@nx/angular 21.0.0-canary.20250206-8bd0bcd → 21.0.0-canary.20250418-8619c1d

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.
Files changed (115) hide show
  1. package/fesm2022/nx-angular.mjs +0 -352
  2. package/fesm2022/nx-angular.mjs.map +1 -1
  3. package/generators.json +7 -2
  4. package/index.d.ts +1 -1
  5. package/migrations.json +199 -69
  6. package/ng-package.json +1 -1
  7. package/package.json +11 -14
  8. package/src/builders/dev-server/dev-server.impl.js +2 -3
  9. package/src/builders/dev-server/lib/normalize-options.js +1 -0
  10. package/src/builders/dev-server/schema.d.ts +4 -0
  11. package/src/builders/dev-server/schema.json +9 -4
  12. package/src/builders/webpack-browser/schema.d.ts +1 -4
  13. package/src/builders/webpack-browser/schema.json +5 -0
  14. package/src/builders/webpack-browser/webpack-browser.impl.js +5 -5
  15. package/src/executors/delegate-build/delegate-build.impl.d.ts +1 -3
  16. package/src/executors/delegate-build/delegate-build.impl.js +0 -3
  17. package/src/executors/module-federation-dev-server/schema.d.ts +3 -0
  18. package/src/executors/module-federation-dev-server/schema.json +1 -1
  19. package/src/executors/package/package.impl.js +1 -4
  20. package/src/generators/add-linting/add-linting.js +1 -16
  21. package/src/generators/add-linting/lib/create-eslint-configuration.d.ts +2 -2
  22. package/src/generators/add-linting/lib/create-eslint-configuration.js +2 -2
  23. package/src/generators/add-linting/schema.d.ts +1 -0
  24. package/src/generators/application/application.js +20 -1
  25. package/src/generators/application/files/rspack-ssr/server.ts__tmpl__ +72 -0
  26. package/src/generators/application/lib/add-e2e.js +2 -9
  27. package/src/generators/application/lib/add-linting.js +1 -0
  28. package/src/generators/application/lib/add-serve-static-target.js +1 -0
  29. package/src/generators/application/lib/add-unit-test-runner.js +2 -0
  30. package/src/generators/application/lib/create-project.js +1 -0
  31. package/src/generators/application/lib/normalize-options.d.ts +1 -1
  32. package/src/generators/application/lib/normalize-options.js +9 -2
  33. package/src/generators/application/schema.d.ts +2 -2
  34. package/src/generators/application/schema.json +1 -7
  35. package/src/generators/component-test/component-test.js +1 -1
  36. package/src/generators/convert-to-rspack/convert-to-rspack.d.ts +4 -0
  37. package/src/generators/convert-to-rspack/convert-to-rspack.js +314 -0
  38. package/src/generators/convert-to-rspack/lib/create-config.d.ts +2 -0
  39. package/src/generators/convert-to-rspack/lib/create-config.js +48 -0
  40. package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +6 -0
  41. package/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +75 -0
  42. package/src/generators/convert-to-rspack/lib/update-tsconfig.d.ts +2 -0
  43. package/src/generators/convert-to-rspack/lib/update-tsconfig.js +26 -0
  44. package/src/generators/convert-to-rspack/lib/validate-supported-executor.d.ts +2 -0
  45. package/src/generators/convert-to-rspack/lib/validate-supported-executor.js +14 -0
  46. package/src/generators/convert-to-rspack/schema.d.ts +5 -0
  47. package/src/generators/convert-to-rspack/schema.json +30 -0
  48. package/src/generators/host/host.js +1 -1
  49. package/src/generators/host/schema.d.ts +0 -1
  50. package/src/generators/host/schema.json +0 -6
  51. package/src/generators/library/lib/add-project.d.ts +1 -1
  52. package/src/generators/library/lib/add-project.js +7 -1
  53. package/src/generators/library/lib/normalize-options.js +1 -1
  54. package/src/generators/library/lib/normalized-schema.d.ts +0 -1
  55. package/src/generators/library/library.js +5 -1
  56. package/src/generators/library/schema.d.ts +0 -1
  57. package/src/generators/library/schema.json +0 -6
  58. package/src/generators/move/move.d.ts +3 -0
  59. package/src/generators/move/move.js +3 -0
  60. package/src/generators/ng-add/migrators/projects/e2e.migrator.js +2 -2
  61. package/src/generators/ngrx/ngrx.d.ts +3 -0
  62. package/src/generators/ngrx/ngrx.js +3 -0
  63. package/src/generators/ngrx/schema.json +1 -1
  64. package/src/generators/ngrx-feature-store/schema.d.ts +1 -1
  65. package/src/generators/remote/remote.js +1 -1
  66. package/src/generators/remote/schema.d.ts +0 -1
  67. package/src/generators/remote/schema.json +0 -6
  68. package/src/generators/setup-mf/lib/setup-serve-target.js +1 -0
  69. package/src/generators/setup-ssr/files/v19+/application-builder/ngmodule-src/app/__rootModuleFileName__ +2 -2
  70. package/src/generators/setup-ssr/files/v19+/application-builder/server/__serverFileName__ +1 -1
  71. package/src/generators/setup-ssr/files/v19+/application-builder/standalone-src/app/app.config.server.ts__tpl__ +2 -2
  72. package/src/generators/setup-ssr/files/v19+/application-builder-common-engine/server/__serverFileName__ +2 -0
  73. package/src/generators/setup-ssr/lib/generate-files.js +12 -1
  74. package/src/generators/setup-ssr/lib/update-project-config.js +1 -0
  75. package/src/generators/stories/stories.js +2 -2
  76. package/src/generators/utils/add-jest.d.ts +1 -0
  77. package/src/generators/utils/add-jest.js +2 -2
  78. package/src/generators/utils/add-vitest.d.ts +1 -0
  79. package/src/generators/utils/add-vitest.js +1 -1
  80. package/src/generators/utils/ensure-angular-dependencies.js +0 -1
  81. package/src/migrations/update-16-2-0/switch-data-persistence-operators-imports-to-ngrx-router-store.js +4 -4
  82. package/src/migrations/update-19-6-0/turn-off-dts-by-default.js +2 -2
  83. package/src/migrations/{update-16-1-0 → update-20-5-0}/update-angular-cli.d.ts +1 -1
  84. package/src/migrations/{update-16-1-0 → update-20-5-0}/update-angular-cli.js +1 -1
  85. package/src/migrations/{update-16-1-0/remove-ngcc-invocation.d.ts → update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.d.ts} +1 -1
  86. package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +122 -0
  87. package/src/migrations/update-21-0-0/set-continuous-option.d.ts +3 -0
  88. package/src/migrations/update-21-0-0/set-continuous-option.js +29 -0
  89. package/src/plugins/plugin.js +2 -0
  90. package/src/utils/backward-compatible-versions.js +2 -0
  91. package/src/utils/nx-devkit/ast-utils.d.ts +0 -8
  92. package/src/utils/nx-devkit/ast-utils.js +7 -12
  93. package/src/utils/versions.d.ts +7 -6
  94. package/src/utils/versions.js +8 -7
  95. package/fesm2022/nx-angular-testing.mjs +0 -45
  96. package/fesm2022/nx-angular-testing.mjs.map +0 -1
  97. package/src/migrations/update-16-0-0/remove-karma-defaults.d.ts +0 -2
  98. package/src/migrations/update-16-0-0/remove-karma-defaults.js +0 -52
  99. package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.d.ts +0 -2
  100. package/src/migrations/update-16-0-0/remove-library-generator-simple-module-name-option.js +0 -40
  101. package/src/migrations/update-16-0-0/remove-protractor-defaults.d.ts +0 -2
  102. package/src/migrations/update-16-0-0/remove-protractor-defaults.js +0 -52
  103. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
  104. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -9
  105. package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.d.ts +0 -2
  106. package/src/migrations/update-16-1-0/extract-standalone-config-from-bootstrap.js +0 -127
  107. package/src/migrations/update-16-1-0/remove-ngcc-invocation.js +0 -22
  108. package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.d.ts +0 -2
  109. package/src/migrations/update-16-1-0/remove-render-module-platform-server-exports.js +0 -62
  110. package/src/migrations/update-16-1-0/update-server-executor-config.d.ts +0 -2
  111. package/src/migrations/update-16-1-0/update-server-executor-config.js +0 -26
  112. package/src/runtime/nx/data-persistence.d.ts +0 -276
  113. package/testing/index.d.ts +0 -1
  114. package/testing/ng-package.json +0 -6
  115. package/testing/src/testing-utils.d.ts +0 -33
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCustomWebpackConfig = getCustomWebpackConfig;
4
+ exports.convertWebpackConfigToUseNxModuleFederationPlugin = convertWebpackConfigToUseNxModuleFederationPlugin;
5
+ const devkit_1 = require("@nx/devkit");
6
+ const config_utils_1 = require("@nx/devkit/src/utils/config-utils");
7
+ const path_1 = require("path");
8
+ const tsquery_1 = require("@phenomnomnominal/tsquery");
9
+ const FILE_EXTENSION_REGEX = /\.[^.]+$/;
10
+ async function getCustomWebpackConfig(tree, projectRoot, pathToCustomWebpackConfig) {
11
+ const webpackConfigContents = tree.read(pathToCustomWebpackConfig, 'utf-8');
12
+ if (webpackConfigContents.includes('@nx/module-federation/angular') &&
13
+ webpackConfigContents.includes('withModuleFederation')) {
14
+ tree.write(pathToCustomWebpackConfig, convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents));
15
+ return {
16
+ isWebpackConfigFunction: false,
17
+ normalizedPathToCustomWebpackConfig: `./${(0, path_1.relative)(projectRoot, pathToCustomWebpackConfig).replace(FILE_EXTENSION_REGEX, '')}`,
18
+ };
19
+ }
20
+ const configFile = await (0, config_utils_1.loadConfigFile)((0, path_1.join)(tree.root, pathToCustomWebpackConfig));
21
+ const webpackConfig = 'default' in configFile ? configFile.default : configFile;
22
+ return {
23
+ isWebpackConfigFunction: typeof webpackConfig === 'function',
24
+ normalizedPathToCustomWebpackConfig: `./${(0, path_1.relative)(projectRoot, pathToCustomWebpackConfig).replace(FILE_EXTENSION_REGEX, '')}`,
25
+ };
26
+ }
27
+ function convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents) {
28
+ let newWebpackConfigContents = webpackConfigContents;
29
+ let ast = tsquery_1.tsquery.ast(webpackConfigContents);
30
+ const withModuleFederationImportNodes = (0, tsquery_1.tsquery)(ast, 'ImportDeclaration:has(StringLiteral[value=@nx/module-federation/angular])');
31
+ if (withModuleFederationImportNodes.length > 0) {
32
+ const withModuleFederationImportNode = withModuleFederationImportNodes[0];
33
+ newWebpackConfigContents = `${webpackConfigContents.slice(0, withModuleFederationImportNode.getStart())}import { NxModuleFederationPlugin } from '@nx/module-federation/rspack';${webpackConfigContents.slice(withModuleFederationImportNode.getEnd())}`;
34
+ ast = tsquery_1.tsquery.ast(newWebpackConfigContents);
35
+ const exportedWithModuleFederationNodes = (0, tsquery_1.tsquery)(ast, 'ExportAssignment:has(CallExpression > Identifier[name=withModuleFederation])');
36
+ if (exportedWithModuleFederationNodes.length > 0) {
37
+ const exportedWithModuleFederationNode = exportedWithModuleFederationNodes[0];
38
+ newWebpackConfigContents = `${newWebpackConfigContents.slice(0, exportedWithModuleFederationNode.getStart())}${newWebpackConfigContents.slice(exportedWithModuleFederationNode.getEnd())}
39
+ export default {
40
+ plugins: [
41
+ new NxModuleFederationPlugin(config, {
42
+ dts: false,
43
+ }),
44
+ ]
45
+ }
46
+ `;
47
+ }
48
+ else {
49
+ devkit_1.logger.warn("Could not find 'export default withModuleFederation' in the webpack config file. Skipping conversion.");
50
+ }
51
+ }
52
+ const withModuleFederationRequireNodes = (0, tsquery_1.tsquery)(ast, 'VariableStatement:has(CallExpression > Identifier[name=withModuleFederation], StringLiteral[value=@nx/module-federation/angular])');
53
+ if (withModuleFederationRequireNodes.length > 0) {
54
+ const withModuleFederationRequireNode = withModuleFederationRequireNodes[0];
55
+ newWebpackConfigContents = `${webpackConfigContents.slice(0, withModuleFederationRequireNode.getStart())}const { NxModuleFederationPlugin } = require('@nx/module-federation/rspack');${webpackConfigContents.slice(withModuleFederationRequireNode.getEnd())}`;
56
+ ast = tsquery_1.tsquery.ast(newWebpackConfigContents);
57
+ const exportedWithModuleFederationNodes = (0, tsquery_1.tsquery)(ast, 'ExpressionStatement:has(BinaryExpression > PropertyAccessExpression:has(Identifier[name=module], Identifier[name=exports]), CallExpression:has(Identifier[name=withModuleFederation]))');
58
+ if (exportedWithModuleFederationNodes.length > 0) {
59
+ const exportedWithModuleFederationNode = exportedWithModuleFederationNodes[0];
60
+ newWebpackConfigContents = `${newWebpackConfigContents.slice(0, exportedWithModuleFederationNode.getStart())}${newWebpackConfigContents.slice(exportedWithModuleFederationNode.getEnd())}
61
+ module.exports = {
62
+ plugins: [
63
+ new NxModuleFederationPlugin({ config }, {
64
+ dts: false,
65
+ }),
66
+ ]
67
+ }
68
+ `;
69
+ }
70
+ else {
71
+ devkit_1.logger.warn("Could not find 'module.exports = withModuleFederation' in the webpack config file. Skipping conversion.");
72
+ }
73
+ }
74
+ return newWebpackConfigContents;
75
+ }
@@ -0,0 +1,2 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare function updateTsconfig(tree: Tree, projectRoot: string): void;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateTsconfig = updateTsconfig;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const js_1 = require("@nx/js");
6
+ function updateTsconfig(tree, projectRoot) {
7
+ const tsconfigPath = (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.json');
8
+ const tsconfig = (0, devkit_1.readJson)(tree, tsconfigPath);
9
+ tsconfig['ts-node'] ??= {};
10
+ tsconfig['ts-node'].compilerOptions ??= {};
11
+ tsconfig['ts-node'].compilerOptions.module = 'CommonJS';
12
+ tsconfig['ts-node'].compilerOptions.moduleResolution = 'Node10';
13
+ if (tsconfig.compilerOptions?.customConditions) {
14
+ tsconfig['ts-node'].compilerOptions.customConditions = null;
15
+ }
16
+ else {
17
+ const rootTsconfigFile = (0, js_1.getRootTsConfigFileName)(tree);
18
+ if (rootTsconfigFile) {
19
+ const rootTsconfigJson = (0, devkit_1.readJson)(tree, rootTsconfigFile);
20
+ if (rootTsconfigJson.compilerOptions?.customConditions) {
21
+ tsconfig['ts-node'].compilerOptions.customConditions = null;
22
+ }
23
+ }
24
+ }
25
+ (0, devkit_1.writeJson)(tree, tsconfigPath, tsconfig);
26
+ }
@@ -0,0 +1,2 @@
1
+ import { TargetConfiguration } from '@nx/devkit';
2
+ export declare function validateSupportedBuildExecutor(targets: TargetConfiguration[]): void;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSupportedBuildExecutor = validateSupportedBuildExecutor;
4
+ const SUPPORTED_BUILD_EXECUTORS = [
5
+ '@angular-devkit/build-angular:browser',
6
+ '@nx/angular:webpack-browser',
7
+ ];
8
+ function validateSupportedBuildExecutor(targets) {
9
+ const executorsUsedByProject = targets.map((target) => target.executor);
10
+ if (!executorsUsedByProject.some((executor) => SUPPORTED_BUILD_EXECUTORS.includes(executor))) {
11
+ throw new Error('The project does not use a supported build executor. Please use one of the following executors: ' +
12
+ SUPPORTED_BUILD_EXECUTORS.join(', '));
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ export interface ConvertToRspackSchema {
2
+ project: string;
3
+ skipFormat?: boolean;
4
+ skipInstall?: boolean;
5
+ }
@@ -0,0 +1,30 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "$id": "GeneratorNxApp",
4
+ "title": "Creates an Angular application.",
5
+ "description": "Creates an Angular application.",
6
+ "type": "object",
7
+ "cli": "nx",
8
+ "properties": {
9
+ "project": {
10
+ "type": "string",
11
+ "aliases": ["name", "projectName"],
12
+ "description": "Project for which to convert to rspack.",
13
+ "$default": {
14
+ "$source": "argv",
15
+ "index": 0
16
+ },
17
+ "x-priority": "important"
18
+ },
19
+ "skipFormat": {
20
+ "description": "Skip formatting files.",
21
+ "type": "boolean",
22
+ "default": false
23
+ },
24
+ "skipInstall": {
25
+ "description": "Skip installing dependencies.",
26
+ "type": "boolean",
27
+ "default": false
28
+ }
29
+ }
30
+ }
@@ -39,7 +39,7 @@ async function host(tree, schema) {
39
39
  }
40
40
  });
41
41
  }
42
- await (0, project_name_and_root_utils_1.ensureProjectName)(tree, options, 'application');
42
+ await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
43
43
  const { projectName: hostProjectName, projectRoot: appRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
44
44
  name: options.name,
45
45
  projectType: 'application',
@@ -20,7 +20,6 @@ export interface Schema {
20
20
  e2eTestRunner?: E2eTestRunner;
21
21
  backendProject?: string;
22
22
  strict?: boolean;
23
- standaloneConfig?: boolean;
24
23
  inlineStyle?: boolean;
25
24
  inlineTemplate?: boolean;
26
25
  viewEncapsulation?: 'Emulated' | 'Native' | 'None';
@@ -144,12 +144,6 @@
144
144
  "description": "Create an application with stricter type checking and build optimization options.",
145
145
  "default": true
146
146
  },
147
- "standaloneConfig": {
148
- "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
149
- "type": "boolean",
150
- "default": true,
151
- "x-deprecated": "Nx only supports standaloneConfig"
152
- },
153
147
  "setParserOptionsProject": {
154
148
  "type": "boolean",
155
149
  "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
@@ -1,4 +1,4 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { AngularProjectConfiguration } from '../../../utils/types';
3
3
  import type { NormalizedSchema } from './normalized-schema';
4
- export declare function addProject(tree: Tree, libraryOptions: NormalizedSchema['libraryOptions']): AngularProjectConfiguration;
4
+ export declare function addProject(tree: Tree, libraryOptions: NormalizedSchema['libraryOptions']): Promise<AngularProjectConfiguration>;
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = addProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
6
- function addProject(tree, libraryOptions) {
6
+ const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
7
+ const use_legacy_versioning_1 = require("nx/src/command-line/release/config/use-legacy-versioning");
8
+ async function addProject(tree, libraryOptions) {
7
9
  const project = {
8
10
  name: libraryOptions.name,
9
11
  root: libraryOptions.projectRoot,
@@ -34,6 +36,10 @@ function addProject(tree, libraryOptions) {
34
36
  },
35
37
  defaultConfiguration: 'production',
36
38
  };
39
+ if (libraryOptions.publishable) {
40
+ const nxJson = (0, devkit_1.readJson)(tree, 'nx.json');
41
+ await (0, add_release_config_1.addReleaseConfigForNonTsSolution)((0, use_legacy_versioning_1.shouldUseLegacyVersioning)(nxJson.release), tree, libraryOptions.name, project);
42
+ }
37
43
  }
38
44
  (0, devkit_1.addProjectConfiguration)(tree, libraryOptions.name, project);
39
45
  return project;
@@ -22,7 +22,7 @@ async function normalizeOptions(host, schema) {
22
22
  skipModule: schema.skipModule || schema.standalone,
23
23
  ...schema,
24
24
  };
25
- await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'library');
25
+ await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'library');
26
26
  const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
27
27
  name: options.name,
28
28
  projectType: 'library',
@@ -12,7 +12,6 @@ export interface NormalizedSchema {
12
12
  buildable?: boolean;
13
13
  publishable?: boolean;
14
14
  importPath?: string;
15
- standaloneConfig?: boolean;
16
15
  spec?: boolean;
17
16
  commonModule?: boolean;
18
17
  routing?: boolean;
@@ -25,6 +25,7 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
25
25
  const test_runners_1 = require("../../utils/test-runners");
26
26
  const add_vitest_1 = require("../utils/add-vitest");
27
27
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
28
+ const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
28
29
  async function libraryGenerator(tree, schema) {
29
30
  (0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'angular', 'library');
30
31
  // Do some validation checks
@@ -49,7 +50,7 @@ async function libraryGenerator(tree, schema) {
49
50
  if (!libraryOptions.skipPackageJson) {
50
51
  (0, ensure_angular_dependencies_1.ensureAngularDependencies)(tree);
51
52
  }
52
- const project = (0, add_project_1.addProject)(tree, libraryOptions);
53
+ const project = await (0, add_project_1.addProject)(tree, libraryOptions);
53
54
  (0, create_files_1.createFiles)(tree, options, project);
54
55
  (0, update_tsconfig_1.updateTsConfig)(tree, libraryOptions);
55
56
  await addUnitTestRunner(tree, libraryOptions);
@@ -76,6 +77,9 @@ async function libraryGenerator(tree, schema) {
76
77
  'ng-packagr': pkgVersions.ngPackagrVersion,
77
78
  }, undefined, true);
78
79
  (0, dependencies_1.addBuildableLibrariesPostCssDependencies)(tree);
80
+ if (libraryOptions.publishable) {
81
+ await (0, add_release_config_1.releaseTasks)(tree);
82
+ }
79
83
  }
80
84
  (0, js_1.addTsConfigPath)(tree, libraryOptions.importPath, [
81
85
  (0, devkit_1.joinPathFragments)(libraryOptions.projectRoot, './src', 'index.ts'),
@@ -12,7 +12,6 @@ export interface Schema {
12
12
  buildable?: boolean;
13
13
  publishable?: boolean;
14
14
  importPath?: string;
15
- standaloneConfig?: boolean;
16
15
  spec?: boolean;
17
16
  flat?: boolean;
18
17
  commonModule?: boolean;
@@ -108,12 +108,6 @@
108
108
  "enum": ["eslint", "none"],
109
109
  "default": "eslint"
110
110
  },
111
- "standaloneConfig": {
112
- "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
113
- "type": "boolean",
114
- "default": true,
115
- "x-deprecated": "Nx only supports standaloneConfig"
116
- },
117
111
  "compilationMode": {
118
112
  "description": "Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries.",
119
113
  "type": "string",
@@ -1,3 +1,6 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
+ /**
4
+ * @deprecated Use the `@nx/workspace:move` generator instead. It will be removed in Nx v22.
5
+ */
3
6
  export declare function angularMoveGenerator(tree: Tree, schema: Schema): Promise<void>;
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.angularMoveGenerator = angularMoveGenerator;
4
4
  const move_1 = require("@nx/workspace/src/generators/move/move");
5
+ /**
6
+ * @deprecated Use the `@nx/workspace:move` generator instead. It will be removed in Nx v22.
7
+ */
5
8
  async function angularMoveGenerator(tree, schema) {
6
9
  process.env.NX_ANGULAR_MOVE_INVOKED = 'true';
7
10
  await (0, move_1.moveGenerator)(tree, schema);
@@ -173,8 +173,8 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
173
173
  }
174
174
  else if (this.isCypressE2eProject()) {
175
175
  (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
176
- const { installedCypressVersion, } = require('@nx/cypress/src/utils/cypress-version');
177
- this.cypressInstalledVersion = installedCypressVersion();
176
+ const { getInstalledCypressMajorVersion, } = require('@nx/cypress/src/utils/versions');
177
+ this.cypressInstalledVersion = getInstalledCypressMajorVersion(this.tree);
178
178
  this.project = {
179
179
  ...this.project,
180
180
  name,
@@ -1,4 +1,7 @@
1
1
  import type { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import type { NgRxGeneratorOptions } from './schema';
3
+ /**
4
+ * @deprecated Use the 'ngrx-root-store' and 'ngrx-feature-store' generators instead. It will be removed in Nx v22.
5
+ */
3
6
  export declare function ngrxGenerator(tree: Tree, schema: NgRxGeneratorOptions): Promise<GeneratorCallback>;
4
7
  export default ngrxGenerator;
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngrxGenerator = ngrxGenerator;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const lib_1 = require("./lib");
6
+ /**
7
+ * @deprecated Use the 'ngrx-root-store' and 'ngrx-feature-store' generators instead. It will be removed in Nx v22.
8
+ */
6
9
  async function ngrxGenerator(tree, schema) {
7
10
  (0, lib_1.validateOptions)(tree, schema);
8
11
  const options = (0, lib_1.normalizeOptions)(tree, schema);
@@ -3,7 +3,7 @@
3
3
  "$id": "NxNgrxGenerator",
4
4
  "title": "Add NgRx support to an application or library.",
5
5
  "description": "Adds NgRx support to an application or library.",
6
- "x-deprecated": "This generator is deprecated and will be removed in a future version of Nx. Use the 'ngrx-root-store' and 'ngrx-feature-store' generators instead.",
6
+ "x-deprecated": "Use the 'ngrx-root-store' and 'ngrx-feature-store' generators instead. It will be removed in Nx v22.",
7
7
  "cli": "nx",
8
8
  "type": "object",
9
9
  "examples": [
@@ -2,7 +2,7 @@ export interface Schema {
2
2
  name: string;
3
3
  minimal: boolean;
4
4
  parent: string;
5
- directory?: string;
5
+ directory: string;
6
6
  route?: string;
7
7
  barrels?: boolean;
8
8
  facade?: boolean;
@@ -18,7 +18,7 @@ async function remote(tree, schema) {
18
18
  if (options.host && !projects.has(options.host)) {
19
19
  throw new Error(`The name of the application to be used as the host app does not exist. (${options.host})`);
20
20
  }
21
- await (0, project_name_and_root_utils_1.ensureProjectName)(tree, options, 'application');
21
+ await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
22
22
  const { projectName: remoteProjectName } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
23
23
  name: options.name,
24
24
  projectType: 'application',
@@ -19,7 +19,6 @@ export interface Schema {
19
19
  e2eTestRunner?: E2eTestRunner;
20
20
  backendProject?: string;
21
21
  strict?: boolean;
22
- standaloneConfig?: boolean;
23
22
  inlineStyle?: boolean;
24
23
  inlineTemplate?: boolean;
25
24
  viewEncapsulation?: 'Emulated' | 'Native' | 'None';
@@ -138,12 +138,6 @@
138
138
  "description": "Create an application with stricter type checking and build optimization options.",
139
139
  "default": true
140
140
  },
141
- "standaloneConfig": {
142
- "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
143
- "type": "boolean",
144
- "default": true,
145
- "x-deprecated": "Nx only supports standaloneConfig"
146
- },
147
141
  "setParserOptionsProject": {
148
142
  "type": "boolean",
149
143
  "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
@@ -17,6 +17,7 @@ function setupServeTarget(host, options) {
17
17
  };
18
18
  if (options.mfType === 'remote') {
19
19
  appConfig.targets['serve-static'] = {
20
+ continuous: true,
20
21
  executor: '@nx/web:file-server',
21
22
  defaultConfiguration: 'production',
22
23
  options: {
@@ -1,13 +1,13 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { ServerModule } from '@angular/platform-server';<% if(serverRouting) { %>
3
- import { provideServerRoutesConfig } from '@angular/ssr';<% } %>
3
+ import { <%= provideServerRoutingFn %> } from '@angular/ssr';<% } %>
4
4
  import { AppComponent } from './app.component';
5
5
  import { AppModule } from './app.module';<% if(serverRouting) { %>
6
6
  import { serverRoutes } from './app.routes.server';<% } %>
7
7
 
8
8
  @NgModule({
9
9
  imports: [AppModule, ServerModule],<% if(serverRouting) { %>
10
- providers: [provideServerRoutesConfig(serverRoutes)],<% } %>
10
+ providers: [<%= provideServerRoutingFn %>(serverRoutes)],<% } %>
11
11
  bootstrap: [AppComponent],
12
12
  })
13
13
  export class <%= rootModuleClassName %> {}
@@ -61,6 +61,6 @@ if (isMainModule(import.meta.url)) {
61
61
  }
62
62
 
63
63
  /**
64
- * The request handler used by the Angular CLI (dev-server and during build).
64
+ * Request handler used by the Angular CLI (for dev-server and during build) or Firebase Cloud Functions.
65
65
  */
66
66
  export const reqHandler = createNodeRequestHandler(app);
@@ -1,13 +1,13 @@
1
1
  import { mergeApplicationConfig, ApplicationConfig } from '@angular/core';
2
2
  import { provideServerRendering } from '@angular/platform-server';<% if(serverRouting) { %>
3
- import { provideServerRoutesConfig } from '@angular/ssr';<% } %>
3
+ import { <%= provideServerRoutingFn %> } from '@angular/ssr';<% } %>
4
4
  import { appConfig } from './app.config';<% if(serverRouting) { %>
5
5
  import { serverRoutes } from './app.routes.server';<% } %>
6
6
 
7
7
  const serverConfig: ApplicationConfig = {
8
8
  providers: [
9
9
  provideServerRendering()<% if(serverRouting) { %>,
10
- provideServerRoutesConfig(serverRoutes)<% } %>
10
+ <%= provideServerRoutingFn %>(serverRoutes)<% } %>
11
11
  ]
12
12
  };
13
13
 
@@ -63,3 +63,5 @@ if (isMainModule(import.meta.url)) {
63
63
  console.log(`Node Express server listening on http://localhost:${port}`);
64
64
  });
65
65
  }
66
+
67
+ export default app;
@@ -4,6 +4,7 @@ exports.generateSSRFiles = generateSSRFiles;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const path_1 = require("path");
6
6
  const version_utils_1 = require("../../utils/version-utils");
7
+ const semver_1 = require("semver");
7
8
  function generateSSRFiles(tree, options) {
8
9
  const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
9
10
  if (project.targets.server ||
@@ -24,7 +25,17 @@ function generateSSRFiles(tree, options) {
24
25
  pathToFiles = (0, path_1.join)(baseFilesPath, 'pre-v19', options.standalone ? 'standalone-src' : 'ngmodule-src');
25
26
  }
26
27
  const sourceRoot = project.sourceRoot ?? (0, devkit_1.joinPathFragments)(project.root, 'src');
27
- (0, devkit_1.generateFiles)(tree, pathToFiles, sourceRoot, { ...options, tpl: '' });
28
+ const ssrVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, '@angular/ssr');
29
+ const cleanedSsrVersion = ssrVersion
30
+ ? (0, semver_1.clean)(ssrVersion) ?? (0, semver_1.coerce)(ssrVersion).version
31
+ : null;
32
+ (0, devkit_1.generateFiles)(tree, pathToFiles, sourceRoot, {
33
+ ...options,
34
+ provideServerRoutingFn: !cleanedSsrVersion || (0, semver_1.gte)(cleanedSsrVersion, '19.2.0')
35
+ ? 'provideServerRouting'
36
+ : 'provideServerRoutesConfig',
37
+ tpl: '',
38
+ });
28
39
  if (angularMajorVersion >= 19 && !options.serverRouting) {
29
40
  tree.delete((0, devkit_1.joinPathFragments)(sourceRoot, 'app/app.routes.server.ts'));
30
41
  }
@@ -76,6 +76,7 @@ function updateProjectConfigForBrowserBuilder(tree, options) {
76
76
  defaultConfiguration: 'production',
77
77
  };
78
78
  projectConfig.targets['serve-ssr'] = {
79
+ continuous: true,
79
80
  executor: '@angular-devkit/build-angular:ssr-dev-server',
80
81
  configurations: {
81
82
  development: {
@@ -7,7 +7,7 @@ const component_story_1 = tslib_1.__importDefault(require("../component-story/co
7
7
  const component_info_1 = require("../utils/storybook-ast/component-info");
8
8
  const entry_point_1 = require("../utils/storybook-ast/entry-point");
9
9
  const module_info_1 = require("../utils/storybook-ast/module-info");
10
- const minimatch_1 = require("minimatch");
10
+ const picomatch = require("picomatch");
11
11
  const versions_1 = require("../../utils/versions");
12
12
  async function angularStoriesGenerator(tree, options) {
13
13
  const entryPoints = (0, entry_point_1.getProjectEntryPoints)(tree, options.name);
@@ -17,7 +17,7 @@ async function angularStoriesGenerator(tree, options) {
17
17
  componentsInfo.push(...(0, component_info_1.getComponentsInfo)(tree, entryPoint, moduleFilePaths, options.name), ...(0, component_info_1.getStandaloneComponentsInfo)(tree, entryPoint));
18
18
  }
19
19
  const componentInfos = componentsInfo.filter((f) => !options.ignorePaths?.some((pattern) => {
20
- const shouldIgnorePath = (0, minimatch_1.minimatch)((0, devkit_1.joinPathFragments)(f.moduleFolderPath, f.path, `${f.componentFileName}.ts`), pattern);
20
+ const shouldIgnorePath = picomatch(pattern)((0, devkit_1.joinPathFragments)(f.moduleFolderPath, f.path, `${f.componentFileName}.ts`));
21
21
  return shouldIgnorePath;
22
22
  }));
23
23
  for (const info of componentInfos) {
@@ -4,5 +4,6 @@ export type AddJestOptions = {
4
4
  projectRoot: string;
5
5
  skipPackageJson: boolean;
6
6
  strict: boolean;
7
+ addPlugin?: boolean;
7
8
  };
8
9
  export declare function addJest(tree: Tree, options: AddJestOptions): Promise<void>;
@@ -16,8 +16,8 @@ async function addJest(tree, options) {
16
16
  skipSerializers: false,
17
17
  skipPackageJson: options.skipPackageJson,
18
18
  skipFormat: true,
19
- addPlugin: false,
20
- addExplicitTargets: true,
19
+ addPlugin: options.addPlugin ?? false,
20
+ addExplicitTargets: !options.addPlugin,
21
21
  });
22
22
  const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src', 'test-setup.ts');
23
23
  if (options.strict && tree.exists(setupFile)) {
@@ -4,5 +4,6 @@ export type AddVitestOptions = {
4
4
  projectRoot: string;
5
5
  skipPackageJson: boolean;
6
6
  strict: boolean;
7
+ addPlugin?: boolean;
7
8
  };
8
9
  export declare function addVitest(tree: Tree, options: AddVitestOptions): Promise<void>;
@@ -10,6 +10,6 @@ async function addVitest(tree, options) {
10
10
  uiFramework: 'angular',
11
11
  testEnvironment: 'jsdom',
12
12
  coverageProvider: 'v8',
13
- addPlugin: false,
13
+ addPlugin: options.addPlugin ?? false,
14
14
  });
15
15
  }
@@ -19,7 +19,6 @@ function ensureAngularDependencies(tree) {
19
19
  const rxjsVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, 'rxjs') ?? pkgVersions.rxjsVersion;
20
20
  const tsLibVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, 'tslib') ?? pkgVersions.tsLibVersion;
21
21
  const zoneJsVersion = (0, version_utils_1.getInstalledPackageVersion)(tree, 'zone.js') ?? pkgVersions.zoneJsVersion;
22
- dependencies['@angular/animations'] = angularVersion;
23
22
  dependencies['@angular/common'] = angularVersion;
24
23
  dependencies['@angular/compiler'] = angularVersion;
25
24
  dependencies['@angular/core'] = angularVersion;
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
6
+ const project_graph_1 = require("nx/src/config/project-graph");
7
+ const nx_deps_cache_1 = require("nx/src/project-graph/nx-deps-cache");
8
+ const version_utils_1 = require("../../generators/utils/version-utils");
6
9
  const file_change_recorder_1 = require("../../utils/file-change-recorder");
7
- const versions_1 = require("../../utils/versions");
8
10
  const projects_1 = require("../utils/projects");
9
- const nx_deps_cache_1 = require("nx/src/project-graph/nx-deps-cache");
10
- const project_graph_1 = require("nx/src/config/project-graph");
11
11
  let tsquery;
12
12
  const angularPluginTargetNames = ['npm:@nx/angular', 'npm:@nrwl/angular'];
13
13
  const dataPersistenceOperators = [
@@ -109,7 +109,7 @@ function addNgrxRouterStoreIfNotInstalled(tree) {
109
109
  devDependencies?.['@ngrx/router-store']) {
110
110
  return;
111
111
  }
112
- (0, devkit_1.addDependenciesToPackageJson)(tree, { '@ngrx/router-store': versions_1.ngrxVersion }, {});
112
+ (0, devkit_1.addDependenciesToPackageJson)(tree, { '@ngrx/router-store': (0, version_utils_1.versions)(tree).ngrxVersion }, {});
113
113
  }
114
114
  function filterFilesWithNxAngularDep(files) {
115
115
  const filteredFiles = [];
@@ -2,12 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const minimatch_1 = require("minimatch");
5
+ const picomatch = require("picomatch");
6
6
  const tsquery_1 = require("@phenomnomnominal/tsquery");
7
7
  async function default_1(tree) {
8
8
  (0, devkit_1.visitNotIgnoredFiles)(tree, '', (path) => {
9
9
  const webpackConfigGlob = '**/webpack*.config*.{js,ts,mjs,cjs}';
10
- const result = (0, minimatch_1.minimatch)(path, webpackConfigGlob);
10
+ const result = picomatch(webpackConfigGlob)(path);
11
11
  if (!result) {
12
12
  return;
13
13
  }
@@ -1,3 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
- export declare const angularCliVersion = "~16.0.0";
2
+ export declare const angularCliVersion = "~19.2.0";
3
3
  export default function (tree: Tree): Promise<void>;
@@ -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 = '~16.0.0';
6
+ exports.angularCliVersion = '~19.2.0';
7
7
  async function default_1(tree) {
8
8
  let shouldFormat = false;
9
9
  (0, devkit_1.updateJson)(tree, 'package.json', (json) => {