@angular/core 19.2.11 → 19.2.13
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.
- package/event_dispatcher.d-K56StcHr.d.ts +1 -1
- package/fesm2022/core.mjs +108 -45
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +10 -3
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +29 -3
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked-BKcld_ew.mjs +1 -1
- package/fesm2022/untracked-BKcld_ew.mjs.map +1 -1
- package/index.d.ts +168 -23
- package/navigation_types.d-fAxd92YV.d.ts +1 -1
- package/package.json +1 -1
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/bundles/{apply_import_manager-DdHXpkne.js → apply_import_manager-QQDfWa1Z.cjs} +3 -3
- package/schematics/bundles/{checker-CGGdizaF.js → checker-5pyJrZ9G.cjs} +81 -63
- package/schematics/bundles/{cleanup-unused-imports.js → cleanup-unused-imports.cjs} +25 -54
- package/schematics/bundles/{compiler_host-BmQrIxJT.js → compiler_host-B1Gyeytz.cjs} +2 -2
- package/schematics/bundles/{control-flow-migration.js → control-flow-migration.cjs} +3 -3
- package/schematics/bundles/{explicit-standalone-flag.js → explicit-standalone-flag.cjs} +5 -5
- package/schematics/bundles/{imports-CIX-JgAN.js → imports-CIX-JgAN.cjs} +1 -1
- package/schematics/bundles/{index-BF06LaCS.js → index-BIvVb6in.cjs} +26 -26
- package/schematics/bundles/{index-DGcgCgNa.js → index-BPhQoCcF.cjs} +28 -19
- package/schematics/bundles/{inject-migration.js → inject-migration.cjs} +7 -7
- package/schematics/bundles/{leading_space-D9nQ8UQC.js → leading_space-D9nQ8UQC.cjs} +1 -1
- package/schematics/bundles/{migrate_ts_type_references-CE_V0IM9.js → migrate_ts_type_references-Czrg1gcB.cjs} +6 -6
- package/schematics/bundles/{ng_decorators-DznZ5jMl.js → ng_decorators-B5HCqr20.cjs} +2 -2
- package/schematics/bundles/{nodes-B16H9JUd.js → nodes-B16H9JUd.cjs} +1 -1
- package/schematics/bundles/{output-migration.js → output-migration.cjs} +7 -7
- package/schematics/bundles/{pending-tasks.js → pending-tasks.cjs} +5 -5
- package/schematics/bundles/{project_paths-CmS2U6KE.js → project_paths-CyWVEsbT.cjs} +66 -37
- package/schematics/bundles/{project_tsconfig_paths-CDVxT6Ov.js → project_tsconfig_paths-CDVxT6Ov.cjs} +1 -1
- package/schematics/bundles/{property_name-BBwFuqMe.js → property_name-BBwFuqMe.cjs} +1 -1
- package/schematics/bundles/{provide-initializer.js → provide-initializer.cjs} +5 -5
- package/schematics/bundles/{route-lazy-loading.js → route-lazy-loading.cjs} +5 -5
- package/schematics/bundles/{self-closing-tags-migration.js → self-closing-tags-migration.cjs} +11 -25
- package/schematics/bundles/{signal-input-migration.js → signal-input-migration.cjs} +19 -15
- package/schematics/bundles/{signal-queries-migration.js → signal-queries-migration.cjs} +9 -9
- package/schematics/bundles/{signals.js → signals.cjs} +12 -12
- package/schematics/bundles/{standalone-migration.js → standalone-migration.cjs} +8 -8
- package/schematics/collection.json +10 -10
- package/schematics/migrations.json +3 -3
- package/testing/index.d.ts +14 -2
- package/weak_ref.d-DWHPG08n.d.ts +1 -1
- package/schematics/package.json +0 -3
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-5pyJrZ9G.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
var p = require('path');
|
|
12
12
|
require('os');
|
|
@@ -912,23 +912,21 @@ function compileHmrInitializer(meta) {
|
|
|
912
912
|
]);
|
|
913
913
|
// (m) => m.default && ɵɵreplaceMetadata(...)
|
|
914
914
|
const replaceCallback = checker.arrowFn([new checker.FnParam(moduleName)], defaultRead.and(replaceCall));
|
|
915
|
-
//
|
|
916
|
-
const
|
|
917
|
-
.
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
// new URL(urlValue, urlBase).href
|
|
923
|
-
const urlHref = new checker.InstantiateExpr(checker.variable('URL'), [urlValue, urlBase]).prop('href');
|
|
915
|
+
// getReplaceMetadataURL(id, timestamp, import.meta.url)
|
|
916
|
+
const url = checker.importExpr(checker.Identifiers.getReplaceMetadataURL)
|
|
917
|
+
.callFn([
|
|
918
|
+
checker.variable(idName),
|
|
919
|
+
checker.variable(timestampName),
|
|
920
|
+
checker.variable('import').prop('meta').prop('url'),
|
|
921
|
+
]);
|
|
924
922
|
// function Cmp_HmrLoad(t) {
|
|
925
|
-
// import(/* @vite-ignore */
|
|
923
|
+
// import(/* @vite-ignore */ url).then((m) => m.default && replaceMetadata(...));
|
|
926
924
|
// }
|
|
927
925
|
const importCallback = new checker.DeclareFunctionStmt(importCallbackName, [new checker.FnParam(timestampName)], [
|
|
928
926
|
// The vite-ignore special comment is required to prevent Vite from generating a superfluous
|
|
929
927
|
// warning for each usage within the development code. If Vite provides a method to
|
|
930
928
|
// programmatically avoid this warning in the future, this added comment can be removed here.
|
|
931
|
-
new checker.DynamicImportExpr(
|
|
929
|
+
new checker.DynamicImportExpr(url, null, '@vite-ignore')
|
|
932
930
|
.prop('then')
|
|
933
931
|
.callFn([replaceCallback])
|
|
934
932
|
.toStmt(),
|
|
@@ -1007,7 +1005,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
1007
1005
|
function compileDeclareClassMetadata(metadata) {
|
|
1008
1006
|
const definitionMap = new checker.DefinitionMap();
|
|
1009
1007
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
1010
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1008
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1011
1009
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1012
1010
|
definitionMap.set('type', metadata.type);
|
|
1013
1011
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -1025,7 +1023,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
1025
1023
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? checker.literal(null));
|
|
1026
1024
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? checker.literal(null));
|
|
1027
1025
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
1028
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1026
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1029
1027
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1030
1028
|
definitionMap.set('type', metadata.type);
|
|
1031
1029
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -1120,7 +1118,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
1120
1118
|
const definitionMap = new checker.DefinitionMap();
|
|
1121
1119
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
1122
1120
|
definitionMap.set('minVersion', checker.literal(minVersion));
|
|
1123
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1121
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1124
1122
|
// e.g. `type: MyDirective`
|
|
1125
1123
|
definitionMap.set('type', meta.type.value);
|
|
1126
1124
|
if (meta.isStandalone !== undefined) {
|
|
@@ -1536,7 +1534,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
1536
1534
|
function compileDeclareFactoryFunction(meta) {
|
|
1537
1535
|
const definitionMap = new checker.DefinitionMap();
|
|
1538
1536
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
1539
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1537
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1540
1538
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1541
1539
|
definitionMap.set('type', meta.type.value);
|
|
1542
1540
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -1571,7 +1569,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
1571
1569
|
function createInjectableDefinitionMap(meta) {
|
|
1572
1570
|
const definitionMap = new checker.DefinitionMap();
|
|
1573
1571
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
1574
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1572
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1575
1573
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1576
1574
|
definitionMap.set('type', meta.type.value);
|
|
1577
1575
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -1622,7 +1620,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
1622
1620
|
function createInjectorDefinitionMap(meta) {
|
|
1623
1621
|
const definitionMap = new checker.DefinitionMap();
|
|
1624
1622
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
1625
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1623
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1626
1624
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1627
1625
|
definitionMap.set('type', meta.type.value);
|
|
1628
1626
|
definitionMap.set('providers', meta.providers);
|
|
@@ -1655,7 +1653,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
1655
1653
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
1656
1654
|
}
|
|
1657
1655
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
1658
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1656
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1659
1657
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1660
1658
|
definitionMap.set('type', meta.type.value);
|
|
1661
1659
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -1706,7 +1704,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
1706
1704
|
function createPipeDefinitionMap(meta) {
|
|
1707
1705
|
const definitionMap = new checker.DefinitionMap();
|
|
1708
1706
|
definitionMap.set('minVersion', checker.literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
1709
|
-
definitionMap.set('version', checker.literal('19.2.
|
|
1707
|
+
definitionMap.set('version', checker.literal('19.2.13'));
|
|
1710
1708
|
definitionMap.set('ngImport', checker.importExpr(checker.Identifiers.core));
|
|
1711
1709
|
// e.g. `type: MyPipe`
|
|
1712
1710
|
definitionMap.set('type', meta.type.value);
|
|
@@ -4510,9 +4508,11 @@ function extractClassMetadata(clazz, reflection, isCore, annotateForClosureCompi
|
|
|
4510
4508
|
}
|
|
4511
4509
|
// Do the same for property decorators.
|
|
4512
4510
|
let metaPropDecorators = null;
|
|
4513
|
-
const classMembers = reflection
|
|
4514
|
-
.
|
|
4515
|
-
|
|
4511
|
+
const classMembers = reflection.getMembersOfClass(clazz).filter((member) => !member.isStatic &&
|
|
4512
|
+
member.decorators !== null &&
|
|
4513
|
+
member.decorators.length > 0 &&
|
|
4514
|
+
// Private fields are not supported in the metadata emit
|
|
4515
|
+
member.accessLevel !== checker.ClassMemberAccessLevel.EcmaScriptPrivate);
|
|
4516
4516
|
const duplicateDecoratedMembers = classMembers.filter((member, i, arr) => arr.findIndex((arrayMember) => arrayMember.name === member.name) < i);
|
|
4517
4517
|
if (duplicateDecoratedMembers.length > 0) {
|
|
4518
4518
|
// This should theoretically never happen, because the only way to have duplicate instance
|
|
@@ -10730,7 +10730,7 @@ class PipeDecoratorHandler {
|
|
|
10730
10730
|
* @description
|
|
10731
10731
|
* Entry point for all public APIs of the compiler-cli package.
|
|
10732
10732
|
*/
|
|
10733
|
-
new checker.Version('19.2.
|
|
10733
|
+
new checker.Version('19.2.13');
|
|
10734
10734
|
|
|
10735
10735
|
/**
|
|
10736
10736
|
* Whether a given decorator should be treated as an Angular decorator.
|
|
@@ -18585,7 +18585,7 @@ var semver = /*@__PURE__*/getDefaultExportFromCjs(semverExports);
|
|
|
18585
18585
|
* @param minVersion Minimum required version for the feature.
|
|
18586
18586
|
*/
|
|
18587
18587
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
18588
|
-
// A version of `19.2.
|
|
18588
|
+
// A version of `19.2.13` usually means that core is at head so it supports
|
|
18589
18589
|
// all features. Use string interpolation prevent the placeholder from being replaced
|
|
18590
18590
|
// with the current version during build time.
|
|
18591
18591
|
if (coreVersion === `0.0.0-${'PLACEHOLDER'}`) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var index = require('./index-
|
|
11
|
+
var checker = require('./checker-5pyJrZ9G.cjs');
|
|
12
|
+
var index = require('./index-BIvVb6in.cjs');
|
|
13
13
|
require('path');
|
|
14
|
-
var project_paths = require('./project_paths-
|
|
14
|
+
var project_paths = require('./project_paths-CyWVEsbT.cjs');
|
|
15
15
|
|
|
16
16
|
function getMemberName(member) {
|
|
17
17
|
if (member.name === undefined) {
|
|
@@ -843,24 +843,33 @@ function identifyPotentialTypeScriptReference(node, programInfo, checker, knownF
|
|
|
843
843
|
return;
|
|
844
844
|
}
|
|
845
845
|
let target = undefined;
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
846
|
+
try {
|
|
847
|
+
// Resolve binding elements to their declaration symbol.
|
|
848
|
+
// Commonly inputs are accessed via object expansion. e.g. `const {input} = this;`.
|
|
849
|
+
if (ts.isBindingElement(node.parent)) {
|
|
850
|
+
// Skip binding elements that are using spread.
|
|
851
|
+
if (node.parent.dotDotDotToken !== undefined) {
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
const bindingInfo = resolveBindingElement(node.parent);
|
|
855
|
+
if (bindingInfo === null) {
|
|
856
|
+
// The declaration could not be resolved. Skip analyzing this.
|
|
857
|
+
return;
|
|
858
|
+
}
|
|
859
|
+
const bindingType = checker.getTypeAtLocation(bindingInfo.pattern);
|
|
860
|
+
const resolved = lookupPropertyAccess(checker, bindingType, [bindingInfo.propertyName]);
|
|
861
|
+
target = resolved?.symbol;
|
|
852
862
|
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
// The declaration could not be resolved. Skip analyzing this.
|
|
856
|
-
return;
|
|
863
|
+
else {
|
|
864
|
+
target = checker.getSymbolAtLocation(node);
|
|
857
865
|
}
|
|
858
|
-
const bindingType = checker.getTypeAtLocation(bindingInfo.pattern);
|
|
859
|
-
const resolved = lookupPropertyAccess(checker, bindingType, [bindingInfo.propertyName]);
|
|
860
|
-
target = resolved?.symbol;
|
|
861
866
|
}
|
|
862
|
-
|
|
863
|
-
|
|
867
|
+
catch (e) {
|
|
868
|
+
console.error('Unexpected error while trying to resolve identifier reference:');
|
|
869
|
+
console.error(e);
|
|
870
|
+
// Gracefully skip analyzing. This can happen when e.g. a reference is named similar
|
|
871
|
+
// to an input, but is dependant on `.d.ts` that is not necessarily available (clutz dts).
|
|
872
|
+
return;
|
|
864
873
|
}
|
|
865
874
|
noTargetSymbolCheck: if (target === undefined) {
|
|
866
875
|
if (ts.isPropertyAccessExpression(node.parent) && node.parent.name === node) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
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 schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var p = require('path');
|
|
11
|
-
var compiler_host = require('./compiler_host-
|
|
11
|
+
var compiler_host = require('./compiler_host-B1Gyeytz.cjs');
|
|
12
12
|
var ts = require('typescript');
|
|
13
|
-
var ng_decorators = require('./ng_decorators-
|
|
14
|
-
var imports = require('./imports-CIX-JgAN.
|
|
15
|
-
var nodes = require('./nodes-B16H9JUd.
|
|
16
|
-
var leading_space = require('./leading_space-D9nQ8UQC.
|
|
17
|
-
require('./checker-
|
|
13
|
+
var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
|
|
14
|
+
var imports = require('./imports-CIX-JgAN.cjs');
|
|
15
|
+
var nodes = require('./nodes-B16H9JUd.cjs');
|
|
16
|
+
var leading_space = require('./leading_space-D9nQ8UQC.cjs');
|
|
17
|
+
require('./checker-5pyJrZ9G.cjs');
|
|
18
18
|
require('os');
|
|
19
19
|
require('fs');
|
|
20
20
|
require('module');
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var checker = require('./checker-
|
|
9
|
+
var checker = require('./checker-5pyJrZ9G.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
12
|
var assert = require('assert');
|
|
13
|
-
var index = require('./index-
|
|
14
|
-
var project_paths = require('./project_paths-
|
|
15
|
-
var leading_space = require('./leading_space-D9nQ8UQC.
|
|
16
|
-
require('./index-
|
|
13
|
+
var index = require('./index-BPhQoCcF.cjs');
|
|
14
|
+
var project_paths = require('./project_paths-CyWVEsbT.cjs');
|
|
15
|
+
var leading_space = require('./leading_space-D9nQ8UQC.cjs');
|
|
16
|
+
require('./index-BIvVb6in.cjs');
|
|
17
17
|
require('path');
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
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.
|
|
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 v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,19 +8,19 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var checker = require('./checker-
|
|
12
|
-
var index$1 = require('./index-
|
|
11
|
+
var checker = require('./checker-5pyJrZ9G.cjs');
|
|
12
|
+
var index$1 = require('./index-BIvVb6in.cjs');
|
|
13
13
|
require('path');
|
|
14
|
-
var project_paths = require('./project_paths-
|
|
15
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
16
|
-
var index = require('./index-
|
|
14
|
+
var project_paths = require('./project_paths-CyWVEsbT.cjs');
|
|
15
|
+
var apply_import_manager = require('./apply_import_manager-QQDfWa1Z.cjs');
|
|
16
|
+
var index = require('./index-BPhQoCcF.cjs');
|
|
17
17
|
require('@angular-devkit/core');
|
|
18
18
|
require('node:path/posix');
|
|
19
19
|
require('fs');
|
|
20
20
|
require('module');
|
|
21
21
|
require('url');
|
|
22
22
|
require('@angular-devkit/schematics');
|
|
23
|
-
require('./project_tsconfig_paths-CDVxT6Ov.
|
|
23
|
+
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
24
24
|
|
|
25
25
|
function isOutputDeclarationEligibleForMigration(node) {
|
|
26
26
|
return (node.initializer !== undefined &&
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
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 schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var p = require('path');
|
|
11
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.
|
|
12
|
-
var compiler_host = require('./compiler_host-
|
|
11
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
12
|
+
var compiler_host = require('./compiler_host-B1Gyeytz.cjs');
|
|
13
13
|
var ts = require('typescript');
|
|
14
|
-
var imports = require('./imports-CIX-JgAN.
|
|
14
|
+
var imports = require('./imports-CIX-JgAN.cjs');
|
|
15
15
|
require('@angular-devkit/core');
|
|
16
|
-
require('./checker-
|
|
16
|
+
require('./checker-5pyJrZ9G.cjs');
|
|
17
17
|
require('os');
|
|
18
18
|
require('fs');
|
|
19
19
|
require('module');
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
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-
|
|
9
|
+
var index = require('./index-BIvVb6in.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-
|
|
15
|
+
var checker = require('./checker-5pyJrZ9G.cjs');
|
|
16
16
|
require('path');
|
|
17
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.
|
|
17
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
18
18
|
|
|
19
19
|
function _interopNamespaceDefault(e) {
|
|
20
20
|
var n = Object.create(null);
|
|
@@ -480,7 +480,7 @@ function createPlainTsProgram(tsHost, tsconfig, optionOverrides) {
|
|
|
480
480
|
ngCompiler: null,
|
|
481
481
|
program,
|
|
482
482
|
userOptions: tsconfig.options,
|
|
483
|
-
|
|
483
|
+
__programAbsoluteRootFileNames: tsconfig.rootNames,
|
|
484
484
|
host: tsHost,
|
|
485
485
|
};
|
|
486
486
|
}
|
|
@@ -503,7 +503,7 @@ function createNgtscProgram(tsHost, tsconfig, optionOverrides) {
|
|
|
503
503
|
ngCompiler: ngtscProgram.compiler,
|
|
504
504
|
program: ngtscProgram.getTsProgram(),
|
|
505
505
|
userOptions: tsconfig.options,
|
|
506
|
-
|
|
506
|
+
__programAbsoluteRootFileNames: tsconfig.rootNames,
|
|
507
507
|
host: tsHost,
|
|
508
508
|
};
|
|
509
509
|
}
|
|
@@ -538,6 +538,33 @@ function createBaseProgramInfo(absoluteTsconfigPath, fs, optionOverrides = {}) {
|
|
|
538
538
|
}
|
|
539
539
|
return createNgtscProgram(tsHost, tsconfig, optionOverrides);
|
|
540
540
|
}
|
|
541
|
+
/**
|
|
542
|
+
* Creates the {@link ProgramInfo} from the given base information.
|
|
543
|
+
*
|
|
544
|
+
* This function purely exists to support custom programs that are
|
|
545
|
+
* intended to be injected into Tsurge migrations. e.g. for language
|
|
546
|
+
* service refactorings.
|
|
547
|
+
*/
|
|
548
|
+
function getProgramInfoFromBaseInfo(baseInfo) {
|
|
549
|
+
const fullProgramSourceFiles = [...baseInfo.program.getSourceFiles()];
|
|
550
|
+
const sourceFiles = fullProgramSourceFiles.filter((f) => !f.isDeclarationFile &&
|
|
551
|
+
// Note `isShim` will work for the initial program, but for TCB programs, the shims are no longer annotated.
|
|
552
|
+
!checker.isShim(f) &&
|
|
553
|
+
!f.fileName.endsWith('.ngtypecheck.ts'));
|
|
554
|
+
// Sort it by length in reverse order (longest first). This speeds up lookups,
|
|
555
|
+
// since there's no need to keep going through the array once a match is found.
|
|
556
|
+
const sortedRootDirs = checker.getRootDirs(baseInfo.host, baseInfo.userOptions).sort((a, b) => b.length - a.length);
|
|
557
|
+
// TODO: Consider also following TS's logic here, finding the common source root.
|
|
558
|
+
// See: Program#getCommonSourceDirectory.
|
|
559
|
+
const primaryRoot = checker.absoluteFrom(baseInfo.userOptions.rootDir ?? sortedRootDirs.at(-1) ?? baseInfo.program.getCurrentDirectory());
|
|
560
|
+
return {
|
|
561
|
+
...baseInfo,
|
|
562
|
+
sourceFiles,
|
|
563
|
+
fullProgramSourceFiles,
|
|
564
|
+
sortedRootDirs,
|
|
565
|
+
projectRoot: primaryRoot,
|
|
566
|
+
};
|
|
567
|
+
}
|
|
541
568
|
|
|
542
569
|
/**
|
|
543
570
|
* @private
|
|
@@ -549,37 +576,14 @@ function createBaseProgramInfo(absoluteTsconfigPath, fs, optionOverrides = {}) {
|
|
|
549
576
|
*/
|
|
550
577
|
class TsurgeBaseMigration {
|
|
551
578
|
/**
|
|
552
|
-
*
|
|
553
|
-
* overriding {@link prepareProgram} is more desirable.
|
|
579
|
+
* Creates the TypeScript program for a given compilation unit.
|
|
554
580
|
*
|
|
555
581
|
* By default:
|
|
556
582
|
* - In 3P: Ngtsc programs are being created.
|
|
557
583
|
* - In 1P: Ngtsc or TS programs are created based on the Blaze target.
|
|
558
584
|
*/
|
|
559
|
-
createProgram(tsconfigAbsPath, fs,
|
|
560
|
-
return createBaseProgramInfo(tsconfigAbsPath, fs,
|
|
561
|
-
}
|
|
562
|
-
// Optional function to prepare the base `ProgramInfo` even further,
|
|
563
|
-
// for the analyze and migrate phases. E.g. determining source files.
|
|
564
|
-
prepareProgram(info) {
|
|
565
|
-
const fullProgramSourceFiles = [...info.program.getSourceFiles()];
|
|
566
|
-
const sourceFiles = fullProgramSourceFiles.filter((f) => !f.isDeclarationFile &&
|
|
567
|
-
// Note `isShim` will work for the initial program, but for TCB programs, the shims are no longer annotated.
|
|
568
|
-
!checker.isShim(f) &&
|
|
569
|
-
!f.fileName.endsWith('.ngtypecheck.ts'));
|
|
570
|
-
// Sort it by length in reverse order (longest first). This speeds up lookups,
|
|
571
|
-
// since there's no need to keep going through the array once a match is found.
|
|
572
|
-
const sortedRootDirs = checker.getRootDirs(info.host, info.userOptions).sort((a, b) => b.length - a.length);
|
|
573
|
-
// TODO: Consider also following TS's logic here, finding the common source root.
|
|
574
|
-
// See: Program#getCommonSourceDirectory.
|
|
575
|
-
const primaryRoot = checker.absoluteFrom(info.userOptions.rootDir ?? sortedRootDirs.at(-1) ?? info.program.getCurrentDirectory());
|
|
576
|
-
return {
|
|
577
|
-
...info,
|
|
578
|
-
sourceFiles,
|
|
579
|
-
fullProgramSourceFiles,
|
|
580
|
-
sortedRootDirs,
|
|
581
|
-
projectRoot: primaryRoot,
|
|
582
|
-
};
|
|
585
|
+
createProgram(tsconfigAbsPath, fs, optionsOverride) {
|
|
586
|
+
return getProgramInfoFromBaseInfo(createBaseProgramInfo(tsconfigAbsPath, fs, optionsOverride));
|
|
583
587
|
}
|
|
584
588
|
}
|
|
585
589
|
|
|
@@ -635,10 +639,11 @@ async function runMigrationInDevkit(config) {
|
|
|
635
639
|
const migration = config.getMigration(fs);
|
|
636
640
|
const unitResults = [];
|
|
637
641
|
const isFunnelMigration = migration instanceof TsurgeFunnelMigration;
|
|
642
|
+
const compilationUnitAssignments = new Map();
|
|
638
643
|
for (const tsconfigPath of tsconfigPaths) {
|
|
639
644
|
config.beforeProgramCreation?.(tsconfigPath, exports.MigrationStage.Analysis);
|
|
640
|
-
const
|
|
641
|
-
|
|
645
|
+
const info = migration.createProgram(tsconfigPath, fs);
|
|
646
|
+
modifyProgramInfoToEnsureNonOverlappingFiles(tsconfigPath, info, compilationUnitAssignments);
|
|
642
647
|
config.afterProgramCreation?.(info, fs, exports.MigrationStage.Analysis);
|
|
643
648
|
config.beforeUnitAnalysis?.(tsconfigPath);
|
|
644
649
|
unitResults.push(await migration.analyze(info));
|
|
@@ -658,8 +663,8 @@ async function runMigrationInDevkit(config) {
|
|
|
658
663
|
replacements = [];
|
|
659
664
|
for (const tsconfigPath of tsconfigPaths) {
|
|
660
665
|
config.beforeProgramCreation?.(tsconfigPath, exports.MigrationStage.Migrate);
|
|
661
|
-
const
|
|
662
|
-
|
|
666
|
+
const info = migration.createProgram(tsconfigPath, fs);
|
|
667
|
+
modifyProgramInfoToEnsureNonOverlappingFiles(tsconfigPath, info, compilationUnitAssignments);
|
|
663
668
|
config.afterProgramCreation?.(info, fs, exports.MigrationStage.Migrate);
|
|
664
669
|
const result = await migration.migrate(globalMeta, info);
|
|
665
670
|
replacements.push(...result.replacements);
|
|
@@ -683,6 +688,31 @@ async function runMigrationInDevkit(config) {
|
|
|
683
688
|
}
|
|
684
689
|
config.whenDone?.(await migration.stats(globalMeta));
|
|
685
690
|
}
|
|
691
|
+
/**
|
|
692
|
+
* Special logic for devkit migrations. In the Angular CLI, or in 3P precisely,
|
|
693
|
+
* projects can have tsconfigs with overlapping source files. i.e. two tsconfigs
|
|
694
|
+
* like e.g. build or test include the same `ts.SourceFile` (`.ts`). Migrations
|
|
695
|
+
* should never have 2+ compilation units with overlapping source files as this
|
|
696
|
+
* can result in duplicated replacements or analysis— hence we only ever assign a
|
|
697
|
+
* source file to a compilation unit *once*.
|
|
698
|
+
*
|
|
699
|
+
* Note that this is fine as we expect Tsurge migrations to work together as
|
|
700
|
+
* isolated compilation units— so it shouldn't matter if worst case a `.ts`
|
|
701
|
+
* file ends up in the e.g. test program.
|
|
702
|
+
*/
|
|
703
|
+
function modifyProgramInfoToEnsureNonOverlappingFiles(tsconfigPath, info, compilationUnitAssignments) {
|
|
704
|
+
const sourceFiles = [];
|
|
705
|
+
for (const sf of info.sourceFiles) {
|
|
706
|
+
const assignment = compilationUnitAssignments.get(sf.fileName);
|
|
707
|
+
// File is already assigned to a different compilation unit.
|
|
708
|
+
if (assignment !== undefined && assignment !== tsconfigPath) {
|
|
709
|
+
continue;
|
|
710
|
+
}
|
|
711
|
+
compilationUnitAssignments.set(sf.fileName, tsconfigPath);
|
|
712
|
+
sourceFiles.push(sf);
|
|
713
|
+
}
|
|
714
|
+
info.sourceFiles = sourceFiles;
|
|
715
|
+
}
|
|
686
716
|
|
|
687
717
|
/** A text replacement for the given file. */
|
|
688
718
|
class Replacement {
|
|
@@ -750,6 +780,5 @@ exports.TextUpdate = TextUpdate;
|
|
|
750
780
|
exports.TsurgeComplexMigration = TsurgeComplexMigration;
|
|
751
781
|
exports.TsurgeFunnelMigration = TsurgeFunnelMigration;
|
|
752
782
|
exports.confirmAsSerializable = confirmAsSerializable;
|
|
753
|
-
exports.createBaseProgramInfo = createBaseProgramInfo;
|
|
754
783
|
exports.projectFile = projectFile;
|
|
755
784
|
exports.runMigrationInDevkit = runMigrationInDevkit;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
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 schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var p = require('path');
|
|
11
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.
|
|
12
|
-
var compiler_host = require('./compiler_host-
|
|
11
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
12
|
+
var compiler_host = require('./compiler_host-B1Gyeytz.cjs');
|
|
13
13
|
var ts = require('typescript');
|
|
14
|
-
var imports = require('./imports-CIX-JgAN.
|
|
14
|
+
var imports = require('./imports-CIX-JgAN.cjs');
|
|
15
15
|
require('@angular-devkit/core');
|
|
16
|
-
require('./checker-
|
|
16
|
+
require('./checker-5pyJrZ9G.cjs');
|
|
17
17
|
require('os');
|
|
18
18
|
require('fs');
|
|
19
19
|
require('module');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v19.2.
|
|
3
|
+
* @license Angular v19.2.13
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
var schematics = require('@angular-devkit/schematics');
|
|
10
10
|
var fs = require('fs');
|
|
11
11
|
var p = require('path');
|
|
12
|
-
var compiler_host = require('./compiler_host-
|
|
13
|
-
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.
|
|
12
|
+
var compiler_host = require('./compiler_host-B1Gyeytz.cjs');
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
14
14
|
var ts = require('typescript');
|
|
15
|
-
var checker = require('./checker-
|
|
16
|
-
var property_name = require('./property_name-BBwFuqMe.
|
|
15
|
+
var checker = require('./checker-5pyJrZ9G.cjs');
|
|
16
|
+
var property_name = require('./property_name-BBwFuqMe.cjs');
|
|
17
17
|
require('os');
|
|
18
18
|
require('@angular-devkit/core');
|
|
19
19
|
require('module');
|