@nx/angular 22.3.0-canary.20251211-205daee → 22.3.0-canary.20251215-e864b6a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/executors.json +5 -0
- package/migrations.json +200 -291
- package/package.json +18 -18
- package/src/builders/dev-server/lib/normalize-options.d.ts.map +1 -1
- package/src/builders/dev-server/lib/normalize-options.js +1 -3
- package/src/builders/dev-server/lib/validate-options.d.ts.map +1 -1
- package/src/builders/dev-server/lib/validate-options.js +6 -5
- package/src/builders/dev-server/schema.d.ts +1 -0
- package/src/builders/dev-server/schema.json +9 -2
- package/src/executors/application/application.impl.js +1 -1
- package/src/executors/application/schema.json +11 -9
- package/src/executors/application/utils/normalize-options.d.ts.map +1 -1
- package/src/executors/application/utils/normalize-options.js +1 -27
- package/src/executors/application/utils/validate-options.d.ts.map +1 -1
- package/src/executors/application/utils/validate-options.js +0 -17
- package/src/executors/browser-esbuild/browser-esbuild.impl.js +1 -1
- package/src/executors/extract-i18n/extract-i18n.impl.js +1 -1
- package/src/executors/unit-test/schema.d.ts +7 -0
- package/src/executors/unit-test/schema.json +320 -0
- package/src/executors/unit-test/unit-test.impl.d.ts +5 -0
- package/src/executors/unit-test/unit-test.impl.d.ts.map +1 -0
- package/src/executors/unit-test/unit-test.impl.js +111 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.d.ts.map +1 -0
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.d.ts.map +1 -1
- package/src/executors/utilities/ng-packagr/stylesheet-processor.di.js +2 -6
- package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.js → stylesheet-processor.js} +2 -2
- package/src/generators/application/application.d.ts +1 -1
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +6 -1
- package/src/generators/application/files/base/tsconfig.app.json__tpl__ +2 -4
- package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
- package/src/generators/application/files/ng-module/src/app/app__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/ng-module/src/main.ts__tpl__ +1 -3
- package/src/generators/application/files/nx-welcome/claimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/claimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/files/nx-welcome/not-configured/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/not-configured/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/files/nx-welcome/unclaimed/ng-module/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +2 -2
- package/src/generators/application/files/nx-welcome/unclaimed/standalone/src/app/nx-welcome__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/files/rspack-ssr/server.ts__tmpl__ +6 -0
- package/src/generators/application/files/standalone-components/src/app/app.config.ts__tpl__ +3 -3
- package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.spec.ts__tpl__ +2 -2
- package/src/generators/application/files/standalone-components/src/app/app__componentFileSuffix__.ts__tpl__ +1 -2
- package/src/generators/application/lib/add-unit-test-runner.d.ts +1 -1
- package/src/generators/application/lib/add-unit-test-runner.d.ts.map +1 -1
- package/src/generators/application/lib/add-unit-test-runner.js +13 -2
- package/src/generators/application/lib/create-files.d.ts.map +1 -1
- package/src/generators/application/lib/create-files.js +1 -3
- package/src/generators/application/lib/create-project.js +12 -10
- package/src/generators/application/lib/enable-strict-type-checking.js +1 -1
- package/src/generators/application/lib/index.d.ts +2 -1
- package/src/generators/application/lib/index.d.ts.map +1 -1
- package/src/generators/application/lib/index.js +2 -1
- package/src/generators/application/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/application/lib/normalize-options.js +12 -2
- package/src/generators/application/lib/update-tsconfig-files.d.ts.map +1 -1
- package/src/generators/application/lib/update-tsconfig-files.js +6 -17
- package/src/generators/application/lib/validate-options.d.ts +4 -0
- package/src/generators/application/lib/validate-options.d.ts.map +1 -0
- package/src/generators/application/lib/validate-options.js +26 -0
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +7 -4
- package/src/generators/component/component.d.ts.map +1 -1
- package/src/generators/component/component.js +4 -3
- package/src/generators/component/files/__fileName__.spec.ts__tpl__ +1 -1
- package/src/generators/component/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/component-test/component-test.d.ts +3 -3
- package/src/generators/component-test/component-test.d.ts.map +1 -1
- package/src/generators/component-test/component-test.js +9 -0
- package/src/generators/component-test/schema.d.ts +1 -0
- package/src/generators/component-test/schema.json +6 -0
- package/src/generators/convert-to-rspack/convert-to-rspack.d.ts.map +1 -1
- package/src/generators/convert-to-rspack/convert-to-rspack.js +1 -4
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +80 -33
- package/src/generators/cypress-component-configuration/schema.d.ts +1 -0
- package/src/generators/cypress-component-configuration/schema.json +6 -0
- package/src/generators/directive/directive.d.ts.map +1 -1
- package/src/generators/directive/directive.js +0 -3
- package/src/generators/directive/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/federate-module/federate-module.d.ts +1 -1
- package/src/generators/federate-module/federate-module.d.ts.map +1 -1
- package/src/generators/federate-module/federate-module.js +8 -0
- package/src/generators/federate-module/lib/add-remote.js +1 -1
- package/src/generators/federate-module/schema.d.ts +2 -2
- package/src/generators/federate-module/schema.json +3 -4
- package/src/generators/host/files/common/src/main.server.ts__tmpl__ +8 -1
- package/src/generators/host/host.d.ts.map +1 -1
- package/src/generators/host/host.js +5 -1
- package/src/generators/host/lib/index.d.ts +1 -0
- package/src/generators/host/lib/index.d.ts.map +1 -1
- package/src/generators/host/lib/index.js +1 -0
- package/src/generators/host/lib/update-ssr-setup.d.ts.map +1 -1
- package/src/generators/host/lib/update-ssr-setup.js +6 -4
- package/src/generators/host/lib/validate-options.d.ts +4 -0
- package/src/generators/host/lib/validate-options.d.ts.map +1 -0
- package/src/generators/host/lib/validate-options.js +12 -0
- package/src/generators/host/schema.d.ts +2 -2
- package/src/generators/host/schema.json +5 -6
- package/src/generators/library/files/base/tsconfig.lib.json__tpl__ +3 -5
- package/src/generators/library/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/library/lib/normalize-options.js +10 -3
- package/src/generators/library/lib/update-tsconfig-files.d.ts.map +1 -1
- package/src/generators/library/lib/update-tsconfig-files.js +15 -6
- package/src/generators/library/lib/validate-options.d.ts +4 -0
- package/src/generators/library/lib/validate-options.d.ts.map +1 -0
- package/src/generators/library/lib/validate-options.js +27 -0
- package/src/generators/library/library.d.ts.map +1 -1
- package/src/generators/library/library.js +20 -13
- package/src/generators/library/schema.json +3 -4
- package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts +16 -0
- package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.d.ts.map +1 -0
- package/src/generators/ng-add/migrators/builders/angular-build-unit-test.migrator.js +161 -0
- package/src/generators/ng-add/migrators/builders/index.d.ts +1 -0
- package/src/generators/ng-add/migrators/builders/index.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/builders/index.js +1 -0
- package/src/generators/ng-add/migrators/projects/app.migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/projects/app.migrator.js +1 -0
- package/src/generators/ng-add/migrators/projects/lib.migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/projects/lib.migrator.js +1 -0
- package/src/generators/pipe/files/__fileName__.ts__tpl__ +1 -1
- package/src/generators/pipe/pipe.d.ts.map +1 -1
- package/src/generators/pipe/pipe.js +0 -5
- package/src/generators/remote/files/common/src/main.server.ts__tmpl__ +8 -1
- package/src/generators/remote/lib/index.d.ts +1 -0
- package/src/generators/remote/lib/index.d.ts.map +1 -1
- package/src/generators/remote/lib/index.js +1 -0
- package/src/generators/remote/lib/update-ssr-setup.d.ts +2 -1
- package/src/generators/remote/lib/update-ssr-setup.d.ts.map +1 -1
- package/src/generators/remote/lib/update-ssr-setup.js +7 -7
- package/src/generators/remote/lib/validate-options.d.ts +4 -0
- package/src/generators/remote/lib/validate-options.d.ts.map +1 -0
- package/src/generators/remote/lib/validate-options.js +12 -0
- package/src/generators/remote/remote.d.ts.map +1 -1
- package/src/generators/remote/remote.js +6 -1
- package/src/generators/remote/schema.d.ts +2 -2
- package/src/generators/remote/schema.json +5 -6
- package/src/generators/scam-to-standalone/lib/convert-scam-to-standalone.js +1 -1
- package/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +2 -2
- package/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +5 -6
- package/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +1 -2
- package/src/generators/setup-mf/lib/add-remote-entry.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/add-remote-entry.js +0 -5
- package/src/generators/setup-mf/lib/update-host-app-routes.d.ts.map +1 -1
- package/src/generators/setup-mf/lib/update-host-app-routes.js +9 -6
- package/src/generators/setup-ssr/files/v20+/application-builder/server/__serverFileName__ +2 -2
- package/src/generators/setup-ssr/files/v20+/server-builder/server/__serverFileName__ +6 -0
- package/src/generators/setup-ssr/lib/add-hydration.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/add-hydration.js +2 -8
- package/src/generators/setup-ssr/lib/add-server-file.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/add-server-file.js +7 -7
- package/src/generators/setup-ssr/lib/generate-files.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/generate-files.js +2 -7
- package/src/generators/setup-ssr/lib/generate-server-ts-config.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/generate-server-ts-config.js +26 -12
- package/src/generators/setup-ssr/lib/normalize-options.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/normalize-options.js +1 -5
- package/src/generators/setup-ssr/lib/update-project-config.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/update-project-config.js +6 -17
- package/src/generators/setup-ssr/lib/validate-options.d.ts.map +1 -1
- package/src/generators/setup-ssr/lib/validate-options.js +9 -0
- package/src/generators/utils/add-jest.d.ts +2 -0
- package/src/generators/utils/add-jest.d.ts.map +1 -1
- package/src/generators/utils/add-jest.js +41 -11
- package/src/generators/utils/add-vitest.d.ts +11 -2
- package/src/generators/utils/add-vitest.d.ts.map +1 -1
- package/src/generators/utils/add-vitest.js +173 -6
- package/src/generators/utils/assert-mf-utils.d.ts +1 -1
- package/src/generators/utils/assert-mf-utils.d.ts.map +1 -1
- package/src/generators/utils/assert-mf-utils.js +1 -4
- package/src/generators/utils/ensure-angular-dependencies.d.ts +1 -1
- package/src/generators/utils/ensure-angular-dependencies.d.ts.map +1 -1
- package/src/generators/utils/ensure-angular-dependencies.js +6 -4
- package/src/generators/utils/storybook-ast/component-info.js +2 -10
- package/src/generators/utils/tsconfig-utils.d.ts +13 -0
- package/src/generators/utils/tsconfig-utils.d.ts.map +1 -0
- package/src/generators/utils/tsconfig-utils.js +29 -0
- package/src/generators/utils/version-utils.d.ts +13 -3
- package/src/generators/utils/version-utils.d.ts.map +1 -1
- package/src/generators/utils/version-utils.js +11 -18
- package/src/migrations/update-21-2-0/update-module-resolution.d.ts.map +1 -1
- package/src/migrations/update-21-2-0/update-module-resolution.js +17 -4
- package/src/migrations/update-22-3-0/update-angular-cli.d.ts +4 -0
- package/src/migrations/update-22-3-0/update-angular-cli.d.ts.map +1 -0
- package/src/migrations/{update-16-4-0 → update-22-3-0}/update-angular-cli.js +1 -1
- package/src/migrations/update-22-3-0/update-module-resolution.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-module-resolution.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-module-resolution.js +61 -0
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.js +111 -0
- package/src/migrations/update-22-3-0/update-typescript-lib.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-typescript-lib.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-typescript-lib.js +98 -0
- package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts +3 -0
- package/src/migrations/update-22-3-0/update-unit-test-runner-option.d.ts.map +1 -0
- package/src/migrations/update-22-3-0/update-unit-test-runner-option.js +44 -0
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +40 -24
- package/src/utils/backward-compatible-versions.d.ts +7 -9
- package/src/utils/backward-compatible-versions.d.ts.map +1 -1
- package/src/utils/backward-compatible-versions.js +20 -14
- package/src/utils/nx-devkit/ast-utils.d.ts.map +1 -1
- package/src/utils/nx-devkit/ast-utils.js +2 -13
- package/src/utils/targets.d.ts +6 -1
- package/src/utils/targets.d.ts.map +1 -1
- package/src/utils/targets.js +20 -3
- package/src/utils/test-runners.d.ts +2 -1
- package/src/utils/test-runners.d.ts.map +1 -1
- package/src/utils/test-runners.js +2 -1
- package/src/utils/version-utils.d.ts +2 -2
- package/src/utils/version-utils.d.ts.map +1 -1
- package/src/utils/version-utils.js +3 -2
- package/src/utils/versions.d.ts +7 -6
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +8 -7
- package/src/utils/zoneless.d.ts +3 -0
- package/src/utils/zoneless.d.ts.map +1 -0
- package/src/utils/zoneless.js +28 -0
- package/{mf/index.d.ts → types/nx-angular-mf.d.ts} +1 -1
- package/types/nx-angular-mf.d.ts.map +1 -0
- package/types/nx-angular.d.ts +3 -0
- package/types/nx-angular.d.ts.map +1 -0
- package/index.d.ts +0 -3
- package/index.d.ts.map +0 -1
- package/mf/index.d.ts.map +0 -1
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts +0 -28
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.d.ts.map +0 -1
- package/src/executors/utilities/ng-packagr/pre-v19/stylesheet-processor.js +0 -159
- package/src/executors/utilities/ng-packagr/v19+/stylesheet-processor.d.ts.map +0 -1
- package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/__main__ +0 -1
- package/src/generators/setup-ssr/files/pre-v19/ngmodule-src/app/__rootModuleFileName__ +0 -14
- package/src/generators/setup-ssr/files/pre-v19/root/tsconfig.server.json__tpl__ +0 -15
- package/src/generators/setup-ssr/files/pre-v19/server/application-builder/__serverFileName__ +0 -57
- package/src/generators/setup-ssr/files/pre-v19/server/server-builder/__serverFileName__ +0 -72
- package/src/generators/setup-ssr/files/pre-v19/standalone-src/__main__ +0 -12
- package/src/generators/setup-ssr/files/pre-v19/standalone-src/app/app.config.server.ts__tpl__ +0 -11
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts +0 -3
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.d.ts.map +0 -1
- package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +0 -122
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts +0 -3
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.d.ts.map +0 -1
- package/src/migrations/update-16-4-0/rename-angular-eslint-accesibility-rules.js +0 -34
- package/src/migrations/update-16-4-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-16-4-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts +0 -3
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.d.ts.map +0 -1
- package/src/migrations/update-16-6-0/explicitly-set-projects-to-update-buildable-deps.js +0 -34
- package/src/migrations/update-16-7-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-16-7-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-16-7-0/update-angular-cli.js +0 -14
- /package/src/executors/utilities/ng-packagr/{v19+/stylesheet-processor.d.ts → stylesheet-processor.d.ts} +0 -0
|
@@ -4,24 +4,37 @@ exports.default = default_1;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const targets_1 = require("../../utils/targets");
|
|
6
6
|
const projects_1 = require("../utils/projects");
|
|
7
|
+
// Common tsconfig file names to account for non-buildable libraries
|
|
8
|
+
const KNOWN_TSCONFIG_FILES = [
|
|
9
|
+
'tsconfig.json',
|
|
10
|
+
'tsconfig.lib.json',
|
|
11
|
+
'tsconfig.spec.json',
|
|
12
|
+
];
|
|
7
13
|
async function default_1(tree) {
|
|
8
14
|
const uniqueTsConfigs = new Set();
|
|
9
15
|
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
10
16
|
'npm:@angular/core',
|
|
11
17
|
]);
|
|
12
18
|
for (const graphNode of projects) {
|
|
19
|
+
const projectRoot = graphNode.data.root;
|
|
20
|
+
// Add existing known tsconfig files
|
|
21
|
+
for (const tsconfigName of KNOWN_TSCONFIG_FILES) {
|
|
22
|
+
const tsconfigPath = (0, devkit_1.joinPathFragments)(projectRoot, tsconfigName);
|
|
23
|
+
if (tree.exists(tsconfigPath)) {
|
|
24
|
+
uniqueTsConfigs.add(tsconfigPath);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
13
27
|
for (const [, target] of (0, targets_1.allProjectTargets)(graphNode.data)) {
|
|
14
28
|
for (const [, options] of (0, targets_1.allTargetOptions)(target)) {
|
|
15
|
-
if (typeof options?.tsConfig === 'string'
|
|
29
|
+
if (typeof options?.tsConfig === 'string' &&
|
|
30
|
+
tree.exists(options.tsConfig)) {
|
|
16
31
|
uniqueTsConfigs.add(options.tsConfig);
|
|
17
32
|
}
|
|
18
33
|
}
|
|
19
34
|
}
|
|
20
35
|
}
|
|
21
36
|
for (const tsConfig of uniqueTsConfigs) {
|
|
22
|
-
|
|
23
|
-
updateModuleResolution(tree, tsConfig);
|
|
24
|
-
}
|
|
37
|
+
updateModuleResolution(tree, tsConfig);
|
|
25
38
|
}
|
|
26
39
|
await (0, devkit_1.formatFiles)(tree);
|
|
27
40
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-22-3-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.angularCliVersion = void 0;
|
|
4
4
|
exports.default = default_1;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
exports.angularCliVersion = '~
|
|
6
|
+
exports.angularCliVersion = '~21.0.0';
|
|
7
7
|
async function default_1(tree) {
|
|
8
8
|
const { devDependencies, dependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
9
|
const hasAngularCli = devDependencies?.['@angular/cli'] || dependencies?.['@angular/cli'];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-module-resolution.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-22-3-0/update-module-resolution.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EAEV,MAAM,YAAY,CAAC;AAoBpB,yBAA+B,IAAI,EAAE,IAAI,iBAuCxC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
6
|
+
const tsconfig_utils_1 = require("../../generators/utils/tsconfig-utils");
|
|
7
|
+
const targets_1 = require("../../utils/targets");
|
|
8
|
+
const projects_1 = require("../utils/projects");
|
|
9
|
+
// Common tsconfig file names to account for non-buildable libraries
|
|
10
|
+
const KNOWN_TSCONFIG_FILES = [
|
|
11
|
+
'tsconfig.json',
|
|
12
|
+
'tsconfig.lib.json',
|
|
13
|
+
'tsconfig.spec.json',
|
|
14
|
+
];
|
|
15
|
+
async function default_1(tree) {
|
|
16
|
+
const uniqueTsConfigs = new Set();
|
|
17
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
18
|
+
'npm:@angular/core',
|
|
19
|
+
]);
|
|
20
|
+
for (const graphNode of projects) {
|
|
21
|
+
const projectRoot = graphNode.data.root;
|
|
22
|
+
// Add existing known tsconfig files
|
|
23
|
+
for (const tsconfigName of KNOWN_TSCONFIG_FILES) {
|
|
24
|
+
const tsconfigPath = (0, devkit_1.joinPathFragments)(projectRoot, tsconfigName);
|
|
25
|
+
if (tree.exists(tsconfigPath)) {
|
|
26
|
+
uniqueTsConfigs.add(tsconfigPath);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
for (const [, target] of (0, targets_1.allProjectTargets)(graphNode.data)) {
|
|
30
|
+
for (const [, options] of (0, targets_1.allTargetOptions)(target)) {
|
|
31
|
+
if (typeof options?.tsConfig === 'string' &&
|
|
32
|
+
tree.exists(options.tsConfig) &&
|
|
33
|
+
// Exclude tsconfig.server.json - handled by update-ssr-webpack-config migration
|
|
34
|
+
!options.tsConfig.endsWith('tsconfig.server.json')) {
|
|
35
|
+
uniqueTsConfigs.add(options.tsConfig);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
for (const tsConfig of uniqueTsConfigs) {
|
|
41
|
+
updateModuleAndModuleResolution(tree, tsConfig);
|
|
42
|
+
}
|
|
43
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
44
|
+
}
|
|
45
|
+
function updateModuleAndModuleResolution(tree, tsConfigPath) {
|
|
46
|
+
const ts = (0, ensure_typescript_1.ensureTypescript)();
|
|
47
|
+
// Read the resolved compiler options from the tsconfig
|
|
48
|
+
const compilerOptions = (0, tsconfig_utils_1.readCompilerOptionsFromTsConfig)(tree, tsConfigPath);
|
|
49
|
+
// Check if both module and moduleResolution are already set correctly
|
|
50
|
+
if (compilerOptions.module === ts.ModuleKind.Preserve &&
|
|
51
|
+
compilerOptions.moduleResolution === ts.ModuleResolutionKind.Bundler) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// Ensure both module and moduleResolution are set to the correct values
|
|
55
|
+
(0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
|
|
56
|
+
json.compilerOptions ??= {};
|
|
57
|
+
json.compilerOptions.module = 'preserve';
|
|
58
|
+
json.compilerOptions.moduleResolution = 'bundler';
|
|
59
|
+
return json;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-ssr-webpack-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-22-3-0/update-ssr-webpack-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EAEV,MAAM,YAAY,CAAC;AAqBpB,yBAA+B,IAAI,EAAE,IAAI,iBAoExC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
6
|
+
const tsconfig_utils_1 = require("../../generators/utils/tsconfig-utils");
|
|
7
|
+
const file_change_recorder_1 = require("../../utils/file-change-recorder");
|
|
8
|
+
const targets_1 = require("../../utils/targets");
|
|
9
|
+
const projects_1 = require("../utils/projects");
|
|
10
|
+
const serverExecutors = new Set([
|
|
11
|
+
'@angular-devkit/build-angular:server',
|
|
12
|
+
'@nx/angular:webpack-server',
|
|
13
|
+
]);
|
|
14
|
+
let ts;
|
|
15
|
+
async function default_1(tree) {
|
|
16
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
17
|
+
'npm:@angular/ssr',
|
|
18
|
+
]);
|
|
19
|
+
// Map project root → {tsConfigPath, serverFiles[]}
|
|
20
|
+
const projectFilesMap = new Map();
|
|
21
|
+
// First pass: collect files grouped by project
|
|
22
|
+
for (const { data: project } of projects) {
|
|
23
|
+
if (project.projectType !== 'application') {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
for (const target of Object.values(project.targets ?? {})) {
|
|
27
|
+
if (!serverExecutors.has(target.executor)) {
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const tsConfigServerPath = (0, devkit_1.joinPathFragments)(project.root, 'tsconfig.server.json');
|
|
31
|
+
if (!tree.exists(tsConfigServerPath)) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
// Get or create entry for this project
|
|
35
|
+
let projectEntry = projectFilesMap.get(project.root);
|
|
36
|
+
if (!projectEntry) {
|
|
37
|
+
projectEntry = {
|
|
38
|
+
tsConfigPath: tsConfigServerPath,
|
|
39
|
+
serverFiles: new Set(),
|
|
40
|
+
};
|
|
41
|
+
projectFilesMap.set(project.root, projectEntry);
|
|
42
|
+
}
|
|
43
|
+
// Collect server files for this project
|
|
44
|
+
for (const [, options] of (0, targets_1.allTargetOptions)(target)) {
|
|
45
|
+
if (options?.main && tree.exists(options.main)) {
|
|
46
|
+
projectEntry.serverFiles.add(options.main);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (projectFilesMap.size === 0) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// Second pass: process each project
|
|
55
|
+
ts = (0, ensure_typescript_1.ensureTypescript)();
|
|
56
|
+
for (const { tsConfigPath, serverFiles } of projectFilesMap.values()) {
|
|
57
|
+
const wasUpdated = updateTsConfigServer(tree, tsConfigPath);
|
|
58
|
+
// Only update server files if tsconfig was actually modified
|
|
59
|
+
if (wasUpdated) {
|
|
60
|
+
for (const serverFile of serverFiles) {
|
|
61
|
+
updateServerImports(tree, serverFile);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
66
|
+
}
|
|
67
|
+
function updateTsConfigServer(tree, tsConfigPath) {
|
|
68
|
+
const compilerOptions = (0, tsconfig_utils_1.readCompilerOptionsFromTsConfig)(tree, tsConfigPath);
|
|
69
|
+
if (compilerOptions.module === ts.ModuleKind.Preserve &&
|
|
70
|
+
compilerOptions.moduleResolution === ts.ModuleResolutionKind.Bundler) {
|
|
71
|
+
// Already configured correctly, skip
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
(0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
|
|
75
|
+
json.compilerOptions ??= {};
|
|
76
|
+
json.compilerOptions.module = 'preserve';
|
|
77
|
+
json.compilerOptions.moduleResolution = 'bundler';
|
|
78
|
+
return json;
|
|
79
|
+
});
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
82
|
+
function updateServerImports(tree, serverFilePath) {
|
|
83
|
+
const content = tree.read(serverFilePath, 'utf-8');
|
|
84
|
+
const sourceFile = ts.createSourceFile(serverFilePath, content, ts.ScriptTarget.Latest, true);
|
|
85
|
+
const allImportDeclarations = sourceFile.statements.filter(ts.isImportDeclaration);
|
|
86
|
+
if (allImportDeclarations.length === 0) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
let recorder;
|
|
90
|
+
// Find namespace imports (import * as X from 'Y')
|
|
91
|
+
for (const importDecl of allImportDeclarations) {
|
|
92
|
+
if (!ts.isStringLiteral(importDecl.moduleSpecifier)) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const namedBindings = importDecl.importClause?.namedBindings;
|
|
96
|
+
// Check if this is a namespace import (import * as X) and there's no
|
|
97
|
+
// default import (e.g., "import express, * as types from 'express'")
|
|
98
|
+
if (namedBindings &&
|
|
99
|
+
ts.isNamespaceImport(namedBindings) &&
|
|
100
|
+
!importDecl.importClause?.name) {
|
|
101
|
+
const importName = namedBindings.name.text;
|
|
102
|
+
const moduleSpecifier = importDecl.moduleSpecifier.text;
|
|
103
|
+
recorder ??= new file_change_recorder_1.FileChangeRecorder(tree, serverFilePath);
|
|
104
|
+
// import * as express from 'express' -> import express from 'express'
|
|
105
|
+
recorder.replace(importDecl, `import ${importName} from '${moduleSpecifier}';`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (recorder) {
|
|
109
|
+
recorder.applyChanges();
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-typescript-lib.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-22-3-0/update-typescript-lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EAEV,MAAM,YAAY,CAAC;AAkBpB,yBAA+B,IAAI,EAAE,IAAI,iBAqCxC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const tsconfig_utils_1 = require("../../generators/utils/tsconfig-utils");
|
|
6
|
+
const targets_1 = require("../../utils/targets");
|
|
7
|
+
const projects_1 = require("../utils/projects");
|
|
8
|
+
// Common tsconfig file names to account for non-buildable libraries
|
|
9
|
+
const KNOWN_TSCONFIG_FILES = [
|
|
10
|
+
'tsconfig.json',
|
|
11
|
+
'tsconfig.lib.json',
|
|
12
|
+
'tsconfig.spec.json',
|
|
13
|
+
];
|
|
14
|
+
async function default_1(tree) {
|
|
15
|
+
const uniqueTsConfigs = new Set();
|
|
16
|
+
const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
|
|
17
|
+
'npm:@angular/core',
|
|
18
|
+
]);
|
|
19
|
+
for (const graphNode of projects) {
|
|
20
|
+
const projectRoot = graphNode.data.root;
|
|
21
|
+
// Add existing known tsconfig files
|
|
22
|
+
for (const tsconfigName of KNOWN_TSCONFIG_FILES) {
|
|
23
|
+
const tsconfigPath = (0, devkit_1.joinPathFragments)(projectRoot, tsconfigName);
|
|
24
|
+
if (tree.exists(tsconfigPath)) {
|
|
25
|
+
uniqueTsConfigs.add(tsconfigPath);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
for (const [, target] of (0, targets_1.allProjectTargets)(graphNode.data)) {
|
|
29
|
+
for (const [, options] of (0, targets_1.allTargetOptions)(target)) {
|
|
30
|
+
if (typeof options?.tsConfig === 'string' &&
|
|
31
|
+
tree.exists(options.tsConfig)) {
|
|
32
|
+
uniqueTsConfigs.add(options.tsConfig);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
for (const tsConfig of uniqueTsConfigs) {
|
|
38
|
+
updateTypeScriptLib(tree, tsConfig);
|
|
39
|
+
}
|
|
40
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
41
|
+
}
|
|
42
|
+
function updateTypeScriptLib(tree, tsConfigPath) {
|
|
43
|
+
// Read resolved compiler options (includes extends chain)
|
|
44
|
+
const { lib: resolvedLib } = (0, tsconfig_utils_1.readCompilerOptionsFromTsConfig)(tree, tsConfigPath);
|
|
45
|
+
// Check if already correct
|
|
46
|
+
if (!resolvedLib || !Array.isArray(resolvedLib)) {
|
|
47
|
+
return; // No lib to update
|
|
48
|
+
}
|
|
49
|
+
// Normalize lib entries from TypeScript's full format (e.g., 'lib.es2020.d.ts')
|
|
50
|
+
const normalizedResolvedLib = resolvedLib.map((l) => typeof l === 'string' ? normalizeLibEntry(l) : l);
|
|
51
|
+
const esLibs = normalizedResolvedLib.filter((l) => typeof l === 'string' && l.toLowerCase().startsWith('es'));
|
|
52
|
+
if (esLibs.length === 0) {
|
|
53
|
+
return; // No ES libs to update
|
|
54
|
+
}
|
|
55
|
+
const esLibToVersion = new Map();
|
|
56
|
+
for (const l of esLibs) {
|
|
57
|
+
const version = l.toLowerCase().match(/^es(next|(\d+))$/)?.[1];
|
|
58
|
+
if (version) {
|
|
59
|
+
// Use lowercase key for case-insensitive comparison
|
|
60
|
+
esLibToVersion.set(l.toLowerCase(), version === 'next' ? Infinity : Number(version));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (esLibToVersion.size === 0) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const latestVersion = Math.max(...esLibToVersion.values());
|
|
67
|
+
// Only upgrade if ES version is strictly less than 2022
|
|
68
|
+
if (latestVersion < 2022) {
|
|
69
|
+
(0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
|
|
70
|
+
json.compilerOptions ??= {};
|
|
71
|
+
const directLib = json.compilerOptions.lib;
|
|
72
|
+
const sourceLib = directLib && Array.isArray(directLib)
|
|
73
|
+
? directLib
|
|
74
|
+
: normalizedResolvedLib;
|
|
75
|
+
// Filter out old ES versions (case-insensitive) and add ES2022
|
|
76
|
+
const otherLibs = sourceLib.filter((l) => {
|
|
77
|
+
if (typeof l === 'string') {
|
|
78
|
+
return !esLibToVersion.has(l.toLowerCase());
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
});
|
|
82
|
+
json.compilerOptions.lib = [...otherLibs, 'es2022'];
|
|
83
|
+
return json;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Normalize lib entry from TypeScript's full format (e.g., 'lib.es2020.d.ts')
|
|
89
|
+
* to the shorthand format (e.g., 'es2020')
|
|
90
|
+
*/
|
|
91
|
+
function normalizeLibEntry(lib) {
|
|
92
|
+
// TypeScript's parseJsonConfigFileContent returns full lib file names like 'lib.es2020.d.ts'
|
|
93
|
+
// We need to extract just 'es2020' from it
|
|
94
|
+
if (lib.startsWith('lib.') && lib.endsWith('.d.ts')) {
|
|
95
|
+
return lib.slice(4, -5); // Remove 'lib.' prefix and '.d.ts' suffix
|
|
96
|
+
}
|
|
97
|
+
return lib;
|
|
98
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-unit-test-runner-option.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-22-3-0/update-unit-test-runner-option.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAU9E,yBAA+B,IAAI,EAAE,IAAI,iBAkBxC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const ANGULAR_GENERATORS = [
|
|
6
|
+
'application',
|
|
7
|
+
'library',
|
|
8
|
+
'host',
|
|
9
|
+
'remote',
|
|
10
|
+
'federate-module',
|
|
11
|
+
];
|
|
12
|
+
async function default_1(tree) {
|
|
13
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
14
|
+
if (!nxJson?.generators) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let updated = false;
|
|
18
|
+
for (const generator of ANGULAR_GENERATORS) {
|
|
19
|
+
if (updateGeneratorDefault(nxJson.generators, '@nx/angular', generator)) {
|
|
20
|
+
updated = true;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
if (updated) {
|
|
24
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
25
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function updateGeneratorDefault(generators, collection, generator) {
|
|
29
|
+
const generatorKey = `${collection}:${generator}`;
|
|
30
|
+
// Check "@nx/angular:application" format
|
|
31
|
+
const flatConfig = generators[generatorKey];
|
|
32
|
+
if (flatConfig?.unitTestRunner === 'vitest') {
|
|
33
|
+
flatConfig.unitTestRunner = 'vitest-analog';
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
// Check { "@nx/angular": { "application": {...} } } format
|
|
37
|
+
const nestedConfig = generators[collection];
|
|
38
|
+
const generatorConfig = nestedConfig?.[generator];
|
|
39
|
+
if (generatorConfig?.unitTestRunner === 'vitest') {
|
|
40
|
+
generatorConfig.unitTestRunner = 'vitest-analog';
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAWpB,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAOD,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACrC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG;IACxC,WAAW,EAAE,aAAa,GAAG,SAAS,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC;CACtD,CAAC;AAkDF,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,oBAAoB,CAqB7D,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -11,6 +11,7 @@ const node_path_1 = require("node:path");
|
|
|
11
11
|
const posix = tslib_1.__importStar(require("node:path/posix"));
|
|
12
12
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
13
13
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
14
|
+
const targets_1 = require("../utils/targets");
|
|
14
15
|
const knownExecutors = {
|
|
15
16
|
appShell: new Set(['@angular-devkit/build-angular:app-shell']),
|
|
16
17
|
build: new Set([
|
|
@@ -41,6 +42,7 @@ const knownExecutors = {
|
|
|
41
42
|
test: new Set([
|
|
42
43
|
'@angular-devkit/build-angular:karma',
|
|
43
44
|
'@angular/build:karma',
|
|
45
|
+
'@angular/build:unit-test',
|
|
44
46
|
]),
|
|
45
47
|
};
|
|
46
48
|
const pmc = (0, devkit_1.getPackageManagerCommand)();
|
|
@@ -132,7 +134,7 @@ async function buildAngularProjects(configFilePath, options, angularWorkspaceRoo
|
|
|
132
134
|
};
|
|
133
135
|
}
|
|
134
136
|
else if (knownExecutors.test.has(angularTarget.builder)) {
|
|
135
|
-
updateTestTarget(targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs, externalDependencies);
|
|
137
|
+
updateTestTarget(projectName, targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs, externalDependencies);
|
|
136
138
|
}
|
|
137
139
|
else if (knownExecutors.server.has(angularTarget.builder)) {
|
|
138
140
|
updateServerTarget(targets[nxTargetName], angularTarget, context, angularWorkspaceRoot, project.root, namedInputs);
|
|
@@ -236,15 +238,31 @@ async function updateBuildTarget(projectName, targetName, target, angularTarget,
|
|
|
236
238
|
target.metadata.help.example.options = { localize: true };
|
|
237
239
|
}
|
|
238
240
|
}
|
|
239
|
-
function updateTestTarget(target, angularTarget, context, angularWorkspaceRoot, projectRoot, namedInputs, externalDependencies) {
|
|
241
|
+
function updateTestTarget(projectName, target, angularTarget, context, angularWorkspaceRoot, projectRoot, namedInputs, externalDependencies) {
|
|
240
242
|
target.cache = true;
|
|
241
243
|
target.inputs =
|
|
242
244
|
'production' in namedInputs
|
|
243
245
|
? ['default', '^production']
|
|
244
246
|
: ['default', '^default'];
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
247
|
+
const isKarmaRunner = angularTarget.builder === '@angular-devkit/build-angular:karma' ||
|
|
248
|
+
angularTarget.builder === '@angular/build:karma' ||
|
|
249
|
+
angularTarget.options?.runner === 'karma';
|
|
250
|
+
if (isKarmaRunner) {
|
|
251
|
+
target.outputs = getKarmaTargetOutputs(angularTarget, angularWorkspaceRoot, projectRoot, context);
|
|
252
|
+
externalDependencies.push('karma');
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
externalDependencies.push('vitest');
|
|
256
|
+
// this is currently hard-coded in the vitest executor
|
|
257
|
+
// https://github.com/angular/angular-cli/blob/5cc8c8479a3f6959f2834145b5163ef2245c2f31/packages/angular/build/src/builders/unit-test/runners/vitest/plugins.ts#L280
|
|
258
|
+
target.outputs = [`{workspaceRoot}/coverage/${projectName}`];
|
|
259
|
+
}
|
|
260
|
+
if (angularTarget.builder === '@angular/build:unit-test') {
|
|
261
|
+
target.metadata.help.example.options = { coverage: true };
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
target.metadata.help.example.options = { codeCoverage: true };
|
|
265
|
+
}
|
|
248
266
|
}
|
|
249
267
|
function updateServerTarget(target, angularTarget, context, angularWorkspaceRoot, projectRoot, namedInputs) {
|
|
250
268
|
target.metadata.help.example.options = { localize: true };
|
|
@@ -321,13 +339,25 @@ async function getNgPackagrOutputs(target, angularWorkspaceRoot, projectRoot, co
|
|
|
321
339
|
}
|
|
322
340
|
function getKarmaTargetOutputs(target, angularWorkspaceRoot, projectRoot, context) {
|
|
323
341
|
const defaultOutput = posix.join('{workspaceRoot}', angularWorkspaceRoot, 'coverage/{projectName}');
|
|
324
|
-
|
|
342
|
+
let karmaConfigPath;
|
|
343
|
+
if (target.builder === '@angular/build:unit-test') {
|
|
344
|
+
karmaConfigPath =
|
|
345
|
+
typeof target.options?.runnerConfig === 'string'
|
|
346
|
+
? target.options?.runnerConfig
|
|
347
|
+
: target.options?.runnerConfig === true
|
|
348
|
+
? 'karma.conf.js'
|
|
349
|
+
: undefined;
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
karmaConfigPath = target.options?.karmaConfig;
|
|
353
|
+
}
|
|
354
|
+
if (!karmaConfigPath) {
|
|
325
355
|
return [defaultOutput];
|
|
326
356
|
}
|
|
327
357
|
try {
|
|
328
358
|
const { parseConfig } = require('karma/lib/config');
|
|
329
|
-
const
|
|
330
|
-
const config = parseConfig(
|
|
359
|
+
const karmaConfigFullPath = (0, node_path_1.join)(context.workspaceRoot, angularWorkspaceRoot, projectRoot, karmaConfigPath);
|
|
360
|
+
const config = parseConfig(karmaConfigFullPath);
|
|
331
361
|
if (config.coverageReporter.dir) {
|
|
332
362
|
return [
|
|
333
363
|
getOutput(config.coverageReporter.dir, context.workspaceRoot, angularWorkspaceRoot, projectRoot),
|
|
@@ -370,14 +400,14 @@ function extractBrowserAndServerTargets(angularJson, projectName, targetName) {
|
|
|
370
400
|
browserTargetSpecifier = configuration?.browserTarget;
|
|
371
401
|
}
|
|
372
402
|
if (browserTargetSpecifier) {
|
|
373
|
-
browserTarget = targetFromTargetString(browserTargetSpecifier, projectName, targetName);
|
|
403
|
+
browserTarget = (0, targets_1.targetFromTargetString)(browserTargetSpecifier, projectName, targetName);
|
|
374
404
|
}
|
|
375
405
|
let serverTargetSpecifier = target.options?.serverTarget;
|
|
376
406
|
if (!serverTargetSpecifier) {
|
|
377
407
|
serverTargetSpecifier = Object.values(target.configurations ?? {}).find((config) => !!config.serverTarget)?.serverTarget;
|
|
378
408
|
}
|
|
379
409
|
if (serverTargetSpecifier) {
|
|
380
|
-
serverTarget = targetFromTargetString(serverTargetSpecifier, projectName, targetName);
|
|
410
|
+
serverTarget = (0, targets_1.targetFromTargetString)(serverTargetSpecifier, projectName, targetName);
|
|
381
411
|
}
|
|
382
412
|
}
|
|
383
413
|
catch { }
|
|
@@ -404,20 +434,6 @@ function mergeInputs(...inputs) {
|
|
|
404
434
|
: []),
|
|
405
435
|
];
|
|
406
436
|
}
|
|
407
|
-
// angular support abbreviated target specifiers, this is adapter from:
|
|
408
|
-
// https://github.com/angular/angular-cli/blob/7d9ce246a33c60ec96eb4bf99520f5475716a910/packages/angular_devkit/architect/src/api.ts#L336
|
|
409
|
-
function targetFromTargetString(specifier, abbreviatedProjectName, abbreviatedTargetName) {
|
|
410
|
-
const tuple = specifier.split(':', 3);
|
|
411
|
-
if (tuple.length < 2) {
|
|
412
|
-
// invalid target, ignore
|
|
413
|
-
return undefined;
|
|
414
|
-
}
|
|
415
|
-
// we only care about project and target
|
|
416
|
-
return {
|
|
417
|
-
project: tuple[0] || abbreviatedProjectName || '',
|
|
418
|
-
target: tuple[1] || abbreviatedTargetName || '',
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
437
|
function getOutput(path, workspaceRoot, angularWorkspaceRoot, projectRoot) {
|
|
422
438
|
const relativePath = (0, node_path_1.relative)((0, node_path_1.join)(workspaceRoot, angularWorkspaceRoot, projectRoot), path);
|
|
423
439
|
if (relativePath.startsWith('..')) {
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import * as latestVersions from './versions';
|
|
2
|
-
|
|
3
|
-
type
|
|
4
|
-
type
|
|
5
|
-
export type PackageVersionNames = LatestPackageVersionNames | CompatPackageVersionNames;
|
|
2
|
+
export declare const supportedVersions: readonly [21, 20, 19];
|
|
3
|
+
export type SupportedVersion = (typeof supportedVersions)[number];
|
|
4
|
+
export type PackageVersionNames = Exclude<keyof typeof latestVersions, 'nxVersion'>;
|
|
6
5
|
export type VersionMap = {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
21: Record<PackageVersionNames, string>;
|
|
7
|
+
20: Record<PackageVersionNames, string>;
|
|
8
|
+
19: Record<PackageVersionNames | 'angularRspackVersion', string>;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
11
|
-
export type PackageCompatVersions = VersionMap[SupportedVersions];
|
|
10
|
+
export type PackageCompatVersions = VersionMap[SupportedVersion];
|
|
12
11
|
export declare const backwardCompatibleVersions: VersionMap;
|
|
13
|
-
export {};
|
|
14
12
|
//# sourceMappingURL=backward-compatible-versions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backward-compatible-versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/backward-compatible-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC;AAE7C,
|
|
1
|
+
{"version":3,"file":"backward-compatible-versions.d.ts","sourceRoot":"","sources":["../../../../../packages/angular/src/utils/backward-compatible-versions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,YAAY,CAAC;AAE7C,eAAO,MAAM,iBAAiB,uBAAwB,CAAC;AACvD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,MAAM,OAAO,cAAc,EAC3B,WAAW,CACZ,CAAC;AACF,MAAM,MAAM,UAAU,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAAC,CAAC;IACxC,EAAE,EAAE,MAAM,CAAC,mBAAmB,GAAG,sBAAsB,EAAE,MAAM,CAAC,CAAC;CAClE,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,gBAAgB,CAAC,CAAC;AAEjE,eAAO,MAAM,0BAA0B,EAAE,UAiExC,CAAC"}
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.backwardCompatibleVersions = void 0;
|
|
3
|
+
exports.backwardCompatibleVersions = exports.supportedVersions = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const latestVersions = tslib_1.__importStar(require("./versions"));
|
|
6
|
+
exports.supportedVersions = [21, 20, 19];
|
|
4
7
|
exports.backwardCompatibleVersions = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
21: { ...latestVersions },
|
|
9
|
+
20: {
|
|
10
|
+
angularVersion: '~20.3.0',
|
|
11
|
+
angularDevkitVersion: '~20.3.0',
|
|
12
|
+
ngPackagrVersion: '~20.3.0',
|
|
13
|
+
ngrxVersion: '^20.0.0',
|
|
10
14
|
rxjsVersion: '~7.8.0',
|
|
11
|
-
zoneJsVersion: '~0.
|
|
12
|
-
angularJsVersion: '1.7.9',
|
|
15
|
+
zoneJsVersion: '~0.15.0',
|
|
13
16
|
tsLibVersion: '^2.3.0',
|
|
14
17
|
corsVersion: '~2.8.5',
|
|
15
18
|
typesCorsVersion: '~2.8.5',
|
|
16
19
|
expressVersion: '^4.21.2',
|
|
17
20
|
typesExpressVersion: '^4.17.21',
|
|
18
21
|
browserSyncVersion: '^3.0.0',
|
|
19
|
-
moduleFederationNodeVersion: '
|
|
20
|
-
moduleFederationEnhancedVersion: '0.
|
|
21
|
-
angularEslintVersion: '^
|
|
22
|
+
moduleFederationNodeVersion: '^2.7.21',
|
|
23
|
+
moduleFederationEnhancedVersion: '^0.21.2',
|
|
24
|
+
angularEslintVersion: '^20.3.0',
|
|
22
25
|
typescriptEslintVersion: '^7.16.0',
|
|
23
26
|
tailwindVersion: '^3.0.2',
|
|
24
27
|
postcssVersion: '^8.4.5',
|
|
@@ -26,13 +29,15 @@ exports.backwardCompatibleVersions = {
|
|
|
26
29
|
autoprefixerVersion: '^10.4.0',
|
|
27
30
|
tsNodeVersion: '10.9.1',
|
|
28
31
|
lessVersion: '^4.3.0',
|
|
29
|
-
jestPresetAngularVersion: '~14.1
|
|
32
|
+
jestPresetAngularVersion: '~14.6.1',
|
|
30
33
|
typesNodeVersion: '20.19.9',
|
|
31
34
|
jasmineMarblesVersion: '^0.9.2',
|
|
32
35
|
jsoncEslintParserVersion: '^2.1.0',
|
|
33
36
|
webpackMergeVersion: '^5.8.0',
|
|
37
|
+
vitestVersion: '^3.1.1',
|
|
38
|
+
jsdomVersion: '~22.1.0',
|
|
34
39
|
},
|
|
35
|
-
|
|
40
|
+
19: {
|
|
36
41
|
angularVersion: '~19.2.0',
|
|
37
42
|
angularDevkitVersion: '~19.2.0',
|
|
38
43
|
ngPackagrVersion: '~19.2.0',
|
|
@@ -40,7 +45,6 @@ exports.backwardCompatibleVersions = {
|
|
|
40
45
|
ngrxVersion: '~19.1.0',
|
|
41
46
|
rxjsVersion: '~7.8.0',
|
|
42
47
|
zoneJsVersion: '~0.15.0',
|
|
43
|
-
angularJsVersion: '1.7.9',
|
|
44
48
|
tsLibVersion: '^2.3.0',
|
|
45
49
|
corsVersion: '~2.8.5',
|
|
46
50
|
typesCorsVersion: '~2.8.5',
|
|
@@ -62,5 +66,7 @@ exports.backwardCompatibleVersions = {
|
|
|
62
66
|
jasmineMarblesVersion: '^0.9.2',
|
|
63
67
|
jsoncEslintParserVersion: '^2.1.0',
|
|
64
68
|
webpackMergeVersion: '^5.8.0',
|
|
69
|
+
vitestVersion: '^3.1.1',
|
|
70
|
+
jsdomVersion: '~22.1.0',
|
|
65
71
|
},
|
|
66
72
|
};
|