@schematics/angular 19.2.2 → 20.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.
@@ -5,7 +5,7 @@
5
5
  "dependencies": {
6
6
  "@types/express": "^4.17.17",
7
7
  "@types/jasmine": "~5.1.0",
8
- "@types/node": "^18.18.0",
8
+ "@types/node": "^20.17.19",
9
9
  "browser-sync": "^3.0.0",
10
10
  "express": "^4.18.2",
11
11
  "jasmine-core": "~5.6.0",
@@ -16,12 +16,12 @@
16
16
  "karma-jasmine": "~5.1.0",
17
17
  "karma": "~6.4.0",
18
18
  "less": "^4.2.0",
19
- "postcss": "^8.4.38",
19
+ "postcss": "^8.5.3",
20
20
  "protractor": "~7.0.0",
21
21
  "rxjs": "~7.8.0",
22
22
  "tslib": "^2.3.0",
23
23
  "ts-node": "~10.9.0",
24
- "typescript": "~5.7.2",
24
+ "typescript": "~5.8.2",
25
25
  "zone.js": "~0.15.0"
26
26
  }
27
27
  }
@@ -14,9 +14,9 @@ const dependencies = require('./latest-versions/package.json')['dependencies'];
14
14
  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
- Angular: '^19.2.0',
18
- NgPackagr: '^19.2.0',
19
- DevkitBuildAngular: '^19.2.2',
20
- AngularBuild: '^19.2.2',
21
- AngularSSR: '^19.2.2',
17
+ Angular: '^20.0.0-next.0',
18
+ NgPackagr: '^20.0.0-next.0',
19
+ DevkitBuildAngular: '^20.0.0-next.1',
20
+ AngularBuild: '^20.0.0-next.1',
21
+ AngularSSR: '^20.0.0-next.1',
22
22
  };
@@ -11,12 +11,10 @@
11
11
  "noFallthroughCasesInSwitch": true,<% } %>
12
12
  "skipLibCheck": true,
13
13
  "isolatedModules": true,
14
- "esModuleInterop": true,
15
14
  "experimentalDecorators": true,
16
- "moduleResolution": "bundler",
17
15
  "importHelpers": true,
18
16
  "target": "ES2022",
19
- "module": "ES2022"
17
+ "module": "preserve"
20
18
  },
21
19
  "angularCompilerOptions": {
22
20
  "enableI18nLegacyMessageIdFormat": false<% if (strict) { %>,
@@ -1,15 +0,0 @@
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
- * Schematics rule that identifies and updates import declarations in TypeScript files.
11
- * Specifically, it modifies imports of '@angular/ssr' by appending '/node' if the
12
- * `CommonEngine` is used from the old entry point.
13
- *
14
- */
15
- export default function (): Rule;
@@ -1,107 +0,0 @@
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
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- exports.default = default_1;
44
- const ts = __importStar(require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
45
- const dependencies_1 = require("../../utility/dependencies");
46
- function* visit(directory) {
47
- for (const path of directory.subfiles) {
48
- if (path.endsWith('.ts') && !path.endsWith('.d.ts')) {
49
- const entry = directory.file(path);
50
- if (entry) {
51
- const content = entry.content;
52
- if (content.includes('CommonEngine') && !content.includes('@angular/ssr/node')) {
53
- const source = ts.createSourceFile(entry.path, content.toString().replace(/^\uFEFF/, ''), ts.ScriptTarget.Latest, true);
54
- yield source;
55
- }
56
- }
57
- }
58
- }
59
- for (const path of directory.subdirs) {
60
- if (path === 'node_modules' || path.startsWith('.')) {
61
- continue;
62
- }
63
- yield* visit(directory.dir(path));
64
- }
65
- }
66
- /**
67
- * Schematics rule that identifies and updates import declarations in TypeScript files.
68
- * Specifically, it modifies imports of '@angular/ssr' by appending '/node' if the
69
- * `CommonEngine` is used from the old entry point.
70
- *
71
- */
72
- function default_1() {
73
- return (tree) => {
74
- if (!(0, dependencies_1.getPackageJsonDependency)(tree, '@angular/ssr')) {
75
- return;
76
- }
77
- for (const sourceFile of visit(tree.root)) {
78
- let recorder;
79
- const allImportDeclarations = sourceFile.statements.filter((n) => ts.isImportDeclaration(n));
80
- if (allImportDeclarations.length === 0) {
81
- continue;
82
- }
83
- const ssrImports = allImportDeclarations.filter((n) => ts.isStringLiteral(n.moduleSpecifier) && n.moduleSpecifier.text === '@angular/ssr');
84
- for (const ssrImport of ssrImports) {
85
- const ssrNamedBinding = getNamedImports(ssrImport);
86
- if (ssrNamedBinding) {
87
- const isUsingOldEntryPoint = ssrNamedBinding.elements.some((e) => e.name.text.startsWith('CommonEngine'));
88
- if (!isUsingOldEntryPoint) {
89
- continue;
90
- }
91
- recorder ??= tree.beginUpdate(sourceFile.fileName);
92
- recorder.insertRight(ssrImport.moduleSpecifier.getEnd() - 1, '/node');
93
- }
94
- }
95
- if (recorder) {
96
- tree.commitUpdate(recorder);
97
- }
98
- }
99
- };
100
- }
101
- function getNamedImports(importDeclaration) {
102
- const namedBindings = importDeclaration?.importClause?.namedBindings;
103
- if (namedBindings && ts.isNamedImports(namedBindings)) {
104
- return namedBindings;
105
- }
106
- return undefined;
107
- }
@@ -1,33 +0,0 @@
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;
@@ -1,77 +0,0 @@
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
- }