@angular/core 19.2.0-next.2 → 19.2.0-rc.0

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 (42) hide show
  1. package/fesm2022/core.mjs +1094 -1064
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  4. package/fesm2022/primitives/signals.mjs +5 -5
  5. package/fesm2022/primitives/signals.mjs.map +1 -1
  6. package/fesm2022/rxjs-interop.mjs +1 -1
  7. package/fesm2022/testing.mjs +5 -5
  8. package/index.d.ts +92 -44
  9. package/package.json +1 -1
  10. package/primitives/event-dispatch/index.d.ts +1 -1
  11. package/primitives/signals/index.d.ts +2 -2
  12. package/rxjs-interop/index.d.ts +1 -1
  13. package/schematics/bundles/apply_import_manager-a930fcf1.js +71 -0
  14. package/schematics/bundles/{checker-9af84be9.js → checker-2eecc677.js} +101 -63
  15. package/schematics/bundles/cleanup-unused-imports.js +17 -16
  16. package/schematics/bundles/{compiler_host-dbff2781.js → compiler_host-c280a924.js} +2 -2
  17. package/schematics/bundles/control-flow-migration.js +10 -3
  18. package/schematics/bundles/explicit-standalone-flag.js +5 -5
  19. package/schematics/bundles/{imports-31a38653.js → imports-abe29092.js} +1 -1
  20. package/schematics/bundles/{index-23b503a4.js → index-24a2ad1e.js} +9 -9
  21. package/schematics/bundles/{index-93e324de.js → index-3891dd55.js} +4 -4
  22. package/schematics/bundles/inject-migration.js +10 -9
  23. package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-d190b83b.js} +1 -1
  24. package/schematics/bundles/{migrate_ts_type_references-c6615b87.js → migrate_ts_type_references-71b3a951.js} +21 -21
  25. package/schematics/bundles/{nodes-88c2157f.js → ng_decorators-e699c081.js} +2 -15
  26. package/schematics/bundles/nodes-a535b2be.js +27 -0
  27. package/schematics/bundles/output-migration.js +22 -21
  28. package/schematics/bundles/pending-tasks.js +5 -5
  29. package/schematics/bundles/{program-66386e72.js → program-24da9092.js} +113 -54
  30. package/schematics/bundles/{apply_import_manager-d8ea426b.js → project_paths-b073c4d6.js} +3 -57
  31. package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-e9ccccbf.js} +1 -1
  32. package/schematics/bundles/property_name-7c8433f5.js +31 -0
  33. package/schematics/bundles/provide-initializer.js +5 -5
  34. package/schematics/bundles/route-lazy-loading.js +9 -13
  35. package/schematics/bundles/self-closing-tags-migration.js +448 -0
  36. package/schematics/bundles/signal-input-migration.js +22 -21
  37. package/schematics/bundles/signal-queries-migration.js +28 -27
  38. package/schematics/bundles/signals.js +9 -8
  39. package/schematics/bundles/standalone-migration.js +14 -13
  40. package/schematics/collection.json +6 -0
  41. package/schematics/ng-generate/self-closing-tags-migration/schema.json +14 -0
  42. package/testing/index.d.ts +1 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0-next.2
3
+ * @license Angular v19.2.0-rc.0
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
8
8
 
9
- var checker = require('./checker-9af84be9.js');
9
+ var checker = require('./checker-2eecc677.js');
10
10
  var ts = require('typescript');
11
11
  var p = require('path');
12
12
  require('os');
@@ -894,29 +894,32 @@ function compileClassDebugInfo(debugInfo) {
894
894
  * @param meta HMR metadata extracted from the class.
895
895
  */
896
896
  function compileHmrInitializer(meta) {
897
- const id = encodeURIComponent(`${meta.filePath}@${meta.className}`);
898
- const urlPartial = `./@ng/component?c=${id}&t=`;
899
897
  const moduleName = 'm';
900
898
  const dataName = 'd';
901
899
  const timestampName = 't';
900
+ const idName = 'id';
902
901
  const importCallbackName = `${meta.className}_HmrLoad`;
903
902
  const namespaces = meta.namespaceDependencies.map((dep) => {
904
903
  return new checker.ExternalExpr({ moduleName: dep.moduleName, name: null });
905
904
  });
906
905
  // m.default
907
906
  const defaultRead = checker.variable(moduleName).prop('default');
908
- // ɵɵreplaceMetadata(Comp, m.default, [...namespaces], [...locals]);
907
+ // ɵɵreplaceMetadata(Comp, m.default, [...namespaces], [...locals], import.meta, id);
909
908
  const replaceCall = checker.importExpr(checker.Identifiers.replaceMetadata)
910
909
  .callFn([
911
910
  meta.type,
912
911
  defaultRead,
913
912
  checker.literalArr(namespaces),
914
913
  checker.literalArr(meta.localDependencies.map((l) => l.runtimeRepresentation)),
914
+ checker.variable('import').prop('meta'),
915
+ checker.variable(idName),
915
916
  ]);
916
917
  // (m) => m.default && ɵɵreplaceMetadata(...)
917
918
  const replaceCallback = checker.arrowFn([new checker.FnParam(moduleName)], defaultRead.and(replaceCall));
918
- // '<urlPartial>' + encodeURIComponent(t)
919
- const urlValue = checker.literal(urlPartial)
919
+ // '<url>?c=' + id + '&t=' + encodeURIComponent(t)
920
+ const urlValue = checker.literal(`./@ng/component?c=`)
921
+ .plus(checker.variable(idName))
922
+ .plus(checker.literal('&t='))
920
923
  .plus(checker.variable('encodeURIComponent').callFn([checker.variable(timestampName)]));
921
924
  // import.meta.url
922
925
  const urlBase = checker.variable('import').prop('meta').prop('url');
@@ -934,10 +937,10 @@ function compileHmrInitializer(meta) {
934
937
  .callFn([replaceCallback])
935
938
  .toStmt(),
936
939
  ], null, checker.StmtModifier.Final);
937
- // (d) => d.id === <id> && Cmp_HmrLoad(d.timestamp)
940
+ // (d) => d.id === id && Cmp_HmrLoad(d.timestamp)
938
941
  const updateCallback = checker.arrowFn([new checker.FnParam(dataName)], checker.variable(dataName)
939
942
  .prop('id')
940
- .identical(checker.literal(id))
943
+ .identical(checker.variable(idName))
941
944
  .and(checker.variable(importCallbackName).callFn([checker.variable(dataName).prop('timestamp')])));
942
945
  // Cmp_HmrLoad(Date.now());
943
946
  // Initial call to kick off the loading in order to avoid edge cases with components
@@ -952,6 +955,8 @@ function compileHmrInitializer(meta) {
952
955
  .prop('on')
953
956
  .callFn([checker.literal('angular:component-update'), updateCallback]);
954
957
  return checker.arrowFn([], [
958
+ // const id = <id>;
959
+ new checker.DeclareVarStmt(idName, checker.literal(encodeURIComponent(`${meta.filePath}@${meta.className}`)), null, checker.StmtModifier.Final),
955
960
  // function Cmp_HmrLoad() {...}.
956
961
  importCallback,
957
962
  // ngDevMode && Cmp_HmrLoad(Date.now());
@@ -1006,7 +1011,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
1006
1011
  function compileDeclareClassMetadata(metadata) {
1007
1012
  const definitionMap = new checker.DefinitionMap();
1008
1013
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
1009
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1014
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1010
1015
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1011
1016
  definitionMap.set('type', metadata.type);
1012
1017
  definitionMap.set('decorators', metadata.decorators);
@@ -1024,7 +1029,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
1024
1029
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
1025
1030
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
1026
1031
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
1027
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1032
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1028
1033
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1029
1034
  definitionMap.set('type', metadata.type);
1030
1035
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -1119,7 +1124,7 @@ function createDirectiveDefinitionMap(meta) {
1119
1124
  const definitionMap = new checker.DefinitionMap();
1120
1125
  const minVersion = getMinimumVersionForPartialOutput(meta);
1121
1126
  definitionMap.set('minVersion', checker.literal(minVersion));
1122
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1127
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1123
1128
  // e.g. `type: MyDirective`
1124
1129
  definitionMap.set('type', meta.type.value);
1125
1130
  if (meta.isStandalone !== undefined) {
@@ -1535,7 +1540,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
1535
1540
  function compileDeclareFactoryFunction(meta) {
1536
1541
  const definitionMap = new checker.DefinitionMap();
1537
1542
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
1538
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1543
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1539
1544
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1540
1545
  definitionMap.set('type', meta.type.value);
1541
1546
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -1570,7 +1575,7 @@ function compileDeclareInjectableFromMetadata(meta) {
1570
1575
  function createInjectableDefinitionMap(meta) {
1571
1576
  const definitionMap = new checker.DefinitionMap();
1572
1577
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
1573
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1578
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1574
1579
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1575
1580
  definitionMap.set('type', meta.type.value);
1576
1581
  // Only generate providedIn property if it has a non-null value
@@ -1621,7 +1626,7 @@ function compileDeclareInjectorFromMetadata(meta) {
1621
1626
  function createInjectorDefinitionMap(meta) {
1622
1627
  const definitionMap = new checker.DefinitionMap();
1623
1628
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
1624
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1629
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1625
1630
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1626
1631
  definitionMap.set('type', meta.type.value);
1627
1632
  definitionMap.set('providers', meta.providers);
@@ -1654,7 +1659,7 @@ function createNgModuleDefinitionMap(meta) {
1654
1659
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
1655
1660
  }
1656
1661
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
1657
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1662
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1658
1663
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1659
1664
  definitionMap.set('type', meta.type.value);
1660
1665
  // We only generate the keys in the metadata if the arrays contain values.
@@ -1705,7 +1710,7 @@ function compileDeclarePipeFromMetadata(meta) {
1705
1710
  function createPipeDefinitionMap(meta) {
1706
1711
  const definitionMap = new checker.DefinitionMap();
1707
1712
  definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
1708
- definitionMap.set('version', checker.literal('19.2.0-next.2'));
1713
+ definitionMap.set('version', checker.literal('19.2.0-rc.0'));
1709
1714
  definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
1710
1715
  // e.g. `type: MyPipe`
1711
1716
  definitionMap.set('type', meta.type.value);
@@ -11750,18 +11755,27 @@ class ComponentDecoratorHandler {
11750
11755
  * the `@Component.imports` field and their usage in `@defer` blocks.
11751
11756
  */
11752
11757
  resolveAllDeferredDependencies(resolution) {
11758
+ const seenDeps = new Set();
11753
11759
  const deferrableTypes = [];
11754
11760
  // Go over all dependencies of all defer blocks and update the value of
11755
11761
  // the `isDeferrable` flag and the `importPath` to reflect the current
11756
11762
  // state after visiting all components during the `resolve` phase.
11757
11763
  for (const [_, deps] of resolution.deferPerBlockDependencies) {
11758
11764
  for (const deferBlockDep of deps) {
11759
- const importDecl = resolution.deferrableDeclToImportDecl.get(deferBlockDep.declaration.node) ?? null;
11765
+ const node = deferBlockDep.declaration.node;
11766
+ const importDecl = resolution.deferrableDeclToImportDecl.get(node) ?? null;
11760
11767
  if (importDecl !== null && this.deferredSymbolTracker.canDefer(importDecl)) {
11761
11768
  deferBlockDep.isDeferrable = true;
11762
11769
  deferBlockDep.importPath = importDecl.moduleSpecifier.text;
11763
11770
  deferBlockDep.isDefaultImport = isDefaultImport(importDecl);
11764
- deferrableTypes.push(deferBlockDep);
11771
+ // The same dependency may be used across multiple deferred blocks. De-duplicate it
11772
+ // because it can throw off other logic further down the compilation pipeline.
11773
+ // Note that the logic above needs to run even if the dependency is seen before,
11774
+ // because the object literals are different between each block.
11775
+ if (!seenDeps.has(node)) {
11776
+ seenDeps.add(node);
11777
+ deferrableTypes.push(deferBlockDep);
11778
+ }
11765
11779
  }
11766
11780
  }
11767
11781
  }
@@ -12807,7 +12821,7 @@ function getDownlevelDecoratorsTransform(typeChecker, host, diagnostics, isCore,
12807
12821
  // ensure that the alias declaration is not elided by TypeScript, and use its
12808
12822
  // name identifier to reference it at runtime.
12809
12823
  if (checker.isAliasImportDeclaration(decl)) {
12810
- referencedParameterTypes.add(decl);
12824
+ referencedParameterTypes?.add(decl);
12811
12825
  // If the entity name resolves to an alias import declaration, we reference the
12812
12826
  // entity based on the alias import name. This ensures that TypeScript properly
12813
12827
  // resolves the link to the import. Cloning the original entity name identifier
@@ -16767,7 +16781,7 @@ function buildDiagnosticForSignal(ctx, node, component) {
16767
16781
  }
16768
16782
  return [];
16769
16783
  }
16770
- const factory$9 = {
16784
+ const factory$a = {
16771
16785
  code: checker.ErrorCode.INTERPOLATED_SIGNAL_NOT_INVOKED,
16772
16786
  name: checker.ExtendedTemplateDiagnosticName.INTERPOLATED_SIGNAL_NOT_INVOKED,
16773
16787
  create: () => new InterpolatedSignalCheck(),
@@ -16793,7 +16807,7 @@ class InvalidBananaInBoxCheck extends TemplateCheckWithVisitor {
16793
16807
  return [diagnostic];
16794
16808
  }
16795
16809
  }
16796
- const factory$8 = {
16810
+ const factory$9 = {
16797
16811
  code: checker.ErrorCode.INVALID_BANANA_IN_BOX,
16798
16812
  name: checker.ExtendedTemplateDiagnosticName.INVALID_BANANA_IN_BOX,
16799
16813
  create: () => new InvalidBananaInBoxCheck(),
@@ -16854,7 +16868,7 @@ class MissingControlFlowDirectiveCheck extends TemplateCheckWithVisitor {
16854
16868
  return [diagnostic];
16855
16869
  }
16856
16870
  }
16857
- const factory$7 = {
16871
+ const factory$8 = {
16858
16872
  code: checker.ErrorCode.MISSING_CONTROL_FLOW_DIRECTIVE,
16859
16873
  name: checker.ExtendedTemplateDiagnosticName.MISSING_CONTROL_FLOW_DIRECTIVE,
16860
16874
  create: (options) => {
@@ -16887,7 +16901,7 @@ class MissingNgForOfLetCheck extends TemplateCheckWithVisitor {
16887
16901
  return [diagnostic];
16888
16902
  }
16889
16903
  }
16890
- const factory$6 = {
16904
+ const factory$7 = {
16891
16905
  code: checker.ErrorCode.MISSING_NGFOROF_LET,
16892
16906
  name: checker.ExtendedTemplateDiagnosticName.MISSING_NGFOROF_LET,
16893
16907
  create: () => new MissingNgForOfLetCheck(),
@@ -16932,7 +16946,7 @@ class NullishCoalescingNotNullableCheck extends TemplateCheckWithVisitor {
16932
16946
  return [diagnostic];
16933
16947
  }
16934
16948
  }
16935
- const factory$5 = {
16949
+ const factory$6 = {
16936
16950
  code: checker.ErrorCode.NULLISH_COALESCING_NOT_NULLABLE,
16937
16951
  name: checker.ExtendedTemplateDiagnosticName.NULLISH_COALESCING_NOT_NULLABLE,
16938
16952
  create: (options) => {
@@ -16989,7 +17003,7 @@ class OptionalChainNotNullableCheck extends TemplateCheckWithVisitor {
16989
17003
  return [diagnostic];
16990
17004
  }
16991
17005
  }
16992
- const factory$4 = {
17006
+ const factory$5 = {
16993
17007
  code: checker.ErrorCode.OPTIONAL_CHAIN_NOT_NULLABLE,
16994
17008
  name: checker.ExtendedTemplateDiagnosticName.OPTIONAL_CHAIN_NOT_NULLABLE,
16995
17009
  create: (options) => {
@@ -17020,7 +17034,7 @@ class SuffixNotSupportedCheck extends TemplateCheckWithVisitor {
17020
17034
  return [diagnostic];
17021
17035
  }
17022
17036
  }
17023
- const factory$3 = {
17037
+ const factory$4 = {
17024
17038
  code: checker.ErrorCode.SUFFIX_NOT_SUPPORTED,
17025
17039
  name: checker.ExtendedTemplateDiagnosticName.SUFFIX_NOT_SUPPORTED,
17026
17040
  create: () => new SuffixNotSupportedCheck(),
@@ -17065,7 +17079,7 @@ class TextAttributeNotBindingSpec extends TemplateCheckWithVisitor {
17065
17079
  return [diagnostic];
17066
17080
  }
17067
17081
  }
17068
- const factory$2 = {
17082
+ const factory$3 = {
17069
17083
  code: checker.ErrorCode.TEXT_ATTRIBUTE_NOT_BINDING,
17070
17084
  name: checker.ExtendedTemplateDiagnosticName.TEXT_ATTRIBUTE_NOT_BINDING,
17071
17085
  create: () => new TextAttributeNotBindingSpec(),
@@ -17125,7 +17139,7 @@ function assertExpressionInvoked(expression, component, node, expressionText, ct
17125
17139
  function generateStringFromExpression(expression, source) {
17126
17140
  return source.substring(expression.span.start, expression.span.end);
17127
17141
  }
17128
- const factory$1 = {
17142
+ const factory$2 = {
17129
17143
  code: checker.ErrorCode.UNINVOKED_FUNCTION_IN_EVENT_BINDING,
17130
17144
  name: checker.ExtendedTemplateDiagnosticName.UNINVOKED_FUNCTION_IN_EVENT_BINDING,
17131
17145
  create: () => new UninvokedFunctionInEventBindingSpec(),
@@ -17169,12 +17183,45 @@ class UnusedLetDeclarationCheck extends TemplateCheckWithVisitor {
17169
17183
  return this.analysis.get(node);
17170
17184
  }
17171
17185
  }
17172
- const factory = {
17186
+ const factory$1 = {
17173
17187
  code: checker.ErrorCode.UNUSED_LET_DECLARATION,
17174
17188
  name: checker.ExtendedTemplateDiagnosticName.UNUSED_LET_DECLARATION,
17175
17189
  create: () => new UnusedLetDeclarationCheck(),
17176
17190
  };
17177
17191
 
17192
+ const NG_SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration';
17193
+ /**
17194
+ * Ensures that the special attribute `ngSkipHydration` is not a binding and has no other
17195
+ * value than `"true"` or an empty value.
17196
+ */
17197
+ class NgSkipHydrationSpec extends TemplateCheckWithVisitor {
17198
+ code = checker.ErrorCode.SKIP_HYDRATION_NOT_STATIC;
17199
+ visitNode(ctx, component, node) {
17200
+ /** Binding should always error */
17201
+ if (node instanceof checker.BoundAttribute && node.name === NG_SKIP_HYDRATION_ATTR_NAME) {
17202
+ const errorString = `ngSkipHydration should not be used as a binding.`;
17203
+ const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, errorString);
17204
+ return [diagnostic];
17205
+ }
17206
+ /** No value, empty string or `"true"` are the only valid values */
17207
+ const acceptedValues = ['true', '' /* empty string */];
17208
+ if (node instanceof checker.TextAttribute &&
17209
+ node.name === NG_SKIP_HYDRATION_ATTR_NAME &&
17210
+ !acceptedValues.includes(node.value) &&
17211
+ node.value !== undefined) {
17212
+ const errorString = `ngSkipHydration only accepts "true" or "" as value or no value at all. For example 'ngSkipHydration="true"' or 'ngSkipHydration'`;
17213
+ const diagnostic = ctx.makeTemplateDiagnostic(node.sourceSpan, errorString);
17214
+ return [diagnostic];
17215
+ }
17216
+ return [];
17217
+ }
17218
+ }
17219
+ const factory = {
17220
+ code: checker.ErrorCode.SKIP_HYDRATION_NOT_STATIC,
17221
+ name: checker.ExtendedTemplateDiagnosticName.SKIP_HYDRATION_NOT_STATIC,
17222
+ create: () => new NgSkipHydrationSpec(),
17223
+ };
17224
+
17178
17225
  /**
17179
17226
  * A label referring to a `ts.DiagnosticCategory` or `'suppress'`, meaning the associated diagnostic
17180
17227
  * should not be displayed at all.
@@ -17262,14 +17309,15 @@ function assertNever(value) {
17262
17309
  }
17263
17310
 
17264
17311
  const ALL_DIAGNOSTIC_FACTORIES = [
17265
- factory$8,
17312
+ factory$9,
17313
+ factory$6,
17266
17314
  factory$5,
17267
- factory$4,
17315
+ factory$8,
17316
+ factory$3,
17268
17317
  factory$7,
17318
+ factory$4,
17319
+ factory$a,
17269
17320
  factory$2,
17270
- factory$6,
17271
- factory$3,
17272
- factory$9,
17273
17321
  factory$1,
17274
17322
  factory,
17275
17323
  ];
@@ -17754,6 +17802,7 @@ function requireRe () {
17754
17802
  const re = exports.re = [];
17755
17803
  const safeRe = exports.safeRe = [];
17756
17804
  const src = exports.src = [];
17805
+ const safeSrc = exports.safeSrc = [];
17757
17806
  const t = exports.t = {};
17758
17807
  let R = 0;
17759
17808
 
@@ -17786,6 +17835,7 @@ function requireRe () {
17786
17835
  debug(name, index, value);
17787
17836
  t[name] = index;
17788
17837
  src[index] = value;
17838
+ safeSrc[index] = safe;
17789
17839
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined);
17790
17840
  safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined);
17791
17841
  };
@@ -18027,7 +18077,7 @@ function requireSemver$1 () {
18027
18077
  hasRequiredSemver$1 = 1;
18028
18078
  const debug = requireDebug();
18029
18079
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = requireConstants();
18030
- const { safeRe: re, t } = requireRe();
18080
+ const { safeRe: re, safeSrc: src, t } = requireRe();
18031
18081
 
18032
18082
  const parseOptions = requireParseOptions();
18033
18083
  const { compareIdentifiers } = requireIdentifiers();
@@ -18037,7 +18087,7 @@ function requireSemver$1 () {
18037
18087
 
18038
18088
  if (version instanceof SemVer) {
18039
18089
  if (version.loose === !!options.loose &&
18040
- version.includePrerelease === !!options.includePrerelease) {
18090
+ version.includePrerelease === !!options.includePrerelease) {
18041
18091
  return version
18042
18092
  } else {
18043
18093
  version = version.version;
@@ -18203,6 +18253,20 @@ function requireSemver$1 () {
18203
18253
  // preminor will bump the version up to the next minor release, and immediately
18204
18254
  // down to pre-release. premajor and prepatch work the same way.
18205
18255
  inc (release, identifier, identifierBase) {
18256
+ if (release.startsWith('pre')) {
18257
+ if (!identifier && identifierBase === false) {
18258
+ throw new Error('invalid increment argument: identifier is empty')
18259
+ }
18260
+ // Avoid an invalid semver results
18261
+ if (identifier) {
18262
+ const r = new RegExp(`^${this.options.loose ? src[t.PRERELEASELOOSE] : src[t.PRERELEASE]}$`);
18263
+ const match = `-${identifier}`.match(r);
18264
+ if (!match || match[1] !== identifier) {
18265
+ throw new Error(`invalid identifier: ${identifier}`)
18266
+ }
18267
+ }
18268
+ }
18269
+
18206
18270
  switch (release) {
18207
18271
  case 'premajor':
18208
18272
  this.prerelease.length = 0;
@@ -18233,6 +18297,12 @@ function requireSemver$1 () {
18233
18297
  }
18234
18298
  this.inc('pre', identifier, identifierBase);
18235
18299
  break
18300
+ case 'release':
18301
+ if (this.prerelease.length === 0) {
18302
+ throw new Error(`version ${this.raw} is not a prerelease`)
18303
+ }
18304
+ this.prerelease.length = 0;
18305
+ break
18236
18306
 
18237
18307
  case 'major':
18238
18308
  // If this is a pre-major version, bump up to the same major version.
@@ -18276,10 +18346,6 @@ function requireSemver$1 () {
18276
18346
  case 'pre': {
18277
18347
  const base = Number(identifierBase) ? 1 : 0;
18278
18348
 
18279
- if (!identifier && identifierBase === false) {
18280
- throw new Error('invalid increment argument: identifier is empty')
18281
- }
18282
-
18283
18349
  if (this.prerelease.length === 0) {
18284
18350
  this.prerelease = [base];
18285
18351
  } else {
@@ -18448,20 +18514,13 @@ function requireDiff () {
18448
18514
  return 'major'
18449
18515
  }
18450
18516
 
18451
- // Otherwise it can be determined by checking the high version
18452
-
18453
- if (highVersion.patch) {
18454
- // anything higher than a patch bump would result in the wrong version
18517
+ // If the main part has no difference
18518
+ if (lowVersion.compareMain(highVersion) === 0) {
18519
+ if (lowVersion.minor && !lowVersion.patch) {
18520
+ return 'minor'
18521
+ }
18455
18522
  return 'patch'
18456
18523
  }
18457
-
18458
- if (highVersion.minor) {
18459
- // anything higher than a minor bump would result in the wrong version
18460
- return 'minor'
18461
- }
18462
-
18463
- // bumping major/minor/patch all have same result
18464
- return 'major'
18465
18524
  }
18466
18525
 
18467
18526
  // add the `pre` prefix if we are going to a prerelease version
@@ -20330,7 +20389,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
20330
20389
  * @param minVersion Minimum required version for the feature.
20331
20390
  */
20332
20391
  function coreVersionSupportsFeature(coreVersion, minVersion) {
20333
- // A version of `19.2.0-next.2` usually means that core is at head so it supports
20392
+ // A version of `19.2.0-rc.0` usually means that core is at head so it supports
20334
20393
  // all features. Use string interpolation prevent the placeholder from being replaced
20335
20394
  // with the current version during build time.
20336
20395
  if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0-next.2
3
+ * @license Angular v19.2.0-rc.0
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -10,8 +10,8 @@ var core = require('@angular-devkit/core');
10
10
  var posixPath = require('node:path/posix');
11
11
  var os = require('os');
12
12
  var ts = require('typescript');
13
- var checker = require('./checker-9af84be9.js');
14
- var program = require('./program-66386e72.js');
13
+ var checker = require('./checker-2eecc677.js');
14
+ var program = require('./program-24da9092.js');
15
15
  require('path');
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -666,65 +666,11 @@ function isWithinBasePath(fs, base, path) {
666
666
  return checker.isLocalRelativePath(fs.relative(base, path));
667
667
  }
668
668
 
669
- /**
670
- * Applies import manager changes, and writes them as replacements the
671
- * given result array.
672
- */
673
- function applyImportManagerChanges(importManager, replacements, sourceFiles, info) {
674
- const { newImports, updatedImports, deletedImports } = importManager.finalize();
675
- const printer = ts__default["default"].createPrinter({});
676
- const pathToFile = new Map(sourceFiles.map((s) => [s.fileName, s]));
677
- // Capture new imports
678
- newImports.forEach((newImports, fileName) => {
679
- newImports.forEach((newImport) => {
680
- const printedImport = printer.printNode(ts__default["default"].EmitHint.Unspecified, newImport, pathToFile.get(fileName));
681
- replacements.push(new Replacement(projectFile(checker.absoluteFrom(fileName), info), new TextUpdate({ position: 0, end: 0, toInsert: `${printedImport}\n` })));
682
- });
683
- });
684
- // Capture updated imports
685
- for (const [oldBindings, newBindings] of updatedImports.entries()) {
686
- // The import will be generated as multi-line if it already is multi-line,
687
- // or if the number of elements significantly increased and it previously
688
- // consisted of very few specifiers.
689
- const isMultiline = oldBindings.getText().includes('\n') ||
690
- (newBindings.elements.length >= 6 && oldBindings.elements.length <= 3);
691
- const hasSpaceBetweenBraces = oldBindings.getText().startsWith('{ ');
692
- let formatFlags = ts__default["default"].ListFormat.NamedImportsOrExportsElements |
693
- ts__default["default"].ListFormat.Indented |
694
- ts__default["default"].ListFormat.Braces |
695
- ts__default["default"].ListFormat.PreserveLines |
696
- (isMultiline ? ts__default["default"].ListFormat.MultiLine : ts__default["default"].ListFormat.SingleLine);
697
- if (hasSpaceBetweenBraces) {
698
- formatFlags |= ts__default["default"].ListFormat.SpaceBetweenBraces;
699
- }
700
- else {
701
- formatFlags &= ~ts__default["default"].ListFormat.SpaceBetweenBraces;
702
- }
703
- const printedBindings = printer.printList(formatFlags, newBindings.elements, oldBindings.getSourceFile());
704
- replacements.push(new Replacement(projectFile(oldBindings.getSourceFile(), info), new TextUpdate({
705
- position: oldBindings.getStart(),
706
- end: oldBindings.getEnd(),
707
- // TS uses four spaces as indent. We migrate to two spaces as we
708
- // assume this to be more common.
709
- toInsert: printedBindings.replace(/^ {4}/gm, ' '),
710
- })));
711
- }
712
- // Update removed imports
713
- for (const removedImport of deletedImports) {
714
- replacements.push(new Replacement(projectFile(removedImport.getSourceFile(), info), new TextUpdate({
715
- position: removedImport.getStart(),
716
- end: removedImport.getEnd(),
717
- toInsert: '',
718
- })));
719
- }
720
- }
721
-
722
669
  exports.DevkitMigrationFilesystem = DevkitMigrationFilesystem;
723
670
  exports.Replacement = Replacement;
724
671
  exports.TextUpdate = TextUpdate;
725
672
  exports.TsurgeComplexMigration = TsurgeComplexMigration;
726
673
  exports.TsurgeFunnelMigration = TsurgeFunnelMigration;
727
- exports.applyImportManagerChanges = applyImportManagerChanges;
728
674
  exports.confirmAsSerializable = confirmAsSerializable;
729
675
  exports.createBaseProgramInfo = createBaseProgramInfo;
730
676
  exports.groupReplacementsByFile = groupReplacementsByFile;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0-next.2
3
+ * @license Angular v19.2.0-rc.0
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+ /**
3
+ * @license Angular v19.2.0-rc.0
4
+ * (c) 2010-2024 Google LLC. https://angular.io/
5
+ * License: MIT
6
+ */
7
+ 'use strict';
8
+
9
+ var ts = require('typescript');
10
+
11
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
+
13
+ var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
14
+
15
+ /**
16
+ * Gets the text of the given property name. Returns null if the property
17
+ * name couldn't be determined statically.
18
+ */
19
+ function getPropertyNameText(node) {
20
+ if (ts__default["default"].isIdentifier(node) || ts__default["default"].isStringLiteralLike(node)) {
21
+ return node.text;
22
+ }
23
+ return null;
24
+ }
25
+ /** Finds a property with a specific name in an object literal expression. */
26
+ function findLiteralProperty(literal, name) {
27
+ return literal.properties.find((prop) => prop.name && ts__default["default"].isIdentifier(prop.name) && prop.name.text === name);
28
+ }
29
+
30
+ exports.findLiteralProperty = findLiteralProperty;
31
+ exports.getPropertyNameText = getPropertyNameText;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0-next.2
3
+ * @license Angular v19.2.0-rc.0
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -10,12 +10,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
12
  var p = require('path');
13
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
14
- var compiler_host = require('./compiler_host-dbff2781.js');
13
+ var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
14
+ var compiler_host = require('./compiler_host-c280a924.js');
15
15
  var ts = require('typescript');
16
- var imports = require('./imports-31a38653.js');
16
+ var imports = require('./imports-abe29092.js');
17
17
  require('@angular-devkit/core');
18
- require('./checker-9af84be9.js');
18
+ require('./checker-2eecc677.js');
19
19
  require('os');
20
20
  require('fs');
21
21
  require('module');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0-next.2
3
+ * @license Angular v19.2.0-rc.0
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -11,10 +11,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
  var schematics = require('@angular-devkit/schematics');
12
12
  var fs = require('fs');
13
13
  var p = require('path');
14
- var compiler_host = require('./compiler_host-dbff2781.js');
15
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
14
+ var compiler_host = require('./compiler_host-c280a924.js');
15
+ var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
16
16
  var ts = require('typescript');
17
- var checker = require('./checker-9af84be9.js');
17
+ var checker = require('./checker-2eecc677.js');
18
+ var property_name = require('./property_name-7c8433f5.js');
18
19
  require('os');
19
20
  require('@angular-devkit/core');
20
21
  require('module');
@@ -36,11 +37,6 @@ function findClassDeclaration(reference, typeChecker) {
36
37
  ?.declarations?.find(ts__default["default"].isClassDeclaration) || null);
37
38
  }
38
39
 
39
- /** Finds a property with a specific name in an object literal expression. */
40
- function findLiteralProperty(literal, name) {
41
- return literal.properties.find((prop) => prop.name && ts__default["default"].isIdentifier(prop.name) && prop.name.text === name);
42
- }
43
-
44
40
  /*!
45
41
  * @license
46
42
  * Copyright Google LLC All Rights Reserved.
@@ -64,7 +60,7 @@ function isStandaloneComponent(node, reflector) {
64
60
  }
65
61
  const arg = decorator.args[0];
66
62
  if (ts__default["default"].isObjectLiteralExpression(arg)) {
67
- const property = findLiteralProperty(arg, 'standalone');
63
+ const property = property_name.findLiteralProperty(arg, 'standalone');
68
64
  if (property) {
69
65
  return property.initializer.getText() === 'true';
70
66
  }
@@ -270,10 +266,10 @@ function migrateRoute(element, route, typeChecker, reflector, tracker) {
270
266
  const skippedRoutes = [];
271
267
  const migratedRoutes = [];
272
268
  const importsToRemove = [];
273
- const component = findLiteralProperty(element, 'component');
269
+ const component = property_name.findLiteralProperty(element, 'component');
274
270
  // this can be empty string or a variable that is not a string, or not present at all
275
- const routePath = findLiteralProperty(element, 'path')?.getText() ?? '';
276
- const children = findLiteralProperty(element, 'children');
271
+ const routePath = property_name.findLiteralProperty(element, 'path')?.getText() ?? '';
272
+ const children = property_name.findLiteralProperty(element, 'children');
277
273
  // recursively migrate children routes first if they exist
278
274
  if (children && ts__default["default"].isArrayLiteralExpression(children.initializer)) {
279
275
  for (const childRoute of children.initializer.elements) {