@nx/react 22.0.1 → 22.0.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/migrations.json +21 -0
- package/package.json +14 -14
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +1 -0
- package/src/generators/application/files/react-router-ssr/common/tsconfig.json__tmpl__ +1 -1
- package/src/generators/application/lib/update-jest-config.d.ts.map +1 -1
- package/src/generators/application/lib/update-jest-config.js +4 -2
- package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +1 -1
- package/src/generators/library/library.js +1 -1
- package/src/utils/jest-utils.d.ts +2 -0
- package/src/utils/jest-utils.d.ts.map +1 -1
- package/src/utils/jest-utils.js +12 -0
- package/src/utils/versions.d.ts +2 -2
- package/src/utils/versions.js +2 -2
package/migrations.json
CHANGED
|
@@ -98,6 +98,27 @@
|
|
|
98
98
|
"alwaysAddToPackageJson": false
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
+
},
|
|
102
|
+
"22.2.0": {
|
|
103
|
+
"version": "22.2.0-beta.0",
|
|
104
|
+
"packages": {
|
|
105
|
+
"@module-federation/enhanced": {
|
|
106
|
+
"version": "^0.21.2",
|
|
107
|
+
"alwaysAddToPackageJson": false
|
|
108
|
+
},
|
|
109
|
+
"@module-federation/runtime": {
|
|
110
|
+
"version": "^0.21.2",
|
|
111
|
+
"alwaysAddToPackageJson": false
|
|
112
|
+
},
|
|
113
|
+
"@module-federation/sdk": {
|
|
114
|
+
"version": "^0.21.2",
|
|
115
|
+
"alwaysAddToPackageJson": false
|
|
116
|
+
},
|
|
117
|
+
"@module-federation/node": {
|
|
118
|
+
"version": "^2.7.21",
|
|
119
|
+
"alwaysAddToPackageJson": false
|
|
120
|
+
}
|
|
121
|
+
}
|
|
101
122
|
}
|
|
102
123
|
}
|
|
103
124
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "22.0.
|
|
3
|
+
"version": "22.0.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": {
|
|
@@ -38,26 +38,26 @@
|
|
|
38
38
|
"minimatch": "9.0.3",
|
|
39
39
|
"picocolors": "^1.1.0",
|
|
40
40
|
"tslib": "^2.3.0",
|
|
41
|
-
"@nx/devkit": "22.0.
|
|
42
|
-
"@nx/js": "22.0.
|
|
43
|
-
"@nx/eslint": "22.0.
|
|
44
|
-
"@nx/web": "22.0.
|
|
45
|
-
"@nx/module-federation": "22.0.
|
|
46
|
-
"@nx/rollup": "22.0.
|
|
41
|
+
"@nx/devkit": "22.0.3",
|
|
42
|
+
"@nx/js": "22.0.3",
|
|
43
|
+
"@nx/eslint": "22.0.3",
|
|
44
|
+
"@nx/web": "22.0.3",
|
|
45
|
+
"@nx/module-federation": "22.0.3",
|
|
46
|
+
"@nx/rollup": "22.0.3",
|
|
47
47
|
"express": "^4.21.2",
|
|
48
48
|
"http-proxy-middleware": "^3.0.5",
|
|
49
49
|
"semver": "^7.6.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@nx/cypress": "22.0.
|
|
53
|
-
"@nx/playwright": "22.0.
|
|
54
|
-
"@nx/rsbuild": "22.0.
|
|
55
|
-
"@nx/vite": "22.0.
|
|
56
|
-
"@nx/webpack": "22.0.
|
|
57
|
-
"nx": "22.0.
|
|
52
|
+
"@nx/cypress": "22.0.3",
|
|
53
|
+
"@nx/playwright": "22.0.3",
|
|
54
|
+
"@nx/rsbuild": "22.0.3",
|
|
55
|
+
"@nx/vite": "22.0.3",
|
|
56
|
+
"@nx/webpack": "22.0.3",
|
|
57
|
+
"nx": "22.0.3"
|
|
58
58
|
},
|
|
59
59
|
"optionalDependencies": {
|
|
60
|
-
"@nx/vite": "22.0.
|
|
60
|
+
"@nx/vite": "22.0.3"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAoCpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAoCpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAqM5B;AAED,eAAe,oBAAoB,CAAC"}
|
|
@@ -152,6 +152,7 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
152
152
|
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json'), (json) => {
|
|
153
153
|
const types = new Set(json.compilerOptions?.types || []);
|
|
154
154
|
types.add('@react-router/node');
|
|
155
|
+
types.add('node');
|
|
155
156
|
return {
|
|
156
157
|
...json,
|
|
157
158
|
compilerOptions: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
|
5
|
-
"types": ["@react-router/node", "vite/client"],
|
|
5
|
+
"types": ["@react-router/node", "vite/client", "node"],
|
|
6
6
|
"isolatedModules": true,
|
|
7
7
|
"esModuleInterop": true,
|
|
8
8
|
"jsx": "react-jsx",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-jest-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/update-jest-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update-jest-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/update-jest-config.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,QAoCrE"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateSpecConfig = updateSpecConfig;
|
|
4
|
-
const maybe_js_1 = require("../../../utils/maybe-js");
|
|
5
4
|
const jest_utils_1 = require("../../../utils/jest-utils");
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
function updateSpecConfig(host, options) {
|
|
@@ -27,7 +26,10 @@ function updateSpecConfig(host, options) {
|
|
|
27
26
|
if (options.unitTestRunner !== 'jest') {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
const configPath = (0,
|
|
29
|
+
const configPath = (0, jest_utils_1.findProjectJestConfig)(host, options.appProjectRoot);
|
|
30
|
+
if (!configPath) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
31
33
|
const originalContent = host.read(configPath, 'utf-8');
|
|
32
34
|
const content = (0, jest_utils_1.updateJestConfigContent)(originalContent);
|
|
33
35
|
host.write(configPath, content);
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"@nx/react/typings/image.d.ts"
|
|
10
10
|
]
|
|
11
11
|
},
|
|
12
|
-
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.spec.tsx", "src/**/*.test.tsx", "src/**/*.spec.js", "src/**/*.test.js", "src/**/*.spec.jsx", "src/**/*.test.jsx"],
|
|
12
|
+
"exclude": ["jest.config.ts", "jest.config.cts", "src/**/*.spec.ts", "src/**/*.test.ts", "src/**/*.spec.tsx", "src/**/*.test.tsx", "src/**/*.spec.js", "src/**/*.test.js", "src/**/*.spec.jsx", "src/**/*.test.jsx"],
|
|
13
13
|
"include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
|
|
14
14
|
}
|
|
@@ -139,7 +139,7 @@ async function libraryGeneratorInternal(host, schema) {
|
|
|
139
139
|
skipFormat: true,
|
|
140
140
|
});
|
|
141
141
|
tasks.push(jestTask);
|
|
142
|
-
const jestConfigPath = (0, devkit_1.joinPathFragments)(options.projectRoot, options.js ? 'jest.config.js' : 'jest.config.
|
|
142
|
+
const jestConfigPath = (0, devkit_1.joinPathFragments)(options.projectRoot, options.js ? 'jest.config.js' : 'jest.config.cts');
|
|
143
143
|
if (options.compiler === 'babel' && host.exists(jestConfigPath)) {
|
|
144
144
|
const updatedContent = (0, jest_utils_1.updateJestConfigContent)(host.read(jestConfigPath, 'utf-8'));
|
|
145
145
|
host.write(jestConfigPath, updatedContent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jest-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/jest-utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,UAUtD"}
|
|
1
|
+
{"version":3,"file":"jest-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/jest-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE1D,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,UAUtD;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,GAClB,MAAM,GAAG,IAAI,CAWf"}
|
package/src/utils/jest-utils.js
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateJestConfigContent = updateJestConfigContent;
|
|
4
|
+
exports.findProjectJestConfig = findProjectJestConfig;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
6
|
function updateJestConfigContent(content) {
|
|
5
7
|
return content
|
|
6
8
|
.replace('transform: {', "transform: {\n '^(?!.*\\\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',")
|
|
7
9
|
.replace(`'babel-jest'`, `['babel-jest', { presets: ['@nx/react/babel'] }]`);
|
|
8
10
|
}
|
|
11
|
+
function findProjectJestConfig(tree, projectRoot) {
|
|
12
|
+
const extensions = ['js', 'ts', 'cts'];
|
|
13
|
+
for (const ext of extensions) {
|
|
14
|
+
const configPath = (0, devkit_1.joinPathFragments)(projectRoot, `jest.config.${ext}`);
|
|
15
|
+
if (tree.exists(configPath)) {
|
|
16
|
+
return configPath;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return null;
|
|
20
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -44,8 +44,8 @@ export declare const typesExpressVersion = "^4.17.21";
|
|
|
44
44
|
export declare const isbotVersion = "^3.6.5";
|
|
45
45
|
export declare const corsVersion = "~2.8.5";
|
|
46
46
|
export declare const typesCorsVersion = "~2.8.12";
|
|
47
|
-
export declare const moduleFederationNodeVersion = "^2.7.
|
|
48
|
-
export declare const moduleFederationEnhancedVersion = "^0.
|
|
47
|
+
export declare const moduleFederationNodeVersion = "^2.7.21";
|
|
48
|
+
export declare const moduleFederationEnhancedVersion = "^0.21.2";
|
|
49
49
|
export declare const lessVersion = "3.12.2";
|
|
50
50
|
export declare const sassVersion = "^1.55.0";
|
|
51
51
|
export declare const rollupPluginUrlVersion = "^8.0.2";
|
package/src/utils/versions.js
CHANGED
|
@@ -51,8 +51,8 @@ exports.typesExpressVersion = '^4.17.21';
|
|
|
51
51
|
exports.isbotVersion = '^3.6.5';
|
|
52
52
|
exports.corsVersion = '~2.8.5';
|
|
53
53
|
exports.typesCorsVersion = '~2.8.12';
|
|
54
|
-
exports.moduleFederationNodeVersion = '^2.7.
|
|
55
|
-
exports.moduleFederationEnhancedVersion = '^0.
|
|
54
|
+
exports.moduleFederationNodeVersion = '^2.7.21';
|
|
55
|
+
exports.moduleFederationEnhancedVersion = '^0.21.2';
|
|
56
56
|
// style preprocessors
|
|
57
57
|
exports.lessVersion = '3.12.2';
|
|
58
58
|
exports.sassVersion = '^1.55.0';
|