这是indexloc提供的服务,不要输入任何密码
Skip to content

Angular - Cleanup: drop legacy ngcc compiler support #23384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: rel-9.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public async Task AddFromModuleAsync(string solutionFilePath, string angularPath

await AddPathsToTsConfigAsync(angularPath, angularProjectsPath, projects);
await CreateTsConfigProdJsonAsync(angularPath);
await AddScriptsToPackageJsonAsync(angularPath);
await AddProjectsToAngularJsonAsync(angularPath, projects);
}
catch (Exception e)
Expand All @@ -58,7 +57,6 @@ public async Task AddAsync(string angularPath, NpmPackageInfo package)

await AddPathsToTsConfigAsync(angularPath, angularProjectsPath, projects);
await CreateTsConfigProdJsonAsync(angularPath);
await AddScriptsToPackageJsonAsync(angularPath);
await AddProjectsToAngularJsonAsync(angularPath, projects);
}
catch (Exception e)
Expand Down Expand Up @@ -124,28 +122,6 @@ private async Task AddProjectsToAngularJsonAsync(string angularPath, List<string
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");
Expand Down
2 changes: 0 additions & 2 deletions npm/ng-packs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
"workspace-generator": "nx workspace-generator",
"dep-graph": "nx dep-graph",
"help": "nx help",
"compile:ivy": "yarn ngcc --properties es2020 browser module main --first-only --create-ivy-entry-points --tsconfig './tsconfig.prod.json' --source node_modules",
"postinstall2": "node ./decorate-angular-cli.js && yarn compile:ivy",
"build:schematics": "cd scripts && yarn && yarn build:schematics && cd ..",
"dev:schematics": "tsc -p packages/schematics/tsconfig.json -w",
"mock:schematics": "cd scripts/mock-schematic && yarn && yarn start",
Expand Down
3 changes: 0 additions & 3 deletions npm/ng-packs/scripts/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import fse from 'fs-extra';

(async () => {
program.option('-i, --noInstall', 'skip updating package.json and installation', false);
program.option('-c, --skipNgcc', 'skip ngcc', false);

program.parse(process.argv);

Expand Down Expand Up @@ -66,8 +65,6 @@ import fse from 'fs-extra';
],
{ stdout: 'inherit', cwd: '../' },
);

if (!program.skipNgcc) await execa('yarn', ['compile:ivy'], { stdout: 'inherit', cwd: '../' });
} catch (error) {
console.error(error.stderr);
process.exit(1);
Expand Down
1 change: 0 additions & 1 deletion npm/packs/utils/.npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
**/*
!dist/**/*
!abp.resourcemapping.js
!ngcc.config.js
5 changes: 2 additions & 3 deletions npm/packs/utils/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "projects/utils/tsconfig.lib.json",
"project": "projects/utils/ng-package.json"
Expand Down Expand Up @@ -40,6 +40,5 @@
},
"cli": {
"analytics": false
},
"defaultProject": "utils"
}
}
6 changes: 0 additions & 6 deletions npm/packs/utils/ngcc.config.js

This file was deleted.

40 changes: 18 additions & 22 deletions npm/packs/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,36 @@
"directory": "npm/packs/utils"
},
"module": "dist/fesm2015/abp-utils.js",
"es2015_ivy_ngcc": "__ivy_ngcc__/dist/fesm2015/abp-utils.js",
"es2015": "dist/fesm2015/abp-utils.js",
"esm2015": "dist/esm2015/abp-utils.js",
"fesm2015_ivy_ngcc": "__ivy_ngcc__/dist/fesm2015/abp-utils.js",
"fesm2015": "dist/fesm2015/abp-utils.js",
"typings": "dist/abp-utils.d.ts",
"metadata": "dist/abp-utils.metadata.json",
"sideEffects": false,
"devDependencies": {
"@angular-builders/jest": "^9.0.0",
"@angular-devkit/build-ng-packagr": "~0.1000.0",
"@angular/cli": "~10.0.0",
"@angular/common": "~10.0.0",
"@angular/compiler": "~10.0.0",
"@angular/compiler-cli": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@types/execa": "^2.0.0",
"@types/fs-extra": "^8.1.0",
"@types/jest": "^25.1.4",
"@angular-builders/jest": "~20.0.0",
"@angular/cli": "~20.0.0",
"@angular/common": "~20.0.0",
"@angular/compiler": "~20.0.0",
"@angular/compiler-cli": "~20.0.0",
"@angular/core": "~20.0.0",
"@angular/platform-browser": "~20.0.0",
"@angular/platform-browser-dynamic": "~20.0.0",
"@angular-devkit/build-angular": "~20.0.0",
"@types/fs-extra": "~11.0.0",
"@types/jest": "^29.0.0",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"execa": "^4.0.0",
"fs-extra": "^9.0.0",
"jest": "^25.2.4",
"jest-preset-angular": "^8.1.2",
"ng-packagr": "^10.0.0",
"protractor": "^7.0.0",
"execa": "~9.6.0",
"fs-extra": "~9.0.0",
"jest": "^29.0.0",
"jest-preset-angular": "^13.0.0",
"ng-packagr": "~20.0.0",
"ts-node": "~8.3.0",
"tslib": "~2.0.0",
"tslint": "^6.1.0",
"typescript": "~3.9.5",
"zone.js": "~0.10.2"
"typescript": "~5.8.0",
"zone.js": "~0.15.0"
},
"dependencies": {
"just-compare": "^2.3.0"
Expand Down
4 changes: 2 additions & 2 deletions npm/packs/utils/prepublish.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const fse = require('fs-extra');
const execa = require('execa');
const { execaSync } = require('execa');

fse.copyFileSync('./package.json', './projects/utils/package.json');
fse.copyFileSync('./README.md', './projects/utils/README.md');

try {
execa.sync('yarn', ['build'], { stdout: 'inherit' });
execaSync('yarn', ['build'], { stdio: 'inherit' });
process.exit(0);
} catch (error) {
console.error(error);
Expand Down
5 changes: 2 additions & 3 deletions npm/packs/utils/projects/utils/ng-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"dest": "../../dist",
"deleteDestPath": true,
"lib": {
"entryFile": "src/public-api.ts",
"umdId": "abp.utils.common"
"entryFile": "src/public-api.ts"
},
"whitelistedNonPeerDependencies": ["just-compare"]
"allowedNonPeerDependencies": ["just-compare"]
}
5 changes: 1 addition & 4 deletions npm/packs/utils/projects/utils/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}
Loading
Loading