@angular/core 20.0.0-rc.0 → 20.0.0-rc.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 (75) hide show
  1. package/{api.d-CRxC7NlU.d.ts → api.d-B0vztftH.d.ts} +15 -15
  2. package/{chrome_dev_tools_performance.d-B0FzTuRf.d.ts → chrome_dev_tools_performance.d-DvzAxqBc.d.ts} +9 -29
  3. package/{discovery.d-CBxzK1ay.d.ts → discovery.d-Cf_r2Ojk.d.ts} +7 -13
  4. package/{event_dispatcher.d-DlbccpYq.d.ts → event_dispatcher.d-BReQpZfC.d.ts} +27 -1
  5. package/fesm2022/attribute-BWp59EjE.mjs +1 -1
  6. package/fesm2022/attribute-BWp59EjE.mjs.map +1 -1
  7. package/fesm2022/core.mjs +21 -14
  8. package/fesm2022/core.mjs.map +1 -1
  9. package/fesm2022/{debug_node-3mmnD06K.mjs → debug_node-Nc-zr65s.mjs} +11161 -11262
  10. package/fesm2022/debug_node-Nc-zr65s.mjs.map +1 -0
  11. package/fesm2022/primitives/di.mjs +1 -1
  12. package/fesm2022/primitives/di.mjs.map +1 -1
  13. package/fesm2022/primitives/event-dispatch.mjs +3 -2
  14. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  15. package/fesm2022/primitives/signals.mjs +1 -1
  16. package/fesm2022/primitives/signals.mjs.map +1 -1
  17. package/fesm2022/{resource-nrAenwIA.mjs → resource-DOwetGLU.mjs} +64 -14
  18. package/fesm2022/resource-DOwetGLU.mjs.map +1 -0
  19. package/fesm2022/{root_effect_scheduler-B_EWGyLU.mjs → root_effect_scheduler-BgGHQ80j.mjs} +29 -17
  20. package/fesm2022/root_effect_scheduler-BgGHQ80j.mjs.map +1 -0
  21. package/fesm2022/rxjs-interop.mjs +27 -12
  22. package/fesm2022/rxjs-interop.mjs.map +1 -1
  23. package/fesm2022/signal-ePSl6jXn.mjs +1 -1
  24. package/fesm2022/signal-ePSl6jXn.mjs.map +1 -1
  25. package/fesm2022/testing.mjs +86 -77
  26. package/fesm2022/testing.mjs.map +1 -1
  27. package/fesm2022/untracked-2ouAFbCz.mjs +1 -1
  28. package/fesm2022/untracked-2ouAFbCz.mjs.map +1 -1
  29. package/fesm2022/weak_ref-BaIq-pgY.mjs +1 -1
  30. package/fesm2022/weak_ref-BaIq-pgY.mjs.map +1 -1
  31. package/graph.d-BcIOep_B.d.ts +1 -1
  32. package/index.d.ts +205 -325
  33. package/package.json +3 -3
  34. package/primitives/di/index.d.ts +1 -1
  35. package/primitives/event-dispatch/index.d.ts +3 -3
  36. package/primitives/signals/index.d.ts +1 -1
  37. package/rxjs-interop/index.d.ts +4 -4
  38. package/schematics/bundles/{apply_import_manager-Coc7Hewu.js → apply_import_manager-BqwxKJiu.cjs} +3 -3
  39. package/schematics/bundles/{change_tracker-CDJPOAni.js → change_tracker-B1qegJFu.cjs} +3 -3
  40. package/schematics/bundles/{checker-BAl7CJ0l.js → checker-DmucNdBi.cjs} +55 -45
  41. package/schematics/bundles/{cleanup-unused-imports.js → cleanup-unused-imports.cjs} +30 -62
  42. package/schematics/bundles/{compiler-BSv6JWRF.js → compiler-DPq1iS19.cjs} +142 -95
  43. package/schematics/bundles/{compiler_host-CAfDJO3W.js → compiler_host-CAfDJO3W.cjs} +1 -1
  44. package/schematics/bundles/{control-flow-migration.js → control-flow-migration.cjs} +4 -4
  45. package/schematics/bundles/{document-core.js → document-core.cjs} +9 -9
  46. package/schematics/bundles/{imports-CIX-JgAN.js → imports-CIX-JgAN.cjs} +1 -1
  47. package/schematics/bundles/{index-CxuDmkeg.js → index-1H-qYSW6.cjs} +101 -37
  48. package/schematics/bundles/{index-CnKffIJ6.js → index-CFmTQ_wx.cjs} +29 -20
  49. package/schematics/bundles/{inject-flags.js → inject-flags.cjs} +9 -9
  50. package/schematics/bundles/{inject-migration.js → inject-migration.cjs} +9 -9
  51. package/schematics/bundles/{leading_space-D9nQ8UQC.js → leading_space-D9nQ8UQC.cjs} +1 -1
  52. package/schematics/bundles/{migrate_ts_type_references-DE1AlxIs.js → migrate_ts_type_references-B2aJNuIK.cjs} +7 -7
  53. package/schematics/bundles/{ng_decorators-DznZ5jMl.js → ng_decorators-B5HCqr20.cjs} +2 -2
  54. package/schematics/bundles/{nodes-B16H9JUd.js → nodes-B16H9JUd.cjs} +1 -1
  55. package/schematics/bundles/{output-migration.js → output-migration.cjs} +14 -17
  56. package/schematics/bundles/{project_paths-Bl-H7Vlb.js → project_paths-DmvzlTQL.cjs} +71 -42
  57. package/schematics/bundles/{project_tsconfig_paths-CDVxT6Ov.js → project_tsconfig_paths-CDVxT6Ov.cjs} +1 -1
  58. package/schematics/bundles/{property_name-BBwFuqMe.js → property_name-BBwFuqMe.cjs} +1 -1
  59. package/schematics/bundles/{route-lazy-loading.js → route-lazy-loading.cjs} +7 -7
  60. package/schematics/bundles/{self-closing-tags-migration.js → self-closing-tags-migration.cjs} +17 -34
  61. package/schematics/bundles/{signal-input-migration.js → signal-input-migration.cjs} +28 -27
  62. package/schematics/bundles/{signal-queries-migration.js → signal-queries-migration.cjs} +18 -21
  63. package/schematics/bundles/{signals.js → signals.cjs} +13 -13
  64. package/schematics/bundles/{standalone-migration.js → standalone-migration.cjs} +11 -11
  65. package/schematics/bundles/{symbol-VPWguRxr.js → symbol-VPWguRxr.cjs} +1 -1
  66. package/schematics/bundles/{test-bed-get.js → test-bed-get.cjs} +9 -9
  67. package/schematics/collection.json +9 -9
  68. package/schematics/migrations.json +4 -4
  69. package/signal.d-D6VJ67xi.d.ts +1 -1
  70. package/testing/index.d.ts +21 -7
  71. package/weak_ref.d-eGOEP9S1.d.ts +1 -1
  72. package/fesm2022/debug_node-3mmnD06K.mjs.map +0 -1
  73. package/fesm2022/resource-nrAenwIA.mjs.map +0 -1
  74. package/fesm2022/root_effect_scheduler-B_EWGyLU.mjs.map +0 -1
  75. package/schematics/package.json +0 -3
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,15 +8,15 @@
8
8
 
9
9
  var schematics = require('@angular-devkit/schematics');
10
10
  var p = require('path');
11
- var change_tracker = require('./change_tracker-CDJPOAni.js');
12
- var compiler_host = require('./compiler_host-CAfDJO3W.js');
11
+ var change_tracker = require('./change_tracker-B1qegJFu.cjs');
12
+ var compiler_host = require('./compiler_host-CAfDJO3W.cjs');
13
13
  var ts = require('typescript');
14
- var ng_decorators = require('./ng_decorators-DznZ5jMl.js');
15
- var imports = require('./imports-CIX-JgAN.js');
16
- var nodes = require('./nodes-B16H9JUd.js');
17
- var leading_space = require('./leading_space-D9nQ8UQC.js');
18
- require('./compiler-BSv6JWRF.js');
19
- require('./checker-BAl7CJ0l.js');
14
+ var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
15
+ var imports = require('./imports-CIX-JgAN.cjs');
16
+ var nodes = require('./nodes-B16H9JUd.cjs');
17
+ var leading_space = require('./leading_space-D9nQ8UQC.cjs');
18
+ require('./compiler-DPq1iS19.cjs');
19
+ require('./checker-DmucNdBi.cjs');
20
20
  require('os');
21
21
  require('fs');
22
22
  require('module');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -1,20 +1,20 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- require('./compiler-BSv6JWRF.js');
9
+ require('./compiler-DPq1iS19.cjs');
10
10
  var ts = require('typescript');
11
- var checker = require('./checker-BAl7CJ0l.js');
11
+ var checker = require('./checker-DmucNdBi.cjs');
12
12
  require('os');
13
13
  var assert = require('assert');
14
- var index = require('./index-CnKffIJ6.js');
15
- var project_paths = require('./project_paths-Bl-H7Vlb.js');
16
- var leading_space = require('./leading_space-D9nQ8UQC.js');
17
- require('./index-CxuDmkeg.js');
14
+ var index = require('./index-CFmTQ_wx.cjs');
15
+ var project_paths = require('./project_paths-DmvzlTQL.cjs');
16
+ var leading_space = require('./leading_space-D9nQ8UQC.cjs');
17
+ require('./index-1H-qYSW6.cjs');
18
18
  require('path');
19
19
 
20
20
  /**
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
9
  var ts = require('typescript');
10
- var imports = require('./imports-CIX-JgAN.js');
10
+ var imports = require('./imports-CIX-JgAN.cjs');
11
11
 
12
12
  function getCallDecoratorImport(typeChecker, decorator) {
13
13
  // Note that this does not cover the edge case where decorators are called from
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.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-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,20 +8,20 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var checker = require('./checker-BAl7CJ0l.js');
12
- var compiler = require('./compiler-BSv6JWRF.js');
13
- var index$1 = require('./index-CxuDmkeg.js');
11
+ var checker = require('./checker-DmucNdBi.cjs');
12
+ var compiler = require('./compiler-DPq1iS19.cjs');
13
+ var index$1 = require('./index-1H-qYSW6.cjs');
14
14
  require('path');
15
- var project_paths = require('./project_paths-Bl-H7Vlb.js');
16
- var apply_import_manager = require('./apply_import_manager-Coc7Hewu.js');
17
- var index = require('./index-CnKffIJ6.js');
15
+ var project_paths = require('./project_paths-DmvzlTQL.cjs');
16
+ var apply_import_manager = require('./apply_import_manager-BqwxKJiu.cjs');
17
+ var index = require('./index-CFmTQ_wx.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
20
20
  require('fs');
21
21
  require('module');
22
22
  require('url');
23
23
  require('@angular-devkit/schematics');
24
- require('./project_tsconfig_paths-CDVxT6Ov.js');
24
+ require('./project_tsconfig_paths-CDVxT6Ov.cjs');
25
25
 
26
26
  function isOutputDeclarationEligibleForMigration(node) {
27
27
  return (node.initializer !== undefined &&
@@ -456,13 +456,11 @@ class OutputMigration extends project_paths.TsurgeFunnelMigration {
456
456
  const problematicOutputs = new Set(Object.keys(globalMetadata.problematicUsages)).size +
457
457
  globalMetadata.problematicDeclarationCount;
458
458
  const successRate = detectedOutputs > 0 ? (detectedOutputs - problematicOutputs) / detectedOutputs : 1;
459
- return {
460
- counters: {
461
- detectedOutputs,
462
- problematicOutputs,
463
- successRate,
464
- },
465
- };
459
+ return project_paths.confirmAsSerializable({
460
+ detectedOutputs,
461
+ problematicOutputs,
462
+ successRate,
463
+ });
466
464
  }
467
465
  async migrate(globalData) {
468
466
  const migratedFiles = new Set();
@@ -594,8 +592,7 @@ function migrate(options) {
594
592
  afterAnalysisFailure: () => {
595
593
  context.logger.error('Migration failed unexpectedly with no analysis data');
596
594
  },
597
- whenDone: ({ counters }) => {
598
- const { detectedOutputs, problematicOutputs, successRate } = counters;
595
+ whenDone: ({ detectedOutputs, problematicOutputs, successRate }) => {
599
596
  const migratedOutputs = detectedOutputs - problematicOutputs;
600
597
  const successRatePercent = (successRate * 100).toFixed(2);
601
598
  context.logger.info('');
@@ -1,21 +1,21 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- var index = require('./index-CxuDmkeg.js');
9
+ var index = require('./index-1H-qYSW6.cjs');
10
10
  var schematics = require('@angular-devkit/schematics');
11
11
  var core = require('@angular-devkit/core');
12
12
  var posixPath = require('node:path/posix');
13
13
  var os = require('os');
14
14
  var ts = require('typescript');
15
- var checker = require('./checker-BAl7CJ0l.js');
16
- require('./compiler-BSv6JWRF.js');
15
+ var checker = require('./checker-DmucNdBi.cjs');
16
+ require('./compiler-DPq1iS19.cjs');
17
17
  require('path');
18
- var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
18
+ var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.cjs');
19
19
 
20
20
  function _interopNamespaceDefault(e) {
21
21
  var n = Object.create(null);
@@ -481,7 +481,7 @@ function createPlainTsProgram(tsHost, tsconfig, optionOverrides) {
481
481
  ngCompiler: null,
482
482
  program,
483
483
  userOptions: tsconfig.options,
484
- programAbsoluteRootFileNames: tsconfig.rootNames,
484
+ __programAbsoluteRootFileNames: tsconfig.rootNames,
485
485
  host: tsHost,
486
486
  };
487
487
  }
@@ -504,7 +504,7 @@ function createNgtscProgram(tsHost, tsconfig, optionOverrides) {
504
504
  ngCompiler: ngtscProgram.compiler,
505
505
  program: ngtscProgram.getTsProgram(),
506
506
  userOptions: tsconfig.options,
507
- programAbsoluteRootFileNames: tsconfig.rootNames,
507
+ __programAbsoluteRootFileNames: tsconfig.rootNames,
508
508
  host: tsHost,
509
509
  };
510
510
  }
@@ -525,10 +525,10 @@ function parseTsconfigOrDie(absoluteTsconfigPath, fs) {
525
525
 
526
526
  /** Creates the base program info for the given tsconfig path. */
527
527
  function createBaseProgramInfo(absoluteTsconfigPath, fs, optionOverrides = {}) {
528
- if (fs === undefined) {
529
- fs = new checker.NodeJSFileSystem();
530
- checker.setFileSystem(fs);
531
- }
528
+ // Make sure the FS becomes globally available. Some code paths
529
+ // of the Angular compiler, or tsconfig parsing aren't leveraging
530
+ // the specified file system.
531
+ checker.setFileSystem(fs);
532
532
  const tsconfig = parseTsconfigOrDie(absoluteTsconfigPath, fs);
533
533
  const tsHost = new NgtscCompilerHost(fs, tsconfig.options);
534
534
  // When enabled, use a plain TS program if we are sure it's not
@@ -539,6 +539,33 @@ function createBaseProgramInfo(absoluteTsconfigPath, fs, optionOverrides = {}) {
539
539
  }
540
540
  return createNgtscProgram(tsHost, tsconfig, optionOverrides);
541
541
  }
542
+ /**
543
+ * Creates the {@link ProgramInfo} from the given base information.
544
+ *
545
+ * This function purely exists to support custom programs that are
546
+ * intended to be injected into Tsurge migrations. e.g. for language
547
+ * service refactorings.
548
+ */
549
+ function getProgramInfoFromBaseInfo(baseInfo) {
550
+ const fullProgramSourceFiles = [...baseInfo.program.getSourceFiles()];
551
+ const sourceFiles = fullProgramSourceFiles.filter((f) => !f.isDeclarationFile &&
552
+ // Note `isShim` will work for the initial program, but for TCB programs, the shims are no longer annotated.
553
+ !checker.isShim(f) &&
554
+ !f.fileName.endsWith('.ngtypecheck.ts'));
555
+ // Sort it by length in reverse order (longest first). This speeds up lookups,
556
+ // since there's no need to keep going through the array once a match is found.
557
+ const sortedRootDirs = checker.getRootDirs(baseInfo.host, baseInfo.userOptions).sort((a, b) => b.length - a.length);
558
+ // TODO: Consider also following TS's logic here, finding the common source root.
559
+ // See: Program#getCommonSourceDirectory.
560
+ const primaryRoot = checker.absoluteFrom(baseInfo.userOptions.rootDir ?? sortedRootDirs.at(-1) ?? baseInfo.program.getCurrentDirectory());
561
+ return {
562
+ ...baseInfo,
563
+ sourceFiles,
564
+ fullProgramSourceFiles,
565
+ sortedRootDirs,
566
+ projectRoot: primaryRoot,
567
+ };
568
+ }
542
569
 
543
570
  /**
544
571
  * @private
@@ -550,37 +577,14 @@ function createBaseProgramInfo(absoluteTsconfigPath, fs, optionOverrides = {}) {
550
577
  */
551
578
  class TsurgeBaseMigration {
552
579
  /**
553
- * Advanced Tsurge users can override this method, but most of the time,
554
- * overriding {@link prepareProgram} is more desirable.
580
+ * Creates the TypeScript program for a given compilation unit.
555
581
  *
556
582
  * By default:
557
583
  * - In 3P: Ngtsc programs are being created.
558
584
  * - In 1P: Ngtsc or TS programs are created based on the Blaze target.
559
585
  */
560
- createProgram(tsconfigAbsPath, fs, optionOverrides) {
561
- return createBaseProgramInfo(tsconfigAbsPath, fs, optionOverrides);
562
- }
563
- // Optional function to prepare the base `ProgramInfo` even further,
564
- // for the analyze and migrate phases. E.g. determining source files.
565
- prepareProgram(info) {
566
- const fullProgramSourceFiles = [...info.program.getSourceFiles()];
567
- const sourceFiles = fullProgramSourceFiles.filter((f) => !f.isDeclarationFile &&
568
- // Note `isShim` will work for the initial program, but for TCB programs, the shims are no longer annotated.
569
- !checker.isShim(f) &&
570
- !f.fileName.endsWith('.ngtypecheck.ts'));
571
- // Sort it by length in reverse order (longest first). This speeds up lookups,
572
- // since there's no need to keep going through the array once a match is found.
573
- const sortedRootDirs = checker.getRootDirs(info.host, info.userOptions).sort((a, b) => b.length - a.length);
574
- // TODO: Consider also following TS's logic here, finding the common source root.
575
- // See: Program#getCommonSourceDirectory.
576
- const primaryRoot = checker.absoluteFrom(info.userOptions.rootDir ?? sortedRootDirs.at(-1) ?? info.program.getCurrentDirectory());
577
- return {
578
- ...info,
579
- sourceFiles,
580
- fullProgramSourceFiles,
581
- sortedRootDirs,
582
- projectRoot: primaryRoot,
583
- };
586
+ createProgram(tsconfigAbsPath, fs, optionsOverride) {
587
+ return getProgramInfoFromBaseInfo(createBaseProgramInfo(tsconfigAbsPath, fs, optionsOverride));
584
588
  }
585
589
  }
586
590
 
@@ -636,10 +640,11 @@ async function runMigrationInDevkit(config) {
636
640
  const migration = config.getMigration(fs);
637
641
  const unitResults = [];
638
642
  const isFunnelMigration = migration instanceof TsurgeFunnelMigration;
643
+ const compilationUnitAssignments = new Map();
639
644
  for (const tsconfigPath of tsconfigPaths) {
640
645
  config.beforeProgramCreation?.(tsconfigPath, exports.MigrationStage.Analysis);
641
- const baseInfo = migration.createProgram(tsconfigPath, fs);
642
- const info = migration.prepareProgram(baseInfo);
646
+ const info = migration.createProgram(tsconfigPath, fs);
647
+ modifyProgramInfoToEnsureNonOverlappingFiles(tsconfigPath, info, compilationUnitAssignments);
643
648
  config.afterProgramCreation?.(info, fs, exports.MigrationStage.Analysis);
644
649
  config.beforeUnitAnalysis?.(tsconfigPath);
645
650
  unitResults.push(await migration.analyze(info));
@@ -659,8 +664,8 @@ async function runMigrationInDevkit(config) {
659
664
  replacements = [];
660
665
  for (const tsconfigPath of tsconfigPaths) {
661
666
  config.beforeProgramCreation?.(tsconfigPath, exports.MigrationStage.Migrate);
662
- const baseInfo = migration.createProgram(tsconfigPath, fs);
663
- const info = migration.prepareProgram(baseInfo);
667
+ const info = migration.createProgram(tsconfigPath, fs);
668
+ modifyProgramInfoToEnsureNonOverlappingFiles(tsconfigPath, info, compilationUnitAssignments);
664
669
  config.afterProgramCreation?.(info, fs, exports.MigrationStage.Migrate);
665
670
  const result = await migration.migrate(globalMeta, info);
666
671
  replacements.push(...result.replacements);
@@ -684,6 +689,31 @@ async function runMigrationInDevkit(config) {
684
689
  }
685
690
  config.whenDone?.(await migration.stats(globalMeta));
686
691
  }
692
+ /**
693
+ * Special logic for devkit migrations. In the Angular CLI, or in 3P precisely,
694
+ * projects can have tsconfigs with overlapping source files. i.e. two tsconfigs
695
+ * like e.g. build or test include the same `ts.SourceFile` (`.ts`). Migrations
696
+ * should never have 2+ compilation units with overlapping source files as this
697
+ * can result in duplicated replacements or analysis— hence we only ever assign a
698
+ * source file to a compilation unit *once*.
699
+ *
700
+ * Note that this is fine as we expect Tsurge migrations to work together as
701
+ * isolated compilation units— so it shouldn't matter if worst case a `.ts`
702
+ * file ends up in the e.g. test program.
703
+ */
704
+ function modifyProgramInfoToEnsureNonOverlappingFiles(tsconfigPath, info, compilationUnitAssignments) {
705
+ const sourceFiles = [];
706
+ for (const sf of info.sourceFiles) {
707
+ const assignment = compilationUnitAssignments.get(sf.fileName);
708
+ // File is already assigned to a different compilation unit.
709
+ if (assignment !== undefined && assignment !== tsconfigPath) {
710
+ continue;
711
+ }
712
+ compilationUnitAssignments.set(sf.fileName, tsconfigPath);
713
+ sourceFiles.push(sf);
714
+ }
715
+ info.sourceFiles = sourceFiles;
716
+ }
687
717
 
688
718
  /** A text replacement for the given file. */
689
719
  class Replacement {
@@ -751,6 +781,5 @@ exports.TextUpdate = TextUpdate;
751
781
  exports.TsurgeComplexMigration = TsurgeComplexMigration;
752
782
  exports.TsurgeFunnelMigration = TsurgeFunnelMigration;
753
783
  exports.confirmAsSerializable = confirmAsSerializable;
754
- exports.createBaseProgramInfo = createBaseProgramInfo;
755
784
  exports.projectFile = projectFile;
756
785
  exports.runMigrationInDevkit = runMigrationInDevkit;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.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-rc.0
3
+ * @license Angular v20.0.0-rc.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-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -9,13 +9,13 @@
9
9
  var schematics = require('@angular-devkit/schematics');
10
10
  var fs = require('fs');
11
11
  var p = require('path');
12
- var change_tracker = require('./change_tracker-CDJPOAni.js');
13
- var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.js');
14
- var compiler_host = require('./compiler_host-CAfDJO3W.js');
12
+ var change_tracker = require('./change_tracker-B1qegJFu.cjs');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.cjs');
14
+ var compiler_host = require('./compiler_host-CAfDJO3W.cjs');
15
15
  var ts = require('typescript');
16
- var checker = require('./checker-BAl7CJ0l.js');
17
- var property_name = require('./property_name-BBwFuqMe.js');
18
- require('./compiler-BSv6JWRF.js');
16
+ var checker = require('./checker-DmucNdBi.cjs');
17
+ var property_name = require('./property_name-BBwFuqMe.cjs');
18
+ require('./compiler-DPq1iS19.cjs');
19
19
  require('os');
20
20
  require('@angular-devkit/core');
21
21
  require('module');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,21 +8,21 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var checker = require('./checker-BAl7CJ0l.js');
12
- var compiler = require('./compiler-BSv6JWRF.js');
13
- require('./index-CxuDmkeg.js');
11
+ var checker = require('./checker-DmucNdBi.cjs');
12
+ var compiler = require('./compiler-DPq1iS19.cjs');
13
+ require('./index-1H-qYSW6.cjs');
14
14
  require('path');
15
- var project_paths = require('./project_paths-Bl-H7Vlb.js');
16
- var ng_decorators = require('./ng_decorators-DznZ5jMl.js');
17
- var property_name = require('./property_name-BBwFuqMe.js');
15
+ var project_paths = require('./project_paths-DmvzlTQL.cjs');
16
+ var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
17
+ var property_name = require('./property_name-BBwFuqMe.cjs');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
20
20
  require('fs');
21
21
  require('module');
22
22
  require('url');
23
23
  require('@angular-devkit/schematics');
24
- require('./project_tsconfig_paths-CDVxT6Ov.js');
25
- require('./imports-CIX-JgAN.js');
24
+ require('./project_tsconfig_paths-CDVxT6Ov.cjs');
25
+ require('./imports-CIX-JgAN.cjs');
26
26
 
27
27
  /**
28
28
  * Unwraps a given expression TypeScript node. Expressions can be wrapped within multiple
@@ -346,11 +346,9 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
346
346
  return project_paths.confirmAsSerializable({ tagReplacements });
347
347
  }
348
348
  async combine(unitA, unitB) {
349
- const uniqueReplacements = removeDuplicateReplacements([
350
- ...unitA.tagReplacements,
351
- ...unitB.tagReplacements,
352
- ]);
353
- return project_paths.confirmAsSerializable({ tagReplacements: uniqueReplacements });
349
+ return project_paths.confirmAsSerializable({
350
+ tagReplacements: [...unitA.tagReplacements, ...unitB.tagReplacements],
351
+ });
354
352
  }
355
353
  async globalMeta(combinedData) {
356
354
  const globalMeta = {
@@ -361,12 +359,10 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
361
359
  async stats(globalMetadata) {
362
360
  const touchedFilesCount = globalMetadata.tagReplacements.length;
363
361
  const replacementCount = globalMetadata.tagReplacements.reduce((acc, cur) => acc + cur.replacementCount, 0);
364
- return {
365
- counters: {
366
- touchedFilesCount,
367
- replacementCount,
368
- },
369
- };
362
+ return project_paths.confirmAsSerializable({
363
+ touchedFilesCount,
364
+ replacementCount,
365
+ });
370
366
  }
371
367
  async migrate(globalData) {
372
368
  return { replacements: globalData.tagReplacements.flatMap(({ replacements }) => replacements) };
@@ -379,18 +375,6 @@ function prepareTextReplacement(file, replacement, start, end) {
379
375
  toInsert: replacement,
380
376
  }));
381
377
  }
382
- function removeDuplicateReplacements(replacements) {
383
- const uniqueFiles = new Set();
384
- const result = [];
385
- for (const replacement of replacements) {
386
- const fileId = replacement.file.id;
387
- if (!uniqueFiles.has(fileId)) {
388
- uniqueFiles.add(fileId);
389
- result.push(replacement);
390
- }
391
- }
392
- return result;
393
- }
394
378
 
395
379
  function migrate(options) {
396
380
  return async (tree, context) => {
@@ -421,8 +405,7 @@ function migrate(options) {
421
405
  afterAnalysisFailure: () => {
422
406
  context.logger.error('Migration failed unexpectedly with no analysis data');
423
407
  },
424
- whenDone: ({ counters }) => {
425
- const { touchedFilesCount, replacementCount } = counters;
408
+ whenDone: ({ touchedFilesCount, replacementCount }) => {
426
409
  context.logger.info('');
427
410
  context.logger.info(`Successfully migrated to self-closing tags 🎉`);
428
411
  context.logger.info(` -> Migrated ${replacementCount} components to self-closing tags in ${touchedFilesCount} component files.`);
@@ -1,30 +1,30 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-rc.0
3
+ * @license Angular v20.0.0-rc.2
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- var migrate_ts_type_references = require('./migrate_ts_type_references-DE1AlxIs.js');
9
+ var migrate_ts_type_references = require('./migrate_ts_type_references-B2aJNuIK.cjs');
10
10
  var ts = require('typescript');
11
11
  require('os');
12
- var checker = require('./checker-BAl7CJ0l.js');
13
- require('./compiler-BSv6JWRF.js');
14
- var index$1 = require('./index-CxuDmkeg.js');
12
+ var checker = require('./checker-DmucNdBi.cjs');
13
+ require('./compiler-DPq1iS19.cjs');
14
+ var index$1 = require('./index-1H-qYSW6.cjs');
15
15
  require('path');
16
- var project_paths = require('./project_paths-Bl-H7Vlb.js');
17
- var index = require('./index-CnKffIJ6.js');
16
+ var project_paths = require('./project_paths-DmvzlTQL.cjs');
17
+ var index = require('./index-CFmTQ_wx.cjs');
18
18
  var assert = require('assert');
19
- var apply_import_manager = require('./apply_import_manager-Coc7Hewu.js');
19
+ var apply_import_manager = require('./apply_import_manager-BqwxKJiu.cjs');
20
20
  require('@angular-devkit/core');
21
21
  require('node:path/posix');
22
- require('./leading_space-D9nQ8UQC.js');
22
+ require('./leading_space-D9nQ8UQC.cjs');
23
23
  require('fs');
24
24
  require('module');
25
25
  require('url');
26
26
  require('@angular-devkit/schematics');
27
- require('./project_tsconfig_paths-CDVxT6Ov.js');
27
+ require('./project_tsconfig_paths-CDVxT6Ov.cjs');
28
28
 
29
29
  /**
30
30
  * Class that holds information about a given directive and its input fields.
@@ -1264,9 +1264,8 @@ class SignalInputMigration extends project_paths.TsurgeComplexMigration {
1264
1264
  super();
1265
1265
  this.config = config;
1266
1266
  }
1267
- // Override the default program creation, to add extra flags.
1268
1267
  createProgram(tsconfigAbsPath, fs) {
1269
- return project_paths.createBaseProgramInfo(tsconfigAbsPath, fs, {
1268
+ return super.createProgram(tsconfigAbsPath, fs, {
1270
1269
  _compilePoisonedComponents: true,
1271
1270
  // We want to migrate non-exported classes too.
1272
1271
  compileNonExportedClasses: true,
@@ -1276,8 +1275,11 @@ class SignalInputMigration extends project_paths.TsurgeComplexMigration {
1276
1275
  strictTemplates: true,
1277
1276
  });
1278
1277
  }
1279
- prepareProgram(baseInfo) {
1280
- const info = super.prepareProgram(baseInfo);
1278
+ /**
1279
+ * Prepares the program for this migration with additional custom
1280
+ * fields to allow for batch-mode testing.
1281
+ */
1282
+ _prepareProgram(info) {
1281
1283
  // Optional filter for testing. Allows for simulation of parallel execution
1282
1284
  // even if some tsconfig's have overlap due to sharing of TS sources.
1283
1285
  // (this is commonly not the case in g3 where deps are `.d.ts` files).
@@ -1286,7 +1288,7 @@ class SignalInputMigration extends project_paths.TsurgeComplexMigration {
1286
1288
  // Optional replacement filter. Allows parallel execution in case
1287
1289
  // some tsconfig's have overlap due to sharing of TS sources.
1288
1290
  // (this is commonly not the case in g3 where deps are `.d.ts` files).
1289
- !limitToRootNamesOnly || info.programAbsoluteRootFileNames.includes(f.fileName));
1291
+ !limitToRootNamesOnly || info.__programAbsoluteRootFileNames.includes(f.fileName));
1290
1292
  return {
1291
1293
  ...info,
1292
1294
  sourceFiles: filteredSourceFiles,
@@ -1296,11 +1298,12 @@ class SignalInputMigration extends project_paths.TsurgeComplexMigration {
1296
1298
  prepareAnalysisDeps(info) {
1297
1299
  const analysisInfo = {
1298
1300
  ...info,
1299
- ...prepareAnalysisInfo(info.program, info.ngCompiler, info.programAbsoluteRootFileNames),
1301
+ ...prepareAnalysisInfo(info.program, info.ngCompiler, info.__programAbsoluteRootFileNames),
1300
1302
  };
1301
1303
  return analysisInfo;
1302
1304
  }
1303
1305
  async analyze(info) {
1306
+ info = this._prepareProgram(info);
1304
1307
  const analysisDeps = this.prepareAnalysisDeps(info);
1305
1308
  const knownInputs = new KnownInputs(info, this.config);
1306
1309
  const result = new MigrationResult();
@@ -1347,6 +1350,7 @@ class SignalInputMigration extends project_paths.TsurgeComplexMigration {
1347
1350
  return project_paths.confirmAsSerializable(convertToGlobalMeta(combinedData));
1348
1351
  }
1349
1352
  async migrate(globalMetadata, info, nonBatchData) {
1353
+ info = this._prepareProgram(info);
1350
1354
  const knownInputs = nonBatchData?.knownInputs ?? new KnownInputs(info, this.config);
1351
1355
  const result = nonBatchData?.result ?? new MigrationResult();
1352
1356
  const host = nonBatchData?.host ?? createMigrationHost(info, this.config);
@@ -1397,15 +1401,13 @@ class SignalInputMigration extends project_paths.TsurgeComplexMigration {
1397
1401
  classIncompatibleCounts[key]++;
1398
1402
  }
1399
1403
  }
1400
- return {
1401
- counters: {
1402
- fullCompilationInputs,
1403
- sourceInputs,
1404
- incompatibleInputs,
1405
- ...fieldIncompatibleCounts,
1406
- ...classIncompatibleCounts,
1407
- },
1408
- };
1404
+ return project_paths.confirmAsSerializable({
1405
+ fullCompilationInputs,
1406
+ sourceInputs,
1407
+ incompatibleInputs,
1408
+ ...fieldIncompatibleCounts,
1409
+ ...classIncompatibleCounts,
1410
+ });
1409
1411
  }
1410
1412
  }
1411
1413
  /**
@@ -1471,8 +1473,7 @@ function migrate(options) {
1471
1473
  afterAnalysisFailure: () => {
1472
1474
  context.logger.error('Migration failed unexpectedly with no analysis data');
1473
1475
  },
1474
- whenDone: ({ counters }) => {
1475
- const { sourceInputs, incompatibleInputs } = counters;
1476
+ whenDone: ({ sourceInputs, incompatibleInputs }) => {
1476
1477
  const migratedInputs = sourceInputs - incompatibleInputs;
1477
1478
  context.logger.info('');
1478
1479
  context.logger.info(`Successfully migrated to signal inputs 🎉`);