@nx/vue 19.2.0-rc.0 → 19.2.0
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/package.json +6 -6
- package/src/utils/add-linting.d.ts +1 -1
- package/src/utils/add-linting.js +44 -78
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "19.2.0
|
|
3
|
+
"version": "19.2.0",
|
|
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": {
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"minimatch": "9.0.3",
|
|
33
33
|
"tslib": "^2.3.0",
|
|
34
|
-
"@nx/devkit": "19.2.0
|
|
35
|
-
"@nx/js": "19.2.0
|
|
36
|
-
"@nx/eslint": "19.2.0
|
|
37
|
-
"@nx/vite": "19.2.0
|
|
38
|
-
"@nx/web": "19.2.0
|
|
34
|
+
"@nx/devkit": "19.2.0",
|
|
35
|
+
"@nx/js": "19.2.0",
|
|
36
|
+
"@nx/eslint": "19.2.0",
|
|
37
|
+
"@nx/vite": "19.2.0",
|
|
38
|
+
"@nx/web": "19.2.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -10,4 +10,4 @@ export declare function addLinting(host: Tree, options: {
|
|
|
10
10
|
rootProject?: boolean;
|
|
11
11
|
addPlugin?: boolean;
|
|
12
12
|
}, projectType: 'lib' | 'app'): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
13
|
-
export declare function editEslintConfigFiles(tree: Tree, projectRoot: string
|
|
13
|
+
export declare function editEslintConfigFiles(tree: Tree, projectRoot: string): void;
|
package/src/utils/add-linting.js
CHANGED
|
@@ -20,15 +20,13 @@ async function addLinting(host, options, projectType) {
|
|
|
20
20
|
rootProject: options.rootProject,
|
|
21
21
|
addPlugin: options.addPlugin,
|
|
22
22
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
editEslintConfigFiles(host, options.projectRoot, options.rootProject);
|
|
23
|
+
(0, eslint_file_1.addExtendsToLintConfig)(host, options.projectRoot, [
|
|
24
|
+
'plugin:vue/vue3-essential',
|
|
25
|
+
'eslint:recommended',
|
|
26
|
+
'@vue/eslint-config-typescript',
|
|
27
|
+
'@vue/eslint-config-prettier/skip-formatting',
|
|
28
|
+
]);
|
|
29
|
+
editEslintConfigFiles(host, options.projectRoot);
|
|
32
30
|
let installTask = () => { };
|
|
33
31
|
if (!options.skipPackageJson) {
|
|
34
32
|
installTask = (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
@@ -40,78 +38,46 @@ async function addLinting(host, options, projectType) {
|
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
exports.addLinting = addLinting;
|
|
43
|
-
function editEslintConfigFiles(tree, projectRoot
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
override.files.push('*.vue');
|
|
75
|
-
}
|
|
76
|
-
updated = true;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (!updated) {
|
|
80
|
-
json.overrides = [
|
|
81
|
-
{
|
|
82
|
-
files: ['*.ts', '*.tsx', '*.js', '*.jsx', '*.vue'],
|
|
83
|
-
rules: { 'vue/multi-word-component-names': 'off' },
|
|
84
|
-
},
|
|
85
|
-
];
|
|
86
|
-
}
|
|
87
|
-
return json;
|
|
88
|
-
});
|
|
41
|
+
function editEslintConfigFiles(tree, projectRoot) {
|
|
42
|
+
const hasVueFiles = (o) => o.files &&
|
|
43
|
+
(Array.isArray(o.files)
|
|
44
|
+
? o.files.some((f) => f.endsWith('*.vue'))
|
|
45
|
+
: o.files.endsWith('*.vue'));
|
|
46
|
+
const addVueFiles = (o) => {
|
|
47
|
+
if (!o.files) {
|
|
48
|
+
o.files = ['*.vue'];
|
|
49
|
+
}
|
|
50
|
+
else if (Array.isArray(o.files)) {
|
|
51
|
+
o.files.push('*.vue');
|
|
52
|
+
}
|
|
53
|
+
else {
|
|
54
|
+
o.files = [o.files, '*.vue'];
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
if ((0, eslint_file_1.isEslintConfigSupported)(tree, projectRoot)) {
|
|
58
|
+
if ((0, eslint_file_1.lintConfigHasOverride)(tree, projectRoot, (o) => o.parserOptions && !hasVueFiles(o), true)) {
|
|
59
|
+
(0, eslint_file_1.updateOverrideInLintConfig)(tree, projectRoot, (o) => !!o.parserOptions, (o) => {
|
|
60
|
+
addVueFiles(o);
|
|
61
|
+
return o;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
(0, eslint_file_1.replaceOverridesInLintConfig)(tree, projectRoot, [
|
|
66
|
+
{
|
|
67
|
+
files: ['*.ts', '*.tsx', '*.js', '*.jsx', '*.vue'],
|
|
68
|
+
rules: { 'vue/multi-word-component-names': 'off' },
|
|
69
|
+
},
|
|
70
|
+
]);
|
|
71
|
+
}
|
|
89
72
|
}
|
|
90
73
|
// Edit root config too
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
for (let override of json.overrides) {
|
|
94
|
-
if (override.rules &&
|
|
95
|
-
'@nx/enforce-module-boundaries' in override.rules) {
|
|
96
|
-
if (!override.files.includes('*.vue')) {
|
|
97
|
-
override.files.push('*.vue');
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return json;
|
|
102
|
-
});
|
|
74
|
+
if (!(0, eslint_file_1.isEslintConfigSupported)(tree)) {
|
|
75
|
+
return;
|
|
103
76
|
}
|
|
104
|
-
|
|
105
|
-
(0,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
'@nx/enforce-module-boundaries' in override.rules) {
|
|
109
|
-
if (!override.files.includes('*.vue')) {
|
|
110
|
-
override.files.push('*.vue');
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
return json;
|
|
77
|
+
if ((0, eslint_file_1.lintConfigHasOverride)(tree, '', (o) => o.rules?.['@nx/enforce-module-boundaries'] && !hasVueFiles(o), true)) {
|
|
78
|
+
(0, eslint_file_1.updateOverrideInLintConfig)(tree, '', (o) => !!o.rules?.['@nx/enforce-module-boundaries'], (o) => {
|
|
79
|
+
addVueFiles(o);
|
|
80
|
+
return o;
|
|
115
81
|
});
|
|
116
82
|
}
|
|
117
83
|
}
|