Browse Source

Merge pull request #23384 from abpframework/issue/remove-deprecated-view-engine

Angular - Cleanup: drop legacy ngcc compiler support
pull/23411/head
oykuermann 6 months ago
committed by GitHub
parent
commit
c4aa9cfc3e
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 24
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/AngularSourceCodeAdder.cs
  2. 2
      npm/ng-packs/package.json
  3. 3
      npm/ng-packs/scripts/build.ts
  4. 1
      npm/packs/utils/.npmignore
  5. 5
      npm/packs/utils/angular.json
  6. 6
      npm/packs/utils/ngcc.config.js
  7. 40
      npm/packs/utils/package.json
  8. 4
      npm/packs/utils/prepublish.js
  9. 5
      npm/packs/utils/projects/utils/ng-package.json
  10. 5
      npm/packs/utils/projects/utils/tsconfig.lib.json
  11. 12274
      npm/packs/utils/yarn.lock

24
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");

2
npm/ng-packs/package.json

@ -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",

3
npm/ng-packs/scripts/build.ts

@ -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);
@ -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);

1
npm/packs/utils/.npmignore

@ -1,4 +1,3 @@
**/*
!dist/**/*
!abp.resourcemapping.js
!ngcc.config.js

5
npm/packs/utils/angular.json

@ -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"
@ -40,6 +40,5 @@
},
"cli": {
"analytics": false
},
"defaultProject": "utils"
}
}

6
npm/packs/utils/ngcc.config.js

@ -1,6 +0,0 @@
module.exports = {
entryPoints: {
'.': { ignore: true },
'./dist': {},
},
};

40
npm/packs/utils/package.json

@ -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"

4
npm/packs/utils/prepublish.js

@ -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);

5
npm/packs/utils/projects/utils/ng-package.json

@ -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
npm/packs/utils/projects/utils/tsconfig.lib.json

@ -9,10 +9,7 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true,
"enableIvy": false
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

12274
npm/packs/utils/yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save