@nx/react 20.7.0-canary.20250326-9dd4766 → 20.7.0-canary.20250327-1a235d7
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
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/react",
|
3
|
-
"version": "20.7.0-canary.
|
3
|
+
"version": "20.7.0-canary.20250327-1a235d7",
|
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": "20.7.0-canary.
|
42
|
-
"@nx/js": "20.7.0-canary.
|
43
|
-
"@nx/eslint": "20.7.0-canary.
|
44
|
-
"@nx/web": "20.7.0-canary.
|
45
|
-
"@nx/module-federation": "20.7.0-canary.
|
41
|
+
"@nx/devkit": "20.7.0-canary.20250327-1a235d7",
|
42
|
+
"@nx/js": "20.7.0-canary.20250327-1a235d7",
|
43
|
+
"@nx/eslint": "20.7.0-canary.20250327-1a235d7",
|
44
|
+
"@nx/web": "20.7.0-canary.20250327-1a235d7",
|
45
|
+
"@nx/module-federation": "20.7.0-canary.20250327-1a235d7",
|
46
46
|
"express": "^4.21.2",
|
47
47
|
"http-proxy-middleware": "^3.0.3",
|
48
48
|
"semver": "^7.6.3"
|
@@ -168,7 +168,7 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
168
168
|
moduleResolution: 'bundler',
|
169
169
|
}, options.linter === 'eslint'
|
170
170
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
171
|
-
: undefined);
|
171
|
+
: undefined, options.useReactRouter ? 'app' : 'src');
|
172
172
|
(0, sort_fields_1.sortPackageJsonFields)(tree, options.appProjectRoot);
|
173
173
|
if (!options.skipFormat) {
|
174
174
|
await (0, devkit_1.formatFiles)(tree);
|
@@ -3,19 +3,43 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addJest = addJest;
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const versions_1 = require("../../../utils/versions");
|
6
|
+
const node_path_1 = require("node:path");
|
6
7
|
async function addJest(host, options) {
|
7
8
|
if (options.unitTestRunner === 'none') {
|
8
9
|
return () => { };
|
9
10
|
}
|
10
11
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/jest', versions_1.nxVersion);
|
11
|
-
|
12
|
+
await configurationGenerator(host, {
|
12
13
|
...options,
|
13
14
|
project: options.projectName,
|
14
15
|
supportTsx: true,
|
15
16
|
skipSerializers: true,
|
16
|
-
setupFile: 'none',
|
17
|
+
setupFile: options.useReactRouter ? 'react-router' : 'none',
|
17
18
|
compiler: options.compiler,
|
18
19
|
skipFormat: true,
|
19
20
|
runtimeTsconfigFileName: 'tsconfig.app.json',
|
20
21
|
});
|
22
|
+
if (options.useReactRouter) {
|
23
|
+
(0, devkit_1.updateJson)(host, (0, node_path_1.join)(options.appProjectRoot, 'tsconfig.spec.json'), (json) => {
|
24
|
+
json.include = json.include ?? [];
|
25
|
+
const reactRouterTestGlob = options.js
|
26
|
+
? [
|
27
|
+
'test/**/*.spec.jsx',
|
28
|
+
'test/**/*.spec.js',
|
29
|
+
'test/**/*.test.jsx',
|
30
|
+
'test/**/*.test.js',
|
31
|
+
]
|
32
|
+
: [
|
33
|
+
'test/**/*.spec.tsx',
|
34
|
+
'test/**/*.spec.ts',
|
35
|
+
'test/**/*.test.tsx',
|
36
|
+
'test/**/*.test.ts',
|
37
|
+
];
|
38
|
+
return {
|
39
|
+
...json,
|
40
|
+
include: Array.from(new Set([...json.include, ...reactRouterTestGlob])),
|
41
|
+
};
|
42
|
+
});
|
43
|
+
}
|
44
|
+
return () => { };
|
21
45
|
}
|