@nx/nuxt 18.2.2 → 18.2.3

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": "18.2.2",
3
+ "version": "18.2.3",
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, 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": {
@@ -30,11 +30,11 @@
30
30
  "dependencies": {
31
31
  "tslib": "^2.3.0",
32
32
  "@nuxt/kit": "^3.10.0",
33
- "@nx/devkit": "18.2.2",
34
- "@nx/js": "18.2.2",
35
- "@nx/eslint": "18.2.2",
36
- "@nx/vue": "18.2.2",
37
- "@nx/vite": "18.2.2"
33
+ "@nx/devkit": "18.2.3",
34
+ "@nx/js": "18.2.3",
35
+ "@nx/eslint": "18.2.3",
36
+ "@nx/vue": "18.2.3",
37
+ "@nx/vite": "18.2.3"
38
38
  },
39
39
  "peerDependencies": {},
40
40
  "publishConfig": {
@@ -20,12 +20,12 @@ async function addE2e(host, options) {
20
20
  directory: 'src',
21
21
  bundler: 'vite',
22
22
  skipFormat: true,
23
- devServerTarget: `${options.projectName}:serve`,
23
+ devServerTarget: `${options.projectName}:${options.e2eWebServerTarget}`,
24
24
  webServerCommands: {
25
- default: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.projectName}`,
25
+ default: `${(0, devkit_1.getPackageManagerCommand)().exec} nx ${options.e2eWebServerTarget} ${options.projectName}`,
26
26
  },
27
27
  ciWebServerCommand: `nx run ${options.projectName}:serve-static`,
28
- baseUrl: 'http://localhost:4200',
28
+ baseUrl: options.e2eWebServerAddress,
29
29
  jsx: true,
30
30
  addPlugin: true,
31
31
  });
@@ -46,8 +46,8 @@ async function addE2e(host, options) {
46
46
  js: false,
47
47
  linter: options.linter,
48
48
  setParserOptionsProject: options.setParserOptionsProject,
49
- webServerAddress: 'http://localhost:4200',
50
- webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.projectName}`,
49
+ webServerAddress: options.e2eWebServerAddress,
50
+ webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx ${options.e2eWebServerTarget} ${options.projectName}`,
51
51
  addPlugin: true,
52
52
  });
53
53
  }
@@ -22,8 +22,26 @@ async function normalizeOptions(host, options, callingGenerator = '@nx/nuxt:appl
22
22
  });
23
23
  options.rootProject = appProjectRoot === '.';
24
24
  options.projectNameAndRootFormat = projectNameAndRootFormat;
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
+ }
25
42
  const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
26
43
  const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
44
+ const e2eWebServerAddress = `http://localhost:${e2ePort}`;
27
45
  const parsedTags = options.tags
28
46
  ? options.tags.split(',').map((s) => s.trim())
29
47
  : [];
@@ -34,6 +52,9 @@ async function normalizeOptions(host, options, callingGenerator = '@nx/nuxt:appl
34
52
  appProjectRoot,
35
53
  e2eProjectName,
36
54
  e2eProjectRoot,
55
+ e2eWebServerAddress,
56
+ e2eWebServerTarget,
57
+ e2ePort,
37
58
  parsedTags,
38
59
  style: options.style ?? 'none',
39
60
  };
@@ -22,5 +22,8 @@ export interface NormalizedSchema extends Schema {
22
22
  appProjectRoot: string;
23
23
  e2eProjectName: string;
24
24
  e2eProjectRoot: string;
25
+ e2eWebServerAddress: string;
26
+ e2eWebServerTarget: string;
27
+ e2ePort: number;
25
28
  parsedTags: string[];
26
29
  }