@nx/vue 19.5.5 → 19.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/vue",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.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": "19.
|
|
35
|
-
"@nx/js": "19.
|
|
36
|
-
"@nx/eslint": "19.
|
|
37
|
-
"@nx/vite": "19.
|
|
38
|
-
"@nx/web": "19.
|
|
34
|
+
"@nx/devkit": "19.6.0-beta.0",
|
|
35
|
+
"@nx/js": "19.6.0-beta.0",
|
|
36
|
+
"@nx/eslint": "19.6.0-beta.0",
|
|
37
|
+
"@nx/vite": "19.6.0-beta.0",
|
|
38
|
+
"@nx/web": "19.6.0-beta.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
@@ -4,13 +4,25 @@ exports.addE2e = addE2e;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const web_1 = require("@nx/web");
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
|
7
|
+
const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
|
|
8
|
+
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
7
9
|
async function addE2e(tree, options) {
|
|
10
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
11
|
+
const hasPlugin = nxJson.plugins?.find((p) => typeof p === 'string'
|
|
12
|
+
? p === '@nx/vite/plugin'
|
|
13
|
+
: p.plugin === '@nx/vite/plugin');
|
|
14
|
+
const e2eWebServerTarget = hasPlugin
|
|
15
|
+
? typeof hasPlugin === 'string'
|
|
16
|
+
? 'serve'
|
|
17
|
+
: hasPlugin.options?.serveTargetName ?? 'serve'
|
|
18
|
+
: 'serve';
|
|
19
|
+
const e2eCiWebServerTarget = hasPlugin
|
|
20
|
+
? typeof hasPlugin === 'string'
|
|
21
|
+
? 'preview'
|
|
22
|
+
: hasPlugin.options?.previewTargetName ?? 'preview'
|
|
23
|
+
: 'preview';
|
|
8
24
|
switch (options.e2eTestRunner) {
|
|
9
25
|
case 'cypress': {
|
|
10
|
-
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
11
|
-
const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
|
|
12
|
-
? p === '@nx/vite/plugin'
|
|
13
|
-
: p.plugin === '@nx/vite/plugin');
|
|
14
26
|
if (!hasPlugin) {
|
|
15
27
|
await (0, web_1.webStaticServeGenerator)(tree, {
|
|
16
28
|
buildTarget: `${options.projectName}:build`,
|
|
@@ -27,16 +39,38 @@ async function addE2e(tree, options) {
|
|
|
27
39
|
tags: [],
|
|
28
40
|
implicitDependencies: [options.projectName],
|
|
29
41
|
});
|
|
30
|
-
|
|
42
|
+
const e2eTask = await configurationGenerator(tree, {
|
|
31
43
|
...options,
|
|
32
44
|
project: options.e2eProjectName,
|
|
33
45
|
directory: 'src',
|
|
34
46
|
bundler: 'vite',
|
|
35
47
|
skipFormat: true,
|
|
36
|
-
devServerTarget: `${options.projectName}
|
|
48
|
+
devServerTarget: `${options.projectName}:${e2eWebServerTarget}`,
|
|
37
49
|
baseUrl: 'http://localhost:4200',
|
|
38
50
|
jsx: true,
|
|
51
|
+
webServerCommands: hasPlugin
|
|
52
|
+
? {
|
|
53
|
+
default: `nx run ${options.projectName}:${e2eWebServerTarget}`,
|
|
54
|
+
production: `nx run ${options.projectName}:preview`,
|
|
55
|
+
}
|
|
56
|
+
: undefined,
|
|
57
|
+
ciWebServerCommand: `nx run ${options.projectName}:${e2eCiWebServerTarget}`,
|
|
58
|
+
ciBaseUrl: 'http://localhost:4300',
|
|
39
59
|
});
|
|
60
|
+
if (options.addPlugin ||
|
|
61
|
+
(0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
|
62
|
+
? p === '@nx/cypress/plugin'
|
|
63
|
+
: p.plugin === '@nx/cypress/plugin')) {
|
|
64
|
+
let buildTarget = '^build';
|
|
65
|
+
if (hasPlugin) {
|
|
66
|
+
const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/vite/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`));
|
|
67
|
+
if (matchingPlugin && typeof matchingPlugin !== 'string') {
|
|
68
|
+
buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/cypress/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `cypress.config.${options.js ? 'js' : 'ts'}`));
|
|
72
|
+
}
|
|
73
|
+
return e2eTask;
|
|
40
74
|
}
|
|
41
75
|
case 'playwright': {
|
|
42
76
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
@@ -47,7 +81,7 @@ async function addE2e(tree, options) {
|
|
|
47
81
|
targets: {},
|
|
48
82
|
implicitDependencies: [options.projectName],
|
|
49
83
|
});
|
|
50
|
-
|
|
84
|
+
const e2eTask = await configurationGenerator(tree, {
|
|
51
85
|
...options,
|
|
52
86
|
project: options.e2eProjectName,
|
|
53
87
|
skipFormat: true,
|
|
@@ -56,9 +90,23 @@ async function addE2e(tree, options) {
|
|
|
56
90
|
js: false,
|
|
57
91
|
linter: options.linter,
|
|
58
92
|
setParserOptionsProject: options.setParserOptionsProject,
|
|
59
|
-
webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx
|
|
60
|
-
webServerAddress: 'http://localhost:
|
|
93
|
+
webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx run ${options.projectName}:${e2eCiWebServerTarget}`,
|
|
94
|
+
webServerAddress: 'http://localhost:4300',
|
|
61
95
|
});
|
|
96
|
+
if (options.addPlugin ||
|
|
97
|
+
(0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
|
98
|
+
? p === '@nx/playwright/plugin'
|
|
99
|
+
: p.plugin === '@nx/playwright/plugin')) {
|
|
100
|
+
let buildTarget = '^build';
|
|
101
|
+
if (hasPlugin) {
|
|
102
|
+
const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/vite/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`));
|
|
103
|
+
if (matchingPlugin && typeof matchingPlugin !== 'string') {
|
|
104
|
+
buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/playwright/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `playwright.config.ts`));
|
|
108
|
+
}
|
|
109
|
+
return e2eTask;
|
|
62
110
|
}
|
|
63
111
|
case 'none':
|
|
64
112
|
default:
|