@nx/angular 23.2.0-beta.1 → 23.2.0-beta.11
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/README.md +2 -2
- package/dist/src/builders/dev-server/dev-server.impl.js +6 -8
- package/dist/src/builders/webpack-browser/webpack-browser.impl.js +5 -6
- package/dist/src/executors/application/application.impl.js +1 -1
- package/dist/src/executors/browser-esbuild/browser-esbuild.impl.js +1 -1
- package/dist/src/executors/extract-i18n/extract-i18n.impl.js +3 -3
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +1 -1
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +2 -3
- package/dist/src/executors/package/schema.d.ts +1 -2
- package/dist/src/executors/unit-test/unit-test.impl.js +1 -1
- package/dist/src/generators/add-linting/add-linting.js +44 -22
- package/dist/src/generators/add-linting/schema.d.ts +7 -0
- package/dist/src/generators/add-linting/schema.json +15 -4
- package/dist/src/generators/application/lib/add-e2e.js +3 -2
- package/dist/src/generators/application/lib/add-linting.js +3 -1
- package/dist/src/generators/application/lib/create-files.js +3 -3
- package/dist/src/generators/application/lib/normalize-options.js +5 -1
- package/dist/src/generators/application/lib/normalized-schema.d.ts +2 -2
- package/dist/src/generators/application/lib/set-generator-defaults.js +3 -1
- package/dist/src/generators/application/schema.d.ts +7 -2
- package/dist/src/generators/application/schema.json +15 -5
- package/dist/src/generators/component-test/component-test.js +2 -0
- package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +1 -5
- package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +2 -0
- package/dist/src/generators/host/host.js +7 -1
- package/dist/src/generators/host/schema.d.ts +6 -2
- package/dist/src/generators/host/schema.json +10 -5
- package/dist/src/generators/library/lib/create-files.js +3 -0
- package/dist/src/generators/library/lib/normalize-options.js +4 -2
- package/dist/src/generators/library/lib/normalized-schema.d.ts +6 -2
- package/dist/src/generators/library/lib/set-generator-defaults.js +5 -1
- package/dist/src/generators/library/library.js +5 -3
- package/dist/src/generators/library/schema.d.ts +6 -2
- package/dist/src/generators/library/schema.json +10 -5
- package/dist/src/generators/ng-add/migrators/projects/lib.migrator.js +1 -2
- package/dist/src/generators/ng-add/schema.d.ts +2 -2
- package/dist/src/generators/ng-add/schema.json +1 -3
- package/dist/src/generators/ng-add/utilities/format-files-task.js +2 -2
- package/dist/src/generators/ng-add/utilities/projects.js +2 -2
- package/dist/src/generators/ng-add/utilities/workspace.js +3 -4
- package/dist/src/generators/remote/remote.js +4 -3
- package/dist/src/generators/remote/schema.d.ts +6 -2
- package/dist/src/generators/remote/schema.json +10 -5
- package/dist/src/generators/scam-to-standalone/lib/get-component-data-from-ast.d.ts +1 -1
- package/dist/src/generators/scam-to-standalone/lib/get-target-project.d.ts +1 -1
- package/dist/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.d.ts +1 -1
- package/dist/src/generators/setup-mf/lib/generate-config.js +2 -1
- package/dist/src/generators/setup-mf/schema.d.ts +4 -0
- package/dist/src/generators/setup-mf/schema.json +8 -2
- package/dist/src/generators/storybook-configuration/schema.d.ts +2 -2
- package/dist/src/generators/storybook-configuration/schema.json +1 -2
- package/dist/src/generators/utils/add-vitest.js +1 -2
- package/dist/src/generators/utils/tsconfig-utils.js +2 -7
- package/dist/src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.js +2 -3
- package/dist/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.js +3 -4
- package/dist/src/plugins/plugin.js +2 -4
- package/dist/src/utils/assert-cypress-component-testing-support.d.ts +6 -0
- package/dist/src/utils/assert-cypress-component-testing-support.js +31 -0
- package/dist/src/utils/versions.d.ts +4 -4
- package/dist/src/utils/versions.js +4 -4
- package/generators.json +1 -1
- package/migrations.json +161 -0
- package/package.json +19 -12
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.host = host;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/eslint/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
const js_1 = require("@nx/js");
|
|
9
|
+
const internal_3 = require("@nx/js/internal");
|
|
8
10
|
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
9
11
|
const test_runners_1 = require("../../utils/test-runners");
|
|
10
12
|
const application_1 = tslib_1.__importDefault(require("../application/application"));
|
|
@@ -28,6 +30,10 @@ async function host(tree, schema) {
|
|
|
28
30
|
schema.zoneless ??= angularMajorVersion >= 21 ? true : false;
|
|
29
31
|
const { typescriptConfiguration = true, ...options } = schema;
|
|
30
32
|
options.standalone = options.standalone ?? true;
|
|
33
|
+
// Resolved before delegating so the host and every generated remote share one
|
|
34
|
+
// answer. `applicationGenerator` returns a new object rather than mutating
|
|
35
|
+
// this one, so resolving there would ask again for each remote.
|
|
36
|
+
options.linter = await (0, internal_3.normalizeLinterOption)(tree, options.linter);
|
|
31
37
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
32
38
|
const remotesToGenerate = [];
|
|
33
39
|
const remotesToIntegrate = [];
|
|
@@ -81,7 +87,7 @@ async function host(tree, schema) {
|
|
|
81
87
|
prefix: options.prefix,
|
|
82
88
|
typescriptConfiguration,
|
|
83
89
|
standalone: options.standalone,
|
|
84
|
-
|
|
90
|
+
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
85
91
|
});
|
|
86
92
|
let installTasks = [appInstallTask];
|
|
87
93
|
if (options.ssr) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
|
|
3
3
|
import type { Styles } from '../utils/types';
|
|
4
4
|
|
|
@@ -9,6 +9,10 @@ export interface Schema {
|
|
|
9
9
|
port?: number;
|
|
10
10
|
remotes?: string[];
|
|
11
11
|
dynamic?: boolean;
|
|
12
|
+
enableTypedLinting?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
15
|
+
*/
|
|
12
16
|
setParserOptionsProject?: boolean;
|
|
13
17
|
skipPackageJson?: boolean;
|
|
14
18
|
skipPostInstall?: boolean;
|
|
@@ -16,7 +20,7 @@ export interface Schema {
|
|
|
16
20
|
style?: Styles;
|
|
17
21
|
skipTests?: boolean;
|
|
18
22
|
tags?: string;
|
|
19
|
-
linter?:
|
|
23
|
+
linter?: LinterType;
|
|
20
24
|
unitTestRunner?: Exclude<UnitTestRunner, UnitTestRunner.VitestAngular>;
|
|
21
25
|
e2eTestRunner?: E2eTestRunner;
|
|
22
26
|
backendProject?: string;
|
|
@@ -139,10 +139,9 @@
|
|
|
139
139
|
"description": "Add tags to the application (used for linting)."
|
|
140
140
|
},
|
|
141
141
|
"linter": {
|
|
142
|
-
"description": "The tool to use for running lint checks.",
|
|
142
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
143
143
|
"type": "string",
|
|
144
|
-
"enum": ["eslint", "none"]
|
|
145
|
-
"default": "eslint"
|
|
144
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
146
145
|
},
|
|
147
146
|
"backendProject": {
|
|
148
147
|
"type": "string",
|
|
@@ -153,11 +152,17 @@
|
|
|
153
152
|
"description": "Create an application with stricter type checking and build optimization options.",
|
|
154
153
|
"default": true
|
|
155
154
|
},
|
|
156
|
-
"
|
|
155
|
+
"enableTypedLinting": {
|
|
157
156
|
"type": "boolean",
|
|
158
|
-
"description": "Whether
|
|
157
|
+
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
159
158
|
"default": false
|
|
160
159
|
},
|
|
160
|
+
"setParserOptionsProject": {
|
|
161
|
+
"type": "boolean",
|
|
162
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
163
|
+
"default": false,
|
|
164
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
165
|
+
},
|
|
161
166
|
"skipFormat": {
|
|
162
167
|
"description": "Skip formatting files.",
|
|
163
168
|
"type": "boolean",
|
|
@@ -41,6 +41,9 @@ function createFiles(tree, options, project) {
|
|
|
41
41
|
tpl: '',
|
|
42
42
|
};
|
|
43
43
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/base'), options.libraryOptions.projectRoot, substitutions);
|
|
44
|
+
if (options.libraryOptions.buildable && !options.libraryOptions.publishable) {
|
|
45
|
+
(0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.libraryOptions.projectRoot, 'package.json'), (json) => ({ ...json, private: true }));
|
|
46
|
+
}
|
|
44
47
|
if (options.libraryOptions.standalone) {
|
|
45
48
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/standalone-components'), options.libraryOptions.projectRoot, substitutions);
|
|
46
49
|
}
|
|
@@ -6,12 +6,14 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
const test_runners_1 = require("../../../utils/test-runners");
|
|
7
7
|
const artifact_types_1 = require("../../utils/artifact-types");
|
|
8
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
9
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
10
|
async function normalizeOptions(host, schema) {
|
|
10
11
|
schema.standalone = schema.standalone ?? true;
|
|
11
12
|
// Create a schema with populated default values
|
|
13
|
+
// No `linter` default here: it would mask the resolution below, which is what
|
|
14
|
+
// detects the workspace's linter and prompts when there is nothing to detect.
|
|
12
15
|
const options = {
|
|
13
16
|
buildable: false,
|
|
14
|
-
linter: 'eslint',
|
|
15
17
|
publishable: false,
|
|
16
18
|
skipFormat: false,
|
|
17
19
|
// Publishable libs cannot use `full` yet, so if its false then use the passed value or default to `full`
|
|
@@ -45,7 +47,7 @@ async function normalizeOptions(host, schema) {
|
|
|
45
47
|
const ngCliSchematicLibRoot = projectName;
|
|
46
48
|
const allNormalizedOptions = {
|
|
47
49
|
...options,
|
|
48
|
-
linter: options.linter
|
|
50
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
49
51
|
unitTestRunner,
|
|
50
52
|
prefix: options.prefix ?? 'lib',
|
|
51
53
|
name: projectName,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnitTestRunner } from '../../../utils/test-runners';
|
|
2
|
-
import type {
|
|
2
|
+
import type { LinterType } from '@nx/js';
|
|
3
3
|
export interface NormalizedSchema {
|
|
4
4
|
libraryOptions: {
|
|
5
5
|
directory: string;
|
|
@@ -18,13 +18,17 @@ export interface NormalizedSchema {
|
|
|
18
18
|
tags?: string;
|
|
19
19
|
strict?: boolean;
|
|
20
20
|
compilationMode?: 'full' | 'partial';
|
|
21
|
+
enableTypedLinting?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
24
|
+
*/
|
|
21
25
|
setParserOptionsProject?: boolean;
|
|
22
26
|
skipModule?: boolean;
|
|
23
27
|
skipPackageJson?: boolean;
|
|
24
28
|
skipPostInstall?: boolean;
|
|
25
29
|
skipTsConfig?: boolean;
|
|
26
30
|
standalone?: boolean;
|
|
27
|
-
linter:
|
|
31
|
+
linter: LinterType;
|
|
28
32
|
unitTestRunner: UnitTestRunner;
|
|
29
33
|
prefix: string;
|
|
30
34
|
fileName: string;
|
|
@@ -6,7 +6,11 @@ function setGeneratorDefaults(tree, options) {
|
|
|
6
6
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
7
7
|
nxJson.generators = nxJson.generators ?? {};
|
|
8
8
|
nxJson.generators['@nx/angular:library'] = {
|
|
9
|
-
|
|
9
|
+
// Pinning `none` would freeze the answer detection exists to give, so a
|
|
10
|
+
// workspace that adopts a linter later would keep getting none.
|
|
11
|
+
linter: options.libraryOptions.linter === 'none'
|
|
12
|
+
? undefined
|
|
13
|
+
: options.libraryOptions.linter,
|
|
10
14
|
unitTestRunner: options.libraryOptions.unitTestRunner,
|
|
11
15
|
strict: !options.libraryOptions.strict ? false : undefined,
|
|
12
16
|
...(nxJson.generators['@nx/angular:library'] || {}),
|
|
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.libraryGenerator = libraryGenerator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/eslint/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
const js_1 = require("@nx/js");
|
|
8
|
-
const
|
|
9
|
+
const internal_3 = require("@nx/js/internal");
|
|
9
10
|
const init_1 = tslib_1.__importDefault(require("../../generators/init/init"));
|
|
10
11
|
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
11
12
|
const test_runners_1 = require("../../utils/test-runners");
|
|
@@ -71,7 +72,7 @@ async function libraryGenerator(tree, schema) {
|
|
|
71
72
|
() => (0, devkit_1.installPackagesTask)(tree),
|
|
72
73
|
];
|
|
73
74
|
if (libraryOptions.publishable) {
|
|
74
|
-
tasks.push(await (0,
|
|
75
|
+
tasks.push(await (0, internal_3.releaseTasks)(tree));
|
|
75
76
|
}
|
|
76
77
|
tasks.push(() => (0, internal_1.logShowProjectCommand)(libraryOptions.name));
|
|
77
78
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
@@ -119,11 +120,12 @@ async function addLinting(host, options) {
|
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
122
|
await (0, add_linting_1.default)(host, {
|
|
123
|
+
linter: options.linter,
|
|
122
124
|
projectName: options.name,
|
|
123
125
|
projectRoot: options.projectRoot,
|
|
124
126
|
prefix: options.prefix,
|
|
125
127
|
unitTestRunner: options.unitTestRunner,
|
|
126
|
-
|
|
128
|
+
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
127
129
|
skipFormat: true,
|
|
128
130
|
skipPackageJson: options.skipPackageJson,
|
|
129
131
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
import type { UnitTestRunner } from '../../utils/test-runners';
|
|
3
3
|
|
|
4
4
|
export interface Schema {
|
|
@@ -19,9 +19,13 @@ export interface Schema {
|
|
|
19
19
|
parent?: string;
|
|
20
20
|
tags?: string;
|
|
21
21
|
strict?: boolean;
|
|
22
|
-
linter?:
|
|
22
|
+
linter?: LinterType;
|
|
23
23
|
unitTestRunner?: UnitTestRunner;
|
|
24
24
|
compilationMode?: 'full' | 'partial';
|
|
25
|
+
enableTypedLinting?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
28
|
+
*/
|
|
25
29
|
setParserOptionsProject?: boolean;
|
|
26
30
|
skipModule?: boolean;
|
|
27
31
|
skipPackageJson?: boolean;
|
|
@@ -97,21 +97,26 @@
|
|
|
97
97
|
"default": true
|
|
98
98
|
},
|
|
99
99
|
"linter": {
|
|
100
|
-
"description": "The tool to use for running lint checks.",
|
|
100
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
101
101
|
"type": "string",
|
|
102
|
-
"enum": ["eslint", "none"]
|
|
103
|
-
"default": "eslint"
|
|
102
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
104
103
|
},
|
|
105
104
|
"compilationMode": {
|
|
106
105
|
"description": "Specifies the compilation mode to use. If not specified, it will default to `partial` for publishable libraries and to `full` for buildable libraries. The `full` value can not be used for publishable libraries.",
|
|
107
106
|
"type": "string",
|
|
108
107
|
"enum": ["full", "partial"]
|
|
109
108
|
},
|
|
110
|
-
"
|
|
109
|
+
"enableTypedLinting": {
|
|
111
110
|
"type": "boolean",
|
|
112
|
-
"description": "Whether
|
|
111
|
+
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
113
112
|
"default": false
|
|
114
113
|
},
|
|
114
|
+
"setParserOptionsProject": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
117
|
+
"default": false,
|
|
118
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
119
|
+
},
|
|
115
120
|
"skipModule": {
|
|
116
121
|
"type": "boolean",
|
|
117
122
|
"description": "Whether to skip the creation of a default module when generating the library.",
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LibMigrator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const devkit_2 = require("@nx/devkit");
|
|
6
5
|
const utilities_1 = require("../../utilities");
|
|
7
6
|
const builders_1 = require("../builders");
|
|
8
7
|
const project_migrator_1 = require("./project.migrator");
|
|
@@ -46,7 +45,7 @@ class LibMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
46
45
|
!Object.keys(this.projectConfig.targets).length) {
|
|
47
46
|
this.logger.warn('The project does not have any targets configured. This might not be an issue. Skipping updating targets.');
|
|
48
47
|
}
|
|
49
|
-
(0,
|
|
48
|
+
(0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
|
|
50
49
|
...this.projectConfig,
|
|
51
50
|
});
|
|
52
51
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinterType } from '@nx/js';
|
|
2
2
|
import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
|
|
3
3
|
import type { Styles } from '../utils/types';
|
|
4
4
|
|
|
@@ -11,6 +11,6 @@ export interface GeneratorOptions {
|
|
|
11
11
|
skipInstall?: boolean;
|
|
12
12
|
skipPostInstall?: boolean;
|
|
13
13
|
style?: Styles;
|
|
14
|
-
linter?:
|
|
14
|
+
linter?: LinterType;
|
|
15
15
|
skipPackageJson?: boolean;
|
|
16
16
|
}
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"default": false,
|
|
18
18
|
"x-priority": "internal"
|
|
19
19
|
},
|
|
20
|
-
|
|
21
20
|
"unitTestRunner": {
|
|
22
21
|
"type": "string",
|
|
23
22
|
"enum": ["karma", "jest", "none"],
|
|
@@ -39,8 +38,7 @@
|
|
|
39
38
|
"linter": {
|
|
40
39
|
"description": "The tool to use for running lint checks. NOTE: only used if running the generator in an Nx workspace.",
|
|
41
40
|
"type": "string",
|
|
42
|
-
"enum": ["eslint", "none"]
|
|
43
|
-
"default": "eslint"
|
|
41
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
44
42
|
},
|
|
45
43
|
"style": {
|
|
46
44
|
"description": "The file extension to be used for style files. NOTE: only used if running the generator in an Nx workspace.",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatFilesTask = formatFilesTask;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
function formatFilesTask(tree) {
|
|
6
6
|
if (!tree
|
|
7
7
|
.listChanges()
|
|
@@ -9,7 +9,7 @@ function formatFilesTask(tree) {
|
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
try {
|
|
12
|
-
(0,
|
|
12
|
+
(0, internal_1.runNxSync)(`format`, { cwd: tree.root, stdio: [0, 1, 2] });
|
|
13
13
|
}
|
|
14
14
|
catch { }
|
|
15
15
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAllProjects = getAllProjects;
|
|
4
4
|
exports.convertToNxProject = convertToNxProject;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
function getAllProjects(tree) {
|
|
8
8
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
9
9
|
const result = {
|
|
@@ -26,7 +26,7 @@ function getAllProjects(tree) {
|
|
|
26
26
|
}
|
|
27
27
|
function convertToNxProject(tree, projectName) {
|
|
28
28
|
const angularJson = (0, devkit_1.readJson)(tree, 'angular.json');
|
|
29
|
-
const project = (0,
|
|
29
|
+
const project = (0, internal_1.toNewFormat)(angularJson).projects[projectName];
|
|
30
30
|
project.name = projectName;
|
|
31
31
|
(0, devkit_1.addProjectConfiguration)(tree, projectName, project);
|
|
32
32
|
delete angularJson.projects[projectName];
|
|
@@ -17,11 +17,10 @@ const devkit_1 = require("@nx/devkit");
|
|
|
17
17
|
const eslint_1 = require("@nx/eslint");
|
|
18
18
|
const internal_1 = require("@nx/eslint/internal");
|
|
19
19
|
const js_1 = require("@nx/js");
|
|
20
|
-
const default_base_1 = require("nx/src/utils/default-base");
|
|
21
20
|
const internal_2 = require("@nx/js/internal");
|
|
22
|
-
const angular_json_1 = require("nx/src/adapter/angular-json");
|
|
23
21
|
const versions_1 = require("../../../utils/versions");
|
|
24
22
|
const path_1 = require("path");
|
|
23
|
+
const internal_3 = require("@nx/devkit/internal");
|
|
25
24
|
function validateWorkspace(tree) {
|
|
26
25
|
const errors = [];
|
|
27
26
|
if (!tree.exists('package.json')) {
|
|
@@ -40,7 +39,7 @@ function validateWorkspace(tree) {
|
|
|
40
39
|
function createNxJson(tree, options, defaultProject) {
|
|
41
40
|
const targets = getWorkspaceCommonTargets(tree);
|
|
42
41
|
(0, devkit_1.writeJson)(tree, 'nx.json', {
|
|
43
|
-
defaultBase: options.defaultBase ?? (0,
|
|
42
|
+
defaultBase: options.defaultBase ?? (0, internal_3.deduceDefaultBase)(),
|
|
44
43
|
namedInputs: {
|
|
45
44
|
sharedGlobals: [],
|
|
46
45
|
default: ['{projectRoot}/**/*', 'sharedGlobals'],
|
|
@@ -278,7 +277,7 @@ function updateVsCodeRecommendedExtensions(tree) {
|
|
|
278
277
|
}
|
|
279
278
|
}
|
|
280
279
|
function deleteAngularJson(tree) {
|
|
281
|
-
const projects = (0,
|
|
280
|
+
const projects = (0, internal_3.toNewFormat)((0, devkit_1.readJson)(tree, 'angular.json')).projects;
|
|
282
281
|
if (!Object.keys(projects).length) {
|
|
283
282
|
tree.delete('angular.json');
|
|
284
283
|
}
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.remote = remote;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/eslint/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const
|
|
8
|
+
const internal_3 = require("@nx/js/internal");
|
|
8
9
|
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
9
10
|
const test_runners_1 = require("../../utils/test-runners");
|
|
10
11
|
const application_1 = require("../application/application");
|
|
@@ -68,12 +69,12 @@ async function remote(tree, schema) {
|
|
|
68
69
|
standalone: options.standalone,
|
|
69
70
|
prefix: options.prefix,
|
|
70
71
|
typescriptConfiguration,
|
|
71
|
-
|
|
72
|
+
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
72
73
|
});
|
|
73
74
|
const installTasks = [appInstallTask];
|
|
74
75
|
if (!options.skipPackageJson) {
|
|
75
76
|
const installSwcHelpersTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
76
|
-
'@swc/helpers':
|
|
77
|
+
'@swc/helpers': internal_3.swcHelpersVersion,
|
|
77
78
|
});
|
|
78
79
|
installTasks.push(installSwcHelpersTask);
|
|
79
80
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
import type { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
|
|
3
3
|
import type { Styles } from '../utils/types';
|
|
4
4
|
|
|
@@ -8,13 +8,17 @@ export interface Schema {
|
|
|
8
8
|
bundler?: 'webpack' | 'rspack';
|
|
9
9
|
host?: string;
|
|
10
10
|
port?: number;
|
|
11
|
+
enableTypedLinting?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
14
|
+
*/
|
|
11
15
|
setParserOptionsProject?: boolean;
|
|
12
16
|
skipPackageJson?: boolean;
|
|
13
17
|
prefix?: string;
|
|
14
18
|
style?: Styles;
|
|
15
19
|
skipTests?: boolean;
|
|
16
20
|
tags?: string;
|
|
17
|
-
linter?:
|
|
21
|
+
linter?: LinterType;
|
|
18
22
|
unitTestRunner?: Exclude<UnitTestRunner, UnitTestRunner.VitestAngular>;
|
|
19
23
|
e2eTestRunner?: E2eTestRunner;
|
|
20
24
|
backendProject?: string;
|
|
@@ -129,10 +129,9 @@
|
|
|
129
129
|
"description": "Add tags to the application (used for linting)."
|
|
130
130
|
},
|
|
131
131
|
"linter": {
|
|
132
|
-
"description": "The tool to use for running lint checks.",
|
|
132
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
133
133
|
"type": "string",
|
|
134
|
-
"enum": ["eslint", "none"]
|
|
135
|
-
"default": "eslint"
|
|
134
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
136
135
|
},
|
|
137
136
|
"backendProject": {
|
|
138
137
|
"type": "string",
|
|
@@ -143,11 +142,17 @@
|
|
|
143
142
|
"description": "Create an application with stricter type checking and build optimization options.",
|
|
144
143
|
"default": true
|
|
145
144
|
},
|
|
146
|
-
"
|
|
145
|
+
"enableTypedLinting": {
|
|
147
146
|
"type": "boolean",
|
|
148
|
-
"description": "Whether
|
|
147
|
+
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
149
148
|
"default": false
|
|
150
149
|
},
|
|
150
|
+
"setParserOptionsProject": {
|
|
151
|
+
"type": "boolean",
|
|
152
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
153
|
+
"default": false,
|
|
154
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
155
|
+
},
|
|
151
156
|
"skipFormat": {
|
|
152
157
|
"description": "Skip formatting files.",
|
|
153
158
|
"type": "boolean",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ProjectConfiguration } from 'nx/
|
|
1
|
+
import { ProjectConfiguration } from '@nx/devkit';
|
|
2
2
|
export declare function getTargetProject(projectName: string, projects: Map<string, ProjectConfiguration>): ProjectConfiguration;
|
package/dist/src/generators/scam-to-standalone/lib/replace-module-usages-with-component.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Tree } from 'nx/
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
2
|
export declare function replaceModuleUsagesWithComponent(tree: Tree, moduleName: string, componentName: string): void;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateWebpackConfig = generateWebpackConfig;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/eslint/internal");
|
|
5
6
|
function generateWebpackConfig(tree, options, appRoot, remotesWithPorts) {
|
|
6
7
|
if (tree.exists(`${appRoot}/module-federation.config.js`) ||
|
|
7
8
|
tree.exists(`${appRoot}/webpack.config.js`) ||
|
|
@@ -25,7 +26,7 @@ function generateWebpackConfig(tree, options, appRoot, remotesWithPorts) {
|
|
|
25
26
|
standalone: options.standalone,
|
|
26
27
|
entryModuleFileName: options.entryModuleFileName,
|
|
27
28
|
});
|
|
28
|
-
if (!
|
|
29
|
+
if (!(0, internal_1.isTypedLintingEnabled)(options)) {
|
|
29
30
|
tree.delete((0, devkit_1.joinPathFragments)(appRoot, 'tsconfig.lint.json'));
|
|
30
31
|
}
|
|
31
32
|
}
|
|
@@ -17,6 +17,10 @@ export interface Schema {
|
|
|
17
17
|
standalone?: boolean;
|
|
18
18
|
skipE2E?: boolean;
|
|
19
19
|
typescriptConfiguration?: boolean;
|
|
20
|
+
enableTypedLinting?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
23
|
+
*/
|
|
20
24
|
setParserOptionsProject?: boolean;
|
|
21
25
|
}
|
|
22
26
|
|
|
@@ -81,10 +81,16 @@
|
|
|
81
81
|
"description": "Whether the module federation configuration and webpack configuration files should use TS.",
|
|
82
82
|
"default": true
|
|
83
83
|
},
|
|
84
|
-
"
|
|
84
|
+
"enableTypedLinting": {
|
|
85
85
|
"type": "boolean",
|
|
86
|
-
"description": "Whether
|
|
86
|
+
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
87
87
|
"default": false
|
|
88
|
+
},
|
|
89
|
+
"setParserOptionsProject": {
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
92
|
+
"default": false,
|
|
93
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
88
94
|
}
|
|
89
95
|
},
|
|
90
96
|
"required": ["appName", "mfType"],
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
export interface StorybookConfigurationOptions {
|
|
4
4
|
configureStaticServe?: boolean;
|
|
5
5
|
generateStories: boolean;
|
|
6
|
-
linter:
|
|
6
|
+
linter: LinterType;
|
|
7
7
|
project: string;
|
|
8
8
|
tsConfiguration?: boolean;
|
|
9
9
|
skipFormat?: boolean;
|
|
@@ -4,7 +4,6 @@ exports.addVitestAngular = addVitestAngular;
|
|
|
4
4
|
exports.addVitestAnalog = addVitestAnalog;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
8
7
|
const semver_1 = require("semver");
|
|
9
8
|
const versions_1 = require("../../utils/versions");
|
|
10
9
|
const version_utils_1 = require("./version-utils");
|
|
@@ -90,7 +89,7 @@ function validateVitestVersion(tree) {
|
|
|
90
89
|
let installedVitestVersion = null;
|
|
91
90
|
// Try to get the actual installed version from node_modules
|
|
92
91
|
try {
|
|
93
|
-
const { packageJson } = (0,
|
|
92
|
+
const { packageJson } = (0, internal_1.readModulePackageJson)('vitest');
|
|
94
93
|
installedVitestVersion = packageJson.version;
|
|
95
94
|
}
|
|
96
95
|
catch { }
|
|
@@ -18,12 +18,7 @@ function getDefinedCompilerOption(tree, tsConfigPath, optionName) {
|
|
|
18
18
|
}
|
|
19
19
|
function readCompilerOptionsFromTsConfig(tree, tsConfigPath) {
|
|
20
20
|
const ts = (0, internal_1.ensureTypescript)();
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
readDirectory: () => [],
|
|
24
|
-
readFile: (path) => tree.read(path, 'utf-8'),
|
|
25
|
-
fileExists: (path) => tree.exists(path),
|
|
26
|
-
};
|
|
27
|
-
const parsed = ts.parseJsonConfigFileContent(ts.readConfigFile(tsConfigPath, tsSysFromTree.readFile).config, tsSysFromTree, (0, node_path_1.dirname)(tsConfigPath));
|
|
21
|
+
const host = (0, internal_1.createTreeParseConfigHost)(tree);
|
|
22
|
+
const parsed = ts.parseJsonConfigFileContent(ts.readConfigFile(tsConfigPath, host.readFile).config, host, (0, node_path_1.dirname)(tsConfigPath));
|
|
28
23
|
return parsed.options;
|
|
29
24
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = migrateMfImportsToNewPackage;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const devkit_2 = require("@nx/devkit");
|
|
6
5
|
const tsquery_1 = require("@phenomnomnominal/tsquery");
|
|
7
6
|
const MF_IMPORT_TO_UPDATE = 'ModuleFederationConfig';
|
|
8
7
|
const MF_CONFIG_IMPORT_SELECTOR = `ImportDeclaration:has(StringLiteral[value=@nx/webpack]):has(Identifier[name=ModuleFederationConfig])`;
|
|
@@ -23,7 +22,7 @@ async function migrateMfImportsToNewPackage(tree) {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
for (const root of rootsToCheck) {
|
|
26
|
-
(0,
|
|
25
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, root, (filePath) => {
|
|
27
26
|
if (!filePath.endsWith('.ts') && !filePath.endsWith('.js')) {
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
@@ -57,5 +56,5 @@ async function migrateMfImportsToNewPackage(tree) {
|
|
|
57
56
|
tree.write(filePath, contents);
|
|
58
57
|
});
|
|
59
58
|
}
|
|
60
|
-
await (0,
|
|
59
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
61
60
|
}
|