@nx/react 17.0.1 → 17.0.2
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 +6 -6
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +2 -1
- package/src/generators/application/lib/add-e2e.js +19 -8
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +1 -0
- package/src/module-federation/utils.js +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "17.0.
|
|
3
|
+
"version": "17.0.2",
|
|
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, 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": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"file-loader": "^6.2.0",
|
|
38
38
|
"minimatch": "3.0.5",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
|
-
"@nx/devkit": "17.0.
|
|
41
|
-
"@nx/js": "17.0.
|
|
42
|
-
"@nx/eslint": "17.0.
|
|
43
|
-
"@nx/web": "17.0.
|
|
44
|
-
"@nrwl/react": "17.0.
|
|
40
|
+
"@nx/devkit": "17.0.2",
|
|
41
|
+
"@nx/js": "17.0.2",
|
|
42
|
+
"@nx/eslint": "17.0.2",
|
|
43
|
+
"@nx/web": "17.0.2",
|
|
44
|
+
"@nrwl/react": "17.0.2"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -15,7 +15,8 @@ function getBuildOptions(buildTarget, context) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
async function* moduleFederationDevServer(options, context) {
|
|
18
|
-
|
|
18
|
+
// Force Node to resolve to look for the nx binary that is inside node_modules
|
|
19
|
+
const nxBin = require.resolve('nx/bin/nx');
|
|
19
20
|
const currIter = options.static
|
|
20
21
|
? (0, file_server_impl_1.default)({
|
|
21
22
|
...options,
|
|
@@ -6,25 +6,35 @@ const web_1 = require("@nx/web");
|
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
|
7
7
|
async function addE2e(tree, options) {
|
|
8
8
|
switch (options.e2eTestRunner) {
|
|
9
|
-
case 'cypress':
|
|
9
|
+
case 'cypress': {
|
|
10
10
|
(0, web_1.webStaticServeGenerator)(tree, {
|
|
11
11
|
buildTarget: `${options.projectName}:build`,
|
|
12
12
|
targetName: 'serve-static',
|
|
13
13
|
});
|
|
14
|
-
const {
|
|
15
|
-
|
|
14
|
+
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
15
|
+
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
16
|
+
projectType: 'application',
|
|
17
|
+
root: options.e2eProjectRoot,
|
|
18
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
19
|
+
targets: {},
|
|
20
|
+
implicitDependencies: [options.projectName],
|
|
21
|
+
tags: [],
|
|
22
|
+
});
|
|
23
|
+
return await configurationGenerator(tree, {
|
|
16
24
|
...options,
|
|
17
|
-
|
|
18
|
-
directory:
|
|
25
|
+
project: options.e2eProjectName,
|
|
26
|
+
directory: 'src',
|
|
19
27
|
// the name and root are already normalized, instruct the generator to use them as is
|
|
20
|
-
projectNameAndRootFormat: 'as-provided',
|
|
21
|
-
project: options.projectName,
|
|
22
28
|
bundler: options.bundler === 'rspack' ? 'webpack' : options.bundler,
|
|
23
29
|
skipFormat: true,
|
|
30
|
+
devServerTarget: `${options.projectName}:serve`,
|
|
31
|
+
jsx: true,
|
|
24
32
|
});
|
|
25
|
-
|
|
33
|
+
}
|
|
34
|
+
case 'playwright': {
|
|
26
35
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
27
36
|
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
37
|
+
projectType: 'application',
|
|
28
38
|
root: options.e2eProjectRoot,
|
|
29
39
|
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
30
40
|
targets: {},
|
|
@@ -41,6 +51,7 @@ async function addE2e(tree, options) {
|
|
|
41
51
|
webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.name}`,
|
|
42
52
|
webServerAddress: 'http://localhost:4200',
|
|
43
53
|
});
|
|
54
|
+
}
|
|
44
55
|
case 'none':
|
|
45
56
|
default:
|
|
46
57
|
return () => { };
|
|
@@ -16,6 +16,7 @@ async function cypressComponentConfigGenerator(tree, options) {
|
|
|
16
16
|
const installTask = await baseCyCtConfig(tree, {
|
|
17
17
|
project: options.project,
|
|
18
18
|
skipFormat: true,
|
|
19
|
+
jsx: true,
|
|
19
20
|
});
|
|
20
21
|
const found = await (0, ct_utils_1.addCTTargetWithBuildTarget)(tree, {
|
|
21
22
|
project: options.project,
|
|
@@ -8,7 +8,13 @@ function getFunctionDeterminateRemoteUrl(isServer = false) {
|
|
|
8
8
|
const target = isServer ? 'serve-server' : 'serve';
|
|
9
9
|
const remoteEntry = isServer ? 'server/remoteEntry.js' : 'remoteEntry.js';
|
|
10
10
|
return function (remote) {
|
|
11
|
-
|
|
11
|
+
let remoteConfiguration = null;
|
|
12
|
+
try {
|
|
13
|
+
remoteConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(remote);
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
throw new Error(`Cannot find remote: "${remote}". Check that the remote name is correct in your module federation config file.\n`);
|
|
17
|
+
}
|
|
12
18
|
const serveTarget = remoteConfiguration?.targets?.[target];
|
|
13
19
|
if (!serveTarget) {
|
|
14
20
|
throw new Error(`Cannot automatically determine URL of remote (${remote}). Looked for property "host" in the project's "${serveTarget}" target.\n
|