@nx/react 21.0.0-beta.8 → 21.0.0-beta.9
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
CHANGED
@@ -1,17 +1,5 @@
|
|
1
1
|
{
|
2
2
|
"generators": {
|
3
|
-
"add-module-federation-env-var-to-target-defaults": {
|
4
|
-
"cli": "nx",
|
5
|
-
"version": "18.0.0-beta.0",
|
6
|
-
"description": "Add NX_MF_DEV_SERVER_STATIC_REMOTES to inputs for task hashing when '@nx/webpack:webpack' is used for Module Federation.",
|
7
|
-
"factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults"
|
8
|
-
},
|
9
|
-
"fix-target-defaults-for-webpack": {
|
10
|
-
"cli": "nx",
|
11
|
-
"version": "18.1.1-beta.0",
|
12
|
-
"description": "Ensure targetDefaults inputs for task hashing when '@nx/webpack:webpack' is used are correct for Module Federation.",
|
13
|
-
"factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs"
|
14
|
-
},
|
15
3
|
"update-19-6-0-turn-module-federation-dts-off": {
|
16
4
|
"cli": "nx",
|
17
5
|
"version": "19.6.0-beta.4",
|
@@ -56,32 +44,6 @@
|
|
56
44
|
}
|
57
45
|
},
|
58
46
|
"packageJsonUpdates": {
|
59
|
-
"17.0.0-beta.0": {
|
60
|
-
"version": "17.0.0-beta.0",
|
61
|
-
"packages": {
|
62
|
-
"@types/react": {
|
63
|
-
"version": "18.2.24",
|
64
|
-
"alwaysAddToPackageJson": false
|
65
|
-
},
|
66
|
-
"@types/react-dom": {
|
67
|
-
"version": "18.2.9",
|
68
|
-
"alwaysAddToPackageJson": false
|
69
|
-
},
|
70
|
-
"@types/react-is": {
|
71
|
-
"version": "18.2.2",
|
72
|
-
"alwaysAddToPackageJson": false
|
73
|
-
}
|
74
|
-
}
|
75
|
-
},
|
76
|
-
"17.3.0": {
|
77
|
-
"version": "17.3.0-beta.3",
|
78
|
-
"packages": {
|
79
|
-
"@types/node": {
|
80
|
-
"version": "18.16.9",
|
81
|
-
"alwaysAddToPackageJson": false
|
82
|
-
}
|
83
|
-
}
|
84
|
-
},
|
85
47
|
"19.0.0": {
|
86
48
|
"version": "19.0.0-beta.12",
|
87
49
|
"packages": {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/react",
|
3
|
-
"version": "21.0.0-beta.
|
3
|
+
"version": "21.0.0-beta.9",
|
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": {
|
@@ -38,11 +38,11 @@
|
|
38
38
|
"minimatch": "9.0.3",
|
39
39
|
"picocolors": "^1.1.0",
|
40
40
|
"tslib": "^2.3.0",
|
41
|
-
"@nx/devkit": "21.0.0-beta.
|
42
|
-
"@nx/js": "21.0.0-beta.
|
43
|
-
"@nx/eslint": "21.0.0-beta.
|
44
|
-
"@nx/web": "21.0.0-beta.
|
45
|
-
"@nx/module-federation": "21.0.0-beta.
|
41
|
+
"@nx/devkit": "21.0.0-beta.9",
|
42
|
+
"@nx/js": "21.0.0-beta.9",
|
43
|
+
"@nx/eslint": "21.0.0-beta.9",
|
44
|
+
"@nx/web": "21.0.0-beta.9",
|
45
|
+
"@nx/module-federation": "21.0.0-beta.9",
|
46
46
|
"express": "^4.21.2",
|
47
47
|
"http-proxy-middleware": "^3.0.3",
|
48
48
|
"semver": "^7.6.3"
|
@@ -1,53 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.default = default_1;
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
5
|
-
async function default_1(tree) {
|
6
|
-
if (!hasModuleFederationProject(tree)) {
|
7
|
-
return;
|
8
|
-
}
|
9
|
-
ensureTargetDefaultsContainProductionInputs(tree);
|
10
|
-
await (0, devkit_1.formatFiles)(tree);
|
11
|
-
}
|
12
|
-
function ensureTargetDefaultsContainProductionInputs(tree) {
|
13
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
14
|
-
const webpackExecutor = '@nx/webpack:webpack';
|
15
|
-
const mfEnvVar = 'NX_MF_DEV_SERVER_STATIC_REMOTES';
|
16
|
-
nxJson.targetDefaults[webpackExecutor] ??= {};
|
17
|
-
nxJson.targetDefaults[webpackExecutor].inputs ??= [
|
18
|
-
'production',
|
19
|
-
'^production',
|
20
|
-
{ env: mfEnvVar },
|
21
|
-
];
|
22
|
-
if (!nxJson.targetDefaults[webpackExecutor].inputs.includes('production')) {
|
23
|
-
nxJson.targetDefaults[webpackExecutor].inputs.push('production');
|
24
|
-
}
|
25
|
-
if (!nxJson.targetDefaults[webpackExecutor].inputs.includes('^production')) {
|
26
|
-
nxJson.targetDefaults[webpackExecutor].inputs.push('^production');
|
27
|
-
}
|
28
|
-
let mfEnvVarExists = false;
|
29
|
-
for (const input of nxJson.targetDefaults[webpackExecutor].inputs) {
|
30
|
-
if (typeof input === 'object' && input['env'] === mfEnvVar) {
|
31
|
-
mfEnvVarExists = true;
|
32
|
-
break;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
if (!mfEnvVarExists) {
|
36
|
-
nxJson.targetDefaults[webpackExecutor].inputs.push({ env: mfEnvVar });
|
37
|
-
}
|
38
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
39
|
-
}
|
40
|
-
function hasModuleFederationProject(tree) {
|
41
|
-
const projects = (0, devkit_1.getProjects)(tree);
|
42
|
-
for (const project of projects.values()) {
|
43
|
-
const targets = project.targets || {};
|
44
|
-
for (const [_, target] of Object.entries(targets)) {
|
45
|
-
if (target.executor === '@nx/webpack:webpack' &&
|
46
|
-
(tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.ts')) ||
|
47
|
-
tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.js')))) {
|
48
|
-
return true;
|
49
|
-
}
|
50
|
-
}
|
51
|
-
}
|
52
|
-
return false;
|
53
|
-
}
|