@angular/core 20.2.0-next.3 → 20.2.0-next.4
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 +7 -1
- 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 +34 -9
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +223 -95
- 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 +21 -7
- 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-Doo9rveC.cjs} +4 -4
- package/schematics/bundles/cleanup-unused-imports.cjs +7 -8
- package/schematics/bundles/{compiler_host-DTywrGR6.cjs → compiler_host-Dtf8fsIr.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-B10puRUY.cjs} +49 -49
- package/schematics/bundles/{index-DWQ8GMRM.cjs → index-DHoQSprx.cjs} +1261 -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-Cr2742bs.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-CrqHneU0.cjs} +16 -17
- package/schematics/bundles/{checker-DBomdQHo.cjs → project_tsconfig_paths-BGhHq5-d.cjs} +139 -24
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +6 -7
- 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/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.4
|
|
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) {
|
|
@@ -30796,7 +30797,8 @@ class R3TargetBinder {
|
|
|
30796
30797
|
// Bind the host element in a separate scope. Note that it only uses the
|
|
30797
30798
|
// `TemplateBinder` since directives don't apply inside a host context.
|
|
30798
30799
|
if (target.host) {
|
|
30799
|
-
|
|
30800
|
+
directives.set(target.host.node, target.host.directives);
|
|
30801
|
+
TemplateBinder.applyWithScope(target.host.node, Scope$1.apply(target.host.node), expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks);
|
|
30800
30802
|
}
|
|
30801
30803
|
return new R3BoundTarget(target, directives, eagerDirectives, missingDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
|
|
30802
30804
|
}
|
|
@@ -31589,7 +31591,8 @@ class R3BoundTarget {
|
|
|
31589
31591
|
}
|
|
31590
31592
|
if (target instanceof Template ||
|
|
31591
31593
|
target.node instanceof Component$1 ||
|
|
31592
|
-
target.node instanceof Directive$1
|
|
31594
|
+
target.node instanceof Directive$1 ||
|
|
31595
|
+
target.node instanceof HostElement) {
|
|
31593
31596
|
return null;
|
|
31594
31597
|
}
|
|
31595
31598
|
return this.referenceTargetToElement(target.node);
|
|
@@ -32783,7 +32786,7 @@ function isAttrNode(ast) {
|
|
|
32783
32786
|
* @description
|
|
32784
32787
|
* Entry point for all public APIs of the compiler package.
|
|
32785
32788
|
*/
|
|
32786
|
-
new Version('20.2.0-next.
|
|
32789
|
+
new Version('20.2.0-next.4');
|
|
32787
32790
|
|
|
32788
32791
|
//////////////////////////////////////
|
|
32789
32792
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -33818,7 +33821,7 @@ class NodeJSPathManipulation {
|
|
|
33818
33821
|
// G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
|
|
33819
33822
|
// CommonJS/ESM interop for determining the current file name and containing dir.
|
|
33820
33823
|
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('
|
|
33824
|
+
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-BGhHq5-d.cjs', document.baseURI).href));
|
|
33822
33825
|
// Note, when this code loads in the browser, `url` may be an empty `{}` due to the Closure shims.
|
|
33823
33826
|
const currentFileName = isCommonJS
|
|
33824
33827
|
? __filename
|
|
@@ -45155,7 +45158,7 @@ function generateTypeCheckBlock(env, ref, name, meta, domSchemaChecker, oobRecor
|
|
|
45155
45158
|
}
|
|
45156
45159
|
// Add the host bindings type checking code.
|
|
45157
45160
|
if (tcb.boundTarget.target.host !== undefined) {
|
|
45158
|
-
const hostScope = Scope.forNodes(tcb, null, tcb.boundTarget.target.host, null, null);
|
|
45161
|
+
const hostScope = Scope.forNodes(tcb, null, tcb.boundTarget.target.host.node, null, null);
|
|
45159
45162
|
statements.push(renderBlockStatements(env, hostScope, createHostBindingsBlockGuard()));
|
|
45160
45163
|
}
|
|
45161
45164
|
const body = ts.factory.createBlock(statements);
|
|
@@ -45526,6 +45529,7 @@ class TcbDirectiveTypeOpBase extends TcbOp {
|
|
|
45526
45529
|
const dirRef = this.dir.ref;
|
|
45527
45530
|
const rawType = this.tcb.env.referenceType(this.dir.ref);
|
|
45528
45531
|
let type;
|
|
45532
|
+
let span;
|
|
45529
45533
|
if (this.dir.isGeneric === false || dirRef.node.typeParameters === undefined) {
|
|
45530
45534
|
type = rawType;
|
|
45531
45535
|
}
|
|
@@ -45536,9 +45540,15 @@ class TcbDirectiveTypeOpBase extends TcbOp {
|
|
|
45536
45540
|
const typeArguments = dirRef.node.typeParameters.map(() => ts.factory.createKeywordTypeNode(ts.SyntaxKind.AnyKeyword));
|
|
45537
45541
|
type = ts.factory.createTypeReferenceNode(rawType.typeName, typeArguments);
|
|
45538
45542
|
}
|
|
45543
|
+
if (this.node instanceof HostElement) {
|
|
45544
|
+
span = this.node.sourceSpan;
|
|
45545
|
+
}
|
|
45546
|
+
else {
|
|
45547
|
+
span = this.node.startSourceSpan || this.node.sourceSpan;
|
|
45548
|
+
}
|
|
45539
45549
|
const id = this.tcb.allocateId();
|
|
45540
45550
|
addExpressionIdentifier(id, ExpressionIdentifier.DIRECTIVE);
|
|
45541
|
-
addParseSpanInfo(id,
|
|
45551
|
+
addParseSpanInfo(id, span);
|
|
45542
45552
|
this.scope.addStatement(tsDeclareVariable(id, type));
|
|
45543
45553
|
return id;
|
|
45544
45554
|
}
|
|
@@ -46208,12 +46218,16 @@ class TcbDirectiveOutputsOp extends TcbOp {
|
|
|
46208
46218
|
tcb;
|
|
46209
46219
|
scope;
|
|
46210
46220
|
node;
|
|
46221
|
+
inputs;
|
|
46222
|
+
outputs;
|
|
46211
46223
|
dir;
|
|
46212
|
-
constructor(tcb, scope, node, dir) {
|
|
46224
|
+
constructor(tcb, scope, node, inputs, outputs, dir) {
|
|
46213
46225
|
super();
|
|
46214
46226
|
this.tcb = tcb;
|
|
46215
46227
|
this.scope = scope;
|
|
46216
46228
|
this.node = node;
|
|
46229
|
+
this.inputs = inputs;
|
|
46230
|
+
this.outputs = outputs;
|
|
46217
46231
|
this.dir = dir;
|
|
46218
46232
|
}
|
|
46219
46233
|
get optional() {
|
|
@@ -46222,14 +46236,16 @@ class TcbDirectiveOutputsOp extends TcbOp {
|
|
|
46222
46236
|
execute() {
|
|
46223
46237
|
let dirId = null;
|
|
46224
46238
|
const outputs = this.dir.outputs;
|
|
46225
|
-
for (const output of this.
|
|
46239
|
+
for (const output of this.outputs) {
|
|
46226
46240
|
if (output.type === exports.ParsedEventType.LegacyAnimation ||
|
|
46227
46241
|
!outputs.hasBindingPropertyName(output.name)) {
|
|
46228
46242
|
continue;
|
|
46229
46243
|
}
|
|
46230
|
-
if (this.tcb.env.config.checkTypeOfOutputEvents &&
|
|
46244
|
+
if (this.tcb.env.config.checkTypeOfOutputEvents &&
|
|
46245
|
+
this.inputs !== null &&
|
|
46246
|
+
output.name.endsWith('Change')) {
|
|
46231
46247
|
const inputName = output.name.slice(0, -6);
|
|
46232
|
-
checkSplitTwoWayBinding(inputName, output, this.
|
|
46248
|
+
checkSplitTwoWayBinding(inputName, output, this.inputs, this.tcb);
|
|
46233
46249
|
}
|
|
46234
46250
|
// TODO(alxhub): consider supporting multiple fields with the same property name for outputs.
|
|
46235
46251
|
const field = outputs.getByBindingPropertyName(output.name)[0].classPropertyName;
|
|
@@ -47009,7 +47025,8 @@ class Scope {
|
|
|
47009
47025
|
else if ((ref instanceof Element$1 ||
|
|
47010
47026
|
ref instanceof Template ||
|
|
47011
47027
|
ref instanceof Component$1 ||
|
|
47012
|
-
ref instanceof Directive$1
|
|
47028
|
+
ref instanceof Directive$1 ||
|
|
47029
|
+
ref instanceof HostElement) &&
|
|
47013
47030
|
directive !== undefined &&
|
|
47014
47031
|
this.directiveOpMap.has(ref)) {
|
|
47015
47032
|
// Resolving a directive on an element or sub-template.
|
|
@@ -47072,7 +47089,7 @@ class Scope {
|
|
|
47072
47089
|
this.appendContentProjectionCheckOp(node);
|
|
47073
47090
|
}
|
|
47074
47091
|
this.appendDirectivesAndInputsOfElementLikeNode(node);
|
|
47075
|
-
this.appendOutputsOfElementLikeNode(node);
|
|
47092
|
+
this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
|
|
47076
47093
|
this.appendSelectorlessDirectives(node);
|
|
47077
47094
|
this.appendChildren(node);
|
|
47078
47095
|
this.checkAndAppendReferencesOfNode(node);
|
|
@@ -47080,7 +47097,7 @@ class Scope {
|
|
|
47080
47097
|
else if (node instanceof Template) {
|
|
47081
47098
|
// Template children are rendered in a child scope.
|
|
47082
47099
|
this.appendDirectivesAndInputsOfElementLikeNode(node);
|
|
47083
|
-
this.appendOutputsOfElementLikeNode(node);
|
|
47100
|
+
this.appendOutputsOfElementLikeNode(node, node.inputs, node.outputs);
|
|
47084
47101
|
this.appendSelectorlessDirectives(node);
|
|
47085
47102
|
const ctxIndex = this.opQueue.push(new TcbTemplateContextOp(this.tcb, this)) - 1;
|
|
47086
47103
|
this.templateCtxOpMap.set(node, ctxIndex);
|
|
@@ -47127,9 +47144,7 @@ class Scope {
|
|
|
47127
47144
|
}
|
|
47128
47145
|
}
|
|
47129
47146
|
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));
|
|
47147
|
+
this.appendHostElement(node);
|
|
47133
47148
|
}
|
|
47134
47149
|
}
|
|
47135
47150
|
appendChildren(node) {
|
|
@@ -47203,7 +47218,7 @@ class Scope {
|
|
|
47203
47218
|
this.opQueue.push(new TcbDomSchemaCheckerOp(this.tcb, node, checkElement, claimedInputs));
|
|
47204
47219
|
}
|
|
47205
47220
|
}
|
|
47206
|
-
appendOutputsOfElementLikeNode(node) {
|
|
47221
|
+
appendOutputsOfElementLikeNode(node, bindings, events) {
|
|
47207
47222
|
// Collect all the outputs on the element.
|
|
47208
47223
|
const claimedOutputs = new Set();
|
|
47209
47224
|
// Don't resolve directives when selectorless is enabled and treat all the outputs on the
|
|
@@ -47214,24 +47229,24 @@ class Scope {
|
|
|
47214
47229
|
// If there are no directives, then all outputs are unclaimed outputs, so queue an operation
|
|
47215
47230
|
// to add them if needed.
|
|
47216
47231
|
if (node instanceof Element$1) {
|
|
47217
|
-
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node,
|
|
47232
|
+
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, events, bindings, claimedOutputs));
|
|
47218
47233
|
}
|
|
47219
47234
|
return;
|
|
47220
47235
|
}
|
|
47221
47236
|
// Queue operations for all directives to check the relevant outputs for a directive.
|
|
47222
47237
|
for (const dir of directives) {
|
|
47223
|
-
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, dir));
|
|
47238
|
+
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, bindings, events, dir));
|
|
47224
47239
|
}
|
|
47225
47240
|
// After expanding the directives, we might need to queue an operation to check any unclaimed
|
|
47226
47241
|
// outputs.
|
|
47227
|
-
if (node instanceof Element$1) {
|
|
47242
|
+
if (node instanceof Element$1 || node instanceof HostElement) {
|
|
47228
47243
|
// Go through the directives and register any outputs that it claims in `claimedOutputs`.
|
|
47229
47244
|
for (const dir of directives) {
|
|
47230
47245
|
for (const outputProperty of dir.outputs.propertyNames) {
|
|
47231
47246
|
claimedOutputs.add(outputProperty);
|
|
47232
47247
|
}
|
|
47233
47248
|
}
|
|
47234
|
-
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node,
|
|
47249
|
+
this.opQueue.push(new TcbUnclaimedOutputsOp(this.tcb, this, node, events, bindings, claimedOutputs));
|
|
47235
47250
|
}
|
|
47236
47251
|
}
|
|
47237
47252
|
appendInputsOfSelectorlessNode(node) {
|
|
@@ -47272,7 +47287,7 @@ class Scope {
|
|
|
47272
47287
|
const claimedOutputs = new Set();
|
|
47273
47288
|
if (directives !== null && directives.length > 0) {
|
|
47274
47289
|
for (const dir of directives) {
|
|
47275
|
-
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, dir));
|
|
47290
|
+
this.opQueue.push(new TcbDirectiveOutputsOp(this.tcb, this, node, node.inputs, node.outputs, dir));
|
|
47276
47291
|
for (const outputProperty of dir.outputs.propertyNames) {
|
|
47277
47292
|
claimedOutputs.add(outputProperty);
|
|
47278
47293
|
}
|
|
@@ -47446,6 +47461,21 @@ class Scope {
|
|
|
47446
47461
|
this.validateReferenceBasedDeferredTrigger(block, triggers.viewport);
|
|
47447
47462
|
}
|
|
47448
47463
|
}
|
|
47464
|
+
appendHostElement(node) {
|
|
47465
|
+
const opIndex = this.opQueue.push(new TcbHostElementOp(this.tcb, this, node)) - 1;
|
|
47466
|
+
const directives = this.tcb.boundTarget.getDirectivesOfNode(node);
|
|
47467
|
+
if (directives !== null && directives.length > 0) {
|
|
47468
|
+
const directiveOpMap = new Map();
|
|
47469
|
+
for (const directive of directives) {
|
|
47470
|
+
const directiveOp = new TcbNonGenericDirectiveTypeOp(this.tcb, this, node, directive);
|
|
47471
|
+
directiveOpMap.set(directive, this.opQueue.push(directiveOp) - 1);
|
|
47472
|
+
}
|
|
47473
|
+
this.directiveOpMap.set(node, directiveOpMap);
|
|
47474
|
+
}
|
|
47475
|
+
this.hostElementOpMap.set(node, opIndex);
|
|
47476
|
+
this.opQueue.push(new TcbUnclaimedInputsOp(this.tcb, this, node.bindings, node, null), new TcbDomSchemaCheckerOp(this.tcb, node, false, null));
|
|
47477
|
+
this.appendOutputsOfElementLikeNode(node, null, node.listeners);
|
|
47478
|
+
}
|
|
47449
47479
|
validateReferenceBasedDeferredTrigger(block, trigger) {
|
|
47450
47480
|
if (trigger.reference === null) {
|
|
47451
47481
|
if (block.placeholder === null) {
|
|
@@ -48072,7 +48102,12 @@ class TypeCheckContextImpl {
|
|
|
48072
48102
|
}
|
|
48073
48103
|
const boundTarget = binder.bind({
|
|
48074
48104
|
template: templateContext?.nodes,
|
|
48075
|
-
host: hostBindingContext
|
|
48105
|
+
host: hostBindingContext === null
|
|
48106
|
+
? undefined
|
|
48107
|
+
: {
|
|
48108
|
+
node: hostBindingContext.node,
|
|
48109
|
+
directives: hostBindingContext.directives,
|
|
48110
|
+
},
|
|
48076
48111
|
});
|
|
48077
48112
|
if (this.inlining === InliningMode.InlineOps) {
|
|
48078
48113
|
// Get all of the directives used in the template and record inline type constructors when
|
|
@@ -50526,6 +50561,85 @@ function isDeprecatedDiagnostics(diag) {
|
|
|
50526
50561
|
return diag.reportsDeprecated !== undefined;
|
|
50527
50562
|
}
|
|
50528
50563
|
|
|
50564
|
+
/**
|
|
50565
|
+
* Gets all tsconfig paths from a CLI project by reading the workspace configuration
|
|
50566
|
+
* and looking for common tsconfig locations.
|
|
50567
|
+
*/
|
|
50568
|
+
async function getProjectTsConfigPaths(tree) {
|
|
50569
|
+
// Start with some tsconfig paths that are generally used within CLI projects. Note
|
|
50570
|
+
// that we are not interested in IDE-specific tsconfig files (e.g. /tsconfig.json)
|
|
50571
|
+
const buildPaths = new Set();
|
|
50572
|
+
const testPaths = new Set();
|
|
50573
|
+
const workspace = await getWorkspace(tree);
|
|
50574
|
+
for (const [, project] of workspace.projects) {
|
|
50575
|
+
for (const [name, target] of project.targets) {
|
|
50576
|
+
if (name !== 'build' && name !== 'test') {
|
|
50577
|
+
continue;
|
|
50578
|
+
}
|
|
50579
|
+
for (const [, options] of allTargetOptions(target)) {
|
|
50580
|
+
const tsConfig = options['tsConfig'];
|
|
50581
|
+
// Filter out tsconfig files that don't exist in the CLI project.
|
|
50582
|
+
if (typeof tsConfig !== 'string' || !tree.exists(tsConfig)) {
|
|
50583
|
+
continue;
|
|
50584
|
+
}
|
|
50585
|
+
if (name === 'build') {
|
|
50586
|
+
buildPaths.add(core.normalize(tsConfig));
|
|
50587
|
+
}
|
|
50588
|
+
else {
|
|
50589
|
+
testPaths.add(core.normalize(tsConfig));
|
|
50590
|
+
}
|
|
50591
|
+
}
|
|
50592
|
+
}
|
|
50593
|
+
}
|
|
50594
|
+
return {
|
|
50595
|
+
buildPaths: [...buildPaths],
|
|
50596
|
+
testPaths: [...testPaths],
|
|
50597
|
+
};
|
|
50598
|
+
}
|
|
50599
|
+
/** Get options for all configurations for the passed builder target. */
|
|
50600
|
+
function* allTargetOptions(target) {
|
|
50601
|
+
if (target.options) {
|
|
50602
|
+
yield [undefined, target.options];
|
|
50603
|
+
}
|
|
50604
|
+
if (!target.configurations) {
|
|
50605
|
+
return;
|
|
50606
|
+
}
|
|
50607
|
+
for (const [name, options] of Object.entries(target.configurations)) {
|
|
50608
|
+
if (options) {
|
|
50609
|
+
yield [name, options];
|
|
50610
|
+
}
|
|
50611
|
+
}
|
|
50612
|
+
}
|
|
50613
|
+
function createHost(tree) {
|
|
50614
|
+
return {
|
|
50615
|
+
async readFile(path) {
|
|
50616
|
+
const data = tree.read(path);
|
|
50617
|
+
if (!data) {
|
|
50618
|
+
throw new Error('File not found.');
|
|
50619
|
+
}
|
|
50620
|
+
return core.virtualFs.fileBufferToString(data);
|
|
50621
|
+
},
|
|
50622
|
+
async writeFile(path, data) {
|
|
50623
|
+
return tree.overwrite(path, data);
|
|
50624
|
+
},
|
|
50625
|
+
async isDirectory(path) {
|
|
50626
|
+
// Approximate a directory check.
|
|
50627
|
+
// We don't need to consider empty directories and hence this is a good enough approach.
|
|
50628
|
+
// This is also per documentation, see:
|
|
50629
|
+
// https://angular.dev/tools/cli/schematics-for-libraries#get-the-project-configuration
|
|
50630
|
+
return !tree.exists(path) && tree.getDir(path).subfiles.length > 0;
|
|
50631
|
+
},
|
|
50632
|
+
async isFile(path) {
|
|
50633
|
+
return tree.exists(path);
|
|
50634
|
+
},
|
|
50635
|
+
};
|
|
50636
|
+
}
|
|
50637
|
+
async function getWorkspace(tree) {
|
|
50638
|
+
const host = createHost(tree);
|
|
50639
|
+
const { workspace } = await core.workspaces.readWorkspace('/', host);
|
|
50640
|
+
return workspace;
|
|
50641
|
+
}
|
|
50642
|
+
|
|
50529
50643
|
exports.AST = AST;
|
|
50530
50644
|
exports.ASTWithSource = ASTWithSource;
|
|
50531
50645
|
exports.AbsoluteModuleStrategy = AbsoluteModuleStrategy;
|
|
@@ -50692,6 +50806,7 @@ exports.getDefaultImportDeclaration = getDefaultImportDeclaration;
|
|
|
50692
50806
|
exports.getDirectiveDiagnostics = getDirectiveDiagnostics;
|
|
50693
50807
|
exports.getFileSystem = getFileSystem;
|
|
50694
50808
|
exports.getOriginNodeForDiagnostics = getOriginNodeForDiagnostics;
|
|
50809
|
+
exports.getProjectTsConfigPaths = getProjectTsConfigPaths;
|
|
50695
50810
|
exports.getProviderDiagnostics = getProviderDiagnostics;
|
|
50696
50811
|
exports.getRootDirs = getRootDirs;
|
|
50697
50812
|
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.4
|
|
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-Dtf8fsIr.cjs');
|
|
13
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-BGhHq5-d.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);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.4
|
|
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-BGhHq5-d.cjs');
|
|
12
|
+
require('./index-DHoQSprx.cjs');
|
|
13
13
|
require('path');
|
|
14
14
|
require('node:path');
|
|
15
|
-
var project_paths = require('./project_paths-
|
|
15
|
+
var project_paths = require('./project_paths-CrqHneU0.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
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v20.2.0-next.
|
|
3
|
+
* @license Angular v20.2.0-next.4
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
var migrate_ts_type_references = require('./migrate_ts_type_references-
|
|
9
|
+
var migrate_ts_type_references = require('./migrate_ts_type_references-Cr2742bs.cjs');
|
|
10
10
|
var ts = require('typescript');
|
|
11
11
|
require('os');
|
|
12
|
-
var
|
|
13
|
-
var index$1 = require('./index-
|
|
12
|
+
var project_tsconfig_paths = require('./project_tsconfig_paths-BGhHq5-d.cjs');
|
|
13
|
+
var index$1 = require('./index-DHoQSprx.cjs');
|
|
14
14
|
require('path');
|
|
15
15
|
require('node:path');
|
|
16
|
-
var project_paths = require('./project_paths-
|
|
17
|
-
var index = require('./index-
|
|
16
|
+
var project_paths = require('./project_paths-CrqHneU0.cjs');
|
|
17
|
+
var index = require('./index-B10puRUY.cjs');
|
|
18
18
|
var assert = require('assert');
|
|
19
|
-
var apply_import_manager = require('./apply_import_manager-
|
|
19
|
+
var apply_import_manager = require('./apply_import_manager-Doo9rveC.cjs');
|
|
20
20
|
require('@angular-devkit/core');
|
|
21
21
|
require('node:path/posix');
|
|
22
22
|
require('./leading_space-D9nQ8UQC.cjs');
|
|
@@ -24,7 +24,6 @@ require('fs');
|
|
|
24
24
|
require('module');
|
|
25
25
|
require('url');
|
|
26
26
|
require('@angular-devkit/schematics');
|
|
27
|
-
require('./project_tsconfig_paths-CDVxT6Ov.cjs');
|
|
28
27
|
|
|
29
28
|
/**
|
|
30
29
|
* Class that holds information about a given directive and its input fields.
|
|
@@ -275,7 +274,7 @@ function prepareAnalysisInfo(userProgram, compiler, programAbsoluteRootPaths) {
|
|
|
275
274
|
state.templateTypeChecker.generateAllTypeCheckBlocks();
|
|
276
275
|
}
|
|
277
276
|
const typeChecker = userProgram.getTypeChecker();
|
|
278
|
-
const reflector = new
|
|
277
|
+
const reflector = new project_tsconfig_paths.TypeScriptReflectionHost(typeChecker);
|
|
279
278
|
const evaluator = new index$1.PartialEvaluator(reflector, typeChecker, null);
|
|
280
279
|
const dtsMetadataReader = new index$1.DtsMetadataReader(typeChecker, reflector);
|
|
281
280
|
return {
|
|
@@ -338,7 +337,7 @@ function extractDtsInput(node, metadataReader) {
|
|
|
338
337
|
// in the `.d.ts` aren't resolvable. This seems to be unexpected and shouldn't
|
|
339
338
|
// result in the entire migration to be failing.
|
|
340
339
|
try {
|
|
341
|
-
directiveMetadata = metadataReader.getDirectiveMetadata(new
|
|
340
|
+
directiveMetadata = metadataReader.getDirectiveMetadata(new project_tsconfig_paths.Reference(node.parent));
|
|
342
341
|
}
|
|
343
342
|
catch (e) {
|
|
344
343
|
console.error('Unexpected error. Gracefully ignoring.');
|
|
@@ -374,7 +373,7 @@ function extractSourceCodeInput(node, host, reflector, evaluator) {
|
|
|
374
373
|
if (decorators === null) {
|
|
375
374
|
return null;
|
|
376
375
|
}
|
|
377
|
-
const ngDecorators =
|
|
376
|
+
const ngDecorators = project_tsconfig_paths.getAngularDecorators(decorators, ['Input'], host.isMigratingCore);
|
|
378
377
|
if (ngDecorators.length === 0) {
|
|
379
378
|
return null;
|
|
380
379
|
}
|
|
@@ -418,27 +417,27 @@ function extractSourceCodeInput(node, host, reflector, evaluator) {
|
|
|
418
417
|
*/
|
|
419
418
|
function parseTransformOfInput(evaluatedInputOpts, node, reflector) {
|
|
420
419
|
const transformValue = evaluatedInputOpts.get('transform');
|
|
421
|
-
if (!(transformValue instanceof
|
|
420
|
+
if (!(transformValue instanceof project_tsconfig_paths.DynamicValue) && !(transformValue instanceof project_tsconfig_paths.Reference)) {
|
|
422
421
|
return null;
|
|
423
422
|
}
|
|
424
423
|
// For parsing the transform, we don't need a real reference emitter, as
|
|
425
424
|
// the emitter is only used for verifying that the transform type could be
|
|
426
425
|
// copied into e.g. an `ngInputAccept` class member.
|
|
427
|
-
const noopRefEmitter = new
|
|
426
|
+
const noopRefEmitter = new project_tsconfig_paths.ReferenceEmitter([
|
|
428
427
|
{
|
|
429
428
|
emit: () => ({
|
|
430
|
-
kind:
|
|
431
|
-
expression:
|
|
429
|
+
kind: project_tsconfig_paths.ReferenceEmitKind.Success,
|
|
430
|
+
expression: project_tsconfig_paths.NULL_EXPR,
|
|
432
431
|
importedFile: null,
|
|
433
432
|
}),
|
|
434
433
|
},
|
|
435
434
|
]);
|
|
436
435
|
try {
|
|
437
|
-
return
|
|
436
|
+
return project_tsconfig_paths.parseDecoratorInputTransformFunction(node.parent, node.name.text, transformValue, reflector, noopRefEmitter, project_tsconfig_paths.CompilationMode.FULL,
|
|
438
437
|
/* emitDeclarationOnly */ false);
|
|
439
438
|
}
|
|
440
439
|
catch (e) {
|
|
441
|
-
if (!(e instanceof
|
|
440
|
+
if (!(e instanceof project_tsconfig_paths.FatalDiagnosticError)) {
|
|
442
441
|
throw e;
|
|
443
442
|
}
|
|
444
443
|
// TODO: implement error handling.
|
|
@@ -646,10 +645,10 @@ function pass1__IdentifySourceFileAndDeclarationInputs(sf, host, checker, reflec
|
|
|
646
645
|
* In addition, spying onto an input may be problematic- so we skip migrating
|
|
647
646
|
* such.
|
|
648
647
|
*/
|
|
649
|
-
function pass3__checkIncompatiblePatterns(host, inheritanceGraph, checker
|
|
650
|
-
migrate_ts_type_references.checkIncompatiblePatterns(inheritanceGraph, checker
|
|
648
|
+
function pass3__checkIncompatiblePatterns(host, inheritanceGraph, checker, groupedTsAstVisitor, knownInputs) {
|
|
649
|
+
migrate_ts_type_references.checkIncompatiblePatterns(inheritanceGraph, checker, groupedTsAstVisitor, knownInputs, () => knownInputs.getAllInputContainingClasses());
|
|
651
650
|
for (const input of knownInputs.knownInputIds.values()) {
|
|
652
|
-
const hostBindingDecorators =
|
|
651
|
+
const hostBindingDecorators = project_tsconfig_paths.getAngularDecorators(input.metadata.fieldDecorators, ['HostBinding'], host.isMigratingCore);
|
|
653
652
|
if (hostBindingDecorators.length > 0) {
|
|
654
653
|
knownInputs.markFieldIncompatible(input.descriptor, {
|
|
655
654
|
context: hostBindingDecorators[0].node,
|
|
@@ -687,7 +686,7 @@ function executeAnalysisPhase(host, knownInputs, result, { sourceFiles, fullProg
|
|
|
687
686
|
fullProgramSourceFiles.forEach((sf) =>
|
|
688
687
|
// Shim shim files. Those are unnecessary and might cause unexpected slowness.
|
|
689
688
|
// e.g. `ngtypecheck` files.
|
|
690
|
-
!
|
|
689
|
+
!project_tsconfig_paths.isShim(sf) &&
|
|
691
690
|
pass1__IdentifySourceFileAndDeclarationInputs(sf, host, typeChecker, reflector, dtsMetadataReader, evaluator, knownInputs, result));
|
|
692
691
|
const fieldNamesToConsiderForReferenceLookup = new Set();
|
|
693
692
|
for (const input of knownInputs.knownInputIds.values()) {
|
|
@@ -1235,7 +1234,7 @@ function pass9__migrateTypeScriptTypeReferences(host, references, importManager,
|
|
|
1235
1234
|
*/
|
|
1236
1235
|
function executeMigrationPhase(host, knownInputs, result, info) {
|
|
1237
1236
|
const { typeChecker, sourceFiles } = info;
|
|
1238
|
-
const importManager = new
|
|
1237
|
+
const importManager = new project_tsconfig_paths.ImportManager({
|
|
1239
1238
|
// For the purpose of this migration, we always use `input` and don't alias
|
|
1240
1239
|
// it to e.g. `input_1`.
|
|
1241
1240
|
generateUniqueIdentifier: () => null,
|