@nx/vue 20.5.0 → 20.6.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/package.json +6 -6
- package/src/generators/application/application.js +15 -9
- package/src/generators/application/lib/add-e2e.js +24 -18
- package/src/generators/application/lib/normalize-options.js +1 -0
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +4 -0
- package/src/generators/library/lib/create-library-files.js +1 -0
- package/src/generators/library/lib/normalize-options.js +1 -0
- package/src/generators/library/library.js +16 -7
- package/src/generators/library/schema.d.ts +1 -0
- package/src/generators/library/schema.json +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.6.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": "20.
|
|
35
|
-
"@nx/js": "20.
|
|
36
|
-
"@nx/eslint": "20.
|
|
37
|
-
"@nx/vite": "20.
|
|
38
|
-
"@nx/web": "20.
|
|
34
|
+
"@nx/devkit": "20.6.0-beta.0",
|
|
35
|
+
"@nx/js": "20.6.0-beta.0",
|
|
36
|
+
"@nx/eslint": "20.6.0-beta.0",
|
|
37
|
+
"@nx/vite": "20.6.0-beta.0",
|
|
38
|
+
"@nx/web": "20.6.0-beta.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -18,7 +18,11 @@ const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-projec
|
|
|
18
18
|
const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
|
|
19
19
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
20
20
|
function applicationGenerator(tree, options) {
|
|
21
|
-
return applicationGeneratorInternal(tree, {
|
|
21
|
+
return applicationGeneratorInternal(tree, {
|
|
22
|
+
addPlugin: false,
|
|
23
|
+
useProjectJson: true,
|
|
24
|
+
...options,
|
|
25
|
+
});
|
|
22
26
|
}
|
|
23
27
|
async function applicationGeneratorInternal(tree, _options) {
|
|
24
28
|
const tasks = [];
|
|
@@ -36,18 +40,18 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
36
40
|
// If we are using the new TS solution
|
|
37
41
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
38
42
|
if (options.isUsingTsSolutionConfig) {
|
|
39
|
-
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
43
|
+
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.appProjectRoot);
|
|
40
44
|
}
|
|
41
45
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
42
46
|
options.addPlugin ??=
|
|
43
47
|
process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
44
48
|
nxJson.useInferencePlugins !== false;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
const packageJson = {
|
|
50
|
+
name: options.importPath,
|
|
51
|
+
version: '0.0.1',
|
|
52
|
+
private: true,
|
|
53
|
+
};
|
|
54
|
+
if (!options.useProjectJson) {
|
|
51
55
|
if (options.projectName !== options.importPath) {
|
|
52
56
|
packageJson.nx = { name: options.projectName };
|
|
53
57
|
}
|
|
@@ -55,7 +59,6 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
55
59
|
packageJson.nx ??= {};
|
|
56
60
|
packageJson.nx.tags = options.parsedTags;
|
|
57
61
|
}
|
|
58
|
-
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
|
|
59
62
|
}
|
|
60
63
|
else {
|
|
61
64
|
(0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
|
|
@@ -66,6 +69,9 @@ async function applicationGeneratorInternal(tree, _options) {
|
|
|
66
69
|
targets: {},
|
|
67
70
|
});
|
|
68
71
|
}
|
|
72
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
73
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json'), packageJson);
|
|
74
|
+
}
|
|
69
75
|
tasks.push(await (0, init_1.vueInitGenerator)(tree, {
|
|
70
76
|
...options,
|
|
71
77
|
skipFormat: true,
|
|
@@ -34,15 +34,15 @@ async function addE2e(tree, options) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
37
|
+
const packageJson = {
|
|
38
|
+
name: options.e2eProjectName,
|
|
39
|
+
version: '0.0.1',
|
|
40
|
+
private: true,
|
|
41
|
+
};
|
|
42
|
+
if (!options.useProjectJson) {
|
|
43
|
+
packageJson.nx = {
|
|
44
|
+
implicitDependencies: [options.projectName],
|
|
45
|
+
};
|
|
46
46
|
}
|
|
47
47
|
else {
|
|
48
48
|
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
@@ -54,6 +54,9 @@ async function addE2e(tree, options) {
|
|
|
54
54
|
implicitDependencies: [options.projectName],
|
|
55
55
|
});
|
|
56
56
|
}
|
|
57
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
58
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
59
|
+
}
|
|
57
60
|
const e2eTask = await configurationGenerator(tree, {
|
|
58
61
|
...options,
|
|
59
62
|
project: options.e2eProjectName,
|
|
@@ -89,15 +92,15 @@ async function addE2e(tree, options) {
|
|
|
89
92
|
}
|
|
90
93
|
case 'playwright': {
|
|
91
94
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
95
|
+
const packageJson = {
|
|
96
|
+
name: options.e2eProjectName,
|
|
97
|
+
version: '0.0.1',
|
|
98
|
+
private: true,
|
|
99
|
+
};
|
|
100
|
+
if (!options.useProjectJson) {
|
|
101
|
+
packageJson.nx = {
|
|
102
|
+
implicitDependencies: [options.projectName],
|
|
103
|
+
};
|
|
101
104
|
}
|
|
102
105
|
else {
|
|
103
106
|
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
@@ -108,6 +111,9 @@ async function addE2e(tree, options) {
|
|
|
108
111
|
implicitDependencies: [options.projectName],
|
|
109
112
|
});
|
|
110
113
|
}
|
|
114
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
115
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
116
|
+
}
|
|
111
117
|
const e2eTask = await configurationGenerator(tree, {
|
|
112
118
|
...options,
|
|
113
119
|
project: options.e2eProjectName,
|
|
@@ -28,6 +28,7 @@ async function normalizeOptions(host, options) {
|
|
|
28
28
|
e2eProjectRoot,
|
|
29
29
|
parsedTags,
|
|
30
30
|
isUsingTsSolutionConfig,
|
|
31
|
+
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
31
32
|
};
|
|
32
33
|
normalized.style = options.style ?? 'css';
|
|
33
34
|
normalized.routing = normalized.routing ?? false;
|
|
@@ -139,6 +139,10 @@
|
|
|
139
139
|
"type": "boolean",
|
|
140
140
|
"default": false,
|
|
141
141
|
"hidden": true
|
|
142
|
+
},
|
|
143
|
+
"useProjectJson": {
|
|
144
|
+
"type": "boolean",
|
|
145
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
142
146
|
}
|
|
143
147
|
},
|
|
144
148
|
"required": ["directory"],
|
|
@@ -15,6 +15,7 @@ function createLibraryFiles(host, options) {
|
|
|
15
15
|
};
|
|
16
16
|
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, '../files'), options.projectRoot, substitutions);
|
|
17
17
|
if (!options.isUsingTsSolutionConfig &&
|
|
18
|
+
options.useProjectJson &&
|
|
18
19
|
(options.publishable || options.bundler !== 'none')) {
|
|
19
20
|
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), {
|
|
20
21
|
name: options.importPath ?? options.projectName,
|
|
@@ -39,6 +39,7 @@ async function normalizeOptions(host, options) {
|
|
|
39
39
|
parsedTags,
|
|
40
40
|
importPath,
|
|
41
41
|
isUsingTsSolutionConfig,
|
|
42
|
+
useProjectJson: options.useProjectJson ?? !isUsingTsSolutionConfig,
|
|
42
43
|
};
|
|
43
44
|
// Libraries with a bundler or is publishable must also be buildable.
|
|
44
45
|
normalized.bundler =
|
|
@@ -20,7 +20,11 @@ const determine_entry_fields_1 = require("./lib/determine-entry-fields");
|
|
|
20
20
|
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
21
21
|
const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
|
|
22
22
|
function libraryGenerator(tree, schema) {
|
|
23
|
-
return libraryGeneratorInternal(tree, {
|
|
23
|
+
return libraryGeneratorInternal(tree, {
|
|
24
|
+
addPlugin: false,
|
|
25
|
+
useProjectJson: true,
|
|
26
|
+
...schema,
|
|
27
|
+
});
|
|
24
28
|
}
|
|
25
29
|
async function libraryGeneratorInternal(tree, schema) {
|
|
26
30
|
const tasks = [];
|
|
@@ -32,12 +36,15 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
32
36
|
// If we are using the new TS solution
|
|
33
37
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
34
38
|
if (options.isUsingTsSolutionConfig) {
|
|
35
|
-
(0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
|
|
39
|
+
await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
|
|
36
40
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
let packageJson = {
|
|
42
|
+
name: options.importPath,
|
|
43
|
+
version: '0.0.1',
|
|
44
|
+
};
|
|
45
|
+
if (!options.useProjectJson) {
|
|
46
|
+
packageJson = {
|
|
47
|
+
...packageJson,
|
|
41
48
|
...(0, determine_entry_fields_1.determineEntryFields)(options),
|
|
42
49
|
files: options.publishable ? ['dist', '!**/*.tsbuildinfo'] : undefined,
|
|
43
50
|
};
|
|
@@ -48,7 +55,6 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
48
55
|
packageJson.nx ??= {};
|
|
49
56
|
packageJson.nx.tags = options.parsedTags;
|
|
50
57
|
}
|
|
51
|
-
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), packageJson);
|
|
52
58
|
}
|
|
53
59
|
else {
|
|
54
60
|
(0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
|
|
@@ -59,6 +65,9 @@ async function libraryGeneratorInternal(tree, schema) {
|
|
|
59
65
|
targets: {},
|
|
60
66
|
});
|
|
61
67
|
}
|
|
68
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
69
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), packageJson);
|
|
70
|
+
}
|
|
62
71
|
tasks.push(await (0, init_1.vueInitGenerator)(tree, {
|
|
63
72
|
...options,
|
|
64
73
|
skipFormat: true,
|
|
@@ -125,6 +125,10 @@
|
|
|
125
125
|
"description": "Create a Vue library with a minimal setup, no separate test files.",
|
|
126
126
|
"type": "boolean",
|
|
127
127
|
"default": false
|
|
128
|
+
},
|
|
129
|
+
"useProjectJson": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
|
|
128
132
|
}
|
|
129
133
|
},
|
|
130
134
|
"required": ["directory"]
|