@nx/angular 20.8.0-canary.20250409-7b85d91 → 20.8.0-rc.0

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": "20.8.0-canary.20250409-7b85d91",
3
+ "version": "20.8.0-rc.0",
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": {
@@ -72,14 +72,14 @@
72
72
  "semver": "^7.5.3",
73
73
  "tslib": "^2.3.0",
74
74
  "webpack-merge": "^5.8.0",
75
- "@nx/devkit": "20.8.0-canary.20250409-7b85d91",
76
- "@nx/js": "20.8.0-canary.20250409-7b85d91",
77
- "@nx/eslint": "20.8.0-canary.20250409-7b85d91",
78
- "@nx/webpack": "20.8.0-canary.20250409-7b85d91",
79
- "@nx/rspack": "20.8.0-canary.20250409-7b85d91",
80
- "@nx/module-federation": "20.8.0-canary.20250409-7b85d91",
81
- "@nx/web": "20.8.0-canary.20250409-7b85d91",
82
- "@nx/workspace": "20.8.0-canary.20250409-7b85d91",
75
+ "@nx/devkit": "20.8.0-rc.0",
76
+ "@nx/js": "20.8.0-rc.0",
77
+ "@nx/eslint": "20.8.0-rc.0",
78
+ "@nx/webpack": "20.8.0-rc.0",
79
+ "@nx/rspack": "20.8.0-rc.0",
80
+ "@nx/module-federation": "20.8.0-rc.0",
81
+ "@nx/web": "20.8.0-rc.0",
82
+ "@nx/workspace": "20.8.0-rc.0",
83
83
  "piscina": "^4.4.0"
84
84
  },
85
85
  "peerDependencies": {
@@ -22,7 +22,7 @@ async function addLintingGenerator(tree, options) {
22
22
  setParserOptionsProject: options.setParserOptionsProject,
23
23
  skipFormat: true,
24
24
  rootProject: rootProject,
25
- addPlugin: false,
25
+ addPlugin: options.addPlugin ?? false,
26
26
  addExplicitTargets: true,
27
27
  skipPackageJson: options.skipPackageJson,
28
28
  });
@@ -6,4 +6,5 @@ export interface AddLintingGeneratorSchema {
6
6
  skipFormat?: boolean;
7
7
  skipPackageJson?: boolean;
8
8
  unitTestRunner?: string;
9
+ addPlugin?: boolean;
9
10
  }
@@ -17,7 +17,7 @@ async function applicationGenerator(tree, schema) {
17
17
  if (isRspack) {
18
18
  schema.bundler = 'webpack';
19
19
  }
20
- const options = await (0, lib_1.normalizeOptions)(tree, schema);
20
+ const options = await (0, lib_1.normalizeOptions)(tree, schema, isRspack);
21
21
  const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
22
22
  await (0, js_1.initGenerator)(tree, {
23
23
  ...options,
@@ -28,6 +28,7 @@ async function applicationGenerator(tree, schema) {
28
28
  await (0, init_1.angularInitGenerator)(tree, {
29
29
  ...options,
30
30
  skipFormat: true,
31
+ addPlugin: options.addPlugin,
31
32
  });
32
33
  if (!options.skipPackageJson) {
33
34
  (0, ensure_angular_dependencies_1.ensureAngularDependencies)(tree);
@@ -7,8 +7,8 @@ const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaul
7
7
  async function addE2e(tree, options) {
8
8
  // since e2e are separate projects, default to adding plugins
9
9
  const nxJson = (0, devkit_1.readNxJson)(tree);
10
- const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
11
- nxJson.useInferencePlugins !== false;
10
+ const addPlugin = nxJson['useInferencePlugins'] !== false &&
11
+ process.env.NX_ADD_PLUGINS !== 'false';
12
12
  const e2eWebServerInfo = getAngularE2EWebServerInfo(tree, options.name, options.port);
13
13
  if (options.e2eTestRunner === 'cypress') {
14
14
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
@@ -16,5 +16,6 @@ async function addLinting(host, options) {
16
16
  skipPackageJson: options.skipPackageJson,
17
17
  unitTestRunner: options.unitTestRunner,
18
18
  skipFormat: true,
19
+ addPlugin: options.addPlugin,
19
20
  });
20
21
  }
@@ -12,6 +12,7 @@ async function addUnitTestRunner(host, options) {
12
12
  projectRoot: options.appProjectRoot,
13
13
  skipPackageJson: options.skipPackageJson,
14
14
  strict: options.strict,
15
+ addPlugin: options.addPlugin,
15
16
  });
16
17
  break;
17
18
  case test_runners_1.UnitTestRunner.Vitest:
@@ -20,6 +21,7 @@ async function addUnitTestRunner(host, options) {
20
21
  projectRoot: options.appProjectRoot,
21
22
  skipPackageJson: options.skipPackageJson,
22
23
  strict: options.strict,
24
+ addPlugin: options.addPlugin,
23
25
  });
24
26
  break;
25
27
  }
@@ -1,4 +1,4 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  import type { Schema } from '../schema';
3
3
  import type { NormalizedSchema } from './normalized-schema';
4
- export declare function normalizeOptions(host: Tree, options: Partial<Schema>): Promise<NormalizedSchema>;
4
+ export declare function normalizeOptions(host: Tree, options: Partial<Schema>, isRspack?: boolean): Promise<NormalizedSchema>;
@@ -5,7 +5,12 @@ const devkit_1 = require("@nx/devkit");
5
5
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
6
  const eslint_1 = require("@nx/eslint");
7
7
  const test_runners_1 = require("../../../utils/test-runners");
8
- async function normalizeOptions(host, options) {
8
+ function arePluginsExplicitlyDisabled(host) {
9
+ const { useInferencePlugins } = (0, devkit_1.readNxJson)(host);
10
+ const addPluginEnvVar = process.env.NX_ADD_PLUGINS;
11
+ return useInferencePlugins === false || addPluginEnvVar === 'false';
12
+ }
13
+ async function normalizeOptions(host, options, isRspack) {
9
14
  await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
10
15
  const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
11
16
  name: options.name,
@@ -20,8 +25,10 @@ async function normalizeOptions(host, options) {
20
25
  ? options.tags.split(',').map((s) => s.trim())
21
26
  : [];
22
27
  const bundler = options.bundler ?? 'esbuild';
28
+ const addPlugin = options.addPlugin ?? (!arePluginsExplicitlyDisabled(host) && isRspack);
23
29
  // Set defaults and then overwrite with user options
24
30
  return {
31
+ addPlugin,
25
32
  style: 'css',
26
33
  routing: true,
27
34
  inlineStyle: false,
@@ -31,4 +31,5 @@ export interface Schema {
31
31
  ssr?: boolean;
32
32
  serverRouting?: boolean;
33
33
  nxCloudToken?: string;
34
+ addPlugin?: boolean;
34
35
  }
@@ -6,7 +6,7 @@ const versions_1 = require("../../utils/versions");
6
6
  const storybook_inputs_1 = require("../utils/storybook-ast/storybook-inputs");
7
7
  async function componentTestGenerator(tree, options) {
8
8
  (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
9
- const { assertMinimumCypressVersion } = require('@nx/cypress/src/utils/cypress-version');
9
+ const { assertMinimumCypressVersion } = require('@nx/cypress/src/utils/versions');
10
10
  assertMinimumCypressVersion(10);
11
11
  const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
12
12
  const componentDirPath = (0, devkit_1.joinPathFragments)(root, options.componentDir);
@@ -282,8 +282,8 @@ async function convertToRspack(tree, schema) {
282
282
  handleDevServerTargetOptions(tree, configuration, configurationOptions[configurationName].devServer, project.root);
283
283
  }
284
284
  }
285
+ serveTargetNames.push(targetName);
285
286
  }
286
- serveTargetNames.push(targetName);
287
287
  }
288
288
  const customWebpackConfigInfo = customWebpackConfigPath
289
289
  ? await (0, get_custom_webpack_config_1.getCustomWebpackConfig)(tree, project.root, customWebpackConfigPath)
@@ -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,
@@ -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
  }