@nx/angular 19.0.4 → 19.1.0-beta.0

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": "19.0.4",
3
+ "version": "19.1.0-beta.0",
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, Playwright 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": "19.0.4",
82
- "@nx/js": "19.0.4",
83
- "@nx/eslint": "19.0.4",
84
- "@nx/webpack": "19.0.4",
85
- "@nx/web": "19.0.4",
86
- "@nx/workspace": "19.0.4",
81
+ "@nx/devkit": "19.1.0-beta.0",
82
+ "@nx/js": "19.1.0-beta.0",
83
+ "@nx/eslint": "19.1.0-beta.0",
84
+ "@nx/webpack": "19.1.0-beta.0",
85
+ "@nx/web": "19.1.0-beta.0",
86
+ "@nx/workspace": "19.1.0-beta.0",
87
87
  "piscina": "^4.4.0",
88
- "@nrwl/angular": "19.0.4"
88
+ "@nrwl/angular": "19.1.0-beta.0"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
@@ -2,5 +2,8 @@ import { ProjectConfiguration } from '@nx/devkit';
2
2
  export declare function getDynamicRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>, pathToManifestFile?: string): string[];
3
3
  export declare function getStaticRemotes(project: ProjectConfiguration, context: import('@angular-devkit/architect').BuilderContext, workspaceProjects: Record<string, ProjectConfiguration>, remotesToSkip: Set<string>): string[];
4
4
  export declare function validateDevRemotes(options: {
5
- devRemotes?: string[];
5
+ devRemotes?: (string | {
6
+ remoteName: string;
7
+ configuration: string;
8
+ })[];
6
9
  }, workspaceProjects: Record<string, ProjectConfiguration>): void;
@@ -85,7 +85,9 @@ function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
85
85
  }
86
86
  exports.getStaticRemotes = getStaticRemotes;
87
87
  function validateDevRemotes(options, workspaceProjects) {
88
- const invalidDevRemotes = options.devRemotes?.filter((remote) => !workspaceProjects[remote]) ?? [];
88
+ const invalidDevRemotes = options.devRemotes?.filter((remote) => !(typeof remote === 'string'
89
+ ? workspaceProjects[remote]
90
+ : workspaceProjects[remote.remoteName])) ?? [];
89
91
  if (invalidDevRemotes.length) {
90
92
  throw new Error(invalidDevRemotes.length === 1
91
93
  ? `Invalid dev remote provided: ${invalidDevRemotes[0]}.`
@@ -13,10 +13,11 @@ async function startRemotes(remotes, workspaceProjects, options, context, target
13
13
  }
14
14
  const [collection, executor] = workspaceProjects[app].targets[target].executor.split(':');
15
15
  const isUsingModuleFederationDevServerExecutor = executor.includes('module-federation-dev-server');
16
+ const configurationOverride = options.devRemotes.find((r) => typeof r !== 'string' && r.remoteName === app)?.configuration;
16
17
  remoteIters.push(await (0, devkit_1.runExecutor)({
17
18
  project: app,
18
19
  target,
19
- configuration: context.configurationName,
20
+ configuration: configurationOverride ?? context.configurationName,
20
21
  }, {
21
22
  ...(target === 'serve' ? { verbose: options.verbose ?? false } : {}),
22
23
  ...(isUsingModuleFederationDevServerExecutor
@@ -52,14 +52,17 @@ async function* moduleFederationDevServerExecutor(schema, context) {
52
52
  }
53
53
  (0, module_federation_2.validateDevRemotes)(options, workspaceProjects);
54
54
  const moduleFederationConfig = (0, module_federation_1.getModuleFederationConfig)(project.targets.build.options.tsConfig, context.root, project.root, 'angular');
55
- const remotes = (0, module_federation_1.getRemotes)(options.devRemotes, options.skipRemotes, moduleFederationConfig, {
55
+ const remoteNames = options.devRemotes?.map((r) => typeof r === 'string' ? r : r.remoteName);
56
+ const remotes = (0, module_federation_1.getRemotes)(remoteNames, options.skipRemotes, moduleFederationConfig, {
56
57
  projectName: project.name,
57
58
  projectGraph: context.projectGraph,
58
59
  root: context.root,
59
60
  }, pathToManifestFile);
60
61
  if (remotes.devRemotes.length > 0 && !schema.staticRemotesPort) {
61
62
  options.staticRemotesPort = options.devRemotes.reduce((portToUse, r) => {
62
- const remotePort = context.projectGraph.nodes[r].data.targets['serve'].options.port;
63
+ const remoteName = typeof r === 'string' ? r : r.remoteName;
64
+ const remotePort = context.projectGraph.nodes[remoteName].data.targets['serve'].options
65
+ .port;
63
66
  if (remotePort >= portToUse) {
64
67
  return remotePort + 1;
65
68
  }
@@ -16,7 +16,13 @@ interface BaseSchema {
16
16
  hmr?: boolean;
17
17
  watch?: boolean;
18
18
  poll?: number;
19
- devRemotes?: string[];
19
+ devRemotes?: (
20
+ | string
21
+ | {
22
+ remoteName: string;
23
+ configuration: string;
24
+ }
25
+ )[];
20
26
  skipRemotes?: string[];
21
27
  pathToManifestFile?: string;
22
28
  static?: boolean;
@@ -112,7 +112,24 @@
112
112
  "devRemotes": {
113
113
  "type": "array",
114
114
  "items": {
115
- "type": "string"
115
+ "oneOf": [
116
+ {
117
+ "type": "string"
118
+ },
119
+ {
120
+ "type": "object",
121
+ "properties": {
122
+ "remoteName": {
123
+ "type": "string"
124
+ },
125
+ "configuration": {
126
+ "type": "string"
127
+ }
128
+ },
129
+ "required": ["remoteName"],
130
+ "additionalProperties": false
131
+ }
132
+ ]
116
133
  },
117
134
  "description": "List of remote applications to run in development mode (i.e. using serve target).",
118
135
  "x-priority": "important"
@@ -5,8 +5,5 @@
5
5
  "@angular/common": "<%= angularPeerDepVersion %>",
6
6
  "@angular/core": "<%= angularPeerDepVersion %>"
7
7
  },
8
- "dependencies": {
9
- "tslib": "^2.3.0"
10
- },
11
8
  "sideEffects": false
12
9
  }