@nx/vue 19.8.0 → 20.0.0-beta.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/generators.json +1 -1
- package/package.json +6 -6
- package/src/generators/application/lib/normalize-options.d.ts +1 -1
- package/src/generators/application/lib/normalize-options.js +1 -2
- package/src/generators/component/component.d.ts +0 -1
- package/src/generators/component/component.js +0 -7
- package/src/generators/component/lib/utils.js +0 -7
- package/src/generators/component/schema.d.ts +3 -18
- package/src/generators/component/schema.json +0 -29
- package/src/generators/library/files/tsconfig.lib.json__tmpl__ +8 -16
- package/src/generators/library/lib/add-vite.js +1 -0
- package/src/generators/library/lib/normalize-options.js +0 -1
- package/src/generators/library/library.js +6 -4
- package/src/generators/library/schema.d.ts +0 -1
- package/src/generators/library/schema.json +0 -6
package/generators.json
CHANGED
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"description": "Create a Vue library."
|
|
24
24
|
},
|
|
25
25
|
"component": {
|
|
26
|
-
"factory": "./src/generators/component/component
|
|
26
|
+
"factory": "./src/generators/component/component",
|
|
27
27
|
"schema": "./src/generators/component/schema.json",
|
|
28
28
|
"aliases": ["c"],
|
|
29
29
|
"x-type": "component",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0-beta.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": "
|
|
35
|
-
"@nx/js": "
|
|
36
|
-
"@nx/eslint": "
|
|
37
|
-
"@nx/vite": "
|
|
38
|
-
"@nx/web": "
|
|
34
|
+
"@nx/devkit": "20.0.0-beta.0",
|
|
35
|
+
"@nx/js": "20.0.0-beta.0",
|
|
36
|
+
"@nx/eslint": "20.0.0-beta.0",
|
|
37
|
+
"@nx/vite": "20.0.0-beta.0",
|
|
38
|
+
"@nx/web": "20.0.0-beta.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import { NormalizedSchema, Schema } from '../schema';
|
|
3
|
-
export declare function normalizeOptions(host: Tree, options: Schema
|
|
3
|
+
export declare function normalizeOptions(host: Tree, options: Schema): Promise<NormalizedSchema>;
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
5
|
-
async function normalizeOptions(host, options
|
|
5
|
+
async function normalizeOptions(host, options) {
|
|
6
6
|
const { projectName: appProjectName, projectRoot: appProjectRoot, projectNameAndRootFormat, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
7
7
|
name: options.name,
|
|
8
8
|
projectType: 'application',
|
|
9
9
|
directory: options.directory,
|
|
10
10
|
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
11
11
|
rootProject: options.rootProject,
|
|
12
|
-
callingGenerator,
|
|
13
12
|
});
|
|
14
13
|
options.rootProject = appProjectRoot === '.';
|
|
15
14
|
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
2
|
import { ComponentGeneratorSchema } from './schema';
|
|
3
3
|
export declare function componentGenerator(host: Tree, schema: ComponentGeneratorSchema): Promise<void>;
|
|
4
|
-
export declare function componentGeneratorInternal(host: Tree, schema: ComponentGeneratorSchema): Promise<void>;
|
|
5
4
|
export default componentGenerator;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.componentGenerator = componentGenerator;
|
|
4
|
-
exports.componentGeneratorInternal = componentGeneratorInternal;
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const path_1 = require("path");
|
|
7
6
|
const utils_1 = require("./lib/utils");
|
|
8
7
|
async function componentGenerator(host, schema) {
|
|
9
|
-
return componentGeneratorInternal(host, {
|
|
10
|
-
nameAndDirectoryFormat: 'derived',
|
|
11
|
-
...schema,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
async function componentGeneratorInternal(host, schema) {
|
|
15
8
|
const options = await (0, utils_1.normalizeOptions)(host, schema);
|
|
16
9
|
createComponentFiles(host, options);
|
|
17
10
|
(0, utils_1.addExportsToBarrel)(host, options);
|
|
@@ -10,17 +10,10 @@ const ast_utils_1 = require("../../../utils/ast-utils");
|
|
|
10
10
|
let tsModule;
|
|
11
11
|
async function normalizeOptions(host, options) {
|
|
12
12
|
const { artifactName: name, directory, fileName, filePath, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
13
|
-
artifactType: 'component',
|
|
14
|
-
callingGenerator: '@nx/vue:component',
|
|
15
13
|
name: options.name,
|
|
16
14
|
directory: options.directory,
|
|
17
|
-
derivedDirectory: options.directory,
|
|
18
|
-
flat: options.flat,
|
|
19
15
|
nameAndDirectoryFormat: options.nameAndDirectoryFormat,
|
|
20
|
-
project: options.project,
|
|
21
16
|
fileExtension: 'vue',
|
|
22
|
-
pascalCaseFile: options.pascalCaseFiles,
|
|
23
|
-
pascalCaseDirectory: options.pascalCaseDirectory,
|
|
24
17
|
});
|
|
25
18
|
let { className } = (0, devkit_1.names)(fileName);
|
|
26
19
|
const componentFileName = fileName;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { NameAndDirectoryFormat } from '@nx/devkit/src/generators/artifact-name-and-directory-utils';
|
|
2
|
+
|
|
1
3
|
export interface ComponentGeneratorSchema {
|
|
2
4
|
name: string;
|
|
3
5
|
skipTests?: boolean;
|
|
@@ -8,24 +10,7 @@ export interface ComponentGeneratorSchema {
|
|
|
8
10
|
fileName?: string;
|
|
9
11
|
inSourceTests?: boolean;
|
|
10
12
|
skipFormat?: boolean;
|
|
11
|
-
nameAndDirectoryFormat?:
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
15
|
-
*/
|
|
16
|
-
flat?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Provide the desired `directory` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
19
|
-
*/
|
|
20
|
-
pascalCaseDirectory?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated Provide the desired `name` option instead and use the `as-provided` format. It will be removed in Nx v20.
|
|
23
|
-
*/
|
|
24
|
-
pascalCaseFiles?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
|
|
27
|
-
*/
|
|
28
|
-
project?: string;
|
|
13
|
+
nameAndDirectoryFormat?: NameAndDirectoryFormat;
|
|
29
14
|
}
|
|
30
15
|
|
|
31
16
|
export interface NormalizedSchema extends ComponentGeneratorSchema {
|
|
@@ -12,15 +12,6 @@
|
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
14
|
"properties": {
|
|
15
|
-
"project": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "The name of the project.",
|
|
18
|
-
"alias": "p",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "projectName"
|
|
21
|
-
},
|
|
22
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
|
|
23
|
-
},
|
|
24
15
|
"name": {
|
|
25
16
|
"type": "string",
|
|
26
17
|
"description": "The name of the component.",
|
|
@@ -53,12 +44,6 @@
|
|
|
53
44
|
"alias": "dir",
|
|
54
45
|
"x-priority": "important"
|
|
55
46
|
},
|
|
56
|
-
"flat": {
|
|
57
|
-
"type": "boolean",
|
|
58
|
-
"description": "Create component at the source root rather than its own directory.",
|
|
59
|
-
"default": false,
|
|
60
|
-
"x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
61
|
-
},
|
|
62
47
|
"export": {
|
|
63
48
|
"type": "boolean",
|
|
64
49
|
"description": "When true, the component is exported from the project `index.ts` (if it exists).",
|
|
@@ -66,20 +51,6 @@
|
|
|
66
51
|
"default": false,
|
|
67
52
|
"x-prompt": "Should this component be exported in the project?"
|
|
68
53
|
},
|
|
69
|
-
"pascalCaseFiles": {
|
|
70
|
-
"type": "boolean",
|
|
71
|
-
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
72
|
-
"alias": "P",
|
|
73
|
-
"default": false,
|
|
74
|
-
"x-deprecated": "Provide the desired `name` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
75
|
-
},
|
|
76
|
-
"pascalCaseDirectory": {
|
|
77
|
-
"type": "boolean",
|
|
78
|
-
"description": "Use pascal case directory name (e.g. `App/App.tsx`).",
|
|
79
|
-
"alias": "R",
|
|
80
|
-
"default": false,
|
|
81
|
-
"x-deprecated": "Provide the desired `directory` option instead and use the `as-provided` format. It will be removed in Nx v20."
|
|
82
|
-
},
|
|
83
54
|
"routing": {
|
|
84
55
|
"type": "boolean",
|
|
85
56
|
"description": "Generate a library with routes."
|
|
@@ -3,25 +3,17 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"outDir": "<%= offsetFromRoot %>dist/out-tsc",
|
|
5
5
|
"types": [],
|
|
6
|
-
}
|
|
6
|
+
},<% if (unitTestRunner === 'vitest') { %>
|
|
7
7
|
"exclude": [
|
|
8
|
-
"src/**/__tests__/*",
|
|
9
|
-
"src/**/*.spec.ts",
|
|
10
|
-
"src/**/*.test.ts",
|
|
11
|
-
"src/**/*.spec.tsx",
|
|
12
|
-
"src/**/*.test.tsx",
|
|
13
|
-
"src/**/*.spec.js",
|
|
14
|
-
"src/**/*.test.js",
|
|
15
|
-
"src/**/*.spec.jsx",
|
|
16
|
-
"src/**/*.test.jsx",
|
|
8
|
+
"src/**/__tests__/*",
|
|
17
9
|
"src/**/*.spec.vue",
|
|
18
10
|
"src/**/*.test.vue"
|
|
19
|
-
|
|
11
|
+
],<% } %>
|
|
20
12
|
"include": [
|
|
21
|
-
"src/**/*.js",
|
|
22
|
-
"src/**/*.jsx",
|
|
23
|
-
"src/**/*.ts",
|
|
24
|
-
"src/**/*.tsx",
|
|
13
|
+
"src/**/*.js",
|
|
14
|
+
"src/**/*.jsx",
|
|
15
|
+
"src/**/*.ts",
|
|
16
|
+
"src/**/*.tsx",
|
|
25
17
|
"src/**/*.vue"
|
|
26
|
-
|
|
18
|
+
]
|
|
27
19
|
}
|
|
@@ -10,7 +10,6 @@ async function normalizeOptions(host, options) {
|
|
|
10
10
|
directory: options.directory,
|
|
11
11
|
importPath: options.importPath,
|
|
12
12
|
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
13
|
-
callingGenerator: '@nx/vue:library',
|
|
14
13
|
});
|
|
15
14
|
const fileName = projectNames.projectFileName;
|
|
16
15
|
const parsedTags = options.tags
|
|
@@ -13,6 +13,8 @@ const component_1 = require("../component/component");
|
|
|
13
13
|
const add_vite_1 = require("./lib/add-vite");
|
|
14
14
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
15
15
|
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
16
|
+
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
17
|
+
const path_1 = require("path");
|
|
16
18
|
function libraryGenerator(tree, schema) {
|
|
17
19
|
return libraryGeneratorInternal(tree, { addPlugin: false, ...schema });
|
|
18
20
|
}
|
|
@@ -42,16 +44,16 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
42
44
|
(0, create_library_files_1.createLibraryFiles)(tree, options);
|
|
43
45
|
tasks.push(await (0, add_vite_1.addVite)(tree, options));
|
|
44
46
|
if (options.component) {
|
|
47
|
+
const relativeCwd = (0, artifact_name_and_directory_utils_1.getRelativeCwd)();
|
|
48
|
+
const name = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/lib', options.fileName);
|
|
45
49
|
await (0, component_1.default)(tree, {
|
|
46
|
-
name:
|
|
47
|
-
|
|
48
|
-
flat: true,
|
|
50
|
+
name: relativeCwd ? (0, path_1.relative)(relativeCwd, name) : name,
|
|
51
|
+
nameAndDirectoryFormat: 'as-provided',
|
|
49
52
|
skipTests: options.unitTestRunner === 'none' ||
|
|
50
53
|
(options.unitTestRunner === 'vitest' && options.inSourceTests == true),
|
|
51
54
|
export: true,
|
|
52
55
|
routing: options.routing,
|
|
53
56
|
js: options.js,
|
|
54
|
-
pascalCaseFiles: options.pascalCaseFiles,
|
|
55
57
|
inSourceTests: options.inSourceTests,
|
|
56
58
|
skipFormat: true,
|
|
57
59
|
});
|
|
@@ -72,12 +72,6 @@
|
|
|
72
72
|
"description": "Do not update `tsconfig.json` for development experience.",
|
|
73
73
|
"x-priority": "internal"
|
|
74
74
|
},
|
|
75
|
-
"pascalCaseFiles": {
|
|
76
|
-
"type": "boolean",
|
|
77
|
-
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
78
|
-
"alias": "P",
|
|
79
|
-
"default": false
|
|
80
|
-
},
|
|
81
75
|
"routing": {
|
|
82
76
|
"type": "boolean",
|
|
83
77
|
"description": "Generate library with routes."
|