@nx/react 19.8.0-beta.1 → 19.8.0-beta.3
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/generators/host/host.js +1 -0
- package/src/generators/host/lib/add-module-federation-files.js +2 -2
- package/src/generators/remote/lib/setup-tspath-for-remote.d.ts +2 -2
- package/src/generators/remote/lib/setup-tspath-for-remote.js +2 -2
- package/src/generators/remote/remote.js +5 -4
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/react",
|
3
|
-
"version": "19.8.0-beta.
|
3
|
+
"version": "19.8.0-beta.3",
|
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,13 +39,13 @@
|
|
39
39
|
"minimatch": "9.0.3",
|
40
40
|
"tslib": "^2.3.0",
|
41
41
|
"@module-federation/enhanced": "~0.6.0",
|
42
|
-
"@nx/devkit": "19.8.0-beta.
|
43
|
-
"@nx/js": "19.8.0-beta.
|
44
|
-
"@nx/eslint": "19.8.0-beta.
|
45
|
-
"@nx/web": "19.8.0-beta.
|
42
|
+
"@nx/devkit": "19.8.0-beta.3",
|
43
|
+
"@nx/js": "19.8.0-beta.3",
|
44
|
+
"@nx/eslint": "19.8.0-beta.3",
|
45
|
+
"@nx/web": "19.8.0-beta.3",
|
46
46
|
"express": "^4.19.2",
|
47
47
|
"http-proxy-middleware": "^3.0.0",
|
48
|
-
"@nrwl/react": "19.8.0-beta.
|
48
|
+
"@nrwl/react": "19.8.0-beta.3"
|
49
49
|
},
|
50
50
|
"publishConfig": {
|
51
51
|
"access": "public"
|
@@ -46,6 +46,7 @@ async function hostGeneratorInternal(host, schema) {
|
|
46
46
|
}
|
47
47
|
const initTask = await (0, application_1.default)(host, {
|
48
48
|
...options,
|
49
|
+
name: options.projectName,
|
49
50
|
// The target use-case is loading remotes as child routes, thus always enable routing.
|
50
51
|
routing: true,
|
51
52
|
skipFormat: true,
|
@@ -5,7 +5,7 @@ const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const maybe_js_1 = require("../../../utils/maybe-js");
|
6
6
|
function addModuleFederationFiles(host, options, defaultRemoteManifest) {
|
7
7
|
const templateVariables = {
|
8
|
-
...(0, devkit_1.names)(options.
|
8
|
+
...(0, devkit_1.names)(options.projectName),
|
9
9
|
...options,
|
10
10
|
static: !options?.dynamic,
|
11
11
|
tmpl: '',
|
@@ -16,7 +16,7 @@ function addModuleFederationFiles(host, options, defaultRemoteManifest) {
|
|
16
16
|
};
|
17
17
|
}),
|
18
18
|
};
|
19
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, options.
|
19
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
|
20
20
|
const pathToMFManifest = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, 'assets/module-federation.manifest.json');
|
21
21
|
// Module federation requires bootstrap code to be dynamically imported.
|
22
22
|
// Renaming original entry file so we can use `import(./bootstrap)` in
|
@@ -1,3 +1,3 @@
|
|
1
1
|
import type { Tree } from '@nx/devkit';
|
2
|
-
import
|
3
|
-
export declare function setupTspathForRemote(tree: Tree, options:
|
2
|
+
import { NormalizedSchema } from '../../application/schema';
|
3
|
+
export declare function setupTspathForRemote(tree: Tree, options: NormalizedSchema): void;
|
@@ -5,10 +5,10 @@ const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
6
6
|
const maybe_js_1 = require("../../../utils/maybe-js");
|
7
7
|
function setupTspathForRemote(tree, options) {
|
8
|
-
const project = (0, devkit_1.readProjectConfiguration)(tree, options.
|
8
|
+
const project = (0, devkit_1.readProjectConfiguration)(tree, options.projectName);
|
9
9
|
const exportPath = (0, maybe_js_1.maybeJs)(options, './src/remote-entry.ts');
|
10
10
|
const exportName = 'Module';
|
11
|
-
(0, js_1.addTsConfigPath)(tree, `${options.
|
11
|
+
(0, js_1.addTsConfigPath)(tree, `${options.projectName}/${exportName}`, [
|
12
12
|
(0, devkit_1.joinPathFragments)(project.root, exportPath),
|
13
13
|
]);
|
14
14
|
}
|
@@ -19,7 +19,7 @@ const js_1 = require("@nx/js");
|
|
19
19
|
const versions_1 = require("../../utils/versions");
|
20
20
|
function addModuleFederationFiles(host, options) {
|
21
21
|
const templateVariables = {
|
22
|
-
...(0, devkit_1.names)(options.
|
22
|
+
...(0, devkit_1.names)(options.projectName),
|
23
23
|
...options,
|
24
24
|
tmpl: '',
|
25
25
|
};
|
@@ -68,13 +68,14 @@ async function remoteGeneratorInternal(host, schema) {
|
|
68
68
|
if (options.dynamic) {
|
69
69
|
// Dynamic remotes generate with library { type: 'var' } by default.
|
70
70
|
// We need to ensure that the remote name is a valid variable name.
|
71
|
-
const isValidRemote = (0, js_1.isValidVariable)(options.
|
71
|
+
const isValidRemote = (0, js_1.isValidVariable)(options.projectName);
|
72
72
|
if (!isValidRemote.isValid) {
|
73
|
-
throw new Error(`Invalid remote name provided: ${options.
|
73
|
+
throw new Error(`Invalid remote name provided: ${options.projectName}. ${isValidRemote.message}`);
|
74
74
|
}
|
75
75
|
}
|
76
76
|
const initAppTask = await (0, application_1.default)(host, {
|
77
77
|
...options,
|
78
|
+
name: options.projectName,
|
78
79
|
skipFormat: true,
|
79
80
|
});
|
80
81
|
tasks.push(initAppTask);
|
@@ -115,7 +116,7 @@ async function remoteGeneratorInternal(host, schema) {
|
|
115
116
|
if (options.host && options.dynamic) {
|
116
117
|
const hostConfig = (0, devkit_1.readProjectConfiguration)(host, schema.host);
|
117
118
|
const pathToMFManifest = (0, devkit_1.joinPathFragments)(hostConfig.sourceRoot, 'assets/module-federation.manifest.json');
|
118
|
-
(0, add_remote_to_dynamic_host_1.addRemoteToDynamicHost)(host, options.
|
119
|
+
(0, add_remote_to_dynamic_host_1.addRemoteToDynamicHost)(host, options.projectName, options.devServerPort, pathToMFManifest);
|
119
120
|
}
|
120
121
|
(0, add_mf_env_to_inputs_1.addMfEnvToTargetDefaultInputs)(host);
|
121
122
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, { '@module-federation/enhanced': versions_1.moduleFederationEnhancedVersion });
|