@nx/vue 17.3.0-beta.3 → 17.3.0-beta.4
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/generators/application/application.js +12 -0
- package/src/generators/init/init.js +12 -30
- package/src/generators/init/schema.d.ts +1 -4
- package/src/generators/init/schema.json +2 -18
- package/src/generators/library/library.js +5 -0
- package/src/utils/ensure-dependencies.d.ts +6 -0
- package/src/utils/ensure-dependencies.js +25 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "17.3.0-beta.
|
|
3
|
+
"version": "17.3.0-beta.4",
|
|
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, 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": {
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"minimatch": "3.0.5",
|
|
32
32
|
"tslib": "^2.3.0",
|
|
33
|
-
"@nx/devkit": "17.3.0-beta.
|
|
34
|
-
"@nx/js": "17.3.0-beta.
|
|
35
|
-
"@nx/eslint": "17.3.0-beta.
|
|
36
|
-
"@nx/vite": "17.3.0-beta.
|
|
37
|
-
"@nx/web": "17.3.0-beta.
|
|
33
|
+
"@nx/devkit": "17.3.0-beta.4",
|
|
34
|
+
"@nx/js": "17.3.0-beta.4",
|
|
35
|
+
"@nx/eslint": "17.3.0-beta.4",
|
|
36
|
+
"@nx/vite": "17.3.0-beta.4",
|
|
37
|
+
"@nx/web": "17.3.0-beta.4"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.applicationGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const eslint_1 = require("@nx/eslint");
|
|
6
|
+
const js_1 = require("@nx/js");
|
|
6
7
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
7
8
|
const init_1 = require("../init/init");
|
|
8
9
|
const add_linting_1 = require("../../utils/add-linting");
|
|
@@ -10,6 +11,7 @@ const add_e2e_1 = require("./lib/add-e2e");
|
|
|
10
11
|
const create_application_files_1 = require("./lib/create-application-files");
|
|
11
12
|
const add_vite_1 = require("./lib/add-vite");
|
|
12
13
|
const create_ts_config_1 = require("../../utils/create-ts-config");
|
|
14
|
+
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
13
15
|
async function applicationGenerator(tree, _options) {
|
|
14
16
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, _options);
|
|
15
17
|
const tasks = [];
|
|
@@ -19,10 +21,20 @@ async function applicationGenerator(tree, _options) {
|
|
|
19
21
|
sourceRoot: `${options.appProjectRoot}/src`,
|
|
20
22
|
targets: {},
|
|
21
23
|
});
|
|
24
|
+
tasks.push(await (0, js_1.initGenerator)(tree, {
|
|
25
|
+
...options,
|
|
26
|
+
tsConfigName: options.rootProject
|
|
27
|
+
? 'tsconfig.json'
|
|
28
|
+
: 'tsconfig.base.json',
|
|
29
|
+
skipFormat: true,
|
|
30
|
+
}));
|
|
22
31
|
tasks.push(await (0, init_1.vueInitGenerator)(tree, {
|
|
23
32
|
...options,
|
|
24
33
|
skipFormat: true,
|
|
25
34
|
}));
|
|
35
|
+
if (!options.skipPackageJson) {
|
|
36
|
+
tasks.push((0, ensure_dependencies_1.ensureDependencies)(tree, options));
|
|
37
|
+
}
|
|
26
38
|
if (!options.rootProject) {
|
|
27
39
|
(0, create_ts_config_1.extractTsConfigBase)(tree);
|
|
28
40
|
}
|
|
@@ -2,40 +2,22 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.vueInitGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const js_1 = require("@nx/js");
|
|
6
5
|
const versions_1 = require("../../utils/versions");
|
|
7
6
|
function updateDependencies(host, schema) {
|
|
8
|
-
(0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/vue'], []);
|
|
9
|
-
let dependencies = {
|
|
10
|
-
vue: versions_1.vueVersion,
|
|
11
|
-
};
|
|
12
|
-
let devDependencies = {
|
|
13
|
-
'@nx/vue': versions_1.nxVersion,
|
|
14
|
-
'@vue/tsconfig': versions_1.vueTsconfigVersion,
|
|
15
|
-
'@vue/test-utils': versions_1.vueTestUtilsVersion,
|
|
16
|
-
'@vitejs/plugin-vue': versions_1.vitePluginVueVersion,
|
|
17
|
-
'vue-tsc': versions_1.vueTscVersion,
|
|
18
|
-
};
|
|
19
|
-
if (schema.routing) {
|
|
20
|
-
dependencies['vue-router'] = versions_1.vueRouterVersion;
|
|
21
|
-
}
|
|
22
|
-
if (schema.style === 'scss') {
|
|
23
|
-
devDependencies['sass'] = versions_1.sassVersion;
|
|
24
|
-
}
|
|
25
|
-
else if (schema.style === 'less') {
|
|
26
|
-
devDependencies['less'] = versions_1.lessVersion;
|
|
27
|
-
}
|
|
28
|
-
return (0, devkit_1.addDependenciesToPackageJson)(host, dependencies, devDependencies);
|
|
29
|
-
}
|
|
30
|
-
async function vueInitGenerator(host, schema) {
|
|
31
7
|
const tasks = [];
|
|
32
|
-
tasks.push(
|
|
33
|
-
|
|
34
|
-
tsConfigName: schema.rootProject ? 'tsconfig.json' : 'tsconfig.base.json',
|
|
35
|
-
skipFormat: true,
|
|
36
|
-
}));
|
|
37
|
-
tasks.push(updateDependencies(host, schema));
|
|
8
|
+
tasks.push((0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/vue'], []));
|
|
9
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, { vue: versions_1.vueVersion }, { '@nx/vue': versions_1.nxVersion }));
|
|
38
10
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
39
11
|
}
|
|
12
|
+
async function vueInitGenerator(host, schema) {
|
|
13
|
+
let installTask = () => { };
|
|
14
|
+
if (!schema.skipPackageJson) {
|
|
15
|
+
installTask = updateDependencies(host, schema);
|
|
16
|
+
}
|
|
17
|
+
if (!schema.skipFormat) {
|
|
18
|
+
await (0, devkit_1.formatFiles)(host);
|
|
19
|
+
}
|
|
20
|
+
return installTask;
|
|
21
|
+
}
|
|
40
22
|
exports.vueInitGenerator = vueInitGenerator;
|
|
41
23
|
exports.default = vueInitGenerator;
|
|
@@ -11,26 +11,10 @@
|
|
|
11
11
|
"type": "boolean",
|
|
12
12
|
"default": false
|
|
13
13
|
},
|
|
14
|
-
"
|
|
14
|
+
"skipPackageJson": {
|
|
15
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
15
16
|
"type": "boolean",
|
|
16
|
-
"description": "Use JavaScript instead of TypeScript",
|
|
17
17
|
"default": false
|
|
18
|
-
},
|
|
19
|
-
"rootProject": {
|
|
20
|
-
"description": "Create a project at the root of the workspace",
|
|
21
|
-
"type": "boolean",
|
|
22
|
-
"default": false
|
|
23
|
-
},
|
|
24
|
-
"routing": {
|
|
25
|
-
"type": "boolean",
|
|
26
|
-
"description": "Generate application with routes.",
|
|
27
|
-
"x-prompt": "Would you like to add Vue Router to this application?",
|
|
28
|
-
"default": false
|
|
29
|
-
},
|
|
30
|
-
"style": {
|
|
31
|
-
"description": "The file extension to be used for style files.",
|
|
32
|
-
"type": "string",
|
|
33
|
-
"default": "css"
|
|
34
18
|
}
|
|
35
19
|
},
|
|
36
20
|
"required": []
|
|
@@ -10,6 +10,7 @@ const create_library_files_1 = require("./lib/create-library-files");
|
|
|
10
10
|
const create_ts_config_1 = require("../../utils/create-ts-config");
|
|
11
11
|
const component_1 = require("../component/component");
|
|
12
12
|
const add_vite_1 = require("./lib/add-vite");
|
|
13
|
+
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
13
14
|
async function libraryGenerator(tree, schema) {
|
|
14
15
|
const tasks = [];
|
|
15
16
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
|
|
@@ -23,10 +24,14 @@ async function libraryGenerator(tree, schema) {
|
|
|
23
24
|
tags: options.parsedTags,
|
|
24
25
|
targets: {},
|
|
25
26
|
});
|
|
27
|
+
tasks.push(await (0, js_1.initGenerator)(tree, { ...schema, skipFormat: true }));
|
|
26
28
|
tasks.push(await (0, init_1.vueInitGenerator)(tree, {
|
|
27
29
|
...options,
|
|
28
30
|
skipFormat: true,
|
|
29
31
|
}));
|
|
32
|
+
if (!options.skipPackageJson) {
|
|
33
|
+
tasks.push((0, ensure_dependencies_1.ensureDependencies)(tree, options));
|
|
34
|
+
}
|
|
30
35
|
(0, create_ts_config_1.extractTsConfigBase)(tree);
|
|
31
36
|
tasks.push(await (0, add_linting_1.addLinting)(tree, options, 'lib'));
|
|
32
37
|
(0, create_library_files_1.createLibraryFiles)(tree, options);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
2
|
+
export type EnsureDependenciesOptions = {
|
|
3
|
+
routing?: boolean;
|
|
4
|
+
style?: 'scss' | 'less' | 'none' | 'css';
|
|
5
|
+
};
|
|
6
|
+
export declare function ensureDependencies(tree: Tree, options: EnsureDependenciesOptions): GeneratorCallback;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ensureDependencies = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const versions_1 = require("./versions");
|
|
6
|
+
function ensureDependencies(tree, options) {
|
|
7
|
+
const dependencies = {};
|
|
8
|
+
const devDependencies = {
|
|
9
|
+
'@vue/tsconfig': versions_1.vueTsconfigVersion,
|
|
10
|
+
'@vue/test-utils': versions_1.vueTestUtilsVersion,
|
|
11
|
+
'@vitejs/plugin-vue': versions_1.vitePluginVueVersion,
|
|
12
|
+
'vue-tsc': versions_1.vueTscVersion,
|
|
13
|
+
};
|
|
14
|
+
if (options.routing) {
|
|
15
|
+
dependencies['vue-router'] = versions_1.vueRouterVersion;
|
|
16
|
+
}
|
|
17
|
+
if (options.style === 'scss') {
|
|
18
|
+
devDependencies['sass'] = versions_1.sassVersion;
|
|
19
|
+
}
|
|
20
|
+
else if (options.style === 'less') {
|
|
21
|
+
devDependencies['less'] = versions_1.lessVersion;
|
|
22
|
+
}
|
|
23
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, dependencies, devDependencies);
|
|
24
|
+
}
|
|
25
|
+
exports.ensureDependencies = ensureDependencies;
|