@nx/react 20.8.0-canary.20250408-32b48a3 → 20.8.0-canary.20250412-07ad2d7

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/react",
3
- "version": "20.8.0-canary.20250408-32b48a3",
3
+ "version": "20.8.0-canary.20250412-07ad2d7",
4
4
  "private": false,
5
5
  "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -38,11 +38,11 @@
38
38
  "minimatch": "9.0.3",
39
39
  "picocolors": "^1.1.0",
40
40
  "tslib": "^2.3.0",
41
- "@nx/devkit": "20.8.0-canary.20250408-32b48a3",
42
- "@nx/js": "20.8.0-canary.20250408-32b48a3",
43
- "@nx/eslint": "20.8.0-canary.20250408-32b48a3",
44
- "@nx/web": "20.8.0-canary.20250408-32b48a3",
45
- "@nx/module-federation": "20.8.0-canary.20250408-32b48a3",
41
+ "@nx/devkit": "20.8.0-canary.20250412-07ad2d7",
42
+ "@nx/js": "20.8.0-canary.20250412-07ad2d7",
43
+ "@nx/eslint": "20.8.0-canary.20250412-07ad2d7",
44
+ "@nx/web": "20.8.0-canary.20250412-07ad2d7",
45
+ "@nx/module-federation": "20.8.0-canary.20250412-07ad2d7",
46
46
  "express": "^4.21.2",
47
47
  "http-proxy-middleware": "^3.0.3",
48
48
  "semver": "^7.6.3"
@@ -10,7 +10,7 @@ const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescri
10
10
  let tsModule;
11
11
  async function componentTestGenerator(tree, options) {
12
12
  (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
13
- const { assertMinimumCypressVersion } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/cypress-version'));
13
+ const { assertMinimumCypressVersion } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/versions'));
14
14
  assertMinimumCypressVersion(10);
15
15
  // normalize any windows paths
16
16
  options.componentPath = options.componentPath.replace(/\\/g, '/');
@@ -1,4 +1,4 @@
1
+ import type { FoundTarget } from '@nx/cypress/src/utils/find-target-options';
1
2
  import { ProjectConfiguration, Tree } from '@nx/devkit';
2
3
  import type { CypressComponentConfigurationSchema } from '../schema';
3
- import { FoundTarget } from '@nx/cypress/src/utils/find-target-options';
4
4
  export declare function addFiles(tree: Tree, projectConfig: ProjectConfiguration, options: CypressComponentConfigurationSchema, found: FoundTarget): Promise<void>;
@@ -3,12 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addFiles = addFiles;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("nx/src/utils/versions");
6
- const component_test_1 = require("../../component-test/component-test");
7
6
  const ct_utils_1 = require("../../../utils/ct-utils");
7
+ const component_test_1 = require("../../component-test/component-test");
8
8
  async function addFiles(tree, projectConfig, options, found) {
9
- // must dyanmicaly import to prevent packages not using cypress from erroring out
9
+ // must dynamicaly import to prevent packages not using cypress from erroring out
10
10
  // when importing react
11
- const { addMountDefinition, addDefaultCTConfig } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/config'));
11
+ const { addMountDefinition } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/config'));
12
+ const { getInstalledCypressMajorVersion } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/versions'));
13
+ const installedCypressMajorVersion = getInstalledCypressMajorVersion(tree);
12
14
  // Specifically undefined to allow Remix workaround of passing an empty string
13
15
  const actualBundler = await (0, ct_utils_1.getActualBundler)(tree, options, found);
14
16
  if (options.bundler && options.bundler !== actualBundler) {
@@ -18,7 +20,8 @@ async function addFiles(tree, projectConfig, options, found) {
18
20
  const bundlerToUse = options.bundler ?? actualBundler;
19
21
  const commandFile = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress', 'support', 'component.ts');
20
22
  const updatedCommandFile = await addMountDefinition(tree.read(commandFile, 'utf-8'));
21
- tree.write(commandFile, `import { mount } from 'cypress/react18';\n${updatedCommandFile}`);
23
+ const moduleSpecifier = installedCypressMajorVersion >= 14 ? 'cypress/react' : 'cypress/react18';
24
+ tree.write(commandFile, `import { mount } from '${moduleSpecifier}';\n${updatedCommandFile}`);
22
25
  if (options.bundler === 'webpack' ||
23
26
  (!options.bundler && actualBundler === 'webpack')) {
24
27
  (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nx/webpack': versions_1.nxVersion });
@@ -2,28 +2,29 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.libraryGenerator = libraryGenerator;
4
4
  exports.libraryGeneratorInternal = libraryGeneratorInternal;
5
- const path_1 = require("path");
6
5
  const devkit_1 = require("@nx/devkit");
7
6
  const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
8
7
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
9
8
  const js_1 = require("@nx/js");
10
- const versions_1 = require("../../utils/versions");
9
+ const path_1 = require("path");
10
+ const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
11
+ const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
12
+ const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
13
+ const use_legacy_versioning_1 = require("nx/src/command-line/release/config/use-legacy-versioning");
14
+ const create_ts_config_1 = require("../../utils/create-ts-config");
15
+ const jest_utils_1 = require("../../utils/jest-utils");
11
16
  const maybe_js_1 = require("../../utils/maybe-js");
17
+ const versions_1 = require("../../utils/versions");
12
18
  const component_1 = require("../component/component");
13
19
  const init_1 = require("../init/init");
14
- const jest_utils_1 = require("../../utils/jest-utils");
15
- const normalize_options_1 = require("./lib/normalize-options");
16
- const add_rollup_build_target_1 = require("./lib/add-rollup-build-target");
17
20
  const add_linting_1 = require("./lib/add-linting");
18
- const update_app_routes_1 = require("./lib/update-app-routes");
21
+ const add_rollup_build_target_1 = require("./lib/add-rollup-build-target");
19
22
  const create_files_1 = require("./lib/create-files");
20
- const create_ts_config_1 = require("../../utils/create-ts-config");
23
+ const determine_entry_fields_1 = require("./lib/determine-entry-fields");
21
24
  const install_common_dependencies_1 = require("./lib/install-common-dependencies");
25
+ const normalize_options_1 = require("./lib/normalize-options");
22
26
  const set_defaults_1 = require("./lib/set-defaults");
23
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
24
- const determine_entry_fields_1 = require("./lib/determine-entry-fields");
25
- const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
26
- const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
27
+ const update_app_routes_1 = require("./lib/update-app-routes");
27
28
  async function libraryGenerator(host, schema) {
28
29
  return await libraryGeneratorInternal(host, {
29
30
  addPlugin: false,
@@ -196,7 +197,8 @@ async function libraryGeneratorInternal(host, schema) {
196
197
  await (0, add_release_config_1.addReleaseConfigForTsSolution)(host, options.name, projectConfiguration);
197
198
  }
198
199
  else {
199
- await (0, add_release_config_1.addReleaseConfigForNonTsSolution)(host, options.name, projectConfiguration);
200
+ const nxJson = (0, devkit_1.readNxJson)(host);
201
+ await (0, add_release_config_1.addReleaseConfigForNonTsSolution)((0, use_legacy_versioning_1.shouldUseLegacyVersioning)(nxJson.release), host, options.name, projectConfiguration);
200
202
  }
201
203
  (0, devkit_1.updateProjectConfiguration)(host, options.name, projectConfiguration);
202
204
  tasks.push(await (0, add_release_config_1.releaseTasks)(host));