@nx/angular 18.3.0-canary.20240403-270788e → 18.3.0-canary.20240404-3b182e4

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "18.3.0-canary.20240403-270788e",
3
+ "version": "18.3.0-canary.20240404-3b182e4",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -78,14 +78,14 @@
78
78
  "tslib": "^2.3.0",
79
79
  "webpack": "^5.80.0",
80
80
  "webpack-merge": "^5.8.0",
81
- "@nx/devkit": "18.3.0-canary.20240403-270788e",
82
- "@nx/js": "18.3.0-canary.20240403-270788e",
83
- "@nx/eslint": "18.3.0-canary.20240403-270788e",
84
- "@nx/webpack": "18.3.0-canary.20240403-270788e",
85
- "@nx/web": "18.3.0-canary.20240403-270788e",
86
- "@nx/workspace": "18.3.0-canary.20240403-270788e",
81
+ "@nx/devkit": "18.3.0-canary.20240404-3b182e4",
82
+ "@nx/js": "18.3.0-canary.20240404-3b182e4",
83
+ "@nx/eslint": "18.3.0-canary.20240404-3b182e4",
84
+ "@nx/webpack": "18.3.0-canary.20240404-3b182e4",
85
+ "@nx/web": "18.3.0-canary.20240404-3b182e4",
86
+ "@nx/workspace": "18.3.0-canary.20240404-3b182e4",
87
87
  "piscina": "^4.4.0",
88
- "@nrwl/angular": "18.3.0-canary.20240403-270788e"
88
+ "@nrwl/angular": "18.3.0-canary.20240404-3b182e4"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
@@ -27,8 +27,8 @@ async function addE2e(tree, options) {
27
27
  linter: options.linter,
28
28
  skipPackageJson: options.skipPackageJson,
29
29
  skipFormat: true,
30
- devServerTarget: `${options.name}:serve:development`,
31
- baseUrl: 'http://localhost:4200',
30
+ devServerTarget: `${options.name}:${options.e2eWebServerTarget}:development`,
31
+ baseUrl: options.e2eWebServerAddress,
32
32
  rootProject: options.rootProject,
33
33
  addPlugin,
34
34
  });
@@ -50,8 +50,8 @@ async function addE2e(tree, options) {
50
50
  js: false,
51
51
  linter: options.linter,
52
52
  setParserOptionsProject: options.setParserOptionsProject,
53
- webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.name}`,
54
- webServerAddress: `http://localhost:${options.port ?? 4200}`,
53
+ webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx ${options.e2eWebServerTarget} ${options.name}`,
54
+ webServerAddress: options.e2eWebServerAddress,
55
55
  rootProject: options.rootProject,
56
56
  addPlugin,
57
57
  });
@@ -67,7 +67,7 @@ function addFileServerTarget(tree, options, targetName) {
67
67
  executor: '@nx/web:file-server',
68
68
  options: {
69
69
  buildTarget: `${options.name}:build`,
70
- port: options.port,
70
+ port: options.e2ePort,
71
71
  staticFilePath: isUsingApplicationBuilder
72
72
  ? (0, devkit_1.joinPathFragments)(options.outputPath, 'browser')
73
73
  : undefined,
@@ -17,8 +17,19 @@ async function normalizeOptions(host, options) {
17
17
  });
18
18
  options.rootProject = appProjectRoot === '.';
19
19
  options.projectNameAndRootFormat = projectNameAndRootFormat;
20
+ const nxJson = (0, devkit_1.readNxJson)(host);
21
+ let e2eWebServerTarget = 'serve';
22
+ let e2ePort = options.port ?? 4200;
23
+ if (nxJson.targetDefaults?.[e2eWebServerTarget] &&
24
+ (nxJson.targetDefaults?.[e2eWebServerTarget].options?.port ||
25
+ nxJson.targetDefaults?.[e2eWebServerTarget].options?.env?.PORT)) {
26
+ e2ePort =
27
+ nxJson.targetDefaults?.[e2eWebServerTarget].options?.port ||
28
+ nxJson.targetDefaults?.[e2eWebServerTarget].options?.env?.PORT;
29
+ }
20
30
  const e2eProjectName = options.rootProject ? 'e2e' : `${appProjectName}-e2e`;
21
31
  const e2eProjectRoot = options.rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
32
+ const e2eWebServerAddress = `http://localhost:${e2ePort}`;
22
33
  const parsedTags = options.tags
23
34
  ? options.tags.split(',').map((s) => s.trim())
24
35
  : [];
@@ -47,6 +58,9 @@ async function normalizeOptions(host, options) {
47
58
  appProjectSourceRoot: `${appProjectRoot}/src`,
48
59
  e2eProjectRoot,
49
60
  e2eProjectName,
61
+ e2eWebServerAddress,
62
+ e2eWebServerTarget,
63
+ e2ePort,
50
64
  parsedTags,
51
65
  bundler,
52
66
  outputPath: (0, devkit_1.joinPathFragments)('dist', !options.rootProject ? appProjectRoot : appProjectName),
@@ -10,6 +10,9 @@ export interface NormalizedSchema extends Schema {
10
10
  appProjectSourceRoot: string;
11
11
  e2eProjectName: string;
12
12
  e2eProjectRoot: string;
13
+ e2eWebServerAddress: string;
14
+ e2eWebServerTarget: string;
15
+ e2ePort: number;
13
16
  parsedTags: string[];
14
17
  outputPath: string;
15
18
  }