@nx/vue 20.2.0 → 20.2.2
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/component/component.js +5 -11
- package/src/generators/component/files/__fileName__.vue__tmpl__ +6 -0
- package/src/generators/component/lib/utils.js +2 -1
- package/src/generators/component/schema.json +9 -1
- /package/src/generators/component/files/{__fileName__.spec.ts__tmpl__ → __fileName__.spec.__specExt__} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "20.2.
|
|
3
|
+
"version": "20.2.2",
|
|
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": "20.2.
|
|
35
|
-
"@nx/js": "20.2.
|
|
36
|
-
"@nx/eslint": "20.2.
|
|
37
|
-
"@nx/vite": "20.2.
|
|
38
|
-
"@nx/web": "20.2.
|
|
34
|
+
"@nx/devkit": "20.2.2",
|
|
35
|
+
"@nx/js": "20.2.2",
|
|
36
|
+
"@nx/eslint": "20.2.2",
|
|
37
|
+
"@nx/vite": "20.2.2",
|
|
38
|
+
"@nx/web": "20.2.2"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -13,21 +13,15 @@ async function componentGenerator(host, schema) {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
function createComponentFiles(host, options) {
|
|
16
|
+
const specExt = options.js ? 'js' : 'ts';
|
|
16
17
|
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, './files'), options.directory, {
|
|
17
18
|
...options,
|
|
19
|
+
isTs: !options.js,
|
|
20
|
+
specExt,
|
|
18
21
|
tmpl: '',
|
|
19
22
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if ((options.skipTests || options.inSourceTests) &&
|
|
23
|
-
/.*spec.ts/.test(c.path)) {
|
|
24
|
-
deleteFile = true;
|
|
25
|
-
}
|
|
26
|
-
if (deleteFile) {
|
|
27
|
-
host.delete(c.path);
|
|
28
|
-
}
|
|
23
|
+
if (options.skipTests || options.inSourceTests) {
|
|
24
|
+
host.delete((0, devkit_1.joinPathFragments)(options.directory, `${options.fileName}.spec.${specExt}`));
|
|
29
25
|
}
|
|
30
|
-
if (options.js)
|
|
31
|
-
(0, devkit_1.toJS)(host);
|
|
32
26
|
}
|
|
33
27
|
exports.default = componentGenerator;
|
|
@@ -9,8 +9,9 @@ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/a
|
|
|
9
9
|
const ast_utils_1 = require("../../../utils/ast-utils");
|
|
10
10
|
let tsModule;
|
|
11
11
|
async function normalizeOptions(host, options) {
|
|
12
|
-
const {
|
|
12
|
+
const { fileName, filePath, directory, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
13
13
|
path: options.path,
|
|
14
|
+
allowedFileExtensions: ['vue'],
|
|
14
15
|
fileExtension: 'vue',
|
|
15
16
|
});
|
|
16
17
|
let { className } = (0, devkit_1.names)(fileName);
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
"description": "Create a Vue Component for Nx.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"description": "Generate a component at `mylib/src/lib/foo.vue`",
|
|
11
|
+
"command": "nx g @nx/vue:component mylib/src/lib/foo.vue"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"description": "Generate a component without providing the file extension at `mylib/src/lib/foo.vue`",
|
|
15
|
+
"command": "nx g @nx/vue:component mylib/src/lib/foo"
|
|
16
|
+
},
|
|
9
17
|
{
|
|
10
18
|
"description": "Generate a component at `mylib/src/lib/foo.vue` with `vitest` as the unit test runner",
|
|
11
19
|
"command": "nx g @nx/vue:component mylib/src/lib/foo --unitTestRunner=vitest"
|
|
@@ -14,7 +22,7 @@
|
|
|
14
22
|
"properties": {
|
|
15
23
|
"path": {
|
|
16
24
|
"type": "string",
|
|
17
|
-
"description": "The file path to the component
|
|
25
|
+
"description": "The file path to the component. Relative to the current working directory.",
|
|
18
26
|
"$default": {
|
|
19
27
|
"$source": "argv",
|
|
20
28
|
"index": 0
|
|
File without changes
|