@nx/angular 0.0.0-pr-31369-292b003 → 0.0.0-pr-31432-8c8eba6

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/migrations.json CHANGED
@@ -303,43 +303,43 @@
303
303
  "description": "Change the data persistence operator imports to '@ngrx/router-store/data-persistence'.",
304
304
  "factory": "./src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence"
305
305
  },
306
- "update-angular-cli-version-20-0-0": {
306
+ "update-angular-cli-version-20-0-0-rc-3": {
307
307
  "cli": "nx",
308
- "version": "21.2.0-beta.2",
308
+ "version": "21.2.0-beta.0",
309
309
  "requires": {
310
- "@angular/core": ">=20.0.0"
310
+ "@angular/core": ">=20.0.0-rc.2"
311
311
  },
312
- "description": "Update the @angular/cli package version to ~20.0.0.",
312
+ "description": "Update the @angular/cli package version to 20.0.0-rc.3.",
313
313
  "factory": "./src/migrations/update-21-2-0/update-angular-cli"
314
314
  },
315
315
  "migrate-provide-server-rendering-import": {
316
- "version": "21.2.0-beta.2",
316
+ "version": "21.2.0-beta.0",
317
317
  "requires": {
318
- "@angular/core": ">=20.0.0"
318
+ "@angular/core": ">=20.0.0-rc.2"
319
319
  },
320
320
  "description": "Migrate imports of `provideServerRendering` from `@angular/platform-server` to `@angular/ssr`.",
321
321
  "factory": "./src/migrations/update-21-2-0/migrate-provide-server-rendering-import"
322
322
  },
323
323
  "replace-provide-server-routing": {
324
- "version": "21.2.0-beta.2",
324
+ "version": "21.2.0-beta.0",
325
325
  "requires": {
326
- "@angular/core": ">=20.0.0"
326
+ "@angular/core": ">=20.0.0-rc.2"
327
327
  },
328
- "description": "Replace `provideServerRouting` and `provideServerRoutesConfig` with `provideServerRendering` using `withRoutes`.",
328
+ "description": "Replace `provideServerRouting` with `provideServerRendering` using `withRoutes`.",
329
329
  "factory": "./src/migrations/update-21-2-0/replace-provide-server-routing"
330
330
  },
331
331
  "set-generator-defaults-for-previous-style-guide": {
332
- "version": "21.2.0-beta.2",
332
+ "version": "21.2.0-beta.0",
333
333
  "requires": {
334
- "@angular/core": ">=20.0.0"
334
+ "@angular/core": ">=20.0.0-rc.2"
335
335
  },
336
336
  "description": "Update the generator defaults to maintain the previous style guide behavior.",
337
337
  "factory": "./src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide"
338
338
  },
339
339
  "update-module-resolution": {
340
- "version": "21.2.0-beta.2",
340
+ "version": "21.2.0-beta.0",
341
341
  "requires": {
342
- "@angular/core": ">=20.0.0"
342
+ "@angular/core": ">=20.0.0-rc.2"
343
343
  },
344
344
  "description": "Update 'moduleResolution' to 'bundler' in TypeScript configurations. You can read more about this here: https://www.typescriptlang.org/tsconfig/#moduleResolution.",
345
345
  "factory": "./src/migrations/update-21-2-0/update-module-resolution"
@@ -1667,130 +1667,66 @@
1667
1667
  }
1668
1668
  },
1669
1669
  "21.2.0": {
1670
- "version": "21.2.0-beta.2",
1670
+ "version": "21.2.0-beta.0",
1671
1671
  "x-prompt": "Do you want to update the Angular version to v20?",
1672
1672
  "requires": {
1673
- "@angular/core": ">=19.2.0 <20.0.0"
1673
+ "@angular/core": ">=19.2.0 <20.0.0-rc.2"
1674
1674
  },
1675
1675
  "packages": {
1676
1676
  "@angular-devkit/build-angular": {
1677
- "version": "~20.0.0",
1677
+ "version": "20.0.0-rc.3",
1678
1678
  "alwaysAddToPackageJson": false
1679
1679
  },
1680
1680
  "@angular-devkit/core": {
1681
- "version": "~20.0.0",
1681
+ "version": "20.0.0-rc.3",
1682
1682
  "alwaysAddToPackageJson": false
1683
1683
  },
1684
1684
  "@angular-devkit/schematics": {
1685
- "version": "~20.0.0",
1685
+ "version": "20.0.0-rc.3",
1686
1686
  "alwaysAddToPackageJson": false
1687
1687
  },
1688
1688
  "@angular/build": {
1689
- "version": "~20.0.0",
1689
+ "version": "20.0.0-rc.3",
1690
1690
  "alwaysAddToPackageJson": false
1691
1691
  },
1692
1692
  "@angular/pwa": {
1693
- "version": "~20.0.0",
1693
+ "version": "20.0.0-rc.3",
1694
1694
  "alwaysAddToPackageJson": false
1695
1695
  },
1696
1696
  "@angular/ssr": {
1697
- "version": "~20.0.0",
1697
+ "version": "20.0.0-rc.3",
1698
1698
  "alwaysAddToPackageJson": false
1699
1699
  },
1700
1700
  "@schematics/angular": {
1701
- "version": "~20.0.0",
1701
+ "version": "20.0.0-rc.3",
1702
1702
  "alwaysAddToPackageJson": false
1703
1703
  },
1704
1704
  "@angular-devkit/architect": {
1705
- "version": "~0.2000.0",
1705
+ "version": "0.2000.0-rc.3",
1706
1706
  "alwaysAddToPackageJson": false
1707
1707
  },
1708
1708
  "@angular-devkit/build-webpack": {
1709
- "version": "~0.2000.0",
1709
+ "version": "0.2000.0-rc.3",
1710
1710
  "alwaysAddToPackageJson": false
1711
1711
  },
1712
1712
  "@angular/core": {
1713
- "version": "~20.0.0",
1713
+ "version": "20.0.0-rc.2",
1714
1714
  "alwaysAddToPackageJson": true
1715
1715
  },
1716
1716
  "@angular/material": {
1717
- "version": "~20.0.0",
1717
+ "version": "20.0.0-rc.2",
1718
1718
  "alwaysAddToPackageJson": false
1719
1719
  },
1720
1720
  "@angular/cdk": {
1721
- "version": "~20.0.0",
1721
+ "version": "20.0.0-rc.2",
1722
1722
  "alwaysAddToPackageJson": false
1723
1723
  },
1724
1724
  "@angular/google-maps": {
1725
- "version": "~20.0.0",
1725
+ "version": "20.0.0-rc.2",
1726
1726
  "alwaysAddToPackageJson": false
1727
1727
  },
1728
1728
  "ng-packagr": {
1729
- "version": "~20.0.0",
1730
- "alwaysAddToPackageJson": false
1731
- }
1732
- }
1733
- },
1734
- "21.2.0-angular-eslint": {
1735
- "version": "21.2.0-beta.2",
1736
- "requires": {
1737
- "@angular/core": ">= 20.0.0 < 21.0.0",
1738
- "typescript-eslint": "^8.0.0",
1739
- "eslint": "^8.57.0 || ^9.0.0"
1740
- },
1741
- "packages": {
1742
- "angular-eslint": {
1743
- "version": "^20.0.0-alpha.1",
1744
- "alwaysAddToPackageJson": false
1745
- }
1746
- }
1747
- },
1748
- "21.2.0-@angular-eslint": {
1749
- "version": "21.2.0-beta.2",
1750
- "requires": {
1751
- "@angular/core": ">= 20.0.0 < 21.0.0",
1752
- "eslint": "^8.57.0 || ^9.0.0"
1753
- },
1754
- "packages": {
1755
- "@angular-eslint/eslint-plugin": {
1756
- "version": "^20.0.0-alpha.1",
1757
- "alwaysAddToPackageJson": false
1758
- },
1759
- "@angular-eslint/eslint-plugin-template": {
1760
- "version": "^20.0.0-alpha.1",
1761
- "alwaysAddToPackageJson": false
1762
- },
1763
- "@angular-eslint/template-parser": {
1764
- "version": "^20.0.0-alpha.1",
1765
- "alwaysAddToPackageJson": false
1766
- },
1767
- "@angular-eslint/utils": {
1768
- "version": "^20.0.0-alpha.1",
1769
- "alwaysAddToPackageJson": false
1770
- },
1771
- "@angular-eslint/schematics": {
1772
- "version": "^20.0.0-alpha.1",
1773
- "alwaysAddToPackageJson": false
1774
- },
1775
- "@angular-eslint/test-utils": {
1776
- "version": "^20.0.0-alpha.1",
1777
- "alwaysAddToPackageJson": false
1778
- },
1779
- "@angular-eslint/builder": {
1780
- "version": "^20.0.0-alpha.1",
1781
- "alwaysAddToPackageJson": false
1782
- },
1783
- "@angular-eslint/bundled-angular-compiler": {
1784
- "version": "^20.0.0-alpha.1",
1785
- "alwaysAddToPackageJson": false
1786
- }
1787
- }
1788
- },
1789
- "21.2.0-angular-rspack": {
1790
- "version": "21.2.0-beta.2",
1791
- "packages": {
1792
- "@nx/angular-rspack": {
1793
- "version": "^21.1.0",
1729
+ "version": "20.0.0-rc.1",
1794
1730
  "alwaysAddToPackageJson": false
1795
1731
  }
1796
1732
  }
package/ng-package.json CHANGED
@@ -7,14 +7,28 @@
7
7
  "deleteDestPath": false,
8
8
  "allowedNonPeerDependencies": [
9
9
  "@nx/",
10
+ "@angular-devkit",
11
+ "@angular-eslint/",
12
+ "@module-federation/enhanced",
13
+ "@schematics",
10
14
  "@phenomnomnominal/tsquery",
11
15
  "@typescript-eslint/",
12
- "enquirer",
13
- "magic-string",
14
16
  "picocolors",
17
+ "ignore",
15
18
  "picomatch",
19
+ "rxjs-for-await",
20
+ "webpack-merge",
21
+ "ts-node",
22
+ "tsconfig-paths",
16
23
  "semver",
17
- "webpack-merge"
24
+ "webpack",
25
+ "express",
26
+ "http-proxy-middleware",
27
+ "http-server",
28
+ "magic-string",
29
+ "enquirer",
30
+ "find-cache-dir",
31
+ "webpack"
18
32
  ],
19
33
  "keepLifecycleScripts": true
20
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "0.0.0-pr-31369-292b003",
3
+ "version": "0.0.0-pr-31432-8c8eba6",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -58,14 +58,14 @@
58
58
  "migrations": "./migrations.json"
59
59
  },
60
60
  "dependencies": {
61
- "@nx/devkit": "0.0.0-pr-31369-292b003",
62
- "@nx/eslint": "0.0.0-pr-31369-292b003",
63
- "@nx/js": "0.0.0-pr-31369-292b003",
64
- "@nx/module-federation": "0.0.0-pr-31369-292b003",
65
- "@nx/rspack": "0.0.0-pr-31369-292b003",
66
- "@nx/web": "0.0.0-pr-31369-292b003",
67
- "@nx/webpack": "0.0.0-pr-31369-292b003",
68
- "@nx/workspace": "0.0.0-pr-31369-292b003",
61
+ "@nx/devkit": "0.0.0-pr-31432-8c8eba6",
62
+ "@nx/eslint": "0.0.0-pr-31432-8c8eba6",
63
+ "@nx/js": "0.0.0-pr-31432-8c8eba6",
64
+ "@nx/module-federation": "0.0.0-pr-31432-8c8eba6",
65
+ "@nx/rspack": "0.0.0-pr-31432-8c8eba6",
66
+ "@nx/web": "0.0.0-pr-31432-8c8eba6",
67
+ "@nx/webpack": "0.0.0-pr-31432-8c8eba6",
68
+ "@nx/workspace": "0.0.0-pr-31432-8c8eba6",
69
69
  "@phenomnomnominal/tsquery": "~5.0.1",
70
70
  "@typescript-eslint/type-utils": "^8.0.0",
71
71
  "enquirer": "~2.3.6",
@@ -1,4 +1,4 @@
1
- import { type Tree, GeneratorCallback } from '@nx/devkit';
1
+ import { type GeneratorCallback, type Tree } from '@nx/devkit';
2
2
  import type { ConvertToRspackSchema } from './schema';
3
3
  export declare function convertToRspack(tree: Tree, schema: ConvertToRspackSchema): Promise<GeneratorCallback>;
4
4
  export default convertToRspack;
@@ -2,15 +2,16 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertToRspack = convertToRspack;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
6
+ const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
7
+ const enquirer_1 = require("enquirer");
8
+ const path_1 = require("path");
9
+ const posix_1 = require("path/posix");
5
10
  const versions_1 = require("../../utils/versions");
6
11
  const create_config_1 = require("./lib/create-config");
7
12
  const get_custom_webpack_config_1 = require("./lib/get-custom-webpack-config");
8
13
  const update_tsconfig_1 = require("./lib/update-tsconfig");
9
14
  const validate_supported_executor_1 = require("./lib/validate-supported-executor");
10
- const posix_1 = require("path/posix");
11
- const path_1 = require("path");
12
- const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
13
- const enquirer_1 = require("enquirer");
14
15
  const SUPPORTED_EXECUTORS = [
15
16
  '@angular-devkit/build-angular:browser',
16
17
  '@angular-devkit/build-angular:dev-server',
@@ -164,10 +165,6 @@ function handleBuildTargetOptions(tree, options, newConfigurationOptions, root)
164
165
  customWebpackConfigPath = options.customWebpackConfig.path;
165
166
  delete options.customWebpackConfig;
166
167
  }
167
- if (options.outputs) {
168
- // handled by the Rspack inference plugin
169
- delete options.outputs;
170
- }
171
168
  for (const [key, value] of Object.entries(options)) {
172
169
  let optionName = key;
173
170
  let optionValue = key in PATH_NORMALIZER ? PATH_NORMALIZER[key](tree, value, root) : value;
@@ -247,8 +244,9 @@ async function convertToRspack(tree, schema) {
247
244
  root: project.root,
248
245
  };
249
246
  const configurationOptions = {};
250
- const buildTargetNames = [];
251
- const serveTargetNames = [];
247
+ let buildTarget;
248
+ let serveTarget;
249
+ const targetsToRemove = [];
252
250
  let customWebpackConfigPath;
253
251
  (0, validate_supported_executor_1.validateSupportedBuildExecutor)(Object.values(project.targets));
254
252
  let projectServePort = DEFAULT_PORT;
@@ -262,14 +260,15 @@ async function convertToRspack(tree, schema) {
262
260
  handleBuildTargetOptions(tree, configuration, configurationOptions[configurationName], project.root);
263
261
  }
264
262
  }
265
- buildTargetNames.push(targetName);
263
+ buildTarget = { name: targetName, config: target };
264
+ targetsToRemove.push(targetName);
266
265
  }
267
266
  else if (target.executor === '@angular-devkit/build-angular:server' ||
268
267
  target.executor === '@nx/angular:webpack-server') {
269
268
  createConfigOptions.ssr ??= {};
270
269
  createConfigOptions.ssr.entry ??= normalizeFromProjectRoot(tree, target.options.main, project.root);
271
270
  createConfigOptions.server = './src/main.server.ts';
272
- buildTargetNames.push(targetName);
271
+ targetsToRemove.push(targetName);
273
272
  }
274
273
  else if (target.executor === '@angular-devkit/build-angular:dev-server' ||
275
274
  target.executor === '@nx/angular:dev-server' ||
@@ -277,7 +276,7 @@ async function convertToRspack(tree, schema) {
277
276
  createConfigOptions.devServer = {};
278
277
  if (target.options) {
279
278
  handleDevServerTargetOptions(tree, target.options, createConfigOptions.devServer, project.root);
280
- if (target.options.port !== DEFAULT_PORT) {
279
+ if (target.options.port && target.options.port !== DEFAULT_PORT) {
281
280
  projectServePort = target.options.port;
282
281
  }
283
282
  }
@@ -288,7 +287,8 @@ async function convertToRspack(tree, schema) {
288
287
  handleDevServerTargetOptions(tree, configuration, configurationOptions[configurationName].devServer, project.root);
289
288
  }
290
289
  }
291
- serveTargetNames.push(targetName);
290
+ serveTarget = { name: targetName, config: target };
291
+ targetsToRemove.push(targetName);
292
292
  }
293
293
  else if (target.executor === '@angular-devkit/build-angular:prerender') {
294
294
  if (target.options) {
@@ -309,11 +309,11 @@ async function convertToRspack(tree, schema) {
309
309
  }
310
310
  }
311
311
  }
312
- buildTargetNames.push(targetName);
312
+ targetsToRemove.push(targetName);
313
313
  }
314
314
  else if (target.executor === '@angular-devkit/build-angular:app-shell') {
315
315
  createConfigOptions.appShell = true;
316
- buildTargetNames.push(targetName);
316
+ targetsToRemove.push(targetName);
317
317
  }
318
318
  }
319
319
  const customWebpackConfigInfo = customWebpackConfigPath
@@ -321,20 +321,169 @@ async function convertToRspack(tree, schema) {
321
321
  : undefined;
322
322
  (0, create_config_1.createConfig)(tree, createConfigOptions, configurationOptions, customWebpackConfigInfo?.normalizedPathToCustomWebpackConfig, customWebpackConfigInfo?.isWebpackConfigFunction);
323
323
  (0, update_tsconfig_1.updateTsconfig)(tree, project.root);
324
- for (const targetName of [...buildTargetNames, ...serveTargetNames]) {
324
+ for (const targetName of targetsToRemove) {
325
325
  delete project.targets[targetName];
326
326
  }
327
- if (projectServePort !== DEFAULT_PORT) {
328
- project.targets.serve ??= {};
329
- project.targets.serve.options ??= {};
330
- project.targets.serve.options.port = projectServePort;
331
- }
332
327
  (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
328
+ // ensure plugin is registered
333
329
  const { rspackInitGenerator } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
334
330
  await rspackInitGenerator(tree, {
335
331
  addPlugin: true,
336
332
  framework: 'angular',
337
333
  });
334
+ // find the inferred target names
335
+ const nxJson = (0, devkit_1.readNxJson)(tree);
336
+ let inferredBuildTargetName = 'build';
337
+ let inferredServeTargetName = 'serve';
338
+ const pluginRegistration = nxJson.plugins.find((p) => typeof p === 'string' ? false : p.plugin === '@nx/rspack/plugin');
339
+ if (pluginRegistration) {
340
+ inferredBuildTargetName =
341
+ pluginRegistration.options.buildTargetName ?? inferredBuildTargetName;
342
+ inferredServeTargetName =
343
+ pluginRegistration.options.serveTargetName ?? inferredServeTargetName;
344
+ }
345
+ if (buildTarget) {
346
+ // these are all replaced by the inferred task
347
+ delete buildTarget.config.options;
348
+ delete buildTarget.config.configurations;
349
+ delete buildTarget.config.defaultConfiguration;
350
+ delete buildTarget.config.executor;
351
+ const shouldOverrideInputs = (inputs) => {
352
+ if (!inputs?.length) {
353
+ return false;
354
+ }
355
+ if (inputs.length === 2) {
356
+ // check whether the existing inputs would match the inferred task
357
+ // inputs with the exception of the @rspack/cli external dependency
358
+ // which webpack tasks wouldn't have
359
+ const namedInputs = (0, get_named_inputs_1.getNamedInputs)(project.root, {
360
+ nxJsonConfiguration: nxJson,
361
+ configFiles: [],
362
+ workspaceRoot: devkit_1.workspaceRoot,
363
+ });
364
+ if ('production' in namedInputs) {
365
+ return !['production', '^production'].every((input) => inputs.includes(input));
366
+ }
367
+ return !['default', '^default'].every((input) => inputs.includes(input));
368
+ }
369
+ return true;
370
+ };
371
+ if (shouldOverrideInputs(buildTarget.config.inputs)) {
372
+ // keep existing inputs and add the @rspack/cli external dependency
373
+ buildTarget.config.inputs = [
374
+ ...buildTarget.config.inputs,
375
+ { externalDependencies: ['@rspack/cli'] },
376
+ ];
377
+ }
378
+ else {
379
+ delete buildTarget.config.inputs;
380
+ }
381
+ if (buildTarget.config.cache) {
382
+ delete buildTarget.config.cache;
383
+ }
384
+ if (buildTarget.config.dependsOn?.length === 1 &&
385
+ buildTarget.config.dependsOn[0] === `^${buildTarget.name}`) {
386
+ delete buildTarget.config.dependsOn;
387
+ }
388
+ else if (buildTarget.config.dependsOn) {
389
+ buildTarget.config.dependsOn = buildTarget.config.dependsOn.map((dep) => dep === `^${buildTarget.name}` ? `^${inferredBuildTargetName}` : dep);
390
+ }
391
+ const newOutputPath = (0, devkit_1.joinPathFragments)(project.root, createConfigOptions.outputPath.base);
392
+ const shouldOverrideOutputs = (outputs) => {
393
+ if (!outputs?.length) {
394
+ // this means the target was wrongly configured, so, we don't override
395
+ // anything and let the inferred outputs be used
396
+ return false;
397
+ }
398
+ if (outputs.length === 1) {
399
+ if (outputs[0] === '{options.outputPath}') {
400
+ // the inferred task output is created after the createConfig
401
+ // outputPath option, so we don't need to keep this
402
+ return false;
403
+ }
404
+ const normalizedOutputPath = outputs[0]
405
+ .replace('{workspaceRoot}/', '')
406
+ .replace('{projectRoot}', project.root)
407
+ .replace('{projectName}', '');
408
+ if (normalizedOutputPath === newOutputPath ||
409
+ normalizedOutputPath.replace(/\/browser\/?$/, '') === newOutputPath) {
410
+ return false;
411
+ }
412
+ }
413
+ return true;
414
+ };
415
+ const normalizeOutput = (path, workspaceRoot, projectRoot) => {
416
+ const fullProjectRoot = (0, path_1.resolve)(workspaceRoot, projectRoot);
417
+ const fullPath = (0, path_1.resolve)(workspaceRoot, path);
418
+ const pathRelativeToProjectRoot = (0, devkit_1.normalizePath)((0, path_1.relative)(fullProjectRoot, fullPath));
419
+ if (pathRelativeToProjectRoot.startsWith('..')) {
420
+ return (0, devkit_1.joinPathFragments)('{workspaceRoot}', (0, path_1.relative)(workspaceRoot, fullPath));
421
+ }
422
+ return (0, devkit_1.joinPathFragments)('{projectRoot}', pathRelativeToProjectRoot);
423
+ };
424
+ if (shouldOverrideOutputs(buildTarget.config.outputs)) {
425
+ buildTarget.config.outputs = buildTarget.config.outputs.map((output) => {
426
+ if (output === '{options.outputPath}') {
427
+ // the target won't have an outputPath option, so we replace it with the new output path
428
+ return normalizeOutput(newOutputPath, devkit_1.workspaceRoot, project.root);
429
+ }
430
+ const normalizedOutputPath = output
431
+ .replace('{workspaceRoot}/', '')
432
+ .replace('{projectRoot}', project.root)
433
+ .replace('{projectName}', '');
434
+ if (/\/browser\/?$/.test(normalizedOutputPath) &&
435
+ normalizedOutputPath.replace(/\/browser\/?$/, '') === newOutputPath) {
436
+ return normalizeOutput(newOutputPath, devkit_1.workspaceRoot, project.root);
437
+ }
438
+ return output;
439
+ });
440
+ }
441
+ else {
442
+ delete buildTarget.config.outputs;
443
+ }
444
+ if (buildTarget.config.syncGenerators?.length === 1 &&
445
+ buildTarget.config.syncGenerators[0] === '@nx/js:typescript-sync') {
446
+ delete buildTarget.config.syncGenerators;
447
+ }
448
+ else if (buildTarget.config.syncGenerators?.length) {
449
+ buildTarget.config.syncGenerators = Array.from(new Set([
450
+ ...buildTarget.config.syncGenerators,
451
+ '@nx/js:typescript-sync',
452
+ ]));
453
+ }
454
+ if (Object.keys(buildTarget.config).length) {
455
+ // there's extra target metadata left that wouldn't be inferred, we keep it
456
+ project.targets[inferredBuildTargetName] = buildTarget.config;
457
+ }
458
+ }
459
+ if (serveTarget) {
460
+ delete serveTarget.config.options;
461
+ delete serveTarget.config.configurations;
462
+ delete serveTarget.config.defaultConfiguration;
463
+ delete serveTarget.config.executor;
464
+ if (serveTarget.config.continuous) {
465
+ delete serveTarget.config.continuous;
466
+ }
467
+ if (serveTarget.config.syncGenerators?.length === 1 &&
468
+ serveTarget.config.syncGenerators[0] === '@nx/js:typescript-sync') {
469
+ delete serveTarget.config.syncGenerators;
470
+ }
471
+ else if (serveTarget.config.syncGenerators?.length) {
472
+ serveTarget.config.syncGenerators = Array.from(new Set([
473
+ ...serveTarget.config.syncGenerators,
474
+ '@nx/js:typescript-sync',
475
+ ]));
476
+ }
477
+ if (projectServePort !== DEFAULT_PORT) {
478
+ serveTarget.config.options = {};
479
+ serveTarget.config.options.port = projectServePort;
480
+ }
481
+ if (Object.keys(serveTarget.config).length) {
482
+ // there's extra target metadata left that wouldn't be inferred, we keep it
483
+ project.targets[inferredServeTargetName] = serveTarget.config;
484
+ }
485
+ }
486
+ (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
338
487
  // This is needed to prevent a circular execution of the build target
339
488
  const rootPkgJson = (0, devkit_1.readJson)(tree, 'package.json');
340
489
  if (rootPkgJson.scripts?.build === 'nx build') {
@@ -26,22 +26,15 @@ async function default_1(tree) {
26
26
  }
27
27
  function processFile(tree, filePath) {
28
28
  const content = tree.read(filePath, 'utf-8');
29
- if ((!content.includes('provideServerRouting') &&
30
- !content.includes('provideServerRoutesConfig')) ||
29
+ if (!content.includes('provideServerRouting') ||
31
30
  !content.includes('@angular/ssr')) {
32
31
  return;
33
32
  }
34
33
  const sourceFile = tsquery_1.tsquery.ast(content);
35
- const providersArray = tsquery_1.tsquery.query(sourceFile, 'PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression', { visitAllChildren: true })[0];
34
+ const providersArray = tsquery_1.tsquery.query(sourceFile, 'PropertyAssignment:has(Identifier[name=providers]) > ArrayLiteralExpression:has(CallExpression > Identifier[name=provideServerRouting])', { visitAllChildren: true })[0];
36
35
  if (!providersArray) {
37
36
  return;
38
37
  }
39
- if (!providersArray.elements.some((el) => ts.isCallExpression(el) &&
40
- ts.isIdentifier(el.expression) &&
41
- (el.expression.getText() === 'provideServerRouting' ||
42
- el.expression.getText() === 'provideServerRoutesConfig'))) {
43
- return;
44
- }
45
38
  const recorder = new file_change_recorder_1.FileChangeRecorder(tree, filePath);
46
39
  const printer = ts.createPrinter({
47
40
  newLine: ts.NewLineKind.LineFeed,
@@ -53,21 +46,18 @@ function processFile(tree, filePath) {
53
46
  if (node.expression.getText() === 'provideServerRendering') {
54
47
  provideServerRenderingCall = node;
55
48
  }
56
- else if (node.expression.getText() === 'provideServerRouting' ||
57
- node.expression.getText() === 'provideServerRoutesConfig') {
49
+ else if (node.expression.getText() === 'provideServerRouting') {
58
50
  provideServerRoutingCall = node;
59
51
  }
60
52
  }
61
53
  const withRoutesCall = ts.factory.createCallExpression(ts.factory.createIdentifier('withRoutes'), undefined, [provideServerRoutingCall.arguments.at(0)]);
62
54
  let updatedProvidersArray;
63
55
  if (provideServerRenderingCall) {
64
- // remove the "provideServerRouting" and "provideServerRoutesConfig"
65
- // calls and update the existing "provideServerRendering" call
56
+ // remove the "provideServerRouting" call and update the existing "provideServerRendering" call
66
57
  updatedProvidersArray = ts.factory.updateArrayLiteralExpression(providersArray, providersArray.elements
67
58
  .filter((el) => !(ts.isCallExpression(el) &&
68
59
  ts.isIdentifier(el.expression) &&
69
- (el.expression.text === 'provideServerRouting' ||
70
- el.expression.text === 'provideServerRoutesConfig')))
60
+ el.expression.text === 'provideServerRouting'))
71
61
  .map((el) => {
72
62
  if (ts.isCallExpression(el) &&
73
63
  ts.isIdentifier(el.expression) &&
@@ -78,13 +68,11 @@ function processFile(tree, filePath) {
78
68
  }));
79
69
  }
80
70
  else {
81
- // replace the "provideServerRouting" and "provideServerRoutesConfig"
82
- // calls with the new "provideServerRendering" call
71
+ // replace the "provideServerRouting" call with the new "provideServerRendering" call
83
72
  updatedProvidersArray = ts.factory.updateArrayLiteralExpression(providersArray, providersArray.elements.map((el) => {
84
73
  if (ts.isCallExpression(el) &&
85
74
  ts.isIdentifier(el.expression) &&
86
- (el.expression.text === 'provideServerRouting' ||
87
- el.expression.text === 'provideServerRoutesConfig')) {
75
+ el.expression.text === 'provideServerRouting') {
88
76
  return ts.factory.createCallExpression(ts.factory.createIdentifier('provideServerRendering'), undefined, [withRoutesCall, ...provideServerRoutingCall.arguments.slice(1)]);
89
77
  }
90
78
  return el;
@@ -97,12 +85,11 @@ function processFile(tree, filePath) {
97
85
  if (importDecl?.importClause?.namedBindings) {
98
86
  const namedBindings = importDecl?.importClause.namedBindings;
99
87
  if (ts.isNamedImports(namedBindings)) {
100
- // remove the "provideServerRouting" and "provideServerRoutesConfig"
101
- // imports and ensure we have the "withRoutes" import
88
+ // remove the "provideServerRouting" import and ensure we have the "withRoutes" import
102
89
  const updatedElementNames = new Set([
103
90
  ...namedBindings.elements
104
91
  .map((el) => el.getText())
105
- .filter((x) => x !== 'provideServerRouting' && x !== 'provideServerRoutesConfig'),
92
+ .filter((x) => x !== 'provideServerRouting'),
106
93
  'withRoutes',
107
94
  ]);
108
95
  const updatedNamedBindings = ts.factory.updateNamedImports(namedBindings, Array.from(updatedElementNames).map((name) => ts.factory.createImportSpecifier(false, undefined, ts.factory.createIdentifier(name))));
@@ -1,3 +1,3 @@
1
1
  import { Tree } from '@nx/devkit';
2
- export declare const angularCliVersion = "~20.0.0";
2
+ export declare const angularCliVersion = "20.0.0-rc.3";
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 = '~20.0.0';
6
+ exports.angularCliVersion = '20.0.0-rc.3';
7
7
  async function default_1(tree) {
8
8
  let shouldFormat = false;
9
9
  (0, devkit_1.updateJson)(tree, 'package.json', (json) => {
@@ -1,8 +1,8 @@
1
1
  export declare const nxVersion: any;
2
- export declare const angularVersion = "~20.0.0";
3
- export declare const angularDevkitVersion = "~20.0.0";
4
- export declare const ngPackagrVersion = "~20.0.0";
5
- export declare const angularRspackVersion = "^21.1.0";
2
+ export declare const angularVersion = "20.0.0-rc.2";
3
+ export declare const angularDevkitVersion = "20.0.0-rc.3";
4
+ export declare const ngPackagrVersion = "20.0.0-rc.1";
5
+ export declare const angularRspackVersion = "^21.0.1";
6
6
  export declare const ngrxVersion = "^19.0.0";
7
7
  export declare const rxjsVersion = "~7.8.0";
8
8
  export declare const zoneJsVersion = "~0.15.0";
@@ -16,7 +16,7 @@ export declare const browserSyncVersion = "^3.0.0";
16
16
  export declare const moduleFederationNodeVersion = "^2.6.26";
17
17
  export declare const moduleFederationEnhancedVersion = "^0.9.0";
18
18
  export declare const webpackMergeVersion = "^5.8.0";
19
- export declare const angularEslintVersion = "^20.0.0-alpha.1";
19
+ export declare const angularEslintVersion = "^19.2.0";
20
20
  export declare const typescriptEslintVersion = "^7.16.0";
21
21
  export declare const tailwindVersion = "^3.0.2";
22
22
  export declare const postcssVersion = "^8.4.5";
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.angularRspackVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
- exports.angularVersion = '~20.0.0';
6
- exports.angularDevkitVersion = '~20.0.0';
7
- exports.ngPackagrVersion = '~20.0.0';
8
- exports.angularRspackVersion = '^21.1.0';
5
+ exports.angularVersion = '20.0.0-rc.2';
6
+ exports.angularDevkitVersion = '20.0.0-rc.3';
7
+ exports.ngPackagrVersion = '20.0.0-rc.1';
8
+ exports.angularRspackVersion = '^21.0.1';
9
9
  exports.ngrxVersion = '^19.0.0';
10
10
  exports.rxjsVersion = '~7.8.0';
11
11
  exports.zoneJsVersion = '~0.15.0';
@@ -19,7 +19,7 @@ exports.browserSyncVersion = '^3.0.0';
19
19
  exports.moduleFederationNodeVersion = '^2.6.26';
20
20
  exports.moduleFederationEnhancedVersion = '^0.9.0';
21
21
  exports.webpackMergeVersion = '^5.8.0';
22
- exports.angularEslintVersion = '^20.0.0-alpha.1';
22
+ exports.angularEslintVersion = '^19.2.0';
23
23
  exports.typescriptEslintVersion = '^7.16.0';
24
24
  exports.tailwindVersion = '^3.0.2';
25
25
  exports.postcssVersion = '^8.4.5';