@nx/react 18.1.0-beta.2 → 18.1.0-beta.4
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 +4 -2
- package/src/generators/application/lib/add-e2e.js +2 -2
- package/src/generators/application/lib/normalize-options.js +4 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +4 -1
- package/src/generators/host/lib/update-module-federation-e2e-project.js +7 -5
- package/src/generators/library/lib/normalize-options.js +4 -1
- package/src/generators/storybook-configuration/configuration.js +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "18.1.0-beta.
|
|
3
|
+
"version": "18.1.0-beta.4",
|
|
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": {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"chalk": "^4.1.0",
|
|
37
37
|
"minimatch": "9.0.3",
|
|
38
38
|
"tslib": "^2.3.0",
|
|
39
|
-
"@nx/devkit": "18.1.0-beta.
|
|
40
|
-
"@nx/js": "18.1.0-beta.
|
|
41
|
-
"@nx/eslint": "18.1.0-beta.
|
|
42
|
-
"@nx/web": "18.1.0-beta.
|
|
43
|
-
"@nrwl/react": "18.1.0-beta.
|
|
39
|
+
"@nx/devkit": "18.1.0-beta.4",
|
|
40
|
+
"@nx/js": "18.1.0-beta.4",
|
|
41
|
+
"@nx/eslint": "18.1.0-beta.4",
|
|
42
|
+
"@nx/web": "18.1.0-beta.4",
|
|
43
|
+
"@nrwl/react": "18.1.0-beta.4"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
@@ -198,8 +198,10 @@ async function* moduleFederationDevServer(options, context) {
|
|
|
198
198
|
devkit_1.logger.info(`NX All remotes started, server ready at ${baseUrl}`);
|
|
199
199
|
next({ success: true, baseUrl: baseUrl });
|
|
200
200
|
}
|
|
201
|
-
catch {
|
|
202
|
-
throw new Error(`
|
|
201
|
+
catch (err) {
|
|
202
|
+
throw new Error(`Failed to start remotes. Check above for any errors.`, {
|
|
203
|
+
cause: err,
|
|
204
|
+
});
|
|
203
205
|
}
|
|
204
206
|
finally {
|
|
205
207
|
done();
|
|
@@ -34,7 +34,7 @@ async function addE2e(tree, options) {
|
|
|
34
34
|
bundler: options.bundler === 'rspack' ? 'webpack' : options.bundler,
|
|
35
35
|
skipFormat: true,
|
|
36
36
|
devServerTarget: `${options.projectName}:serve`,
|
|
37
|
-
baseUrl:
|
|
37
|
+
baseUrl: `http://localhost:${options.devServerPort ?? 4200}`,
|
|
38
38
|
jsx: true,
|
|
39
39
|
rootProject: options.rootProject,
|
|
40
40
|
webServerCommands: hasNxBuildPlugin
|
|
@@ -66,7 +66,7 @@ async function addE2e(tree, options) {
|
|
|
66
66
|
linter: options.linter,
|
|
67
67
|
setParserOptionsProject: options.setParserOptionsProject,
|
|
68
68
|
webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.name}`,
|
|
69
|
-
webServerAddress:
|
|
69
|
+
webServerAddress: `http://localhost:${options.devServerPort ?? 4200}`,
|
|
70
70
|
rootProject: options.rootProject,
|
|
71
71
|
addPlugin: options.addPlugin,
|
|
72
72
|
});
|
|
@@ -26,7 +26,10 @@ async function normalizeOptions(host, options, callingGenerator = '@nx/react:app
|
|
|
26
26
|
rootProject: options.rootProject,
|
|
27
27
|
callingGenerator,
|
|
28
28
|
});
|
|
29
|
-
|
|
29
|
+
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
30
|
+
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
31
|
+
nxJson.useInferencePlugins !== false;
|
|
32
|
+
options.addPlugin ??= addPlugin;
|
|
30
33
|
options.rootProject = appProjectRoot === '.';
|
|
31
34
|
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
32
35
|
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
@@ -19,7 +19,10 @@ exports.cypressComponentConfigGenerator = cypressComponentConfigGenerator;
|
|
|
19
19
|
*/
|
|
20
20
|
async function cypressComponentConfigGeneratorInternal(tree, options) {
|
|
21
21
|
const { componentConfigurationGenerator: baseCyCtConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
22
|
-
|
|
22
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
23
|
+
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
24
|
+
nxJson.useInferencePlugins !== false;
|
|
25
|
+
options.addPlugin ??= addPlugin;
|
|
23
26
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
24
27
|
const installTask = await baseCyCtConfig(tree, {
|
|
25
28
|
project: options.project,
|
|
@@ -5,11 +5,13 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
function updateModuleFederationE2eProject(host, options) {
|
|
6
6
|
try {
|
|
7
7
|
let projectConfig = (0, devkit_1.readProjectConfiguration)(host, options.e2eProjectName);
|
|
8
|
-
projectConfig.targets.e2e.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
if (projectConfig.targets.e2e.executor !== '@nx/playwright:playwright') {
|
|
9
|
+
projectConfig.targets.e2e.options = {
|
|
10
|
+
...projectConfig.targets.e2e.options,
|
|
11
|
+
baseUrl: `http://localhost:${options.devServerPort}`,
|
|
12
|
+
};
|
|
13
|
+
(0, devkit_1.updateProjectConfiguration)(host, options.e2eProjectName, projectConfig);
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
16
|
catch {
|
|
15
17
|
// nothing
|
|
@@ -13,7 +13,10 @@ async function normalizeOptions(host, options) {
|
|
|
13
13
|
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
14
14
|
callingGenerator: '@nx/react:library',
|
|
15
15
|
});
|
|
16
|
-
|
|
16
|
+
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
17
|
+
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
18
|
+
nxJson.useInferencePlugins !== false;
|
|
19
|
+
options.addPlugin ??= addPlugin;
|
|
17
20
|
const fileName = options.simpleName
|
|
18
21
|
? projectNames.projectSimpleName
|
|
19
22
|
: projectNames.projectFileName;
|
|
@@ -28,7 +28,10 @@ function storybookConfigurationGenerator(host, schema) {
|
|
|
28
28
|
}
|
|
29
29
|
exports.storybookConfigurationGenerator = storybookConfigurationGenerator;
|
|
30
30
|
async function storybookConfigurationGeneratorInternal(host, schema) {
|
|
31
|
-
|
|
31
|
+
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
32
|
+
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
33
|
+
nxJson.useInferencePlugins !== false;
|
|
34
|
+
schema.addPlugin ??= addPluginDefault;
|
|
32
35
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
|
|
33
36
|
let uiFramework = '@storybook/react-vite';
|
|
34
37
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.project);
|