@nx/react 19.6.0-canary.20240806-a3869a8 → 19.6.0-canary.20240808-333ab77
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": "19.6.0-canary.
|
3
|
+
"version": "19.6.0-canary.20240808-333ab77",
|
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": {
|
@@ -39,11 +39,11 @@
|
|
39
39
|
"minimatch": "9.0.3",
|
40
40
|
"tslib": "^2.3.0",
|
41
41
|
"@module-federation/enhanced": "~0.2.3",
|
42
|
-
"@nx/devkit": "19.6.0-canary.
|
43
|
-
"@nx/js": "19.6.0-canary.
|
44
|
-
"@nx/eslint": "19.6.0-canary.
|
45
|
-
"@nx/web": "19.6.0-canary.
|
46
|
-
"@nrwl/react": "19.6.0-canary.
|
42
|
+
"@nx/devkit": "19.6.0-canary.20240808-333ab77",
|
43
|
+
"@nx/js": "19.6.0-canary.20240808-333ab77",
|
44
|
+
"@nx/eslint": "19.6.0-canary.20240808-333ab77",
|
45
|
+
"@nx/web": "19.6.0-canary.20240808-333ab77",
|
46
|
+
"@nrwl/react": "19.6.0-canary.20240808-333ab77"
|
47
47
|
},
|
48
48
|
"publishConfig": {
|
49
49
|
"access": "public"
|
@@ -6,6 +6,8 @@ const web_1 = require("@nx/web");
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
7
7
|
const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
|
8
8
|
const has_vite_plugin_1 = require("../../../utils/has-vite-plugin");
|
9
|
+
const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
|
10
|
+
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
9
11
|
async function addE2e(tree, options) {
|
10
12
|
const hasNxBuildPlugin = (options.bundler === 'webpack' && (0, has_webpack_plugin_1.hasWebpackPlugin)(tree)) ||
|
11
13
|
(options.bundler === 'vite' && (0, has_vite_plugin_1.hasVitePlugin)(tree));
|
@@ -27,7 +29,7 @@ async function addE2e(tree, options) {
|
|
27
29
|
implicitDependencies: [options.projectName],
|
28
30
|
tags: [],
|
29
31
|
});
|
30
|
-
|
32
|
+
const e2eTask = await configurationGenerator(tree, {
|
31
33
|
...options,
|
32
34
|
project: options.e2eProjectName,
|
33
35
|
directory: 'src',
|
@@ -49,6 +51,25 @@ async function addE2e(tree, options) {
|
|
49
51
|
: undefined,
|
50
52
|
ciBaseUrl: options.bundler === 'vite' ? options.e2eCiBaseUrl : undefined,
|
51
53
|
});
|
54
|
+
if (options.addPlugin ||
|
55
|
+
(0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
56
|
+
? p === '@nx/cypress/plugin'
|
57
|
+
: p.plugin === '@nx/cypress/plugin')) {
|
58
|
+
let buildTarget = '^build';
|
59
|
+
if (hasNxBuildPlugin) {
|
60
|
+
const configFile = options.bundler === 'webpack'
|
61
|
+
? 'webpack.config.js'
|
62
|
+
: options.bundler === 'vite'
|
63
|
+
? `vite.config.${options.js ? 'js' : 'ts'}`
|
64
|
+
: 'webpack.config.js';
|
65
|
+
const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/${options.bundler}/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, configFile));
|
66
|
+
if (matchingPlugin && typeof matchingPlugin !== 'string') {
|
67
|
+
buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/cypress/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `cypress.config.${options.js ? 'js' : 'ts'}`));
|
71
|
+
}
|
72
|
+
return e2eTask;
|
52
73
|
}
|
53
74
|
case 'playwright': {
|
54
75
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
@@ -59,7 +80,7 @@ async function addE2e(tree, options) {
|
|
59
80
|
targets: {},
|
60
81
|
implicitDependencies: [options.projectName],
|
61
82
|
});
|
62
|
-
|
83
|
+
const e2eTask = await configurationGenerator(tree, {
|
63
84
|
project: options.e2eProjectName,
|
64
85
|
skipFormat: true,
|
65
86
|
skipPackageJson: options.skipPackageJson,
|
@@ -72,6 +93,25 @@ async function addE2e(tree, options) {
|
|
72
93
|
rootProject: options.rootProject,
|
73
94
|
addPlugin: options.addPlugin,
|
74
95
|
});
|
96
|
+
if (options.addPlugin ||
|
97
|
+
(0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
98
|
+
? p === '@nx/playwright/plugin'
|
99
|
+
: p.plugin === '@nx/playwright/plugin')) {
|
100
|
+
let buildTarget = '^build';
|
101
|
+
if (hasNxBuildPlugin) {
|
102
|
+
const configFile = options.bundler === 'webpack'
|
103
|
+
? 'webpack.config.js'
|
104
|
+
: options.bundler === 'vite'
|
105
|
+
? `vite.config.${options.js ? 'js' : 'ts'}`
|
106
|
+
: 'webpack.config.js';
|
107
|
+
const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/${options.bundler}/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, configFile));
|
108
|
+
if (matchingPlugin && typeof matchingPlugin !== 'string') {
|
109
|
+
buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
|
110
|
+
}
|
111
|
+
}
|
112
|
+
await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/playwright/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `playwright.config.ts`));
|
113
|
+
}
|
114
|
+
return e2eTask;
|
75
115
|
}
|
76
116
|
case 'none':
|
77
117
|
default:
|