@nx/react 23.0.0-beta.15 → 23.0.0-beta.17
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 +16 -16
- package/src/generators/application/lib/add-linting.js +10 -11
- package/src/generators/application/lib/create-application-files.d.ts +1 -1
- package/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +2 -2
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +2 -2
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +2 -2
- package/src/generators/library/lib/add-linting.js +7 -8
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +1 -1
- package/src/utils/ct-utils.d.ts.map +1 -1
- package/src/utils/ct-utils.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.17",
|
|
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,28 +37,28 @@
|
|
|
37
37
|
"@svgr/webpack": "^8.0.1",
|
|
38
38
|
"minimatch": "10.2.5",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
|
-
"@nx/devkit": "23.0.0-beta.
|
|
41
|
-
"@nx/js": "23.0.0-beta.
|
|
42
|
-
"@nx/eslint": "23.0.0-beta.
|
|
43
|
-
"@nx/web": "23.0.0-beta.
|
|
44
|
-
"@nx/module-federation": "23.0.0-beta.
|
|
45
|
-
"@nx/rollup": "23.0.0-beta.
|
|
40
|
+
"@nx/devkit": "23.0.0-beta.17",
|
|
41
|
+
"@nx/js": "23.0.0-beta.17",
|
|
42
|
+
"@nx/eslint": "23.0.0-beta.17",
|
|
43
|
+
"@nx/web": "23.0.0-beta.17",
|
|
44
|
+
"@nx/module-federation": "23.0.0-beta.17",
|
|
45
|
+
"@nx/rollup": "23.0.0-beta.17",
|
|
46
46
|
"express": "^4.21.2",
|
|
47
47
|
"http-proxy-middleware": "^3.0.5",
|
|
48
48
|
"semver": "^7.6.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@nx/cypress": "23.0.0-beta.
|
|
52
|
-
"@nx/playwright": "23.0.0-beta.
|
|
53
|
-
"@nx/rsbuild": "23.0.0-beta.
|
|
54
|
-
"@nx/vite": "23.0.0-beta.
|
|
55
|
-
"@nx/vitest": "23.0.0-beta.
|
|
56
|
-
"@nx/webpack": "23.0.0-beta.
|
|
57
|
-
"@nx/storybook": "23.0.0-beta.
|
|
58
|
-
"nx": "23.0.0-beta.
|
|
51
|
+
"@nx/cypress": "23.0.0-beta.17",
|
|
52
|
+
"@nx/playwright": "23.0.0-beta.17",
|
|
53
|
+
"@nx/rsbuild": "23.0.0-beta.17",
|
|
54
|
+
"@nx/vite": "23.0.0-beta.17",
|
|
55
|
+
"@nx/vitest": "23.0.0-beta.17",
|
|
56
|
+
"@nx/webpack": "23.0.0-beta.17",
|
|
57
|
+
"@nx/storybook": "23.0.0-beta.17",
|
|
58
|
+
"nx": "23.0.0-beta.17"
|
|
59
59
|
},
|
|
60
60
|
"optionalDependencies": {
|
|
61
|
-
"@nx/vite": "23.0.0-beta.
|
|
61
|
+
"@nx/vite": "23.0.0-beta.17"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|
|
@@ -37,10 +37,9 @@ exports.addLinting = addLinting;
|
|
|
37
37
|
exports.isEslintInstalled = isEslintInstalled;
|
|
38
38
|
const devkit_1 = require("@nx/devkit");
|
|
39
39
|
const eslint_1 = require("@nx/eslint");
|
|
40
|
-
const
|
|
41
|
-
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
|
40
|
+
const internal_1 = require("@nx/eslint/internal");
|
|
42
41
|
const devkit_2 = require("@nx/devkit");
|
|
43
|
-
const
|
|
42
|
+
const internal_2 = require("@nx/js/internal");
|
|
44
43
|
const lint_1 = require("../../../utils/lint");
|
|
45
44
|
const versions_1 = require("../../../utils/versions");
|
|
46
45
|
async function addLinting(host, options) {
|
|
@@ -59,23 +58,23 @@ async function addLinting(host, options) {
|
|
|
59
58
|
addPlugin: options.addPlugin,
|
|
60
59
|
});
|
|
61
60
|
tasks.push(lintTask);
|
|
62
|
-
if ((0,
|
|
63
|
-
if ((0,
|
|
64
|
-
(0,
|
|
61
|
+
if ((0, internal_1.isEslintConfigSupported)(host)) {
|
|
62
|
+
if ((0, internal_1.useFlatConfig)(host)) {
|
|
63
|
+
(0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.appProjectRoot, 'flat/react', { checkBaseConfig: true });
|
|
65
64
|
// Add an empty rules object to users know how to add/override rules
|
|
66
|
-
(0,
|
|
65
|
+
(0, internal_1.addOverrideToLintConfig)(host, options.appProjectRoot, {
|
|
67
66
|
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
68
67
|
rules: {},
|
|
69
68
|
});
|
|
70
69
|
}
|
|
71
70
|
else {
|
|
72
|
-
const addExtendsTask = (0,
|
|
71
|
+
const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.appProjectRoot, { name: 'plugin:@nx/react', needCompatFixup: true });
|
|
73
72
|
tasks.push(addExtendsTask);
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
if (!options.skipPackageJson) {
|
|
77
76
|
const installTask = (0, devkit_2.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
78
|
-
const addSwcTask = (0,
|
|
77
|
+
const addSwcTask = (0, internal_2.addSwcDependencies)(host);
|
|
79
78
|
tasks.push(installTask, addSwcTask);
|
|
80
79
|
}
|
|
81
80
|
if (options.useReactRouter) {
|
|
@@ -89,11 +88,11 @@ async function ignoreReactRouterFilesInEslintConfig(tree, projectRoot) {
|
|
|
89
88
|
return;
|
|
90
89
|
}
|
|
91
90
|
(0, devkit_1.ensurePackage)('@nx/eslint', versions_1.nxVersion);
|
|
92
|
-
const { addIgnoresToLintConfig, isEslintConfigSupported } = await Promise.resolve().then(() => __importStar(require('@nx/eslint/
|
|
91
|
+
const { addIgnoresToLintConfig, isEslintConfigSupported } = await Promise.resolve().then(() => __importStar(require('@nx/eslint/internal')));
|
|
93
92
|
if (!isEslintConfigSupported(tree)) {
|
|
94
93
|
return;
|
|
95
94
|
}
|
|
96
|
-
const { useFlatConfig } = await Promise.resolve().then(() => __importStar(require('@nx/eslint/
|
|
95
|
+
const { useFlatConfig } = await Promise.resolve().then(() => __importStar(require('@nx/eslint/internal')));
|
|
97
96
|
const isUsingFlatConfig = useFlatConfig(tree);
|
|
98
97
|
if (!projectRoot && !isUsingFlatConfig) {
|
|
99
98
|
// root eslintrc files ignore all files and the root eslintrc files add
|
|
@@ -37,7 +37,7 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
|
|
|
37
37
|
tags?: string;
|
|
38
38
|
inSourceTests?: boolean;
|
|
39
39
|
e2eTestRunner: "cypress" | "playwright" | "none";
|
|
40
|
-
linter: import("packages/eslint").Linter | import("packages/eslint").LinterType;
|
|
40
|
+
linter: import("packages/eslint/dist").Linter | import("packages/eslint/dist").LinterType;
|
|
41
41
|
classComponent?: boolean;
|
|
42
42
|
routing?: boolean;
|
|
43
43
|
useReactRouter?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
|
|
2
2
|
import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
|
|
3
|
-
import { NxModuleFederationPlugin, NxModuleFederationSSRDevServerPlugin } from '@nx/module-federation/rspack
|
|
3
|
+
import { NxModuleFederationPlugin, NxModuleFederationSSRDevServerPlugin } from '@nx/module-federation/rspack';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
|
|
6
6
|
import browserMfConfig from './module-federation.config';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
|
|
2
2
|
import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
|
|
3
|
-
import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack
|
|
4
|
-
import { ModuleFederationConfig } from '@nx/module-federation';
|
|
3
|
+
import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack';
|
|
4
|
+
import type { ModuleFederationConfig } from '@nx/module-federation';
|
|
5
5
|
import { join } from 'path';
|
|
6
6
|
|
|
7
7
|
import baseConfig from './module-federation.config';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
|
|
2
2
|
import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
|
|
3
|
-
import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack
|
|
3
|
+
import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
|
|
6
6
|
import config from './module-federation.config';
|
package/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {composePlugins, withNx} from '@nx/webpack';
|
|
2
2
|
import {withReact} from '@nx/react';
|
|
3
|
-
import {withModuleFederationForSSR} from '@nx/module-federation/webpack
|
|
3
|
+
import {withModuleFederationForSSR} from '@nx/module-federation/webpack';
|
|
4
4
|
|
|
5
5
|
import baseConfig from './module-federation.config';
|
|
6
6
|
|
package/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { composePlugins, withNx } from '@nx/webpack';
|
|
2
2
|
import { withReact } from '@nx/react';
|
|
3
|
-
import { withModuleFederation } from '@nx/module-federation/webpack
|
|
4
|
-
import { ModuleFederationConfig } from '@nx/module-federation';
|
|
3
|
+
import { withModuleFederation } from '@nx/module-federation/webpack';
|
|
4
|
+
import type { ModuleFederationConfig } from '@nx/module-federation';
|
|
5
5
|
|
|
6
6
|
import baseConfig from './module-federation.config';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {composePlugins, withNx} from '@nx/webpack';
|
|
2
2
|
import {withReact} from '@nx/react';
|
|
3
|
-
import {withModuleFederation} from '@nx/module-federation/webpack
|
|
4
|
-
import { ModuleFederationConfig } from '@nx/module-federation';
|
|
3
|
+
import {withModuleFederation} from '@nx/module-federation/webpack';
|
|
4
|
+
import type { ModuleFederationConfig } from '@nx/module-federation';
|
|
5
5
|
|
|
6
6
|
import baseConfig from './module-federation.config';
|
|
7
7
|
|
|
@@ -5,8 +5,7 @@ const eslint_1 = require("@nx/eslint");
|
|
|
5
5
|
const path_1 = require("nx/src/utils/path");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const lint_1 = require("../../../utils/lint");
|
|
8
|
-
const
|
|
9
|
-
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
|
8
|
+
const internal_1 = require("@nx/eslint/internal");
|
|
10
9
|
async function addLinting(host, options) {
|
|
11
10
|
if (options.linter === 'eslint') {
|
|
12
11
|
const tasks = [];
|
|
@@ -23,17 +22,17 @@ async function addLinting(host, options) {
|
|
|
23
22
|
addPlugin: options.addPlugin,
|
|
24
23
|
});
|
|
25
24
|
tasks.push(lintTask);
|
|
26
|
-
if ((0,
|
|
27
|
-
if ((0,
|
|
28
|
-
(0,
|
|
25
|
+
if ((0, internal_1.isEslintConfigSupported)(host)) {
|
|
26
|
+
if ((0, internal_1.useFlatConfig)(host)) {
|
|
27
|
+
(0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
|
|
29
28
|
// Add an empty rules object to users know how to add/override rules
|
|
30
|
-
(0,
|
|
29
|
+
(0, internal_1.addOverrideToLintConfig)(host, options.projectRoot, {
|
|
31
30
|
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
32
31
|
rules: {},
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
else {
|
|
36
|
-
const addExtendsTask = (0,
|
|
35
|
+
const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.projectRoot, {
|
|
37
36
|
name: 'plugin:@nx/react',
|
|
38
37
|
needCompatFixup: true,
|
|
39
38
|
});
|
|
@@ -41,7 +40,7 @@ async function addLinting(host, options) {
|
|
|
41
40
|
}
|
|
42
41
|
// Add out-tsc ignore pattern when using TS solution setup
|
|
43
42
|
if (options.isUsingTsSolutionConfig) {
|
|
44
|
-
(0,
|
|
43
|
+
(0, internal_1.addIgnoresToLintConfig)(host, options.projectRoot, ['**/out-tsc']);
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
let installTask = () => { };
|
package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
|
|
2
2
|
import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
|
|
3
|
-
import { NxModuleFederationPlugin, NxModuleFederationSSRDevServerPlugin } from '@nx/module-federation/rspack
|
|
3
|
+
import { NxModuleFederationPlugin, NxModuleFederationSSRDevServerPlugin } from '@nx/module-federation/rspack';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
|
|
6
6
|
import browserMfConfig from './module-federation.config';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
|
|
2
2
|
import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
|
|
3
|
-
import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack
|
|
3
|
+
import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack';
|
|
4
4
|
import { join } from 'path';
|
|
5
5
|
|
|
6
6
|
import config from './module-federation.config';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {composePlugins, withNx} from '@nx/webpack';
|
|
2
2
|
import {withReact} from '@nx/react';
|
|
3
|
-
import {withModuleFederationForSSR} from '@nx/module-federation/webpack
|
|
3
|
+
import {withModuleFederationForSSR} from '@nx/module-federation/webpack';
|
|
4
4
|
|
|
5
5
|
import baseConfig from "./module-federation.server.config";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {composePlugins, withNx} from '@nx/webpack';
|
|
2
2
|
import {withReact} from '@nx/react';
|
|
3
|
-
import {withModuleFederation} from '@nx/module-federation/webpack
|
|
3
|
+
import {withModuleFederation} from '@nx/module-federation/webpack';
|
|
4
4
|
|
|
5
5
|
import baseConfig from './module-federation.config';
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ct-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/ct-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAEL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAQ7E,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACjC,GACA,OAAO,CAAC,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"ct-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/react/src/utils/ct-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAEL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAQ7E,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,kBAAkB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACjC,GACA,OAAO,CAAC,WAAW,CAAC,CAmEtB;AAUD,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,WAAW,EAClB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAY7B;AAED,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,EAC/D,KAAK,EAAE,WAAW,+BASnB;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAmBjE"}
|
package/src/utils/ct-utils.js
CHANGED
|
@@ -82,8 +82,8 @@ async function configureCypressCT(tree, options) {
|
|
|
82
82
|
ctConfigOptions.buildTarget = found.target;
|
|
83
83
|
}
|
|
84
84
|
const cypressConfigFilePath = getProjectCypressConfigPath(tree, projectConfig.root);
|
|
85
|
-
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigFilePath, 'utf-8'), ctConfigOptions);
|
|
86
|
-
tree.write(cypressConfigFilePath,
|
|
85
|
+
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigFilePath, 'utf-8'), ctConfigOptions, '@nx/react/plugins/component-testing');
|
|
86
|
+
tree.write(cypressConfigFilePath, updatedCyConfig);
|
|
87
87
|
return found;
|
|
88
88
|
}
|
|
89
89
|
function assertValidConfig(config) {
|