@nx/angular 23.2.0-beta.6 → 23.2.0-beta.7
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/dist/src/generators/add-linting/add-linting.js +29 -18
- package/dist/src/generators/add-linting/schema.d.ts +3 -0
- package/dist/src/generators/add-linting/schema.json +7 -2
- package/dist/src/generators/application/lib/add-linting.js +1 -0
- 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 +2 -2
- package/dist/src/generators/application/schema.json +2 -3
- package/dist/src/generators/host/host.js +5 -0
- package/dist/src/generators/host/schema.d.ts +2 -2
- package/dist/src/generators/host/schema.json +2 -3
- package/dist/src/generators/library/lib/normalize-options.js +4 -2
- package/dist/src/generators/library/lib/normalized-schema.d.ts +2 -2
- package/dist/src/generators/library/lib/set-generator-defaults.js +5 -1
- package/dist/src/generators/library/library.js +1 -0
- package/dist/src/generators/library/schema.d.ts +2 -2
- package/dist/src/generators/library/schema.json +2 -3
- 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/remote/schema.d.ts +2 -2
- package/dist/src/generators/remote/schema.json +2 -3
- package/dist/src/generators/storybook-configuration/schema.d.ts +2 -2
- package/dist/src/generators/storybook-configuration/schema.json +1 -2
- package/generators.json +1 -1
- package/package.json +13 -12
|
@@ -3,35 +3,46 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addLintingGenerator = addLintingGenerator;
|
|
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 assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
8
|
-
const
|
|
8
|
+
const internal_3 = require("@nx/eslint/internal");
|
|
9
9
|
const add_angular_eslint_dependencies_1 = require("./lib/add-angular-eslint-dependencies");
|
|
10
10
|
const buildable_project_1 = require("./lib/buildable-project");
|
|
11
11
|
async function addLintingGenerator(tree, options) {
|
|
12
12
|
(0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
|
|
13
13
|
const tasks = [];
|
|
14
14
|
const rootProject = options.projectRoot === '.' || options.projectRoot === '';
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
// Resolved once, up front: `undefined !== 'eslint'` is true, so an unresolved
|
|
16
|
+
// linter would take the early return below and skip the angular-eslint arm.
|
|
17
|
+
// Callers that already resolved it pass it in, so this only prompts when the
|
|
18
|
+
// generator is run directly.
|
|
19
|
+
const linter = await (0, internal_2.normalizeLinterOption)(tree, options.linter);
|
|
20
|
+
tasks.push(await (0, internal_2.addLintingToProject)(tree, {
|
|
21
|
+
linter,
|
|
17
22
|
project: options.projectName,
|
|
18
23
|
tsConfigPaths: [
|
|
19
24
|
(0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.app.json'),
|
|
20
25
|
],
|
|
21
26
|
unitTestRunner: options.unitTestRunner,
|
|
22
|
-
enableTypedLinting: (0,
|
|
23
|
-
skipFormat: true,
|
|
27
|
+
enableTypedLinting: (0, internal_3.isTypedLintingEnabled)(options),
|
|
24
28
|
rootProject: rootProject,
|
|
25
29
|
addPlugin: options.addPlugin ?? false,
|
|
26
30
|
addExplicitTargets: true,
|
|
27
31
|
skipPackageJson: options.skipPackageJson,
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(0,
|
|
34
|
-
|
|
32
|
+
}));
|
|
33
|
+
// The angular-eslint presets, selector rules and dependency install below have
|
|
34
|
+
// no equivalent in other linters. Only the formatting tail is shared.
|
|
35
|
+
if (linter !== 'eslint') {
|
|
36
|
+
if (!options.skipFormat) {
|
|
37
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
38
|
+
}
|
|
39
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
40
|
+
}
|
|
41
|
+
if ((0, internal_3.isEslintConfigSupported)(tree)) {
|
|
42
|
+
if ((0, internal_3.useFlatConfig)(tree)) {
|
|
43
|
+
(0, internal_3.addPredefinedConfigToFlatLintConfig)(tree, options.projectRoot, 'flat/angular', { checkBaseConfig: true });
|
|
44
|
+
(0, internal_3.addPredefinedConfigToFlatLintConfig)(tree, options.projectRoot, 'flat/angular-template', { checkBaseConfig: true });
|
|
45
|
+
(0, internal_3.addOverrideToLintConfig)(tree, options.projectRoot, {
|
|
35
46
|
files: ['*.ts'],
|
|
36
47
|
rules: {
|
|
37
48
|
'@angular-eslint/directive-selector': [
|
|
@@ -52,7 +63,7 @@ async function addLintingGenerator(tree, options) {
|
|
|
52
63
|
],
|
|
53
64
|
},
|
|
54
65
|
});
|
|
55
|
-
(0,
|
|
66
|
+
(0, internal_3.addOverrideToLintConfig)(tree, options.projectRoot, {
|
|
56
67
|
files: ['*.html'],
|
|
57
68
|
rules: {},
|
|
58
69
|
});
|
|
@@ -62,18 +73,18 @@ async function addLintingGenerator(tree, options) {
|
|
|
62
73
|
// an existing `parserOptions.project`. Detect it first so we can carry it
|
|
63
74
|
// over. (Flat configs keep typed linting via `lintProjectGenerator`, so
|
|
64
75
|
// this is only needed on the legacy stack.)
|
|
65
|
-
const eslintFile = (0,
|
|
76
|
+
const eslintFile = (0, internal_3.findEslintFile)(tree, options.projectRoot);
|
|
66
77
|
const eslintFileContent = eslintFile
|
|
67
78
|
? tree.read((0, devkit_1.joinPathFragments)(options.projectRoot, eslintFile), 'utf8')
|
|
68
79
|
: null;
|
|
69
80
|
const typedLinting = eslintFileContent
|
|
70
|
-
? (0,
|
|
81
|
+
? (0, internal_3.inspectTypedLinting)(eslintFileContent)
|
|
71
82
|
: null;
|
|
72
83
|
// Only a `project` needs carrying over. A config running the project
|
|
73
84
|
// service needs no glob and typescript-eslint rejects one next to it.
|
|
74
85
|
const carryOverProject = !!typedLinting?.project && !typedLinting.projectService;
|
|
75
|
-
(0,
|
|
76
|
-
...(rootProject ? [
|
|
86
|
+
(0, internal_3.replaceOverridesInLintConfig)(tree, options.projectRoot, [
|
|
87
|
+
...(rootProject ? [internal_3.typeScriptOverride, internal_3.javaScriptOverride] : []),
|
|
77
88
|
{
|
|
78
89
|
files: ['*.ts'],
|
|
79
90
|
// Legacy `.eslintrc` is JSON, which can't express the `__dirname`
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/schema",
|
|
3
3
|
"$id": "NxAngularAddLintingGenerator",
|
|
4
4
|
"title": "Add linting to an Angular project.",
|
|
5
|
-
"description": "Adds linting configuration to an Angular project.",
|
|
5
|
+
"description": "Adds linting configuration to an Angular project, using the linter the workspace already uses. Adds nothing when the workspace has no linter and none is selected.",
|
|
6
6
|
"cli": "nx",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"examples": [
|
|
9
9
|
{
|
|
10
10
|
"command": "nx g @nx/angular:add-linting --prefix=cool --projectName=cool-lib --projectRoot=libs/cool-lib",
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "Sets up linting for an existing project named `cool-lib` using the linter the workspace already uses. The Angular-specific rules and the [prefix](https://angular.dev/style-guide#style-02-07) `cool` apply to ESLint only"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"properties": {
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
"description": "The path to the root of the selected project.",
|
|
29
29
|
"x-priority": "important"
|
|
30
30
|
},
|
|
31
|
+
"linter": {
|
|
32
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
35
|
+
},
|
|
31
36
|
"enableTypedLinting": {
|
|
32
37
|
"type": "boolean",
|
|
33
38
|
"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.",
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
6
7
|
const test_runners_1 = require("../../../utils/test-runners");
|
|
7
8
|
const version_utils_1 = require("../../utils/version-utils");
|
|
8
9
|
function arePluginsExplicitlyDisabled(host) {
|
|
@@ -50,11 +51,14 @@ async function normalizeOptions(host, options, isRspack) {
|
|
|
50
51
|
skipTests: unitTestRunner === test_runners_1.UnitTestRunner.None,
|
|
51
52
|
skipFormat: false,
|
|
52
53
|
e2eTestRunner: test_runners_1.E2eTestRunner.Playwright,
|
|
53
|
-
linter: 'eslint',
|
|
54
54
|
strict: true,
|
|
55
55
|
standalone: true,
|
|
56
56
|
directory: appProjectRoot,
|
|
57
57
|
...options,
|
|
58
|
+
// Resolved after the spread, so the `=== 'none'` and `!== 'eslint'` guards
|
|
59
|
+
// downstream see a concrete linter. Both read `undefined` as "some linter,
|
|
60
|
+
// but not ESLint", which sets up linting and then skips its config.
|
|
61
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
58
62
|
prefix: options.prefix || 'app',
|
|
59
63
|
name: appProjectName,
|
|
60
64
|
appProjectRoot,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E2eTestRunner, UnitTestRunner } from '../../../utils/test-runners';
|
|
2
2
|
import type { Schema } from '../schema';
|
|
3
|
-
import {
|
|
3
|
+
import { LinterType } from '@nx/js';
|
|
4
4
|
export interface NormalizedSchema extends Schema {
|
|
5
|
-
linter:
|
|
5
|
+
linter: LinterType;
|
|
6
6
|
unitTestRunner: UnitTestRunner;
|
|
7
7
|
e2eTestRunner: E2eTestRunner;
|
|
8
8
|
prefix: string;
|
|
@@ -7,7 +7,9 @@ function setGeneratorDefaults(tree, options) {
|
|
|
7
7
|
nxJson.generators = nxJson.generators ?? {};
|
|
8
8
|
nxJson.generators['@nx/angular:application'] = {
|
|
9
9
|
e2eTestRunner: options.e2eTestRunner,
|
|
10
|
-
|
|
10
|
+
// Pinning `none` would freeze the answer detection exists to give, so a
|
|
11
|
+
// workspace that adopts a linter later would keep getting none.
|
|
12
|
+
linter: options.linter === 'none' ? undefined : options.linter,
|
|
11
13
|
style: options.style,
|
|
12
14
|
unitTestRunner: options.unitTestRunner,
|
|
13
15
|
strict: !options.strict ? false : undefined,
|
|
@@ -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
|
|
|
@@ -14,7 +14,7 @@ export interface Schema {
|
|
|
14
14
|
style?: Styles;
|
|
15
15
|
skipTests?: boolean;
|
|
16
16
|
tags?: string;
|
|
17
|
-
linter?:
|
|
17
|
+
linter?: LinterType;
|
|
18
18
|
unitTestRunner?: UnitTestRunner;
|
|
19
19
|
e2eTestRunner?: E2eTestRunner;
|
|
20
20
|
backendProject?: string;
|
|
@@ -115,10 +115,9 @@
|
|
|
115
115
|
"description": "Add tags to the application (used for linting)."
|
|
116
116
|
},
|
|
117
117
|
"linter": {
|
|
118
|
-
"description": "The tool to use for running lint checks.",
|
|
118
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
119
119
|
"type": "string",
|
|
120
|
-
"enum": ["eslint", "none"]
|
|
121
|
-
"default": "eslint"
|
|
120
|
+
"enum": ["eslint", "oxlint", "none"]
|
|
122
121
|
},
|
|
123
122
|
"backendProject": {
|
|
124
123
|
"type": "string",
|
|
@@ -6,6 +6,7 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
const internal_2 = require("@nx/eslint/internal");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const js_1 = require("@nx/js");
|
|
9
|
+
const internal_3 = require("@nx/js/internal");
|
|
9
10
|
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
10
11
|
const test_runners_1 = require("../../utils/test-runners");
|
|
11
12
|
const application_1 = tslib_1.__importDefault(require("../application/application"));
|
|
@@ -29,6 +30,10 @@ async function host(tree, schema) {
|
|
|
29
30
|
schema.zoneless ??= angularMajorVersion >= 21 ? true : false;
|
|
30
31
|
const { typescriptConfiguration = true, ...options } = schema;
|
|
31
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);
|
|
32
37
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
33
38
|
const remotesToGenerate = [];
|
|
34
39
|
const remotesToIntegrate = [];
|
|
@@ -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
|
|
|
@@ -20,7 +20,7 @@ export interface Schema {
|
|
|
20
20
|
style?: Styles;
|
|
21
21
|
skipTests?: boolean;
|
|
22
22
|
tags?: string;
|
|
23
|
-
linter?:
|
|
23
|
+
linter?: LinterType;
|
|
24
24
|
unitTestRunner?: Exclude<UnitTestRunner, UnitTestRunner.VitestAngular>;
|
|
25
25
|
e2eTestRunner?: E2eTestRunner;
|
|
26
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",
|
|
@@ -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;
|
|
@@ -28,7 +28,7 @@ export interface NormalizedSchema {
|
|
|
28
28
|
skipPostInstall?: boolean;
|
|
29
29
|
skipTsConfig?: boolean;
|
|
30
30
|
standalone?: boolean;
|
|
31
|
-
linter:
|
|
31
|
+
linter: LinterType;
|
|
32
32
|
unitTestRunner: UnitTestRunner;
|
|
33
33
|
prefix: string;
|
|
34
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'] || {}),
|
|
@@ -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,7 +19,7 @@ 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
25
|
enableTypedLinting?: boolean;
|
|
@@ -97,10 +97,9 @@
|
|
|
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.",
|
|
@@ -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,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
|
|
|
@@ -18,7 +18,7 @@ export interface Schema {
|
|
|
18
18
|
style?: Styles;
|
|
19
19
|
skipTests?: boolean;
|
|
20
20
|
tags?: string;
|
|
21
|
-
linter?:
|
|
21
|
+
linter?: LinterType;
|
|
22
22
|
unitTestRunner?: Exclude<UnitTestRunner, UnitTestRunner.VitestAngular>;
|
|
23
23
|
e2eTestRunner?: E2eTestRunner;
|
|
24
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",
|
|
@@ -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;
|
package/generators.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"add-linting": {
|
|
7
7
|
"factory": "./dist/src/generators/add-linting/add-linting",
|
|
8
8
|
"schema": "./dist/src/generators/add-linting/schema.json",
|
|
9
|
-
"description": "Adds linting configuration to an Angular project.",
|
|
9
|
+
"description": "Adds linting configuration to an Angular project, using the linter the workspace already uses. Adds nothing when the workspace has no linter and none is selected.",
|
|
10
10
|
"hidden": true
|
|
11
11
|
},
|
|
12
12
|
"application": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
@@ -80,14 +80,15 @@
|
|
|
80
80
|
"picomatch": "4.0.4",
|
|
81
81
|
"semver": "^7.6.3",
|
|
82
82
|
"tslib": "^2.3.0",
|
|
83
|
-
"@nx/
|
|
84
|
-
"@nx/web": "23.2.0-beta.
|
|
85
|
-
"@nx/
|
|
86
|
-
"@nx/
|
|
83
|
+
"@nx/js": "23.2.0-beta.7",
|
|
84
|
+
"@nx/web": "23.2.0-beta.7",
|
|
85
|
+
"@nx/eslint": "23.2.0-beta.7",
|
|
86
|
+
"@nx/devkit": "23.2.0-beta.7"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@nx/
|
|
90
|
-
"nx": "23.2.0-beta.
|
|
89
|
+
"@nx/storybook": "23.2.0-beta.7",
|
|
90
|
+
"@nx/vitest": "23.2.0-beta.7",
|
|
91
|
+
"nx": "23.2.0-beta.7"
|
|
91
92
|
},
|
|
92
93
|
"peerDependencies": {
|
|
93
94
|
"@angular/build": ">= 20.0.0 < 23.0.0",
|
|
@@ -98,11 +99,11 @@
|
|
|
98
99
|
"ng-packagr": ">= 20.0.0 < 23.0.0",
|
|
99
100
|
"rxjs": "^6.5.3 || ^7.5.0",
|
|
100
101
|
"webpack-merge": "^5.8.0",
|
|
101
|
-
"@nx/
|
|
102
|
-
"@nx/
|
|
103
|
-
"@nx/
|
|
104
|
-
"@nx/webpack": "23.2.0-beta.
|
|
105
|
-
"@nx/
|
|
102
|
+
"@nx/cypress": "23.2.0-beta.7",
|
|
103
|
+
"@nx/playwright": "23.2.0-beta.7",
|
|
104
|
+
"@nx/module-federation": "23.2.0-beta.7",
|
|
105
|
+
"@nx/webpack": "23.2.0-beta.7",
|
|
106
|
+
"@nx/rspack": "23.2.0-beta.7"
|
|
106
107
|
},
|
|
107
108
|
"peerDependenciesMeta": {
|
|
108
109
|
"@angular/build": {
|