@angular/core 19.2.0 → 19.2.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 (50) hide show
  1. package/fesm2022/core.mjs +317 -1646
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/di.mjs +45 -0
  4. package/fesm2022/primitives/di.mjs.map +1 -0
  5. package/fesm2022/primitives/event-dispatch.mjs +3 -590
  6. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  7. package/fesm2022/primitives/signals.mjs +19 -9
  8. package/fesm2022/primitives/signals.mjs.map +1 -1
  9. package/fesm2022/rxjs-interop.mjs +8 -12
  10. package/fesm2022/rxjs-interop.mjs.map +1 -1
  11. package/fesm2022/testing.mjs +387 -241
  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 +14138 -14924
  16. package/navigation_types.d-u4EOrrdZ.d.ts +121 -0
  17. package/package.json +5 -1
  18. package/primitives/di/index.d.ts +91 -0
  19. package/primitives/event-dispatch/index.d.ts +206 -310
  20. package/primitives/signals/index.d.ts +159 -196
  21. package/rxjs-interop/index.d.ts +73 -92
  22. package/schematics/bundles/{apply_import_manager-a4e62ded.js → apply_import_manager-C8MABThs.js} +13 -17
  23. package/schematics/bundles/{checker-2eecc677.js → checker-DP-zos5Q.js} +2961 -1060
  24. package/schematics/bundles/cleanup-unused-imports.js +22 -28
  25. package/schematics/bundles/{compiler_host-f313eac9.js → compiler_host-DzM2hemp.js} +20 -24
  26. package/schematics/bundles/control-flow-migration.js +82 -39
  27. package/schematics/bundles/explicit-standalone-flag.js +27 -33
  28. package/schematics/bundles/{imports-31a38653.js → imports-CIX-JgAN.js} +10 -15
  29. package/schematics/bundles/{index-afc3f749.js → index-CEdDCtp8.js} +56 -60
  30. package/schematics/bundles/{index-3891dd55.js → index-CrKEaRj_.js} +5 -5
  31. package/schematics/bundles/inject-migration.js +122 -128
  32. package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-D9nQ8UQC.js} +2 -2
  33. package/schematics/bundles/{migrate_ts_type_references-1abf1f5f.js → migrate_ts_type_references-C0325A9V.js} +107 -112
  34. package/schematics/bundles/{ng_decorators-6878e227.js → ng_decorators-DznZ5jMl.js} +5 -9
  35. package/schematics/bundles/{nodes-ffdce442.js → nodes-B16H9JUd.js} +3 -7
  36. package/schematics/bundles/output-migration.js +40 -46
  37. package/schematics/bundles/pending-tasks.js +14 -20
  38. package/schematics/bundles/{program-24da9092.js → program-CRYsSwIq.js} +769 -2634
  39. package/schematics/bundles/{project_paths-64bc3947.js → project_paths-BoRVJPjW.js} +26 -24
  40. package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-CDVxT6Ov.js} +2 -2
  41. package/schematics/bundles/{property_name-42030525.js → property_name-BBwFuqMe.js} +4 -8
  42. package/schematics/bundles/provide-initializer.js +14 -20
  43. package/schematics/bundles/route-lazy-loading.js +36 -42
  44. package/schematics/bundles/self-closing-tags-migration.js +55 -45
  45. package/schematics/bundles/signal-input-migration.js +61 -68
  46. package/schematics/bundles/signal-queries-migration.js +48 -55
  47. package/schematics/bundles/signals.js +10 -12
  48. package/schematics/bundles/standalone-migration.js +179 -185
  49. package/testing/index.d.ts +309 -471
  50. package/weak_ref.d-ttyj86RV.d.ts +9 -0
@@ -1,33 +1,27 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v19.2.2
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-6c9cde78.js');
13
- var project_paths = require('./project_paths-64bc3947.js');
10
+ var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
11
+ var project_paths = require('./project_paths-BoRVJPjW.js');
14
12
  require('os');
15
13
  var ts = require('typescript');
16
- var checker = require('./checker-2eecc677.js');
17
- require('./program-24da9092.js');
14
+ var checker = require('./checker-DP-zos5Q.js');
15
+ require('./program-CRYsSwIq.js');
18
16
  require('path');
19
- var ng_decorators = require('./ng_decorators-6878e227.js');
20
- var property_name = require('./property_name-42030525.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-31a38653.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,8 +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) => {
318
- if (!ts__default["default"].isClassDeclaration(node)) {
311
+ ts.forEachChild(sf, (node) => {
312
+ // Skipping any non component declarations
313
+ if (!ts.isClassDeclaration(node)) {
319
314
  return;
320
315
  }
321
316
  const file = project_paths.projectFile(node.getSourceFile(), info);
@@ -326,22 +321,23 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
326
321
  templateVisitor.visitNode(node);
327
322
  templateVisitor.resolvedTemplates.forEach((template) => {
328
323
  const { migrated, changed, replacementCount } = migrateTemplateToSelfClosingTags(template.content);
329
- if (changed) {
330
- const fileToMigrate = template.inline
331
- ? file
332
- : project_paths.projectFile(template.filePath, info);
333
- const end = template.start + template.content.length;
334
- const replacements = [
335
- prepareTextReplacement(fileToMigrate, migrated, template.start, end),
336
- ];
337
- const fileReplacements = tagReplacements.find((tagReplacement) => tagReplacement.file === file);
338
- if (fileReplacements) {
339
- fileReplacements.replacements.push(...replacements);
340
- fileReplacements.replacementCount += replacementCount;
341
- }
342
- else {
343
- tagReplacements.push({ file, replacements, replacementCount });
344
- }
324
+ if (!changed) {
325
+ return;
326
+ }
327
+ const fileToMigrate = template.inline
328
+ ? file
329
+ : project_paths.projectFile(template.filePath, info);
330
+ const end = template.start + template.content.length;
331
+ const replacements = [
332
+ prepareTextReplacement(fileToMigrate, migrated, template.start, end),
333
+ ];
334
+ const fileReplacements = tagReplacements.find((tagReplacement) => tagReplacement.file === file);
335
+ if (fileReplacements) {
336
+ fileReplacements.replacements.push(...replacements);
337
+ fileReplacements.replacementCount += replacementCount;
338
+ }
339
+ else {
340
+ tagReplacements.push({ file, replacements, replacementCount });
345
341
  }
346
342
  });
347
343
  });
@@ -349,9 +345,11 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
349
345
  return project_paths.confirmAsSerializable({ tagReplacements });
350
346
  }
351
347
  async combine(unitA, unitB) {
352
- return project_paths.confirmAsSerializable({
353
- tagReplacements: unitA.tagReplacements.concat(unitB.tagReplacements),
354
- });
348
+ const uniqueReplacements = removeDuplicateReplacements([
349
+ ...unitA.tagReplacements,
350
+ ...unitB.tagReplacements,
351
+ ]);
352
+ return project_paths.confirmAsSerializable({ tagReplacements: uniqueReplacements });
355
353
  }
356
354
  async globalMeta(combinedData) {
357
355
  const globalMeta = {
@@ -380,6 +378,18 @@ function prepareTextReplacement(file, replacement, start, end) {
380
378
  toInsert: replacement,
381
379
  }));
382
380
  }
381
+ function removeDuplicateReplacements(replacements) {
382
+ const uniqueFiles = new Set();
383
+ const result = [];
384
+ for (const replacement of replacements) {
385
+ const fileId = replacement.file.id;
386
+ if (!uniqueFiles.has(fileId)) {
387
+ uniqueFiles.add(fileId);
388
+ result.push(replacement);
389
+ }
390
+ }
391
+ return result;
392
+ }
383
393
 
384
394
  function migrate(options) {
385
395
  return async (tree, context) => {
@@ -1,37 +1,30 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v19.2.2
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 migrate_ts_type_references = require('./migrate_ts_type_references-1abf1f5f.js');
10
+ var migrate_ts_type_references = require('./migrate_ts_type_references-C0325A9V.js');
13
11
  var ts = require('typescript');
14
12
  require('os');
15
- var checker = require('./checker-2eecc677.js');
16
- var program = require('./program-24da9092.js');
13
+ var checker = require('./checker-DP-zos5Q.js');
14
+ var program = require('./program-CRYsSwIq.js');
17
15
  require('path');
18
- var project_paths = require('./project_paths-64bc3947.js');
19
- var index = require('./index-afc3f749.js');
16
+ var project_paths = require('./project_paths-BoRVJPjW.js');
17
+ var index = require('./index-CEdDCtp8.js');
20
18
  var assert = require('assert');
21
- var apply_import_manager = require('./apply_import_manager-a4e62ded.js');
22
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
23
- require('./leading_space-6e7a8ec6.js');
19
+ var apply_import_manager = require('./apply_import_manager-C8MABThs.js');
20
+ var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
21
+ require('./leading_space-D9nQ8UQC.js');
24
22
  require('fs');
25
23
  require('module');
26
24
  require('url');
27
25
  require('@angular-devkit/core');
28
26
  require('node:path/posix');
29
27
 
30
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
-
32
- var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
33
- var assert__default = /*#__PURE__*/_interopDefaultLegacy(assert);
34
-
35
28
  /**
36
29
  * Class that holds information about a given directive and its input fields.
37
30
  */
@@ -102,7 +95,7 @@ class MigrationHost {
102
95
 
103
96
  function getInputDescriptor(hostOrInfo, node) {
104
97
  let className;
105
- if (ts__default["default"].isAccessor(node)) {
98
+ if (ts.isAccessor(node)) {
106
99
  className = node.parent.name?.text || '<anonymous>';
107
100
  }
108
101
  else {
@@ -307,7 +300,7 @@ function prepareAnalysisInfo(userProgram, compiler, programAbsoluteRootPaths) {
307
300
  * - imports that may need to be updated.
308
301
  */
309
302
  class MigrationResult {
310
- printer = ts__default["default"].createPrinter({ newLine: ts__default["default"].NewLineKind.LineFeed });
303
+ printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });
311
304
  // May be `null` if the input cannot be converted. This is also
312
305
  // signified by an incompatibility- but the input is tracked here as it
313
306
  // still is a "source input".
@@ -329,14 +322,14 @@ function extractDecoratorInput(node, host, reflector, metadataReader, evaluator)
329
322
  */
330
323
  function extractDtsInput(node, metadataReader) {
331
324
  if (!index.isInputContainerNode(node) ||
332
- !ts__default["default"].isIdentifier(node.name) ||
325
+ !ts.isIdentifier(node.name) ||
333
326
  !node.getSourceFile().isDeclarationFile) {
334
327
  return null;
335
328
  }
336
329
  // If the potential node is not part of a valid input class, skip.
337
- if (!ts__default["default"].isClassDeclaration(node.parent) ||
330
+ if (!ts.isClassDeclaration(node.parent) ||
338
331
  node.parent.name === undefined ||
339
- !ts__default["default"].isIdentifier(node.parent.name)) {
332
+ !ts.isIdentifier(node.parent.name)) {
340
333
  return null;
341
334
  }
342
335
  let directiveMetadata = null;
@@ -372,7 +365,7 @@ function extractDtsInput(node, metadataReader) {
372
365
  */
373
366
  function extractSourceCodeInput(node, host, reflector, evaluator) {
374
367
  if (!index.isInputContainerNode(node) ||
375
- !ts__default["default"].isIdentifier(node.name) ||
368
+ !ts.isIdentifier(node.name) ||
376
369
  node.getSourceFile().isDeclarationFile) {
377
370
  return null;
378
371
  }
@@ -440,7 +433,7 @@ function parseTransformOfInput(evaluatedInputOpts, node, reflector) {
440
433
  },
441
434
  ]);
442
435
  try {
443
- return program.parseDecoratorInputTransformFunction(node.parent, node.name.text, transformValue, reflector, noopRefEmitter, checker.CompilationMode.FULL);
436
+ return checker.parseDecoratorInputTransformFunction(node.parent, node.name.text, transformValue, reflector, noopRefEmitter, checker.CompilationMode.FULL);
444
437
  }
445
438
  catch (e) {
446
439
  if (!(e instanceof checker.FatalDiagnosticError)) {
@@ -464,16 +457,16 @@ function parseTransformOfInput(evaluatedInputOpts, node, reflector) {
464
457
  */
465
458
  function prepareAndCheckForConversion(node, metadata, checker, options) {
466
459
  // Accessor inputs cannot be migrated right now.
467
- if (ts__default["default"].isAccessor(node)) {
460
+ if (ts.isAccessor(node)) {
468
461
  return {
469
462
  context: node,
470
463
  reason: migrate_ts_type_references.FieldIncompatibilityReason.Accessor,
471
464
  };
472
465
  }
473
- assert__default["default"](metadata.inputDecorator !== null, 'Expected an input decorator for inputs that are being migrated.');
466
+ assert(metadata.inputDecorator !== null, 'Expected an input decorator for inputs that are being migrated.');
474
467
  let initialValue = node.initializer;
475
468
  let isUndefinedInitialValue = node.initializer === undefined ||
476
- (ts__default["default"].isIdentifier(node.initializer) && node.initializer.text === 'undefined');
469
+ (ts.isIdentifier(node.initializer) && node.initializer.text === 'undefined');
477
470
  const strictNullChecksEnabled = options.strict === true || options.strictNullChecks === true;
478
471
  const strictPropertyInitialization = options.strict === true || options.strictPropertyInitialization === true;
479
472
  // Shorthand should never be used, as would expand the type of `T` to be `T|undefined`.
@@ -515,9 +508,9 @@ function prepareAndCheckForConversion(node, metadata, checker, options) {
515
508
  };
516
509
  }
517
510
  if (!checker.isTypeAssignableTo(checker.getUndefinedType(), checker.getTypeFromTypeNode(typeToAdd))) {
518
- typeToAdd = ts__default["default"].factory.createUnionTypeNode([
511
+ typeToAdd = ts.factory.createUnionTypeNode([
519
512
  typeToAdd,
520
- ts__default["default"].factory.createKeywordTypeNode(ts__default["default"].SyntaxKind.UndefinedKeyword),
513
+ ts.factory.createKeywordTypeNode(ts.SyntaxKind.UndefinedKeyword),
521
514
  ]);
522
515
  }
523
516
  }
@@ -538,7 +531,7 @@ function prepareAndCheckForConversion(node, metadata, checker, options) {
538
531
  'Input is initialized to `undefined` but type does not allow this value. ' +
539
532
  'This worked with `@Input` because your project uses `--strictPropertyInitialization=false`.';
540
533
  isUndefinedInitialValue = false;
541
- initialValue = ts__default["default"].factory.createNonNullExpression(ts__default["default"].factory.createIdentifier('undefined'));
534
+ initialValue = ts.factory.createNonNullExpression(ts.factory.createIdentifier('undefined'));
542
535
  }
543
536
  // Attempt to extract type from input initial value. No explicit type, but input is required.
544
537
  // Hence we need an explicit type, or fall back to `typeof`.
@@ -572,28 +565,28 @@ function inferImportableTypeForInput(checker, node, initialValue) {
572
565
  // return a type node fully derived from the resolved type.
573
566
  if (isPrimitiveImportableTypeNode(propertyType) ||
574
567
  (propertyType.isUnion() && propertyType.types.every(isPrimitiveImportableTypeNode))) {
575
- return checker.typeToTypeNode(propertyType, node, ts__default["default"].NodeBuilderFlags.NoTypeReduction) ?? null;
568
+ return checker.typeToTypeNode(propertyType, node, ts.NodeBuilderFlags.NoTypeReduction) ?? null;
576
569
  }
577
570
  // Alternatively, try to infer a simple importable type from\
578
571
  // the initializer.
579
- if (ts__default["default"].isIdentifier(initialValue)) {
572
+ if (ts.isIdentifier(initialValue)) {
580
573
  // @Input({required: true}) bla = SOME_DEFAULT;
581
- return ts__default["default"].factory.createTypeQueryNode(initialValue);
574
+ return ts.factory.createTypeQueryNode(initialValue);
582
575
  }
583
- else if (ts__default["default"].isPropertyAccessExpression(initialValue) &&
584
- ts__default["default"].isIdentifier(initialValue.name) &&
585
- ts__default["default"].isIdentifier(initialValue.expression)) {
576
+ else if (ts.isPropertyAccessExpression(initialValue) &&
577
+ ts.isIdentifier(initialValue.name) &&
578
+ ts.isIdentifier(initialValue.expression)) {
586
579
  // @Input({required: true}) bla = prop.SOME_DEFAULT;
587
- return ts__default["default"].factory.createTypeQueryNode(ts__default["default"].factory.createQualifiedName(initialValue.name, initialValue.expression));
580
+ return ts.factory.createTypeQueryNode(ts.factory.createQualifiedName(initialValue.name, initialValue.expression));
588
581
  }
589
582
  return null;
590
583
  }
591
584
  function isPrimitiveImportableTypeNode(type) {
592
- return !!(type.flags & ts__default["default"].TypeFlags.BooleanLike ||
593
- type.flags & ts__default["default"].TypeFlags.StringLike ||
594
- type.flags & ts__default["default"].TypeFlags.NumberLike ||
595
- type.flags & ts__default["default"].TypeFlags.Undefined ||
596
- type.flags & ts__default["default"].TypeFlags.Null);
585
+ return !!(type.flags & ts.TypeFlags.BooleanLike ||
586
+ type.flags & ts.TypeFlags.StringLike ||
587
+ type.flags & ts.TypeFlags.NumberLike ||
588
+ type.flags & ts.TypeFlags.Undefined ||
589
+ type.flags & ts.TypeFlags.Null);
597
590
  }
598
591
 
599
592
  /**
@@ -604,7 +597,7 @@ function pass1__IdentifySourceFileAndDeclarationInputs(sf, host, checker, reflec
604
597
  const visitor = (node) => {
605
598
  const decoratorInput = extractDecoratorInput(node, host, reflector, dtsMetadataReader, evaluator);
606
599
  if (decoratorInput !== null) {
607
- assert__default["default"](index.isInputContainerNode(node), 'Expected input to be declared on accessor or property.');
600
+ assert(index.isInputContainerNode(node), 'Expected input to be declared on accessor or property.');
608
601
  const inputDescr = getInputDescriptor(host, node);
609
602
  // track all inputs, even from declarations for reference resolution.
610
603
  knownDecoratorInputs.register({ descriptor: inputDescr, metadata: decoratorInput, node });
@@ -623,10 +616,10 @@ function pass1__IdentifySourceFileAndDeclarationInputs(sf, host, checker, reflec
623
616
  }
624
617
  // track all imports to `Input` or `input`.
625
618
  let importName = null;
626
- if (ts__default["default"].isImportSpecifier(node) &&
619
+ if (ts.isImportSpecifier(node) &&
627
620
  ((importName = (node.propertyName ?? node.name).text) === 'Input' ||
628
621
  importName === 'input') &&
629
- ts__default["default"].isStringLiteral(node.parent.parent.parent.moduleSpecifier) &&
622
+ ts.isStringLiteral(node.parent.parent.parent.moduleSpecifier) &&
630
623
  (host.isMigratingCore || node.parent.parent.parent.moduleSpecifier.text === '@angular/core')) {
631
624
  if (!result.inputDecoratorSpecifiers.has(sf)) {
632
625
  result.inputDecoratorSpecifiers.set(sf, []);
@@ -636,9 +629,9 @@ function pass1__IdentifySourceFileAndDeclarationInputs(sf, host, checker, reflec
636
629
  node,
637
630
  });
638
631
  }
639
- ts__default["default"].forEachChild(node, visitor);
632
+ ts.forEachChild(node, visitor);
640
633
  };
641
- ts__default["default"].forEachChild(sf, visitor);
634
+ ts.forEachChild(sf, visitor);
642
635
  }
643
636
 
644
637
  /**
@@ -767,7 +760,7 @@ function pass4__checkInheritanceOfInputs(inheritanceGraph, metaRegistry, knownIn
767
760
  isClassWithKnownFields: (clazz) => knownInputs.isInputContainingClass(clazz),
768
761
  getFieldsForClass: (clazz) => {
769
762
  const directiveInfo = knownInputs.getDirectiveInfoForClass(clazz);
770
- assert__default["default"](directiveInfo !== undefined, 'Expected directive info to exist for input.');
763
+ assert(directiveInfo !== undefined, 'Expected directive info to exist for input.');
771
764
  return Array.from(directiveInfo.inputFields.values()).map((i) => i.descriptor);
772
765
  },
773
766
  });
@@ -974,7 +967,7 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
974
967
  if (metadata.bindingPropertyName !== metadata.classPropertyName || metadata.transform !== null) {
975
968
  const properties = [];
976
969
  if (metadata.bindingPropertyName !== metadata.classPropertyName) {
977
- properties.push(ts__default["default"].factory.createPropertyAssignment('alias', ts__default["default"].factory.createStringLiteral(metadata.bindingPropertyName)));
970
+ properties.push(ts.factory.createPropertyAssignment('alias', ts.factory.createStringLiteral(metadata.bindingPropertyName)));
978
971
  }
979
972
  if (metadata.transform !== null) {
980
973
  const transformRes = extractTransformOfInput(metadata.transform, resolvedType, checker);
@@ -985,7 +978,7 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
985
978
  (leadingTodoText ? `${leadingTodoText} ` : '') + transformRes.leadingTodoText;
986
979
  }
987
980
  }
988
- optionsLiteral = ts__default["default"].factory.createObjectLiteralExpression(properties);
981
+ optionsLiteral = ts.factory.createObjectLiteralExpression(properties);
989
982
  }
990
983
  // The initial value is `undefined` or none is present:
991
984
  // - We may be able to use the `input()` shorthand
@@ -993,14 +986,14 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
993
986
  if (initialValue === undefined) {
994
987
  // Shorthand not possible, so explicitly add `undefined`.
995
988
  if (preferShorthandIfPossible === null) {
996
- initialValue = ts__default["default"].factory.createIdentifier('undefined');
989
+ initialValue = ts.factory.createIdentifier('undefined');
997
990
  }
998
991
  else {
999
992
  resolvedType = preferShorthandIfPossible.originalType;
1000
993
  // When using the `input()` shorthand, try cutting of `undefined` from potential
1001
994
  // union types. `undefined` will be automatically included in the type.
1002
- if (ts__default["default"].isUnionTypeNode(resolvedType)) {
1003
- resolvedType = migrate_ts_type_references.removeFromUnionIfPossible(resolvedType, (t) => t.kind !== ts__default["default"].SyntaxKind.UndefinedKeyword);
995
+ if (ts.isUnionTypeNode(resolvedType)) {
996
+ resolvedType = migrate_ts_type_references.removeFromUnionIfPossible(resolvedType, (t) => t.kind !== ts.SyntaxKind.UndefinedKeyword);
1004
997
  }
1005
998
  }
1006
999
  }
@@ -1011,13 +1004,13 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
1011
1004
  if (metadata.transform !== null) {
1012
1005
  // Note: The TCB code generation may use the same type node and attach
1013
1006
  // synthetic comments for error reporting. We remove those explicitly here.
1014
- typeArguments.push(ts__default["default"].setSyntheticTrailingComments(metadata.transform.type.node, undefined));
1007
+ typeArguments.push(ts.setSyntheticTrailingComments(metadata.transform.type.node, undefined));
1015
1008
  }
1016
1009
  }
1017
1010
  // Always add an initial value when the input is optional, and we have one, or we need one
1018
1011
  // to be able to pass options as the second argument.
1019
1012
  if (!metadata.required && (initialValue !== undefined || optionsLiteral !== null)) {
1020
- inputArgs.push(initialValue ?? ts__default["default"].factory.createIdentifier('undefined'));
1013
+ inputArgs.push(initialValue ?? ts.factory.createIdentifier('undefined'));
1021
1014
  }
1022
1015
  if (optionsLiteral !== null) {
1023
1016
  inputArgs.push(optionsLiteral);
@@ -1028,16 +1021,16 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
1028
1021
  requestedFile: node.getSourceFile(),
1029
1022
  });
1030
1023
  const inputInitializerFn = metadata.required
1031
- ? ts__default["default"].factory.createPropertyAccessExpression(inputFnRef, 'required')
1024
+ ? ts.factory.createPropertyAccessExpression(inputFnRef, 'required')
1032
1025
  : inputFnRef;
1033
- const inputInitializer = ts__default["default"].factory.createCallExpression(inputInitializerFn, typeArguments, inputArgs);
1026
+ const inputInitializer = ts.factory.createCallExpression(inputInitializerFn, typeArguments, inputArgs);
1034
1027
  let modifiersWithoutInputDecorator = node.modifiers?.filter((m) => m !== originalInputDecorator.node) ?? [];
1035
1028
  // Add `readonly` to all new signal input declarations.
1036
- if (!modifiersWithoutInputDecorator?.some((s) => s.kind === ts__default["default"].SyntaxKind.ReadonlyKeyword)) {
1037
- modifiersWithoutInputDecorator.push(ts__default["default"].factory.createModifier(ts__default["default"].SyntaxKind.ReadonlyKeyword));
1029
+ if (!modifiersWithoutInputDecorator?.some((s) => s.kind === ts.SyntaxKind.ReadonlyKeyword)) {
1030
+ modifiersWithoutInputDecorator.push(ts.factory.createModifier(ts.SyntaxKind.ReadonlyKeyword));
1038
1031
  }
1039
- const newNode = ts__default["default"].factory.createPropertyDeclaration(modifiersWithoutInputDecorator, node.name, undefined, undefined, inputInitializer);
1040
- const newPropertyText = result.printer.printNode(ts__default["default"].EmitHint.Unspecified, newNode, node.getSourceFile());
1032
+ const newNode = ts.factory.createPropertyDeclaration(modifiersWithoutInputDecorator, node.name, undefined, undefined, inputInitializer);
1033
+ const newPropertyText = result.printer.printNode(ts.EmitHint.Unspecified, newNode, node.getSourceFile());
1041
1034
  const replacements = [];
1042
1035
  if (leadingTodoText !== null) {
1043
1036
  replacements.push(migrate_ts_type_references.insertPrecedingLine(node, info, '// TODO: Notes from signal input migration:'), ...migrate_ts_type_references.cutStringToLineLimit(leadingTodoText, 70).map((line) => migrate_ts_type_references.insertPrecedingLine(node, info, `// ${line}`)));
@@ -1054,29 +1047,29 @@ function convertToSignalInput(node, { resolvedMetadata: metadata, resolvedType,
1054
1047
  * that works for the new signal `input()` API.
1055
1048
  */
1056
1049
  function extractTransformOfInput(transform, resolvedType, checker) {
1057
- assert__default["default"](ts__default["default"].isExpression(transform.node), `Expected transform to be an expression.`);
1050
+ assert(ts.isExpression(transform.node), `Expected transform to be an expression.`);
1058
1051
  let transformFn = transform.node;
1059
1052
  let leadingTodoText = null;
1060
1053
  // If there is an explicit type, check if the transform return type actually works.
1061
1054
  // In some cases, the transform function is not compatible because with decorator inputs,
1062
1055
  // those were not checked. We cast the transform to `any` and add a TODO.
1063
1056
  // TODO: Capture this in the design doc.
1064
- if (resolvedType !== undefined && !ts__default["default"].isSyntheticExpression(resolvedType)) {
1057
+ if (resolvedType !== undefined && !ts.isSyntheticExpression(resolvedType)) {
1065
1058
  // Note: If the type is synthetic, we cannot check, and we accept that in the worst case
1066
1059
  // we will create code that is not necessarily compiling. This is unlikely, but notably
1067
1060
  // the errors would be correct and valuable.
1068
1061
  const transformType = checker.getTypeAtLocation(transform.node);
1069
1062
  const transformSignature = transformType.getCallSignatures()[0];
1070
- assert__default["default"](transformSignature !== undefined, 'Expected transform to be an invoke-able.');
1063
+ assert(transformSignature !== undefined, 'Expected transform to be an invoke-able.');
1071
1064
  if (!checker.isTypeAssignableTo(checker.getReturnTypeOfSignature(transformSignature), checker.getTypeFromTypeNode(resolvedType))) {
1072
1065
  leadingTodoText =
1073
1066
  'Input type is incompatible with transform. The migration added an `any` cast. ' +
1074
1067
  'This worked previously because Angular was unable to check transforms.';
1075
- transformFn = ts__default["default"].factory.createAsExpression(ts__default["default"].factory.createParenthesizedExpression(transformFn), ts__default["default"].factory.createKeywordTypeNode(ts__default["default"].SyntaxKind.AnyKeyword));
1068
+ transformFn = ts.factory.createAsExpression(ts.factory.createParenthesizedExpression(transformFn), ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword));
1076
1069
  }
1077
1070
  }
1078
1071
  return {
1079
- node: ts__default["default"].factory.createPropertyAssignment('transform', transformFn),
1072
+ node: ts.factory.createPropertyAssignment('transform', transformFn),
1080
1073
  leadingTodoText,
1081
1074
  };
1082
1075
  }
@@ -1104,8 +1097,8 @@ function pass6__migrateInputDeclarations(host, checker, result, knownInputs, imp
1104
1097
  filesWithIncompatibleInputs.add(sf);
1105
1098
  continue;
1106
1099
  }
1107
- assert__default["default"](metadata !== null, `Expected metadata to exist for input isn't marked incompatible.`);
1108
- assert__default["default"](!ts__default["default"].isAccessor(input.node), 'Accessor inputs are incompatible.');
1100
+ assert(metadata !== null, `Expected metadata to exist for input isn't marked incompatible.`);
1101
+ assert(!ts.isAccessor(input.node), 'Accessor inputs are incompatible.');
1109
1102
  filesWithMigratedInputs.add(sf);
1110
1103
  result.replacements.push(...convertToSignalInput(input.node, metadata, info, checker, importManager, result));
1111
1104
  }