From e492ececa5eb2178a121cfe881e57b0399ce2305 Mon Sep 17 00:00:00 2001 From: sumeyye Date: Fri, 25 Jul 2025 11:05:23 +0300 Subject: [PATCH] remove: `AddScriptsToPackageJsonAsync` function that uses redundant ngcc compilation method --- .../AngularSourceCodeAdder.cs | 24 ------------------- 1 file changed, 24 deletions(-) diff --git a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs index ec817d825f..f996247217 100644 --- a/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs +++ b/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs @@ -36,7 +36,6 @@ public class AngularSourceCodeAdder : ITransientDependency await AddPathsToTsConfigAsync(angularPath, angularProjectsPath, projects); await CreateTsConfigProdJsonAsync(angularPath); - await AddScriptsToPackageJsonAsync(angularPath); await AddProjectsToAngularJsonAsync(angularPath, projects); } catch (Exception e) @@ -58,7 +57,6 @@ public class AngularSourceCodeAdder : ITransientDependency await AddPathsToTsConfigAsync(angularPath, angularProjectsPath, projects); await CreateTsConfigProdJsonAsync(angularPath); - await AddScriptsToPackageJsonAsync(angularPath); await AddProjectsToAngularJsonAsync(angularPath, projects); } catch (Exception e) @@ -124,28 +122,6 @@ public class AngularSourceCodeAdder : ITransientDependency File.WriteAllText(angularJsonFilePath, json.ToString(Formatting.Indented)); } - private async Task AddScriptsToPackageJsonAsync(string angularPath) - { - var packageJsonFilePath = Path.Combine(angularPath, "package.json"); - var fileContent = File.ReadAllText(packageJsonFilePath); - - var json = JObject.Parse(fileContent); - - var scriptsJobject = (JObject)json["scripts"]; - - if (scriptsJobject == null || scriptsJobject["postinstall"] != null || - scriptsJobject["compile:ivy"] != null) - { - return; - } - - scriptsJobject["postinstall"] = "npm run compile:ivy"; - scriptsJobject["compile:ivy"] = - "yarn ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points --tsconfig './tsconfig.prod.json' --source node_modules"; - - File.WriteAllText(packageJsonFilePath, json.ToString(Formatting.Indented)); - } - private async Task CreateTsConfigProdJsonAsync(string angularPath) { var tsConfigProdJsonFilePath = Path.Combine(angularPath, "tsconfig.prod.json");