@angular/core 20.0.0-next.5 → 20.0.0-next.6

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 (68) hide show
  1. package/{api.d-mxcXqDpA.d.ts → api.d-DQLNOR5l.d.ts} +4 -4
  2. package/{discovery.d-CyYpOJ7j.d.ts → discovery.d-CFs2MaLO.d.ts} +7 -17
  3. package/{event_dispatcher.d-PWnbqZDx.d.ts → event_dispatcher.d-DlbccpYq.d.ts} +3 -3
  4. package/fesm2022/{attribute-B17mgaqe.mjs → attribute-BWp59EjE.mjs} +3 -3
  5. package/fesm2022/{attribute-B17mgaqe.mjs.map → attribute-BWp59EjE.mjs.map} +1 -1
  6. package/fesm2022/core.mjs +20 -18
  7. package/fesm2022/core.mjs.map +1 -1
  8. package/fesm2022/{debug_node-xKpCIZm-.mjs → debug_node-z_3NG8qT.mjs} +77 -68
  9. package/fesm2022/{debug_node-xKpCIZm-.mjs.map → debug_node-z_3NG8qT.mjs.map} +1 -1
  10. package/fesm2022/primitives/di.mjs +1 -1
  11. package/fesm2022/primitives/event-dispatch.mjs +2 -2
  12. package/fesm2022/primitives/signals.mjs +5 -5
  13. package/fesm2022/{resource-BPpYEDic.mjs → resource-CPPwEcg7.mjs} +6 -8
  14. package/fesm2022/resource-CPPwEcg7.mjs.map +1 -0
  15. package/fesm2022/{root_effect_scheduler-D0_b1cf_.mjs → root_effect_scheduler-VSXfCzDX.mjs} +46 -15
  16. package/fesm2022/root_effect_scheduler-VSXfCzDX.mjs.map +1 -0
  17. package/fesm2022/rxjs-interop.mjs +7 -84
  18. package/fesm2022/rxjs-interop.mjs.map +1 -1
  19. package/fesm2022/{signal-DhRAAi7R.mjs → signal-B6pMq7KS.mjs} +3 -3
  20. package/fesm2022/{signal-DhRAAi7R.mjs.map → signal-B6pMq7KS.mjs.map} +1 -1
  21. package/fesm2022/testing.mjs +165 -103
  22. package/fesm2022/testing.mjs.map +1 -1
  23. package/fesm2022/{untracked-DaaW3JJm.mjs → untracked-Bz5WMeU1.mjs} +4 -4
  24. package/fesm2022/{untracked-DaaW3JJm.mjs.map → untracked-Bz5WMeU1.mjs.map} +1 -1
  25. package/fesm2022/{weak_ref-DrMdAIDh.mjs → weak_ref-BaIq-pgY.mjs} +3 -3
  26. package/fesm2022/{weak_ref-DrMdAIDh.mjs.map → weak_ref-BaIq-pgY.mjs.map} +1 -1
  27. package/{graph.d-StYigYp1.d.ts → graph.d-BcIOep_B.d.ts} +3 -3
  28. package/index.d.ts +18 -20
  29. package/{ng_i18n_closure_mode.d-DLxSUiDr.d.ts → ng_i18n_closure_mode.d-C9d2CaSt.d.ts} +5 -5
  30. package/package.json +2 -2
  31. package/primitives/di/index.d.ts +1 -1
  32. package/primitives/event-dispatch/index.d.ts +3 -3
  33. package/primitives/signals/index.d.ts +6 -6
  34. package/rxjs-interop/index.d.ts +8 -17
  35. package/schematics/bundles/{apply_import_manager-C-ysxahq.js → apply_import_manager-DnMqg1pY.js} +6 -6
  36. package/schematics/bundles/{change_tracker-0Ktek5Xl.js → change_tracker-UMPkv-eH.js} +3 -3
  37. package/schematics/bundles/{checker-DqUKCGda.js → checker-BFBQyesT.js} +20 -3
  38. package/schematics/bundles/cleanup-unused-imports.js +25 -20
  39. package/schematics/bundles/{compiler-CuoiHqkc.js → compiler-BQ7R7w2v.js} +962 -297
  40. package/schematics/bundles/compiler_host-CAfDJO3W.js +1 -1
  41. package/schematics/bundles/control-flow-migration.js +2 -2
  42. package/schematics/bundles/document-core.js +12 -12
  43. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  44. package/schematics/bundles/{index-WFXCe5Q0.js → index-Cv4Q415G.js} +127 -36
  45. package/schematics/bundles/{index-CwFQSYXZ.js → index-D8tMJPKa.js} +10 -10
  46. package/schematics/bundles/inject-flags.js +14 -14
  47. package/schematics/bundles/inject-migration.js +4 -4
  48. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  49. package/schematics/bundles/{migrate_ts_type_references-BNuHufqZ.js → migrate_ts_type_references-Cq_ZBuT4.js} +21 -21
  50. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  51. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  52. package/schematics/bundles/output-migration.js +80 -22
  53. package/schematics/bundles/{run_in_devkit-CmHxABFr.js → project_paths-ql6qcf_c.js} +254 -244
  54. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  55. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  56. package/schematics/bundles/route-lazy-loading.js +4 -4
  57. package/schematics/bundles/self-closing-tags-migration.js +20 -15
  58. package/schematics/bundles/signal-input-migration.js +26 -21
  59. package/schematics/bundles/signal-queries-migration.js +32 -27
  60. package/schematics/bundles/signals.js +8 -8
  61. package/schematics/bundles/standalone-migration.js +5 -5
  62. package/schematics/bundles/symbol-VPWguRxr.js +1 -1
  63. package/schematics/bundles/test-bed-get.js +13 -13
  64. package/{signal.d-BeaTIeOE.d.ts → signal.d-E0e5nW1p.d.ts} +4 -4
  65. package/testing/index.d.ts +9 -25
  66. package/{weak_ref.d-ttyj86RV.d.ts → weak_ref.d-eGOEP9S1.d.ts} +2 -2
  67. package/fesm2022/resource-BPpYEDic.mjs.map +0 -1
  68. package/fesm2022/root_effect_scheduler-D0_b1cf_.mjs.map +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.5
3
+ * @license Angular v20.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,12 +8,12 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var checker = require('./checker-DqUKCGda.js');
12
- require('./compiler-CuoiHqkc.js');
13
- require('./index-WFXCe5Q0.js');
11
+ var checker = require('./checker-BFBQyesT.js');
12
+ require('./compiler-BQ7R7w2v.js');
13
+ require('./index-Cv4Q415G.js');
14
14
  require('path');
15
- var run_in_devkit = require('./run_in_devkit-CmHxABFr.js');
16
- var apply_import_manager = require('./apply_import_manager-C-ysxahq.js');
15
+ var project_paths = require('./project_paths-ql6qcf_c.js');
16
+ var apply_import_manager = require('./apply_import_manager-DnMqg1pY.js');
17
17
  var imports = require('./imports-CIX-JgAN.js');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
@@ -32,7 +32,7 @@ const FLAGS_TO_FIELDS = {
32
32
  'SkipSelf': 'skipSelf',
33
33
  };
34
34
  /** Migration that replaces `InjectFlags` usages with object literals. */
35
- class InjectFlagsMigration extends run_in_devkit.TsurgeFunnelMigration {
35
+ class InjectFlagsMigration extends project_paths.TsurgeFunnelMigration {
36
36
  async analyze(info) {
37
37
  const locations = {};
38
38
  const importRemovals = {};
@@ -41,7 +41,7 @@ class InjectFlagsMigration extends run_in_devkit.TsurgeFunnelMigration {
41
41
  if (specifier === null) {
42
42
  continue;
43
43
  }
44
- const file = run_in_devkit.projectFile(sourceFile, info);
44
+ const file = project_paths.projectFile(sourceFile, info);
45
45
  const importManager = new checker.ImportManager();
46
46
  const importReplacements = [];
47
47
  // Always remove the `InjectFlags` since it has been removed from Angular.
@@ -73,7 +73,7 @@ class InjectFlagsMigration extends run_in_devkit.TsurgeFunnelMigration {
73
73
  }
74
74
  });
75
75
  }
76
- return run_in_devkit.confirmAsSerializable({ locations, importRemovals });
76
+ return project_paths.confirmAsSerializable({ locations, importRemovals });
77
77
  }
78
78
  async migrate(globalData) {
79
79
  const replacements = [];
@@ -84,12 +84,12 @@ class InjectFlagsMigration extends run_in_devkit.TsurgeFunnelMigration {
84
84
  // Declare a property for each flag, except for `default` which does not have a flag.
85
85
  const properties = flags.filter((flag) => flag !== 'default').map((flag) => `${flag}: true`);
86
86
  const toInsert = properties.length ? `{ ${properties.join(', ')} }` : '{}';
87
- replacements.push(new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({ position, end, toInsert })));
87
+ replacements.push(new project_paths.Replacement(file, new project_paths.TextUpdate({ position, end, toInsert })));
88
88
  }
89
- return run_in_devkit.confirmAsSerializable({ replacements });
89
+ return project_paths.confirmAsSerializable({ replacements });
90
90
  }
91
91
  async combine(unitA, unitB) {
92
- return run_in_devkit.confirmAsSerializable({
92
+ return project_paths.confirmAsSerializable({
93
93
  locations: {
94
94
  ...unitA.locations,
95
95
  ...unitB.locations,
@@ -101,7 +101,7 @@ class InjectFlagsMigration extends run_in_devkit.TsurgeFunnelMigration {
101
101
  });
102
102
  }
103
103
  async globalMeta(combinedData) {
104
- return run_in_devkit.confirmAsSerializable(combinedData);
104
+ return project_paths.confirmAsSerializable(combinedData);
105
105
  }
106
106
  async stats() {
107
107
  return { counters: {} };
@@ -138,7 +138,7 @@ function getInjectFlagsRootExpression(start) {
138
138
 
139
139
  function migrate() {
140
140
  return async (tree) => {
141
- await run_in_devkit.runMigrationInDevkit({
141
+ await project_paths.runMigrationInDevkit({
142
142
  tree,
143
143
  getMigration: () => new InjectFlagsMigration(),
144
144
  });
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.5
3
+ * @license Angular v20.0.0-next.6
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-0Ktek5Xl.js');
11
+ var change_tracker = require('./change_tracker-UMPkv-eH.js');
12
12
  var compiler_host = require('./compiler_host-CAfDJO3W.js');
13
13
  var ts = require('typescript');
14
14
  var ng_decorators = require('./ng_decorators-DznZ5jMl.js');
15
15
  var imports = require('./imports-CIX-JgAN.js');
16
16
  var nodes = require('./nodes-B16H9JUd.js');
17
17
  var leading_space = require('./leading_space-D9nQ8UQC.js');
18
- require('./compiler-CuoiHqkc.js');
19
- require('./checker-DqUKCGda.js');
18
+ require('./compiler-BQ7R7w2v.js');
19
+ require('./checker-BFBQyesT.js');
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-next.5
3
+ * @license Angular v20.0.0-next.6
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-next.5
3
+ * @license Angular v20.0.0-next.6
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-CuoiHqkc.js');
9
+ require('./compiler-BQ7R7w2v.js');
10
10
  var ts = require('typescript');
11
- var checker = require('./checker-DqUKCGda.js');
11
+ var checker = require('./checker-BFBQyesT.js');
12
12
  require('os');
13
13
  var assert = require('assert');
14
- var index = require('./index-CwFQSYXZ.js');
15
- var run_in_devkit = require('./run_in_devkit-CmHxABFr.js');
14
+ var index = require('./index-D8tMJPKa.js');
15
+ var project_paths = require('./project_paths-ql6qcf_c.js');
16
16
  var leading_space = require('./leading_space-D9nQ8UQC.js');
17
- require('./index-WFXCe5Q0.js');
17
+ require('./index-Cv4Q415G.js');
18
18
  require('path');
19
19
 
20
20
  /**
@@ -913,7 +913,7 @@ function removeFromUnionIfPossible(union, filter) {
913
913
  */
914
914
  function insertPrecedingLine(node, info, text) {
915
915
  const leadingSpace = leading_space.getLeadingLineWhitespaceOfNode(node);
916
- return new run_in_devkit.Replacement(run_in_devkit.projectFile(node.getSourceFile(), info), new run_in_devkit.TextUpdate({
916
+ return new project_paths.Replacement(project_paths.projectFile(node.getSourceFile(), info), new project_paths.TextUpdate({
917
917
  position: node.getStart(),
918
918
  end: node.getStart(),
919
919
  toInsert: `${text}\n${leadingSpace}`,
@@ -1254,20 +1254,20 @@ function createNewBlockToInsertVariable(node, file, toInsert) {
1254
1254
  const contentSpace = ' '.repeat(character + 2);
1255
1255
  return [
1256
1256
  // Delete leading whitespace of the concise body.
1257
- new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
1257
+ new project_paths.Replacement(file, new project_paths.TextUpdate({
1258
1258
  position: node.body.getFullStart(),
1259
1259
  end: node.body.getStart(),
1260
1260
  toInsert: '',
1261
1261
  })),
1262
1262
  // Insert leading block braces, and `toInsert` content.
1263
1263
  // Wrap the previous expression in a return now.
1264
- new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
1264
+ new project_paths.Replacement(file, new project_paths.TextUpdate({
1265
1265
  position: node.body.getStart(),
1266
1266
  end: node.body.getStart(),
1267
1267
  toInsert: ` {\n${contentSpace}${toInsert}\n${contentSpace}return `,
1268
1268
  })),
1269
1269
  // Add trailing brace.
1270
- new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
1270
+ new project_paths.Replacement(file, new project_paths.TextUpdate({
1271
1271
  position: node.body.getEnd(),
1272
1272
  end: node.body.getEnd(),
1273
1273
  toInsert: `;\n${blockSpace}}`,
@@ -1297,7 +1297,7 @@ function migrateBindingElementInputReference(tsReferencesInBindingElements, info
1297
1297
  const bindingElement = reference.parent;
1298
1298
  const bindingDecl = index.getBindingElementDeclaration(bindingElement);
1299
1299
  const sourceFile = bindingElement.getSourceFile();
1300
- const file = run_in_devkit.projectFile(sourceFile, info);
1300
+ const file = project_paths.projectFile(sourceFile, info);
1301
1301
  const inputFieldName = bindingElement.propertyName ?? bindingElement.name;
1302
1302
  assert(!ts.isObjectBindingPattern(inputFieldName) && !ts.isArrayBindingPattern(inputFieldName), 'Property of binding element cannot be another pattern.');
1303
1303
  const tmpName = nameGenerator.generate(reference.text, bindingElement);
@@ -1315,7 +1315,7 @@ function migrateBindingElementInputReference(tsReferencesInBindingElements, info
1315
1315
  console.error(`Could not migrate reference ${reference.text} in ${file.rootRelativePath}`);
1316
1316
  continue;
1317
1317
  }
1318
- replacements.push(new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
1318
+ replacements.push(new project_paths.Replacement(file, new project_paths.TextUpdate({
1319
1319
  position: bindingElement.getStart(),
1320
1320
  end: bindingElement.getEnd(),
1321
1321
  toInsert: printer.printNode(ts.EmitHint.Unspecified, newBindingToAccessInputField, sourceFile),
@@ -1340,7 +1340,7 @@ function insertTemporaryVariableForBindingElement(expansionDecl, file, toInsert)
1340
1340
  const leadingSpace = ' '.repeat(leadingSpaceCount);
1341
1341
  const statement = parent.parent;
1342
1342
  return [
1343
- new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
1343
+ new project_paths.Replacement(file, new project_paths.TextUpdate({
1344
1344
  position: statement.getEnd(),
1345
1345
  end: statement.getEnd(),
1346
1346
  toInsert: `\n${leadingSpace}${toInsert}`,
@@ -1358,7 +1358,7 @@ function insertTemporaryVariableForBindingElement(expansionDecl, file, toInsert)
1358
1358
  const leadingSpaceCount = ts.getLineAndCharacterOfPosition(sf, spaceReferenceNode.getStart()).character + spaceOffset;
1359
1359
  const leadingSpace = ' '.repeat(leadingSpaceCount);
1360
1360
  return [
1361
- new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
1361
+ new project_paths.Replacement(file, new project_paths.TextUpdate({
1362
1362
  position: bodyBlock.getStart() + 1,
1363
1363
  end: bodyBlock.getStart() + 1,
1364
1364
  toInsert: `\n${leadingSpace}${toInsert}`,
@@ -1759,7 +1759,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
1759
1759
  // Unwrap the signal directly.
1760
1760
  if (recommendedNode === 'preserve') {
1761
1761
  // Append `()` to unwrap the signal.
1762
- replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
1762
+ replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
1763
1763
  position: originalNode.getEnd(),
1764
1764
  end: originalNode.getEnd(),
1765
1765
  toInsert: '()',
@@ -1773,7 +1773,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
1773
1773
  const toInsert = idToSharedField.get(recommendedNode);
1774
1774
  const replaceNode = index.traverseAccess(originalNode);
1775
1775
  assert(toInsert, 'no shared variable yet available');
1776
- replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
1776
+ replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
1777
1777
  position: replaceNode.getStart(),
1778
1778
  end: replaceNode.getEnd(),
1779
1779
  toInsert,
@@ -1793,7 +1793,7 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
1793
1793
  parent = parent.parent;
1794
1794
  }
1795
1795
  const replaceNode = index.traverseAccess(originalNode);
1796
- const filePath = run_in_devkit.projectFile(sf, info);
1796
+ const filePath = project_paths.projectFile(sf, info);
1797
1797
  const initializer = `${replaceNode.getText()}()`;
1798
1798
  const fieldName = nameGenerator.generate(originalNode.text, referenceNodeInBlock);
1799
1799
  let sharedValueAccessExpr;
@@ -1815,13 +1815,13 @@ function migrateStandardTsReference(tsReferencesWithNarrowing, checker, info, re
1815
1815
  }
1816
1816
  else {
1817
1817
  const leadingSpace = ts.getLineAndCharacterOfPosition(sf, referenceNodeInBlock.getStart());
1818
- replacements.push(new run_in_devkit.Replacement(filePath, new run_in_devkit.TextUpdate({
1818
+ replacements.push(new project_paths.Replacement(filePath, new project_paths.TextUpdate({
1819
1819
  position: referenceNodeInBlock.getStart(),
1820
1820
  end: referenceNodeInBlock.getStart(),
1821
1821
  toInsert: `${temporaryVariableStr}\n${' '.repeat(leadingSpace.character)}`,
1822
1822
  })));
1823
1823
  }
1824
- replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
1824
+ replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
1825
1825
  position: replaceNode.getStart(),
1826
1826
  end: replaceNode.getEnd(),
1827
1827
  toInsert: sharedValueAccessExpr,
@@ -1930,12 +1930,12 @@ function migrateTypeScriptTypeReferences(host, references, importManager, info)
1930
1930
  exportSymbolName: 'UnwrapSignalInputs',
1931
1931
  requestedFile: sf,
1932
1932
  });
1933
- host.replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
1933
+ host.replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
1934
1934
  position: firstArg.getStart(),
1935
1935
  end: firstArg.getStart(),
1936
1936
  toInsert: `${host.printer.printNode(ts.EmitHint.Unspecified, unwrapImportExpr, sf)}<`,
1937
1937
  })));
1938
- host.replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({ position: firstArg.getEnd(), end: firstArg.getEnd(), toInsert: '>' })));
1938
+ host.replacements.push(new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({ position: firstArg.getEnd(), end: firstArg.getEnd(), toInsert: '>' })));
1939
1939
  }
1940
1940
  }
1941
1941
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.5
3
+ * @license Angular v20.0.0-next.6
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.5
3
+ * @license Angular v20.0.0-next.6
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.5
3
+ * @license Angular v20.0.0-next.6
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,13 +8,13 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var checker = require('./checker-DqUKCGda.js');
12
- var compiler = require('./compiler-CuoiHqkc.js');
13
- var index$1 = require('./index-WFXCe5Q0.js');
11
+ var checker = require('./checker-BFBQyesT.js');
12
+ var compiler = require('./compiler-BQ7R7w2v.js');
13
+ var index$1 = require('./index-Cv4Q415G.js');
14
14
  require('path');
15
- var run_in_devkit = require('./run_in_devkit-CmHxABFr.js');
16
- var apply_import_manager = require('./apply_import_manager-C-ysxahq.js');
17
- var index = require('./index-CwFQSYXZ.js');
15
+ var project_paths = require('./project_paths-ql6qcf_c.js');
16
+ var apply_import_manager = require('./apply_import_manager-DnMqg1pY.js');
17
+ var index = require('./index-D8tMJPKa.js');
18
18
  require('@angular-devkit/core');
19
19
  require('node:path/posix');
20
20
  require('fs');
@@ -91,7 +91,7 @@ function getOutputDecorator(node, reflector) {
91
91
  // THINK: this utility + type is not specific to @Output, really, maybe move it to tsurge?
92
92
  /** Computes an unique ID for a given Angular `@Output` property. */
93
93
  function getUniqueIdForProperty(info, prop) {
94
- const { id } = run_in_devkit.projectFile(prop.getSourceFile(), info);
94
+ const { id } = project_paths.projectFile(prop.getSourceFile(), info);
95
95
  id.replace(/\.d\.ts$/, '.ts');
96
96
  return `${id}@@${prop.parent.name ?? 'unknown-class'}@@${prop.name.getText()}`;
97
97
  }
@@ -174,7 +174,7 @@ function calculateImportReplacements(info, sourceFiles) {
174
174
  const importManager = new checker.ImportManager();
175
175
  const addOnly = [];
176
176
  const addRemove = [];
177
- const file = run_in_devkit.projectFile(sf, info);
177
+ const file = project_paths.projectFile(sf, info);
178
178
  importManager.addImport({
179
179
  requestedFile: sf,
180
180
  exportModuleSpecifier: '@angular/core',
@@ -230,21 +230,21 @@ function calculatePipeCallReplacement(info, node) {
230
230
  }
231
231
  function prepareTextReplacementForNode(info, node, replacement, start) {
232
232
  const sf = node.getSourceFile();
233
- return new run_in_devkit.Replacement(run_in_devkit.projectFile(sf, info), new run_in_devkit.TextUpdate({
233
+ return new project_paths.Replacement(project_paths.projectFile(sf, info), new project_paths.TextUpdate({
234
234
  position: start ?? node.getStart(),
235
235
  end: node.getEnd(),
236
236
  toInsert: replacement,
237
237
  }));
238
238
  }
239
239
  function prepareTextReplacement(file, replacement, start, end) {
240
- return new run_in_devkit.Replacement(file, new run_in_devkit.TextUpdate({
240
+ return new project_paths.Replacement(file, new project_paths.TextUpdate({
241
241
  position: start,
242
242
  end: end,
243
243
  toInsert: replacement,
244
244
  }));
245
245
  }
246
246
 
247
- class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
247
+ class OutputMigration extends project_paths.TsurgeFunnelMigration {
248
248
  config;
249
249
  constructor(config = {}) {
250
250
  super();
@@ -295,7 +295,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
295
295
  id: getUniqueIdForProperty(info, node),
296
296
  aliasParam: outputDecorator.args?.at(0),
297
297
  };
298
- const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
298
+ const outputFile = project_paths.projectFile(node.getSourceFile(), info);
299
299
  if (this.config.shouldMigrate === undefined ||
300
300
  this.config.shouldMigrate({
301
301
  key: outputDef.id,
@@ -323,7 +323,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
323
323
  const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
324
324
  if (propertyDeclaration !== null) {
325
325
  const id = getUniqueIdForProperty(info, propertyDeclaration);
326
- const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
326
+ const outputFile = project_paths.projectFile(node.getSourceFile(), info);
327
327
  addOutputReplacement(outputFieldReplacements, id, outputFile, calculateNextFnReplacement(info, node.expression.name));
328
328
  }
329
329
  }
@@ -332,7 +332,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
332
332
  const propertyDeclaration = isTargetOutputDeclaration(node.expression.expression, checker$1, reflector, dtsReader);
333
333
  if (propertyDeclaration !== null) {
334
334
  const id = getUniqueIdForProperty(info, propertyDeclaration);
335
- const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
335
+ const outputFile = project_paths.projectFile(node.getSourceFile(), info);
336
336
  if (ts.isExpressionStatement(node.parent)) {
337
337
  addOutputReplacement(outputFieldReplacements, id, outputFile, calculateCompleteCallReplacement(info, node.parent));
338
338
  }
@@ -341,6 +341,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
341
341
  }
342
342
  }
343
343
  }
344
+ addCommentForEmptyEmit(node, info, checker$1, reflector, dtsReader, outputFieldReplacements);
344
345
  // detect imports of test runners
345
346
  if (isTestRunnerImport(node)) {
346
347
  isTestFile = true;
@@ -351,7 +352,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
351
352
  if (propertyDeclaration !== null) {
352
353
  const id = getUniqueIdForProperty(info, propertyDeclaration);
353
354
  if (isTestFile) {
354
- const outputFile = run_in_devkit.projectFile(node.getSourceFile(), info);
355
+ const outputFile = project_paths.projectFile(node.getSourceFile(), info);
355
356
  addOutputReplacement(outputFieldReplacements, id, outputFile, ...calculatePipeCallReplacement(info, node));
356
357
  }
357
358
  else {
@@ -395,7 +396,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
395
396
  }
396
397
  // calculate import replacements but do so only for files that have output declarations
397
398
  const importReplacements = calculateImportReplacements(info, filesWithOutputDeclarations);
398
- return run_in_devkit.confirmAsSerializable({
399
+ return project_paths.confirmAsSerializable({
399
400
  problematicDeclarationCount,
400
401
  outputFields: outputFieldReplacements,
401
402
  importReplacements,
@@ -425,7 +426,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
425
426
  problematicUsages[declId] = unit.problematicUsages[declId];
426
427
  }
427
428
  }
428
- return run_in_devkit.confirmAsSerializable({
429
+ return project_paths.confirmAsSerializable({
429
430
  problematicDeclarationCount,
430
431
  outputFields,
431
432
  importReplacements,
@@ -447,7 +448,7 @@ class OutputMigration extends run_in_devkit.TsurgeFunnelMigration {
447
448
  }
448
449
  }
449
450
  // Noop here as we don't have any form of special global metadata.
450
- return run_in_devkit.confirmAsSerializable(combinedData);
451
+ return project_paths.confirmAsSerializable(combinedData);
451
452
  }
452
453
  async stats(globalMetadata) {
453
454
  const detectedOutputs = new Set(Object.keys(globalMetadata.outputFields)).size +
@@ -503,10 +504,62 @@ function addOutputReplacement(outputFieldReplacements, outputId, file, ...replac
503
504
  }
504
505
  existingReplacements.replacements.push(...replacements);
505
506
  }
507
+ function addCommentForEmptyEmit(node, info, checker, reflector, dtsReader, outputFieldReplacements) {
508
+ if (!isEmptyEmitCall(node))
509
+ return;
510
+ const propertyAccess = getPropertyAccess(node);
511
+ if (!propertyAccess)
512
+ return;
513
+ const symbol = checker.getSymbolAtLocation(propertyAccess.name);
514
+ if (!symbol || !symbol.declarations?.length)
515
+ return;
516
+ const propertyDeclaration = isTargetOutputDeclaration(propertyAccess, checker, reflector, dtsReader);
517
+ if (!propertyDeclaration)
518
+ return;
519
+ const eventEmitterType = getEventEmitterArgumentType(propertyDeclaration);
520
+ if (!eventEmitterType)
521
+ return;
522
+ const id = getUniqueIdForProperty(info, propertyDeclaration);
523
+ const file = project_paths.projectFile(node.getSourceFile(), info);
524
+ const formatter = getFormatterText(node);
525
+ const todoReplacement = new project_paths.TextUpdate({
526
+ toInsert: `${formatter.indent}// TODO: The 'emit' function requires a mandatory ${eventEmitterType} argument\n`,
527
+ end: formatter.lineStartPos,
528
+ position: formatter.lineStartPos,
529
+ });
530
+ addOutputReplacement(outputFieldReplacements, id, file, new project_paths.Replacement(file, todoReplacement));
531
+ }
532
+ function isEmptyEmitCall(node) {
533
+ return (ts.isCallExpression(node) &&
534
+ ts.isPropertyAccessExpression(node.expression) &&
535
+ node.expression.name.text === 'emit' &&
536
+ node.arguments.length === 0);
537
+ }
538
+ function getPropertyAccess(node) {
539
+ const propertyAccessExpression = node.expression.expression;
540
+ return ts.isPropertyAccessExpression(propertyAccessExpression) ? propertyAccessExpression : null;
541
+ }
542
+ function getEventEmitterArgumentType(propertyDeclaration) {
543
+ const initializer = propertyDeclaration.initializer;
544
+ if (!initializer || !ts.isNewExpression(initializer))
545
+ return null;
546
+ const isEventEmitter = ts.isIdentifier(initializer.expression) && initializer.expression.getText() === 'EventEmitter';
547
+ if (!isEventEmitter)
548
+ return null;
549
+ const [typeArg] = initializer.typeArguments ?? [];
550
+ return typeArg ? typeArg.getText() : null;
551
+ }
552
+ function getFormatterText(node) {
553
+ const sourceFile = node.getSourceFile();
554
+ const { line } = sourceFile.getLineAndCharacterOfPosition(node.getStart());
555
+ const lineStartPos = sourceFile.getPositionOfLineAndCharacter(line, 0);
556
+ const indent = sourceFile.text.slice(lineStartPos, node.getStart());
557
+ return { indent, lineStartPos };
558
+ }
506
559
 
507
560
  function migrate(options) {
508
561
  return async (tree, context) => {
509
- await run_in_devkit.runMigrationInDevkit({
562
+ await project_paths.runMigrationInDevkit({
510
563
  tree,
511
564
  getMigration: (fs) => new OutputMigration({
512
565
  shouldMigrate: (_, file) => {
@@ -514,8 +567,13 @@ function migrate(options) {
514
567
  !/(^|\/)node_modules\//.test(file.rootRelativePath));
515
568
  },
516
569
  }),
517
- beforeProgramCreation: (tsconfigPath) => {
518
- context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
570
+ beforeProgramCreation: (tsconfigPath, stage) => {
571
+ if (stage === project_paths.MigrationStage.Analysis) {
572
+ context.logger.info(`Preparing analysis for: ${tsconfigPath}...`);
573
+ }
574
+ else {
575
+ context.logger.info(`Running migration for: ${tsconfigPath}...`);
576
+ }
519
577
  },
520
578
  afterProgramCreation: (info, fs) => {
521
579
  const analysisPath = fs.resolve(options.analysisDir);