@nx/angular 19.0.7 → 19.1.0-beta.1

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.7",
3
+ "version": "19.1.0-beta.1",
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": {
@@ -13,8 +13,7 @@
13
13
  "Angular",
14
14
  "Jest",
15
15
  "Cypress",
16
- "CLI",
17
- "Front-end"
16
+ "CLI"
18
17
  ],
19
18
  "exports": {
20
19
  "./migrations.json": "./migrations.json",
@@ -79,14 +78,14 @@
79
78
  "tslib": "^2.3.0",
80
79
  "webpack": "^5.80.0",
81
80
  "webpack-merge": "^5.8.0",
82
- "@nx/devkit": "19.0.7",
83
- "@nx/js": "19.0.7",
84
- "@nx/eslint": "19.0.7",
85
- "@nx/webpack": "19.0.7",
86
- "@nx/web": "19.0.7",
87
- "@nx/workspace": "19.0.7",
81
+ "@nx/devkit": "19.1.0-beta.1",
82
+ "@nx/js": "19.1.0-beta.1",
83
+ "@nx/eslint": "19.1.0-beta.1",
84
+ "@nx/webpack": "19.1.0-beta.1",
85
+ "@nx/web": "19.1.0-beta.1",
86
+ "@nx/workspace": "19.1.0-beta.1",
88
87
  "piscina": "^4.4.0",
89
- "@nrwl/angular": "19.0.7"
88
+ "@nrwl/angular": "19.1.0-beta.1"
90
89
  },
91
90
  "peerDependencies": {
92
91
  "@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "proxyConfig": {
38
38
  "type": "string",
39
- "description": "Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server."
39
+ "description": "Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server."
40
40
  },
41
41
  "ssl": {
42
42
  "type": "boolean",
@@ -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]}.`
@@ -153,7 +153,7 @@
153
153
  "additionalProperties": false
154
154
  },
155
155
  "optimization": {
156
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
156
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
157
157
  "x-user-analytics": 16,
158
158
  "default": true,
159
159
  "oneOf": [
@@ -242,7 +242,7 @@
242
242
  "default": true
243
243
  },
244
244
  "sourceMap": {
245
- "description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
245
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
246
246
  "default": false,
247
247
  "oneOf": [
248
248
  {
@@ -45,7 +45,7 @@
45
45
  "additionalProperties": false
46
46
  },
47
47
  "optimization": {
48
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
48
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
49
49
  "default": true,
50
50
  "x-user-analytics": "ep.ng_optimization",
51
51
  "oneOf": [
@@ -87,7 +87,7 @@
87
87
  "description": "The path where style resources will be placed, relative to outputPath."
88
88
  },
89
89
  "sourceMap": {
90
- "description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
90
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
91
91
  "default": false,
92
92
  "oneOf": [
93
93
  {
@@ -145,7 +145,7 @@
145
145
  "description": "Automatically clear the terminal screen during rebuilds. _Note: this is only supported in Angular versions >= 17.2.0_."
146
146
  },
147
147
  "optimization": {
148
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
148
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
149
149
  "default": true,
150
150
  "x-user-analytics": "ep.ng_optimization",
151
151
  "oneOf": [
@@ -281,7 +281,7 @@
281
281
  "default": true
282
282
  },
283
283
  "sourceMap": {
284
- "description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
284
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
285
285
  "default": false,
286
286
  "oneOf": [
287
287
  {
@@ -141,7 +141,7 @@
141
141
  "default": []
142
142
  },
143
143
  "optimization": {
144
- "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.dev/reference/configs/workspace-config#optimization-configuration.",
144
+ "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking, dead-code elimination, inlining of critical CSS and fonts inlining. For more information, see https://angular.io/guide/workspace-config#optimization-configuration.",
145
145
  "default": true,
146
146
  "x-user-analytics": "ep.ng_optimization",
147
147
  "oneOf": [
@@ -229,7 +229,7 @@
229
229
  "default": true
230
230
  },
231
231
  "sourceMap": {
232
- "description": "Output source maps for scripts and styles. For more information, see https://angular.dev/reference/configs/workspace-config#source-map-configuration.",
232
+ "description": "Output source maps for scripts and styles. For more information, see https://angular.io/guide/workspace-config#source-map-configuration.",
233
233
  "default": false,
234
234
  "oneOf": [
235
235
  {
@@ -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;
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "proxyConfig": {
36
36
  "type": "string",
37
- "description": "Proxy configuration file. For more information, see https://angular.dev/tools/cli/serve#proxying-to-a-backend-server."
37
+ "description": "Proxy configuration file. For more information, see https://angular.io/guide/build#proxying-to-a-backend-server."
38
38
  },
39
39
  "ssl": {
40
40
  "type": "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"
@@ -8,7 +8,7 @@
8
8
  "examples": [
9
9
  {
10
10
  "command": "nx g @nx/angular:add-linting --prefix=cool --projectName=cool-lib --projectRoot=libs/cool-lib",
11
- "description": "Adds ESLint with Angular-specific rules for an existing project named `cool-lib` with the [prefix](https://angular.dev/style-guide#style-02-07) `cool`"
11
+ "description": "Adds ESLint with Angular-specific rules for an existing project named `cool-lib` with the [prefix](https://angular.io/guide/styleguide#style-02-07) `cool`"
12
12
  }
13
13
  ],
14
14
  "properties": {