@nx/react 19.0.3 → 19.1.0-beta.0
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/migrations.json +9 -0
- package/package.json +6 -6
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +4 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +7 -3
- package/src/executors/module-federation-dev-server/schema.json +20 -2
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
package/migrations.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.1.0-beta.0",
|
|
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": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"file-loader": "^6.2.0",
|
|
38
38
|
"minimatch": "9.0.3",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
|
-
"@nx/devkit": "19.0.
|
|
41
|
-
"@nx/js": "19.0.
|
|
42
|
-
"@nx/eslint": "19.0.
|
|
43
|
-
"@nx/web": "19.0.
|
|
44
|
-
"@nrwl/react": "19.0.
|
|
40
|
+
"@nx/devkit": "19.1.0-beta.0",
|
|
41
|
+
"@nx/js": "19.1.0-beta.0",
|
|
42
|
+
"@nx/eslint": "19.1.0-beta.0",
|
|
43
|
+
"@nx/web": "19.1.0-beta.0",
|
|
44
|
+
"@nrwl/react": "19.1.0-beta.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ExecutorContext } from '@nx/devkit';
|
|
2
2
|
import { WebDevServerOptions } from '@nx/webpack/src/executors/dev-server/schema';
|
|
3
3
|
type ModuleFederationDevServerOptions = WebDevServerOptions & {
|
|
4
|
-
devRemotes?: string
|
|
4
|
+
devRemotes?: (string | {
|
|
5
|
+
remoteName: string;
|
|
6
|
+
configuration: string;
|
|
7
|
+
})[];
|
|
5
8
|
skipRemotes?: string[];
|
|
6
9
|
static?: boolean;
|
|
7
10
|
isInitialHost?: boolean;
|
|
@@ -63,6 +63,7 @@ async function startRemotes(remotes, context, options, target = 'serve') {
|
|
|
63
63
|
for (const app of remotes) {
|
|
64
64
|
const remoteProjectServeTarget = context.projectGraph.nodes[app].data.targets[target];
|
|
65
65
|
const isUsingModuleFederationDevServerExecutor = remoteProjectServeTarget.executor.includes('module-federation-dev-server');
|
|
66
|
+
const configurationOverride = options.devRemotes?.find((r) => typeof r !== 'string' && r.remoteName === app)?.configuration;
|
|
66
67
|
const overrides = target === 'serve'
|
|
67
68
|
? {
|
|
68
69
|
watch: true,
|
|
@@ -78,7 +79,7 @@ async function startRemotes(remotes, context, options, target = 'serve') {
|
|
|
78
79
|
remoteIters.push(await (0, devkit_1.runExecutor)({
|
|
79
80
|
project: app,
|
|
80
81
|
target,
|
|
81
|
-
configuration: context.configurationName,
|
|
82
|
+
configuration: configurationOverride ?? context.configurationName,
|
|
82
83
|
}, overrides, context));
|
|
83
84
|
}
|
|
84
85
|
return remoteIters;
|
|
@@ -175,14 +176,17 @@ async function* moduleFederationDevServer(options, context) {
|
|
|
175
176
|
return yield* currIter;
|
|
176
177
|
}
|
|
177
178
|
const moduleFederationConfig = (0, module_federation_1.getModuleFederationConfig)(buildOptions.tsConfig, context.root, p.root, 'react');
|
|
178
|
-
const
|
|
179
|
+
const remoteNames = options.devRemotes?.map((r) => typeof r === 'string' ? r : r.remoteName);
|
|
180
|
+
const remotes = (0, module_federation_1.getRemotes)(remoteNames, options.skipRemotes, moduleFederationConfig, {
|
|
179
181
|
projectName: context.projectName,
|
|
180
182
|
projectGraph: context.projectGraph,
|
|
181
183
|
root: context.root,
|
|
182
184
|
}, pathToManifestFile);
|
|
183
185
|
if (remotes.devRemotes.length > 0 && !initialStaticRemotesPorts) {
|
|
184
186
|
options.staticRemotesPort = options.devRemotes.reduce((portToUse, r) => {
|
|
185
|
-
const
|
|
187
|
+
const remoteName = typeof r === 'string' ? r : r.remoteName;
|
|
188
|
+
const remotePort = context.projectGraph.nodes[remoteName].data.targets['serve'].options
|
|
189
|
+
.port;
|
|
186
190
|
if (remotePort >= portToUse) {
|
|
187
191
|
return remotePort + 1;
|
|
188
192
|
}
|
|
@@ -9,7 +9,24 @@
|
|
|
9
9
|
"devRemotes": {
|
|
10
10
|
"type": "array",
|
|
11
11
|
"items": {
|
|
12
|
-
"
|
|
12
|
+
"oneOf": [
|
|
13
|
+
{
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "object",
|
|
18
|
+
"properties": {
|
|
19
|
+
"remoteName": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"configuration": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"required": ["remoteName"],
|
|
27
|
+
"additionalProperties": false
|
|
28
|
+
}
|
|
29
|
+
]
|
|
13
30
|
},
|
|
14
31
|
"description": "List of remote applications to run in development mode (i.e. using serve target).",
|
|
15
32
|
"x-priority": "important"
|
|
@@ -114,5 +131,6 @@
|
|
|
114
131
|
"type": "string",
|
|
115
132
|
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
|
|
116
133
|
}
|
|
117
|
-
}
|
|
134
|
+
},
|
|
135
|
+
"examplesFile": "../../../docs/module-federation-dev-server-examples.md"
|
|
118
136
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare const eslintPluginReactHooksVersion = "4.6.0";
|
|
|
29
29
|
export declare const babelPluginStyledComponentsVersion = "1.10.7";
|
|
30
30
|
export declare const tsLibVersion = "^2.3.0";
|
|
31
31
|
export declare const postcssVersion = "8.4.21";
|
|
32
|
-
export declare const tailwindcssVersion = "3.
|
|
32
|
+
export declare const tailwindcssVersion = "3.4.3";
|
|
33
33
|
export declare const autoprefixerVersion = "10.4.13";
|
|
34
34
|
export declare const expressVersion = "~4.18.2";
|
|
35
35
|
export declare const typesExpressVersion = "4.17.17";
|
package/src/utils/versions.js
CHANGED
|
@@ -34,7 +34,7 @@ exports.eslintPluginReactHooksVersion = '4.6.0';
|
|
|
34
34
|
exports.babelPluginStyledComponentsVersion = '1.10.7';
|
|
35
35
|
exports.tsLibVersion = '^2.3.0';
|
|
36
36
|
exports.postcssVersion = '8.4.21';
|
|
37
|
-
exports.tailwindcssVersion = '3.
|
|
37
|
+
exports.tailwindcssVersion = '3.4.3';
|
|
38
38
|
exports.autoprefixerVersion = '10.4.13';
|
|
39
39
|
// SSR and Module Federation
|
|
40
40
|
exports.expressVersion = '~4.18.2';
|