@nx/angular 21.0.4-beta.0 → 21.1.0-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "21.0.4-beta.0",
3
+ "version": "21.1.0-beta.1",
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": {
@@ -67,14 +67,14 @@
67
67
  "semver": "^7.5.3",
68
68
  "tslib": "^2.3.0",
69
69
  "webpack-merge": "^5.8.0",
70
- "@nx/devkit": "21.0.4-beta.0",
71
- "@nx/js": "21.0.4-beta.0",
72
- "@nx/eslint": "21.0.4-beta.0",
73
- "@nx/webpack": "21.0.4-beta.0",
74
- "@nx/rspack": "21.0.4-beta.0",
75
- "@nx/module-federation": "21.0.4-beta.0",
76
- "@nx/web": "21.0.4-beta.0",
77
- "@nx/workspace": "21.0.4-beta.0",
70
+ "@nx/devkit": "21.1.0-beta.1",
71
+ "@nx/js": "21.1.0-beta.1",
72
+ "@nx/eslint": "21.1.0-beta.1",
73
+ "@nx/webpack": "21.1.0-beta.1",
74
+ "@nx/rspack": "21.1.0-beta.1",
75
+ "@nx/module-federation": "21.1.0-beta.1",
76
+ "@nx/web": "21.1.0-beta.1",
77
+ "@nx/workspace": "21.1.0-beta.1",
78
78
  "piscina": "^4.4.0"
79
79
  },
80
80
  "peerDependencies": {
@@ -44,7 +44,7 @@ async function createFiles(tree, options, rootOffset) {
44
44
  connectCloudUrl,
45
45
  tutorialUrl: options.standalone
46
46
  ? 'https://nx.dev/getting-started/tutorials/angular-standalone-tutorial?utm_source=nx-project'
47
- : 'https://nx.dev/tutorials/3-angular-monorepo/1a-introduction/1-welcome?utm_source=nx-project',
47
+ : 'https://nx.dev/getting-started/tutorials/angular-monorepo-tutorial?utm_source=nx-project',
48
48
  tpl: '',
49
49
  };
50
50
  const angularAppType = options.standalone ? 'standalone' : 'ng-module';
@@ -15,6 +15,8 @@ const SUPPORTED_EXECUTORS = [
15
15
  '@angular-devkit/build-angular:browser',
16
16
  '@angular-devkit/build-angular:dev-server',
17
17
  '@angular-devkit/build-angular:server',
18
+ '@angular-devkit/build-angular:prerender',
19
+ '@angular-devkit/build-angular:app-shell',
18
20
  '@nx/angular:webpack-browser',
19
21
  '@nx/angular:webpack-server',
20
22
  '@nx/angular:dev-server',
@@ -293,6 +295,31 @@ async function convertToRspack(tree, schema) {
293
295
  }
294
296
  serveTargetNames.push(targetName);
295
297
  }
298
+ else if (target.executor === '@angular-devkit/build-angular:prerender') {
299
+ if (target.options) {
300
+ const prerenderOptions = {
301
+ routesFile: target.options.routesFile,
302
+ discoverRoutes: target.options.discoverRoutes ?? true,
303
+ routes: target.options.routes ?? [],
304
+ };
305
+ createConfigOptions.prerender = prerenderOptions;
306
+ if (target.configurations) {
307
+ for (const [configurationName, configuration] of Object.entries(target.configurations)) {
308
+ configurationOptions[configurationName] ??= {};
309
+ configurationOptions[configurationName].prerender ??= {
310
+ routesFile: configuration.routesFile,
311
+ discoverRoutes: configuration.discoverRoutes ?? true,
312
+ routes: configuration.routes ?? [],
313
+ };
314
+ }
315
+ }
316
+ }
317
+ buildTargetNames.push(targetName);
318
+ }
319
+ else if (target.executor === '@angular-devkit/build-angular:app-shell') {
320
+ createConfigOptions.appShell = true;
321
+ buildTargetNames.push(targetName);
322
+ }
296
323
  }
297
324
  const customWebpackConfigInfo = customWebpackConfigPath
298
325
  ? await (0, get_custom_webpack_config_1.getCustomWebpackConfig)(tree, project.root, customWebpackConfigPath)
@@ -311,6 +338,7 @@ async function convertToRspack(tree, schema) {
311
338
  const { rspackInitGenerator } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
312
339
  await rspackInitGenerator(tree, {
313
340
  addPlugin: true,
341
+ framework: 'angular',
314
342
  });
315
343
  // This is needed to prevent a circular execution of the build target
316
344
  const rootPkgJson = (0, devkit_1.readJson)(tree, 'package.json');
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addVitest = addVitest;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("../../utils/versions");
6
+ const version_utils_1 = require("./version-utils");
6
7
  async function addVitest(tree, options) {
7
8
  const { vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
8
9
  await vitestGenerator(tree, {
@@ -12,4 +13,9 @@ async function addVitest(tree, options) {
12
13
  coverageProvider: 'v8',
13
14
  addPlugin: options.addPlugin ?? false,
14
15
  });
16
+ if (!options.skipPackageJson) {
17
+ const angularDevkitVersion = (0, version_utils_1.getInstalledAngularDevkitVersion)(tree) ??
18
+ (0, version_utils_1.versions)(tree).angularDevkitVersion;
19
+ (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/build': angularDevkitVersion }, undefined, true);
20
+ }
15
21
  }
@@ -1,5 +1,6 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  import { type PackageCompatVersions, type PackageLatestVersions } from '../../utils/backward-compatible-versions';
3
+ export declare function getInstalledAngularDevkitVersion(tree: Tree): string | null;
3
4
  export declare function getInstalledAngularVersion(tree: Tree): string;
4
5
  export declare function getInstalledAngularMajorVersion(tree: Tree): number;
5
6
  export declare function getInstalledAngularVersionInfo(tree: Tree): {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getInstalledAngularDevkitVersion = getInstalledAngularDevkitVersion;
3
4
  exports.getInstalledAngularVersion = getInstalledAngularVersion;
4
5
  exports.getInstalledAngularMajorVersion = getInstalledAngularMajorVersion;
5
6
  exports.getInstalledAngularVersionInfo = getInstalledAngularVersionInfo;
@@ -12,6 +13,10 @@ const semver_1 = require("semver");
12
13
  const backward_compatible_versions_1 = require("../../utils/backward-compatible-versions");
13
14
  const latestVersions = tslib_1.__importStar(require("../../utils/versions"));
14
15
  const versions_1 = require("../../utils/versions");
16
+ function getInstalledAngularDevkitVersion(tree) {
17
+ return (getInstalledPackageVersion(tree, '@angular-devkit/build-angular') ??
18
+ getInstalledPackageVersion(tree, '@angular/build'));
19
+ }
15
20
  function getInstalledAngularVersion(tree) {
16
21
  const pkgJson = (0, devkit_1.readJson)(tree, 'package.json');
17
22
  const installedAngularVersion = pkgJson.dependencies && pkgJson.dependencies['@angular/core'];