@nx/react 20.8.0-canary.20250409-7b85d91 → 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.
|
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.
|
42
|
-
"@nx/js": "20.8.0-canary.
|
43
|
-
"@nx/eslint": "20.8.0-canary.
|
44
|
-
"@nx/web": "20.8.0-canary.
|
45
|
-
"@nx/module-federation": "20.8.0-canary.
|
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/
|
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
|
9
|
+
// must dynamicaly import to prevent packages not using cypress from erroring out
|
10
10
|
// when importing react
|
11
|
-
const { addMountDefinition
|
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
|
-
|
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 });
|