@nx/nuxt 20.0.0-beta.5 → 20.0.0-beta.7
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 +2 -0
- package/src/generators/application/lib/normalize-options.d.ts +0 -1
- package/src/generators/application/lib/normalize-options.js +2 -12
- package/src/generators/application/schema.d.ts +2 -4
- package/src/generators/application/schema.json +16 -16
- package/src/generators/init/init.js +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nuxt",
|
|
3
|
-
"version": "20.0.0-beta.
|
|
3
|
+
"version": "20.0.0-beta.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nuxt plugin for Nx contains executors and generators for managing Nuxt 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
|
"tslib": "^2.3.0",
|
|
33
33
|
"@nuxt/kit": "^3.10.0",
|
|
34
|
-
"@nx/devkit": "20.0.0-beta.
|
|
35
|
-
"@nx/js": "20.0.0-beta.
|
|
36
|
-
"@nx/eslint": "20.0.0-beta.
|
|
37
|
-
"@nx/vue": "20.0.0-beta.
|
|
38
|
-
"@nx/vite": "20.0.0-beta.
|
|
34
|
+
"@nx/devkit": "20.0.0-beta.7",
|
|
35
|
+
"@nx/js": "20.0.0-beta.7",
|
|
36
|
+
"@nx/eslint": "20.0.0-beta.7",
|
|
37
|
+
"@nx/vue": "20.0.0-beta.7",
|
|
38
|
+
"@nx/vite": "20.0.0-beta.7",
|
|
39
39
|
"@phenomnomnominal/tsquery": "~5.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {},
|
|
@@ -6,6 +6,7 @@ const init_1 = require("../init/init");
|
|
|
6
6
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
7
7
|
const create_ts_config_1 = require("../../utils/create-ts-config");
|
|
8
8
|
const js_1 = require("@nx/js");
|
|
9
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
9
10
|
const update_gitignore_1 = require("../../utils/update-gitignore");
|
|
10
11
|
const eslint_1 = require("@nx/eslint");
|
|
11
12
|
const add_e2e_1 = require("./lib/add-e2e");
|
|
@@ -17,6 +18,7 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
|
|
|
17
18
|
const node_child_process_1 = require("node:child_process");
|
|
18
19
|
const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
|
|
19
20
|
async function applicationGenerator(tree, schema) {
|
|
21
|
+
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(tree, 'nuxt', 'application');
|
|
20
22
|
const tasks = [];
|
|
21
23
|
const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
|
|
22
24
|
const projectOffsetFromRoot = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
|
|
@@ -1,27 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeDirectory = normalizeDirectory;
|
|
4
3
|
exports.normalizeOptions = normalizeOptions;
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
7
|
-
function normalizeDirectory(options) {
|
|
8
|
-
options.directory = options.directory?.replace(/\\{1,2}/g, '/');
|
|
9
|
-
const { projectDirectory } = (0, devkit_1.extractLayoutDirectory)(options.directory);
|
|
10
|
-
return projectDirectory
|
|
11
|
-
? `${(0, devkit_1.names)(projectDirectory).fileName}/${(0, devkit_1.names)(options.name).fileName}`
|
|
12
|
-
: (0, devkit_1.names)(options.name).fileName;
|
|
13
|
-
}
|
|
14
6
|
async function normalizeOptions(host, options) {
|
|
15
|
-
|
|
7
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'application');
|
|
8
|
+
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
16
9
|
name: options.name,
|
|
17
10
|
projectType: 'application',
|
|
18
11
|
directory: options.directory,
|
|
19
|
-
projectNameAndRootFormat: options.projectNameAndRootFormat,
|
|
20
12
|
rootProject: options.rootProject,
|
|
21
13
|
});
|
|
22
14
|
options.rootProject = appProjectRoot === '.';
|
|
23
|
-
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
24
|
-
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
25
15
|
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
26
16
|
const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
27
17
|
const parsedTags = options.tags
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import type { ProjectNameAndRootFormat } from '@nx/devkit/src/generators/project-name-and-root-utils';
|
|
2
1
|
import type { Linter, LinterType } from '@nx/eslint';
|
|
3
2
|
|
|
4
3
|
export interface Schema {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
projectNameAndRootFormat?: ProjectNameAndRootFormat;
|
|
4
|
+
directory: string;
|
|
5
|
+
name?: string;
|
|
8
6
|
linter?: Linter | LinterType;
|
|
9
7
|
skipFormat?: boolean;
|
|
10
8
|
unitTestRunner?: 'vitest' | 'none';
|
|
@@ -6,28 +6,22 @@
|
|
|
6
6
|
"description": "Create a Nuxt Application for Nx.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
|
-
"
|
|
10
|
-
"description": "The
|
|
9
|
+
"directory": {
|
|
10
|
+
"description": "The directory of the new application.",
|
|
11
11
|
"type": "string",
|
|
12
|
+
"alias": "dir",
|
|
12
13
|
"$default": {
|
|
13
14
|
"$source": "argv",
|
|
14
15
|
"index": 0
|
|
15
16
|
},
|
|
16
|
-
"x-prompt": "
|
|
17
|
-
"pattern": "^[a-zA-Z][^:]*$",
|
|
18
|
-
"x-priority": "important"
|
|
17
|
+
"x-prompt": "Which directory do you want to create the application in?"
|
|
19
18
|
},
|
|
20
|
-
"
|
|
21
|
-
"description": "The
|
|
19
|
+
"name": {
|
|
20
|
+
"description": "The name of the application.",
|
|
22
21
|
"type": "string",
|
|
23
|
-
"
|
|
22
|
+
"pattern": "^[a-zA-Z][^:]*$",
|
|
24
23
|
"x-priority": "important"
|
|
25
24
|
},
|
|
26
|
-
"projectNameAndRootFormat": {
|
|
27
|
-
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
28
|
-
"type": "string",
|
|
29
|
-
"enum": ["as-provided", "derived"]
|
|
30
|
-
},
|
|
31
25
|
"linter": {
|
|
32
26
|
"description": "The tool to use for running lint checks.",
|
|
33
27
|
"type": "string",
|
|
@@ -86,7 +80,10 @@
|
|
|
86
80
|
"message": "Which stylesheet format would you like to use?",
|
|
87
81
|
"type": "list",
|
|
88
82
|
"items": [
|
|
89
|
-
{
|
|
83
|
+
{
|
|
84
|
+
"value": "css",
|
|
85
|
+
"label": "CSS"
|
|
86
|
+
},
|
|
90
87
|
{
|
|
91
88
|
"value": "scss",
|
|
92
89
|
"label": "SASS(.scss) [ https://sass-lang.com ]"
|
|
@@ -95,7 +92,10 @@
|
|
|
95
92
|
"value": "less",
|
|
96
93
|
"label": "LESS [ https://lesscss.org ]"
|
|
97
94
|
},
|
|
98
|
-
{
|
|
95
|
+
{
|
|
96
|
+
"value": "none",
|
|
97
|
+
"label": "None"
|
|
98
|
+
}
|
|
99
99
|
]
|
|
100
100
|
}
|
|
101
101
|
},
|
|
@@ -105,6 +105,6 @@
|
|
|
105
105
|
"default": false
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
"required": [],
|
|
108
|
+
"required": ["directory"],
|
|
109
109
|
"examplesFile": "../../../docs/application-examples.md"
|
|
110
110
|
}
|
|
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.nuxtInitGenerator = nuxtInitGenerator;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
6
|
+
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
7
|
const plugin_1 = require("../../plugins/plugin");
|
|
7
8
|
const utils_1 = require("./lib/utils");
|
|
8
9
|
async function nuxtInitGenerator(host, schema) {
|
|
10
|
+
(0, ts_solution_setup_1.assertNotUsingTsSolutionSetup)(host, 'nuxt', 'init');
|
|
9
11
|
await (0, add_plugin_1.addPluginV1)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/nuxt/plugin', plugin_1.createNodes, {
|
|
10
12
|
buildTargetName: ['build', 'nuxt:build', 'nuxt-build'],
|
|
11
13
|
serveTargetName: ['serve', 'nuxt:serve', 'nuxt-serve'],
|