@nx/rspack 23.0.0-beta.12 → 23.0.0-beta.14
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 +46 -8
- package/package.json +26 -12
- package/src/executors/dev-server/dev-server.impl.js +2 -2
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +2 -2
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +2 -2
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +2 -2
- package/src/executors/rspack/lib/normalize-options.js +2 -2
- package/src/executors/rspack/rspack.impl.js +2 -2
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +5 -3
- package/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.d.ts.map +1 -1
- package/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.js +2 -0
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +1 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.js +9 -1
- package/src/generators/convert-webpack/convert-webpack.d.ts.map +1 -1
- package/src/generators/convert-webpack/convert-webpack.js +8 -1
- package/src/generators/init/init.d.ts.map +1 -1
- package/src/generators/init/init.js +12 -5
- package/src/generators/init/schema.json +1 -1
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +3 -4
- package/src/plugins/utils/apply-base-config.js +2 -2
- package/src/plugins/utils/apply-web-config.js +2 -2
- package/src/plugins/utils/models.d.ts +1 -1
- package/src/plugins/utils/models.d.ts.map +1 -1
- package/src/plugins/utils/plugins/normalize-options.js +2 -2
- package/src/plugins/utils/plugins/nx-tsconfig-paths-rspack-plugin.js +3 -3
- package/src/utils/assert-supported-rspack-version.d.ts +3 -0
- package/src/utils/assert-supported-rspack-version.d.ts.map +1 -0
- package/src/utils/assert-supported-rspack-version.js +8 -0
- package/src/utils/config.js +2 -2
- package/src/utils/e2e-web-server-info-utils.d.ts.map +1 -1
- package/src/utils/e2e-web-server-info-utils.js +4 -3
- package/src/utils/generator-utils.d.ts.map +1 -1
- package/src/utils/generator-utils.js +3 -4
- package/src/utils/version-utils.d.ts +27 -0
- package/src/utils/version-utils.d.ts.map +1 -0
- package/src/utils/version-utils.js +53 -0
- package/src/utils/versions.d.ts +18 -3
- package/src/utils/versions.d.ts.map +1 -1
- package/src/utils/versions.js +21 -4
- package/src/utils/with-react.d.ts +1 -1
- package/src/utils/with-react.d.ts.map +1 -1
- package/src/utils/with-web.d.ts +1 -1
- package/src/utils/with-web.d.ts.map +1 -1
package/migrations.json
CHANGED
|
@@ -65,13 +65,24 @@
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
"21.3.0": {
|
|
68
|
+
"21.3.0-module-federation-enhanced": {
|
|
69
69
|
"version": "21.3.0-beta.8",
|
|
70
|
+
"requires": {
|
|
71
|
+
"@module-federation/enhanced": ">=0.15.0 <0.17.0"
|
|
72
|
+
},
|
|
70
73
|
"packages": {
|
|
71
74
|
"@module-federation/enhanced": {
|
|
72
75
|
"version": "^0.17.0",
|
|
73
76
|
"alwaysAddToPackageJson": false
|
|
74
|
-
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"21.3.0-module-federation-node": {
|
|
81
|
+
"version": "21.3.0-beta.8",
|
|
82
|
+
"requires": {
|
|
83
|
+
"@module-federation/node": "<2.7.9"
|
|
84
|
+
},
|
|
85
|
+
"packages": {
|
|
75
86
|
"@module-federation/node": {
|
|
76
87
|
"version": "^2.7.9",
|
|
77
88
|
"alwaysAddToPackageJson": false
|
|
@@ -100,21 +111,48 @@
|
|
|
100
111
|
}
|
|
101
112
|
}
|
|
102
113
|
},
|
|
103
|
-
"22.2.0": {
|
|
114
|
+
"22.2.0-module-federation-enhanced": {
|
|
104
115
|
"version": "22.2.0-beta.0",
|
|
116
|
+
"requires": {
|
|
117
|
+
"@module-federation/enhanced": ">=0.17.0 <0.21.0"
|
|
118
|
+
},
|
|
105
119
|
"packages": {
|
|
106
120
|
"@module-federation/enhanced": {
|
|
107
121
|
"version": "^0.21.2",
|
|
108
122
|
"alwaysAddToPackageJson": false
|
|
109
|
-
}
|
|
110
|
-
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"22.2.0-module-federation-sdk": {
|
|
127
|
+
"version": "22.2.0-beta.0",
|
|
128
|
+
"requires": {
|
|
129
|
+
"@module-federation/sdk": ">=0.17.0 <0.21.0"
|
|
130
|
+
},
|
|
131
|
+
"packages": {
|
|
132
|
+
"@module-federation/sdk": {
|
|
111
133
|
"version": "^0.21.2",
|
|
112
134
|
"alwaysAddToPackageJson": false
|
|
113
|
-
}
|
|
114
|
-
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"22.2.0-module-federation-runtime": {
|
|
139
|
+
"version": "22.2.0-beta.0",
|
|
140
|
+
"requires": {
|
|
141
|
+
"@module-federation/runtime": "<0.21.0"
|
|
142
|
+
},
|
|
143
|
+
"packages": {
|
|
144
|
+
"@module-federation/runtime": {
|
|
115
145
|
"version": "^0.21.2",
|
|
116
146
|
"alwaysAddToPackageJson": false
|
|
117
|
-
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"22.2.0-module-federation-node": {
|
|
151
|
+
"version": "22.2.0-beta.0",
|
|
152
|
+
"requires": {
|
|
153
|
+
"@module-federation/node": "<2.7.21"
|
|
154
|
+
},
|
|
155
|
+
"packages": {
|
|
118
156
|
"@module-federation/node": {
|
|
119
157
|
"version": "^2.7.21",
|
|
120
158
|
"alwaysAddToPackageJson": false
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rspack",
|
|
3
3
|
"description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.",
|
|
4
|
-
"version": "23.0.0-beta.
|
|
4
|
+
"version": "23.0.0-beta.14",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,14 +24,11 @@
|
|
|
24
24
|
"generators": "./generators.json",
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nx/devkit": "23.0.0-beta.
|
|
28
|
-
"@nx/js": "23.0.0-beta.
|
|
29
|
-
"@nx/module-federation": "23.0.0-beta.
|
|
30
|
-
"@nx/web": "23.0.0-beta.
|
|
27
|
+
"@nx/devkit": "23.0.0-beta.14",
|
|
28
|
+
"@nx/js": "23.0.0-beta.14",
|
|
29
|
+
"@nx/module-federation": "23.0.0-beta.14",
|
|
30
|
+
"@nx/web": "23.0.0-beta.14",
|
|
31
31
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
32
|
-
"@rspack/core": "1.6.8",
|
|
33
|
-
"@rspack/dev-server": "^1.1.4",
|
|
34
|
-
"@rspack/plugin-react-refresh": "^1.0.0",
|
|
35
32
|
"autoprefixer": "^10.4.9",
|
|
36
33
|
"browserslist": "^4.26.0",
|
|
37
34
|
"css-loader": "^6.4.0",
|
|
@@ -49,6 +46,7 @@
|
|
|
49
46
|
"sass": "^1.97.2",
|
|
50
47
|
"sass-embedded": "^1.97.2",
|
|
51
48
|
"sass-loader": "^16.0.7",
|
|
49
|
+
"semver": "^7.6.3",
|
|
52
50
|
"source-map-loader": "^5.0.0",
|
|
53
51
|
"style-loader": "^3.3.0",
|
|
54
52
|
"ts-checker-rspack-plugin": "^1.1.1",
|
|
@@ -57,12 +55,28 @@
|
|
|
57
55
|
"webpack-node-externals": "^3.0.0"
|
|
58
56
|
},
|
|
59
57
|
"devDependencies": {
|
|
60
|
-
"nx": "23.0.0-beta.
|
|
61
|
-
"@nx/nest": "23.0.0-beta.
|
|
58
|
+
"nx": "23.0.0-beta.14",
|
|
59
|
+
"@nx/nest": "23.0.0-beta.14"
|
|
62
60
|
},
|
|
63
61
|
"peerDependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
62
|
+
"@rspack/cli": "^1.0.0",
|
|
63
|
+
"@rspack/core": "^1.0.0",
|
|
64
|
+
"@rspack/dev-server": "^1.0.0",
|
|
65
|
+
"@rspack/plugin-react-refresh": "^1.0.0"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@rspack/cli": {
|
|
69
|
+
"optional": true
|
|
70
|
+
},
|
|
71
|
+
"@rspack/core": {
|
|
72
|
+
"optional": true
|
|
73
|
+
},
|
|
74
|
+
"@rspack/dev-server": {
|
|
75
|
+
"optional": true
|
|
76
|
+
},
|
|
77
|
+
"@rspack/plugin-react-refresh": {
|
|
78
|
+
"optional": true
|
|
79
|
+
}
|
|
66
80
|
},
|
|
67
81
|
"nx-migrations": {
|
|
68
82
|
"migrations": "./migrations.json"
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = runExecutor;
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
const dev_server_1 = require("@rspack/dev-server");
|
|
8
8
|
const create_compiler_1 = require("../../utils/create-compiler");
|
|
9
9
|
const mode_utils_1 = require("../../utils/mode-utils");
|
|
@@ -21,7 +21,7 @@ async function* runExecutor(options, context) {
|
|
|
21
21
|
process.env.NX_BUILD_LIBS_FROM_SOURCE = `${buildOptions.buildLibsFromSource}`;
|
|
22
22
|
process.env.NX_BUILD_TARGET = options.buildTarget;
|
|
23
23
|
const metadata = context.projectsConfigurations.projects[context.projectName];
|
|
24
|
-
const sourceRoot = (0,
|
|
24
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(metadata);
|
|
25
25
|
const normalizedBuildOptions = (0, normalize_options_1.normalizeOptions)(buildOptions, context.root, metadata.root, sourceRoot);
|
|
26
26
|
let devServerConfig = (0, get_dev_server_config_1.getDevServerOptions)(context.root, options, normalizedBuildOptions);
|
|
27
27
|
const compiler = await (0, create_compiler_1.createCompiler)({
|
|
@@ -4,7 +4,7 @@ exports.default = moduleFederationDevServer;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
9
9
|
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
|
10
10
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
@@ -25,7 +25,7 @@ async function* moduleFederationDevServer(schema, context) {
|
|
|
25
25
|
}, context)
|
|
26
26
|
: (0, dev_server_impl_1.default)(options, context);
|
|
27
27
|
const p = context.projectsConfigurations.projects[context.projectName];
|
|
28
|
-
let pathToManifestFile = (0, path_1.join)(context.root, (0,
|
|
28
|
+
let pathToManifestFile = (0, path_1.join)(context.root, (0, internal_2.getProjectSourceRoot)(p), 'assets/module-federation.manifest.json');
|
|
29
29
|
if (options.pathToManifestFile) {
|
|
30
30
|
const userPathToManifestFile = (0, path_1.join)(context.root, options.pathToManifestFile);
|
|
31
31
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.default = moduleFederationSsrDevServer;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
9
9
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
10
10
|
const fs_1 = require("fs");
|
|
@@ -15,7 +15,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
15
15
|
const options = (0, lib_1.normalizeOptions)(ssrDevServerOptions);
|
|
16
16
|
const iter = (0, ssr_dev_server_impl_1.default)(options, context);
|
|
17
17
|
const projectConfig = context.projectsConfigurations.projects[context.projectName];
|
|
18
|
-
let pathToManifestFile = (0, path_1.join)(context.root, (0,
|
|
18
|
+
let pathToManifestFile = (0, path_1.join)(context.root, (0, internal_2.getProjectSourceRoot)(projectConfig), 'assets/module-federation.manifest.json');
|
|
19
19
|
if (options.pathToManifestFile) {
|
|
20
20
|
const userPathToManifestFile = (0, path_1.join)(context.root, options.pathToManifestFile);
|
|
21
21
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
package/src/executors/module-federation-static-server/module-federation-static-server.impl.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.default = moduleFederationStaticServer;
|
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const
|
|
8
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
9
|
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
10
10
|
const utils_2 = require("@nx/module-federation/src/utils");
|
|
11
11
|
const file_server_impl_1 = tslib_1.__importDefault(require("@nx/web/src/executors/file-server/file-server.impl"));
|
|
@@ -18,7 +18,7 @@ function getBuildAndServeOptionsFromServeTarget(serveTarget, context) {
|
|
|
18
18
|
const serveOptions = (0, devkit_1.readTargetOptions)(target, context);
|
|
19
19
|
const buildTarget = (0, devkit_1.parseTargetString)(serveOptions.buildTarget, context);
|
|
20
20
|
const buildOptions = (0, devkit_1.readTargetOptions)(buildTarget, context);
|
|
21
|
-
let pathToManifestFile = (0, path_1.join)(context.root, (0,
|
|
21
|
+
let pathToManifestFile = (0, path_1.join)(context.root, (0, internal_2.getProjectSourceRoot)(context.projectGraph.nodes[context.projectName].data), 'assets/module-federation.manifest.json');
|
|
22
22
|
if (serveOptions.pathToManifestFile) {
|
|
23
23
|
const userPathToManifestFile = (0, path_1.join)(context.root, serveOptions.pathToManifestFile);
|
|
24
24
|
if (!(0, fs_1.existsSync)(userPathToManifestFile)) {
|
|
@@ -4,11 +4,11 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
exports.normalizePluginPath = normalizePluginPath;
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const normalize_options_1 = require("../../../plugins/utils/plugins/normalize-options");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
function normalizeOptions(options, root, projectRoot, sourceRoot) {
|
|
9
9
|
const normalizedOptions = {
|
|
10
10
|
...options,
|
|
11
|
-
useTsconfigPaths: !(0,
|
|
11
|
+
useTsconfigPaths: !(0, internal_1.isUsingTsSolutionSetup)(),
|
|
12
12
|
root,
|
|
13
13
|
projectRoot,
|
|
14
14
|
sourceRoot,
|
|
@@ -4,7 +4,7 @@ exports.default = runExecutor;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const core_1 = require("@rspack/core");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
const create_compiler_1 = require("../../utils/create-compiler");
|
|
@@ -16,7 +16,7 @@ async function* runExecutor(options, context) {
|
|
|
16
16
|
process.env.NODE_ENV ??= options.mode ?? 'production';
|
|
17
17
|
options.target ??= 'web';
|
|
18
18
|
const metadata = context.projectsConfigurations.projects[context.projectName];
|
|
19
|
-
const sourceRoot = (0,
|
|
19
|
+
const sourceRoot = (0, internal_2.getProjectSourceRoot)(metadata);
|
|
20
20
|
const normalizedOptions = (0, normalize_options_1.normalizeOptions)(options, context.root, metadata.root, sourceRoot);
|
|
21
21
|
if ((0, mode_utils_1.isMode)(process.env.NODE_ENV)) {
|
|
22
22
|
normalizedOptions.mode = process.env.NODE_ENV;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAGL,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,EAGL,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAoD/C,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,mDAqI7B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -6,13 +6,14 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const generator_utils_1 = require("../../utils/generator-utils");
|
|
8
8
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
9
|
-
const
|
|
9
|
+
const internal_1 = require("@nx/js/internal");
|
|
10
10
|
const deprecation_1 = require("../../utils/deprecation");
|
|
11
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
11
12
|
function projectIsRootProjectInStandaloneWorkspace(projectRoot) {
|
|
12
13
|
return (0, path_1.relative)(devkit_1.workspaceRoot, projectRoot).length === 0;
|
|
13
14
|
}
|
|
14
15
|
function editTsConfig(tree, projectRoot, framework, relativePathToRootTsConfig) {
|
|
15
|
-
const shared = require('@nx/js
|
|
16
|
+
const shared = require('@nx/js');
|
|
16
17
|
if (framework === 'react') {
|
|
17
18
|
const json = {
|
|
18
19
|
compilerOptions: {
|
|
@@ -46,6 +47,7 @@ function editTsConfig(tree, projectRoot, framework, relativePathToRootTsConfig)
|
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
async function configurationGenerator(tree, options) {
|
|
50
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
49
51
|
const task = await (0, init_1.default)(tree, {
|
|
50
52
|
...options,
|
|
51
53
|
});
|
|
@@ -70,7 +72,7 @@ async function configurationGenerator(tree, options) {
|
|
|
70
72
|
projectAlreadyHasRspackTargets = alreadyHasNxRspackTargets;
|
|
71
73
|
if (alreadyHasNxRspackTargets.build &&
|
|
72
74
|
(alreadyHasNxRspackTargets.serve ||
|
|
73
|
-
(0,
|
|
75
|
+
(0, internal_1.getProjectType)(tree, options.project, projectType) === 'library' ||
|
|
74
76
|
options.framework === 'nest')) {
|
|
75
77
|
throw new Error(`The project ${options.project} is already configured to use the @nx/rspack executors.
|
|
76
78
|
Please try a different project, or remove the existing targets
|
package/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-config-to-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,IAAI,EAIL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"convert-config-to-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-config-to-rspack-plugin/convert-config-to-rspack-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,IAAI,EAIL,MAAM,YAAY,CAAC;AAQpB,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAWD,wBAAsB,oCAAoC,CACxD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,iBAsGhB;AAED,eAAe,oCAAoC,CAAC"}
|
|
@@ -7,6 +7,7 @@ const extract_rspack_options_1 = require("./lib/extract-rspack-options");
|
|
|
7
7
|
const normalize_path_options_1 = require("./lib/normalize-path-options");
|
|
8
8
|
const path_1 = require("path");
|
|
9
9
|
const validate_project_1 = require("./lib/validate-project");
|
|
10
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
10
11
|
// Make text JSON compatible
|
|
11
12
|
const preprocessText = (text) => {
|
|
12
13
|
return text
|
|
@@ -16,6 +17,7 @@ const preprocessText = (text) => {
|
|
|
16
17
|
.replace(/(\r\n|\n|\r|\t)/gm, ''); // Remove newlines and tabs
|
|
17
18
|
};
|
|
18
19
|
async function convertConfigToRspackPluginGenerator(tree, options) {
|
|
20
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
19
21
|
let migrated = 0;
|
|
20
22
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
21
23
|
(0, internal_1.forEachExecutorOptions)(tree, '@nx/rspack:rspack', (currentTargetOptions, projectName, targetName, configurationName) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"convert-to-inferred.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-to-inferred/convert-to-inferred.ts"],"names":[],"mappings":"AAKA,OAAO,EAML,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG/D,UAAU,MAAM;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAiFlE;AA6CD,wBAAgB,sBAAsB,IAAI,OAAO,YAAY,GAAG;IAC9D,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,KAAK,IAAI,CAAC;CAC5D,CAkCA"}
|
|
@@ -9,7 +9,9 @@ const plugin_1 = require("../../plugins/plugin");
|
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
10
|
const utils_1 = require("./utils");
|
|
11
11
|
const devkit_exports_1 = require("nx/src/devkit-exports");
|
|
12
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
12
13
|
async function convertToInferred(tree, options) {
|
|
14
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
13
15
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
14
16
|
const migrationContext = {
|
|
15
17
|
logger: new internal_1.AggregatedLog(),
|
|
@@ -52,7 +54,13 @@ async function convertToInferred(tree, options) {
|
|
|
52
54
|
else {
|
|
53
55
|
logger.flushLogs();
|
|
54
56
|
}
|
|
55
|
-
const installCallback = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
57
|
+
const installCallback = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
58
|
+
'@rspack/core': versions_1.rspackCoreVersion,
|
|
59
|
+
// The inferred plugin's targets run the `rspack` CLI. Since
|
|
60
|
+
// @rspack/cli is an optional peer dependency of @nx/rspack, install
|
|
61
|
+
// it explicitly so the converted targets can execute.
|
|
62
|
+
'@rspack/cli': versions_1.rspackCoreVersion,
|
|
63
|
+
}, undefined, true);
|
|
56
64
|
if (!options.skipFormat) {
|
|
57
65
|
await (0, devkit_1.formatFiles)(tree);
|
|
58
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert-webpack.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-webpack/convert-webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"convert-webpack.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/convert-webpack/convert-webpack.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,IAAI,EAGV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAWlC,yBAA+B,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,mDAiKzD"}
|
|
@@ -6,7 +6,9 @@ const versions_1 = require("../../utils/versions");
|
|
|
6
6
|
const transform_esm_1 = require("./lib/transform-esm");
|
|
7
7
|
const transform_cjs_1 = require("./lib/transform-cjs");
|
|
8
8
|
const transform_plugin_config_1 = require("./lib/transform-plugin-config");
|
|
9
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
9
10
|
async function default_1(tree, options) {
|
|
11
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
10
12
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
11
13
|
if (!projects.has(options.project)) {
|
|
12
14
|
throw new Error(`Could not find project '${options.project}'. Ensure you have specified the project you'd like to convert correctly.`);
|
|
@@ -113,7 +115,12 @@ async function default_1(tree, options) {
|
|
|
113
115
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
114
116
|
'@rspack/core': versions_1.rspackCoreVersion,
|
|
115
117
|
'@rspack/dev-server': versions_1.rspackDevServerVersion,
|
|
116
|
-
|
|
118
|
+
// @rspack/plugin-react-refresh is required at runtime by
|
|
119
|
+
// apply-react-config when building a React project. Since it is an
|
|
120
|
+
// optional peer dependency of @nx/rspack, the convert generator must
|
|
121
|
+
// install it explicitly.
|
|
122
|
+
'@rspack/plugin-react-refresh': versions_1.rspackPluginReactRefreshVersion,
|
|
123
|
+
}, undefined, true);
|
|
117
124
|
if (!options.skipFormat) {
|
|
118
125
|
await (0, devkit_1.formatFiles)(tree);
|
|
119
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAWpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,mBAAmB,8BAiH5B;AAED,eAAe,mBAAmB,CAAC;AAEnC,eAAO,MAAM,mBAAmB,sFAA0C,CAAC"}
|
|
@@ -7,7 +7,10 @@ const devkit_1 = require("@nx/devkit");
|
|
|
7
7
|
const js_1 = require("@nx/js");
|
|
8
8
|
const plugin_1 = require("../../../plugin");
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
|
+
const version_utils_1 = require("../../utils/version-utils");
|
|
11
|
+
const assert_supported_rspack_version_1 = require("../../utils/assert-supported-rspack-version");
|
|
10
12
|
async function rspackInitGenerator(tree, schema) {
|
|
13
|
+
(0, assert_supported_rspack_version_1.assertSupportedRspackVersion)(tree);
|
|
11
14
|
const tasks = [];
|
|
12
15
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
13
16
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
@@ -59,12 +62,15 @@ async function rspackInitGenerator(tree, schema) {
|
|
|
59
62
|
skipFormat: true,
|
|
60
63
|
});
|
|
61
64
|
tasks.push(jsInitTask);
|
|
65
|
+
const rspackVersions = (0, version_utils_1.getRspackVersionsForInstalledMajor)(tree);
|
|
66
|
+
const keepExistingVersions = schema.keepExistingVersions ?? true;
|
|
62
67
|
const devDependencies = {
|
|
63
|
-
'@rspack/core':
|
|
64
|
-
'@rspack/cli':
|
|
68
|
+
'@rspack/core': rspackVersions.rspackCoreVersion,
|
|
69
|
+
'@rspack/cli': rspackVersions.rspackCoreVersion,
|
|
70
|
+
'@rspack/dev-server': rspackVersions.rspackDevServerVersion,
|
|
65
71
|
...(!schema.framework || schema.framework === 'react'
|
|
66
72
|
? {
|
|
67
|
-
'@rspack/plugin-react-refresh':
|
|
73
|
+
'@rspack/plugin-react-refresh': rspackVersions.rspackPluginReactRefreshVersion,
|
|
68
74
|
'react-refresh': versions_1.reactRefreshVersion,
|
|
69
75
|
}
|
|
70
76
|
: {}),
|
|
@@ -82,9 +88,10 @@ async function rspackInitGenerator(tree, schema) {
|
|
|
82
88
|
devDependencies['sass-embedded'] = versions_1.sassEmbeddedVersion;
|
|
83
89
|
}
|
|
84
90
|
if (schema.framework !== 'none' || schema.devServer) {
|
|
85
|
-
devDependencies['@rspack/dev-server'] =
|
|
91
|
+
devDependencies['@rspack/dev-server'] =
|
|
92
|
+
rspackVersions.rspackDevServerVersion;
|
|
86
93
|
}
|
|
87
|
-
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined,
|
|
94
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, keepExistingVersions);
|
|
88
95
|
tasks.push(installTask);
|
|
89
96
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
90
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/plugins/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAKd,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/plugins/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,kBAAkB,EAGlB,aAAa,EAKd,MAAM,YAAY,CAAC;AAapB,MAAM,WAAW,mBAAmB;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAID,eAAO,MAAM,kBAAkB,EAAE,kBAEhC,CAAC;AAIF,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAiC5D,CAAC"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.createNodesV2 = exports.createDependencies = void 0;
|
|
|
4
4
|
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
|
-
const
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const file_hasher_1 = require("nx/src/hasher/file-hasher");
|
|
10
10
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
@@ -12,7 +12,6 @@ const package_manager_1 = require("nx/src/utils/package-manager");
|
|
|
12
12
|
const path_1 = require("path");
|
|
13
13
|
const read_rspack_options_1 = require("../utils/read-rspack-options");
|
|
14
14
|
const resolve_user_defined_rspack_config_1 = require("../utils/resolve-user-defined-rspack-config");
|
|
15
|
-
const util_1 = require("@nx/js/src/plugins/typescript/util");
|
|
16
15
|
const createDependencies = () => {
|
|
17
16
|
return [];
|
|
18
17
|
};
|
|
@@ -24,7 +23,7 @@ exports.createNodesV2 = [
|
|
|
24
23
|
const optionsHash = (0, file_hasher_1.hashObject)(options);
|
|
25
24
|
const cachePath = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `rspack-${optionsHash}.hash`);
|
|
26
25
|
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
27
|
-
const isTsSolutionSetup = (0,
|
|
26
|
+
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)();
|
|
28
27
|
const packageManager = (0, devkit_1.detectPackageManager)(context.workspaceRoot);
|
|
29
28
|
const pmc = (0, package_manager_1.getPackageManagerCommand)(packageManager);
|
|
30
29
|
const lockFileName = (0, js_1.getLockFileName)(packageManager);
|
|
@@ -166,7 +165,7 @@ async function createRspackTargets(configFilePath, projectRoot, options, context
|
|
|
166
165
|
'@nx/js:typescript-sync',
|
|
167
166
|
];
|
|
168
167
|
}
|
|
169
|
-
(0,
|
|
168
|
+
(0, internal_2.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
|
|
170
169
|
return { targets, metadata: {} };
|
|
171
170
|
}
|
|
172
171
|
function normalizeOptions(options) {
|
|
@@ -12,7 +12,7 @@ const hash_format_1 = require("./hash-format");
|
|
|
12
12
|
const nx_tsconfig_paths_rspack_plugin_1 = require("./plugins/nx-tsconfig-paths-rspack-plugin");
|
|
13
13
|
const get_terser_ecma_version_1 = require("./get-terser-ecma-version");
|
|
14
14
|
const nodeExternals = require("webpack-node-externals");
|
|
15
|
-
const
|
|
15
|
+
const internal_1 = require("@nx/js/internal");
|
|
16
16
|
const get_non_buildable_libs_1 = require("./get-non-buildable-libs");
|
|
17
17
|
const IGNORED_RSPACK_WARNINGS = [
|
|
18
18
|
/The comment file/i,
|
|
@@ -201,7 +201,7 @@ function applyNxIndependentConfig(options, config) {
|
|
|
201
201
|
function applyNxDependentConfig(options, config, { useNormalizedEntry } = {}) {
|
|
202
202
|
const tsConfig = options.tsConfig ?? (0, js_1.getRootTsConfigPath)();
|
|
203
203
|
const plugins = [];
|
|
204
|
-
const isUsingTsSolution = (0,
|
|
204
|
+
const isUsingTsSolution = (0, internal_1.isUsingTsSolutionSetup)();
|
|
205
205
|
const executorContext = {
|
|
206
206
|
projectName: options.projectName,
|
|
207
207
|
targetName: options.targetName,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applyWebConfig = applyWebConfig;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/js/internal");
|
|
5
5
|
const core_1 = require("@rspack/core");
|
|
6
6
|
const path_1 = require("path");
|
|
7
7
|
const write_index_html_plugin_1 = require("../write-index-html-plugin");
|
|
@@ -18,7 +18,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
18
18
|
options.generateIndexHtml ??= true;
|
|
19
19
|
options.index = options.index
|
|
20
20
|
? (0, path_1.join)(options.root, options.index)
|
|
21
|
-
: (0, path_1.join)(options.root, (0,
|
|
21
|
+
: (0, path_1.join)(options.root, (0, internal_1.getProjectSourceRoot)(options.projectGraph.nodes[options.projectName].data), 'index.html');
|
|
22
22
|
options.styles ??= [];
|
|
23
23
|
options.scripts ??= [];
|
|
24
24
|
const isProd = process.env.NODE_ENV === 'production' || options.mode === 'production';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DevTool, Mode } from '@rspack/core';
|
|
2
2
|
import type { ProjectGraph } from '@nx/devkit';
|
|
3
|
-
import type { AssetGlob } from '@nx/js/
|
|
3
|
+
import type { AssetGlob } from '@nx/js/internal';
|
|
4
4
|
export interface AssetGlobPattern {
|
|
5
5
|
glob: string;
|
|
6
6
|
input: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAE1D,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAA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|
5
5
|
exports.normalizeFileReplacements = normalizeFileReplacements;
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const path_1 = require("path");
|
|
10
10
|
function normalizeOptions(options) {
|
|
@@ -49,7 +49,7 @@ function normalizeOptions(options) {
|
|
|
49
49
|
// executor options take precedence (especially for overriding with CLI args)
|
|
50
50
|
originalTargetOptions);
|
|
51
51
|
}
|
|
52
|
-
const sourceRoot = (0,
|
|
52
|
+
const sourceRoot = (0, internal_1.getProjectSourceRoot)(projectNode.data);
|
|
53
53
|
if (!combinedPluginAndMaybeExecutorOptions.main) {
|
|
54
54
|
throw new Error(`Missing "main" option for the entry file. Set this option in your Nx rspack plugin.`);
|
|
55
55
|
}
|
|
@@ -4,7 +4,7 @@ exports.NxTsconfigPathsRspackPlugin = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path = tslib_1.__importStar(require("path"));
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const rspack_nx_build_coordination_plugin_1 = require("./rspack-nx-build-coordination-plugin");
|
|
9
9
|
const fs_1 = require("fs");
|
|
10
10
|
class NxTsconfigPathsRspackPlugin {
|
|
@@ -43,8 +43,8 @@ class NxTsconfigPathsRspackPlugin {
|
|
|
43
43
|
handleBuildLibsFromSource(config, options) {
|
|
44
44
|
if (!options.buildLibsFromSource && options.targetName) {
|
|
45
45
|
const remappedTarget = options.targetName === 'serve' ? 'build' : options.targetName;
|
|
46
|
-
const { target, dependencies } = (0,
|
|
47
|
-
options.tsConfig = (0,
|
|
46
|
+
const { target, dependencies } = (0, internal_1.calculateProjectBuildableDependencies)(undefined, options.projectGraph, options.root, options.projectName, remappedTarget, options.configurationName);
|
|
47
|
+
options.tsConfig = (0, internal_1.createTmpTsConfig)(options.tsConfig, options.root, target.data.root, dependencies);
|
|
48
48
|
this.tmpTsConfigPath = options.tsConfig;
|
|
49
49
|
if (options.targetName === 'serve') {
|
|
50
50
|
const buildableDependencies = dependencies
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-supported-rspack-version.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/assert-supported-rspack-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAIvC,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAM7D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.assertSupportedRspackVersion = assertSupportedRspackVersion;
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
|
+
const versions_1 = require("./versions");
|
|
6
|
+
function assertSupportedRspackVersion(tree) {
|
|
7
|
+
(0, internal_1.assertSupportedPackageVersion)(tree, '@rspack/core', versions_1.minSupportedRspackVersion);
|
|
8
|
+
}
|
package/src/utils/config.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.isNxRspackComposablePlugin = isNxRspackComposablePlugin;
|
|
|
5
5
|
exports.composePlugins = composePlugins;
|
|
6
6
|
exports.composePluginsSync = composePluginsSync;
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
|
-
const
|
|
8
|
+
const internal_1 = require("@nx/js/internal");
|
|
9
9
|
const configuration_1 = require("nx/src/config/configuration");
|
|
10
10
|
exports.nxRspackComposablePlugin = 'nxRspackComposablePlugin';
|
|
11
11
|
function isNxRspackComposablePlugin(a) {
|
|
@@ -50,7 +50,7 @@ function ensureNxRspackExecutionContext(ctx) {
|
|
|
50
50
|
ctx.options ??= {
|
|
51
51
|
root: devkit_1.workspaceRoot,
|
|
52
52
|
projectRoot: projectNode.data.root,
|
|
53
|
-
sourceRoot: (0,
|
|
53
|
+
sourceRoot: (0, internal_1.getProjectSourceRoot)(projectNode.data),
|
|
54
54
|
// These aren't actually needed since NxRspackPlugin and withNx both support them being undefined.
|
|
55
55
|
assets: undefined,
|
|
56
56
|
outputFileName: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e-web-server-info-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/e2e-web-server-info-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"e2e-web-server-info-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/e2e-web-server-info-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,YAAY,CAAC;AAMnD,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,OAAO,EAC3B,eAAe,CAAC,EAAE,MAAM,8DA6BzB"}
|
|
@@ -6,9 +6,10 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
async function getRspackE2EWebServerInfo(tree, projectName, configFilePath, isPluginBeingAdded, e2ePortOverride) {
|
|
7
7
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
8
8
|
let e2ePort = e2ePortOverride ?? 4200;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const servePort = (0, internal_1.readTargetDefaultsForTarget)('serve', nxJson.targetDefaults)
|
|
10
|
+
?.options?.port;
|
|
11
|
+
if (servePort) {
|
|
12
|
+
e2ePort = servePort;
|
|
12
13
|
}
|
|
13
14
|
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
14
15
|
plugin: '@nx/rspack/plugin',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/generator-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,mBAAmB,EACnB,IAAI,EAEL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"generator-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/generator-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,mBAAmB,EACnB,IAAI,EAEL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAG3D,MAAM,MAAM,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC;AACvC,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3D,MAAM,MAAM,sBAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AACrE,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAKnE,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE;IACP,CAAC,UAAU,EAAE,MAAM,GAAG,mBAAmB,CAAC;CAC3C,EACD,mBAAmB,CAAC,EAAE,sBAAsB,GAC3C;IACD,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,kCAAkC,EAAE,OAAO,CAAC;IAC5C,+BAA+B,EAAE,WAAW,CAAC;IAC7C,yBAAyB,EAAE,WAAW,CAAC;CACxC,CAwHA;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,MAAM,QAgEf;AAED,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,EAC5B,MAAM,EAAE,MAAM,QAoBf;AAED,wBAAgB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,8 +14,7 @@ exports.determineFrameworkAndTarget = determineFrameworkAndTarget;
|
|
|
14
14
|
exports.determineMain = determineMain;
|
|
15
15
|
exports.determineTsConfig = determineTsConfig;
|
|
16
16
|
const devkit_1 = require("@nx/devkit");
|
|
17
|
-
const
|
|
18
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
17
|
+
const internal_1 = require("@nx/js/internal");
|
|
19
18
|
const has_plugin_1 = require("./has-plugin");
|
|
20
19
|
function findExistingTargetsInProject(targets, userProvidedTargets) {
|
|
21
20
|
const output = {
|
|
@@ -130,7 +129,7 @@ function addOrChangeBuildTarget(tree, options, target) {
|
|
|
130
129
|
if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'src/assets'))) {
|
|
131
130
|
assets.push((0, devkit_1.joinPathFragments)(project.root, 'src/assets'));
|
|
132
131
|
}
|
|
133
|
-
const isTsSolutionSetup = (0,
|
|
132
|
+
const isTsSolutionSetup = (0, internal_1.isUsingTsSolutionSetup)(tree);
|
|
134
133
|
const buildOptions = {
|
|
135
134
|
target: options.target ?? 'web',
|
|
136
135
|
outputPath: isTsSolutionSetup
|
|
@@ -486,7 +485,7 @@ async function handleUnknownExecutors(projectName) {
|
|
|
486
485
|
}
|
|
487
486
|
}
|
|
488
487
|
function determineFrameworkAndTarget(tree, options, projectRoot, targets) {
|
|
489
|
-
(0,
|
|
488
|
+
(0, internal_1.ensureTypescript)();
|
|
490
489
|
const { ast, query } = require('@phenomnomnominal/tsquery');
|
|
491
490
|
// First try to infer if the target is node
|
|
492
491
|
if (options.target !== 'node') {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
import { type SupportedRspackMajorVersion } from './versions';
|
|
3
|
+
/**
|
|
4
|
+
* Returns the declared @rspack/core major version from the workspace's
|
|
5
|
+
* package.json when it matches a supported major, or `undefined` otherwise
|
|
6
|
+
* (fresh install, dist tag, unknown major). Below-floor enforcement is
|
|
7
|
+
* handled at generator entry points via `assertSupportedRspackVersion`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getInstalledRspackMajorVersion(tree: Tree): SupportedRspackMajorVersion | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Returns the installed @rspack/core major version resolved at runtime from
|
|
12
|
+
* node_modules. For use in executors and runtime code where no Tree is
|
|
13
|
+
* available. Returns `null` when @rspack/core can't be resolved or the
|
|
14
|
+
* installed major isn't supported.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getInstalledRspackVersionRuntime(): SupportedRspackMajorVersion | null;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the version-map entry for the installed major, falling back to the
|
|
19
|
+
* latest supported map when no installed version is detected (fresh install)
|
|
20
|
+
* or the detected major is outside the supported window.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getRspackVersionsForInstalledMajor(tree: Tree): {
|
|
23
|
+
rspackCoreVersion: string;
|
|
24
|
+
rspackDevServerVersion: string;
|
|
25
|
+
rspackPluginReactRefreshVersion: string;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=version-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/version-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAMvC,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,YAAY,CAAC;AAIpB;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,IAAI,GACT,2BAA2B,GAAG,SAAS,CASzC;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,IAAI,2BAA2B,GAAG,IAAI,CASrF;AAED;;;;GAIG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,EAAE,IAAI;;;;EAM5D"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInstalledRspackMajorVersion = getInstalledRspackMajorVersion;
|
|
4
|
+
exports.getInstalledRspackVersionRuntime = getInstalledRspackVersionRuntime;
|
|
5
|
+
exports.getRspackVersionsForInstalledMajor = getRspackVersionsForInstalledMajor;
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
+
const semver_1 = require("semver");
|
|
8
|
+
const versions_1 = require("./versions");
|
|
9
|
+
const RSPACK_CORE_PACKAGE = '@rspack/core';
|
|
10
|
+
/**
|
|
11
|
+
* Returns the declared @rspack/core major version from the workspace's
|
|
12
|
+
* package.json when it matches a supported major, or `undefined` otherwise
|
|
13
|
+
* (fresh install, dist tag, unknown major). Below-floor enforcement is
|
|
14
|
+
* handled at generator entry points via `assertSupportedRspackVersion`.
|
|
15
|
+
*/
|
|
16
|
+
function getInstalledRspackMajorVersion(tree) {
|
|
17
|
+
const declared = (0, internal_1.getDeclaredPackageVersion)(tree, RSPACK_CORE_PACKAGE);
|
|
18
|
+
if (!declared) {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
const installedMajor = (0, semver_1.major)(declared);
|
|
22
|
+
return installedMajor in versions_1.backwardCompatibleRspackVersions
|
|
23
|
+
? installedMajor
|
|
24
|
+
: undefined;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns the installed @rspack/core major version resolved at runtime from
|
|
28
|
+
* node_modules. For use in executors and runtime code where no Tree is
|
|
29
|
+
* available. Returns `null` when @rspack/core can't be resolved or the
|
|
30
|
+
* installed major isn't supported.
|
|
31
|
+
*/
|
|
32
|
+
function getInstalledRspackVersionRuntime() {
|
|
33
|
+
const version = (0, internal_1.getInstalledPackageVersion)(RSPACK_CORE_PACKAGE);
|
|
34
|
+
if (!version) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
const installedMajor = (0, semver_1.major)(version);
|
|
38
|
+
return installedMajor in versions_1.backwardCompatibleRspackVersions
|
|
39
|
+
? installedMajor
|
|
40
|
+
: null;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Returns the version-map entry for the installed major, falling back to the
|
|
44
|
+
* latest supported map when no installed version is detected (fresh install)
|
|
45
|
+
* or the detected major is outside the supported window.
|
|
46
|
+
*/
|
|
47
|
+
function getRspackVersionsForInstalledMajor(tree) {
|
|
48
|
+
const installed = getInstalledRspackMajorVersion(tree);
|
|
49
|
+
if (installed === undefined) {
|
|
50
|
+
return versions_1.latestRspackVersions;
|
|
51
|
+
}
|
|
52
|
+
return versions_1.backwardCompatibleRspackVersions[installed];
|
|
53
|
+
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const rspackDevServerVersion = "^1.1.4";
|
|
4
|
-
export declare const rspackPluginReactRefreshVersion = "^1.0.0";
|
|
2
|
+
export declare const minSupportedRspackVersion = "1.0.0";
|
|
5
3
|
export declare const lessLoaderVersion = "~11.1.3";
|
|
6
4
|
export declare const sassLoaderVersion = "^16.0.7";
|
|
7
5
|
export declare const sassEmbeddedVersion = "^1.97.2";
|
|
8
6
|
export declare const reactRefreshVersion = "~0.14.0";
|
|
7
|
+
export declare const supportedRspackMajorVersions: readonly [1];
|
|
8
|
+
export type SupportedRspackMajorVersion = (typeof supportedRspackMajorVersions)[number];
|
|
9
|
+
type RspackVersionMap = {
|
|
10
|
+
rspackCoreVersion: string;
|
|
11
|
+
rspackDevServerVersion: string;
|
|
12
|
+
rspackPluginReactRefreshVersion: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const latestRspackVersions: RspackVersionMap;
|
|
15
|
+
export declare const backwardCompatibleRspackVersions: Record<SupportedRspackMajorVersion, RspackVersionMap>;
|
|
16
|
+
/**
|
|
17
|
+
* Kept for backward compatibility with code paths that don't yet branch on
|
|
18
|
+
* the detected installed major. Points at the latest supported major.
|
|
19
|
+
*/
|
|
20
|
+
export declare const rspackCoreVersion: string;
|
|
21
|
+
export declare const rspackDevServerVersion: string;
|
|
22
|
+
export declare const rspackPluginReactRefreshVersion: string;
|
|
23
|
+
export {};
|
|
9
24
|
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/versions.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,KAAwC,CAAC;AAE/D,eAAO,MAAM,yBAAyB,UAAU,CAAC;AAEjD,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAC7C,eAAO,MAAM,mBAAmB,YAAY,CAAC;AAK7C,eAAO,MAAM,4BAA4B,cAAe,CAAC;AACzD,MAAM,MAAM,2BAA2B,GACrC,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD,KAAK,gBAAgB,GAAG;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,+BAA+B,EAAE,MAAM,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,gBAIlC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,2BAA2B,EAC3B,gBAAgB,CAGjB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAAyC,CAAC;AACxE,eAAO,MAAM,sBAAsB,QACU,CAAC;AAC9C,eAAO,MAAM,+BAA+B,QACU,CAAC"}
|
package/src/utils/versions.js
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.rspackPluginReactRefreshVersion = exports.rspackDevServerVersion = exports.rspackCoreVersion = exports.backwardCompatibleRspackVersions = exports.latestRspackVersions = exports.supportedRspackMajorVersions = exports.reactRefreshVersion = exports.sassEmbeddedVersion = exports.sassLoaderVersion = exports.lessLoaderVersion = exports.minSupportedRspackVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.
|
|
6
|
-
exports.rspackDevServerVersion = '^1.1.4';
|
|
7
|
-
exports.rspackPluginReactRefreshVersion = '^1.0.0';
|
|
5
|
+
exports.minSupportedRspackVersion = '1.0.0';
|
|
8
6
|
exports.lessLoaderVersion = '~11.1.3';
|
|
9
7
|
exports.sassLoaderVersion = '^16.0.7';
|
|
10
8
|
exports.sassEmbeddedVersion = '^1.97.2';
|
|
11
9
|
exports.reactRefreshVersion = '~0.14.0';
|
|
10
|
+
// Supported `@rspack/core` majors. Currently v1 only — v2 ships as pure
|
|
11
|
+
// ESM, which @nx/rspack (CommonJS) cannot consume without a deeper
|
|
12
|
+
// refactor; tracked separately.
|
|
13
|
+
exports.supportedRspackMajorVersions = [1];
|
|
14
|
+
exports.latestRspackVersions = {
|
|
15
|
+
rspackCoreVersion: '1.6.8',
|
|
16
|
+
rspackDevServerVersion: '^1.1.4',
|
|
17
|
+
rspackPluginReactRefreshVersion: '^1.0.0',
|
|
18
|
+
};
|
|
19
|
+
exports.backwardCompatibleRspackVersions = {
|
|
20
|
+
1: exports.latestRspackVersions,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Kept for backward compatibility with code paths that don't yet branch on
|
|
24
|
+
* the detected installed major. Points at the latest supported major.
|
|
25
|
+
*/
|
|
26
|
+
exports.rspackCoreVersion = exports.latestRspackVersions.rspackCoreVersion;
|
|
27
|
+
exports.rspackDevServerVersion = exports.latestRspackVersions.rspackDevServerVersion;
|
|
28
|
+
exports.rspackPluginReactRefreshVersion = exports.latestRspackVersions.rspackPluginReactRefreshVersion;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-react.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/with-react.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"with-react.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/with-react.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAW,cAAc,EAAE,MAAM,YAAY,CAAC;AAGrD,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG;AAE3D,wBAAgB,SAAS,CAAC,IAAI,GAAE,gBAAqB,IAEjD,QAAQ,aAAa,EACrB,sBAAsB,wBAAwB,KAC7C,aAAa,CASjB"}
|
package/src/utils/with-web.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-web.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/with-web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"with-web.d.ts","sourceRoot":"","sources":["../../../../../packages/rspack/src/utils/with-web.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,E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