@nx/rspack 21.6.2 → 21.7.0-canary.20250930-e144408
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/generators.json +0 -14
- package/migrations.json +6 -0
- package/package.json +7 -7
- package/src/executors/rspack/lib/normalize-options.d.ts.map +1 -1
- package/src/executors/rspack/lib/normalize-options.js +0 -1
- package/src/executors/rspack/rspack.impl.d.ts.map +1 -1
- package/src/executors/rspack/rspack.impl.js +0 -7
- package/src/executors/rspack/schema.d.ts +0 -2
- package/src/executors/rspack/schema.json +0 -11
- package/src/generators/configuration/configuration.d.ts.map +1 -1
- package/src/generators/configuration/configuration.js +46 -2
- package/src/migrations/update-22-0-0/remove-deprecated-options.d.ts +3 -0
- package/src/migrations/update-22-0-0/remove-deprecated-options.d.ts.map +1 -0
- package/src/migrations/update-22-0-0/remove-deprecated-options.js +95 -0
- package/src/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.d.ts.map +1 -1
- package/src/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.js +0 -4
- package/src/plugins/utils/apply-base-config.d.ts.map +1 -1
- package/src/plugins/utils/apply-base-config.js +1 -2
- package/src/plugins/utils/apply-web-config.d.ts.map +1 -1
- package/src/plugins/utils/apply-web-config.js +3 -9
- package/src/plugins/utils/models.d.ts +0 -10
- package/src/plugins/utils/models.d.ts.map +1 -1
- package/src/plugins/utils/plugins/normalize-options.d.ts.map +1 -1
- package/src/plugins/utils/plugins/normalize-options.js +0 -3
- package/src/utils/with-web.d.ts +0 -1
- package/src/utils/with-web.d.ts.map +1 -1
- package/src/generators/application/application.d.ts +0 -4
- package/src/generators/application/application.d.ts.map +0 -1
- package/src/generators/application/application.js +0 -141
- package/src/generators/application/lib/create-ts-config.d.ts +0 -4
- package/src/generators/application/lib/create-ts-config.d.ts.map +0 -1
- package/src/generators/application/lib/create-ts-config.js +0 -49
- package/src/generators/application/lib/normalize-options.d.ts +0 -4
- package/src/generators/application/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/application/lib/normalize-options.js +0 -30
- package/src/generators/application/schema.d.ts +0 -16
- package/src/generators/application/schema.json +0 -94
- package/src/generators/preset/preset.d.ts +0 -4
- package/src/generators/preset/preset.d.ts.map +0 -1
- package/src/generators/preset/preset.js +0 -29
- package/src/generators/preset/schema.d.ts +0 -17
- package/src/generators/preset/schema.json +0 -67
package/generators.json
CHANGED
|
@@ -14,20 +14,6 @@
|
|
|
14
14
|
"description": "Rspack init generator.",
|
|
15
15
|
"hidden": true
|
|
16
16
|
},
|
|
17
|
-
"preset": {
|
|
18
|
-
"factory": "./src/generators/preset/preset",
|
|
19
|
-
"schema": "./src/generators/preset/schema.json",
|
|
20
|
-
"description": "React preset generator.",
|
|
21
|
-
"hidden": true
|
|
22
|
-
},
|
|
23
|
-
"application": {
|
|
24
|
-
"factory": "./src/generators/application/application",
|
|
25
|
-
"schema": "./src/generators/application/schema.json",
|
|
26
|
-
"aliases": ["app"],
|
|
27
|
-
"x-type": "application",
|
|
28
|
-
"description": "React application generator.",
|
|
29
|
-
"x-deprecated": "This generator will be removed in Nx 22. Please use the equivalent generator for your application type instead."
|
|
30
|
-
},
|
|
31
17
|
"convert-webpack": {
|
|
32
18
|
"aliases": ["convert-to-rspack"],
|
|
33
19
|
"factory": "./src/generators/convert-webpack/convert-webpack",
|
package/migrations.json
CHANGED
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
"version": "20.3.0-beta.2",
|
|
12
12
|
"description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
|
|
13
13
|
"factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package"
|
|
14
|
+
},
|
|
15
|
+
"remove-deprecated-rspack-options": {
|
|
16
|
+
"cli": "nx",
|
|
17
|
+
"version": "22.0.0-beta.1",
|
|
18
|
+
"description": "Remove deprecated deleteOutputPath and sassImplementation options from rspack configurations.",
|
|
19
|
+
"factory": "./src/migrations/update-22-0-0/remove-deprecated-options"
|
|
14
20
|
}
|
|
15
21
|
},
|
|
16
22
|
"packageJsonUpdates": {
|
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": "21.
|
|
4
|
+
"version": "21.7.0-canary.20250930-e144408",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"generators": "./generators.json",
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nx/devkit": "21.
|
|
28
|
-
"@nx/js": "21.
|
|
29
|
-
"@nx/module-federation": "21.
|
|
30
|
-
"@nx/web": "21.
|
|
27
|
+
"@nx/devkit": "21.7.0-canary.20250930-e144408",
|
|
28
|
+
"@nx/js": "21.7.0-canary.20250930-e144408",
|
|
29
|
+
"@nx/module-federation": "21.7.0-canary.20250930-e144408",
|
|
30
|
+
"@nx/web": "21.7.0-canary.20250930-e144408",
|
|
31
31
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
32
32
|
"@rspack/core": "^1.5.0",
|
|
33
33
|
"@rspack/dev-server": "^1.1.4",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"webpack-node-externals": "^3.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"nx": "21.
|
|
61
|
-
"@nx/nest": "21.
|
|
60
|
+
"nx": "21.7.0-canary.20250930-e144408",
|
|
61
|
+
"@nx/nest": "21.7.0-canary.20250930-e144408"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@module-federation/enhanced": "^0.18.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/executors/rspack/lib/normalize-options.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,EACpB,8BAA8B,EAC/B,MAAM,WAAW,CAAC;AAGnB,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,8BAA8B,
|
|
1
|
+
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/executors/rspack/lib/normalize-options.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,EACpB,8BAA8B,EAC/B,MAAM,WAAW,CAAC;AAGnB,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,oBAAoB,EAC7B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,GACjB,8BAA8B,CA6BhC;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,IAAI,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,UAS1E"}
|
|
@@ -22,7 +22,6 @@ function normalizeOptions(options, root, projectRoot, sourceRoot) {
|
|
|
22
22
|
styles: options.optimization,
|
|
23
23
|
}
|
|
24
24
|
: options.optimization,
|
|
25
|
-
sassImplementation: options.sassImplementation ?? 'sass',
|
|
26
25
|
};
|
|
27
26
|
if (options.assets) {
|
|
28
27
|
normalizedOptions.assets = (0, normalize_options_1.normalizeAssets)(options.assets, root, sourceRoot, projectRoot, false // executor assets are relative to workspace root for consistency
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rspack.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/rspack/rspack.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAUrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,wBAA+B,WAAW,CACxC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"rspack.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/executors/rspack/rspack.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAU,MAAM,YAAY,CAAC;AAUrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,wBAA+B,WAAW,CACxC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,eAAe;aA0Bb,OAAO;cACN,MAAM;cA+EnB"}
|
|
@@ -6,7 +6,6 @@ const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
|
6
6
|
const js_1 = require("@nx/js");
|
|
7
7
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
8
8
|
const core_1 = require("@rspack/core");
|
|
9
|
-
const fs_1 = require("fs");
|
|
10
9
|
const path_1 = require("path");
|
|
11
10
|
const create_compiler_1 = require("../../utils/create-compiler");
|
|
12
11
|
const mode_utils_1 = require("../../utils/mode-utils");
|
|
@@ -23,12 +22,6 @@ async function* runExecutor(options, context) {
|
|
|
23
22
|
if (!normalizedOptions.skipTypeChecking) {
|
|
24
23
|
await executeTypeCheck(normalizedOptions, context);
|
|
25
24
|
}
|
|
26
|
-
if (options.deleteOutputPath !== false) {
|
|
27
|
-
(0, fs_1.rmSync)((0, path_1.join)(context.root, normalizedOptions.outputPath), {
|
|
28
|
-
force: true,
|
|
29
|
-
recursive: true,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
25
|
const compiler = await (0, create_compiler_1.createCompiler)(normalizedOptions, context);
|
|
33
26
|
const iterable = (0, async_iterable_1.createAsyncIterable)(async ({ next, done }) => {
|
|
34
27
|
const watch = (compiler instanceof core_1.Compiler
|
|
@@ -5,7 +5,6 @@ export interface RspackExecutorSchema {
|
|
|
5
5
|
assets?: Array<AssetGlobPattern | string>;
|
|
6
6
|
baseHref?: string;
|
|
7
7
|
buildLibsFromSource?: boolean;
|
|
8
|
-
deleteOutputPath?: boolean;
|
|
9
8
|
deployUrl?: string;
|
|
10
9
|
extractCss?: boolean;
|
|
11
10
|
extractLicenses?: boolean;
|
|
@@ -41,7 +40,6 @@ export interface RspackExecutorSchema {
|
|
|
41
40
|
sassOptions?: Record<string, any>;
|
|
42
41
|
lessOptions?: Record<string, any>;
|
|
43
42
|
};
|
|
44
|
-
sassImplementation?: 'sass' | 'sass-embedded';
|
|
45
43
|
styles?: Array<ExtraEntryPointClass | string>;
|
|
46
44
|
target?: 'web' | 'node';
|
|
47
45
|
transformers?: TransformerEntry[];
|
|
@@ -10,11 +10,6 @@
|
|
|
10
10
|
"description": "The platform to target (e.g. web, node).",
|
|
11
11
|
"enum": ["web", "node"]
|
|
12
12
|
},
|
|
13
|
-
"deleteOutputPath": {
|
|
14
|
-
"type": "boolean",
|
|
15
|
-
"description": "Delete the output path before building.",
|
|
16
|
-
"default": true
|
|
17
|
-
},
|
|
18
13
|
"main": {
|
|
19
14
|
"type": "string",
|
|
20
15
|
"description": "The main entry file."
|
|
@@ -262,12 +257,6 @@
|
|
|
262
257
|
},
|
|
263
258
|
"additionalProperties": false
|
|
264
259
|
},
|
|
265
|
-
"sassImplementation": {
|
|
266
|
-
"type": "string",
|
|
267
|
-
"description": "The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.",
|
|
268
|
-
"enum": ["sass", "sass-embedded"],
|
|
269
|
-
"default": "sass"
|
|
270
|
-
},
|
|
271
260
|
"styles": {
|
|
272
261
|
"type": "array",
|
|
273
262
|
"description": "External Styles which will be included with the application",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/configuration/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,IAAI,
|
|
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;AAwD/C,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,mDA0H7B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -3,10 +3,54 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.configurationGenerator = configurationGenerator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const path_1 = require("path");
|
|
6
7
|
const generator_utils_1 = require("../../utils/generator-utils");
|
|
7
|
-
const create_ts_config_1 = require("../application/lib/create-ts-config");
|
|
8
8
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
9
9
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
10
|
+
function projectIsRootProjectInStandaloneWorkspace(projectRoot) {
|
|
11
|
+
return (0, path_1.relative)(devkit_1.workspaceRoot, projectRoot).length === 0;
|
|
12
|
+
}
|
|
13
|
+
function editTsConfig(tree, projectRoot, framework, relativePathToRootTsConfig) {
|
|
14
|
+
// Nx 15.8 moved util to @nx/js, but it is in @nx/workspace in 15.7
|
|
15
|
+
let shared;
|
|
16
|
+
try {
|
|
17
|
+
shared = require('@nx/js/src/utils/typescript/create-ts-config');
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
shared = require('@nx/workspace/src/utils/create-ts-config');
|
|
21
|
+
}
|
|
22
|
+
if (framework === 'react') {
|
|
23
|
+
const json = {
|
|
24
|
+
compilerOptions: {
|
|
25
|
+
jsx: 'react-jsx',
|
|
26
|
+
allowJs: false,
|
|
27
|
+
esModuleInterop: false,
|
|
28
|
+
allowSyntheticDefaultImports: true,
|
|
29
|
+
strict: true,
|
|
30
|
+
},
|
|
31
|
+
files: [],
|
|
32
|
+
include: [],
|
|
33
|
+
references: [
|
|
34
|
+
{
|
|
35
|
+
path: './tsconfig.app.json',
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
// inline tsconfig.base.json into the project
|
|
40
|
+
if (projectIsRootProjectInStandaloneWorkspace(projectRoot)) {
|
|
41
|
+
json.compileOnSave = false;
|
|
42
|
+
json.compilerOptions = {
|
|
43
|
+
...shared.tsConfigBaseOptions,
|
|
44
|
+
...json.compilerOptions,
|
|
45
|
+
};
|
|
46
|
+
json.exclude = ['node_modules', 'tmp'];
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
json.extends = relativePathToRootTsConfig;
|
|
50
|
+
}
|
|
51
|
+
(0, devkit_1.writeJson)(tree, `${projectRoot}/tsconfig.json`, json);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
10
54
|
async function configurationGenerator(tree, options) {
|
|
11
55
|
const task = await (0, init_1.default)(tree, {
|
|
12
56
|
...options,
|
|
@@ -60,7 +104,7 @@ async function configurationGenerator(tree, options) {
|
|
|
60
104
|
foundStylePreprocessorOptions =
|
|
61
105
|
targets?.[buildTargetName]?.options?.stylePreprocessorOptions;
|
|
62
106
|
(0, generator_utils_1.deleteWebpackConfig)(tree, root, targets?.[buildTargetName]?.options?.webpackConfig);
|
|
63
|
-
|
|
107
|
+
editTsConfig(tree, root, options.framework, (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(root), 'tsconfig.base.json'));
|
|
64
108
|
}
|
|
65
109
|
if (!projectAlreadyHasRspackTargets.build) {
|
|
66
110
|
(0, generator_utils_1.addOrChangeBuildTarget)(tree, options, buildTargetName);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-deprecated-options.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/migrations/update-22-0-0/remove-deprecated-options.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,EAKV,MAAM,YAAY,CAAC;AAGpB,wBAA8B,uBAAuB,CAAC,IAAI,EAAE,IAAI,iBAwH/D"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = removeDeprecatedOptions;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
|
|
6
|
+
async function removeDeprecatedOptions(tree) {
|
|
7
|
+
const projects = new Set();
|
|
8
|
+
// Find all projects using @nx/rspack:rspack or @nx/rspack:dev-server executors
|
|
9
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/rspack:rspack', (options, project) => {
|
|
10
|
+
projects.add(project);
|
|
11
|
+
});
|
|
12
|
+
(0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nx/rspack:dev-server', (options, project) => {
|
|
13
|
+
projects.add(project);
|
|
14
|
+
});
|
|
15
|
+
// Update project configurations to remove deprecated options
|
|
16
|
+
for (const projectName of projects) {
|
|
17
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
|
|
18
|
+
let hasChanges = false;
|
|
19
|
+
// Check all targets for deprecated options
|
|
20
|
+
if (projectConfig.targets) {
|
|
21
|
+
for (const targetName in projectConfig.targets) {
|
|
22
|
+
const target = projectConfig.targets[targetName];
|
|
23
|
+
if (target.executor === '@nx/rspack:rspack' ||
|
|
24
|
+
target.executor === '@nx/rspack:dev-server') {
|
|
25
|
+
// Handle options
|
|
26
|
+
if (target.options) {
|
|
27
|
+
if ('deleteOutputPath' in target.options) {
|
|
28
|
+
delete target.options.deleteOutputPath;
|
|
29
|
+
hasChanges = true;
|
|
30
|
+
}
|
|
31
|
+
if ('sassImplementation' in target.options) {
|
|
32
|
+
delete target.options.sassImplementation;
|
|
33
|
+
hasChanges = true;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Handle configurations
|
|
37
|
+
if (target.configurations) {
|
|
38
|
+
for (const configName in target.configurations) {
|
|
39
|
+
const config = target.configurations[configName];
|
|
40
|
+
if ('deleteOutputPath' in config) {
|
|
41
|
+
delete config.deleteOutputPath;
|
|
42
|
+
hasChanges = true;
|
|
43
|
+
}
|
|
44
|
+
if ('sassImplementation' in config) {
|
|
45
|
+
delete config.sassImplementation;
|
|
46
|
+
hasChanges = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (hasChanges) {
|
|
54
|
+
(0, devkit_1.updateJson)(tree, `${projectConfig.root}/project.json`, () => projectConfig);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// Find and update any rspack.config.ts/js files that might use these options
|
|
58
|
+
const rspackConfigFiles = new Set();
|
|
59
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
60
|
+
if (filePath.endsWith('rspack.config.ts') ||
|
|
61
|
+
filePath.endsWith('rspack.config.js')) {
|
|
62
|
+
rspackConfigFiles.add(filePath);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
for (const configFile of rspackConfigFiles) {
|
|
66
|
+
let contents = tree.read(configFile, 'utf-8');
|
|
67
|
+
let hasChanges = false;
|
|
68
|
+
// Check if the file contains deleteOutputPath
|
|
69
|
+
if (contents.includes('deleteOutputPath')) {
|
|
70
|
+
// Add a comment explaining the migration
|
|
71
|
+
const deleteOutputPathRegex = /deleteOutputPath\s*:\s*(?:true|false)/g;
|
|
72
|
+
const matches = contents.match(deleteOutputPathRegex);
|
|
73
|
+
if (matches) {
|
|
74
|
+
// Replace deleteOutputPath with a comment
|
|
75
|
+
contents = contents.replace(deleteOutputPathRegex, '// deleteOutputPath option has been removed in Nx v22. Use output.clean in your Rspack config instead');
|
|
76
|
+
hasChanges = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Check if the file contains sassImplementation
|
|
80
|
+
if (contents.includes('sassImplementation')) {
|
|
81
|
+
// Add a comment explaining the removal
|
|
82
|
+
const sassImplementationRegex = /sassImplementation\s*:\s*['"`](?:sass|sass-embedded)['"`]/g;
|
|
83
|
+
const matches = contents.match(sassImplementationRegex);
|
|
84
|
+
if (matches) {
|
|
85
|
+
// Replace sassImplementation with a comment
|
|
86
|
+
contents = contents.replace(sassImplementationRegex, '// sassImplementation option has been removed in Nx v22. sass-embedded is now always used');
|
|
87
|
+
hasChanges = true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (hasChanges) {
|
|
91
|
+
tree.write(configFile, contents);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
95
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nx-app-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;gBAEjD,OAAO,GAAE,wBAA6B;IAOlD,KAAK,CAAC,QAAQ,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"nx-app-rspack-plugin.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/nx-app-rspack-plugin/nx-app-rspack-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAEV,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAKzB;;;;;;;;GAQG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqC;gBAEjD,OAAO,GAAE,wBAA6B;IAOlD,KAAK,CAAC,QAAQ,EAAE,QAAQ;CA+BzB"}
|
|
@@ -33,10 +33,6 @@ class NxAppRspackPlugin {
|
|
|
33
33
|
Object.keys(compiler.options.entry['main']).length === 0) {
|
|
34
34
|
compiler.options.entry = {};
|
|
35
35
|
}
|
|
36
|
-
// Prefer `clean` option from Rspack config over our own.
|
|
37
|
-
if (typeof compiler.options.output.clean !== 'undefined') {
|
|
38
|
-
this.options.deleteOutputPath = false;
|
|
39
|
-
}
|
|
40
36
|
(0, apply_base_config_1.applyBaseConfig)(this.options, compiler.options, {
|
|
41
37
|
useNormalizedEntry: true,
|
|
42
38
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-base-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/apply-base-config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAStB,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAmB9D,wBAAgB,eAAe,CAC7B,OAAO,EAAE,kCAAkC,EAC3C,MAAM,GAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAM,EAC7D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,
|
|
1
|
+
{"version":3,"file":"apply-base-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/apply-base-config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,aAAa,EAKb,uBAAuB,EAExB,MAAM,cAAc,CAAC;AAStB,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAmB9D,wBAAgB,eAAe,CAC7B,OAAO,EAAE,kCAAkC,EAC3C,MAAM,GAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAM,EAC7D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,CAeN"}
|
|
@@ -28,7 +28,6 @@ const extensionAlias = {
|
|
|
28
28
|
const mainFields = ['module', 'main'];
|
|
29
29
|
function applyBaseConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
30
30
|
// Defaults that was applied from executor schema previously.
|
|
31
|
-
options.deleteOutputPath ??= true;
|
|
32
31
|
options.externalDependencies ??= 'all';
|
|
33
32
|
options.fileReplacements ??= [];
|
|
34
33
|
options.memoryLimit ??= 2048;
|
|
@@ -113,7 +112,7 @@ function applyNxIndependentConfig(options, config) {
|
|
|
113
112
|
hashFunction: config.output?.hashFunction ?? 'xxhash64',
|
|
114
113
|
// Disabled for performance
|
|
115
114
|
pathinfo: config.output?.pathinfo ?? false,
|
|
116
|
-
clean: config.output?.clean ??
|
|
115
|
+
clean: config.output?.clean ?? true,
|
|
117
116
|
};
|
|
118
117
|
config.watch = options.watch;
|
|
119
118
|
config.watchOptions = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/apply-web-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAQlB,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAG9D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,kCAAkC,EAC3C,MAAM,GAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAM,EAC7D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,
|
|
1
|
+
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/apply-web-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAQlB,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAG9D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,kCAAkC,EAC3C,MAAM,GAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAM,EAC7D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,CAiXN"}
|
|
@@ -106,9 +106,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
106
106
|
{
|
|
107
107
|
loader: require.resolve('sass-loader'),
|
|
108
108
|
options: {
|
|
109
|
-
implementation:
|
|
110
|
-
? require.resolve('sass')
|
|
111
|
-
: require.resolve('sass-embedded'),
|
|
109
|
+
implementation: require.resolve('sass-embedded'),
|
|
112
110
|
api: 'modern-compiler',
|
|
113
111
|
sassOptions: {
|
|
114
112
|
fiber: false,
|
|
@@ -152,9 +150,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
152
150
|
loader: require.resolve('sass-loader'),
|
|
153
151
|
options: {
|
|
154
152
|
api: 'modern-compiler',
|
|
155
|
-
implementation:
|
|
156
|
-
? require.resolve('sass')
|
|
157
|
-
: require.resolve('sass-embedded'),
|
|
153
|
+
implementation: require.resolve('sass-embedded'),
|
|
158
154
|
sourceMap: !!options.sourceMap,
|
|
159
155
|
sassOptions: {
|
|
160
156
|
fiber: false,
|
|
@@ -201,9 +197,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
201
197
|
loader: require.resolve('sass-loader'),
|
|
202
198
|
options: {
|
|
203
199
|
api: 'modern-compiler',
|
|
204
|
-
implementation:
|
|
205
|
-
? require.resolve('sass')
|
|
206
|
-
: require.resolve('sass-embedded'),
|
|
200
|
+
implementation: require.resolve('sass-embedded'),
|
|
207
201
|
sourceMap: !!options.sourceMap,
|
|
208
202
|
sassOptions: {
|
|
209
203
|
fiber: false,
|
|
@@ -65,11 +65,6 @@ export interface NxAppRspackPluginOptions {
|
|
|
65
65
|
*/
|
|
66
66
|
buildLibsFromSource?: boolean;
|
|
67
67
|
commonChunk?: boolean;
|
|
68
|
-
/**
|
|
69
|
-
* Delete the output path before building.
|
|
70
|
-
* @deprecated Use the `output.clean` option in Rspack. https://rspack.dev/config/output#outputclean
|
|
71
|
-
*/
|
|
72
|
-
deleteOutputPath?: boolean;
|
|
73
68
|
/**
|
|
74
69
|
* The deploy path for the application. e.g. `/my-app/`
|
|
75
70
|
*/
|
|
@@ -153,11 +148,6 @@ export interface NxAppRspackPluginOptions {
|
|
|
153
148
|
* Add an additional chunk for the rspack runtime. Defaults to `true` when `target === 'web'`.
|
|
154
149
|
*/
|
|
155
150
|
runtimeChunk?: boolean;
|
|
156
|
-
/**
|
|
157
|
-
* The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.
|
|
158
|
-
* @deprecated Sass option will be removed in Nx 22. This option will also be removed in Nx 22 as it is no longer needed.
|
|
159
|
-
*/
|
|
160
|
-
sassImplementation?: 'sass' | 'sass-embedded';
|
|
161
151
|
/**
|
|
162
152
|
* External scripts that will be included before the main application entry.
|
|
163
153
|
*/
|
|
@@ -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,gCAAgC,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,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,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,qBAAqB,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/C;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC1B;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/models.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/plugins/utils/plugins/normalize-options.ts"],"names":[],"mappings":"AASA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,kCAAkC,EAClC,wBAAwB,EACzB,MAAM,WAAW,CAAC;AAEnB,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,wBAAwB,GAChC,kCAAkC,
|
|
1
|
+
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/plugins/utils/plugins/normalize-options.ts"],"names":[],"mappings":"AASA,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,kCAAkC,EAClC,wBAAwB,EACzB,MAAM,WAAW,CAAC;AAEnB,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,wBAAwB,GAChC,kCAAkC,CAoJpC;AAED,wBAAgB,eAAe,CAC7B,MAAM,EAAE,GAAG,EAAE,EACb,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,iCAAiC,UAAO,GACvC,gBAAgB,EAAE,CA8CpB;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,MAAM,EACZ,gBAAgB,EAAE,eAAe,EAAE,GAClC,eAAe,EAAE,CAOnB"}
|
|
@@ -90,7 +90,6 @@ function normalizeOptions(options) {
|
|
|
90
90
|
buildLibsFromSource: combinedPluginAndMaybeExecutorOptions.buildLibsFromSource ?? true,
|
|
91
91
|
commonChunk: combinedPluginAndMaybeExecutorOptions.commonChunk ?? true,
|
|
92
92
|
configurationName,
|
|
93
|
-
deleteOutputPath: combinedPluginAndMaybeExecutorOptions.deleteOutputPath ?? true,
|
|
94
93
|
extractCss: combinedPluginAndMaybeExecutorOptions.extractCss ?? true,
|
|
95
94
|
fileReplacements: normalizeFileReplacements(devkit_1.workspaceRoot, combinedPluginAndMaybeExecutorOptions.fileReplacements),
|
|
96
95
|
generateIndexHtml: combinedPluginAndMaybeExecutorOptions.generateIndexHtml ?? true,
|
|
@@ -107,8 +106,6 @@ function normalizeOptions(options) {
|
|
|
107
106
|
projectRoot: projectNode.data.root,
|
|
108
107
|
root: devkit_1.workspaceRoot,
|
|
109
108
|
runtimeChunk: combinedPluginAndMaybeExecutorOptions.runtimeChunk ?? true,
|
|
110
|
-
sassImplementation: combinedPluginAndMaybeExecutorOptions.sassImplementation ??
|
|
111
|
-
'sass-embedded',
|
|
112
109
|
scripts: combinedPluginAndMaybeExecutorOptions.scripts ?? [],
|
|
113
110
|
skipTypeChecking: normalizedSkipTypeChecking,
|
|
114
111
|
sourceMap: combinedPluginAndMaybeExecutorOptions.sourceMap ?? !isProd,
|
package/src/utils/with-web.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export interface WithWebOptions {
|
|
|
8
8
|
generateIndexHtml?: boolean;
|
|
9
9
|
index?: string;
|
|
10
10
|
postcssConfig?: string;
|
|
11
|
-
sassImplementation?: 'sass' | 'sass-embedded';
|
|
12
11
|
scripts?: Array<ExtraEntryPointClass | string>;
|
|
13
12
|
styles?: Array<ExtraEntryPointClass | string>;
|
|
14
13
|
stylePreprocessorOptions?: {
|
|
@@ -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;AAC7C,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,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,
|
|
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;AAC7C,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,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,KAAK,CAAC,oBAAoB,GAAG,MAAM,CAAC,CAAC;IAC/C,MAAM,CAAC,EAAE,KAAK,CAAC,oBAAoB,GAAG,MAAM,CAAC,CAAC;IAC9C,wBAAwB,CAAC,EAAE;QACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KACnC,CAAC;IACF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,kBAAkB,CAAC,EACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtB,OAAO,GACP,CAAC,CACC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KACxB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;CAC9D;AAID,wBAAgB,OAAO,CAAC,aAAa,GAAE,cAAmB,IAEtD,QAAQ,aAAa,EACrB,sBAAsB,wBAAwB,KAC7C,aAAa,CAsBjB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EAEL,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAE,0BAA0B,EAAoB,MAAM,UAAU,CAAC;AAoDxE,yBACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,0BAA0B,mDA4GrC"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const package_json_1 = require("nx/package.json");
|
|
7
|
-
const configuration_1 = tslib_1.__importDefault(require("../configuration/configuration"));
|
|
8
|
-
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
9
|
-
const normalize_options_1 = require("./lib/normalize-options");
|
|
10
|
-
/**
|
|
11
|
-
* Updates the exclude field for any @nx/rspack/plugin registrations in nx.json
|
|
12
|
-
*/
|
|
13
|
-
function updateRspackPluginExclusion(tree, options) {
|
|
14
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
15
|
-
if (!nxJson.plugins?.length) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
let updated = false;
|
|
19
|
-
// Loop through all plugins to find @nx/rspack/plugin registrations
|
|
20
|
-
for (let i = 0; i < nxJson.plugins.length; i++) {
|
|
21
|
-
const plugin = nxJson.plugins[i];
|
|
22
|
-
const isRspackPlugin = typeof plugin === 'string'
|
|
23
|
-
? plugin === '@nx/rspack/plugin'
|
|
24
|
-
: plugin.plugin === '@nx/rspack/plugin';
|
|
25
|
-
if (!isRspackPlugin) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
if (typeof plugin === 'string') {
|
|
29
|
-
// Convert string notation to object notation with exclude field
|
|
30
|
-
nxJson.plugins[i] = {
|
|
31
|
-
plugin: '@nx/rspack/plugin',
|
|
32
|
-
exclude: [`${options.appProjectRoot}/**`],
|
|
33
|
-
};
|
|
34
|
-
updated = true;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
// Object notation
|
|
38
|
-
if (!plugin.exclude) {
|
|
39
|
-
// Add exclude field if it doesn't exist
|
|
40
|
-
plugin.exclude = [`${options.appProjectRoot}/**`];
|
|
41
|
-
updated = true;
|
|
42
|
-
}
|
|
43
|
-
else if (Array.isArray(plugin.exclude)) {
|
|
44
|
-
// Add to existing exclude field if it's an array
|
|
45
|
-
plugin.exclude.push(`${options.appProjectRoot}/**`);
|
|
46
|
-
updated = true;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if (updated) {
|
|
51
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
// TODO(v22) - remove this generator
|
|
55
|
-
async function default_1(tree, _options) {
|
|
56
|
-
// Add deprecation warning with alternatives based on framework
|
|
57
|
-
const framework = _options.framework || 'react'; // Default is react
|
|
58
|
-
devkit_1.logger.warn(`The @nx/rspack:application generator is deprecated and will be removed in Nx 22. ` +
|
|
59
|
-
`Please use @nx/${framework === 'nest' ? 'nest' : framework === 'web' ? 'web' : 'react'}:application instead.`);
|
|
60
|
-
const tasks = [];
|
|
61
|
-
const initTask = await (0, init_1.default)(tree, {
|
|
62
|
-
..._options,
|
|
63
|
-
});
|
|
64
|
-
tasks.push(initTask);
|
|
65
|
-
const options = await (0, normalize_options_1.normalizeOptions)(tree, _options);
|
|
66
|
-
if (framework === 'nest') {
|
|
67
|
-
updateRspackPluginExclusion(tree, options);
|
|
68
|
-
}
|
|
69
|
-
options.style ??= 'css';
|
|
70
|
-
if (options.framework === 'nest') {
|
|
71
|
-
const { applicationGenerator: nestAppGenerator } = (0, devkit_1.ensurePackage)('@nx/nest', package_json_1.version);
|
|
72
|
-
const createAppTask = await nestAppGenerator(tree, {
|
|
73
|
-
...options,
|
|
74
|
-
skipFormat: true,
|
|
75
|
-
tags: options.tags ?? '',
|
|
76
|
-
addPlugin: false,
|
|
77
|
-
});
|
|
78
|
-
const convertAppTask = await (0, configuration_1.default)(tree, {
|
|
79
|
-
project: options.name,
|
|
80
|
-
target: 'node',
|
|
81
|
-
newProject: false,
|
|
82
|
-
buildTarget: 'build',
|
|
83
|
-
framework: 'nest',
|
|
84
|
-
addPlugin: false,
|
|
85
|
-
});
|
|
86
|
-
tasks.push(createAppTask, convertAppTask);
|
|
87
|
-
}
|
|
88
|
-
else if (options.framework === 'web') {
|
|
89
|
-
const { applicationGenerator: webAppGenerator } = (0, devkit_1.ensurePackage)('@nx/web', package_json_1.version);
|
|
90
|
-
const createAppTask = await webAppGenerator(tree, {
|
|
91
|
-
bundler: 'webpack',
|
|
92
|
-
name: options.name,
|
|
93
|
-
style: options.style,
|
|
94
|
-
directory: options.directory,
|
|
95
|
-
tags: options.tags ?? '',
|
|
96
|
-
unitTestRunner: options.unitTestRunner,
|
|
97
|
-
e2eTestRunner: options.e2eTestRunner,
|
|
98
|
-
rootProject: options.rootProject,
|
|
99
|
-
skipFormat: true,
|
|
100
|
-
addPlugin: false,
|
|
101
|
-
});
|
|
102
|
-
const convertAppTask = await (0, configuration_1.default)(tree, {
|
|
103
|
-
project: options.name,
|
|
104
|
-
target: 'web',
|
|
105
|
-
newProject: false,
|
|
106
|
-
buildTarget: 'build',
|
|
107
|
-
serveTarget: 'serve',
|
|
108
|
-
framework: 'web',
|
|
109
|
-
addPlugin: false,
|
|
110
|
-
});
|
|
111
|
-
tasks.push(createAppTask, convertAppTask);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
// default to react
|
|
115
|
-
const { applicationGenerator: reactAppGenerator } = (0, devkit_1.ensurePackage)('@nx/react', package_json_1.version);
|
|
116
|
-
const createAppTask = await reactAppGenerator(tree, {
|
|
117
|
-
bundler: 'webpack',
|
|
118
|
-
name: options.name,
|
|
119
|
-
style: options.style,
|
|
120
|
-
directory: options.directory,
|
|
121
|
-
tags: options.tags ?? '',
|
|
122
|
-
unitTestRunner: options.unitTestRunner,
|
|
123
|
-
e2eTestRunner: options.e2eTestRunner,
|
|
124
|
-
rootProject: options.rootProject,
|
|
125
|
-
skipFormat: true,
|
|
126
|
-
addPlugin: false,
|
|
127
|
-
});
|
|
128
|
-
const convertAppTask = await (0, configuration_1.default)(tree, {
|
|
129
|
-
project: options.name,
|
|
130
|
-
target: 'web',
|
|
131
|
-
newProject: false,
|
|
132
|
-
buildTarget: 'build',
|
|
133
|
-
serveTarget: 'serve',
|
|
134
|
-
framework: 'react',
|
|
135
|
-
addPlugin: false,
|
|
136
|
-
});
|
|
137
|
-
tasks.push(createAppTask, convertAppTask);
|
|
138
|
-
}
|
|
139
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
140
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
141
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-ts-config.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/generators/application/lib/create-ts-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAA4B,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,wBAAgB,YAAY,CAC1B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,SAAS,EACpB,0BAA0B,EAAE,MAAM,QA0CnC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.editTsConfig = editTsConfig;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
function editTsConfig(tree, projectRoot, framework, relativePathToRootTsConfig) {
|
|
7
|
-
// Nx 15.8 moved util to @nx/js, but it is in @nx/workspace in 15.7
|
|
8
|
-
let shared;
|
|
9
|
-
try {
|
|
10
|
-
shared = require('@nx/js/src/utils/typescript/create-ts-config');
|
|
11
|
-
}
|
|
12
|
-
catch {
|
|
13
|
-
shared = require('@nx/workspace/src/utils/create-ts-config');
|
|
14
|
-
}
|
|
15
|
-
if (framework === 'react') {
|
|
16
|
-
const json = {
|
|
17
|
-
compilerOptions: {
|
|
18
|
-
jsx: 'react-jsx',
|
|
19
|
-
allowJs: false,
|
|
20
|
-
esModuleInterop: false,
|
|
21
|
-
allowSyntheticDefaultImports: true,
|
|
22
|
-
strict: true,
|
|
23
|
-
},
|
|
24
|
-
files: [],
|
|
25
|
-
include: [],
|
|
26
|
-
references: [
|
|
27
|
-
{
|
|
28
|
-
path: './tsconfig.app.json',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
};
|
|
32
|
-
// inline tsconfig.base.json into the project
|
|
33
|
-
if (projectIsRootProjectInStandaloneWorkspace(projectRoot)) {
|
|
34
|
-
json.compileOnSave = false;
|
|
35
|
-
json.compilerOptions = {
|
|
36
|
-
...shared.tsConfigBaseOptions,
|
|
37
|
-
...json.compilerOptions,
|
|
38
|
-
};
|
|
39
|
-
json.exclude = ['node_modules', 'tmp'];
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
json.extends = relativePathToRootTsConfig;
|
|
43
|
-
}
|
|
44
|
-
(0, devkit_1.writeJson)(tree, `${projectRoot}/tsconfig.json`, json);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
function projectIsRootProjectInStandaloneWorkspace(projectRoot) {
|
|
48
|
-
return (0, path_1.relative)(devkit_1.workspaceRoot, projectRoot).length === 0;
|
|
49
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { ApplicationGeneratorSchema, NormalizedSchema } from '../schema';
|
|
3
|
-
export declare function normalizeOptions(host: Tree, options: ApplicationGeneratorSchema): Promise<NormalizedSchema>;
|
|
4
|
-
//# sourceMappingURL=normalize-options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/rspack/src/generators/application/lib/normalize-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAOzE,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,gBAAgB,CAAC,CAkC3B"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeOptions = normalizeOptions;
|
|
4
|
-
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
5
|
-
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
|
-
async function normalizeOptions(host, options) {
|
|
7
|
-
await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
|
|
8
|
-
const { projectName, projectRoot: appProjectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
9
|
-
...options,
|
|
10
|
-
projectType: 'application',
|
|
11
|
-
});
|
|
12
|
-
// --monorepo takes precedence over --rootProject
|
|
13
|
-
// This won't be needed once we add --bundler=rspack to the @nx/react:app preset
|
|
14
|
-
const rootProject = !options.monorepo && options.rootProject;
|
|
15
|
-
const isTsSolutionSetup = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
16
|
-
const appProjectName = !isTsSolutionSetup || options.name ? projectName : importPath;
|
|
17
|
-
const e2eProjectName = options.rootProject ? 'e2e' : `${projectName}-e2e`;
|
|
18
|
-
const normalized = {
|
|
19
|
-
...options,
|
|
20
|
-
rootProject,
|
|
21
|
-
name: appProjectName,
|
|
22
|
-
projectName: appProjectName,
|
|
23
|
-
appProjectRoot,
|
|
24
|
-
e2eProjectName,
|
|
25
|
-
fileName: 'app',
|
|
26
|
-
};
|
|
27
|
-
normalized.unitTestRunner ??= 'jest';
|
|
28
|
-
normalized.e2eTestRunner ??= 'cypress';
|
|
29
|
-
return normalized;
|
|
30
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface ApplicationGeneratorSchema {
|
|
2
|
-
directory: string;
|
|
3
|
-
name?: string;
|
|
4
|
-
framework?: Framework;
|
|
5
|
-
style: 'css' | 'scss' | 'less';
|
|
6
|
-
unitTestRunner?: 'none' | 'jest';
|
|
7
|
-
e2eTestRunner?: 'none' | 'cypress';
|
|
8
|
-
tags?: string;
|
|
9
|
-
rootProject?: boolean;
|
|
10
|
-
monorepo?: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface NormalizedSchema extends ApplicationGeneratorSchema {
|
|
14
|
-
appProjectRoot: string;
|
|
15
|
-
e2eProjectName: string;
|
|
16
|
-
}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "Application",
|
|
4
|
-
"title": "Application generator for React + rspack",
|
|
5
|
-
"type": "object",
|
|
6
|
-
"description": "React + Rspack application generator.",
|
|
7
|
-
"x-deprecated": "This generator will be removed in Nx 22. Please use the equivalent generator for your application type instead.",
|
|
8
|
-
"examples": [
|
|
9
|
-
{
|
|
10
|
-
"command": "nx g app myorg/myapp",
|
|
11
|
-
"description": "Generate `apps/myorg/myapp` and `apps/myorg/myapp-e2e`"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"properties": {
|
|
15
|
-
"directory": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "The directory to nest the app under.",
|
|
18
|
-
"$default": {
|
|
19
|
-
"$source": "argv",
|
|
20
|
-
"index": 0
|
|
21
|
-
},
|
|
22
|
-
"x-prompt": "What directory would you like to use for the application?"
|
|
23
|
-
},
|
|
24
|
-
"name": {
|
|
25
|
-
"description": "The name of the application.",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$"
|
|
28
|
-
},
|
|
29
|
-
"framework": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "The framework to use for the application.",
|
|
32
|
-
"x-prompt": "What framework do you want to use when generating this application?",
|
|
33
|
-
"enum": ["none", "react", "web", "nest"],
|
|
34
|
-
"alias": ["uiFramework"],
|
|
35
|
-
"x-priority": "important",
|
|
36
|
-
"default": "react"
|
|
37
|
-
},
|
|
38
|
-
"style": {
|
|
39
|
-
"description": "The file extension to be used for style files.",
|
|
40
|
-
"type": "string",
|
|
41
|
-
"default": "css",
|
|
42
|
-
"alias": "s",
|
|
43
|
-
"x-prompt": {
|
|
44
|
-
"message": "Which stylesheet format would you like to use?",
|
|
45
|
-
"type": "list",
|
|
46
|
-
"items": [
|
|
47
|
-
{
|
|
48
|
-
"value": "css",
|
|
49
|
-
"label": "CSS"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"value": "scss",
|
|
53
|
-
"label": "SASS(.scss) [ http://sass-lang.com ]"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"value": "less",
|
|
57
|
-
"label": "LESS [ http://lesscss.org ]"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"value": "none",
|
|
61
|
-
"label": "None"
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"unitTestRunner": {
|
|
67
|
-
"type": "string",
|
|
68
|
-
"description": "The unit test runner to use.",
|
|
69
|
-
"enum": ["none", "jest"],
|
|
70
|
-
"default": "jest"
|
|
71
|
-
},
|
|
72
|
-
"e2eTestRunner": {
|
|
73
|
-
"type": "string",
|
|
74
|
-
"description": "The e2e test runner to use.",
|
|
75
|
-
"enum": ["none", "cypress"],
|
|
76
|
-
"default": "cypress"
|
|
77
|
-
},
|
|
78
|
-
"tags": {
|
|
79
|
-
"type": "string",
|
|
80
|
-
"description": "Add tags to the application (used for linting).",
|
|
81
|
-
"alias": "t"
|
|
82
|
-
},
|
|
83
|
-
"monorepo": {
|
|
84
|
-
"type": "boolean",
|
|
85
|
-
"description": "Creates an integrated monorepo.",
|
|
86
|
-
"aliases": ["integrated"]
|
|
87
|
-
},
|
|
88
|
-
"rootProject": {
|
|
89
|
-
"type": "boolean",
|
|
90
|
-
"x-priority": "internal"
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
"required": ["directory"]
|
|
94
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preset.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/generators/preset/preset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,YAAY,CAAC;AAG9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEjD,yBAA+B,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,qBAAqB,mDAyBxE"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const application_1 = tslib_1.__importDefault(require("../application/application"));
|
|
7
|
-
async function default_1(tree, options) {
|
|
8
|
-
const appTask = (0, application_1.default)(tree, {
|
|
9
|
-
...options,
|
|
10
|
-
directory: '.',
|
|
11
|
-
// Since `--style` is not passed down to custom preset, we're using individual flags for now.
|
|
12
|
-
style: options.sass ? 'scss' : options.less ? 'less' : 'css',
|
|
13
|
-
});
|
|
14
|
-
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
15
|
-
json.scripts ??= {};
|
|
16
|
-
json.scripts.build ??= 'npx nx build';
|
|
17
|
-
json.scripts.start ??= 'npx nx serve';
|
|
18
|
-
json.scripts.lint ??= 'npx nx lint';
|
|
19
|
-
json.scripts.test ??= 'npx nx test';
|
|
20
|
-
json.scripts.e2e ??= 'npx nx e2e e2e';
|
|
21
|
-
return json;
|
|
22
|
-
});
|
|
23
|
-
if (options.rootProject) {
|
|
24
|
-
// Remove these folders so projects will be generated at the root.
|
|
25
|
-
tree.delete('apps');
|
|
26
|
-
tree.delete('libs');
|
|
27
|
-
}
|
|
28
|
-
return appTask;
|
|
29
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export interface PresetGeneratorSchema {
|
|
2
|
-
name: string;
|
|
3
|
-
framework?: Framework;
|
|
4
|
-
less?: boolean;
|
|
5
|
-
sass?: boolean;
|
|
6
|
-
unitTestRunner?: 'none' | 'jest';
|
|
7
|
-
e2eTestRunner?: 'none' | 'cypress';
|
|
8
|
-
directory?: string;
|
|
9
|
-
tags?: string;
|
|
10
|
-
rootProject?: boolean;
|
|
11
|
-
monorepo?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface NormalizedSchema extends PresetGeneratorSchema {
|
|
15
|
-
appProjectRoot: string;
|
|
16
|
-
e2eProjectName: string;
|
|
17
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"$id": "Preset",
|
|
4
|
-
"title": "Standalone React and rspack preset",
|
|
5
|
-
"description": "React + Rspack preset generator.",
|
|
6
|
-
"type": "object",
|
|
7
|
-
"properties": {
|
|
8
|
-
"name": {
|
|
9
|
-
"type": "string",
|
|
10
|
-
"description": "",
|
|
11
|
-
"$default": {
|
|
12
|
-
"$source": "argv",
|
|
13
|
-
"index": 0
|
|
14
|
-
},
|
|
15
|
-
"x-priority": "important"
|
|
16
|
-
},
|
|
17
|
-
"framework": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"description": "The framework to use for the application.",
|
|
20
|
-
"enum": ["none", "react", "web", "nest"],
|
|
21
|
-
"alias": ["uiFramework"],
|
|
22
|
-
"x-priority": "important",
|
|
23
|
-
"default": "react"
|
|
24
|
-
},
|
|
25
|
-
"less": {
|
|
26
|
-
"type": "boolean",
|
|
27
|
-
"description": "Use less for styling."
|
|
28
|
-
},
|
|
29
|
-
"sass": {
|
|
30
|
-
"type": "boolean",
|
|
31
|
-
"description": "Use sass for styling."
|
|
32
|
-
},
|
|
33
|
-
"unitTestRunner": {
|
|
34
|
-
"type": "string",
|
|
35
|
-
"description": "The unit test runner to use.",
|
|
36
|
-
"enum": ["none", "jest"],
|
|
37
|
-
"default": "jest"
|
|
38
|
-
},
|
|
39
|
-
"e2eTestRunner": {
|
|
40
|
-
"type": "string",
|
|
41
|
-
"description": "The e2e test runner to use.",
|
|
42
|
-
"enum": ["none", "cypress"],
|
|
43
|
-
"default": "cypress"
|
|
44
|
-
},
|
|
45
|
-
"directory": {
|
|
46
|
-
"type": "string",
|
|
47
|
-
"description": "The directory to nest the app under."
|
|
48
|
-
},
|
|
49
|
-
"tags": {
|
|
50
|
-
"type": "string",
|
|
51
|
-
"description": "Add tags to the project (used for linting).",
|
|
52
|
-
"alias": "t"
|
|
53
|
-
},
|
|
54
|
-
"monorepo": {
|
|
55
|
-
"type": "boolean",
|
|
56
|
-
"description": "Creates an integrated monorepo.",
|
|
57
|
-
"default": false,
|
|
58
|
-
"aliases": ["integrated"]
|
|
59
|
-
},
|
|
60
|
-
"rootProject": {
|
|
61
|
-
"type": "boolean",
|
|
62
|
-
"x-priority": "internal",
|
|
63
|
-
"default": true
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"required": ["name"]
|
|
67
|
-
}
|