@angular/core 20.0.0-next.1 → 20.0.0-next.2

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.
Files changed (52) hide show
  1. package/fesm2022/core.mjs +374 -1796
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/di.mjs +1 -1
  4. package/fesm2022/primitives/di.mjs.map +1 -1
  5. package/fesm2022/primitives/event-dispatch.mjs +2 -589
  6. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  7. package/fesm2022/primitives/signals.mjs +18 -8
  8. package/fesm2022/primitives/signals.mjs.map +1 -1
  9. package/fesm2022/rxjs-interop.mjs +7 -32
  10. package/fesm2022/rxjs-interop.mjs.map +1 -1
  11. package/fesm2022/testing.mjs +119 -138
  12. package/fesm2022/testing.mjs.map +1 -1
  13. package/fesm2022/weak_ref-DrMdAIDh.mjs +12 -0
  14. package/fesm2022/weak_ref-DrMdAIDh.mjs.map +1 -0
  15. package/index.d.ts +14343 -15225
  16. package/navigation_types.d-u4EOrrdZ.d.ts +121 -0
  17. package/package.json +2 -2
  18. package/primitives/di/index.d.ts +42 -50
  19. package/primitives/event-dispatch/index.d.ts +205 -309
  20. package/primitives/signals/index.d.ts +158 -195
  21. package/rxjs-interop/index.d.ts +71 -91
  22. package/schematics/bundles/{apply_import_manager-e2a7fe5b.js → apply_import_manager-CyRT0UvU.js} +12 -16
  23. package/schematics/bundles/{checker-af521da6.js → checker-DF8ZaFW5.js} +3084 -1122
  24. package/schematics/bundles/cleanup-unused-imports.js +21 -27
  25. package/schematics/bundles/{compiler_host-5a29293c.js → compiler_host-Da636uJ8.js} +19 -23
  26. package/schematics/bundles/control-flow-migration.js +81 -38
  27. package/schematics/bundles/{imports-047fbbc8.js → imports-CIX-JgAN.js} +9 -14
  28. package/schematics/bundles/{index-1bef3025.js → index-DnkWgagp.js} +55 -59
  29. package/schematics/bundles/{index-ef1bffbb.js → index-vGJcp5M7.js} +4 -4
  30. package/schematics/bundles/inject-flags.js +181 -0
  31. package/schematics/bundles/inject-migration.js +121 -127
  32. package/schematics/bundles/{leading_space-f8944434.js → leading_space-D9nQ8UQC.js} +1 -1
  33. package/schematics/bundles/{migrate_ts_type_references-2a3e9e6b.js → migrate_ts_type_references-DtkOnnv0.js} +106 -111
  34. package/schematics/bundles/{ng_decorators-b0d8b324.js → ng_decorators-DznZ5jMl.js} +4 -8
  35. package/schematics/bundles/{nodes-7758dbf6.js → nodes-B16H9JUd.js} +2 -6
  36. package/schematics/bundles/output-migration.js +39 -45
  37. package/schematics/bundles/{program-a449f9bf.js → program-BZk27Ndu.js} +844 -2651
  38. package/schematics/bundles/{project_paths-17dc204d.js → project_paths-Jtbi76Bs.js} +25 -23
  39. package/schematics/bundles/{project_tsconfig_paths-b558633b.js → project_tsconfig_paths-CDVxT6Ov.js} +1 -1
  40. package/schematics/bundles/{property_name-ac18447e.js → property_name-BBwFuqMe.js} +3 -7
  41. package/schematics/bundles/route-lazy-loading.js +35 -41
  42. package/schematics/bundles/self-closing-tags-migration.js +19 -25
  43. package/schematics/bundles/signal-input-migration.js +60 -67
  44. package/schematics/bundles/signal-queries-migration.js +47 -54
  45. package/schematics/bundles/signals.js +9 -11
  46. package/schematics/bundles/standalone-migration.js +178 -184
  47. package/schematics/migrations.json +4 -15
  48. package/testing/index.d.ts +289 -469
  49. package/weak_ref.d-ttyj86RV.d.ts +9 -0
  50. package/schematics/bundles/explicit-standalone-flag.js +0 -184
  51. package/schematics/bundles/pending-tasks.js +0 -103
  52. package/schematics/bundles/provide-initializer.js +0 -186
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.1
3
+ * @license Angular v20.0.0-next.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -10,14 +10,11 @@ var core = require('@angular-devkit/core');
10
10
  var posixPath = require('node:path/posix');
11
11
  var os = require('os');
12
12
  var ts = require('typescript');
13
- var checker = require('./checker-af521da6.js');
14
- var program = require('./program-a449f9bf.js');
13
+ var checker = require('./checker-DF8ZaFW5.js');
14
+ var program = require('./program-BZk27Ndu.js');
15
15
  require('path');
16
16
 
17
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
-
19
- function _interopNamespace(e) {
20
- if (e && e.__esModule) return e;
17
+ function _interopNamespaceDefault(e) {
21
18
  var n = Object.create(null);
22
19
  if (e) {
23
20
  Object.keys(e).forEach(function (k) {
@@ -30,13 +27,12 @@ function _interopNamespace(e) {
30
27
  }
31
28
  });
32
29
  }
33
- n["default"] = e;
30
+ n.default = e;
34
31
  return Object.freeze(n);
35
32
  }
36
33
 
37
- var posixPath__namespace = /*#__PURE__*/_interopNamespace(posixPath);
38
- var os__namespace = /*#__PURE__*/_interopNamespace(os);
39
- var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
34
+ var posixPath__namespace = /*#__PURE__*/_interopNamespaceDefault(posixPath);
35
+ var os__namespace = /*#__PURE__*/_interopNamespaceDefault(os);
40
36
 
41
37
  /// <reference types="node" />
42
38
  class NgtscCompilerHost {
@@ -49,11 +45,11 @@ class NgtscCompilerHost {
49
45
  getSourceFile(fileName, languageVersion) {
50
46
  const text = this.readFile(fileName);
51
47
  return text !== undefined
52
- ? ts__default["default"].createSourceFile(fileName, text, languageVersion, true)
48
+ ? ts.createSourceFile(fileName, text, languageVersion, true)
53
49
  : undefined;
54
50
  }
55
51
  getDefaultLibFileName(options) {
56
- return this.fs.join(this.getDefaultLibLocation(), ts__default["default"].getDefaultLibFileName(options));
52
+ return this.fs.join(this.getDefaultLibLocation(), ts.getDefaultLibFileName(options));
57
53
  }
58
54
  getDefaultLibLocation() {
59
55
  return this.fs.getDefaultLibLocation();
@@ -74,9 +70,9 @@ class NgtscCompilerHost {
74
70
  }
75
71
  getNewLine() {
76
72
  switch (this.options.newLine) {
77
- case ts__default["default"].NewLineKind.CarriageReturnLineFeed:
73
+ case ts.NewLineKind.CarriageReturnLineFeed:
78
74
  return '\r\n';
79
- case ts__default["default"].NewLineKind.LineFeed:
75
+ case ts.NewLineKind.LineFeed:
80
76
  return '\n';
81
77
  default:
82
78
  return os__namespace.EOL;
@@ -99,17 +95,23 @@ class NgtscCompilerHost {
99
95
  }
100
96
 
101
97
  // We use TypeScript's native `ts.matchFiles` utility for the virtual file systems
98
+ // and their TypeScript compiler host `readDirectory` implementation. TypeScript's
99
+ // function implements complex logic for matching files with respect to root
100
+ // directory, extensions, excludes, includes etc. The function is currently
101
+ // internal but we can use it as the API most likely will not change any time soon,
102
+ // nor does it seem like this is being made public any time soon.
103
+ // Related issue for tracking: https://github.com/microsoft/TypeScript/issues/13793.
102
104
  /**
103
105
  * Creates a {@link ts.CompilerHost#readDirectory} implementation function,
104
106
  * that leverages the specified file system (that may be e.g. virtual).
105
107
  */
106
108
  function createFileSystemTsReadDirectoryFn(fs) {
107
- if (ts__default["default"].matchFiles === undefined) {
109
+ if (ts.matchFiles === undefined) {
108
110
  throw Error('Unable to read directory in configured file system. This means that ' +
109
111
  'TypeScript changed its file matching internals.\n\nPlease consider downgrading your ' +
110
112
  'TypeScript version, and report an issue in the Angular framework repository.');
111
113
  }
112
- const matchFilesFn = ts__default["default"].matchFiles.bind(ts__default["default"]);
114
+ const matchFilesFn = ts.matchFiles.bind(ts);
113
115
  return (rootDir, extensions, excludes, includes, depth) => {
114
116
  const directoryExists = (p) => {
115
117
  const resolvedPath = fs.resolve(p);
@@ -148,7 +150,7 @@ function calcProjectFileAndBasePath(project, host = checker.getFileSystem()) {
148
150
  function readConfiguration(project, existingOptions, host = checker.getFileSystem()) {
149
151
  try {
150
152
  const fs = checker.getFileSystem();
151
- const readConfigFile = (configFile) => ts__default["default"].readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
153
+ const readConfigFile = (configFile) => ts.readConfigFile(configFile, (file) => host.readFile(host.resolve(file)));
152
154
  const readAngularCompilerOptions = (configFile, parentOptions = {}) => {
153
155
  const { config, error } = readConfigFile(configFile);
154
156
  if (error) {
@@ -195,7 +197,7 @@ function readConfiguration(project, existingOptions, host = checker.getFileSyste
195
197
  ...existingOptions,
196
198
  };
197
199
  const parseConfigHost = createParseConfigHost(host, fs);
198
- const { options, errors, fileNames: rootNames, projectReferences, } = ts__default["default"].parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
200
+ const { options, errors, fileNames: rootNames, projectReferences, } = ts.parseJsonConfigFileContent(config, parseConfigHost, basePath, existingCompilerOptions, configFileName);
199
201
  let emitFlags = program.EmitFlags.Default;
200
202
  if (!(options['skipMetadataEmit'] || options['flatModuleOutFile'])) {
201
203
  emitFlags |= program.EmitFlags.Metadata;
@@ -208,7 +210,7 @@ function readConfiguration(project, existingOptions, host = checker.getFileSyste
208
210
  catch (e) {
209
211
  const errors = [
210
212
  {
211
- category: ts__default["default"].DiagnosticCategory.Error,
213
+ category: ts.DiagnosticCategory.Error,
212
214
  messageText: e.stack ?? e.message,
213
215
  file: undefined,
214
216
  start: undefined,
@@ -248,7 +250,7 @@ function getExtendedConfigPathWorker(configFile, extendsValue, host, fs) {
248
250
  else {
249
251
  const parseConfigHost = createParseConfigHost(host, fs);
250
252
  // Path isn't a rooted or relative path, resolve like a module.
251
- const { resolvedModule } = ts__default["default"].nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts__default["default"].ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
253
+ const { resolvedModule } = ts.nodeModuleNameResolver(extendsValue, configFile, { moduleResolution: ts.ModuleResolutionKind.Node10, resolveJsonModule: true }, parseConfigHost);
252
254
  if (resolvedModule) {
253
255
  return checker.absoluteFrom(resolvedModule.resolvedFileName);
254
256
  }
@@ -464,7 +466,7 @@ const defaultMigrationTsOptions = {
464
466
  * Creates an instance of a TypeScript program for the given project.
465
467
  */
466
468
  function createPlainTsProgram(tsHost, tsconfig, optionOverrides) {
467
- const program = ts__default["default"].createProgram({
469
+ const program = ts.createProgram({
468
470
  rootNames: tsconfig.rootNames,
469
471
  options: {
470
472
  ...tsconfig.options,
@@ -493,7 +495,7 @@ function createNgtscProgram(tsHost, tsconfig, optionOverrides) {
493
495
  }, tsHost);
494
496
  // Expose an easy way to debug-print ng semantic diagnostics.
495
497
  if (process.env['DEBUG_NG_SEMANTIC_DIAGNOSTICS'] === '1') {
496
- console.error(ts__default["default"].formatDiagnosticsWithColorAndContext(ngtscProgram.getNgSemanticDiagnostics(), tsHost));
498
+ console.error(ts.formatDiagnosticsWithColorAndContext(ngtscProgram.getNgSemanticDiagnostics(), tsHost));
497
499
  }
498
500
  return {
499
501
  ngCompiler: ngtscProgram.compiler,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.1
3
+ * @license Angular v20.0.0-next.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.1
3
+ * @license Angular v20.0.0-next.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,23 +8,19 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
 
11
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
-
13
- var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
14
-
15
11
  /**
16
12
  * Gets the text of the given property name. Returns null if the property
17
13
  * name couldn't be determined statically.
18
14
  */
19
15
  function getPropertyNameText(node) {
20
- if (ts__default["default"].isIdentifier(node) || ts__default["default"].isStringLiteralLike(node)) {
16
+ if (ts.isIdentifier(node) || ts.isStringLiteralLike(node)) {
21
17
  return node.text;
22
18
  }
23
19
  return null;
24
20
  }
25
21
  /** Finds a property with a specific name in an object literal expression. */
26
22
  function findLiteralProperty(literal, name) {
27
- return literal.properties.find((prop) => prop.name && ts__default["default"].isIdentifier(prop.name) && prop.name.text === name);
23
+ return literal.properties.find((prop) => prop.name && ts.isIdentifier(prop.name) && prop.name.text === name);
28
24
  }
29
25
 
30
26
  exports.findLiteralProperty = findLiteralProperty;
@@ -1,30 +1,24 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.1
3
+ * @license Angular v20.0.0-next.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- Object.defineProperty(exports, '__esModule', { value: true });
10
-
11
9
  var schematics = require('@angular-devkit/schematics');
12
10
  var fs = require('fs');
13
11
  var p = require('path');
14
- var compiler_host = require('./compiler_host-5a29293c.js');
15
- var project_tsconfig_paths = require('./project_tsconfig_paths-b558633b.js');
12
+ var compiler_host = require('./compiler_host-Da636uJ8.js');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
16
14
  var ts = require('typescript');
17
- var checker = require('./checker-af521da6.js');
18
- var property_name = require('./property_name-ac18447e.js');
15
+ var checker = require('./checker-DF8ZaFW5.js');
16
+ var property_name = require('./property_name-BBwFuqMe.js');
19
17
  require('os');
20
18
  require('@angular-devkit/core');
21
19
  require('module');
22
20
  require('url');
23
21
 
24
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
-
26
- var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
27
-
28
22
  /**
29
23
  * Finds the class declaration that is being referred to by a node.
30
24
  * @param reference Node referring to a class declaration.
@@ -34,7 +28,7 @@ function findClassDeclaration(reference, typeChecker) {
34
28
  return (typeChecker
35
29
  .getTypeAtLocation(reference)
36
30
  .getSymbol()
37
- ?.declarations?.find(ts__default["default"].isClassDeclaration) || null);
31
+ ?.declarations?.find(ts.isClassDeclaration) || null);
38
32
  }
39
33
 
40
34
  /*!
@@ -59,7 +53,7 @@ function isStandaloneComponent(node, reflector) {
59
53
  return false;
60
54
  }
61
55
  const arg = decorator.args[0];
62
- if (ts__default["default"].isObjectLiteralExpression(arg)) {
56
+ if (ts.isObjectLiteralExpression(arg)) {
63
57
  const property = property_name.findLiteralProperty(arg, 'standalone');
64
58
  if (property) {
65
59
  return property.initializer.getText() === 'true';
@@ -76,7 +70,7 @@ function isStandaloneComponent(node, reflector) {
76
70
  * @param typeChecker
77
71
  */
78
72
  function isAngularRoutesArray(node, typeChecker) {
79
- if (ts__default["default"].isVariableDeclaration(node)) {
73
+ if (ts.isVariableDeclaration(node)) {
80
74
  const type = typeChecker.getTypeAtLocation(node);
81
75
  if (type && typeChecker.isArrayType(type)) {
82
76
  // Route[] is an array type
@@ -97,7 +91,7 @@ function isAngularRoutesArray(node, typeChecker) {
97
91
  * - RouterModule.forChild(routes)
98
92
  */
99
93
  function isRouterModuleCallExpression(node, typeChecker) {
100
- if (ts__default["default"].isPropertyAccessExpression(node.expression)) {
94
+ if (ts.isPropertyAccessExpression(node.expression)) {
101
95
  const propAccess = node.expression;
102
96
  const moduleSymbol = typeChecker.getSymbolAtLocation(propAccess.expression);
103
97
  return (moduleSymbol?.name === 'RouterModule' &&
@@ -110,8 +104,8 @@ function isRouterModuleCallExpression(node, typeChecker) {
110
104
  * Example: this.router.resetConfig(routes)
111
105
  */
112
106
  function isRouterCallExpression(node, typeChecker) {
113
- if (ts__default["default"].isCallExpression(node) &&
114
- ts__default["default"].isPropertyAccessExpression(node.expression) &&
107
+ if (ts.isCallExpression(node) &&
108
+ ts.isPropertyAccessExpression(node.expression) &&
115
109
  node.expression.name.text === 'resetConfig') {
116
110
  const calleeExpression = node.expression.expression;
117
111
  const symbol = typeChecker.getSymbolAtLocation(calleeExpression);
@@ -128,7 +122,7 @@ function isRouterCallExpression(node, typeChecker) {
128
122
  * Example: provideRoutes(routes)
129
123
  */
130
124
  function isRouterProviderCallExpression(node, typeChecker) {
131
- if (ts__default["default"].isIdentifier(node.expression)) {
125
+ if (ts.isIdentifier(node.expression)) {
132
126
  const moduleSymbol = typeChecker.getSymbolAtLocation(node.expression);
133
127
  return moduleSymbol && moduleSymbol.name === 'provideRoutes';
134
128
  }
@@ -139,7 +133,7 @@ function isRouterProviderCallExpression(node, typeChecker) {
139
133
  * Example: provideRouter(routes)
140
134
  */
141
135
  function isProvideRoutesCallExpression(node, typeChecker) {
142
- if (ts__default["default"].isIdentifier(node.expression)) {
136
+ if (ts.isIdentifier(node.expression)) {
143
137
  const moduleSymbol = typeChecker.getSymbolAtLocation(node.expression);
144
138
  return moduleSymbol && moduleSymbol.name === 'provideRouter';
145
139
  }
@@ -161,7 +155,7 @@ function isProvideRoutesCallExpression(node, typeChecker) {
161
155
  function migrateFileToLazyRoutes(sourceFile, program) {
162
156
  const typeChecker = program.getTypeChecker();
163
157
  const reflector = new checker.TypeScriptReflectionHost(typeChecker);
164
- const printer = ts__default["default"].createPrinter();
158
+ const printer = ts.createPrinter();
165
159
  const tracker = new compiler_host.ChangeTracker(printer);
166
160
  const routeArraysToMigrate = findRoutesArrayToMigrate(sourceFile, typeChecker);
167
161
  if (routeArraysToMigrate.length === 0) {
@@ -178,14 +172,14 @@ function migrateFileToLazyRoutes(sourceFile, program) {
178
172
  function findRoutesArrayToMigrate(sourceFile, typeChecker) {
179
173
  const routesArrays = [];
180
174
  sourceFile.forEachChild(function walk(node) {
181
- if (ts__default["default"].isCallExpression(node)) {
175
+ if (ts.isCallExpression(node)) {
182
176
  if (isRouterModuleCallExpression(node, typeChecker) ||
183
177
  isRouterProviderCallExpression(node, typeChecker) ||
184
178
  isRouterCallExpression(node, typeChecker) ||
185
179
  isProvideRoutesCallExpression(node, typeChecker)) {
186
180
  const arg = node.arguments[0]; // ex: RouterModule.forRoot(routes) or provideRouter(routes)
187
- const routeFileImports = sourceFile.statements.filter(ts__default["default"].isImportDeclaration);
188
- if (ts__default["default"].isArrayLiteralExpression(arg) && arg.elements.length > 0) {
181
+ const routeFileImports = sourceFile.statements.filter(ts.isImportDeclaration);
182
+ if (ts.isArrayLiteralExpression(arg) && arg.elements.length > 0) {
189
183
  // ex: inline routes array: RouterModule.forRoot([{ path: 'test', component: TestComponent }])
190
184
  routesArrays.push({
191
185
  routeFilePath: sourceFile.fileName,
@@ -193,16 +187,16 @@ function findRoutesArrayToMigrate(sourceFile, typeChecker) {
193
187
  routeFileImports,
194
188
  });
195
189
  }
196
- else if (ts__default["default"].isIdentifier(arg)) {
190
+ else if (ts.isIdentifier(arg)) {
197
191
  // ex: reference to routes array: RouterModule.forRoot(routes)
198
192
  // RouterModule.forRoot(routes), provideRouter(routes), provideRoutes(routes)
199
193
  const symbol = typeChecker.getSymbolAtLocation(arg);
200
194
  if (!symbol?.declarations)
201
195
  return;
202
196
  for (const declaration of symbol.declarations) {
203
- if (ts__default["default"].isVariableDeclaration(declaration)) {
197
+ if (ts.isVariableDeclaration(declaration)) {
204
198
  const initializer = declaration.initializer;
205
- if (initializer && ts__default["default"].isArrayLiteralExpression(initializer)) {
199
+ if (initializer && ts.isArrayLiteralExpression(initializer)) {
206
200
  // ex: const routes = [{ path: 'test', component: TestComponent }];
207
201
  routesArrays.push({
208
202
  routeFilePath: sourceFile.fileName,
@@ -215,11 +209,11 @@ function findRoutesArrayToMigrate(sourceFile, typeChecker) {
215
209
  }
216
210
  }
217
211
  }
218
- if (ts__default["default"].isVariableDeclaration(node)) {
212
+ if (ts.isVariableDeclaration(node)) {
219
213
  if (isAngularRoutesArray(node, typeChecker)) {
220
214
  const initializer = node.initializer;
221
215
  if (initializer &&
222
- ts__default["default"].isArrayLiteralExpression(initializer) &&
216
+ ts.isArrayLiteralExpression(initializer) &&
223
217
  initializer.elements.length > 0) {
224
218
  // ex: const routes: Routes = [{ path: 'test', component: TestComponent }];
225
219
  if (routesArrays.find((x) => x.array === initializer)) {
@@ -229,7 +223,7 @@ function findRoutesArrayToMigrate(sourceFile, typeChecker) {
229
223
  routesArrays.push({
230
224
  routeFilePath: sourceFile.fileName,
231
225
  array: initializer,
232
- routeFileImports: sourceFile.statements.filter(ts__default["default"].isImportDeclaration),
226
+ routeFileImports: sourceFile.statements.filter(ts.isImportDeclaration),
233
227
  });
234
228
  }
235
229
  }
@@ -245,7 +239,7 @@ function migrateRoutesArray(routesArray, typeChecker, reflector, tracker) {
245
239
  const importsToRemove = [];
246
240
  for (const route of routesArray) {
247
241
  route.array.elements.forEach((element) => {
248
- if (ts__default["default"].isObjectLiteralExpression(element)) {
242
+ if (ts.isObjectLiteralExpression(element)) {
249
243
  const { migratedRoutes: migrated, skippedRoutes: toBeSkipped, importsToRemove: toBeRemoved, } = migrateRoute(element, route, typeChecker, reflector, tracker);
250
244
  migratedRoutes.push(...migrated);
251
245
  skippedRoutes.push(...toBeSkipped);
@@ -271,9 +265,9 @@ function migrateRoute(element, route, typeChecker, reflector, tracker) {
271
265
  const routePath = property_name.findLiteralProperty(element, 'path')?.getText() ?? '';
272
266
  const children = property_name.findLiteralProperty(element, 'children');
273
267
  // recursively migrate children routes first if they exist
274
- if (children && ts__default["default"].isArrayLiteralExpression(children.initializer)) {
268
+ if (children && ts.isArrayLiteralExpression(children.initializer)) {
275
269
  for (const childRoute of children.initializer.elements) {
276
- if (ts__default["default"].isObjectLiteralExpression(childRoute)) {
270
+ if (ts.isObjectLiteralExpression(childRoute)) {
277
271
  const { migratedRoutes: migrated, skippedRoutes: toBeSkipped, importsToRemove: toBeRemoved, } = migrateRoute(childRoute, route, typeChecker, reflector, tracker);
278
272
  migratedRoutes.push(...migrated);
279
273
  skippedRoutes.push(...toBeSkipped);
@@ -294,7 +288,7 @@ function migrateRoute(element, route, typeChecker, reflector, tracker) {
294
288
  skippedRoutes.push({ path: routePath, file: route.routeFilePath });
295
289
  return routeMigrationResults;
296
290
  }
297
- const componentClassName = componentDeclaration.name && ts__default["default"].isIdentifier(componentDeclaration.name)
291
+ const componentClassName = componentDeclaration.name && ts.isIdentifier(componentDeclaration.name)
298
292
  ? componentDeclaration.name.text
299
293
  : null;
300
294
  if (!componentClassName) {
@@ -306,7 +300,7 @@ function migrateRoute(element, route, typeChecker, reflector, tracker) {
306
300
  }
307
301
  const componentImport = route.routeFileImports.find((importDecl) => importDecl.importClause?.getText().includes(componentClassName));
308
302
  // remove single and double quotes from the import path
309
- let componentImportPath = ts__default["default"].isStringLiteral(componentImport?.moduleSpecifier)
303
+ let componentImportPath = ts.isStringLiteral(componentImport?.moduleSpecifier)
310
304
  ? componentImport.moduleSpecifier.text
311
305
  : null;
312
306
  // if the import path is not a string literal, skip it
@@ -314,7 +308,7 @@ function migrateRoute(element, route, typeChecker, reflector, tracker) {
314
308
  skippedRoutes.push({ path: routePath, file: route.routeFilePath });
315
309
  return routeMigrationResults;
316
310
  }
317
- const isDefaultExport = componentDeclaration.modifiers?.some((x) => x.kind === ts__default["default"].SyntaxKind.DefaultKeyword) ?? false;
311
+ const isDefaultExport = componentDeclaration.modifiers?.some((x) => x.kind === ts.SyntaxKind.DefaultKeyword) ?? false;
318
312
  const loadComponent = createLoadComponentPropertyAssignment(componentImportPath, componentClassName, isDefaultExport);
319
313
  tracker.replaceNode(component, loadComponent);
320
314
  // Add the import statement for the standalone component
@@ -334,18 +328,18 @@ function migrateRoute(element, route, typeChecker, reflector, tracker) {
334
328
  * loadComponent: () => import('./path') // when isDefaultExport is true
335
329
  */
336
330
  function createLoadComponentPropertyAssignment(componentImportPath, componentDeclarationName, isDefaultExport) {
337
- return ts__default["default"].factory.createPropertyAssignment('loadComponent', ts__default["default"].factory.createArrowFunction(undefined, undefined, [], undefined, ts__default["default"].factory.createToken(ts__default["default"].SyntaxKind.EqualsGreaterThanToken), isDefaultExport
331
+ return ts.factory.createPropertyAssignment('loadComponent', ts.factory.createArrowFunction(undefined, undefined, [], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), isDefaultExport
338
332
  ? createImportCallExpression(componentImportPath) // will generate import('./path) and will skip the then() call
339
- : ts__default["default"].factory.createCallExpression(
333
+ : ts.factory.createCallExpression(
340
334
  // will generate import('./path).then(m => m.componentName)
341
- ts__default["default"].factory.createPropertyAccessExpression(createImportCallExpression(componentImportPath), 'then'), undefined, [createImportThenCallExpression(componentDeclarationName)])));
335
+ ts.factory.createPropertyAccessExpression(createImportCallExpression(componentImportPath), 'then'), undefined, [createImportThenCallExpression(componentDeclarationName)])));
342
336
  }
343
337
  // import('./path)
344
- const createImportCallExpression = (componentImportPath) => ts__default["default"].factory.createCallExpression(ts__default["default"].factory.createIdentifier('import'), undefined, [
345
- ts__default["default"].factory.createStringLiteral(componentImportPath, true),
338
+ const createImportCallExpression = (componentImportPath) => ts.factory.createCallExpression(ts.factory.createIdentifier('import'), undefined, [
339
+ ts.factory.createStringLiteral(componentImportPath, true),
346
340
  ]);
347
341
  // m => m.componentName
348
- const createImportThenCallExpression = (componentDeclarationName) => ts__default["default"].factory.createArrowFunction(undefined, undefined, [ts__default["default"].factory.createParameterDeclaration(undefined, undefined, 'm', undefined, undefined)], undefined, ts__default["default"].factory.createToken(ts__default["default"].SyntaxKind.EqualsGreaterThanToken), ts__default["default"].factory.createPropertyAccessExpression(ts__default["default"].factory.createIdentifier('m'), componentDeclarationName));
342
+ const createImportThenCallExpression = (componentDeclarationName) => ts.factory.createArrowFunction(undefined, undefined, [ts.factory.createParameterDeclaration(undefined, undefined, 'm', undefined, undefined)], undefined, ts.factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier('m'), componentDeclarationName));
349
343
 
350
344
  function migrate(options) {
351
345
  return async (tree, context) => {
@@ -1,33 +1,27 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.1
3
+ * @license Angular v20.0.0-next.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- Object.defineProperty(exports, '__esModule', { value: true });
10
-
11
9
  var schematics = require('@angular-devkit/schematics');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-b558633b.js');
13
- var project_paths = require('./project_paths-17dc204d.js');
10
+ var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
11
+ var project_paths = require('./project_paths-Jtbi76Bs.js');
14
12
  require('os');
15
13
  var ts = require('typescript');
16
- var checker = require('./checker-af521da6.js');
17
- require('./program-a449f9bf.js');
14
+ var checker = require('./checker-DF8ZaFW5.js');
15
+ require('./program-BZk27Ndu.js');
18
16
  require('path');
19
- var ng_decorators = require('./ng_decorators-b0d8b324.js');
20
- var property_name = require('./property_name-ac18447e.js');
17
+ var ng_decorators = require('./ng_decorators-DznZ5jMl.js');
18
+ var property_name = require('./property_name-BBwFuqMe.js');
21
19
  require('@angular-devkit/core');
22
20
  require('node:path/posix');
23
21
  require('fs');
24
22
  require('module');
25
23
  require('url');
26
- require('./imports-047fbbc8.js');
27
-
28
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
29
-
30
- var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
24
+ require('./imports-CIX-JgAN.js');
31
25
 
32
26
  /**
33
27
  * Unwraps a given expression TypeScript node. Expressions can be wrapped within multiple
@@ -35,7 +29,7 @@ var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
35
29
  * TypeScript node referring to the inner expression. e.g "exp".
36
30
  */
37
31
  function unwrapExpression(node) {
38
- if (ts__default["default"].isParenthesizedExpression(node) || ts__default["default"].isAsExpression(node)) {
32
+ if (ts.isParenthesizedExpression(node) || ts.isAsExpression(node)) {
39
33
  return unwrapExpression(node.expression);
40
34
  }
41
35
  else {
@@ -45,7 +39,7 @@ function unwrapExpression(node) {
45
39
 
46
40
  /** Extracts `@Directive` or `@Component` metadata from the given class. */
47
41
  function extractAngularClassMetadata(typeChecker, node) {
48
- const decorators = ts__default["default"].getDecorators(node);
42
+ const decorators = ts.getDecorators(node);
49
43
  if (!decorators || !decorators.length) {
50
44
  return null;
51
45
  }
@@ -64,7 +58,7 @@ function extractAngularClassMetadata(typeChecker, node) {
64
58
  }
65
59
  const metadata = unwrapExpression(decoratorCall.arguments[0]);
66
60
  // Ensure that the metadata is an object literal expression.
67
- if (!ts__default["default"].isObjectLiteralExpression(metadata)) {
61
+ if (!ts.isObjectLiteralExpression(metadata)) {
68
62
  return null;
69
63
  }
70
64
  return {
@@ -138,10 +132,10 @@ class NgComponentTemplateVisitor {
138
132
  this.typeChecker = typeChecker;
139
133
  }
140
134
  visitNode(node) {
141
- if (node.kind === ts__default["default"].SyntaxKind.ClassDeclaration) {
135
+ if (node.kind === ts.SyntaxKind.ClassDeclaration) {
142
136
  this.visitClassDeclaration(node);
143
137
  }
144
- ts__default["default"].forEachChild(node, (n) => this.visitNode(n));
138
+ ts.forEachChild(node, (n) => this.visitNode(n));
145
139
  }
146
140
  visitClassDeclaration(node) {
147
141
  const metadata = extractAngularClassMetadata(this.typeChecker, node);
@@ -153,13 +147,13 @@ class NgComponentTemplateVisitor {
153
147
  // Walk through all component metadata properties and determine the referenced
154
148
  // HTML templates (either external or inline)
155
149
  metadata.node.properties.forEach((property) => {
156
- if (!ts__default["default"].isPropertyAssignment(property)) {
150
+ if (!ts.isPropertyAssignment(property)) {
157
151
  return;
158
152
  }
159
153
  const propertyName = property_name.getPropertyNameText(property.name);
160
154
  // In case there is an inline template specified, ensure that the value is statically
161
155
  // analyzable by checking if the initializer is a string literal-like node.
162
- if (propertyName === 'template' && ts__default["default"].isStringLiteralLike(property.initializer)) {
156
+ if (propertyName === 'template' && ts.isStringLiteralLike(property.initializer)) {
163
157
  // Need to add an offset of one to the start because the template quotes are
164
158
  // not part of the template content.
165
159
  // The `getText()` method gives us the original raw text.
@@ -177,10 +171,10 @@ class NgComponentTemplateVisitor {
177
171
  content,
178
172
  inline: true,
179
173
  start: start,
180
- getCharacterAndLineOfPosition: (pos) => ts__default["default"].getLineAndCharacterOfPosition(sourceFile, pos + start),
174
+ getCharacterAndLineOfPosition: (pos) => ts.getLineAndCharacterOfPosition(sourceFile, pos + start),
181
175
  });
182
176
  }
183
- if (propertyName === 'templateUrl' && ts__default["default"].isStringLiteralLike(property.initializer)) {
177
+ if (propertyName === 'templateUrl' && ts.isStringLiteralLike(property.initializer)) {
184
178
  const absolutePath = this.fs.resolve(this.fs.dirname(sourceFileName), property.initializer.text);
185
179
  if (!this.fs.exists(absolutePath)) {
186
180
  return;
@@ -314,9 +308,9 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
314
308
  const typeChecker = program.getTypeChecker();
315
309
  const tagReplacements = [];
316
310
  for (const sf of sourceFiles) {
317
- ts__default["default"].forEachChild(sf, (node) => {
311
+ ts.forEachChild(sf, (node) => {
318
312
  // Skipping any non component declarations
319
- if (!ts__default["default"].isClassDeclaration(node)) {
313
+ if (!ts.isClassDeclaration(node)) {
320
314
  return;
321
315
  }
322
316
  const file = project_paths.projectFile(node.getSourceFile(), info);