@nx/angular 18.1.3 → 18.2.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017-2023 Narwhal Technologies Inc.
3
+ Copyright (c) 2017-2024 Narwhal Technologies Inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/migrations.json CHANGED
@@ -377,6 +377,15 @@
377
377
  "version": "18.1.1-beta.0",
378
378
  "description": "Ensure targetDefaults inputs for task hashing when '@nx/angular:webpack-browser' is used are correct for Module Federation.",
379
379
  "factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs"
380
+ },
381
+ "update-angular-cli-version-17-3-0": {
382
+ "cli": "nx",
383
+ "version": "18.2.0-beta.0",
384
+ "requires": {
385
+ "@angular/core": ">=17.3.0"
386
+ },
387
+ "description": "Update the @angular/cli package version to ~17.3.0.",
388
+ "factory": "./src/migrations/update-18-2-0/update-angular-cli"
380
389
  }
381
390
  },
382
391
  "packageJsonUpdates": {
@@ -1718,6 +1727,84 @@
1718
1727
  "alwaysAddToPackageJson": false
1719
1728
  }
1720
1729
  }
1730
+ },
1731
+ "18.2.0": {
1732
+ "version": "18.2.0-beta.0",
1733
+ "x-prompt": "Do you want to update the Angular version to v17.3?",
1734
+ "requires": {
1735
+ "@angular/core": ">=17.2.0 <17.3.0"
1736
+ },
1737
+ "packages": {
1738
+ "@angular-devkit/build-angular": {
1739
+ "version": "~17.3.0",
1740
+ "alwaysAddToPackageJson": false
1741
+ },
1742
+ "@angular-devkit/core": {
1743
+ "version": "~17.3.0",
1744
+ "alwaysAddToPackageJson": false
1745
+ },
1746
+ "@angular-devkit/schematics": {
1747
+ "version": "~17.3.0",
1748
+ "alwaysAddToPackageJson": false
1749
+ },
1750
+ "@angular/pwa": {
1751
+ "version": "~17.3.0",
1752
+ "alwaysAddToPackageJson": false
1753
+ },
1754
+ "@angular/ssr": {
1755
+ "version": "~17.3.0",
1756
+ "alwaysAddToPackageJson": false
1757
+ },
1758
+ "@schematics/angular": {
1759
+ "version": "~17.3.0",
1760
+ "alwaysAddToPackageJson": false
1761
+ },
1762
+ "@angular-devkit/architect": {
1763
+ "version": "~0.1703.0",
1764
+ "alwaysAddToPackageJson": false
1765
+ },
1766
+ "@angular-devkit/build-webpack": {
1767
+ "version": "~0.1703.0",
1768
+ "alwaysAddToPackageJson": false
1769
+ },
1770
+ "@angular/core": {
1771
+ "version": "~17.3.0",
1772
+ "alwaysAddToPackageJson": true
1773
+ },
1774
+ "@angular/material": {
1775
+ "version": "~17.3.0",
1776
+ "alwaysAddToPackageJson": false
1777
+ },
1778
+ "@angular/cdk": {
1779
+ "version": "~17.3.0",
1780
+ "alwaysAddToPackageJson": false
1781
+ },
1782
+ "ng-packagr": {
1783
+ "version": "~17.3.0",
1784
+ "alwaysAddToPackageJson": false
1785
+ }
1786
+ }
1787
+ },
1788
+ "18.2.0-angular-eslint": {
1789
+ "version": "18.2.0-beta.0",
1790
+ "requires": {
1791
+ "eslint": "^7.20.0 || ^8.0.0",
1792
+ "@angular/core": ">= 17.0.0 < 18.0.0"
1793
+ },
1794
+ "packages": {
1795
+ "@angular-eslint/eslint-plugin": {
1796
+ "version": "~17.3.0",
1797
+ "alwaysAddToPackageJson": false
1798
+ },
1799
+ "@angular-eslint/eslint-plugin-template": {
1800
+ "version": "~17.3.0",
1801
+ "alwaysAddToPackageJson": false
1802
+ },
1803
+ "@angular-eslint/template-parser": {
1804
+ "version": "~17.3.0",
1805
+ "alwaysAddToPackageJson": false
1806
+ }
1807
+ }
1721
1808
  }
1722
1809
  }
1723
1810
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "18.1.3",
3
+ "version": "18.2.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, 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": {
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@phenomnomnominal/tsquery": "~5.0.1",
71
- "@typescript-eslint/type-utils": "^6.9.1",
71
+ "@typescript-eslint/type-utils": "^7.3.0",
72
72
  "chalk": "^4.1.0",
73
73
  "find-cache-dir": "^3.3.2",
74
74
  "ignore": "^5.0.4",
@@ -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.1.3",
82
- "@nx/js": "18.1.3",
83
- "@nx/eslint": "18.1.3",
84
- "@nx/webpack": "18.1.3",
85
- "@nx/web": "18.1.3",
86
- "@nx/workspace": "18.1.3",
87
- "piscina": "^4.2.1",
88
- "@nrwl/angular": "18.1.3"
81
+ "@nx/devkit": "18.2.0-beta.1",
82
+ "@nx/js": "18.2.0-beta.1",
83
+ "@nx/eslint": "18.2.0-beta.1",
84
+ "@nx/webpack": "18.2.0-beta.1",
85
+ "@nx/web": "18.2.0-beta.1",
86
+ "@nx/workspace": "18.2.0-beta.1",
87
+ "piscina": "^4.4.0",
88
+ "@nrwl/angular": "18.2.0-beta.1"
89
89
  },
90
90
  "peerDependencies": {
91
91
  "@angular-devkit/build-angular": ">= 15.0.0 < 18.0.0",
@@ -1,4 +1,4 @@
1
- import { Schema } from '@angular-devkit/build-angular/src/builders/browser/schema';
1
+ import type { Schema } from '@angular-devkit/build-angular/src/builders/browser/schema';
2
2
 
3
3
  export type BrowserBuilderSchema = Schema & {
4
4
  customWebpackConfig?: {
@@ -292,8 +292,7 @@
292
292
  },
293
293
  "deployUrl": {
294
294
  "type": "string",
295
- "description": "URL where files will be deployed.",
296
- "x-deprecated": "Use `baseHref` option, `APP_BASE_HREF` DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
295
+ "description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
297
296
  },
298
297
  "verbose": {
299
298
  "type": "boolean",
@@ -517,11 +516,11 @@
517
516
  "properties": {
518
517
  "src": {
519
518
  "type": "string",
520
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
519
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
521
520
  },
522
521
  "replaceWith": {
523
522
  "type": "string",
524
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
523
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
525
524
  }
526
525
  },
527
526
  "additionalProperties": false,
@@ -532,11 +531,11 @@
532
531
  "properties": {
533
532
  "replace": {
534
533
  "type": "string",
535
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
534
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
536
535
  },
537
536
  "with": {
538
537
  "type": "string",
539
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
538
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
540
539
  }
541
540
  },
542
541
  "additionalProperties": false,
@@ -123,8 +123,7 @@
123
123
  },
124
124
  "deployUrl": {
125
125
  "type": "string",
126
- "description": "URL where files will be deployed.",
127
- "x-deprecated": "Use \"baseHref\" browser builder option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
126
+ "description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
128
127
  },
129
128
  "vendorChunk": {
130
129
  "type": "boolean",
@@ -290,11 +289,11 @@
290
289
  "properties": {
291
290
  "src": {
292
291
  "type": "string",
293
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
292
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
294
293
  },
295
294
  "replaceWith": {
296
295
  "type": "string",
297
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
296
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
298
297
  }
299
298
  },
300
299
  "additionalProperties": false,
@@ -305,11 +304,11 @@
305
304
  "properties": {
306
305
  "replace": {
307
306
  "type": "string",
308
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
307
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
309
308
  },
310
309
  "with": {
311
310
  "type": "string",
312
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
311
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
313
312
  }
314
313
  },
315
314
  "additionalProperties": false,
@@ -35,6 +35,10 @@
35
35
  "type": "string",
36
36
  "description": "The full path for the TypeScript configuration file, relative to the current workspace."
37
37
  },
38
+ "deployUrl": {
39
+ "type": "string",
40
+ "description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations. _Note: this is only supported in Angular versions >= 17.3.0_."
41
+ },
38
42
  "scripts": {
39
43
  "description": "Global scripts to be included in the build.",
40
44
  "type": "array",
@@ -612,11 +616,11 @@
612
616
  "properties": {
613
617
  "replace": {
614
618
  "type": "string",
615
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
619
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
616
620
  },
617
621
  "with": {
618
622
  "type": "string",
619
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
623
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
620
624
  }
621
625
  },
622
626
  "additionalProperties": false,
@@ -43,5 +43,10 @@ function validateOptions(options) {
43
43
  throw new Error(`The "clearScreen" option requires Angular version 17.2.0 or greater. You are currently using version ${angularVersion}.`);
44
44
  }
45
45
  }
46
+ if ((0, semver_1.lt)(angularVersion, '17.3.0')) {
47
+ if (options.deployUrl) {
48
+ throw new Error(`The "deployUrl" option requires Angular version 17.3.0 or greater. You are currently using version ${angularVersion}.`);
49
+ }
50
+ }
46
51
  }
47
52
  exports.validateOptions = validateOptions;
@@ -279,8 +279,7 @@
279
279
  },
280
280
  "deployUrl": {
281
281
  "type": "string",
282
- "description": "URL where files will be deployed.",
283
- "x-deprecated": "Use \"baseHref\" option, \"APP_BASE_HREF\" DI token or a combination of both instead. For more information, see https://angular.io/guide/deployment#the-deploy-url."
282
+ "description": "Customize the base path for the URLs of resources in 'index.html' and component stylesheets. This option is only necessary for specific deployment scenarios, such as with Angular Elements or when utilizing different CDN locations."
284
283
  },
285
284
  "verbose": {
286
285
  "type": "boolean",
@@ -519,11 +518,11 @@
519
518
  "properties": {
520
519
  "replace": {
521
520
  "type": "string",
522
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
521
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
523
522
  },
524
523
  "with": {
525
524
  "type": "string",
526
- "pattern": "\\.(([cm]?j|t)sx?|json)$"
525
+ "pattern": "\\.(([cm]?[jt])sx?|json)$"
527
526
  }
528
527
  },
529
528
  "additionalProperties": false,
@@ -80,6 +80,7 @@ class StylesheetProcessor {
80
80
  this.renderWorker = new Piscina({
81
81
  filename: require.resolve('ng-packagr/lib/styles/stylesheet-processor-worker'),
82
82
  maxThreads,
83
+ recordTiming: false,
83
84
  env: {
84
85
  ...process.env,
85
86
  FORCE_COLOR: '' + color_1.colors.enabled,
@@ -157,6 +158,7 @@ class AsyncStylesheetProcessor {
157
158
  this.renderWorker = new Piscina({
158
159
  filename: require.resolve('ng-packagr/lib/styles/stylesheet-processor-worker'),
159
160
  maxThreads,
161
+ recordTiming: false,
160
162
  env: {
161
163
  ...process.env,
162
164
  FORCE_COLOR: '' + color_1.colors.enabled,
@@ -67,7 +67,7 @@ async function convertProjectTargets(tree, projectName, angularVersion, isProvid
67
67
  warnIfProvided(`The provided project "${projectName}" is not an application. Skipping conversion.`);
68
68
  return false;
69
69
  }
70
- const { buildTargetName, serverTargetName } = getTargetsToConvert(project.targets);
70
+ const { buildTargetName, serverTargetName } = getTargetsToConvert(project.targets, angularVersion);
71
71
  if (!buildTargetName) {
72
72
  warnIfProvided(`The provided project "${projectName}" does not have any targets using on of the ` +
73
73
  `'@angular-devkit/build-angular:browser', '@angular-devkit/build-angular:browser-esbuild', ` +
@@ -125,7 +125,9 @@ async function convertProjectTargets(tree, projectName, angularVersion, isProvid
125
125
  }
126
126
  }
127
127
  // Delete removed options
128
- delete options['deployUrl'];
128
+ if ((0, semver_1.lt)(angularVersion, '17.3.0')) {
129
+ delete options['deployUrl'];
130
+ }
129
131
  delete options['vendorChunk'];
130
132
  delete options['commonChunk'];
131
133
  delete options['resourcesOutputPath'];
@@ -191,7 +193,7 @@ async function convertProjectTargets(tree, projectName, angularVersion, isProvid
191
193
  (0, devkit_1.updateProjectConfiguration)(tree, projectName, project);
192
194
  return true;
193
195
  }
194
- function getTargetsToConvert(targets) {
196
+ function getTargetsToConvert(targets, angularVersion) {
195
197
  let buildTargetName;
196
198
  let serverTargetName;
197
199
  for (const target of Object.keys(targets)) {
@@ -203,7 +205,7 @@ function getTargetsToConvert(targets) {
203
205
  // build target
204
206
  if (executorsToConvert.has(targets[target].executor)) {
205
207
  for (const [, options] of (0, targets_1.allTargetOptions)(targets[target])) {
206
- if (options.deployUrl) {
208
+ if ((0, semver_1.lt)(angularVersion, '17.3.0') && options.deployUrl) {
207
209
  devkit_1.logger.warn(`The project is using the "deployUrl" option which is not available in the application builder. Skipping conversion.`);
208
210
  return {};
209
211
  }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ export declare const angularCliVersion = "~17.3.0";
3
+ export default function (tree: Tree): Promise<void>;
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.angularCliVersion = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ exports.angularCliVersion = '~17.3.0';
6
+ async function default_1(tree) {
7
+ let shouldFormat = false;
8
+ (0, devkit_1.updateJson)(tree, 'package.json', (json) => {
9
+ if (json.devDependencies?.['@angular/cli']) {
10
+ json.devDependencies['@angular/cli'] = exports.angularCliVersion;
11
+ shouldFormat = true;
12
+ }
13
+ else if (json.dependencies?.['@angular/cli']) {
14
+ json.dependencies['@angular/cli'] = exports.angularCliVersion;
15
+ shouldFormat = true;
16
+ }
17
+ return json;
18
+ });
19
+ if (shouldFormat) {
20
+ await (0, devkit_1.formatFiles)(tree);
21
+ }
22
+ }
23
+ exports.default = default_1;
@@ -1,7 +1,7 @@
1
1
  export declare const nxVersion: any;
2
- export declare const angularVersion = "~17.2.0";
3
- export declare const angularDevkitVersion = "~17.2.0";
4
- export declare const ngPackagrVersion = "~17.2.0";
2
+ export declare const angularVersion = "~17.3.0";
3
+ export declare const angularDevkitVersion = "~17.3.0";
4
+ export declare const ngPackagrVersion = "~17.3.0";
5
5
  export declare const ngrxVersion = "~17.0.0";
6
6
  export declare const rxjsVersion = "~7.8.0";
7
7
  export declare const zoneJsVersion = "~0.14.3";
@@ -13,7 +13,7 @@ export declare const expressVersion = "~4.18.2";
13
13
  export declare const typesExpressVersion = "4.17.14";
14
14
  export declare const browserSyncVersion = "^3.0.0";
15
15
  export declare const moduleFederationNodeVersion = "~1.0.5";
16
- export declare const angularEslintVersion = "~17.0.0";
16
+ export declare const angularEslintVersion = "~17.3.0";
17
17
  export declare const tailwindVersion = "^3.0.2";
18
18
  export declare const postcssVersion = "^8.4.5";
19
19
  export declare const postcssUrlVersion = "~10.1.3";
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.angularEslintVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
- exports.angularVersion = '~17.2.0';
6
- exports.angularDevkitVersion = '~17.2.0';
7
- exports.ngPackagrVersion = '~17.2.0';
5
+ exports.angularVersion = '~17.3.0';
6
+ exports.angularDevkitVersion = '~17.3.0';
7
+ exports.ngPackagrVersion = '~17.3.0';
8
8
  exports.ngrxVersion = '~17.0.0';
9
9
  exports.rxjsVersion = '~7.8.0';
10
10
  exports.zoneJsVersion = '~0.14.3';
@@ -16,7 +16,7 @@ exports.expressVersion = '~4.18.2';
16
16
  exports.typesExpressVersion = '4.17.14';
17
17
  exports.browserSyncVersion = '^3.0.0';
18
18
  exports.moduleFederationNodeVersion = '~1.0.5';
19
- exports.angularEslintVersion = '~17.0.0';
19
+ exports.angularEslintVersion = '~17.3.0';
20
20
  exports.tailwindVersion = '^3.0.2';
21
21
  exports.postcssVersion = '^8.4.5';
22
22
  exports.postcssUrlVersion = '~10.1.3';