@nx/nuxt 19.6.2 → 19.6.4
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/nuxt",
|
|
3
|
-
"version": "19.6.
|
|
3
|
+
"version": "19.6.4",
|
|
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": "19.6.
|
|
35
|
-
"@nx/js": "19.6.
|
|
36
|
-
"@nx/eslint": "19.6.
|
|
37
|
-
"@nx/vue": "19.6.
|
|
38
|
-
"@nx/vite": "19.6.
|
|
34
|
+
"@nx/devkit": "19.6.4",
|
|
35
|
+
"@nx/js": "19.6.4",
|
|
36
|
+
"@nx/eslint": "19.6.4",
|
|
37
|
+
"@nx/vue": "19.6.4",
|
|
38
|
+
"@nx/vite": "19.6.4",
|
|
39
39
|
"@phenomnomnominal/tsquery": "~5.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {},
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addE2e = addE2e;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const e2e_web_server_info_utils_1 = require("@nx/devkit/src/generators/e2e-web-server-info-utils");
|
|
5
6
|
const versions_1 = require("../../../utils/versions");
|
|
6
7
|
const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
|
|
7
8
|
const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
|
|
8
9
|
async function addE2e(host, options) {
|
|
10
|
+
const e2eWebServerInfo = await getNuxtE2EWebServerInfo(host, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `nuxt.config.${options.js ? 'js' : 'ts'}`));
|
|
9
11
|
if (options.e2eTestRunner === 'cypress') {
|
|
10
12
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
11
13
|
(0, devkit_1.addProjectConfiguration)(host, options.e2eProjectName, {
|
|
@@ -22,12 +24,13 @@ async function addE2e(host, options) {
|
|
|
22
24
|
directory: 'src',
|
|
23
25
|
bundler: 'vite',
|
|
24
26
|
skipFormat: true,
|
|
25
|
-
devServerTarget:
|
|
27
|
+
devServerTarget: e2eWebServerInfo.e2eDevServerTarget,
|
|
26
28
|
webServerCommands: {
|
|
27
|
-
default:
|
|
29
|
+
default: e2eWebServerInfo.e2eWebServerCommand,
|
|
28
30
|
},
|
|
29
|
-
ciWebServerCommand:
|
|
30
|
-
baseUrl:
|
|
31
|
+
ciWebServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
|
|
32
|
+
baseUrl: e2eWebServerInfo.e2eWebServerAddress,
|
|
33
|
+
ciBaseUrl: e2eWebServerInfo.e2eCiBaseUrl,
|
|
31
34
|
jsx: true,
|
|
32
35
|
addPlugin: true,
|
|
33
36
|
});
|
|
@@ -55,8 +58,8 @@ async function addE2e(host, options) {
|
|
|
55
58
|
js: false,
|
|
56
59
|
linter: options.linter,
|
|
57
60
|
setParserOptionsProject: options.setParserOptionsProject,
|
|
58
|
-
webServerAddress:
|
|
59
|
-
webServerCommand:
|
|
61
|
+
webServerAddress: e2eWebServerInfo.e2eCiWebServerCommand,
|
|
62
|
+
webServerCommand: e2eWebServerInfo.e2eCiBaseUrl,
|
|
60
63
|
addPlugin: true,
|
|
61
64
|
});
|
|
62
65
|
let buildTarget = '^build-static';
|
|
@@ -69,3 +72,23 @@ async function addE2e(host, options) {
|
|
|
69
72
|
}
|
|
70
73
|
return () => { };
|
|
71
74
|
}
|
|
75
|
+
async function getNuxtE2EWebServerInfo(tree, projectName, configFilePath) {
|
|
76
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
77
|
+
let e2ePort = 4200;
|
|
78
|
+
if (nxJson.targetDefaults?.['serve'] &&
|
|
79
|
+
nxJson.targetDefaults?.['serve'].options?.port) {
|
|
80
|
+
e2ePort = nxJson.targetDefaults?.['serve'].options?.port;
|
|
81
|
+
}
|
|
82
|
+
return (0, e2e_web_server_info_utils_1.getE2EWebServerInfo)(tree, projectName, {
|
|
83
|
+
plugin: '@nx/nuxt/plugin',
|
|
84
|
+
serveTargetName: 'serveTargetName',
|
|
85
|
+
serveStaticTargetName: 'serveStaticTargetName',
|
|
86
|
+
configFilePath,
|
|
87
|
+
}, {
|
|
88
|
+
defaultServeTargetName: 'serve',
|
|
89
|
+
defaultServeStaticTargetName: 'serve-static',
|
|
90
|
+
defaultE2EWebServerAddress: `http://localhost:${e2ePort}`,
|
|
91
|
+
defaultE2ECiBaseUrl: 'http://localhost:4200',
|
|
92
|
+
defaultE2EPort: e2ePort,
|
|
93
|
+
}, true);
|
|
94
|
+
}
|
|
@@ -23,25 +23,8 @@ async function normalizeOptions(host, options, callingGenerator = '@nx/nuxt:appl
|
|
|
23
23
|
options.rootProject = appProjectRoot === '.';
|
|
24
24
|
options.projectNameAndRootFormat = projectNameAndRootFormat;
|
|
25
25
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
26
|
-
let e2eWebServerTarget = 'serve';
|
|
27
|
-
if (nxJson.plugins) {
|
|
28
|
-
for (const plugin of nxJson.plugins) {
|
|
29
|
-
if (typeof plugin === 'object' &&
|
|
30
|
-
plugin.plugin === '@nx/nuxt/plugin' &&
|
|
31
|
-
plugin.options.serveTargetName) {
|
|
32
|
-
e2eWebServerTarget = plugin.options
|
|
33
|
-
.serveTargetName;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
let e2ePort = 4200;
|
|
38
|
-
if (nxJson.targetDefaults?.[e2eWebServerTarget] &&
|
|
39
|
-
nxJson.targetDefaults?.[e2eWebServerTarget].options?.port) {
|
|
40
|
-
e2ePort = nxJson.targetDefaults?.[e2eWebServerTarget].options?.port;
|
|
41
|
-
}
|
|
42
26
|
const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
43
27
|
const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
44
|
-
const e2eWebServerAddress = `http://localhost:${e2ePort}`;
|
|
45
28
|
const parsedTags = options.tags
|
|
46
29
|
? options.tags.split(',').map((s) => s.trim())
|
|
47
30
|
: [];
|
|
@@ -52,9 +35,6 @@ async function normalizeOptions(host, options, callingGenerator = '@nx/nuxt:appl
|
|
|
52
35
|
appProjectRoot,
|
|
53
36
|
e2eProjectName,
|
|
54
37
|
e2eProjectRoot,
|
|
55
|
-
e2eWebServerAddress,
|
|
56
|
-
e2eWebServerTarget,
|
|
57
|
-
e2ePort,
|
|
58
38
|
parsedTags,
|
|
59
39
|
style: options.style ?? 'none',
|
|
60
40
|
};
|