@angular/core 20.2.0-next.3 → 20.2.0-next.5
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/api.d.d.ts +1 -1
- package/chrome_dev_tools_performance.d.d.ts +1 -1
- package/discovery.d.d.ts +14 -2
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/attribute.mjs.map +1 -1
- package/fesm2022/core.mjs +40 -12
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +234 -97
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/not_found.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/resource.mjs +1 -1
- package/fesm2022/resource.mjs.map +1 -1
- package/fesm2022/root_effect_scheduler.mjs +1 -1
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal.mjs +1 -1
- package/fesm2022/signal.mjs.map +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/untracked.mjs +1 -1
- package/fesm2022/untracked.mjs.map +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/fesm2022/weak_ref.mjs.map +1 -1
- package/graph.d.d.ts +1 -1
- package/index.d.ts +23 -8
- package/package.json +2 -2
- 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-C9H5B66Q.cjs → apply_import_manager-Bf0h419q.cjs} +4 -4
- package/schematics/bundles/cleanup-unused-imports.cjs +7 -8
- package/schematics/bundles/{compiler_host-DTywrGR6.cjs → compiler_host-CpG50gww.cjs} +3 -3
- package/schematics/bundles/control-flow-migration.cjs +18 -19
- package/schematics/bundles/document-core.cjs +6 -7
- package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
- package/schematics/bundles/{index-DvIl8s8s.cjs → index-DTWyGOPM.cjs} +49 -49
- package/schematics/bundles/{index-DWQ8GMRM.cjs → index-Dl0zaIBS.cjs} +1263 -1253
- package/schematics/bundles/inject-flags.cjs +6 -7
- package/schematics/bundles/inject-migration.cjs +6 -7
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-BFb3oiAk.cjs → migrate_ts_type_references-BlMDltWE.cjs} +14 -14
- package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +20 -21
- package/schematics/bundles/{project_paths-Cuim0I7i.cjs → project_paths-0E6AzVkB.cjs} +16 -17
- package/schematics/bundles/{checker-DBomdQHo.cjs → project_tsconfig_paths-ClCuNoA6.cjs} +147 -30
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +6 -7
- package/schematics/bundles/router-current-navigation.cjs +114 -0
- package/schematics/bundles/self-closing-tags-migration.cjs +10 -11
- package/schematics/bundles/signal-input-migration.cjs +21 -22
- package/schematics/bundles/signal-queries-migration.cjs +31 -32
- package/schematics/bundles/signals.cjs +8 -9
- package/schematics/bundles/standalone-migration.cjs +10 -11
- package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
- package/schematics/bundles/test-bed-get.cjs +4 -5
- package/schematics/migrations.json +6 -0
- package/signal.d.d.ts +1 -1
- package/testing/index.d.ts +1 -1
- package/weak_ref.d.d.ts +1 -1
- package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.cjs +0 -90
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.5
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -12,6 +12,7 @@ var fs$1 = require('fs');
|
|
|
12
12
|
var module$1 = require('module');
|
|
13
13
|
var p = require('path');
|
|
14
14
|
var url = require('url');
|
|
15
|
+
var core = require('@angular-devkit/core');
|
|
15
16
|
|
|
16
17
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
17
18
|
function _interopNamespaceDefault(e) {
|
|
@@ -451,6 +452,7 @@ exports.ViewEncapsulation = void 0;
|
|
|
451
452
|
// Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
|
|
452
453
|
ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
|
|
453
454
|
ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
|
|
455
|
+
ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
|
|
454
456
|
})(exports.ViewEncapsulation || (exports.ViewEncapsulation = {}));
|
|
455
457
|
exports.ChangeDetectionStrategy = void 0;
|
|
456
458
|
(function (ChangeDetectionStrategy) {
|
|
@@ -544,6 +546,7 @@ var ViewEncapsulation;
|
|
|
544
546
|
// Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
|
|
545
547
|
ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
|
|
546
548
|
ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
|
|
549
|
+
ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
|
|
547
550
|
})(ViewEncapsulation || (ViewEncapsulation = {}));
|
|
548
551
|
|
|
549
552
|
/**
|
|
@@ -30796,7 +30799,8 @@ class R3TargetBinder {
|
|
|
30796
30799
|
// Bind the host element in a separate scope. Note that it only uses the
|
|
30797
30800
|
// `TemplateBinder` since directives don't apply inside a host context.
|
|
30798
30801
|
if (target.host) {
|
|
30799
|
-
|
|
30802
|
+
directives.set(target.host.node, target.host.directives);
|
|
30803
|
+
TemplateBinder.applyWithScope(target.host.node, Scope$1.apply(target.host.node), expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
|
|
30800
30804
|
}
|
|
30801
30805
|
return new R3BoundTarget(target, directives, eagerDirectives, missingDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
|
|
30802
30806
|
}
|
|
@@ -31589,7 +31593,8 @@ class R3BoundTarget {
|
|
|
31589
31593
|
}
|
|
31590
31594
|
if (target instanceof Template ||
|
|
31591
31595
|
target.node instanceof Component$1 ||
|
|
31592
|
-
target.node instanceof Directive$1
|
|
31596
|
+
target.node instanceof Directive$1 ||
|
|
31597
|
+
target.node instanceof HostElement) {
|
|
31593
31598
|
return null;
|
|
31594
31599
|
}
|
|
31595
31600
|
return this.referenceTargetToElement(target.node);
|
|
@@ -32783,7 +32788,7 @@ function isAttrNode(ast) {
|
|
|
32783
32788
|
* @description
|
|
32784
32789
|
* Entry point for all public APIs of the compiler package.
|
|
32785
32790
|
*/
|
|
32786
|
-
new Version('20.2.0-next.
|
|
32791
|
+
new Version('20.2.0-next.5');
|
|
32787
32792
|
|
|
32788
32793
|
//////////////////////////////////////
|
|
32789
32794
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -33818,7 +33823,7 @@ class NodeJSPathManipulation {
|
|
|
33818
33823
|
// G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
|
|
33819
33824
|
// CommonJS/ESM interop for determining the current file name and containing dir.
|
|
33820
33825
|
const isCommonJS = typeof __filename !== 'undefined';
|
|
33821
|
-
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('
|
|
33826
|
+
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-ClCuNoA6.cjs', document.baseURI).href));
|
|
33822
33827
|
// Note, when this code loads in the browser, `url` may be an empty `{}` due to the Closure shims.
|
|
33823
33828
|
const currentFileName = isCommonJS
|
|
33824
33829
|
? __filename
|
|
@@ -45155,7 +45160,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
45155
45160
|
}
|
|
45156
45161
|
// Add the host bindings type checking code.
|
|
45157
45162
|
if (tcb.boundTarget.target.host !== undefined) {
|
|
45158
|
-
const hostScope = Scope.forNodes(tcb, null, tcb.boundTarget.target.host, null, null);
|
|
45163
|
+
const hostScope = Scope.forNodes(tcb, null, tcb.boundTarget.target.host.node, null, null);
|
|
45159
45164
|
statements.push(renderBlockStatements(env, hostScope, createHostBindingsBlockGuard()));
|
|
45160
45165
|
}
|
|
45161
45166
|
const body = ts.factory.createBlock(statements);
|
|
@@ -45526,6 +45531,7 @@ class TcbDirectiveTypeOpBase extends TcbOp {
|
|
|
45526
45531
|
const dirRef = this.dir.ref;
|
|
45527
45532
|
const rawType = this.tcb.env.referenceType(this.dir.ref);
|
|
45528
45533
|
let type;
|
|
45534
|
+
let span;
|
|
45529
45535
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === undefined) {
|
|
45530
45536
|
type = rawType;
|
|
45531
45537
|
}
|
|
@@ -45536,9 +45542,15 @@ class TcbDirectiveTypeOpBase extends TcbOp {
|
|
|
45536
45542
|
const typeArguments = dirRef.node.typeParameters.map(() => ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword));
|
|
45537
45543
|
type = ts.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
45538
45544
|
}
|
|
45545
|
+
if (this.node instanceof HostElement) {
|
|
45546
|
+
span = this.node.sourceSpan;
|
|
45547
|
+
}
|
|
45548
|
+
else {
|
|
45549
|
+
span = this.node.startSourceSpan || this.node.sourceSpan;
|
|
45550
|
+
}
|
|
45539
45551
|
const id = this.tcb.allocateId();
|
|
45540
45552
|
addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
|
|
45541
|
-
addParseSpanInfo(id,
|
|
45553
|
+
addParseSpanInfo(id, span);
|
|
45542
45554
|
this.scope.addStatement(tsDeclareVariable(id, type));
|
|
45543
45555
|
return id;
|
|
45544
45556
|
}
|
|
@@ -46208,12 +46220,16 @@ class TcbDirectiveOutputsOp extends TcbOp {
|
|
|
46208
46220
|
tcb;
|
|
46209
46221
|
scope;
|
|
46210
46222
|
node;
|
|
46223
|
+
inputs;
|
|
46224
|
+
outputs;
|
|
46211
46225
|
dir;
|
|
46212
|
-
constructor(tcb, scope, node, dir) {
|
|
46226
|
+
constructor(tcb, scope, node, inputs, outputs, dir) {
|
|
46213
46227
|
super();
|
|
46214
46228
|
this.tcb = tcb;
|
|
46215
46229
|
this.scope = scope;
|
|
46216
46230
|
this.node = node;
|
|
46231
|
+
this.inputs = inputs;
|
|
46232
|
+
this.outputs = outputs;
|
|
46217
46233
|
this.dir = dir;
|
|
46218
46234
|
}
|
|
46219
46235
|
get optional() {
|
|
@@ -46222,14 +46238,16 @@ class TcbDirectiveOutputsOp extends TcbOp {
|
|
|
46222
46238
|
execute() {
|
|
46223
46239
|
let dirId = null;
|
|
46224
46240
|
const outputs = this.dir.outputs;
|
|
46225
|
-
for (const output of this.
|
|
46241
|
+
for (const output of this.outputs) {
|
|
46226
46242
|
if (output.type === exports.ParsedEventType.LegacyAnimation ||
|
|
46227
46243
|
!outputs.hasBindingPropertyName(output.name)) {
|
|
46228
46244
|
continue;
|
|
46229
46245
|
}
|
|
46230
|
-
if (this.tcb.env.config.checkTypeOfOutputEvents &&
|
|
46246
|
+
if (this.tcb.env.config.checkTypeOfOutputEvents &&
|
|
46247
|
+
this.inputs !== null &&
|
|
46248
|
+
output.name.endsWith('Change')) {
|
|
46231
46249
|
const inputName = output.name.slice(0, -6);
|
|
46232
|
-
checkSplitTwoWayBinding(inputName, output, this.
|
|
46250
|
+
checkSplitTwoWayBinding(inputName, output, this.inputs, this.tcb);
|
|
46233
46251
|
}
|
|
46234
46252
|
// TODO(alxhub): consider supporting multiple fields with the same property name for outputs.
|
|
46235
46253
|
const field = outputs.getByBindingPropertyName(output.name)[0].classPropertyName;
|
|
@@ -47009,7 +47027,8 @@ class Scope {
|
|
|
47009
47027
|
else if ((ref instanceof Element$1 ||
|
|
47010
47028
|
ref instanceof Template ||
|
|
47011
47029
|
ref instanceof Component$1 ||
|
|
47012
|
-
ref instanceof Directive$1
|
|
47030
|
+
ref instanceof Directive$1 ||
|
|
47031
|
+
ref instanceof HostElement) &&
|
|
47013
47032
|
directive !== undefined &&
|
|
47014
47033
|
this.directiveOpMap.has(ref)) {
|
|
47015
47034
|
// Resolving a directive on an element or sub-template.
|
|
@@ -47072,7 +47091,7 @@ class Scope {
|
|
|
47072
47091
|
this.appendContentProjectionCheckOp(node);
|
|
47073
47092
|
}
|
|
47074
47093
|
this.appendDirectivesAndInputsOfElementLikeNode(node);
|
|
47075
|
-
this.appendOutputsOfElementLikeNode(node);
|
|
47094
|
+
this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
|
|
47076
47095
|
this.appendSelectorlessDirectives(node);
|
|
47077
47096
|
this.appendChildren(node);
|
|
47078
47097
|
this.checkAndAppendReferencesOfNode(node);
|
|
@@ -47080,7 +47099,7 @@ class Scope {
|
|
|
47080
47099
|
else if (node instanceof Template) {
|
|
47081
47100
|
// Template children are rendered in a child scope.
|
|
47082
47101
|
this.appendDirectivesAndInputsOfElementLikeNode(node);
|
|
47083
|
-
this.appendOutputsOfElementLikeNode(node);
|
|
47102
|
+
this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
|
|
47084
47103
|
this.appendSelectorlessDirectives(node);
|
|
47085
47104
|
const ctxIndex = this.opQueue.push(new TcbTemplateContextOp(this.tcb, this)) - 1;
|
|
47086
47105
|
this.templateCtxOpMap.set(node, ctxIndex);
|
|
@@ -47127,9 +47146,7 @@ class Scope {
|
|
|
47127
47146
|
}
|
|
47128
47147
|
}
|
|
47129
47148
|
else if (node instanceof HostElement) {
|
|
47130
|
-
|
|
47131
|
-
this.hostElementOpMap.set(node, opIndex);
|
|
47132
|
-
this.opQueue.push(new TcbUnclaimedInputsOp(this.tcb, this, node.bindings, node, null), new TcbUnclaimedOutputsOp(this.tcb, this, node, node.listeners, null, null), new TcbDomSchemaCheckerOp(this.tcb, node, false, null));
|
|
47149
|
+
this.appendHostElement(node);
|
|
47133
47150
|
}
|
|
47134
47151
|
}
|
|
47135
47152
|
appendChildren(node) {
|
|
@@ -47203,7 +47220,7 @@ class Scope {
|
|
|
47203
47220
|
this.opQueue.push(new TcbDomSchemaCheckerOp(this.tcb, node, checkElement, claimedInputs));
|
|
47204
47221
|
}
|
|
47205
47222
|
}
|
|
47206
|
-
appendOutputsOfElementLikeNode(node) {
|
|
47223
|
+
appendOutputsOfElementLikeNode(node, bindings, events) {
|
|
47207
47224
|
// Collect all the outputs on the element.
|
|
47208
47225
|
const claimedOutputs = new Set();
|
|
47209
47226
|
// Don't resolve directives when selectorless is enabled and treat all the outputs on the
|
|
@@ -47214,24 +47231,24 @@ class Scope {
|
|
|
47214
47231
|
// If there are no directives, then all outputs are unclaimed outputs, so queue an operation
|
|
47215
47232
|
// to add them if needed.
|
|
47216
47233
|
if (node instanceof Element$1) {
|
|
47217
|
-
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node,
|
|
47234
|
+
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, events, bindings, claimedOutputs));
|
|
47218
47235
|
}
|
|
47219
47236
|
return;
|
|
47220
47237
|
}
|
|
47221
47238
|
// Queue operations for all directives to check the relevant outputs for a directive.
|
|
47222
47239
|
for (const dir of directives) {
|
|
47223
|
-
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, dir));
|
|
47240
|
+
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, bindings, events, dir));
|
|
47224
47241
|
}
|
|
47225
47242
|
// After expanding the directives, we might need to queue an operation to check any unclaimed
|
|
47226
47243
|
// outputs.
|
|
47227
|
-
if (node instanceof Element$1) {
|
|
47244
|
+
if (node instanceof Element$1 || node instanceof HostElement) {
|
|
47228
47245
|
// Go through the directives and register any outputs that it claims in `claimedOutputs`.
|
|
47229
47246
|
for (const dir of directives) {
|
|
47230
47247
|
for (const outputProperty of dir.outputs.propertyNames) {
|
|
47231
47248
|
claimedOutputs.add(outputProperty);
|
|
47232
47249
|
}
|
|
47233
47250
|
}
|
|
47234
|
-
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node,
|
|
47251
|
+
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, events, bindings, claimedOutputs));
|
|
47235
47252
|
}
|
|
47236
47253
|
}
|
|
47237
47254
|
appendInputsOfSelectorlessNode(node) {
|
|
@@ -47272,7 +47289,7 @@ class Scope {
|
|
|
47272
47289
|
const claimedOutputs = new Set();
|
|
47273
47290
|
if (directives !== null && directives.length > 0) {
|
|
47274
47291
|
for (const dir of directives) {
|
|
47275
|
-
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, dir));
|
|
47292
|
+
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, node.inputs, node.outputs, dir));
|
|
47276
47293
|
for (const outputProperty of dir.outputs.propertyNames) {
|
|
47277
47294
|
claimedOutputs.add(outputProperty);
|
|
47278
47295
|
}
|
|
@@ -47446,6 +47463,21 @@ class Scope {
|
|
|
47446
47463
|
this.validateReferenceBasedDeferredTrigger(block, triggers.viewport);
|
|
47447
47464
|
}
|
|
47448
47465
|
}
|
|
47466
|
+
appendHostElement(node) {
|
|
47467
|
+
const opIndex = this.opQueue.push(new TcbHostElementOp(this.tcb, this, node)) - 1;
|
|
47468
|
+
const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
|
|
47469
|
+
if (directives !== null && directives.length > 0) {
|
|
47470
|
+
const directiveOpMap = new Map();
|
|
47471
|
+
for (const directive of directives) {
|
|
47472
|
+
const directiveOp = new TcbNonGenericDirectiveTypeOp(this.tcb, this, node, directive);
|
|
47473
|
+
directiveOpMap.set(directive, this.opQueue.push(directiveOp) - 1);
|
|
47474
|
+
}
|
|
47475
|
+
this.directiveOpMap.set(node, directiveOpMap);
|
|
47476
|
+
}
|
|
47477
|
+
this.hostElementOpMap.set(node, opIndex);
|
|
47478
|
+
this.opQueue.push(new TcbUnclaimedInputsOp(this.tcb, this, node.bindings, node, null), new TcbDomSchemaCheckerOp(this.tcb, node, false, null));
|
|
47479
|
+
this.appendOutputsOfElementLikeNode(node, null, node.listeners);
|
|
47480
|
+
}
|
|
47449
47481
|
validateReferenceBasedDeferredTrigger(block, trigger) {
|
|
47450
47482
|
if (trigger.reference === null) {
|
|
47451
47483
|
if (block.placeholder === null) {
|
|
@@ -48072,7 +48104,12 @@ class TypeCheckContextImpl {
|
|
|
48072
48104
|
}
|
|
48073
48105
|
const boundTarget = binder.bind({
|
|
48074
48106
|
template: templateContext?.nodes,
|
|
48075
|
-
host: hostBindingContext
|
|
48107
|
+
host: hostBindingContext === null
|
|
48108
|
+
? undefined
|
|
48109
|
+
: {
|
|
48110
|
+
node: hostBindingContext.node,
|
|
48111
|
+
directives: hostBindingContext.directives,
|
|
48112
|
+
},
|
|
48076
48113
|
});
|
|
48077
48114
|
if (this.inlining === InliningMode.InlineOps) {
|
|
48078
48115
|
// Get all of the directives used in the template and record inline type constructors when
|
|
@@ -50395,11 +50432,11 @@ function getClassDeclFromSymbol(symbol, checker) {
|
|
|
50395
50432
|
return null;
|
|
50396
50433
|
}
|
|
50397
50434
|
if (ts.isExportAssignment(decl)) {
|
|
50398
|
-
const symbol = checker.getTypeAtLocation(decl.expression).
|
|
50435
|
+
const symbol = checker.getTypeAtLocation(decl.expression).getSymbol();
|
|
50399
50436
|
return getClassDeclFromSymbol(symbol, checker);
|
|
50400
50437
|
}
|
|
50401
50438
|
if (ts.isExportSpecifier(decl)) {
|
|
50402
|
-
const symbol = checker.getTypeAtLocation(decl).
|
|
50439
|
+
const symbol = checker.getTypeAtLocation(decl).getSymbol();
|
|
50403
50440
|
return getClassDeclFromSymbol(symbol, checker);
|
|
50404
50441
|
}
|
|
50405
50442
|
if (isNamedClassDeclaration(decl)) {
|
|
@@ -50460,7 +50497,7 @@ function getTheElementTagDeprecatedSuggestionDiagnostics(shimPath, program, file
|
|
|
50460
50497
|
for (const tsDiag of diags) {
|
|
50461
50498
|
const diagNode = getTokenAtPosition(sourceFile, tsDiag.start);
|
|
50462
50499
|
const nodeType = typeChecker.getTypeAtLocation(diagNode);
|
|
50463
|
-
const nodeSymbolDeclarations = nodeType.
|
|
50500
|
+
const nodeSymbolDeclarations = nodeType.getSymbol()?.declarations;
|
|
50464
50501
|
const decl = nodeSymbolDeclarations !== undefined && nodeSymbolDeclarations.length > 0
|
|
50465
50502
|
? nodeSymbolDeclarations[0]
|
|
50466
50503
|
: undefined;
|
|
@@ -50484,7 +50521,7 @@ function getTheElementTagDeprecatedSuggestionDiagnostics(shimPath, program, file
|
|
|
50484
50521
|
const templateDiagnostics = [];
|
|
50485
50522
|
for (const directive of directiveNodesInTcb) {
|
|
50486
50523
|
const directiveType = typeChecker.getTypeAtLocation(directive);
|
|
50487
|
-
const directiveSymbolDeclarations = directiveType.
|
|
50524
|
+
const directiveSymbolDeclarations = directiveType.getSymbol()?.declarations;
|
|
50488
50525
|
const decl = directiveSymbolDeclarations !== undefined && directiveSymbolDeclarations.length > 0
|
|
50489
50526
|
? directiveSymbolDeclarations[0]
|
|
50490
50527
|
: undefined;
|
|
@@ -50526,6 +50563,85 @@ function isDeprecatedDiagnostics(diag) {
|
|
|
50526
50563
|
return diag.reportsDeprecated !== undefined;
|
|
50527
50564
|
}
|
|
50528
50565
|
|
|
50566
|
+
/**
|
|
50567
|
+
* Gets all tsconfig paths from a CLI project by reading the workspace configuration
|
|
50568
|
+
* and looking for common tsconfig locations.
|
|
50569
|
+
*/
|
|
50570
|
+
async function getProjectTsConfigPaths(tree) {
|
|
50571
|
+
// Start with some tsconfig paths that are generally used within CLI projects. Note
|
|
50572
|
+
// that we are not interested in IDE-specific tsconfig files (e.g. /tsconfig.json)
|
|
50573
|
+
const buildPaths = new Set();
|
|
50574
|
+
const testPaths = new Set();
|
|
50575
|
+
const workspace = await getWorkspace(tree);
|
|
50576
|
+
for (const [, project] of workspace.projects) {
|
|
50577
|
+
for (const [name, target] of project.targets) {
|
|
50578
|
+
if (name !== 'build' && name !== 'test') {
|
|
50579
|
+
continue;
|
|
50580
|
+
}
|
|
50581
|
+
for (const [, options] of allTargetOptions(target)) {
|
|
50582
|
+
const tsConfig = options['tsConfig'];
|
|
50583
|
+
// Filter out tsconfig files that don't exist in the CLI project.
|
|
50584
|
+
if (typeof tsConfig !== 'string' || !tree.exists(tsConfig)) {
|
|
50585
|
+
continue;
|
|
50586
|
+
}
|
|
50587
|
+
if (name === 'build') {
|
|
50588
|
+
buildPaths.add(core.normalize(tsConfig));
|
|
50589
|
+
}
|
|
50590
|
+
else {
|
|
50591
|
+
testPaths.add(core.normalize(tsConfig));
|
|
50592
|
+
}
|
|
50593
|
+
}
|
|
50594
|
+
}
|
|
50595
|
+
}
|
|
50596
|
+
return {
|
|
50597
|
+
buildPaths: [...buildPaths],
|
|
50598
|
+
testPaths: [...testPaths],
|
|
50599
|
+
};
|
|
50600
|
+
}
|
|
50601
|
+
/** Get options for all configurations for the passed builder target. */
|
|
50602
|
+
function* allTargetOptions(target) {
|
|
50603
|
+
if (target.options) {
|
|
50604
|
+
yield [undefined, target.options];
|
|
50605
|
+
}
|
|
50606
|
+
if (!target.configurations) {
|
|
50607
|
+
return;
|
|
50608
|
+
}
|
|
50609
|
+
for (const [name, options] of Object.entries(target.configurations)) {
|
|
50610
|
+
if (options) {
|
|
50611
|
+
yield [name, options];
|
|
50612
|
+
}
|
|
50613
|
+
}
|
|
50614
|
+
}
|
|
50615
|
+
function createHost(tree) {
|
|
50616
|
+
return {
|
|
50617
|
+
async readFile(path) {
|
|
50618
|
+
const data = tree.read(path);
|
|
50619
|
+
if (!data) {
|
|
50620
|
+
throw new Error('File not found.');
|
|
50621
|
+
}
|
|
50622
|
+
return core.virtualFs.fileBufferToString(data);
|
|
50623
|
+
},
|
|
50624
|
+
async writeFile(path, data) {
|
|
50625
|
+
return tree.overwrite(path, data);
|
|
50626
|
+
},
|
|
50627
|
+
async isDirectory(path) {
|
|
50628
|
+
// Approximate a directory check.
|
|
50629
|
+
// We don't need to consider empty directories and hence this is a good enough approach.
|
|
50630
|
+
// This is also per documentation, see:
|
|
50631
|
+
// https://angular.dev/tools/cli/schematics-for-libraries#get-the-project-configuration
|
|
50632
|
+
return !tree.exists(path) && tree.getDir(path).subfiles.length > 0;
|
|
50633
|
+
},
|
|
50634
|
+
async isFile(path) {
|
|
50635
|
+
return tree.exists(path);
|
|
50636
|
+
},
|
|
50637
|
+
};
|
|
50638
|
+
}
|
|
50639
|
+
async function getWorkspace(tree) {
|
|
50640
|
+
const host = createHost(tree);
|
|
50641
|
+
const { workspace } = await core.workspaces.readWorkspace('/', host);
|
|
50642
|
+
return workspace;
|
|
50643
|
+
}
|
|
50644
|
+
|
|
50529
50645
|
exports.AST = AST;
|
|
50530
50646
|
exports.ASTWithSource = ASTWithSource;
|
|
50531
50647
|
exports.AbsoluteModuleStrategy = AbsoluteModuleStrategy;
|
|
@@ -50560,8 +50676,8 @@ exports.Directive = Directive$1;
|
|
|
50560
50676
|
exports.DomElementSchemaRegistry = DomElementSchemaRegistry;
|
|
50561
50677
|
exports.DynamicImportExpr = DynamicImportExpr;
|
|
50562
50678
|
exports.DynamicValue = DynamicValue;
|
|
50563
|
-
exports.Element = Element
|
|
50564
|
-
exports.Element$1 = Element;
|
|
50679
|
+
exports.Element = Element;
|
|
50680
|
+
exports.Element$1 = Element$1;
|
|
50565
50681
|
exports.EnumValue = EnumValue;
|
|
50566
50682
|
exports.ExternalExpr = ExternalExpr;
|
|
50567
50683
|
exports.FatalDiagnosticError = FatalDiagnosticError;
|
|
@@ -50692,6 +50808,7 @@ exports.getDefaultImportDeclaration = getDefaultImportDeclaration;
|
|
|
50692
50808
|
exports.getDirectiveDiagnostics = getDirectiveDiagnostics;
|
|
50693
50809
|
exports.getFileSystem = getFileSystem;
|
|
50694
50810
|
exports.getOriginNodeForDiagnostics = getOriginNodeForDiagnostics;
|
|
50811
|
+
exports.getProjectTsConfigPaths = getProjectTsConfigPaths;
|
|
50695
50812
|
exports.getProviderDiagnostics = getProviderDiagnostics;
|
|
50696
50813
|
exports.getRootDirs = getRootDirs;
|
|
50697
50814
|
exports.getSourceFile = getSourceFile;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.5
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -9,15 +9,14 @@
|
|
|
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-
|
|
12
|
+
var compiler_host = require('./compiler_host-CpG50gww.cjs');
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-ClCuNoA6.cjs');
|
|
14
14
|
var ts = require('typescript');
|
|
15
|
-
var checker = require('./checker-DBomdQHo.cjs');
|
|
16
15
|
var property_name = require('./property_name-BBwFuqMe.cjs');
|
|
17
16
|
require('os');
|
|
18
|
-
require('@angular-devkit/core');
|
|
19
17
|
require('module');
|
|
20
18
|
require('url');
|
|
19
|
+
require('@angular-devkit/core');
|
|
21
20
|
|
|
22
21
|
/**
|
|
23
22
|
* Finds the class declaration that is being referred to by a node.
|
|
@@ -48,7 +47,7 @@ function isStandaloneComponent(node, reflector) {
|
|
|
48
47
|
if (decorators === null) {
|
|
49
48
|
return false;
|
|
50
49
|
}
|
|
51
|
-
const decorator =
|
|
50
|
+
const decorator = project_tsconfig_paths.findAngularDecorator(decorators, 'Component', false);
|
|
52
51
|
if (decorator === undefined || decorator.args === null || decorator.args.length !== 1) {
|
|
53
52
|
return false;
|
|
54
53
|
}
|
|
@@ -154,7 +153,7 @@ function isProvideRoutesCallExpression(node, typeChecker) {
|
|
|
154
153
|
*/
|
|
155
154
|
function migrateFileToLazyRoutes(sourceFile, program) {
|
|
156
155
|
const typeChecker = program.getTypeChecker();
|
|
157
|
-
const reflector = new
|
|
156
|
+
const reflector = new project_tsconfig_paths.TypeScriptReflectionHost(typeChecker);
|
|
158
157
|
const printer = ts.createPrinter();
|
|
159
158
|
const tracker = new compiler_host.ChangeTracker(printer);
|
|
160
159
|
const routeArraysToMigrate = findRoutesArrayToMigrate(sourceFile, typeChecker);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
/**
|
|
3
|
+
* @license Angular v20.2.0-next.5
|
|
4
|
+
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
|
+
* License: MIT
|
|
6
|
+
*/
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
var ts = require('typescript');
|
|
10
|
+
require('os');
|
|
11
|
+
require('./project_tsconfig_paths-ClCuNoA6.cjs');
|
|
12
|
+
require('./index-Dl0zaIBS.cjs');
|
|
13
|
+
require('path');
|
|
14
|
+
require('node:path');
|
|
15
|
+
var project_paths = require('./project_paths-0E6AzVkB.cjs');
|
|
16
|
+
var imports = require('./imports-CIX-JgAN.cjs');
|
|
17
|
+
var symbol = require('./symbol-VPWguRxr.cjs');
|
|
18
|
+
require('@angular-devkit/core');
|
|
19
|
+
require('node:path/posix');
|
|
20
|
+
require('fs');
|
|
21
|
+
require('module');
|
|
22
|
+
require('url');
|
|
23
|
+
require('@angular-devkit/schematics');
|
|
24
|
+
|
|
25
|
+
/** Name of the method being replaced. */
|
|
26
|
+
const METHOD_NAME = 'getCurrentNavigation';
|
|
27
|
+
/** Migration that replaces `Router.getCurrentNavigation` usages with `Router.currentNavigation()`. */
|
|
28
|
+
class RouterCurrentNavigationMigration extends project_paths.TsurgeFunnelMigration {
|
|
29
|
+
async analyze(info) {
|
|
30
|
+
const locations = [];
|
|
31
|
+
for (const sourceFile of info.sourceFiles) {
|
|
32
|
+
const routerSpecifier = imports.getImportSpecifier(sourceFile, '@angular/router', 'Router');
|
|
33
|
+
if (routerSpecifier === null) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const typeChecker = info.program.getTypeChecker();
|
|
37
|
+
sourceFile.forEachChild(function walk(node) {
|
|
38
|
+
if (ts.isPropertyAccessExpression(node) &&
|
|
39
|
+
node.name.text === METHOD_NAME &&
|
|
40
|
+
isRouterType(typeChecker, node.expression, routerSpecifier)) {
|
|
41
|
+
locations.push({ file: project_paths.projectFile(sourceFile, info), position: node.name.getStart() });
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
node.forEachChild(walk);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
return project_paths.confirmAsSerializable({ locations });
|
|
49
|
+
}
|
|
50
|
+
async migrate(globalData) {
|
|
51
|
+
const replacements = globalData.locations.map(({ file, position }) => {
|
|
52
|
+
return new project_paths.Replacement(file, new project_paths.TextUpdate({
|
|
53
|
+
position: position,
|
|
54
|
+
end: position + METHOD_NAME.length,
|
|
55
|
+
toInsert: 'currentNavigation',
|
|
56
|
+
}));
|
|
57
|
+
});
|
|
58
|
+
return project_paths.confirmAsSerializable({ replacements });
|
|
59
|
+
}
|
|
60
|
+
async combine(unitA, unitB) {
|
|
61
|
+
const seen = new Set();
|
|
62
|
+
const locations = [];
|
|
63
|
+
const combined = [...unitA.locations, ...unitB.locations];
|
|
64
|
+
for (const location of combined) {
|
|
65
|
+
const key = `${location.file.id}#${location.position}`;
|
|
66
|
+
if (!seen.has(key)) {
|
|
67
|
+
seen.add(key);
|
|
68
|
+
locations.push(location);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return project_paths.confirmAsSerializable({ locations });
|
|
72
|
+
}
|
|
73
|
+
async globalMeta(combinedData) {
|
|
74
|
+
return project_paths.confirmAsSerializable(combinedData);
|
|
75
|
+
}
|
|
76
|
+
async stats() {
|
|
77
|
+
return project_paths.confirmAsSerializable({});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Checks if the given symbol represents a Router type.
|
|
82
|
+
*/
|
|
83
|
+
function isRouterType(typeChecker, expression, routerSpecifier) {
|
|
84
|
+
const expressionType = typeChecker.getTypeAtLocation(expression);
|
|
85
|
+
const expressionSymbol = expressionType.getSymbol();
|
|
86
|
+
if (!expressionSymbol) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const declarations = expressionSymbol.getDeclarations() ?? [];
|
|
90
|
+
for (const declaration of declarations) {
|
|
91
|
+
if (symbol.isReferenceToImport(typeChecker, declaration, routerSpecifier)) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return declarations.some((decl) => decl === routerSpecifier);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/*!
|
|
99
|
+
* @license
|
|
100
|
+
* Copyright Google LLC All Rights Reserved.
|
|
101
|
+
*
|
|
102
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
103
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
104
|
+
*/
|
|
105
|
+
function migrate() {
|
|
106
|
+
return async (tree) => {
|
|
107
|
+
await project_paths.runMigrationInDevkit({
|
|
108
|
+
tree,
|
|
109
|
+
getMigration: () => new RouterCurrentNavigationMigration(),
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
exports.migrate = migrate;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.5
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
var ts = require('typescript');
|
|
10
10
|
require('os');
|
|
11
|
-
var
|
|
12
|
-
require('./index-
|
|
11
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-ClCuNoA6.cjs');
|
|
12
|
+
require('./index-Dl0zaIBS.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
15
|
+
var project_paths = require('./project_paths-0E6AzVkB.cjs');
|
|
16
16
|
var ng_decorators = require('./ng_decorators-B5HCqr20.cjs');
|
|
17
17
|
var property_name = require('./property_name-BBwFuqMe.cjs');
|
|
18
18
|
require('@angular-devkit/core');
|
|
@@ -21,7 +21,6 @@ require('fs');
|
|
|
21
21
|
require('module');
|
|
22
22
|
require('url');
|
|
23
23
|
require('@angular-devkit/schematics');
|
|
24
|
-
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
25
24
|
require('./imports-CIX-JgAN.cjs');
|
|
26
25
|
|
|
27
26
|
/**
|
|
@@ -128,7 +127,7 @@ function findClosestLineStartPosition(linesMap, position, low = 0, high = linesM
|
|
|
128
127
|
class NgComponentTemplateVisitor {
|
|
129
128
|
typeChecker;
|
|
130
129
|
resolvedTemplates = [];
|
|
131
|
-
fs =
|
|
130
|
+
fs = project_tsconfig_paths.getFileSystem();
|
|
132
131
|
constructor(typeChecker) {
|
|
133
132
|
this.typeChecker = typeChecker;
|
|
134
133
|
}
|
|
@@ -203,7 +202,7 @@ function parseTemplate(template) {
|
|
|
203
202
|
// interpolated text as text nodes containing a mixture of interpolation tokens and text tokens,
|
|
204
203
|
// rather than turning them into `BoundText` nodes like the Ivy AST does. This allows us to
|
|
205
204
|
// easily get the text-only ranges without having to reconstruct the original text.
|
|
206
|
-
parsed = new
|
|
205
|
+
parsed = new project_tsconfig_paths.HtmlParser().parse(template, '', {
|
|
207
206
|
// Allows for ICUs to be parsed.
|
|
208
207
|
tokenizeExpansionForms: true,
|
|
209
208
|
// Explicitly disable blocks so that their characters are treated as plain text.
|
|
@@ -228,7 +227,7 @@ function migrateTemplateToSelfClosingTags(template) {
|
|
|
228
227
|
return { migrated: template, changed: false, replacementCount: 0 };
|
|
229
228
|
}
|
|
230
229
|
const visitor = new AngularElementCollector();
|
|
231
|
-
|
|
230
|
+
project_tsconfig_paths.visitAll$1(visitor, parsed.tree.rootNodes);
|
|
232
231
|
let newTemplate = template;
|
|
233
232
|
let changedOffset = 0;
|
|
234
233
|
let replacementCount = 0;
|
|
@@ -256,8 +255,8 @@ function replaceWithSelfClosingTag(html, tagName) {
|
|
|
256
255
|
function replaceTemplate(template, replaceValue, start, end, offset) {
|
|
257
256
|
return template.slice(0, start + offset) + replaceValue + template.slice(end + offset);
|
|
258
257
|
}
|
|
259
|
-
const ALL_HTML_TAGS = new
|
|
260
|
-
class AngularElementCollector extends
|
|
258
|
+
const ALL_HTML_TAGS = new project_tsconfig_paths.DomElementSchemaRegistry().allKnownElementNames();
|
|
259
|
+
class AngularElementCollector extends project_tsconfig_paths.RecursiveVisitor$1 {
|
|
261
260
|
elements = [];
|
|
262
261
|
constructor() {
|
|
263
262
|
super();
|
|
@@ -280,7 +279,7 @@ class AngularElementCollector extends checker.RecursiveVisitor$1 {
|
|
|
280
279
|
}
|
|
281
280
|
if (element.children.length === 1) {
|
|
282
281
|
const child = element.children[0];
|
|
283
|
-
return child instanceof
|
|
282
|
+
return child instanceof project_tsconfig_paths.Text && /^\s*$/.test(child.value);
|
|
284
283
|
}
|
|
285
284
|
return false;
|
|
286
285
|
}
|