@nx/nuxt 0.0.0-pr-30418-4e2b721 → 0.0.0-pr-3-ec41644
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/application.d.ts +0 -1
- package/src/generators/application/application.js +18 -28
- package/src/generators/application/lib/add-e2e.js +22 -24
- package/src/generators/application/lib/normalize-options.js +5 -8
- package/src/generators/application/schema.d.ts +1 -3
- package/src/generators/application/schema.json +0 -4
package/generators.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"hidden": true
|
|
12
12
|
},
|
|
13
13
|
"application": {
|
|
14
|
-
"factory": "./src/generators/application/application
|
|
14
|
+
"factory": "./src/generators/application/application",
|
|
15
15
|
"schema": "./src/generators/application/schema.json",
|
|
16
16
|
"aliases": ["app"],
|
|
17
17
|
"description": "Create a Nuxt application."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nuxt",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-3-ec41644",
|
|
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": "0.0.0-pr-
|
|
35
|
-
"@nx/js": "0.0.0-pr-
|
|
36
|
-
"@nx/eslint": "0.0.0-pr-
|
|
37
|
-
"@nx/vue": "0.0.0-pr-
|
|
38
|
-
"@nx/vite": "0.0.0-pr-
|
|
34
|
+
"@nx/devkit": "0.0.0-pr-3-ec41644",
|
|
35
|
+
"@nx/js": "0.0.0-pr-3-ec41644",
|
|
36
|
+
"@nx/eslint": "0.0.0-pr-3-ec41644",
|
|
37
|
+
"@nx/vue": "0.0.0-pr-3-ec41644",
|
|
38
|
+
"@nx/vite": "0.0.0-pr-3-ec41644",
|
|
39
39
|
"@phenomnomnominal/tsquery": "~5.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
export declare function applicationGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
|
-
export declare function applicationGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
4
|
export default applicationGenerator;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applicationGenerator = applicationGenerator;
|
|
4
|
-
exports.applicationGeneratorInternal = applicationGeneratorInternal;
|
|
5
4
|
const devkit_1 = require("@nx/devkit");
|
|
6
5
|
const init_1 = require("../init/init");
|
|
7
6
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
@@ -17,15 +16,10 @@ const ensure_dependencies_1 = require("./lib/ensure-dependencies");
|
|
|
17
16
|
const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
|
|
18
17
|
const node_child_process_1 = require("node:child_process");
|
|
19
18
|
const onboarding_1 = require("nx/src/nx-cloud/utilities/onboarding");
|
|
19
|
+
const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
|
|
20
20
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
21
21
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
22
22
|
async function applicationGenerator(tree, schema) {
|
|
23
|
-
return await applicationGeneratorInternal(tree, {
|
|
24
|
-
useProjectJson: true,
|
|
25
|
-
...schema,
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
async function applicationGeneratorInternal(tree, schema) {
|
|
29
23
|
const tasks = [];
|
|
30
24
|
const jsInitTask = await (0, js_1.initGenerator)(tree, {
|
|
31
25
|
...schema,
|
|
@@ -41,19 +35,18 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
41
35
|
const connectCloudUrl = onBoardingStatus === 'unclaimed' &&
|
|
42
36
|
(await (0, onboarding_1.getNxCloudAppOnBoardingUrl)(options.nxCloudToken));
|
|
43
37
|
tasks.push((0, ensure_dependencies_1.ensureDependencies)(tree, options));
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
38
|
+
if (options.isUsingTsSolutionConfig) {
|
|
39
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), {
|
|
40
|
+
name: (0, get_import_path_1.getImportPath)(tree, options.name),
|
|
41
|
+
version: '0.0.1',
|
|
42
|
+
private: true,
|
|
43
|
+
nx: {
|
|
44
|
+
name: options.name,
|
|
45
|
+
projectType: 'application',
|
|
46
|
+
sourceRoot: `${options.appProjectRoot}/src`,
|
|
47
|
+
tags: options.parsedTags?.length ? options.parsedTags : undefined,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
57
50
|
}
|
|
58
51
|
else {
|
|
59
52
|
(0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
|
|
@@ -64,9 +57,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
64
57
|
targets: {},
|
|
65
58
|
});
|
|
66
59
|
}
|
|
67
|
-
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
68
|
-
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
|
|
69
|
-
}
|
|
70
60
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files/base'), options.appProjectRoot, {
|
|
71
61
|
...options,
|
|
72
62
|
offsetFromRoot: projectOffsetFromRoot,
|
|
@@ -98,11 +88,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
98
88
|
isUsingTsSolutionConfig: options.isUsingTsSolutionConfig,
|
|
99
89
|
}, (0, js_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot));
|
|
100
90
|
(0, update_gitignore_1.updateGitIgnore)(tree);
|
|
101
|
-
// If we are using the new TS solution
|
|
102
|
-
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
103
|
-
if (options.isUsingTsSolutionConfig) {
|
|
104
|
-
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
105
|
-
}
|
|
106
91
|
tasks.push(await (0, add_linting_1.addLinting)(tree, {
|
|
107
92
|
projectName: options.projectName,
|
|
108
93
|
projectRoot: options.appProjectRoot,
|
|
@@ -136,6 +121,11 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
136
121
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
137
122
|
: undefined);
|
|
138
123
|
}
|
|
124
|
+
// If we are using the new TS solution
|
|
125
|
+
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
126
|
+
if (options.isUsingTsSolutionConfig) {
|
|
127
|
+
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
128
|
+
}
|
|
139
129
|
(0, sort_fields_1.sortPackageJsonFields)(tree, options.appProjectRoot);
|
|
140
130
|
if (!options.skipFormat)
|
|
141
131
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -10,15 +10,17 @@ async function addE2e(host, options) {
|
|
|
10
10
|
const e2eWebServerInfo = await getNuxtE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `nuxt.config.${options.js ? 'js' : 'ts'}`));
|
|
11
11
|
if (options.e2eTestRunner === 'cypress') {
|
|
12
12
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
if (options.isUsingTsSolutionConfig) {
|
|
14
|
+
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), {
|
|
15
|
+
name: options.e2eProjectName,
|
|
16
|
+
version: '0.0.1',
|
|
17
|
+
private: true,
|
|
18
|
+
nx: {
|
|
19
|
+
projectType: 'application',
|
|
20
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
21
|
+
implicitDependencies: [options.projectName],
|
|
22
|
+
},
|
|
23
|
+
});
|
|
22
24
|
}
|
|
23
25
|
else {
|
|
24
26
|
(0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
|
|
@@ -30,9 +32,6 @@ async function addE2e(host, options) {
|
|
|
30
32
|
implicitDependencies: [options.projectName],
|
|
31
33
|
});
|
|
32
34
|
}
|
|
33
|
-
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
34
|
-
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
35
|
-
}
|
|
36
35
|
const e2eTask = await configurationGenerator(host, {
|
|
37
36
|
...options,
|
|
38
37
|
project: options.e2eProjectName,
|
|
@@ -59,15 +58,17 @@ async function addE2e(host, options) {
|
|
|
59
58
|
}
|
|
60
59
|
else if (options.e2eTestRunner === 'playwright') {
|
|
61
60
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
if (options.isUsingTsSolutionConfig) {
|
|
62
|
+
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), {
|
|
63
|
+
name: options.e2eProjectName,
|
|
64
|
+
version: '0.0.1',
|
|
65
|
+
private: true,
|
|
66
|
+
nx: {
|
|
67
|
+
projectType: 'application',
|
|
68
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
69
|
+
implicitDependencies: [options.projectName],
|
|
70
|
+
},
|
|
71
|
+
});
|
|
71
72
|
}
|
|
72
73
|
else {
|
|
73
74
|
(0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
|
|
@@ -78,9 +79,6 @@ async function addE2e(host, options) {
|
|
|
78
79
|
implicitDependencies: [options.projectName],
|
|
79
80
|
});
|
|
80
81
|
}
|
|
81
|
-
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
82
|
-
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
83
|
-
}
|
|
84
82
|
const e2eTask = await configurationGenerator(host, {
|
|
85
83
|
project: options.e2eProjectName,
|
|
86
84
|
skipFormat: true,
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
5
|
const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
|
|
5
6
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
6
7
|
async function normalizeOptions(host, options) {
|
|
7
|
-
await (0, project_name_and_root_utils_1.
|
|
8
|
-
const { projectName
|
|
8
|
+
await (0, project_name_and_root_utils_1.ensureProjectName)(host, options, 'application');
|
|
9
|
+
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
|
|
9
10
|
name: options.name,
|
|
10
11
|
projectType: 'application',
|
|
11
12
|
directory: options.directory,
|
|
12
13
|
rootProject: options.rootProject,
|
|
13
14
|
});
|
|
14
15
|
options.rootProject = appProjectRoot === '.';
|
|
15
|
-
const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
|
|
16
|
-
const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
|
|
17
16
|
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
18
17
|
const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
19
18
|
const parsedTags = options.tags
|
|
@@ -21,16 +20,14 @@ async function normalizeOptions(host, options) {
|
|
|
21
20
|
: [];
|
|
22
21
|
const normalized = {
|
|
23
22
|
...options,
|
|
24
|
-
name:
|
|
23
|
+
name: (0, devkit_1.names)(options.name).fileName,
|
|
25
24
|
projectName: appProjectName,
|
|
26
25
|
appProjectRoot,
|
|
27
|
-
importPath,
|
|
28
26
|
e2eProjectName,
|
|
29
27
|
e2eProjectRoot,
|
|
30
28
|
parsedTags,
|
|
31
29
|
style: options.style ?? 'none',
|
|
32
|
-
isUsingTsSolutionConfig,
|
|
33
|
-
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
30
|
+
isUsingTsSolutionConfig: (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host),
|
|
34
31
|
};
|
|
35
32
|
normalized.unitTestRunner ??= 'vitest';
|
|
36
33
|
normalized.e2eTestRunner = normalized.e2eTestRunner ?? 'playwright';
|
|
@@ -16,13 +16,11 @@ export interface Schema {
|
|
|
16
16
|
style?: 'css' | 'scss' | 'less' | 'none';
|
|
17
17
|
nxCloudToken?: string;
|
|
18
18
|
useTsSolution?: boolean;
|
|
19
|
-
useProjectJson?: boolean;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
|
-
export interface NormalizedSchema extends
|
|
21
|
+
export interface NormalizedSchema extends Schema {
|
|
23
22
|
projectName: string;
|
|
24
23
|
appProjectRoot: string;
|
|
25
|
-
importPath: string;
|
|
26
24
|
e2eProjectName: string;
|
|
27
25
|
e2eProjectRoot: string;
|
|
28
26
|
parsedTags: string[];
|
|
@@ -106,10 +106,6 @@
|
|
|
106
106
|
"type": "boolean",
|
|
107
107
|
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
108
108
|
"default": false
|
|
109
|
-
},
|
|
110
|
-
"useProjectJson": {
|
|
111
|
-
"type": "boolean",
|
|
112
|
-
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
113
109
|
}
|
|
114
110
|
},
|
|
115
111
|
"required": ["directory"],
|