@schematics/angular 19.0.0-next.0 → 19.0.0-next.1

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.
@@ -164,8 +164,8 @@ function addAppToWorkspaceFile(options, appDir, folderName) {
164
164
  },
165
165
  {
166
166
  type: 'anyComponentStyle',
167
- maximumWarning: '2kB',
168
- maximumError: '4kB',
167
+ maximumWarning: '4kB',
168
+ maximumError: '8kB',
169
169
  },
170
170
  ];
171
171
  }
@@ -1,11 +1,16 @@
1
1
  {
2
2
  "schematics": {
3
3
  "use-application-builder": {
4
- "version": "18.0.0",
4
+ "version": "19.0.0",
5
5
  "factory": "./use-application-builder/migration",
6
6
  "description": "Migrate application projects to the new build system. Application projects that are using the '@angular-devkit/build-angular' package's 'browser' and/or 'browser-esbuild' builders will be migrated to use the new 'application' builder. You can read more about this, including known issues and limitations, here: https://angular.dev/tools/cli/build-system-migration",
7
7
  "optional": true,
8
8
  "documentation": "tools/cli/build-system-migration"
9
+ },
10
+ "update-workspace-config": {
11
+ "version": "19.0.0",
12
+ "factory": "./update-workspace-config/migration",
13
+ "description": "Update the workspace configuration by replacing deprecated options in 'angular.json' for compatibility with the latest Angular CLI changes."
9
14
  }
10
15
  }
11
16
  }
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { Rule } from '@angular-devkit/schematics';
9
+ /**
10
+ * Main entry point for the migration rule.
11
+ *
12
+ * This schematic migration performs updates to the Angular workspace configuration
13
+ * to ensure that application projects are properly configured with polyfills
14
+ * required for internationalization (`localize`).
15
+ *
16
+ * It specifically targets application projects that use either the `application`
17
+ * or `browser-esbuild` builders.
18
+ *
19
+ * The migration process involves:
20
+ *
21
+ * 1. Iterating over all projects in the workspace.
22
+ * 2. Checking each project to determine if it is an application-type project.
23
+ * 3. For each application project, examining the associated build targets.
24
+ * 4. If a build target's `localize` option is enabled but the polyfill
25
+ * `@angular/localize/init` is missing from the `polyfills` array, the polyfill
26
+ * is automatically added to ensure proper internationalization support.
27
+ *
28
+ * Additionally, this migration updates projects that use the `dev-server` or `extract-i18n`
29
+ * builders to ensure that deprecated `browserTarget` options are migrated to the
30
+ * newer `buildTarget` field.
31
+ *
32
+ */
33
+ export default function (): Rule;
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.default = default_1;
11
+ const workspace_1 = require("../../utility/workspace");
12
+ const workspace_models_1 = require("../../utility/workspace-models");
13
+ /**
14
+ * Main entry point for the migration rule.
15
+ *
16
+ * This schematic migration performs updates to the Angular workspace configuration
17
+ * to ensure that application projects are properly configured with polyfills
18
+ * required for internationalization (`localize`).
19
+ *
20
+ * It specifically targets application projects that use either the `application`
21
+ * or `browser-esbuild` builders.
22
+ *
23
+ * The migration process involves:
24
+ *
25
+ * 1. Iterating over all projects in the workspace.
26
+ * 2. Checking each project to determine if it is an application-type project.
27
+ * 3. For each application project, examining the associated build targets.
28
+ * 4. If a build target's `localize` option is enabled but the polyfill
29
+ * `@angular/localize/init` is missing from the `polyfills` array, the polyfill
30
+ * is automatically added to ensure proper internationalization support.
31
+ *
32
+ * Additionally, this migration updates projects that use the `dev-server` or `extract-i18n`
33
+ * builders to ensure that deprecated `browserTarget` options are migrated to the
34
+ * newer `buildTarget` field.
35
+ *
36
+ */
37
+ function default_1() {
38
+ return (0, workspace_1.updateWorkspace)((workspace) => {
39
+ for (const project of workspace.projects.values()) {
40
+ if (project.extensions.projectType !== workspace_models_1.ProjectType.Application) {
41
+ continue;
42
+ }
43
+ for (const target of project.targets.values()) {
44
+ if (target.builder === workspace_models_1.Builders.DevServer || target.builder === workspace_models_1.Builders.ExtractI18n) {
45
+ // Migrate `browserTarget` to `buildTarget`
46
+ for (const [, options] of (0, workspace_1.allTargetOptions)(target, false)) {
47
+ if (options['browserTarget'] && !options['buildTarget']) {
48
+ options['buildTarget'] = options['browserTarget'];
49
+ }
50
+ delete options['browserTarget'];
51
+ }
52
+ }
53
+ // Check if the target uses application-related builders
54
+ if (target.builder !== workspace_models_1.Builders.BuildApplication &&
55
+ target.builder !== workspace_models_1.Builders.Application &&
56
+ target.builder !== workspace_models_1.Builders.BrowserEsbuild) {
57
+ continue;
58
+ }
59
+ // Check if polyfills include '@angular/localize/init'
60
+ const polyfills = target.options?.['polyfills'];
61
+ if (Array.isArray(polyfills) &&
62
+ polyfills.some((polyfill) => typeof polyfill === 'string' && polyfill.startsWith('@angular/localize'))) {
63
+ // Skip if the polyfill is already present
64
+ continue;
65
+ }
66
+ // Add '@angular/localize/init' polyfill if localize option is enabled
67
+ for (const [, options] of (0, workspace_1.allTargetOptions)(target, false)) {
68
+ if (options['localize']) {
69
+ target.options ??= {};
70
+ (target.options['polyfills'] ??= []).push('@angular/localize/init');
71
+ break;
72
+ }
73
+ }
74
+ }
75
+ }
76
+ });
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematics/angular",
3
- "version": "19.0.0-next.0",
3
+ "version": "19.0.0-next.1",
4
4
  "description": "Schematics specific to Angular",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "keywords": [
@@ -22,8 +22,8 @@
22
22
  },
23
23
  "schematics": "./collection.json",
24
24
  "dependencies": {
25
- "@angular-devkit/core": "19.0.0-next.0",
26
- "@angular-devkit/schematics": "19.0.0-next.0",
25
+ "@angular-devkit/core": "19.0.0-next.1",
26
+ "@angular-devkit/schematics": "19.0.0-next.1",
27
27
  "jsonc-parser": "3.3.1"
28
28
  },
29
29
  "packageManager": "yarn@4.4.0",
@@ -24,6 +24,6 @@
24
24
  "tslib": "^2.3.0",
25
25
  "ts-node": "~10.9.0",
26
26
  "typescript": "~5.5.2",
27
- "zone.js": "~0.14.3"
27
+ "zone.js": "~0.15.0"
28
28
  }
29
29
  }
@@ -15,6 +15,6 @@ exports.latestVersions = {
15
15
  ...dependencies,
16
16
  // As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
17
17
  Angular: dependencies['@angular/core'],
18
- DevkitBuildAngular: '^19.0.0-next.0',
19
- AngularSSR: '^19.0.0-next.0',
18
+ DevkitBuildAngular: '^19.0.0-next.1',
19
+ AngularSSR: '^19.0.0-next.1',
20
20
  };
@@ -67,11 +67,7 @@ export interface BrowserBuilderOptions extends BrowserBuilderBaseOptions {
67
67
  webWorkerTsConfig?: string;
68
68
  }
69
69
  export interface ServeBuilderOptions {
70
- /**
71
- * @deprecated not used since version 17.0.0. Use the property "buildTarget" instead.
72
- */
73
- browserTarget: string;
74
- buildTarget?: string;
70
+ buildTarget: string;
75
71
  }
76
72
  export interface LibraryBuilderOptions {
77
73
  tsConfig: string;
@@ -12,8 +12,6 @@
12
12
  "skipLibCheck": true,
13
13
  "isolatedModules": true,
14
14
  "esModuleInterop": true,
15
- "sourceMap": true,
16
- "declaration": false,
17
15
  "experimentalDecorators": true,
18
16
  "moduleResolution": "bundler",
19
17
  "importHelpers": true,