@nx/vue 23.2.0-beta.0 → 23.2.0-beta.10
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/application/application.js +8 -8
- package/dist/src/generators/application/lib/add-e2e.js +3 -1
- package/dist/src/generators/application/lib/create-application-files.js +3 -3
- package/dist/src/generators/application/lib/normalize-options.js +8 -5
- package/dist/src/generators/application/schema.d.ts +9 -3
- package/dist/src/generators/application/schema.json +15 -6
- package/dist/src/generators/library/lib/determine-entry-fields.d.ts +1 -1
- package/dist/src/generators/library/lib/normalize-options.js +25 -20
- package/dist/src/generators/library/schema.d.ts +7 -3
- package/dist/src/generators/library/schema.json +10 -6
- package/dist/src/generators/storybook-configuration/schema.d.ts +2 -2
- package/dist/src/generators/storybook-configuration/schema.json +1 -2
- package/dist/src/utils/add-linting.d.ts +7 -4
- package/dist/src/utils/add-linting.js +18 -20
- package/package.json +12 -12
|
@@ -4,6 +4,7 @@ exports.applicationGenerator = applicationGenerator;
|
|
|
4
4
|
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const internal_2 = require("@nx/eslint/internal");
|
|
7
8
|
const js_1 = require("@nx/js");
|
|
8
9
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
9
10
|
const init_1 = require("../init/init");
|
|
@@ -15,7 +16,7 @@ const add_rsbuild_1 = require("./lib/add-rsbuild");
|
|
|
15
16
|
const create_ts_config_1 = require("../../utils/create-ts-config");
|
|
16
17
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
17
18
|
const assert_supported_vue_version_1 = require("../../utils/assert-supported-vue-version");
|
|
18
|
-
const
|
|
19
|
+
const internal_3 = require("@nx/js/internal");
|
|
19
20
|
function applicationGenerator(tree, options) {
|
|
20
21
|
return applicationGeneratorInternal(tree, {
|
|
21
22
|
addPlugin: false,
|
|
@@ -26,7 +27,7 @@ function applicationGenerator(tree, options) {
|
|
|
26
27
|
async function applicationGeneratorInternal(tree, _options) {
|
|
27
28
|
(0, assert_supported_vue_version_1.assertSupportedVueVersion)(tree);
|
|
28
29
|
const tasks = [];
|
|
29
|
-
const addTsPlugin = (0,
|
|
30
|
+
const addTsPlugin = (0, internal_3.shouldConfigureTsSolutionSetup)(tree, _options.addPlugin, _options.useTsSolution);
|
|
30
31
|
tasks.push(await (0, js_1.initGenerator)(tree, {
|
|
31
32
|
..._options,
|
|
32
33
|
tsConfigName: _options.rootProject
|
|
@@ -34,14 +35,13 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
34
35
|
: 'tsconfig.base.json',
|
|
35
36
|
skipFormat: true,
|
|
36
37
|
addTsPlugin,
|
|
37
|
-
formatter: _options.formatter,
|
|
38
38
|
platform: 'web',
|
|
39
39
|
}));
|
|
40
40
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, _options);
|
|
41
41
|
// If we are using the new TS solution
|
|
42
42
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
43
43
|
if (options.isUsingTsSolutionConfig) {
|
|
44
|
-
await (0,
|
|
44
|
+
await (0, internal_3.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
45
45
|
}
|
|
46
46
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
47
47
|
options.addPlugin ??=
|
|
@@ -87,10 +87,10 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
87
87
|
tasks.push(await (0, add_linting_1.addLinting)(tree, {
|
|
88
88
|
name: options.projectName,
|
|
89
89
|
projectRoot: options.appProjectRoot,
|
|
90
|
-
linter: options.linter
|
|
90
|
+
linter: options.linter,
|
|
91
91
|
unitTestRunner: options.unitTestRunner,
|
|
92
92
|
skipPackageJson: options.skipPackageJson,
|
|
93
|
-
|
|
93
|
+
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
94
94
|
rootProject: options.rootProject,
|
|
95
95
|
addPlugin: options.addPlugin,
|
|
96
96
|
projectName: options.projectName,
|
|
@@ -106,7 +106,7 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
106
106
|
if (options.js)
|
|
107
107
|
(0, devkit_1.toJS)(tree);
|
|
108
108
|
if (options.isUsingTsSolutionConfig) {
|
|
109
|
-
(0,
|
|
109
|
+
(0, internal_3.updateTsconfigFiles)(tree, options.appProjectRoot, 'tsconfig.app.json', {
|
|
110
110
|
jsx: 'preserve',
|
|
111
111
|
jsxImportSource: 'vue',
|
|
112
112
|
module: 'esnext',
|
|
@@ -116,7 +116,7 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
116
116
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
117
117
|
: undefined);
|
|
118
118
|
}
|
|
119
|
-
(0,
|
|
119
|
+
(0, internal_3.sortPackageJsonFields)(tree, options.appProjectRoot);
|
|
120
120
|
if (!options.skipFormat)
|
|
121
121
|
await (0, devkit_1.formatFiles)(tree);
|
|
122
122
|
tasks.push(() => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addE2e = addE2e;
|
|
4
|
+
const internal_1 = require("@nx/eslint/internal");
|
|
4
5
|
const devkit_1 = require("@nx/devkit");
|
|
5
6
|
const web_1 = require("@nx/web");
|
|
6
7
|
const versions_1 = require("../../../utils/versions");
|
|
@@ -66,6 +67,7 @@ async function addE2e(tree, options) {
|
|
|
66
67
|
devServerTarget: e2eWebServerInfo.e2eDevServerTarget,
|
|
67
68
|
baseUrl: e2eWebServerInfo.e2eWebServerAddress,
|
|
68
69
|
jsx: true,
|
|
70
|
+
enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
|
|
69
71
|
webServerCommands: {
|
|
70
72
|
default: e2eWebServerInfo.e2eWebServerCommand,
|
|
71
73
|
production: e2eWebServerInfo.e2eCiWebServerCommand,
|
|
@@ -107,7 +109,7 @@ async function addE2e(tree, options) {
|
|
|
107
109
|
directory: 'src',
|
|
108
110
|
js: false,
|
|
109
111
|
linter: options.linter,
|
|
110
|
-
|
|
112
|
+
enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
|
|
111
113
|
webServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
|
|
112
114
|
webServerAddress: e2eWebServerInfo.e2eCiBaseUrl,
|
|
113
115
|
});
|
|
@@ -6,11 +6,11 @@ const path = tslib_1.__importStar(require("path"));
|
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const js_1 = require("@nx/js");
|
|
8
8
|
const create_ts_config_1 = require("../../../utils/create-ts-config");
|
|
9
|
-
const
|
|
9
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
10
10
|
async function createApplicationFiles(tree, options) {
|
|
11
|
-
const onBoardingStatus = await (0,
|
|
11
|
+
const onBoardingStatus = await (0, internal_1.createNxCloudOnboardingURLForWelcomeApp)(tree, options.nxCloudToken);
|
|
12
12
|
const connectCloudUrl = onBoardingStatus === 'unclaimed' &&
|
|
13
|
-
(await (0,
|
|
13
|
+
(await (0, internal_1.getNxCloudAppOnBoardingUrl)(options.nxCloudToken));
|
|
14
14
|
(0, devkit_1.generateFiles)(tree, path.join(__dirname, '../files/common'), options.appProjectRoot, {
|
|
15
15
|
...options,
|
|
16
16
|
offsetFromRoot: (0, devkit_1.offsetFromRoot)(options.appProjectRoot),
|
|
@@ -29,11 +29,14 @@ async function normalizeOptions(host, options) {
|
|
|
29
29
|
parsedTags,
|
|
30
30
|
isUsingTsSolutionConfig,
|
|
31
31
|
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
32
|
+
style: options.style ?? 'css',
|
|
33
|
+
routing: options.routing ?? false,
|
|
34
|
+
unitTestRunner: options.unitTestRunner ?? 'vitest',
|
|
35
|
+
e2eTestRunner: options.e2eTestRunner ?? 'playwright',
|
|
36
|
+
bundler: options.bundler ?? 'vite',
|
|
37
|
+
// Resolved here rather than at the `addLinting` call, so the `=== 'eslint'`
|
|
38
|
+
// check that builds the tsconfig excludes reads the same value.
|
|
39
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
32
40
|
};
|
|
33
|
-
normalized.style = options.style ?? 'css';
|
|
34
|
-
normalized.routing = normalized.routing ?? false;
|
|
35
|
-
normalized.unitTestRunner ??= 'vitest';
|
|
36
|
-
normalized.e2eTestRunner = normalized.e2eTestRunner ?? 'playwright';
|
|
37
|
-
normalized.bundler = normalized.bundler ?? 'vite';
|
|
38
41
|
return normalized;
|
|
39
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
export interface Schema {
|
|
4
4
|
directory: string;
|
|
@@ -10,11 +10,15 @@ export interface Schema {
|
|
|
10
10
|
unitTestRunner?: 'vitest' | 'none';
|
|
11
11
|
inSourceTests?: boolean;
|
|
12
12
|
e2eTestRunner: 'cypress' | 'playwright' | 'none';
|
|
13
|
-
linter
|
|
14
|
-
formatter?: 'none' | 'prettier';
|
|
13
|
+
linter?: LinterType;
|
|
14
|
+
formatter?: 'none' | 'prettier' | 'oxfmt';
|
|
15
15
|
routing?: boolean;
|
|
16
16
|
js?: boolean;
|
|
17
17
|
strict?: boolean;
|
|
18
|
+
enableTypedLinting?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
21
|
+
*/
|
|
18
22
|
setParserOptionsProject?: boolean;
|
|
19
23
|
skipPackageJson?: boolean;
|
|
20
24
|
rootProject?: boolean;
|
|
@@ -25,6 +29,8 @@ export interface Schema {
|
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
export interface NormalizedSchema extends Omit<Schema, 'useTsSolution'> {
|
|
32
|
+
// `normalizeOptions` always resolves this, so it is no longer optional.
|
|
33
|
+
linter: LinterType;
|
|
28
34
|
projectName: string;
|
|
29
35
|
appProjectRoot: string;
|
|
30
36
|
importPath: string;
|
|
@@ -78,13 +78,16 @@
|
|
|
78
78
|
"x-priority": "internal"
|
|
79
79
|
},
|
|
80
80
|
"linter": {
|
|
81
|
-
"description": "The tool to use for running lint checks.",
|
|
81
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
82
82
|
"type": "string",
|
|
83
|
-
"enum": ["eslint", "none"],
|
|
84
|
-
"default": "none",
|
|
85
|
-
"x-prompt": "Which linter would you like to use?",
|
|
83
|
+
"enum": ["eslint", "oxlint", "none"],
|
|
86
84
|
"x-priority": "important"
|
|
87
85
|
},
|
|
86
|
+
"formatter": {
|
|
87
|
+
"description": "The tool to use for code formatting.",
|
|
88
|
+
"type": "string",
|
|
89
|
+
"enum": ["none", "prettier", "oxfmt"]
|
|
90
|
+
},
|
|
88
91
|
"unitTestRunner": {
|
|
89
92
|
"type": "string",
|
|
90
93
|
"enum": ["vitest", "none"],
|
|
@@ -120,11 +123,17 @@
|
|
|
120
123
|
"description": "Whether to enable tsconfig strict mode or not.",
|
|
121
124
|
"default": true
|
|
122
125
|
},
|
|
123
|
-
"
|
|
126
|
+
"enableTypedLinting": {
|
|
124
127
|
"type": "boolean",
|
|
125
|
-
"description": "Whether
|
|
128
|
+
"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.",
|
|
126
129
|
"default": false
|
|
127
130
|
},
|
|
131
|
+
"setParserOptionsProject": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
134
|
+
"default": false,
|
|
135
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
136
|
+
},
|
|
128
137
|
"skipPackageJson": {
|
|
129
138
|
"description": "Do not add dependencies to `package.json`.",
|
|
130
139
|
"type": "boolean",
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { PackageJson } from 'nx/src/utils/package-json';
|
|
2
1
|
import type { NormalizedSchema } from '../schema';
|
|
2
|
+
import { type PackageJson } from '@nx/devkit/internal';
|
|
3
3
|
export declare function determineEntryFields(options: NormalizedSchema): Pick<PackageJson, 'module' | 'types' | 'exports'>;
|
|
@@ -27,11 +27,29 @@ async function normalizeOptions(host, options) {
|
|
|
27
27
|
const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
28
28
|
nxJson.useInferencePlugins !== false;
|
|
29
29
|
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
30
|
+
let appMain;
|
|
31
|
+
let appSourceRoot;
|
|
32
|
+
if (options.appProject) {
|
|
33
|
+
const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
|
|
34
|
+
const appProjectType = (0, internal_2.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
|
|
35
|
+
if (appProjectType !== 'application') {
|
|
36
|
+
throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
|
|
37
|
+
}
|
|
38
|
+
const projectSourceRoot = (0, internal_2.getProjectSourceRoot)(appProjectConfig, host);
|
|
39
|
+
try {
|
|
40
|
+
appMain = appProjectConfig.targets.build.options.main;
|
|
41
|
+
appSourceRoot = (0, devkit_1.normalizePath)(projectSourceRoot);
|
|
42
|
+
}
|
|
43
|
+
catch (e) {
|
|
44
|
+
throw new Error(`Could not locate project main for ${options.appProject}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
30
47
|
const normalized = {
|
|
31
48
|
addPlugin,
|
|
32
49
|
...options,
|
|
33
50
|
projectName: isUsingTsSolutionConfig && !options.name ? importPath : projectName,
|
|
34
|
-
bundler
|
|
51
|
+
// Libraries with a bundler or that are publishable must also be buildable.
|
|
52
|
+
bundler: bundler !== 'none' || options.publishable ? 'vite' : 'none',
|
|
35
53
|
fileName,
|
|
36
54
|
routePath: `/${projectNames.projectFileName}`,
|
|
37
55
|
name: projectName,
|
|
@@ -40,25 +58,12 @@ async function normalizeOptions(host, options) {
|
|
|
40
58
|
importPath,
|
|
41
59
|
isUsingTsSolutionConfig,
|
|
42
60
|
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
61
|
+
js: options.js ?? false,
|
|
62
|
+
appMain,
|
|
63
|
+
appSourceRoot,
|
|
64
|
+
// Framework-specific ESLint shaping is guarded on `=== 'eslint'`, so an
|
|
65
|
+
// unresolved `undefined` would create a bare config with none of it.
|
|
66
|
+
linter: await (0, internal_2.normalizeLinterOption)(host, options.linter),
|
|
43
67
|
};
|
|
44
|
-
// Libraries with a bundler or is publishable must also be buildable.
|
|
45
|
-
normalized.bundler =
|
|
46
|
-
normalized.bundler !== 'none' || options.publishable ? 'vite' : 'none';
|
|
47
|
-
normalized.inSourceTests === normalized.minimal || normalized.inSourceTests;
|
|
48
|
-
if (options.appProject) {
|
|
49
|
-
const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
|
|
50
|
-
const appProjectType = (0, internal_2.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
|
|
51
|
-
if (appProjectType !== 'application') {
|
|
52
|
-
throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
|
|
53
|
-
}
|
|
54
|
-
const appSourceRoot = (0, internal_2.getProjectSourceRoot)(appProjectConfig, host);
|
|
55
|
-
try {
|
|
56
|
-
normalized.appMain = appProjectConfig.targets.build.options.main;
|
|
57
|
-
normalized.appSourceRoot = (0, devkit_1.normalizePath)(appSourceRoot);
|
|
58
|
-
}
|
|
59
|
-
catch (e) {
|
|
60
|
-
throw new Error(`Could not locate project main for ${options.appProject}`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
68
|
return normalized;
|
|
64
69
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
export interface Schema {
|
|
4
4
|
appProject?: string;
|
|
@@ -8,10 +8,14 @@ export interface Schema {
|
|
|
8
8
|
importPath?: string;
|
|
9
9
|
inSourceTests?: boolean;
|
|
10
10
|
js?: boolean;
|
|
11
|
-
linter
|
|
11
|
+
linter?: LinterType;
|
|
12
12
|
name?: string;
|
|
13
13
|
publishable?: boolean;
|
|
14
14
|
routing?: boolean;
|
|
15
|
+
enableTypedLinting?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
18
|
+
*/
|
|
15
19
|
setParserOptionsProject?: boolean;
|
|
16
20
|
skipFormat?: boolean;
|
|
17
21
|
skipPackageJson?: boolean;
|
|
@@ -29,7 +33,7 @@ export interface NormalizedSchema extends Schema {
|
|
|
29
33
|
js: boolean;
|
|
30
34
|
name: string;
|
|
31
35
|
projectName: string;
|
|
32
|
-
linter:
|
|
36
|
+
linter: LinterType;
|
|
33
37
|
fileName: string;
|
|
34
38
|
projectRoot: string;
|
|
35
39
|
routePath: string;
|
|
@@ -33,11 +33,9 @@
|
|
|
33
33
|
"x-priority": "important"
|
|
34
34
|
},
|
|
35
35
|
"linter": {
|
|
36
|
-
"description": "The tool to use for running lint checks.",
|
|
36
|
+
"description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.",
|
|
37
37
|
"type": "string",
|
|
38
|
-
"enum": ["eslint", "none"],
|
|
39
|
-
"default": "none",
|
|
40
|
-
"x-prompt": "Which linter would you like to use?",
|
|
38
|
+
"enum": ["eslint", "oxlint", "none"],
|
|
41
39
|
"x-priority": "important"
|
|
42
40
|
},
|
|
43
41
|
"unitTestRunner": {
|
|
@@ -102,11 +100,17 @@
|
|
|
102
100
|
"description": "Whether to enable tsconfig strict mode or not.",
|
|
103
101
|
"default": true
|
|
104
102
|
},
|
|
105
|
-
"
|
|
103
|
+
"enableTypedLinting": {
|
|
106
104
|
"type": "boolean",
|
|
107
|
-
"description": "Whether
|
|
105
|
+
"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.",
|
|
108
106
|
"default": false
|
|
109
107
|
},
|
|
108
|
+
"setParserOptionsProject": {
|
|
109
|
+
"type": "boolean",
|
|
110
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
111
|
+
"default": false,
|
|
112
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
113
|
+
},
|
|
110
114
|
"bundler": {
|
|
111
115
|
"type": "string",
|
|
112
116
|
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinterType } from '@nx/js';
|
|
2
2
|
|
|
3
3
|
export interface StorybookConfigureSchema {
|
|
4
4
|
project: string;
|
|
@@ -6,7 +6,7 @@ export interface StorybookConfigureSchema {
|
|
|
6
6
|
generateStories?: boolean;
|
|
7
7
|
js?: boolean;
|
|
8
8
|
tsConfiguration?: boolean;
|
|
9
|
-
linter?:
|
|
9
|
+
linter?: LinterType;
|
|
10
10
|
ignorePaths?: string[];
|
|
11
11
|
configureStaticServe?: boolean;
|
|
12
12
|
addPlugin?: boolean;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { GeneratorCallback } from '@nx/devkit';
|
|
2
|
-
import {
|
|
3
|
-
import { Tree } from 'nx/src/generators/tree';
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
import { LinterType } from '@nx/js';
|
|
4
3
|
export declare function addLinting(host: Tree, options: {
|
|
5
|
-
linter:
|
|
4
|
+
linter: LinterType;
|
|
6
5
|
name: string;
|
|
7
6
|
projectRoot: string;
|
|
8
7
|
unitTestRunner?: 'vitest' | 'none';
|
|
8
|
+
enableTypedLinting?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
11
|
+
*/
|
|
9
12
|
setParserOptionsProject?: boolean;
|
|
10
13
|
skipPackageJson?: boolean;
|
|
11
14
|
rootProject?: boolean;
|
|
@@ -2,26 +2,27 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addLinting = addLinting;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const eslint_1 = require("@nx/eslint");
|
|
6
5
|
const internal_1 = require("@nx/eslint/internal");
|
|
7
|
-
const path_1 = require("nx/src/utils/path");
|
|
8
6
|
const versions_1 = require("./versions");
|
|
7
|
+
const internal_2 = require("@nx/js/internal");
|
|
9
8
|
async function addLinting(host, options, projectType) {
|
|
9
|
+
const tasks = [];
|
|
10
|
+
tasks.push(await (0, internal_2.addLintingToProject)(host, {
|
|
11
|
+
oxlintPlugins: ['vue'],
|
|
12
|
+
linter: options.linter,
|
|
13
|
+
project: options.projectName,
|
|
14
|
+
tsConfigPaths: [
|
|
15
|
+
(0, devkit_1.joinPathFragments)(options.projectRoot, `tsconfig.${projectType}.json`),
|
|
16
|
+
],
|
|
17
|
+
unitTestRunner: options.unitTestRunner,
|
|
18
|
+
enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
|
|
19
|
+
rootProject: options.rootProject,
|
|
20
|
+
addPlugin: options.addPlugin,
|
|
21
|
+
skipPackageJson: options.skipPackageJson,
|
|
22
|
+
}));
|
|
23
|
+
// Everything below configures ESLint — predefined configs, `extends`, ignore
|
|
24
|
+
// entries — which have no equivalent in other linters.
|
|
10
25
|
if (options.linter === 'eslint') {
|
|
11
|
-
const tasks = [];
|
|
12
|
-
const lintTask = await (0, eslint_1.lintProjectGenerator)(host, {
|
|
13
|
-
linter: options.linter,
|
|
14
|
-
project: options.projectName,
|
|
15
|
-
tsConfigPaths: [
|
|
16
|
-
(0, path_1.joinPathFragments)(options.projectRoot, `tsconfig.${projectType}.json`),
|
|
17
|
-
],
|
|
18
|
-
unitTestRunner: options.unitTestRunner,
|
|
19
|
-
skipFormat: true,
|
|
20
|
-
setParserOptionsProject: options.setParserOptionsProject,
|
|
21
|
-
rootProject: options.rootProject,
|
|
22
|
-
addPlugin: options.addPlugin,
|
|
23
|
-
});
|
|
24
|
-
tasks.push(lintTask);
|
|
25
26
|
if ((0, internal_1.useFlatConfig)(host)) {
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
@@ -48,11 +49,8 @@ async function addLinting(host, options, projectType) {
|
|
|
48
49
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, {}, devDependencies, undefined, true);
|
|
49
50
|
tasks.push(installTask);
|
|
50
51
|
}
|
|
51
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return () => { };
|
|
55
52
|
}
|
|
53
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
56
54
|
}
|
|
57
55
|
function editEslintConfigFiles(tree, projectRoot) {
|
|
58
56
|
const hasVueFiles = (o) => o.files &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "23.2.0-beta.
|
|
3
|
+
"version": "23.2.0-beta.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Vue plugin for Nx contains executors and generators for managing Vue applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -63,15 +63,15 @@
|
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"picomatch": "4.0.4",
|
|
65
65
|
"tslib": "^2.3.0",
|
|
66
|
-
"@nx/
|
|
67
|
-
"@nx/js": "23.2.0-beta.
|
|
68
|
-
"@nx/
|
|
69
|
-
"@nx/
|
|
70
|
-
"@nx/
|
|
71
|
-
"@nx/web": "23.2.0-beta.
|
|
66
|
+
"@nx/devkit": "23.2.0-beta.10",
|
|
67
|
+
"@nx/js": "23.2.0-beta.10",
|
|
68
|
+
"@nx/eslint": "23.2.0-beta.10",
|
|
69
|
+
"@nx/vitest": "23.2.0-beta.10",
|
|
70
|
+
"@nx/vite": "23.2.0-beta.10",
|
|
71
|
+
"@nx/web": "23.2.0-beta.10"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"nx": "23.2.0-beta.
|
|
74
|
+
"nx": "23.2.0-beta.10"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public"
|
|
@@ -81,10 +81,10 @@
|
|
|
81
81
|
"vue-router": "^4.0.0",
|
|
82
82
|
"vue-tsc": "^2.0.0",
|
|
83
83
|
"@vitejs/plugin-vue": "^5.0.0 || ^6.0.0",
|
|
84
|
-
"@nx/
|
|
85
|
-
"@nx/
|
|
86
|
-
"@nx/
|
|
87
|
-
"@nx/
|
|
84
|
+
"@nx/playwright": "23.2.0-beta.10",
|
|
85
|
+
"@nx/rsbuild": "23.2.0-beta.10",
|
|
86
|
+
"@nx/storybook": "23.2.0-beta.10",
|
|
87
|
+
"@nx/cypress": "23.2.0-beta.10"
|
|
88
88
|
},
|
|
89
89
|
"peerDependenciesMeta": {
|
|
90
90
|
"@nx/cypress": {
|