@angular/core 17.3.0-next.1 → 17.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/rxjs-interop/src/index.mjs +3 -1
- package/esm2022/rxjs-interop/src/output_from_observable.mjs +68 -0
- package/esm2022/rxjs-interop/src/output_to_observable.mjs +29 -0
- package/esm2022/rxjs-interop/src/to_observable.mjs +1 -1
- package/esm2022/src/application/application_ref.mjs +56 -40
- package/esm2022/src/authoring/input/input.mjs +4 -1
- package/esm2022/src/authoring/input/input_type_checking.mjs +1 -1
- package/esm2022/src/authoring/model/model.mjs +4 -1
- package/esm2022/src/authoring/model/model_signal.mjs +9 -18
- package/esm2022/src/authoring/output/output.mjs +35 -0
- package/esm2022/src/authoring/output/output_emitter_ref.mjs +85 -0
- package/esm2022/src/authoring/output/output_ref.mjs +9 -0
- package/esm2022/src/authoring/queries.mjs +7 -1
- package/esm2022/src/authoring.mjs +3 -2
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +1 -1
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +10 -4
- package/esm2022/src/core_private_export.mjs +4 -4
- package/esm2022/src/di/contextual.mjs +9 -3
- package/esm2022/src/di/interface/provider.mjs +1 -1
- package/esm2022/src/di/metadata.mjs +1 -1
- package/esm2022/src/di/r3_injector.mjs +26 -15
- package/esm2022/src/errors.mjs +1 -1
- package/esm2022/src/event_emitter.mjs +18 -2
- package/esm2022/src/hydration/annotate.mjs +4 -2
- package/esm2022/src/hydration/api.mjs +28 -3
- package/esm2022/src/hydration/cleanup.mjs +18 -2
- package/esm2022/src/hydration/interfaces.mjs +1 -1
- package/esm2022/src/hydration/node_lookup_utils.mjs +59 -39
- package/esm2022/src/hydration/tokens.mjs +6 -1
- package/esm2022/src/i18n/utils.mjs +16 -0
- package/esm2022/src/render3/after_render_hooks.mjs +12 -9
- package/esm2022/src/render3/component_ref.mjs +103 -93
- package/esm2022/src/render3/i18n/i18n_apply.mjs +32 -7
- package/esm2022/src/render3/i18n/i18n_parse.mjs +50 -16
- package/esm2022/src/render3/instructions/control_flow.mjs +4 -2
- package/esm2022/src/render3/instructions/element.mjs +5 -3
- package/esm2022/src/render3/instructions/element_container.mjs +3 -2
- package/esm2022/src/render3/instructions/listener.mjs +7 -9
- package/esm2022/src/render3/instructions/render.mjs +3 -2
- package/esm2022/src/render3/instructions/template.mjs +4 -2
- package/esm2022/src/render3/instructions/text.mjs +4 -2
- package/esm2022/src/render3/interfaces/i18n.mjs +1 -1
- package/esm2022/src/render3/interfaces/view.mjs +1 -1
- package/esm2022/src/render3/node_manipulation.mjs +18 -5
- package/esm2022/src/render3/node_selector_matcher.mjs +37 -51
- package/esm2022/src/render3/queue_state_update.mjs +2 -4
- package/esm2022/src/render3/reactivity/effect.mjs +11 -7
- package/esm2022/src/render3/reactivity/signal.mjs +3 -4
- package/esm2022/src/render3/util/view_utils.mjs +2 -1
- package/esm2022/src/render3/view_manipulation.mjs +24 -17
- package/esm2022/src/sanitization/html_sanitizer.mjs +54 -14
- package/esm2022/src/util/assert.mjs +7 -1
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/component_fixture.mjs +15 -11
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed_compiler.mjs +26 -4
- package/fesm2022/core.mjs +14049 -13736
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +82 -3
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +38 -12
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +210 -78
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +39 -1
- package/schematics/migrations/block-template-entities/bundle.js +25 -34
- package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +26387 -0
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +7 -0
- package/schematics/migrations.json +5 -0
- package/schematics/ng-generate/control-flow-migration/bundle.js +25 -34
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
- package/schematics/ng-generate/standalone-migration/bundle.js +424 -351
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
- package/esm2022/src/authoring/output.mjs +0 -33
- package/esm2022/src/is_internal.mjs +0 -15
|
@@ -10542,13 +10542,10 @@ var ExpressionKind;
|
|
|
10542
10542
|
ExpressionKind2[ExpressionKind2["EmptyExpr"] = 17] = "EmptyExpr";
|
|
10543
10543
|
ExpressionKind2[ExpressionKind2["AssignTemporaryExpr"] = 18] = "AssignTemporaryExpr";
|
|
10544
10544
|
ExpressionKind2[ExpressionKind2["ReadTemporaryExpr"] = 19] = "ReadTemporaryExpr";
|
|
10545
|
-
ExpressionKind2[ExpressionKind2["
|
|
10546
|
-
ExpressionKind2[ExpressionKind2["
|
|
10547
|
-
ExpressionKind2[ExpressionKind2["
|
|
10548
|
-
ExpressionKind2[ExpressionKind2["
|
|
10549
|
-
ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 24] = "DerivedRepeaterVar";
|
|
10550
|
-
ExpressionKind2[ExpressionKind2["ConstCollected"] = 25] = "ConstCollected";
|
|
10551
|
-
ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 26] = "TwoWayBindingSet";
|
|
10545
|
+
ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 20] = "SlotLiteralExpr";
|
|
10546
|
+
ExpressionKind2[ExpressionKind2["ConditionalCase"] = 21] = "ConditionalCase";
|
|
10547
|
+
ExpressionKind2[ExpressionKind2["ConstCollected"] = 22] = "ConstCollected";
|
|
10548
|
+
ExpressionKind2[ExpressionKind2["TwoWayBindingSet"] = 23] = "TwoWayBindingSet";
|
|
10552
10549
|
})(ExpressionKind || (ExpressionKind = {}));
|
|
10553
10550
|
var VariableFlags;
|
|
10554
10551
|
(function(VariableFlags2) {
|
|
@@ -10567,12 +10564,6 @@ var CompatibilityMode;
|
|
|
10567
10564
|
CompatibilityMode2[CompatibilityMode2["Normal"] = 0] = "Normal";
|
|
10568
10565
|
CompatibilityMode2[CompatibilityMode2["TemplateDefinitionBuilder"] = 1] = "TemplateDefinitionBuilder";
|
|
10569
10566
|
})(CompatibilityMode || (CompatibilityMode = {}));
|
|
10570
|
-
var DeferSecondaryKind;
|
|
10571
|
-
(function(DeferSecondaryKind2) {
|
|
10572
|
-
DeferSecondaryKind2[DeferSecondaryKind2["Loading"] = 0] = "Loading";
|
|
10573
|
-
DeferSecondaryKind2[DeferSecondaryKind2["Placeholder"] = 1] = "Placeholder";
|
|
10574
|
-
DeferSecondaryKind2[DeferSecondaryKind2["Error"] = 2] = "Error";
|
|
10575
|
-
})(DeferSecondaryKind || (DeferSecondaryKind = {}));
|
|
10576
10567
|
var BindingKind;
|
|
10577
10568
|
(function(BindingKind2) {
|
|
10578
10569
|
BindingKind2[BindingKind2["Attribute"] = 0] = "Attribute";
|
|
@@ -10646,10 +10637,6 @@ var TRAIT_DEPENDS_ON_SLOT_CONTEXT = {
|
|
|
10646
10637
|
var TRAIT_CONSUMES_VARS = {
|
|
10647
10638
|
[ConsumesVarsTrait]: true
|
|
10648
10639
|
};
|
|
10649
|
-
var TRAIT_USES_VAR_OFFSET = {
|
|
10650
|
-
[UsesVarOffset]: true,
|
|
10651
|
-
varOffset: null
|
|
10652
|
-
};
|
|
10653
10640
|
function hasConsumesSlotTrait(op) {
|
|
10654
10641
|
return op[ConsumesSlot] === true;
|
|
10655
10642
|
}
|
|
@@ -12914,7 +12901,7 @@ var ElementAttributes = class {
|
|
|
12914
12901
|
this.propertyBindings = null;
|
|
12915
12902
|
this.projectAs = null;
|
|
12916
12903
|
}
|
|
12917
|
-
isKnown(kind, name
|
|
12904
|
+
isKnown(kind, name) {
|
|
12918
12905
|
var _a2;
|
|
12919
12906
|
const nameToValue = (_a2 = this.known.get(kind)) != null ? _a2 : /* @__PURE__ */ new Set();
|
|
12920
12907
|
this.known.set(kind, nameToValue);
|
|
@@ -12927,7 +12914,7 @@ var ElementAttributes = class {
|
|
|
12927
12914
|
add(kind, name, value, namespace, trustedValueFn) {
|
|
12928
12915
|
var _a2;
|
|
12929
12916
|
const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder && (kind === BindingKind.Attribute || kind === BindingKind.ClassName || kind === BindingKind.StyleProperty);
|
|
12930
|
-
if (!allowDuplicates && this.isKnown(kind, name
|
|
12917
|
+
if (!allowDuplicates && this.isKnown(kind, name)) {
|
|
12931
12918
|
return;
|
|
12932
12919
|
}
|
|
12933
12920
|
if (name === "ngProjectAs") {
|
|
@@ -13527,7 +13514,7 @@ function createI18nMessage(job, context, messagePlaceholder) {
|
|
|
13527
13514
|
}
|
|
13528
13515
|
function formatIcuPlaceholder(op) {
|
|
13529
13516
|
if (op.strings.length !== op.expressionPlaceholders.length + 1) {
|
|
13530
|
-
throw Error(`
|
|
13517
|
+
throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
|
|
13531
13518
|
}
|
|
13532
13519
|
const values = op.expressionPlaceholders.map(formatValue);
|
|
13533
13520
|
return op.strings.flatMap((str, i) => [str, values[i] || ""]).join("");
|
|
@@ -20132,7 +20119,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
20132
20119
|
}
|
|
20133
20120
|
if (op.emptyView !== null) {
|
|
20134
20121
|
const emptyView = unit.job.views.get(op.emptyView);
|
|
20135
|
-
addNamesToView(emptyView, `${baseName}_${
|
|
20122
|
+
addNamesToView(emptyView, `${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot + 2}`, state, compatibility);
|
|
20136
20123
|
}
|
|
20137
20124
|
addNamesToView(unit.job.views.get(op.xref), `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`, state, compatibility);
|
|
20138
20125
|
break;
|
|
@@ -20553,7 +20540,7 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
|
|
|
20553
20540
|
break;
|
|
20554
20541
|
case OpKind.RepeaterCreate:
|
|
20555
20542
|
const forView = unit.job.views.get(op.xref);
|
|
20556
|
-
subTemplateIndex = propagateI18nBlocksForView(
|
|
20543
|
+
subTemplateIndex = propagateI18nBlocksForView(forView, i18nBlock, op.i18nPlaceholder, subTemplateIndex);
|
|
20557
20544
|
if (op.emptyView !== null) {
|
|
20558
20545
|
subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
|
|
20559
20546
|
}
|
|
@@ -21653,11 +21640,11 @@ function processLexicalScope(view, ops) {
|
|
|
21653
21640
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
|
|
21654
21641
|
function resolveDollarEvent(job) {
|
|
21655
21642
|
for (const unit of job.units) {
|
|
21656
|
-
transformDollarEvent(unit
|
|
21657
|
-
transformDollarEvent(unit
|
|
21643
|
+
transformDollarEvent(unit.create);
|
|
21644
|
+
transformDollarEvent(unit.update);
|
|
21658
21645
|
}
|
|
21659
21646
|
}
|
|
21660
|
-
function transformDollarEvent(
|
|
21647
|
+
function transformDollarEvent(ops) {
|
|
21661
21648
|
for (const op of ops) {
|
|
21662
21649
|
if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
21663
21650
|
transformExpressionsInOp(op, (expr) => {
|
|
@@ -21828,7 +21815,7 @@ function recordTemplateStart(job, view, slot, i18nPlaceholder, i18nContext, i18n
|
|
|
21828
21815
|
addParam(i18nContext.params, startName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
|
|
21829
21816
|
}
|
|
21830
21817
|
function recordTemplateClose(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) {
|
|
21831
|
-
const {
|
|
21818
|
+
const { closeName } = i18nPlaceholder;
|
|
21832
21819
|
const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
|
|
21833
21820
|
if (closeName) {
|
|
21834
21821
|
addParam(i18nContext.params, closeName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags);
|
|
@@ -21855,14 +21842,14 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
|
|
|
21855
21842
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
|
|
21856
21843
|
function resolveI18nExpressionPlaceholders(job) {
|
|
21857
21844
|
var _a2;
|
|
21858
|
-
const
|
|
21845
|
+
const subTemplateIndices = /* @__PURE__ */ new Map();
|
|
21859
21846
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
21860
21847
|
const icuPlaceholders = /* @__PURE__ */ new Map();
|
|
21861
21848
|
for (const unit of job.units) {
|
|
21862
21849
|
for (const op of unit.create) {
|
|
21863
21850
|
switch (op.kind) {
|
|
21864
21851
|
case OpKind.I18nStart:
|
|
21865
|
-
|
|
21852
|
+
subTemplateIndices.set(op.xref, op.subTemplateIndex);
|
|
21866
21853
|
break;
|
|
21867
21854
|
case OpKind.I18nContext:
|
|
21868
21855
|
i18nContexts.set(op.xref, op);
|
|
@@ -21879,7 +21866,7 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
21879
21866
|
for (const op of unit.update) {
|
|
21880
21867
|
if (op.kind === OpKind.I18nExpression) {
|
|
21881
21868
|
const index = expressionIndices.get(referenceIndex(op)) || 0;
|
|
21882
|
-
const subTemplateIndex = (_a2 =
|
|
21869
|
+
const subTemplateIndex = (_a2 = subTemplateIndices.get(op.i18nOwner)) != null ? _a2 : null;
|
|
21883
21870
|
const value = {
|
|
21884
21871
|
value: index,
|
|
21885
21872
|
subTemplateIndex,
|
|
@@ -21943,7 +21930,7 @@ function processLexicalScope2(unit, ops, savedView) {
|
|
|
21943
21930
|
if (op.kind == OpKind.Listener || op.kind === OpKind.TwoWayListener) {
|
|
21944
21931
|
continue;
|
|
21945
21932
|
}
|
|
21946
|
-
transformExpressionsInOp(op, (expr
|
|
21933
|
+
transformExpressionsInOp(op, (expr) => {
|
|
21947
21934
|
if (expr instanceof LexicalReadExpr) {
|
|
21948
21935
|
if (scope.has(expr.name)) {
|
|
21949
21936
|
return new ReadVariableExpr(scope.get(expr.name));
|
|
@@ -22056,10 +22043,13 @@ function transformTwoWayBindingSet(job) {
|
|
|
22056
22043
|
}
|
|
22057
22044
|
}
|
|
22058
22045
|
function wrapSetOperation(target, value) {
|
|
22046
|
+
if (target instanceof ReadVariableExpr) {
|
|
22047
|
+
return twoWayBindingSet(target, value);
|
|
22048
|
+
}
|
|
22059
22049
|
return twoWayBindingSet(target, value).or(target.set(value));
|
|
22060
22050
|
}
|
|
22061
22051
|
function isReadExpression2(value) {
|
|
22062
|
-
return value instanceof ReadPropExpr || value instanceof ReadKeyExpr;
|
|
22052
|
+
return value instanceof ReadPropExpr || value instanceof ReadKeyExpr || value instanceof ReadVariableExpr;
|
|
22063
22053
|
}
|
|
22064
22054
|
function wrapAction(target, value) {
|
|
22065
22055
|
if (isReadExpression2(target)) {
|
|
@@ -22545,7 +22535,6 @@ function optimizeVariablesInOpList(ops, compatibility) {
|
|
|
22545
22535
|
const toInline = [];
|
|
22546
22536
|
for (const [id, count] of varUsages) {
|
|
22547
22537
|
const decl = varDecls.get(id);
|
|
22548
|
-
const varInfo = opMap.get(decl);
|
|
22549
22538
|
const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline);
|
|
22550
22539
|
if (count !== 1 || isAlwaysInline) {
|
|
22551
22540
|
continue;
|
|
@@ -23248,7 +23237,6 @@ function ingestIcu(unit, icu) {
|
|
|
23248
23237
|
var _a2;
|
|
23249
23238
|
if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
|
|
23250
23239
|
const xref = unit.job.allocateXrefId();
|
|
23251
|
-
const icuNode = icu.i18n.nodes[0];
|
|
23252
23240
|
unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
|
|
23253
23241
|
for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
|
|
23254
23242
|
if (text2 instanceof BoundText) {
|
|
@@ -24263,6 +24251,9 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
24263
24251
|
errors.push(new ParseError(param.sourceSpan, '@for loop can only have one "track" expression'));
|
|
24264
24252
|
} else {
|
|
24265
24253
|
const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
|
|
24254
|
+
if (expression.ast instanceof EmptyExpr) {
|
|
24255
|
+
errors.push(new ParseError(param.sourceSpan, '@for loop must have a "track" expression'));
|
|
24256
|
+
}
|
|
24266
24257
|
const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy("track".length));
|
|
24267
24258
|
result.trackBy = { expression, keywordSpan };
|
|
24268
24259
|
}
|
|
@@ -29344,7 +29335,7 @@ function publishFacade(global) {
|
|
|
29344
29335
|
}
|
|
29345
29336
|
|
|
29346
29337
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
29347
|
-
var VERSION2 = new Version("17.3.0
|
|
29338
|
+
var VERSION2 = new Version("17.3.0");
|
|
29348
29339
|
|
|
29349
29340
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
29350
29341
|
var _I18N_ATTR = "i18n";
|
|
@@ -30410,7 +30401,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
30410
30401
|
function compileDeclareClassMetadata(metadata) {
|
|
30411
30402
|
const definitionMap = new DefinitionMap();
|
|
30412
30403
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
30413
|
-
definitionMap.set("version", literal("17.3.0
|
|
30404
|
+
definitionMap.set("version", literal("17.3.0"));
|
|
30414
30405
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30415
30406
|
definitionMap.set("type", metadata.type);
|
|
30416
30407
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -30479,7 +30470,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30479
30470
|
const definitionMap = new DefinitionMap();
|
|
30480
30471
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30481
30472
|
definitionMap.set("minVersion", literal(minVersion));
|
|
30482
|
-
definitionMap.set("version", literal("17.3.0
|
|
30473
|
+
definitionMap.set("version", literal("17.3.0"));
|
|
30483
30474
|
definitionMap.set("type", meta.type.value);
|
|
30484
30475
|
if (meta.isStandalone) {
|
|
30485
30476
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -30778,7 +30769,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
|
|
|
30778
30769
|
function compileDeclareFactoryFunction(meta) {
|
|
30779
30770
|
const definitionMap = new DefinitionMap();
|
|
30780
30771
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
30781
|
-
definitionMap.set("version", literal("17.3.0
|
|
30772
|
+
definitionMap.set("version", literal("17.3.0"));
|
|
30782
30773
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30783
30774
|
definitionMap.set("type", meta.type.value);
|
|
30784
30775
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -30801,7 +30792,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
30801
30792
|
function createInjectableDefinitionMap(meta) {
|
|
30802
30793
|
const definitionMap = new DefinitionMap();
|
|
30803
30794
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
30804
|
-
definitionMap.set("version", literal("17.3.0
|
|
30795
|
+
definitionMap.set("version", literal("17.3.0"));
|
|
30805
30796
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30806
30797
|
definitionMap.set("type", meta.type.value);
|
|
30807
30798
|
if (meta.providedIn !== void 0) {
|
|
@@ -30839,7 +30830,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
30839
30830
|
function createInjectorDefinitionMap(meta) {
|
|
30840
30831
|
const definitionMap = new DefinitionMap();
|
|
30841
30832
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
30842
|
-
definitionMap.set("version", literal("17.3.0
|
|
30833
|
+
definitionMap.set("version", literal("17.3.0"));
|
|
30843
30834
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30844
30835
|
definitionMap.set("type", meta.type.value);
|
|
30845
30836
|
definitionMap.set("providers", meta.providers);
|
|
@@ -30863,7 +30854,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
30863
30854
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
30864
30855
|
}
|
|
30865
30856
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
30866
|
-
definitionMap.set("version", literal("17.3.0
|
|
30857
|
+
definitionMap.set("version", literal("17.3.0"));
|
|
30867
30858
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30868
30859
|
definitionMap.set("type", meta.type.value);
|
|
30869
30860
|
if (meta.bootstrap.length > 0) {
|
|
@@ -30898,7 +30889,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
30898
30889
|
function createPipeDefinitionMap(meta) {
|
|
30899
30890
|
const definitionMap = new DefinitionMap();
|
|
30900
30891
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
30901
|
-
definitionMap.set("version", literal("17.3.0
|
|
30892
|
+
definitionMap.set("version", literal("17.3.0"));
|
|
30902
30893
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30903
30894
|
definitionMap.set("type", meta.type.value);
|
|
30904
30895
|
if (meta.isStandalone) {
|
|
@@ -30915,7 +30906,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
30915
30906
|
publishFacade(_global);
|
|
30916
30907
|
|
|
30917
30908
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
30918
|
-
var VERSION3 = new Version("17.3.0
|
|
30909
|
+
var VERSION3 = new Version("17.3.0");
|
|
30919
30910
|
|
|
30920
30911
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
30921
30912
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
@@ -33377,7 +33368,7 @@ var DtsMetadataReader = class {
|
|
|
33377
33368
|
const inputs = ClassPropertyMapping.fromMappedObject(readInputsType(def.type.typeArguments[3]));
|
|
33378
33369
|
const outputs = ClassPropertyMapping.fromMappedObject(readMapType(def.type.typeArguments[4], readStringType));
|
|
33379
33370
|
const hostDirectives = def.type.typeArguments.length > 8 ? readHostDirectivesType(this.checker, def.type.typeArguments[8], ref.bestGuessOwningModule) : null;
|
|
33380
|
-
const
|
|
33371
|
+
const isSignal = def.type.typeArguments.length > 9 && ((_b2 = readBooleanType(def.type.typeArguments[9])) != null ? _b2 : false);
|
|
33381
33372
|
return __spreadProps(__spreadValues({
|
|
33382
33373
|
kind: MetaKind.Directive,
|
|
33383
33374
|
matchSource: MatchSource.Selector,
|
|
@@ -33397,7 +33388,7 @@ var DtsMetadataReader = class {
|
|
|
33397
33388
|
animationTriggerNames: null,
|
|
33398
33389
|
ngContentSelectors,
|
|
33399
33390
|
isStandalone,
|
|
33400
|
-
isSignal
|
|
33391
|
+
isSignal,
|
|
33401
33392
|
imports: null,
|
|
33402
33393
|
deferredImports: null,
|
|
33403
33394
|
schemas: null,
|
|
@@ -35313,7 +35304,7 @@ var TraitCompiler = class {
|
|
|
35313
35304
|
}
|
|
35314
35305
|
}
|
|
35315
35306
|
}
|
|
35316
|
-
|
|
35307
|
+
runAdditionalChecks(sf, check) {
|
|
35317
35308
|
if (this.compilationMode === CompilationMode.LOCAL) {
|
|
35318
35309
|
return [];
|
|
35319
35310
|
}
|
|
@@ -35328,10 +35319,10 @@ var TraitCompiler = class {
|
|
|
35328
35319
|
}
|
|
35329
35320
|
const record = this.classes.get(clazz);
|
|
35330
35321
|
for (const trait of record.traits) {
|
|
35331
|
-
|
|
35332
|
-
|
|
35322
|
+
const result = check(clazz, trait.handler);
|
|
35323
|
+
if (result !== null) {
|
|
35324
|
+
diagnostics.push(...result);
|
|
35333
35325
|
}
|
|
35334
|
-
diagnostics.push(...trait.handler.extendedTemplateCheck(clazz, extendedTemplateChecker));
|
|
35335
35326
|
}
|
|
35336
35327
|
}
|
|
35337
35328
|
return diagnostics;
|
|
@@ -38002,58 +37993,71 @@ var import_typescript55 = __toESM(require("typescript"), 1);
|
|
|
38002
37993
|
|
|
38003
37994
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/initializer_functions.mjs
|
|
38004
37995
|
var import_typescript52 = __toESM(require("typescript"), 1);
|
|
38005
|
-
function tryParseInitializerApiMember(
|
|
37996
|
+
function tryParseInitializerApiMember(functions, member, reflector, importTracker) {
|
|
38006
37997
|
if (member.value === null || !import_typescript52.default.isCallExpression(member.value)) {
|
|
38007
37998
|
return null;
|
|
38008
37999
|
}
|
|
38009
38000
|
const call2 = member.value;
|
|
38010
|
-
const staticResult = parseTopLevelCall(call2,
|
|
38001
|
+
const staticResult = parseTopLevelCall(call2, functions, importTracker) || parseTopLevelRequiredCall(call2, functions, importTracker) || parseTopLevelCallFromNamespace(call2, functions, importTracker);
|
|
38011
38002
|
if (staticResult === null) {
|
|
38012
38003
|
return null;
|
|
38013
38004
|
}
|
|
38014
|
-
const resolvedImport = reflector.getImportOfIdentifier(staticResult.
|
|
38015
|
-
if (resolvedImport === null ||
|
|
38005
|
+
const resolvedImport = reflector.getImportOfIdentifier(staticResult.apiReference);
|
|
38006
|
+
if (resolvedImport === null || staticResult.api.functionName !== resolvedImport.name || staticResult.api.owningModule !== resolvedImport.from) {
|
|
38016
38007
|
return null;
|
|
38017
38008
|
}
|
|
38018
38009
|
return {
|
|
38010
|
+
api: staticResult.api,
|
|
38019
38011
|
call: call2,
|
|
38020
|
-
isRequired: staticResult.isRequired
|
|
38021
|
-
apiName: resolvedImport.name
|
|
38012
|
+
isRequired: staticResult.isRequired
|
|
38022
38013
|
};
|
|
38023
38014
|
}
|
|
38024
|
-
function parseTopLevelCall(call2,
|
|
38015
|
+
function parseTopLevelCall(call2, functions, importTracker) {
|
|
38025
38016
|
const node = call2.expression;
|
|
38026
38017
|
if (!import_typescript52.default.isIdentifier(node)) {
|
|
38027
38018
|
return null;
|
|
38028
38019
|
}
|
|
38029
|
-
|
|
38020
|
+
const matchingApi = functions.find((fn2) => importTracker.isPotentialReferenceToNamedImport(node, fn2.functionName, fn2.owningModule));
|
|
38021
|
+
if (matchingApi === void 0) {
|
|
38022
|
+
return null;
|
|
38023
|
+
}
|
|
38024
|
+
return { api: matchingApi, apiReference: node, isRequired: false };
|
|
38030
38025
|
}
|
|
38031
|
-
function parseTopLevelRequiredCall(call2,
|
|
38026
|
+
function parseTopLevelRequiredCall(call2, functions, importTracker) {
|
|
38032
38027
|
const node = call2.expression;
|
|
38033
38028
|
if (!import_typescript52.default.isPropertyAccessExpression(node) || !import_typescript52.default.isIdentifier(node.expression) || node.name.text !== "required") {
|
|
38034
38029
|
return null;
|
|
38035
38030
|
}
|
|
38036
38031
|
const expression = node.expression;
|
|
38037
|
-
const
|
|
38038
|
-
|
|
38032
|
+
const matchingApi = functions.find((fn2) => importTracker.isPotentialReferenceToNamedImport(expression, fn2.functionName, fn2.owningModule));
|
|
38033
|
+
if (matchingApi === void 0) {
|
|
38034
|
+
return null;
|
|
38035
|
+
}
|
|
38036
|
+
return { api: matchingApi, apiReference: expression, isRequired: true };
|
|
38039
38037
|
}
|
|
38040
|
-
function parseTopLevelCallFromNamespace(call2,
|
|
38038
|
+
function parseTopLevelCallFromNamespace(call2, functions, importTracker) {
|
|
38041
38039
|
const node = call2.expression;
|
|
38042
38040
|
if (!import_typescript52.default.isPropertyAccessExpression(node)) {
|
|
38043
38041
|
return null;
|
|
38044
38042
|
}
|
|
38045
38043
|
let apiReference = null;
|
|
38044
|
+
let matchingApi = void 0;
|
|
38046
38045
|
let isRequired = false;
|
|
38047
|
-
if (import_typescript52.default.isIdentifier(node.expression) && import_typescript52.default.isIdentifier(node.name)
|
|
38046
|
+
if (import_typescript52.default.isIdentifier(node.expression) && import_typescript52.default.isIdentifier(node.name)) {
|
|
38047
|
+
const namespaceRef = node.expression;
|
|
38048
38048
|
apiReference = node.name;
|
|
38049
|
-
|
|
38049
|
+
matchingApi = functions.find((fn2) => node.name.text === fn2.functionName && importTracker.isPotentialReferenceToNamespaceImport(namespaceRef, fn2.owningModule));
|
|
38050
|
+
} else if (import_typescript52.default.isPropertyAccessExpression(node.expression) && import_typescript52.default.isIdentifier(node.expression.expression) && import_typescript52.default.isIdentifier(node.expression.name) && node.name.text === "required") {
|
|
38051
|
+
const potentialName = node.expression.name.text;
|
|
38052
|
+
const namespaceRef = node.expression.expression;
|
|
38050
38053
|
apiReference = node.expression.name;
|
|
38054
|
+
matchingApi = functions.find((fn2) => fn2.functionName === potentialName && importTracker.isPotentialReferenceToNamespaceImport(namespaceRef, fn2.owningModule));
|
|
38051
38055
|
isRequired = true;
|
|
38052
38056
|
}
|
|
38053
|
-
if (
|
|
38057
|
+
if (matchingApi === void 0 || apiReference === null) {
|
|
38054
38058
|
return null;
|
|
38055
38059
|
}
|
|
38056
|
-
return {
|
|
38060
|
+
return { api: matchingApi, apiReference, isRequired };
|
|
38057
38061
|
}
|
|
38058
38062
|
|
|
38059
38063
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_output_parse_options.mjs
|
|
@@ -38077,7 +38081,7 @@ function parseAndValidateInputAndOutputOptions(optionsNode) {
|
|
|
38077
38081
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/input_function.mjs
|
|
38078
38082
|
function tryParseSignalInputMapping(member, reflector, importTracker) {
|
|
38079
38083
|
var _a2;
|
|
38080
|
-
const signalInput = tryParseInitializerApiMember(["input"], member, reflector, importTracker);
|
|
38084
|
+
const signalInput = tryParseInitializerApiMember([{ functionName: "input", owningModule: "@angular/core" }], member, reflector, importTracker);
|
|
38081
38085
|
if (signalInput === null) {
|
|
38082
38086
|
return null;
|
|
38083
38087
|
}
|
|
@@ -38096,7 +38100,7 @@ function tryParseSignalInputMapping(member, reflector, importTracker) {
|
|
|
38096
38100
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/model_function.mjs
|
|
38097
38101
|
function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
38098
38102
|
var _a2;
|
|
38099
|
-
const model = tryParseInitializerApiMember(["model"], member, reflector, importTracker);
|
|
38103
|
+
const model = tryParseInitializerApiMember([{ functionName: "model", owningModule: "@angular/core" }], member, reflector, importTracker);
|
|
38100
38104
|
if (model === null) {
|
|
38101
38105
|
return null;
|
|
38102
38106
|
}
|
|
@@ -38124,14 +38128,17 @@ function tryParseSignalModelMapping(member, reflector, importTracker) {
|
|
|
38124
38128
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/annotations/directive/src/output_function.mjs
|
|
38125
38129
|
function tryParseInitializerBasedOutput(member, reflector, importTracker) {
|
|
38126
38130
|
var _a2;
|
|
38127
|
-
const output = tryParseInitializerApiMember([
|
|
38131
|
+
const output = tryParseInitializerApiMember([
|
|
38132
|
+
{ functionName: "output", owningModule: "@angular/core" },
|
|
38133
|
+
{ functionName: "outputFromObservable", owningModule: "@angular/core/rxjs-interop" }
|
|
38134
|
+
], member, reflector, importTracker);
|
|
38128
38135
|
if (output === null) {
|
|
38129
38136
|
return null;
|
|
38130
38137
|
}
|
|
38131
38138
|
if (output.isRequired) {
|
|
38132
38139
|
throw new FatalDiagnosticError(ErrorCode.INITIALIZER_API_NO_REQUIRED_FUNCTION, output.call, `Output does not support ".required()".`);
|
|
38133
38140
|
}
|
|
38134
|
-
const optionsNode = output.call.arguments[0];
|
|
38141
|
+
const optionsNode = output.api.functionName === "output" ? output.call.arguments[0] : output.call.arguments[1];
|
|
38135
38142
|
const options = optionsNode !== void 0 ? parseAndValidateInputAndOutputOptions(optionsNode) : null;
|
|
38136
38143
|
const classPropertyName = member.name;
|
|
38137
38144
|
return {
|
|
@@ -38149,11 +38156,13 @@ var import_typescript54 = __toESM(require("typescript"), 1);
|
|
|
38149
38156
|
var queryFunctionNames = ["viewChild", "viewChildren", "contentChild", "contentChildren"];
|
|
38150
38157
|
var defaultDescendantsValue = (type) => type !== "contentChildren";
|
|
38151
38158
|
function tryParseSignalQueryFromInitializer(member, reflector, importTracker) {
|
|
38152
|
-
const
|
|
38159
|
+
const initializerFns = queryFunctionNames.map((fnName) => ({ functionName: fnName, owningModule: "@angular/core" }));
|
|
38160
|
+
const query = tryParseInitializerApiMember(initializerFns, member, reflector, importTracker);
|
|
38153
38161
|
if (query === null) {
|
|
38154
38162
|
return null;
|
|
38155
38163
|
}
|
|
38156
|
-
const
|
|
38164
|
+
const { functionName } = query.api;
|
|
38165
|
+
const isSingleQuery = functionName === "viewChild" || functionName === "contentChild";
|
|
38157
38166
|
const predicateNode = query.call.arguments[0];
|
|
38158
38167
|
if (predicateNode === void 0) {
|
|
38159
38168
|
throw new FatalDiagnosticError(ErrorCode.VALUE_HAS_WRONG_TYPE, query.call, "No locator specified.");
|
|
@@ -38164,9 +38173,9 @@ function tryParseSignalQueryFromInitializer(member, reflector, importTracker) {
|
|
|
38164
38173
|
}
|
|
38165
38174
|
const options = optionsNode && reflectObjectLiteral(optionsNode);
|
|
38166
38175
|
const read = (options == null ? void 0 : options.has("read")) ? parseReadOption(options.get("read")) : null;
|
|
38167
|
-
const descendants = (options == null ? void 0 : options.has("descendants")) ? parseDescendantsOption(options.get("descendants")) : defaultDescendantsValue(
|
|
38176
|
+
const descendants = (options == null ? void 0 : options.has("descendants")) ? parseDescendantsOption(options.get("descendants")) : defaultDescendantsValue(functionName);
|
|
38168
38177
|
return {
|
|
38169
|
-
name:
|
|
38178
|
+
name: functionName,
|
|
38170
38179
|
call: query.call,
|
|
38171
38180
|
metadata: {
|
|
38172
38181
|
isSignal: true,
|
|
@@ -38191,6 +38200,9 @@ function parseLocator(expression, reflector) {
|
|
|
38191
38200
|
return createMayBeForwardRefExpression(new output_ast_exports.WrappedNodeExpr(expression), unwrappedExpression !== null ? 2 : 0);
|
|
38192
38201
|
}
|
|
38193
38202
|
function parseReadOption(value) {
|
|
38203
|
+
if (import_typescript54.default.isExpressionWithTypeArguments(value) || import_typescript54.default.isParenthesizedExpression(value) || import_typescript54.default.isAsExpression(value)) {
|
|
38204
|
+
return parseReadOption(value.expression);
|
|
38205
|
+
}
|
|
38194
38206
|
if (import_typescript54.default.isPropertyAccessExpression(value) && import_typescript54.default.isIdentifier(value.expression) || import_typescript54.default.isIdentifier(value)) {
|
|
38195
38207
|
return new output_ast_exports.WrappedNodeExpr(value);
|
|
38196
38208
|
}
|
|
@@ -38285,14 +38297,14 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
38285
38297
|
}
|
|
38286
38298
|
isStandalone = resolved;
|
|
38287
38299
|
}
|
|
38288
|
-
let
|
|
38300
|
+
let isSignal = false;
|
|
38289
38301
|
if (directive.has("signals")) {
|
|
38290
38302
|
const expr = directive.get("signals");
|
|
38291
38303
|
const resolved = evaluator.evaluate(expr);
|
|
38292
38304
|
if (typeof resolved !== "boolean") {
|
|
38293
38305
|
throw createValueHasWrongTypeError(expr, resolved, `signals flag must be a boolean`);
|
|
38294
38306
|
}
|
|
38295
|
-
|
|
38307
|
+
isSignal = resolved;
|
|
38296
38308
|
}
|
|
38297
38309
|
const usesInheritance = reflector.hasBaseClass(clazz);
|
|
38298
38310
|
const sourceFile = clazz.getSourceFile();
|
|
@@ -38329,7 +38341,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
38329
38341
|
exportAs,
|
|
38330
38342
|
providers,
|
|
38331
38343
|
isStandalone,
|
|
38332
|
-
isSignal
|
|
38344
|
+
isSignal,
|
|
38333
38345
|
hostDirectives: (hostDirectives == null ? void 0 : hostDirectives.map((hostDir) => toHostDirectiveMetadata(hostDir, sourceFile, refEmitter))) || null
|
|
38334
38346
|
};
|
|
38335
38347
|
return {
|
|
@@ -39312,7 +39324,12 @@ function createModuleWithProvidersResolver(reflector, isCore) {
|
|
|
39312
39324
|
if (import_typescript56.default.isTypeLiteralNode(t)) {
|
|
39313
39325
|
for (const m of t.members) {
|
|
39314
39326
|
const ngModuleType = import_typescript56.default.isPropertySignature(m) && import_typescript56.default.isIdentifier(m.name) && m.name.text === "ngModule" && m.type || null;
|
|
39315
|
-
|
|
39327
|
+
let ngModuleExpression = null;
|
|
39328
|
+
if (ngModuleType !== null && import_typescript56.default.isTypeQueryNode(ngModuleType)) {
|
|
39329
|
+
ngModuleExpression = entityNameToValue(ngModuleType.exprName);
|
|
39330
|
+
} else if (ngModuleType !== null) {
|
|
39331
|
+
ngModuleExpression = typeNodeToValueExpr(ngModuleType);
|
|
39332
|
+
}
|
|
39316
39333
|
if (ngModuleExpression) {
|
|
39317
39334
|
return ngModuleExpression;
|
|
39318
39335
|
}
|
|
@@ -40871,6 +40888,9 @@ var ComponentDecoratorHandler = class {
|
|
|
40871
40888
|
extendedTemplateCheck(component, extendedTemplateChecker) {
|
|
40872
40889
|
return extendedTemplateChecker.getDiagnosticsForComponent(component);
|
|
40873
40890
|
}
|
|
40891
|
+
templateSemanticsCheck(component, templateSemanticsChecker) {
|
|
40892
|
+
return templateSemanticsChecker.getDiagnosticsForComponent(component);
|
|
40893
|
+
}
|
|
40874
40894
|
resolve(node, analysis, symbol) {
|
|
40875
40895
|
const metadata = analysis.meta;
|
|
40876
40896
|
const diagnostics = [];
|
|
@@ -41833,7 +41853,7 @@ var EmitFlags;
|
|
|
41833
41853
|
var import_typescript67 = __toESM(require("typescript"), 1);
|
|
41834
41854
|
|
|
41835
41855
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
41836
|
-
var
|
|
41856
|
+
var import_typescript116 = __toESM(require("typescript"), 1);
|
|
41837
41857
|
|
|
41838
41858
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
41839
41859
|
var path2 = __toESM(require("path"), 1);
|
|
@@ -41937,7 +41957,7 @@ function verifySupportedTypeScriptVersion() {
|
|
|
41937
41957
|
}
|
|
41938
41958
|
|
|
41939
41959
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
41940
|
-
var
|
|
41960
|
+
var import_typescript112 = __toESM(require("typescript"), 1);
|
|
41941
41961
|
|
|
41942
41962
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
41943
41963
|
var CycleAnalyzer = class {
|
|
@@ -45115,8 +45135,8 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
45115
45135
|
const plainKeys = [];
|
|
45116
45136
|
const coercedKeys = [];
|
|
45117
45137
|
const signalInputKeys = [];
|
|
45118
|
-
for (const { classPropertyName, transform: transform2, isSignal
|
|
45119
|
-
if (
|
|
45138
|
+
for (const { classPropertyName, transform: transform2, isSignal } of meta.fields.inputs) {
|
|
45139
|
+
if (isSignal) {
|
|
45120
45140
|
signalInputKeys.push(import_typescript95.default.factory.createLiteralTypeNode(import_typescript95.default.factory.createStringLiteral(classPropertyName)));
|
|
45121
45141
|
} else if (!meta.coercedInputFields.has(classPropertyName)) {
|
|
45122
45142
|
plainKeys.push(import_typescript95.default.factory.createLiteralTypeNode(import_typescript95.default.factory.createStringLiteral(classPropertyName)));
|
|
@@ -45306,21 +45326,6 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
45306
45326
|
}
|
|
45307
45327
|
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, import_typescript97.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
|
|
45308
45328
|
}
|
|
45309
|
-
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
45310
|
-
var _a2, _b2;
|
|
45311
|
-
const mapping = this.resolver.getSourceMapping(templateId);
|
|
45312
|
-
const errorMsg = `Cannot use variable '${assignment.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
|
|
45313
|
-
const sourceSpan = this.resolver.toParseSourceSpan(templateId, assignment.sourceSpan);
|
|
45314
|
-
if (sourceSpan === null) {
|
|
45315
|
-
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
45316
|
-
}
|
|
45317
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, import_typescript97.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
45318
|
-
text: `The variable ${assignment.name} is declared here.`,
|
|
45319
|
-
start: ((_a2 = target.valueSpan) == null ? void 0 : _a2.start.offset) || target.sourceSpan.start.offset,
|
|
45320
|
-
end: ((_b2 = target.valueSpan) == null ? void 0 : _b2.end.offset) || target.sourceSpan.end.offset,
|
|
45321
|
-
sourceFile: mapping.node.getSourceFile()
|
|
45322
|
-
}]));
|
|
45323
|
-
}
|
|
45324
45329
|
duplicateTemplateVar(templateId, variable2, firstDecl) {
|
|
45325
45330
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
45326
45331
|
const errorMsg = `Cannot redeclare variable '${variable2.name}' as it was previously declared elsewhere for the same template.`;
|
|
@@ -45850,29 +45855,6 @@ var VeSafeLhsInferenceBugDetector = _VeSafeLhsInferenceBugDetector;
|
|
|
45850
45855
|
_VeSafeLhsInferenceBugDetector.SINGLETON = new _VeSafeLhsInferenceBugDetector();
|
|
45851
45856
|
})();
|
|
45852
45857
|
|
|
45853
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
45854
|
-
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
45855
|
-
constructor(templateId, boundTarget, oob) {
|
|
45856
|
-
super();
|
|
45857
|
-
this.templateId = templateId;
|
|
45858
|
-
this.boundTarget = boundTarget;
|
|
45859
|
-
this.oob = oob;
|
|
45860
|
-
}
|
|
45861
|
-
visitPropertyWrite(ast, context) {
|
|
45862
|
-
super.visitPropertyWrite(ast, context);
|
|
45863
|
-
if (!(ast.receiver instanceof ImplicitReceiver)) {
|
|
45864
|
-
return;
|
|
45865
|
-
}
|
|
45866
|
-
const target = this.boundTarget.getExpressionTarget(ast);
|
|
45867
|
-
if (target instanceof Variable) {
|
|
45868
|
-
this.oob.illegalAssignmentToTemplateVar(this.templateId, ast, target);
|
|
45869
|
-
}
|
|
45870
|
-
}
|
|
45871
|
-
static visit(ast, id, boundTarget, oob) {
|
|
45872
|
-
ast.visit(new ExpressionSemanticVisitor(id, boundTarget, oob));
|
|
45873
|
-
}
|
|
45874
|
-
};
|
|
45875
|
-
|
|
45876
45858
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
45877
45859
|
var TcbGenericContextBehavior;
|
|
45878
45860
|
(function(TcbGenericContextBehavior2) {
|
|
@@ -46228,7 +46210,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
46228
46210
|
for (const attr of boundAttrs) {
|
|
46229
46211
|
const expr = widenBinding(translateInput(attr.attribute, this.tcb, this.scope), this.tcb);
|
|
46230
46212
|
let assignment = wrapForDiagnostics(expr);
|
|
46231
|
-
for (const { fieldName, required, transformType, isSignal
|
|
46213
|
+
for (const { fieldName, required, transformType, isSignal, isTwoWayBinding } of attr.inputs) {
|
|
46232
46214
|
let target;
|
|
46233
46215
|
if (required) {
|
|
46234
46216
|
seenRequiredInputs.add(fieldName);
|
|
@@ -46268,7 +46250,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
46268
46250
|
}
|
|
46269
46251
|
target = this.dir.stringLiteralInputFields.has(fieldName) ? import_typescript101.default.factory.createElementAccessExpression(dirId, import_typescript101.default.factory.createStringLiteral(fieldName)) : import_typescript101.default.factory.createPropertyAccessExpression(dirId, import_typescript101.default.factory.createIdentifier(fieldName));
|
|
46270
46252
|
}
|
|
46271
|
-
if (
|
|
46253
|
+
if (isSignal) {
|
|
46272
46254
|
const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(Identifiers.InputSignalBrandWriteType.moduleName, Identifiers.InputSignalBrandWriteType.name);
|
|
46273
46255
|
if (!import_typescript101.default.isIdentifier(inputSignalBrandWriteSymbol) && !import_typescript101.default.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
|
|
46274
46256
|
throw new Error(`Expected identifier or property access for reference to ${Identifiers.InputSignalBrandWriteType.name}`);
|
|
@@ -46512,7 +46494,6 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
46512
46494
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
46513
46495
|
this.scope.addStatement(import_typescript101.default.factory.createExpressionStatement(handler));
|
|
46514
46496
|
}
|
|
46515
|
-
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
46516
46497
|
}
|
|
46517
46498
|
return null;
|
|
46518
46499
|
}
|
|
@@ -46562,7 +46543,6 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
46562
46543
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
46563
46544
|
this.scope.addStatement(import_typescript101.default.factory.createExpressionStatement(handler));
|
|
46564
46545
|
}
|
|
46565
|
-
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
46566
46546
|
}
|
|
46567
46547
|
return null;
|
|
46568
46548
|
}
|
|
@@ -48482,6 +48462,10 @@ var TemplateTypeCheckerImpl = class {
|
|
|
48482
48462
|
fileData.isComplete = false;
|
|
48483
48463
|
this.isComplete = false;
|
|
48484
48464
|
}
|
|
48465
|
+
getExpressionTarget(expression, clazz) {
|
|
48466
|
+
var _a2;
|
|
48467
|
+
return ((_a2 = this.getLatestComponentState(clazz).data) == null ? void 0 : _a2.boundTarget.getExpressionTarget(expression)) || null;
|
|
48468
|
+
}
|
|
48485
48469
|
makeTemplateDiagnostic(clazz, sourceSpan, category, errorCode, message, relatedInformation) {
|
|
48486
48470
|
const sfPath = absoluteFromSourceFile(clazz.getSourceFile());
|
|
48487
48471
|
const fileRecord = this.state.get(sfPath);
|
|
@@ -48967,8 +48951,25 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
48967
48951
|
}
|
|
48968
48952
|
};
|
|
48969
48953
|
|
|
48970
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/
|
|
48954
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.mjs
|
|
48971
48955
|
var import_typescript107 = __toESM(require("typescript"), 1);
|
|
48956
|
+
var SIGNAL_FNS = /* @__PURE__ */ new Set([
|
|
48957
|
+
"WritableSignal",
|
|
48958
|
+
"Signal",
|
|
48959
|
+
"InputSignal",
|
|
48960
|
+
"InputSignalWithTransform",
|
|
48961
|
+
"ModelSignal"
|
|
48962
|
+
]);
|
|
48963
|
+
function isSignalReference(symbol) {
|
|
48964
|
+
return (symbol.kind === SymbolKind.Expression || symbol.kind === SymbolKind.Variable) && (symbol.tsType.symbol !== void 0 && isSignalSymbol(symbol.tsType.symbol) || symbol.tsType.aliasSymbol !== void 0 && isSignalSymbol(symbol.tsType.aliasSymbol));
|
|
48965
|
+
}
|
|
48966
|
+
function isSignalSymbol(symbol) {
|
|
48967
|
+
const declarations = symbol.getDeclarations();
|
|
48968
|
+
return declarations !== void 0 && declarations.some((decl) => {
|
|
48969
|
+
const fileName = decl.getSourceFile().fileName;
|
|
48970
|
+
return (import_typescript107.default.isInterfaceDeclaration(decl) || import_typescript107.default.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
|
|
48971
|
+
});
|
|
48972
|
+
}
|
|
48972
48973
|
|
|
48973
48974
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
48974
48975
|
var TemplateCheckWithVisitor = class {
|
|
@@ -49094,13 +49095,6 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor2 {
|
|
|
49094
49095
|
};
|
|
49095
49096
|
|
|
49096
49097
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
|
|
49097
|
-
var SIGNAL_FNS = /* @__PURE__ */ new Set([
|
|
49098
|
-
"WritableSignal",
|
|
49099
|
-
"Signal",
|
|
49100
|
-
"InputSignal",
|
|
49101
|
-
"InputSignalWithTransform",
|
|
49102
|
-
"ModelSignal"
|
|
49103
|
-
]);
|
|
49104
49098
|
var SIGNAL_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["set", "update", "asReadonly"]);
|
|
49105
49099
|
var FUNCTION_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["name", "length", "prototype"]);
|
|
49106
49100
|
var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
@@ -49115,13 +49109,6 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
|
49115
49109
|
return [];
|
|
49116
49110
|
}
|
|
49117
49111
|
};
|
|
49118
|
-
function isSignal(symbol) {
|
|
49119
|
-
const declarations = symbol == null ? void 0 : symbol.getDeclarations();
|
|
49120
|
-
return declarations !== void 0 && declarations.some((decl) => {
|
|
49121
|
-
const fileName = decl.getSourceFile().fileName;
|
|
49122
|
-
return (import_typescript107.default.isInterfaceDeclaration(decl) || import_typescript107.default.isTypeAliasDeclaration(decl)) && SIGNAL_FNS.has(decl.name.text) && (fileName.includes("@angular/core") || fileName.includes("angular2/rc/packages/core"));
|
|
49123
|
-
});
|
|
49124
|
-
}
|
|
49125
49112
|
function isFunctionInstanceProperty(name) {
|
|
49126
49113
|
return FUNCTION_INSTANCE_PROPERTIES.has(name);
|
|
49127
49114
|
}
|
|
@@ -49130,14 +49117,14 @@ function isSignalInstanceProperty(name) {
|
|
|
49130
49117
|
}
|
|
49131
49118
|
function buildDiagnosticForSignal(ctx, node, component) {
|
|
49132
49119
|
const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
|
|
49133
|
-
if (
|
|
49120
|
+
if (symbol !== null && symbol.kind === SymbolKind.Expression && isSignalReference(symbol)) {
|
|
49134
49121
|
const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbol.tcbLocation);
|
|
49135
49122
|
const errorString = `${node.name} is a function and should be invoked: ${node.name}()`;
|
|
49136
49123
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
49137
49124
|
return [diagnostic];
|
|
49138
49125
|
}
|
|
49139
49126
|
const symbolOfReceiver = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
|
|
49140
|
-
if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) &&
|
|
49127
|
+
if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) && symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
|
|
49141
49128
|
const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbolOfReceiver.tcbLocation);
|
|
49142
49129
|
const errorString = `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()`;
|
|
49143
49130
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
@@ -49481,6 +49468,87 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
|
|
|
49481
49468
|
...ALL_DIAGNOSTIC_FACTORIES.map((factory9) => factory9.name)
|
|
49482
49469
|
]);
|
|
49483
49470
|
|
|
49471
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
|
|
49472
|
+
var import_typescript111 = __toESM(require("typescript"), 1);
|
|
49473
|
+
var TemplateSemanticsCheckerImpl = class {
|
|
49474
|
+
constructor(templateTypeChecker) {
|
|
49475
|
+
this.templateTypeChecker = templateTypeChecker;
|
|
49476
|
+
}
|
|
49477
|
+
getDiagnosticsForComponent(component) {
|
|
49478
|
+
const template2 = this.templateTypeChecker.getTemplate(component);
|
|
49479
|
+
return template2 !== null ? TemplateSemanticsVisitor.visit(template2, component, this.templateTypeChecker) : [];
|
|
49480
|
+
}
|
|
49481
|
+
};
|
|
49482
|
+
var TemplateSemanticsVisitor = class extends RecursiveVisitor {
|
|
49483
|
+
constructor(expressionVisitor) {
|
|
49484
|
+
super();
|
|
49485
|
+
this.expressionVisitor = expressionVisitor;
|
|
49486
|
+
}
|
|
49487
|
+
static visit(nodes, component, templateTypeChecker) {
|
|
49488
|
+
const diagnostics = [];
|
|
49489
|
+
const expressionVisitor = new ExpressionsSemanticsVisitor(templateTypeChecker, component, diagnostics);
|
|
49490
|
+
const templateVisitor = new TemplateSemanticsVisitor(expressionVisitor);
|
|
49491
|
+
nodes.forEach((node) => node.visit(templateVisitor));
|
|
49492
|
+
return diagnostics;
|
|
49493
|
+
}
|
|
49494
|
+
visitBoundEvent(event) {
|
|
49495
|
+
super.visitBoundEvent(event);
|
|
49496
|
+
event.handler.visit(this.expressionVisitor, event);
|
|
49497
|
+
}
|
|
49498
|
+
};
|
|
49499
|
+
var ExpressionsSemanticsVisitor = class extends RecursiveAstVisitor2 {
|
|
49500
|
+
constructor(templateTypeChecker, component, diagnostics) {
|
|
49501
|
+
super();
|
|
49502
|
+
this.templateTypeChecker = templateTypeChecker;
|
|
49503
|
+
this.component = component;
|
|
49504
|
+
this.diagnostics = diagnostics;
|
|
49505
|
+
}
|
|
49506
|
+
visitPropertyWrite(ast, context) {
|
|
49507
|
+
super.visitPropertyWrite(ast, context);
|
|
49508
|
+
this.checkForIllegalWriteInEventBinding(ast, context);
|
|
49509
|
+
}
|
|
49510
|
+
visitPropertyRead(ast, context) {
|
|
49511
|
+
super.visitPropertyRead(ast, context);
|
|
49512
|
+
this.checkForIllegalWriteInTwoWayBinding(ast, context);
|
|
49513
|
+
}
|
|
49514
|
+
checkForIllegalWriteInEventBinding(ast, context) {
|
|
49515
|
+
if (!(context instanceof BoundEvent) || !(ast.receiver instanceof ImplicitReceiver)) {
|
|
49516
|
+
return;
|
|
49517
|
+
}
|
|
49518
|
+
const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
|
|
49519
|
+
if (target instanceof Variable) {
|
|
49520
|
+
const errorMessage = `Cannot use variable '${target.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
|
|
49521
|
+
this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
|
|
49522
|
+
}
|
|
49523
|
+
}
|
|
49524
|
+
checkForIllegalWriteInTwoWayBinding(ast, context) {
|
|
49525
|
+
if (!(context instanceof BoundEvent) || context.type !== 2 || !(ast.receiver instanceof ImplicitReceiver) || ast !== unwrapAstWithSource(context.handler)) {
|
|
49526
|
+
return;
|
|
49527
|
+
}
|
|
49528
|
+
const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
|
|
49529
|
+
if (!(target instanceof Variable)) {
|
|
49530
|
+
return;
|
|
49531
|
+
}
|
|
49532
|
+
const symbol = this.templateTypeChecker.getSymbolOfNode(target, this.component);
|
|
49533
|
+
if (symbol !== null && !isSignalReference(symbol)) {
|
|
49534
|
+
const errorMessage = `Cannot use a non-signal variable '${target.name}' in a two-way binding expression. Template variables are read-only.`;
|
|
49535
|
+
this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
|
|
49536
|
+
}
|
|
49537
|
+
}
|
|
49538
|
+
makeIllegalTemplateVarDiagnostic(target, expressionNode, errorMessage) {
|
|
49539
|
+
var _a2, _b2;
|
|
49540
|
+
return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan, import_typescript111.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMessage, [{
|
|
49541
|
+
text: `The variable ${target.name} is declared here.`,
|
|
49542
|
+
start: ((_a2 = target.valueSpan) == null ? void 0 : _a2.start.offset) || target.sourceSpan.start.offset,
|
|
49543
|
+
end: ((_b2 = target.valueSpan) == null ? void 0 : _b2.end.offset) || target.sourceSpan.end.offset,
|
|
49544
|
+
sourceFile: this.component.getSourceFile()
|
|
49545
|
+
}]);
|
|
49546
|
+
}
|
|
49547
|
+
};
|
|
49548
|
+
function unwrapAstWithSource(ast) {
|
|
49549
|
+
return ast instanceof ASTWithSource ? ast.ast : ast;
|
|
49550
|
+
}
|
|
49551
|
+
|
|
49484
49552
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/feature_detection.mjs
|
|
49485
49553
|
var import_semver = __toESM(require_semver2(), 1);
|
|
49486
49554
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
@@ -49566,7 +49634,7 @@ var NgCompiler = class {
|
|
|
49566
49634
|
this.currentProgram = inputProgram;
|
|
49567
49635
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
49568
49636
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
49569
|
-
const moduleResolutionCache =
|
|
49637
|
+
const moduleResolutionCache = import_typescript112.default.createModuleResolutionCache(
|
|
49570
49638
|
this.adapter.getCurrentDirectory(),
|
|
49571
49639
|
this.adapter.getCanonicalFileName.bind(this.adapter)
|
|
49572
49640
|
);
|
|
@@ -49610,7 +49678,7 @@ var NgCompiler = class {
|
|
|
49610
49678
|
}
|
|
49611
49679
|
for (const clazz of classesToUpdate) {
|
|
49612
49680
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
49613
|
-
if (!
|
|
49681
|
+
if (!import_typescript112.default.isClassDeclaration(clazz)) {
|
|
49614
49682
|
continue;
|
|
49615
49683
|
}
|
|
49616
49684
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -49626,10 +49694,7 @@ var NgCompiler = class {
|
|
|
49626
49694
|
...this.getNonTemplateDiagnostics()
|
|
49627
49695
|
];
|
|
49628
49696
|
try {
|
|
49629
|
-
diagnostics.push(...this.getTemplateDiagnostics());
|
|
49630
|
-
if (this.options.strictTemplates) {
|
|
49631
|
-
diagnostics.push(...this.getExtendedTemplateDiagnostics());
|
|
49632
|
-
}
|
|
49697
|
+
diagnostics.push(...this.getTemplateDiagnostics(), ...this.runAdditionalChecks());
|
|
49633
49698
|
} catch (err) {
|
|
49634
49699
|
if (!isFatalDiagnosticError(err)) {
|
|
49635
49700
|
throw err;
|
|
@@ -49641,10 +49706,7 @@ var NgCompiler = class {
|
|
|
49641
49706
|
getDiagnosticsForFile(file, optimizeFor) {
|
|
49642
49707
|
const diagnostics = [...this.getNonTemplateDiagnostics().filter((diag) => diag.file === file)];
|
|
49643
49708
|
try {
|
|
49644
|
-
diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor));
|
|
49645
|
-
if (this.options.strictTemplates) {
|
|
49646
|
-
diagnostics.push(...this.getExtendedTemplateDiagnostics(file));
|
|
49647
|
-
}
|
|
49709
|
+
diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor), ...this.runAdditionalChecks(file));
|
|
49648
49710
|
} catch (err) {
|
|
49649
49711
|
if (!isFatalDiagnosticError(err)) {
|
|
49650
49712
|
throw err;
|
|
@@ -49659,8 +49721,11 @@ var NgCompiler = class {
|
|
|
49659
49721
|
const diagnostics = [];
|
|
49660
49722
|
try {
|
|
49661
49723
|
diagnostics.push(...ttc.getDiagnosticsForComponent(component));
|
|
49662
|
-
const extendedTemplateChecker = compilation
|
|
49663
|
-
if (
|
|
49724
|
+
const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
|
|
49725
|
+
if (templateSemanticsChecker !== null) {
|
|
49726
|
+
diagnostics.push(...templateSemanticsChecker.getDiagnosticsForComponent(component));
|
|
49727
|
+
}
|
|
49728
|
+
if (this.options.strictTemplates && extendedTemplateChecker !== null) {
|
|
49664
49729
|
diagnostics.push(...extendedTemplateChecker.getDiagnosticsForComponent(component));
|
|
49665
49730
|
}
|
|
49666
49731
|
} catch (err) {
|
|
@@ -49956,18 +50021,24 @@ var NgCompiler = class {
|
|
|
49956
50021
|
}
|
|
49957
50022
|
return this.nonTemplateDiagnostics;
|
|
49958
50023
|
}
|
|
49959
|
-
|
|
50024
|
+
runAdditionalChecks(sf) {
|
|
49960
50025
|
const diagnostics = [];
|
|
49961
50026
|
const compilation = this.ensureAnalyzed();
|
|
49962
|
-
const extendedTemplateChecker = compilation
|
|
49963
|
-
|
|
49964
|
-
|
|
49965
|
-
|
|
49966
|
-
|
|
49967
|
-
|
|
49968
|
-
|
|
49969
|
-
|
|
49970
|
-
|
|
50027
|
+
const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
|
|
50028
|
+
const files = sf ? [sf] : this.inputProgram.getSourceFiles();
|
|
50029
|
+
for (const sf2 of files) {
|
|
50030
|
+
if (templateSemanticsChecker !== null) {
|
|
50031
|
+
diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
|
|
50032
|
+
var _a2;
|
|
50033
|
+
return ((_a2 = handler.templateSemanticsCheck) == null ? void 0 : _a2.call(handler, clazz, templateSemanticsChecker)) || null;
|
|
50034
|
+
}));
|
|
50035
|
+
}
|
|
50036
|
+
if (this.options.strictTemplates && extendedTemplateChecker !== null) {
|
|
50037
|
+
diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
|
|
50038
|
+
var _a2;
|
|
50039
|
+
return ((_a2 = handler.extendedTemplateCheck) == null ? void 0 : _a2.call(handler, clazz, extendedTemplateChecker)) || null;
|
|
50040
|
+
}));
|
|
50041
|
+
}
|
|
49971
50042
|
}
|
|
49972
50043
|
return diagnostics;
|
|
49973
50044
|
}
|
|
@@ -50076,6 +50147,7 @@ var NgCompiler = class {
|
|
|
50076
50147
|
});
|
|
50077
50148
|
const templateTypeChecker = new TemplateTypeCheckerImpl(this.inputProgram, notifyingDriver, traitCompiler, this.getTypeCheckingConfig(), refEmitter, reflector, this.adapter, this.incrementalCompilation, metaReader, localMetaReader, ngModuleIndex, scopeReader, typeCheckScopeRegistry, this.delegatingPerfRecorder);
|
|
50078
50149
|
const extendedTemplateChecker = this.constructionDiagnostics.length === 0 ? new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, ALL_DIAGNOSTIC_FACTORIES, this.options) : null;
|
|
50150
|
+
const templateSemanticsChecker = this.constructionDiagnostics.length === 0 ? new TemplateSemanticsCheckerImpl(templateTypeChecker) : null;
|
|
50079
50151
|
return {
|
|
50080
50152
|
isCore,
|
|
50081
50153
|
traitCompiler,
|
|
@@ -50090,7 +50162,8 @@ var NgCompiler = class {
|
|
|
50090
50162
|
templateTypeChecker,
|
|
50091
50163
|
resourceRegistry,
|
|
50092
50164
|
extendedTemplateChecker,
|
|
50093
|
-
localCompilationExtraImportsTracker
|
|
50165
|
+
localCompilationExtraImportsTracker,
|
|
50166
|
+
templateSemanticsChecker
|
|
50094
50167
|
};
|
|
50095
50168
|
}
|
|
50096
50169
|
};
|
|
@@ -50100,18 +50173,18 @@ function isAngularCorePackage(program) {
|
|
|
50100
50173
|
return false;
|
|
50101
50174
|
}
|
|
50102
50175
|
return r3Symbols.statements.some((stmt) => {
|
|
50103
|
-
if (!
|
|
50176
|
+
if (!import_typescript112.default.isVariableStatement(stmt)) {
|
|
50104
50177
|
return false;
|
|
50105
50178
|
}
|
|
50106
|
-
const modifiers =
|
|
50107
|
-
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind ===
|
|
50179
|
+
const modifiers = import_typescript112.default.getModifiers(stmt);
|
|
50180
|
+
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === import_typescript112.default.SyntaxKind.ExportKeyword)) {
|
|
50108
50181
|
return false;
|
|
50109
50182
|
}
|
|
50110
50183
|
return stmt.declarationList.declarations.some((decl) => {
|
|
50111
|
-
if (!
|
|
50184
|
+
if (!import_typescript112.default.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
50112
50185
|
return false;
|
|
50113
50186
|
}
|
|
50114
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
50187
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== import_typescript112.default.SyntaxKind.TrueKeyword) {
|
|
50115
50188
|
return false;
|
|
50116
50189
|
}
|
|
50117
50190
|
return true;
|
|
@@ -50125,7 +50198,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
50125
50198
|
var _a2, _b2, _c2;
|
|
50126
50199
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
50127
50200
|
yield makeConfigDiagnostic({
|
|
50128
|
-
category:
|
|
50201
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50129
50202
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
50130
50203
|
messageText: `
|
|
50131
50204
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -50144,7 +50217,7 @@ https://angular.io/guide/template-typecheck
|
|
|
50144
50217
|
}
|
|
50145
50218
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
50146
50219
|
yield makeConfigDiagnostic({
|
|
50147
|
-
category:
|
|
50220
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50148
50221
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
50149
50222
|
messageText: `
|
|
50150
50223
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -50161,7 +50234,7 @@ One of the following actions is required:
|
|
|
50161
50234
|
const defaultCategory = (_a2 = options.extendedDiagnostics) == null ? void 0 : _a2.defaultCategory;
|
|
50162
50235
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
50163
50236
|
yield makeConfigDiagnostic({
|
|
50164
|
-
category:
|
|
50237
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50165
50238
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
50166
50239
|
messageText: `
|
|
50167
50240
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -50174,7 +50247,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
50174
50247
|
for (const [checkName, category] of Object.entries((_c2 = (_b2 = options.extendedDiagnostics) == null ? void 0 : _b2.checks) != null ? _c2 : {})) {
|
|
50175
50248
|
if (!SUPPORTED_DIAGNOSTIC_NAMES.has(checkName)) {
|
|
50176
50249
|
yield makeConfigDiagnostic({
|
|
50177
|
-
category:
|
|
50250
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50178
50251
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
50179
50252
|
messageText: `
|
|
50180
50253
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -50186,7 +50259,7 @@ ${Array.from(SUPPORTED_DIAGNOSTIC_NAMES).join("\n")}
|
|
|
50186
50259
|
}
|
|
50187
50260
|
if (!allowedCategoryLabels.includes(category)) {
|
|
50188
50261
|
yield makeConfigDiagnostic({
|
|
50189
|
-
category:
|
|
50262
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50190
50263
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
50191
50264
|
messageText: `
|
|
50192
50265
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -50216,7 +50289,7 @@ var ReferenceGraphAdapter = class {
|
|
|
50216
50289
|
for (const { node } of references) {
|
|
50217
50290
|
let sourceFile = node.getSourceFile();
|
|
50218
50291
|
if (sourceFile === void 0) {
|
|
50219
|
-
sourceFile =
|
|
50292
|
+
sourceFile = import_typescript112.default.getOriginalNode(node).getSourceFile();
|
|
50220
50293
|
}
|
|
50221
50294
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
50222
50295
|
this.graph.add(source, node);
|
|
@@ -50255,7 +50328,7 @@ function versionMapFromProgram(program, driver) {
|
|
|
50255
50328
|
}
|
|
50256
50329
|
|
|
50257
50330
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
50258
|
-
var
|
|
50331
|
+
var import_typescript114 = __toESM(require("typescript"), 1);
|
|
50259
50332
|
var DelegatingCompilerHost2 = class {
|
|
50260
50333
|
get jsDocParsingMode() {
|
|
50261
50334
|
return this.delegate.jsDocParsingMode;
|
|
@@ -50340,7 +50413,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
50340
50413
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
50341
50414
|
if (entryPoint === null) {
|
|
50342
50415
|
diagnostics.push({
|
|
50343
|
-
category:
|
|
50416
|
+
category: import_typescript114.default.DiagnosticCategory.Error,
|
|
50344
50417
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
50345
50418
|
file: void 0,
|
|
50346
50419
|
start: void 0,
|
|
@@ -50383,10 +50456,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
50383
50456
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
50384
50457
|
}
|
|
50385
50458
|
createCachedResolveModuleNamesFunction() {
|
|
50386
|
-
const moduleResolutionCache =
|
|
50459
|
+
const moduleResolutionCache = import_typescript114.default.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
50387
50460
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
50388
50461
|
return moduleNames.map((moduleName) => {
|
|
50389
|
-
const module2 =
|
|
50462
|
+
const module2 = import_typescript114.default.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
50390
50463
|
return module2.resolvedModule;
|
|
50391
50464
|
});
|
|
50392
50465
|
};
|
|
@@ -50410,7 +50483,7 @@ var NgtscProgram = class {
|
|
|
50410
50483
|
if (reuseProgram !== void 0) {
|
|
50411
50484
|
retagAllTsFiles(reuseProgram);
|
|
50412
50485
|
}
|
|
50413
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
50486
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => import_typescript116.default.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
50414
50487
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
50415
50488
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
50416
50489
|
this.host.postProgramCreationCleanup();
|
|
@@ -50626,10 +50699,10 @@ function createProgram({ rootNames, options, host, oldProgram }) {
|
|
|
50626
50699
|
}
|
|
50627
50700
|
|
|
50628
50701
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
50629
|
-
var
|
|
50702
|
+
var import_typescript118 = __toESM(require("typescript"), 1);
|
|
50630
50703
|
|
|
50631
50704
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
50632
|
-
var
|
|
50705
|
+
var import_typescript117 = __toESM(require("typescript"), 1);
|
|
50633
50706
|
|
|
50634
50707
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/private/tooling.mjs
|
|
50635
50708
|
var GLOBAL_DEFS_FOR_TERSER = {
|
|
@@ -50664,14 +50737,14 @@ setFileSystem(new NodeJSFileSystem());
|
|
|
50664
50737
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/index.mjs
|
|
50665
50738
|
var import_fs2 = require("fs");
|
|
50666
50739
|
var import_path8 = require("path");
|
|
50667
|
-
var
|
|
50740
|
+
var import_typescript131 = __toESM(require("typescript"), 1);
|
|
50668
50741
|
|
|
50669
50742
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
|
|
50670
|
-
var
|
|
50743
|
+
var import_typescript120 = __toESM(require("typescript"), 1);
|
|
50671
50744
|
|
|
50672
50745
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
|
|
50673
50746
|
var import_path4 = require("path");
|
|
50674
|
-
var
|
|
50747
|
+
var import_typescript119 = __toESM(require("typescript"), 1);
|
|
50675
50748
|
var ImportManager2 = class {
|
|
50676
50749
|
constructor(getUpdateRecorder, printer) {
|
|
50677
50750
|
__publicField(this, "getUpdateRecorder");
|
|
@@ -50694,7 +50767,7 @@ var ImportManager2 = class {
|
|
|
50694
50767
|
}
|
|
50695
50768
|
for (let i = sourceFile.statements.length - 1; i >= 0; i--) {
|
|
50696
50769
|
const statement = sourceFile.statements[i];
|
|
50697
|
-
if (!
|
|
50770
|
+
if (!import_typescript119.default.isImportDeclaration(statement) || !import_typescript119.default.isStringLiteral(statement.moduleSpecifier) || !statement.importClause) {
|
|
50698
50771
|
continue;
|
|
50699
50772
|
}
|
|
50700
50773
|
if (importStartIndex === 0) {
|
|
@@ -50706,9 +50779,9 @@ var ImportManager2 = class {
|
|
|
50706
50779
|
}
|
|
50707
50780
|
if (statement.importClause.namedBindings) {
|
|
50708
50781
|
const namedBindings = statement.importClause.namedBindings;
|
|
50709
|
-
if (
|
|
50710
|
-
return
|
|
50711
|
-
} else if (
|
|
50782
|
+
if (import_typescript119.default.isNamespaceImport(namedBindings) && !typeImport) {
|
|
50783
|
+
return import_typescript119.default.factory.createPropertyAccessExpression(import_typescript119.default.factory.createIdentifier(namedBindings.name.text), import_typescript119.default.factory.createIdentifier(alias || symbolName || "default"));
|
|
50784
|
+
} else if (import_typescript119.default.isNamedImports(namedBindings) && symbolName) {
|
|
50712
50785
|
const existingElement = namedBindings.elements.find((e) => {
|
|
50713
50786
|
if (alias) {
|
|
50714
50787
|
return e.propertyName && e.name.text === alias && e.propertyName.text === symbolName;
|
|
@@ -50716,12 +50789,12 @@ var ImportManager2 = class {
|
|
|
50716
50789
|
return e.propertyName ? e.propertyName.text === symbolName : e.name.text === symbolName;
|
|
50717
50790
|
});
|
|
50718
50791
|
if (existingElement) {
|
|
50719
|
-
return
|
|
50792
|
+
return import_typescript119.default.factory.createIdentifier(existingElement.name.text);
|
|
50720
50793
|
}
|
|
50721
50794
|
existingImport = statement;
|
|
50722
50795
|
}
|
|
50723
50796
|
} else if (statement.importClause.name && !symbolName) {
|
|
50724
|
-
return
|
|
50797
|
+
return import_typescript119.default.factory.createIdentifier(statement.importClause.name.text);
|
|
50725
50798
|
}
|
|
50726
50799
|
}
|
|
50727
50800
|
if (existingImport) {
|
|
@@ -50745,7 +50818,7 @@ var ImportManager2 = class {
|
|
|
50745
50818
|
if (!importMap.has(moduleName)) {
|
|
50746
50819
|
importMap.set(moduleName, []);
|
|
50747
50820
|
}
|
|
50748
|
-
importMap.get(moduleName).push(
|
|
50821
|
+
importMap.get(moduleName).push(import_typescript119.default.factory.createImportSpecifier(false, propertyName, name));
|
|
50749
50822
|
} else {
|
|
50750
50823
|
const importMap = this.newImports.get(sourceFile).defaultImports;
|
|
50751
50824
|
identifier = this._getUniqueIdentifier(sourceFile, "defaultExport");
|
|
@@ -50759,19 +50832,19 @@ var ImportManager2 = class {
|
|
|
50759
50832
|
const sourceFile = importDecl.getSourceFile();
|
|
50760
50833
|
const recorder = this.getUpdateRecorder(sourceFile);
|
|
50761
50834
|
const namedBindings = importDecl.importClause.namedBindings;
|
|
50762
|
-
const newNamedBindings =
|
|
50763
|
-
const newNamedBindingsText = this.printer.printNode(
|
|
50835
|
+
const newNamedBindings = import_typescript119.default.factory.updateNamedImports(namedBindings, namedBindings.elements.concat(expressions.map(({ propertyName, importName }) => import_typescript119.default.factory.createImportSpecifier(false, propertyName, importName))));
|
|
50836
|
+
const newNamedBindingsText = this.printer.printNode(import_typescript119.default.EmitHint.Unspecified, newNamedBindings, sourceFile);
|
|
50764
50837
|
recorder.updateExistingImport(namedBindings, newNamedBindingsText);
|
|
50765
50838
|
});
|
|
50766
50839
|
this.newImports.forEach(({ importStartIndex, defaultImports, namedImports }, sourceFile) => {
|
|
50767
50840
|
const recorder = this.getUpdateRecorder(sourceFile);
|
|
50768
50841
|
const useSingleQuotes = this._getQuoteStyle(sourceFile) === 0;
|
|
50769
50842
|
defaultImports.forEach((identifier, moduleName) => {
|
|
50770
|
-
const newImport =
|
|
50843
|
+
const newImport = import_typescript119.default.factory.createImportDeclaration(void 0, import_typescript119.default.factory.createImportClause(false, identifier, void 0), import_typescript119.default.factory.createStringLiteral(moduleName, useSingleQuotes));
|
|
50771
50844
|
recorder.addNewImport(importStartIndex, this._getNewImportText(importStartIndex, newImport, sourceFile));
|
|
50772
50845
|
});
|
|
50773
50846
|
namedImports.forEach((specifiers, moduleName) => {
|
|
50774
|
-
const newImport =
|
|
50847
|
+
const newImport = import_typescript119.default.factory.createImportDeclaration(void 0, import_typescript119.default.factory.createImportClause(false, void 0, import_typescript119.default.factory.createNamedImports(specifiers)), import_typescript119.default.factory.createStringLiteral(moduleName, useSingleQuotes));
|
|
50775
50848
|
recorder.addNewImport(importStartIndex, this._getNewImportText(importStartIndex, newImport, sourceFile));
|
|
50776
50849
|
});
|
|
50777
50850
|
});
|
|
@@ -50779,7 +50852,7 @@ var ImportManager2 = class {
|
|
|
50779
50852
|
_getUniqueIdentifier(sourceFile, baseName) {
|
|
50780
50853
|
if (this.isUniqueIdentifierName(sourceFile, baseName)) {
|
|
50781
50854
|
this._recordUsedIdentifier(sourceFile, baseName);
|
|
50782
|
-
return
|
|
50855
|
+
return import_typescript119.default.factory.createIdentifier(baseName);
|
|
50783
50856
|
}
|
|
50784
50857
|
let name = null;
|
|
50785
50858
|
let counter = 1;
|
|
@@ -50787,7 +50860,7 @@ var ImportManager2 = class {
|
|
|
50787
50860
|
name = `${baseName}_${counter++}`;
|
|
50788
50861
|
} while (!this.isUniqueIdentifierName(sourceFile, name));
|
|
50789
50862
|
this._recordUsedIdentifier(sourceFile, name);
|
|
50790
|
-
return
|
|
50863
|
+
return import_typescript119.default.factory.createIdentifier(name);
|
|
50791
50864
|
}
|
|
50792
50865
|
isUniqueIdentifierName(sourceFile, name) {
|
|
50793
50866
|
if (this.usedIdentifierNames.has(sourceFile) && this.usedIdentifierNames.get(sourceFile).indexOf(name) !== -1) {
|
|
@@ -50796,7 +50869,7 @@ var ImportManager2 = class {
|
|
|
50796
50869
|
const nodeQueue = [sourceFile];
|
|
50797
50870
|
while (nodeQueue.length) {
|
|
50798
50871
|
const node = nodeQueue.shift();
|
|
50799
|
-
if (
|
|
50872
|
+
if (import_typescript119.default.isIdentifier(node) && node.text === name && (!import_typescript119.default.isImportSpecifier(node.parent) || node.parent.propertyName !== node)) {
|
|
50800
50873
|
return false;
|
|
50801
50874
|
}
|
|
50802
50875
|
nodeQueue.push(...node.getChildren());
|
|
@@ -50808,21 +50881,21 @@ var ImportManager2 = class {
|
|
|
50808
50881
|
}
|
|
50809
50882
|
_getEndPositionOfNode(node) {
|
|
50810
50883
|
const nodeEndPos = node.getEnd();
|
|
50811
|
-
const commentRanges =
|
|
50884
|
+
const commentRanges = import_typescript119.default.getTrailingCommentRanges(node.getSourceFile().text, nodeEndPos);
|
|
50812
50885
|
if (!commentRanges || !commentRanges.length) {
|
|
50813
50886
|
return nodeEndPos;
|
|
50814
50887
|
}
|
|
50815
50888
|
return commentRanges[commentRanges.length - 1].end;
|
|
50816
50889
|
}
|
|
50817
50890
|
_getNewImportText(importStartIndex, newImport, sourceFile) {
|
|
50818
|
-
const text2 = this.printer.printNode(
|
|
50891
|
+
const text2 = this.printer.printNode(import_typescript119.default.EmitHint.Unspecified, newImport, sourceFile);
|
|
50819
50892
|
return importStartIndex === 0 ? `${text2}
|
|
50820
50893
|
` : `
|
|
50821
50894
|
${text2}`;
|
|
50822
50895
|
}
|
|
50823
50896
|
_getImportParts(sourceFile, symbolName, alias, keepSymbolName) {
|
|
50824
|
-
const symbolIdentifier =
|
|
50825
|
-
const aliasIdentifier = alias ?
|
|
50897
|
+
const symbolIdentifier = import_typescript119.default.factory.createIdentifier(symbolName);
|
|
50898
|
+
const aliasIdentifier = alias ? import_typescript119.default.factory.createIdentifier(alias) : null;
|
|
50826
50899
|
const generatedUniqueIdentifier = this._getUniqueIdentifier(sourceFile, alias || symbolName);
|
|
50827
50900
|
const needsGeneratedUniqueName = generatedUniqueIdentifier.text !== (alias || symbolName);
|
|
50828
50901
|
let propertyName;
|
|
@@ -50842,7 +50915,7 @@ ${text2}`;
|
|
|
50842
50915
|
if (!this.quoteStyles.hasOwnProperty(sourceFile.fileName)) {
|
|
50843
50916
|
let quoteStyle;
|
|
50844
50917
|
for (const statement of sourceFile.statements) {
|
|
50845
|
-
if (
|
|
50918
|
+
if (import_typescript119.default.isImportDeclaration(statement) && import_typescript119.default.isStringLiteralLike(statement.moduleSpecifier)) {
|
|
50846
50919
|
quoteStyle = statement.moduleSpecifier.getText().trim().startsWith('"') ? 1 : 0;
|
|
50847
50920
|
break;
|
|
50848
50921
|
}
|
|
@@ -50873,7 +50946,7 @@ var ChangeTracker = class {
|
|
|
50873
50946
|
replaceText(sourceFile, start, removeLength, text2) {
|
|
50874
50947
|
this._trackChange(sourceFile, { start, removeLength, text: text2 });
|
|
50875
50948
|
}
|
|
50876
|
-
replaceNode(oldNode, newNode, emitHint =
|
|
50949
|
+
replaceNode(oldNode, newNode, emitHint = import_typescript120.default.EmitHint.Unspecified, sourceFileWhenPrinting) {
|
|
50877
50950
|
const sourceFile = oldNode.getSourceFile();
|
|
50878
50951
|
this.replaceText(sourceFile, oldNode.getStart(), oldNode.getWidth(), this._printer.printNode(emitHint, newNode, sourceFileWhenPrinting || sourceFile));
|
|
50879
50952
|
}
|
|
@@ -50994,23 +51067,23 @@ function getWorkspace(tree) {
|
|
|
50994
51067
|
|
|
50995
51068
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
50996
51069
|
var import_path5 = require("path");
|
|
50997
|
-
var
|
|
51070
|
+
var import_typescript122 = __toESM(require("typescript"), 1);
|
|
50998
51071
|
|
|
50999
51072
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
|
|
51000
51073
|
var path3 = __toESM(require("path"), 1);
|
|
51001
|
-
var
|
|
51074
|
+
var import_typescript121 = __toESM(require("typescript"), 1);
|
|
51002
51075
|
function parseTsconfigFile(tsconfigPath, basePath) {
|
|
51003
|
-
const { config } =
|
|
51076
|
+
const { config } = import_typescript121.default.readConfigFile(tsconfigPath, import_typescript121.default.sys.readFile);
|
|
51004
51077
|
const parseConfigHost = {
|
|
51005
|
-
useCaseSensitiveFileNames:
|
|
51006
|
-
fileExists:
|
|
51007
|
-
readDirectory:
|
|
51008
|
-
readFile:
|
|
51078
|
+
useCaseSensitiveFileNames: import_typescript121.default.sys.useCaseSensitiveFileNames,
|
|
51079
|
+
fileExists: import_typescript121.default.sys.fileExists,
|
|
51080
|
+
readDirectory: import_typescript121.default.sys.readDirectory,
|
|
51081
|
+
readFile: import_typescript121.default.sys.readFile
|
|
51009
51082
|
};
|
|
51010
51083
|
if (!path3.isAbsolute(basePath)) {
|
|
51011
51084
|
throw Error("Unexpected relative base path has been specified.");
|
|
51012
51085
|
}
|
|
51013
|
-
return
|
|
51086
|
+
return import_typescript121.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
|
|
51014
51087
|
}
|
|
51015
51088
|
|
|
51016
51089
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
@@ -51022,7 +51095,7 @@ function createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additi
|
|
|
51022
51095
|
return { rootNames: parsed.fileNames.concat(additionalFiles || []), options, host };
|
|
51023
51096
|
}
|
|
51024
51097
|
function createMigrationCompilerHost(tree, options, basePath, fakeRead) {
|
|
51025
|
-
const host =
|
|
51098
|
+
const host = import_typescript122.default.createCompilerHost(options, true);
|
|
51026
51099
|
const defaultReadFile = host.readFile;
|
|
51027
51100
|
host.readFile = (fileName) => {
|
|
51028
51101
|
var _a2;
|
|
@@ -51043,24 +51116,24 @@ function canMigrateFile(basePath, sourceFile, program) {
|
|
|
51043
51116
|
}
|
|
51044
51117
|
|
|
51045
51118
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/prune-modules.mjs
|
|
51046
|
-
var
|
|
51119
|
+
var import_typescript127 = __toESM(require("typescript"), 1);
|
|
51047
51120
|
|
|
51048
51121
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
51049
|
-
var
|
|
51122
|
+
var import_typescript124 = __toESM(require("typescript"), 1);
|
|
51050
51123
|
|
|
51051
51124
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
|
|
51052
|
-
var
|
|
51125
|
+
var import_typescript123 = __toESM(require("typescript"), 1);
|
|
51053
51126
|
function getImportOfIdentifier(typeChecker, node) {
|
|
51054
51127
|
const symbol = typeChecker.getSymbolAtLocation(node);
|
|
51055
51128
|
if (!symbol || symbol.declarations === void 0 || !symbol.declarations.length) {
|
|
51056
51129
|
return null;
|
|
51057
51130
|
}
|
|
51058
51131
|
const decl = symbol.declarations[0];
|
|
51059
|
-
if (!
|
|
51132
|
+
if (!import_typescript123.default.isImportSpecifier(decl)) {
|
|
51060
51133
|
return null;
|
|
51061
51134
|
}
|
|
51062
51135
|
const importDecl = decl.parent.parent.parent;
|
|
51063
|
-
if (!
|
|
51136
|
+
if (!import_typescript123.default.isStringLiteral(importDecl.moduleSpecifier)) {
|
|
51064
51137
|
return null;
|
|
51065
51138
|
}
|
|
51066
51139
|
return {
|
|
@@ -51077,10 +51150,10 @@ function getImportSpecifiers(sourceFile, moduleName, specifierNames) {
|
|
|
51077
51150
|
var _a2;
|
|
51078
51151
|
const matches = [];
|
|
51079
51152
|
for (const node of sourceFile.statements) {
|
|
51080
|
-
if (
|
|
51153
|
+
if (import_typescript123.default.isImportDeclaration(node) && import_typescript123.default.isStringLiteral(node.moduleSpecifier)) {
|
|
51081
51154
|
const isMatch = typeof moduleName === "string" ? node.moduleSpecifier.text === moduleName : moduleName.test(node.moduleSpecifier.text);
|
|
51082
51155
|
const namedBindings = (_a2 = node.importClause) == null ? void 0 : _a2.namedBindings;
|
|
51083
|
-
if (isMatch && namedBindings &&
|
|
51156
|
+
if (isMatch && namedBindings && import_typescript123.default.isNamedImports(namedBindings)) {
|
|
51084
51157
|
for (const specifierName of specifierNames) {
|
|
51085
51158
|
const match = findImportSpecifier(namedBindings.elements, specifierName);
|
|
51086
51159
|
if (match) {
|
|
@@ -51101,7 +51174,7 @@ function findImportSpecifier(nodes, specifierName) {
|
|
|
51101
51174
|
|
|
51102
51175
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
51103
51176
|
function getCallDecoratorImport(typeChecker, decorator) {
|
|
51104
|
-
if (!
|
|
51177
|
+
if (!import_typescript124.default.isCallExpression(decorator.expression) || !import_typescript124.default.isIdentifier(decorator.expression.expression)) {
|
|
51105
51178
|
return null;
|
|
51106
51179
|
}
|
|
51107
51180
|
const identifier = decorator.expression.expression;
|
|
@@ -51119,10 +51192,10 @@ function getAngularDecorators2(typeChecker, decorators) {
|
|
|
51119
51192
|
}
|
|
51120
51193
|
|
|
51121
51194
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs
|
|
51122
|
-
var
|
|
51195
|
+
var import_typescript125 = __toESM(require("typescript"), 1);
|
|
51123
51196
|
function closestNode(node, predicate) {
|
|
51124
51197
|
let current = node.parent;
|
|
51125
|
-
while (current && !
|
|
51198
|
+
while (current && !import_typescript125.default.isSourceFile(current)) {
|
|
51126
51199
|
if (predicate(current)) {
|
|
51127
51200
|
return current;
|
|
51128
51201
|
}
|
|
@@ -51133,7 +51206,7 @@ function closestNode(node, predicate) {
|
|
|
51133
51206
|
|
|
51134
51207
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/util.mjs
|
|
51135
51208
|
var import_path6 = require("path");
|
|
51136
|
-
var
|
|
51209
|
+
var import_typescript126 = __toESM(require("typescript"), 1);
|
|
51137
51210
|
var UniqueItemTracker = class {
|
|
51138
51211
|
constructor() {
|
|
51139
51212
|
__publicField(this, "_nodes", /* @__PURE__ */ new Map());
|
|
@@ -51182,7 +51255,7 @@ var ReferenceResolver = class {
|
|
|
51182
51255
|
const results = /* @__PURE__ */ new Map();
|
|
51183
51256
|
for (const symbol of referencedSymbols) {
|
|
51184
51257
|
for (const ref of symbol.references) {
|
|
51185
|
-
if (!ref.isDefinition || symbol.definition.kind ===
|
|
51258
|
+
if (!ref.isDefinition || symbol.definition.kind === import_typescript126.default.ScriptElementKind.alias) {
|
|
51186
51259
|
if (!results.has(ref.fileName)) {
|
|
51187
51260
|
results.set(ref.fileName, []);
|
|
51188
51261
|
}
|
|
@@ -51206,7 +51279,7 @@ var ReferenceResolver = class {
|
|
|
51206
51279
|
for (const file of highlights) {
|
|
51207
51280
|
if (file.fileName === fileName) {
|
|
51208
51281
|
for (const { textSpan: { start, length }, kind } of file.highlightSpans) {
|
|
51209
|
-
if (kind !==
|
|
51282
|
+
if (kind !== import_typescript126.default.HighlightSpanKind.none) {
|
|
51210
51283
|
results.push([start, start + length]);
|
|
51211
51284
|
}
|
|
51212
51285
|
}
|
|
@@ -51232,19 +51305,19 @@ var ReferenceResolver = class {
|
|
|
51232
51305
|
rootFileNames.push(fileName);
|
|
51233
51306
|
}
|
|
51234
51307
|
});
|
|
51235
|
-
this._languageService =
|
|
51308
|
+
this._languageService = import_typescript126.default.createLanguageService({
|
|
51236
51309
|
getCompilationSettings: () => this._program.getTsProgram().getCompilerOptions(),
|
|
51237
51310
|
getScriptFileNames: () => rootFileNames,
|
|
51238
51311
|
getScriptVersion: () => "0",
|
|
51239
51312
|
getScriptSnapshot: (path4) => {
|
|
51240
51313
|
const content = this._readFile(path4);
|
|
51241
|
-
return content ?
|
|
51314
|
+
return content ? import_typescript126.default.ScriptSnapshot.fromString(content) : void 0;
|
|
51242
51315
|
},
|
|
51243
51316
|
getCurrentDirectory: () => this._basePath,
|
|
51244
|
-
getDefaultLibFileName: (options) =>
|
|
51317
|
+
getDefaultLibFileName: (options) => import_typescript126.default.getDefaultLibFilePath(options),
|
|
51245
51318
|
readFile: (path4) => this._readFile(path4),
|
|
51246
51319
|
fileExists: (path4) => this._host.fileExists(path4)
|
|
51247
|
-
},
|
|
51320
|
+
}, import_typescript126.default.createDocumentRegistry(), import_typescript126.default.LanguageServiceMode.PartialSemantic);
|
|
51248
51321
|
}
|
|
51249
51322
|
return this._languageService;
|
|
51250
51323
|
}
|
|
@@ -51274,10 +51347,10 @@ function offsetsToNodes(lookup, offsets, results) {
|
|
|
51274
51347
|
}
|
|
51275
51348
|
function findClassDeclaration(reference2, typeChecker) {
|
|
51276
51349
|
var _a2, _b2;
|
|
51277
|
-
return ((_b2 = (_a2 = typeChecker.getTypeAtLocation(reference2).getSymbol()) == null ? void 0 : _a2.declarations) == null ? void 0 : _b2.find(
|
|
51350
|
+
return ((_b2 = (_a2 = typeChecker.getTypeAtLocation(reference2).getSymbol()) == null ? void 0 : _a2.declarations) == null ? void 0 : _b2.find(import_typescript126.default.isClassDeclaration)) || null;
|
|
51278
51351
|
}
|
|
51279
51352
|
function findLiteralProperty(literal3, name) {
|
|
51280
|
-
return literal3.properties.find((prop) => prop.name &&
|
|
51353
|
+
return literal3.properties.find((prop) => prop.name && import_typescript126.default.isIdentifier(prop.name) && prop.name.text === name);
|
|
51281
51354
|
}
|
|
51282
51355
|
function getRelativeImportPath(fromFile, toFile) {
|
|
51283
51356
|
let path4 = (0, import_path6.relative)((0, import_path6.dirname)(fromFile), toFile).replace(/\.ts$/, "");
|
|
@@ -51298,9 +51371,9 @@ function isClassReferenceInAngularModule(node, className, moduleName, typeChecke
|
|
|
51298
51371
|
const externalName = `@angular/${moduleName}`;
|
|
51299
51372
|
const internalName = `angular2/rc/packages/${moduleName}`;
|
|
51300
51373
|
return !!((_a2 = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a2.some((decl) => {
|
|
51301
|
-
const closestClass = closestOrSelf(decl,
|
|
51374
|
+
const closestClass = closestOrSelf(decl, import_typescript126.default.isClassDeclaration);
|
|
51302
51375
|
const closestClassFileName = closestClass == null ? void 0 : closestClass.getSourceFile().fileName;
|
|
51303
|
-
if (!closestClass || !closestClassFileName || !closestClass.name || !
|
|
51376
|
+
if (!closestClass || !closestClassFileName || !closestClass.name || !import_typescript126.default.isIdentifier(closestClass.name) || !closestClassFileName.includes(externalName) && !closestClassFileName.includes(internalName)) {
|
|
51304
51377
|
return false;
|
|
51305
51378
|
}
|
|
51306
51379
|
return typeof className === "string" ? closestClass.name.text === className : className.test(closestClass.name.text);
|
|
@@ -51325,10 +51398,10 @@ function pruneNgModules(program, host, basePath, rootFileNames, sourceFiles, pri
|
|
|
51325
51398
|
const nodesToRemove = /* @__PURE__ */ new Set();
|
|
51326
51399
|
sourceFiles.forEach(function walk(node) {
|
|
51327
51400
|
var _a2, _b2;
|
|
51328
|
-
if (
|
|
51401
|
+
if (import_typescript127.default.isClassDeclaration(node) && canRemoveClass(node, typeChecker)) {
|
|
51329
51402
|
collectRemovalLocations(node, removalLocations, referenceResolver, program);
|
|
51330
51403
|
classesToRemove.add(node);
|
|
51331
|
-
} else if (
|
|
51404
|
+
} else if (import_typescript127.default.isExportDeclaration(node) && !node.exportClause && node.moduleSpecifier && import_typescript127.default.isStringLiteralLike(node.moduleSpecifier) && node.moduleSpecifier.text.startsWith(".")) {
|
|
51332
51405
|
const exportedSourceFile = (_b2 = (_a2 = typeChecker.getSymbolAtLocation(node.moduleSpecifier)) == null ? void 0 : _a2.valueDeclaration) == null ? void 0 : _b2.getSourceFile();
|
|
51333
51406
|
if (exportedSourceFile) {
|
|
51334
51407
|
barrelExports.track(exportedSourceFile, node);
|
|
@@ -51374,17 +51447,17 @@ function collectRemovalLocations(ngModule, removalLocations, referenceResolver,
|
|
|
51374
51447
|
}
|
|
51375
51448
|
}
|
|
51376
51449
|
for (const node of nodes) {
|
|
51377
|
-
const closestArray = closestNode(node,
|
|
51450
|
+
const closestArray = closestNode(node, import_typescript127.default.isArrayLiteralExpression);
|
|
51378
51451
|
if (closestArray) {
|
|
51379
51452
|
removalLocations.arrays.track(closestArray, node);
|
|
51380
51453
|
continue;
|
|
51381
51454
|
}
|
|
51382
|
-
const closestImport = closestNode(node,
|
|
51455
|
+
const closestImport = closestNode(node, import_typescript127.default.isNamedImports);
|
|
51383
51456
|
if (closestImport) {
|
|
51384
51457
|
removalLocations.imports.track(closestImport, node);
|
|
51385
51458
|
continue;
|
|
51386
51459
|
}
|
|
51387
|
-
const closestExport = closestNode(node,
|
|
51460
|
+
const closestExport = closestNode(node, import_typescript127.default.isNamedExports);
|
|
51388
51461
|
if (closestExport) {
|
|
51389
51462
|
removalLocations.exports.track(closestExport, node);
|
|
51390
51463
|
continue;
|
|
@@ -51395,24 +51468,24 @@ function collectRemovalLocations(ngModule, removalLocations, referenceResolver,
|
|
|
51395
51468
|
function removeArrayReferences(locations, tracker) {
|
|
51396
51469
|
for (const [array, toRemove] of locations.getEntries()) {
|
|
51397
51470
|
const newElements = filterRemovedElements(array.elements, toRemove);
|
|
51398
|
-
tracker.replaceNode(array,
|
|
51471
|
+
tracker.replaceNode(array, import_typescript127.default.factory.updateArrayLiteralExpression(array, import_typescript127.default.factory.createNodeArray(newElements, array.elements.hasTrailingComma)));
|
|
51399
51472
|
}
|
|
51400
51473
|
}
|
|
51401
51474
|
function removeImportReferences(locations, tracker) {
|
|
51402
51475
|
for (const [namedImports, toRemove] of locations.getEntries()) {
|
|
51403
51476
|
const newElements = filterRemovedElements(namedImports.elements, toRemove);
|
|
51404
51477
|
if (newElements.length === 0) {
|
|
51405
|
-
const importClause = closestNode(namedImports,
|
|
51478
|
+
const importClause = closestNode(namedImports, import_typescript127.default.isImportClause);
|
|
51406
51479
|
if (importClause && importClause.name) {
|
|
51407
|
-
tracker.replaceNode(importClause,
|
|
51480
|
+
tracker.replaceNode(importClause, import_typescript127.default.factory.updateImportClause(importClause, importClause.isTypeOnly, importClause.name, void 0));
|
|
51408
51481
|
} else {
|
|
51409
|
-
const declaration = closestNode(namedImports,
|
|
51482
|
+
const declaration = closestNode(namedImports, import_typescript127.default.isImportDeclaration);
|
|
51410
51483
|
if (declaration) {
|
|
51411
51484
|
tracker.removeNode(declaration);
|
|
51412
51485
|
}
|
|
51413
51486
|
}
|
|
51414
51487
|
} else {
|
|
51415
|
-
tracker.replaceNode(namedImports,
|
|
51488
|
+
tracker.replaceNode(namedImports, import_typescript127.default.factory.updateNamedImports(namedImports, newElements));
|
|
51416
51489
|
}
|
|
51417
51490
|
}
|
|
51418
51491
|
}
|
|
@@ -51420,22 +51493,22 @@ function removeExportReferences(locations, tracker) {
|
|
|
51420
51493
|
for (const [namedExports, toRemove] of locations.getEntries()) {
|
|
51421
51494
|
const newElements = filterRemovedElements(namedExports.elements, toRemove);
|
|
51422
51495
|
if (newElements.length === 0) {
|
|
51423
|
-
const declaration = closestNode(namedExports,
|
|
51496
|
+
const declaration = closestNode(namedExports, import_typescript127.default.isExportDeclaration);
|
|
51424
51497
|
if (declaration) {
|
|
51425
51498
|
tracker.removeNode(declaration);
|
|
51426
51499
|
}
|
|
51427
51500
|
} else {
|
|
51428
|
-
tracker.replaceNode(namedExports,
|
|
51501
|
+
tracker.replaceNode(namedExports, import_typescript127.default.factory.updateNamedExports(namedExports, newElements));
|
|
51429
51502
|
}
|
|
51430
51503
|
}
|
|
51431
51504
|
}
|
|
51432
51505
|
function canRemoveClass(node, typeChecker) {
|
|
51433
51506
|
var _a2;
|
|
51434
51507
|
const decorator = (_a2 = findNgModuleDecorator(node, typeChecker)) == null ? void 0 : _a2.node;
|
|
51435
|
-
if (!decorator || !
|
|
51508
|
+
if (!decorator || !import_typescript127.default.isCallExpression(decorator.expression)) {
|
|
51436
51509
|
return false;
|
|
51437
51510
|
}
|
|
51438
|
-
if (decorator.expression.arguments.length > 0 && !
|
|
51511
|
+
if (decorator.expression.arguments.length > 0 && !import_typescript127.default.isObjectLiteralExpression(decorator.expression.arguments[0])) {
|
|
51439
51512
|
return false;
|
|
51440
51513
|
}
|
|
51441
51514
|
if (node.members.length > 0 && node.members.some((member) => !isEmptyConstructor(member))) {
|
|
@@ -51448,7 +51521,7 @@ function canRemoveClass(node, typeChecker) {
|
|
|
51448
51521
|
const imports = findLiteralProperty(literal3, "imports");
|
|
51449
51522
|
if (imports && isNonEmptyNgModuleProperty(imports)) {
|
|
51450
51523
|
for (const dep of imports.initializer.elements) {
|
|
51451
|
-
if (!
|
|
51524
|
+
if (!import_typescript127.default.isIdentifier(dep)) {
|
|
51452
51525
|
return false;
|
|
51453
51526
|
}
|
|
51454
51527
|
const depDeclaration = findClassDeclaration(dep, typeChecker);
|
|
@@ -51466,15 +51539,15 @@ function canRemoveClass(node, typeChecker) {
|
|
|
51466
51539
|
return true;
|
|
51467
51540
|
}
|
|
51468
51541
|
function isNonEmptyNgModuleProperty(node) {
|
|
51469
|
-
return
|
|
51542
|
+
return import_typescript127.default.isPropertyAssignment(node) && import_typescript127.default.isIdentifier(node.name) && import_typescript127.default.isArrayLiteralExpression(node.initializer) && node.initializer.elements.length > 0;
|
|
51470
51543
|
}
|
|
51471
51544
|
function canRemoveFile(sourceFile, nodesToBeRemoved) {
|
|
51472
51545
|
var _a2;
|
|
51473
51546
|
for (const node of sourceFile.statements) {
|
|
51474
|
-
if (
|
|
51547
|
+
if (import_typescript127.default.isImportDeclaration(node) || nodesToBeRemoved.has(node)) {
|
|
51475
51548
|
continue;
|
|
51476
51549
|
}
|
|
51477
|
-
if (
|
|
51550
|
+
if (import_typescript127.default.isExportDeclaration(node) || import_typescript127.default.canHaveModifiers(node) && ((_a2 = import_typescript127.default.getModifiers(node)) == null ? void 0 : _a2.some((m) => m.kind === import_typescript127.default.SyntaxKind.ExportKeyword))) {
|
|
51478
51551
|
return false;
|
|
51479
51552
|
}
|
|
51480
51553
|
}
|
|
@@ -51494,7 +51567,7 @@ function filterRemovedElements(elements, toRemove) {
|
|
|
51494
51567
|
});
|
|
51495
51568
|
}
|
|
51496
51569
|
function isEmptyConstructor(node) {
|
|
51497
|
-
return
|
|
51570
|
+
return import_typescript127.default.isConstructorDeclaration(node) && node.parameters.length === 0 && (node.body == null || node.body.statements.length === 0);
|
|
51498
51571
|
}
|
|
51499
51572
|
function addRemovalTodos(nodes, tracker) {
|
|
51500
51573
|
for (const node of nodes) {
|
|
@@ -51502,19 +51575,19 @@ function addRemovalTodos(nodes, tracker) {
|
|
|
51502
51575
|
}
|
|
51503
51576
|
}
|
|
51504
51577
|
function findNgModuleDecorator(node, typeChecker) {
|
|
51505
|
-
const decorators = getAngularDecorators2(typeChecker,
|
|
51578
|
+
const decorators = getAngularDecorators2(typeChecker, import_typescript127.default.getDecorators(node) || []);
|
|
51506
51579
|
return decorators.find((decorator) => decorator.name === "NgModule") || null;
|
|
51507
51580
|
}
|
|
51508
51581
|
|
|
51509
51582
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/standalone-bootstrap.mjs
|
|
51510
51583
|
var import_path7 = require("path");
|
|
51511
|
-
var
|
|
51584
|
+
var import_typescript130 = __toESM(require("typescript"), 1);
|
|
51512
51585
|
|
|
51513
51586
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/to-standalone.mjs
|
|
51514
|
-
var
|
|
51587
|
+
var import_typescript129 = __toESM(require("typescript"), 1);
|
|
51515
51588
|
|
|
51516
51589
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/symbol.mjs
|
|
51517
|
-
var
|
|
51590
|
+
var import_typescript128 = __toESM(require("typescript"), 1);
|
|
51518
51591
|
function isReferenceToImport(typeChecker, node, importSpecifier) {
|
|
51519
51592
|
var _a2, _b2;
|
|
51520
51593
|
const nodeSymbol = typeChecker.getTypeAtLocation(node).getSymbol();
|
|
@@ -51561,8 +51634,8 @@ function convertNgModuleDeclarationToStandalone(decl, allDeclarations, tracker,
|
|
|
51561
51634
|
const importsToAdd = getComponentImportExpressions(decl, allDeclarations, tracker, typeChecker, importRemapper);
|
|
51562
51635
|
if (importsToAdd.length > 0) {
|
|
51563
51636
|
const hasTrailingComma = importsToAdd.length > 2 && !!((_a2 = extractMetadataLiteral(directiveMeta.decorator)) == null ? void 0 : _a2.properties.hasTrailingComma);
|
|
51564
|
-
decorator = addPropertyToAngularDecorator(decorator,
|
|
51565
|
-
|
|
51637
|
+
decorator = addPropertyToAngularDecorator(decorator, import_typescript129.default.factory.createPropertyAssignment("imports", import_typescript129.default.factory.createArrayLiteralExpression(
|
|
51638
|
+
import_typescript129.default.factory.createNodeArray(importsToAdd, hasTrailingComma),
|
|
51566
51639
|
hasTrailingComma
|
|
51567
51640
|
)));
|
|
51568
51641
|
}
|
|
@@ -51594,11 +51667,11 @@ function getComponentImportExpressions(decl, allDeclarations, tracker, typeCheck
|
|
|
51594
51667
|
const identifier = tracker.addImport(decl.getSourceFile(), importLocation.symbolName, importLocation.moduleSpecifier);
|
|
51595
51668
|
imports.push(identifier);
|
|
51596
51669
|
} else {
|
|
51597
|
-
const identifier =
|
|
51670
|
+
const identifier = import_typescript129.default.factory.createIdentifier(importLocation.symbolName);
|
|
51598
51671
|
if (importLocation.isForwardReference) {
|
|
51599
51672
|
const forwardRefExpression = tracker.addImport(decl.getSourceFile(), "forwardRef", "@angular/core");
|
|
51600
|
-
const arrowFunction =
|
|
51601
|
-
imports.push(
|
|
51673
|
+
const arrowFunction = import_typescript129.default.factory.createArrowFunction(void 0, void 0, [], void 0, void 0, identifier);
|
|
51674
|
+
imports.push(import_typescript129.default.factory.createCallExpression(forwardRefExpression, void 0, [arrowFunction]));
|
|
51602
51675
|
} else {
|
|
51603
51676
|
imports.push(identifier);
|
|
51604
51677
|
}
|
|
@@ -51623,11 +51696,11 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
51623
51696
|
const declarationsToCopy = [];
|
|
51624
51697
|
const properties = [];
|
|
51625
51698
|
const importsProp = findLiteralProperty(literal3, "imports");
|
|
51626
|
-
const hasAnyArrayTrailingComma = literal3.properties.some((prop) =>
|
|
51627
|
-
if (
|
|
51628
|
-
if (
|
|
51699
|
+
const hasAnyArrayTrailingComma = literal3.properties.some((prop) => import_typescript129.default.isPropertyAssignment(prop) && import_typescript129.default.isArrayLiteralExpression(prop.initializer) && prop.initializer.elements.hasTrailingComma);
|
|
51700
|
+
if (import_typescript129.default.isPropertyAssignment(declarationsProp)) {
|
|
51701
|
+
if (import_typescript129.default.isArrayLiteralExpression(declarationsProp.initializer)) {
|
|
51629
51702
|
for (const el of declarationsProp.initializer.elements) {
|
|
51630
|
-
if (
|
|
51703
|
+
if (import_typescript129.default.isIdentifier(el)) {
|
|
51631
51704
|
const correspondingClass = findClassDeclaration(el, typeChecker);
|
|
51632
51705
|
if (!correspondingClass || isStandaloneDeclaration(correspondingClass, allDeclarations, templateTypeChecker)) {
|
|
51633
51706
|
declarationsToCopy.push(el);
|
|
@@ -51639,11 +51712,11 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
51639
51712
|
}
|
|
51640
51713
|
}
|
|
51641
51714
|
} else {
|
|
51642
|
-
declarationsToCopy.push(
|
|
51715
|
+
declarationsToCopy.push(import_typescript129.default.factory.createSpreadElement(declarationsProp.initializer));
|
|
51643
51716
|
}
|
|
51644
51717
|
}
|
|
51645
51718
|
if (!importsProp && declarationsToCopy.length > 0) {
|
|
51646
|
-
properties.push(
|
|
51719
|
+
properties.push(import_typescript129.default.factory.createPropertyAssignment("imports", import_typescript129.default.factory.createArrayLiteralExpression(import_typescript129.default.factory.createNodeArray(declarationsToCopy, hasAnyArrayTrailingComma && declarationsToCopy.length > 2))));
|
|
51647
51720
|
}
|
|
51648
51721
|
for (const prop of literal3.properties) {
|
|
51649
51722
|
if (!isNamedPropertyAssignment(prop)) {
|
|
@@ -51652,49 +51725,49 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
51652
51725
|
}
|
|
51653
51726
|
if (prop === declarationsProp) {
|
|
51654
51727
|
if (declarationsToPreserve.length > 0) {
|
|
51655
|
-
const hasTrailingComma =
|
|
51656
|
-
properties.push(
|
|
51728
|
+
const hasTrailingComma = import_typescript129.default.isArrayLiteralExpression(prop.initializer) ? prop.initializer.elements.hasTrailingComma : hasAnyArrayTrailingComma;
|
|
51729
|
+
properties.push(import_typescript129.default.factory.updatePropertyAssignment(prop, prop.name, import_typescript129.default.factory.createArrayLiteralExpression(import_typescript129.default.factory.createNodeArray(declarationsToPreserve, hasTrailingComma && declarationsToPreserve.length > 2))));
|
|
51657
51730
|
}
|
|
51658
51731
|
continue;
|
|
51659
51732
|
}
|
|
51660
51733
|
if (prop === importsProp && declarationsToCopy.length > 0) {
|
|
51661
51734
|
let initializer;
|
|
51662
|
-
if (
|
|
51663
|
-
initializer =
|
|
51735
|
+
if (import_typescript129.default.isArrayLiteralExpression(prop.initializer)) {
|
|
51736
|
+
initializer = import_typescript129.default.factory.updateArrayLiteralExpression(prop.initializer, import_typescript129.default.factory.createNodeArray([...prop.initializer.elements, ...declarationsToCopy], prop.initializer.elements.hasTrailingComma));
|
|
51664
51737
|
} else {
|
|
51665
|
-
initializer =
|
|
51666
|
-
[
|
|
51738
|
+
initializer = import_typescript129.default.factory.createArrayLiteralExpression(import_typescript129.default.factory.createNodeArray(
|
|
51739
|
+
[import_typescript129.default.factory.createSpreadElement(prop.initializer), ...declarationsToCopy],
|
|
51667
51740
|
hasAnyArrayTrailingComma && declarationsToCopy.length > 1
|
|
51668
51741
|
));
|
|
51669
51742
|
}
|
|
51670
|
-
properties.push(
|
|
51743
|
+
properties.push(import_typescript129.default.factory.updatePropertyAssignment(prop, prop.name, initializer));
|
|
51671
51744
|
continue;
|
|
51672
51745
|
}
|
|
51673
51746
|
properties.push(prop);
|
|
51674
51747
|
}
|
|
51675
|
-
tracker.replaceNode(literal3,
|
|
51748
|
+
tracker.replaceNode(literal3, import_typescript129.default.factory.updateObjectLiteralExpression(literal3, import_typescript129.default.factory.createNodeArray(properties, literal3.properties.hasTrailingComma)), import_typescript129.default.EmitHint.Expression);
|
|
51676
51749
|
}
|
|
51677
51750
|
function addStandaloneToDecorator(node) {
|
|
51678
|
-
return addPropertyToAngularDecorator(node,
|
|
51751
|
+
return addPropertyToAngularDecorator(node, import_typescript129.default.factory.createPropertyAssignment("standalone", import_typescript129.default.factory.createToken(import_typescript129.default.SyntaxKind.TrueKeyword)));
|
|
51679
51752
|
}
|
|
51680
51753
|
function addPropertyToAngularDecorator(node, property2) {
|
|
51681
|
-
if (!
|
|
51754
|
+
if (!import_typescript129.default.isCallExpression(node.expression) || node.expression.arguments.length > 1) {
|
|
51682
51755
|
return node;
|
|
51683
51756
|
}
|
|
51684
51757
|
let literalProperties;
|
|
51685
51758
|
let hasTrailingComma = false;
|
|
51686
51759
|
if (node.expression.arguments.length === 0) {
|
|
51687
51760
|
literalProperties = [property2];
|
|
51688
|
-
} else if (
|
|
51761
|
+
} else if (import_typescript129.default.isObjectLiteralExpression(node.expression.arguments[0])) {
|
|
51689
51762
|
hasTrailingComma = node.expression.arguments[0].properties.hasTrailingComma;
|
|
51690
51763
|
literalProperties = [...node.expression.arguments[0].properties, property2];
|
|
51691
51764
|
} else {
|
|
51692
51765
|
return node;
|
|
51693
51766
|
}
|
|
51694
|
-
return
|
|
51767
|
+
return import_typescript129.default.factory.createDecorator(import_typescript129.default.factory.createCallExpression(node.expression.expression, node.expression.typeArguments, [import_typescript129.default.factory.createObjectLiteralExpression(import_typescript129.default.factory.createNodeArray(literalProperties, hasTrailingComma), literalProperties.length > 1)]));
|
|
51695
51768
|
}
|
|
51696
51769
|
function isNamedPropertyAssignment(node) {
|
|
51697
|
-
return
|
|
51770
|
+
return import_typescript129.default.isPropertyAssignment(node) && node.name && import_typescript129.default.isIdentifier(node.name);
|
|
51698
51771
|
}
|
|
51699
51772
|
function findImportLocation(target, inComponent, importMode, typeChecker) {
|
|
51700
51773
|
const importLocations = typeChecker.getPotentialImportsFor(target, inComponent, importMode);
|
|
@@ -51714,14 +51787,14 @@ function findImportLocation(target, inComponent, importMode, typeChecker) {
|
|
|
51714
51787
|
return firstSameFileImport || firstModuleImport || importLocations[0] || null;
|
|
51715
51788
|
}
|
|
51716
51789
|
function hasNgModuleMetadataElements(node) {
|
|
51717
|
-
return
|
|
51790
|
+
return import_typescript129.default.isPropertyAssignment(node) && (!import_typescript129.default.isArrayLiteralExpression(node.initializer) || node.initializer.elements.length > 0);
|
|
51718
51791
|
}
|
|
51719
51792
|
function findNgModuleClassesToMigrate(sourceFile, typeChecker) {
|
|
51720
51793
|
const modules = [];
|
|
51721
51794
|
if (getImportSpecifier(sourceFile, "@angular/core", "NgModule")) {
|
|
51722
51795
|
sourceFile.forEachChild(function walk(node) {
|
|
51723
|
-
if (
|
|
51724
|
-
const decorator = getAngularDecorators2(typeChecker,
|
|
51796
|
+
if (import_typescript129.default.isClassDeclaration(node)) {
|
|
51797
|
+
const decorator = getAngularDecorators2(typeChecker, import_typescript129.default.getDecorators(node) || []).find((current) => current.name === "NgModule");
|
|
51725
51798
|
const metadata = decorator ? extractMetadataLiteral(decorator.node) : null;
|
|
51726
51799
|
if (metadata) {
|
|
51727
51800
|
const declarations = findLiteralProperty(metadata, "declarations");
|
|
@@ -51741,13 +51814,13 @@ function findTestObjectsToMigrate(sourceFile, typeChecker) {
|
|
|
51741
51814
|
const catalystImport = getImportSpecifier(sourceFile, /testing\/catalyst$/, "setupModule");
|
|
51742
51815
|
if (testBedImport || catalystImport) {
|
|
51743
51816
|
sourceFile.forEachChild(function walk(node) {
|
|
51744
|
-
const isObjectLiteralCall =
|
|
51817
|
+
const isObjectLiteralCall = import_typescript129.default.isCallExpression(node) && node.arguments.length > 0 && import_typescript129.default.isObjectLiteralExpression(node.arguments[0]);
|
|
51745
51818
|
const config = isObjectLiteralCall ? node.arguments[0] : null;
|
|
51746
|
-
const isTestBedCall = isObjectLiteralCall && (testBedImport &&
|
|
51747
|
-
const isCatalystCall = isObjectLiteralCall && (catalystImport &&
|
|
51819
|
+
const isTestBedCall = isObjectLiteralCall && (testBedImport && import_typescript129.default.isPropertyAccessExpression(node.expression) && node.expression.name.text === "configureTestingModule" && isReferenceToImport(typeChecker, node.expression.expression, testBedImport));
|
|
51820
|
+
const isCatalystCall = isObjectLiteralCall && (catalystImport && import_typescript129.default.isIdentifier(node.expression) && isReferenceToImport(typeChecker, node.expression, catalystImport));
|
|
51748
51821
|
if ((isTestBedCall || isCatalystCall) && config) {
|
|
51749
51822
|
const declarations = findLiteralProperty(config, "declarations");
|
|
51750
|
-
if (declarations &&
|
|
51823
|
+
if (declarations && import_typescript129.default.isPropertyAssignment(declarations) && import_typescript129.default.isArrayLiteralExpression(declarations.initializer) && declarations.initializer.elements.length > 0) {
|
|
51751
51824
|
testObjects.push(config);
|
|
51752
51825
|
}
|
|
51753
51826
|
}
|
|
@@ -51762,7 +51835,7 @@ function findTemplateDependencies(decl, typeChecker) {
|
|
|
51762
51835
|
const usedPipes = typeChecker.getUsedPipes(decl);
|
|
51763
51836
|
if (usedDirectives !== null) {
|
|
51764
51837
|
for (const dir of usedDirectives) {
|
|
51765
|
-
if (
|
|
51838
|
+
if (import_typescript129.default.isClassDeclaration(dir.ref.node)) {
|
|
51766
51839
|
results.push(dir.ref);
|
|
51767
51840
|
}
|
|
51768
51841
|
}
|
|
@@ -51770,7 +51843,7 @@ function findTemplateDependencies(decl, typeChecker) {
|
|
|
51770
51843
|
if (usedPipes !== null) {
|
|
51771
51844
|
const potentialPipes = typeChecker.getPotentialPipes(decl);
|
|
51772
51845
|
for (const pipe2 of potentialPipes) {
|
|
51773
|
-
if (
|
|
51846
|
+
if (import_typescript129.default.isClassDeclaration(pipe2.ref.node) && usedPipes.some((current) => pipe2.name === current)) {
|
|
51774
51847
|
results.push(pipe2.ref);
|
|
51775
51848
|
}
|
|
51776
51849
|
}
|
|
@@ -51784,12 +51857,12 @@ function filterNonBootstrappedDeclarations(declarations, ngModule, templateTypeC
|
|
|
51784
51857
|
if (!bootstrapProp) {
|
|
51785
51858
|
return declarations;
|
|
51786
51859
|
}
|
|
51787
|
-
if (!
|
|
51860
|
+
if (!import_typescript129.default.isPropertyAssignment(bootstrapProp) || !import_typescript129.default.isArrayLiteralExpression(bootstrapProp.initializer)) {
|
|
51788
51861
|
return [];
|
|
51789
51862
|
}
|
|
51790
51863
|
const bootstrappedClasses = /* @__PURE__ */ new Set();
|
|
51791
51864
|
for (const el of bootstrapProp.initializer.elements) {
|
|
51792
|
-
const referencedClass =
|
|
51865
|
+
const referencedClass = import_typescript129.default.isIdentifier(el) ? findClassDeclaration(el, typeChecker) : null;
|
|
51793
51866
|
if (referencedClass) {
|
|
51794
51867
|
bootstrappedClasses.add(referencedClass);
|
|
51795
51868
|
} else {
|
|
@@ -51800,14 +51873,14 @@ function filterNonBootstrappedDeclarations(declarations, ngModule, templateTypeC
|
|
|
51800
51873
|
}
|
|
51801
51874
|
function extractDeclarationsFromModule(ngModule, templateTypeChecker) {
|
|
51802
51875
|
const metadata = templateTypeChecker.getNgModuleMetadata(ngModule);
|
|
51803
|
-
return metadata ? metadata.declarations.filter((decl) =>
|
|
51876
|
+
return metadata ? metadata.declarations.filter((decl) => import_typescript129.default.isClassDeclaration(decl.node)).map((decl) => decl.node) : [];
|
|
51804
51877
|
}
|
|
51805
51878
|
function migrateTestDeclarations(testObjects, declarationsOutsideOfTestFiles, tracker, templateTypeChecker, typeChecker) {
|
|
51806
51879
|
var _a2;
|
|
51807
51880
|
const { decorators, componentImports } = analyzeTestingModules(testObjects, typeChecker);
|
|
51808
51881
|
const allDeclarations = new Set(declarationsOutsideOfTestFiles);
|
|
51809
51882
|
for (const decorator of decorators) {
|
|
51810
|
-
const closestClass = closestNode(decorator.node,
|
|
51883
|
+
const closestClass = closestNode(decorator.node, import_typescript129.default.isClassDeclaration);
|
|
51811
51884
|
if (decorator.name === "Pipe" || decorator.name === "Directive") {
|
|
51812
51885
|
tracker.replaceNode(decorator.node, addStandaloneToDecorator(decorator.node));
|
|
51813
51886
|
if (closestClass) {
|
|
@@ -51821,8 +51894,8 @@ function migrateTestDeclarations(testObjects, declarationsOutsideOfTestFiles, tr
|
|
|
51821
51894
|
}
|
|
51822
51895
|
if (importsToAdd && importsToAdd.size > 0) {
|
|
51823
51896
|
const hasTrailingComma = importsToAdd.size > 2 && !!((_a2 = extractMetadataLiteral(decorator.node)) == null ? void 0 : _a2.properties.hasTrailingComma);
|
|
51824
|
-
const importsArray =
|
|
51825
|
-
tracker.replaceNode(decorator.node, addPropertyToAngularDecorator(newDecorator,
|
|
51897
|
+
const importsArray = import_typescript129.default.factory.createNodeArray(Array.from(importsToAdd), hasTrailingComma);
|
|
51898
|
+
tracker.replaceNode(decorator.node, addPropertyToAngularDecorator(newDecorator, import_typescript129.default.factory.createPropertyAssignment("imports", import_typescript129.default.factory.createArrayLiteralExpression(importsArray))));
|
|
51826
51899
|
} else {
|
|
51827
51900
|
tracker.replaceNode(decorator.node, newDecorator);
|
|
51828
51901
|
}
|
|
@@ -51843,13 +51916,13 @@ function analyzeTestingModules(testObjects, typeChecker) {
|
|
|
51843
51916
|
}
|
|
51844
51917
|
const importsProp = findLiteralProperty(obj, "imports");
|
|
51845
51918
|
const importElements = importsProp && hasNgModuleMetadataElements(importsProp) ? importsProp.initializer.elements.filter((el) => {
|
|
51846
|
-
return !
|
|
51919
|
+
return !import_typescript129.default.isCallExpression(el) && !isClassReferenceInAngularModule(el, /^BrowserAnimationsModule|NoopAnimationsModule$/, "platform-browser/animations", typeChecker);
|
|
51847
51920
|
}) : null;
|
|
51848
51921
|
for (const decl of declarations) {
|
|
51849
51922
|
if (seenDeclarations.has(decl)) {
|
|
51850
51923
|
continue;
|
|
51851
51924
|
}
|
|
51852
|
-
const [decorator] = getAngularDecorators2(typeChecker,
|
|
51925
|
+
const [decorator] = getAngularDecorators2(typeChecker, import_typescript129.default.getDecorators(decl) || []);
|
|
51853
51926
|
if (decorator) {
|
|
51854
51927
|
seenDeclarations.add(decl);
|
|
51855
51928
|
decorators.push(decorator);
|
|
@@ -51880,7 +51953,7 @@ function extractDeclarationsFromTestObject(obj, typeChecker) {
|
|
|
51880
51953
|
return results;
|
|
51881
51954
|
}
|
|
51882
51955
|
function extractMetadataLiteral(decorator) {
|
|
51883
|
-
return
|
|
51956
|
+
return import_typescript129.default.isCallExpression(decorator.expression) && decorator.expression.arguments.length === 1 && import_typescript129.default.isObjectLiteralExpression(decorator.expression.arguments[0]) ? decorator.expression.arguments[0] : null;
|
|
51884
51957
|
}
|
|
51885
51958
|
function isStandaloneDeclaration(node, declarationsInMigration, templateTypeChecker) {
|
|
51886
51959
|
if (declarationsInMigration.has(node)) {
|
|
@@ -51902,7 +51975,7 @@ function toStandaloneBootstrap(program, host, basePath, rootFileNames, sourceFil
|
|
|
51902
51975
|
const additionalProviders = hasImport(program, rootFileNames, "protractor") ? /* @__PURE__ */ new Map([["provideProtractorTestingSupport", "@angular/platform-browser"]]) : null;
|
|
51903
51976
|
for (const sourceFile of sourceFiles) {
|
|
51904
51977
|
sourceFile.forEachChild(function walk(node) {
|
|
51905
|
-
if (
|
|
51978
|
+
if (import_typescript130.default.isCallExpression(node) && import_typescript130.default.isPropertyAccessExpression(node.expression) && node.expression.name.text === "bootstrapModule" && isClassReferenceInAngularModule(node.expression, "PlatformRef", "core", typeChecker)) {
|
|
51906
51979
|
const call2 = analyzeBootstrapCall(node, typeChecker, templateTypeChecker);
|
|
51907
51980
|
if (call2) {
|
|
51908
51981
|
bootstrapCalls.push(call2);
|
|
@@ -51923,24 +51996,24 @@ function toStandaloneBootstrap(program, host, basePath, rootFileNames, sourceFil
|
|
|
51923
51996
|
return tracker.recordChanges();
|
|
51924
51997
|
}
|
|
51925
51998
|
function analyzeBootstrapCall(call2, typeChecker, templateTypeChecker) {
|
|
51926
|
-
if (call2.arguments.length === 0 || !
|
|
51999
|
+
if (call2.arguments.length === 0 || !import_typescript130.default.isIdentifier(call2.arguments[0])) {
|
|
51927
52000
|
return null;
|
|
51928
52001
|
}
|
|
51929
52002
|
const declaration = findClassDeclaration(call2.arguments[0], typeChecker);
|
|
51930
52003
|
if (!declaration) {
|
|
51931
52004
|
return null;
|
|
51932
52005
|
}
|
|
51933
|
-
const decorator = getAngularDecorators2(typeChecker,
|
|
51934
|
-
if (!decorator || decorator.node.expression.arguments.length === 0 || !
|
|
52006
|
+
const decorator = getAngularDecorators2(typeChecker, import_typescript130.default.getDecorators(declaration) || []).find((decorator2) => decorator2.name === "NgModule");
|
|
52007
|
+
if (!decorator || decorator.node.expression.arguments.length === 0 || !import_typescript130.default.isObjectLiteralExpression(decorator.node.expression.arguments[0])) {
|
|
51935
52008
|
return null;
|
|
51936
52009
|
}
|
|
51937
52010
|
const metadata = decorator.node.expression.arguments[0];
|
|
51938
52011
|
const bootstrapProp = findLiteralProperty(metadata, "bootstrap");
|
|
51939
|
-
if (!bootstrapProp || !
|
|
52012
|
+
if (!bootstrapProp || !import_typescript130.default.isPropertyAssignment(bootstrapProp) || !import_typescript130.default.isArrayLiteralExpression(bootstrapProp.initializer) || bootstrapProp.initializer.elements.length === 0 || !import_typescript130.default.isIdentifier(bootstrapProp.initializer.elements[0])) {
|
|
51940
52013
|
return null;
|
|
51941
52014
|
}
|
|
51942
52015
|
const component = findClassDeclaration(bootstrapProp.initializer.elements[0], typeChecker);
|
|
51943
|
-
if (component && component.name &&
|
|
52016
|
+
if (component && component.name && import_typescript130.default.isIdentifier(component.name)) {
|
|
51944
52017
|
return {
|
|
51945
52018
|
module: declaration,
|
|
51946
52019
|
metadata,
|
|
@@ -51962,22 +52035,22 @@ function migrateBootstrapCall(analysis, tracker, additionalProviders, referenceR
|
|
|
51962
52035
|
let nodeLookup = null;
|
|
51963
52036
|
tracker.insertText(moduleSourceFile, analysis.metadata.getStart(), "/* TODO(standalone-migration): clean up removed NgModule class manually. \n");
|
|
51964
52037
|
tracker.insertText(moduleSourceFile, analysis.metadata.getEnd(), " */");
|
|
51965
|
-
if (providers &&
|
|
52038
|
+
if (providers && import_typescript130.default.isPropertyAssignment(providers)) {
|
|
51966
52039
|
nodeLookup = nodeLookup || getNodeLookup(moduleSourceFile);
|
|
51967
|
-
if (
|
|
52040
|
+
if (import_typescript130.default.isArrayLiteralExpression(providers.initializer)) {
|
|
51968
52041
|
providersInNewCall.push(...providers.initializer.elements);
|
|
51969
52042
|
} else {
|
|
51970
|
-
providersInNewCall.push(
|
|
52043
|
+
providersInNewCall.push(import_typescript130.default.factory.createSpreadElement(providers.initializer));
|
|
51971
52044
|
}
|
|
51972
52045
|
addNodesToCopy(sourceFile, providers, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
51973
52046
|
}
|
|
51974
|
-
if (imports &&
|
|
52047
|
+
if (imports && import_typescript130.default.isPropertyAssignment(imports)) {
|
|
51975
52048
|
nodeLookup = nodeLookup || getNodeLookup(moduleSourceFile);
|
|
51976
52049
|
migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, moduleImportsInNewCall, providersInNewCall, tracker, nodesToCopy, referenceResolver, typeChecker);
|
|
51977
52050
|
}
|
|
51978
52051
|
if (additionalProviders) {
|
|
51979
52052
|
additionalProviders.forEach((moduleSpecifier, name) => {
|
|
51980
|
-
providersInNewCall.push(
|
|
52053
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, name, moduleSpecifier), void 0, void 0));
|
|
51981
52054
|
});
|
|
51982
52055
|
}
|
|
51983
52056
|
if (nodesToCopy.size > 0) {
|
|
@@ -51987,7 +52060,7 @@ function migrateBootstrapCall(analysis, tracker, additionalProviders, referenceR
|
|
|
51987
52060
|
if (transformedNode === node) {
|
|
51988
52061
|
text2 += transformedNode.getText() + "\n";
|
|
51989
52062
|
} else {
|
|
51990
|
-
text2 += printer.printNode(
|
|
52063
|
+
text2 += printer.printNode(import_typescript130.default.EmitHint.Unspecified, transformedNode, node.getSourceFile());
|
|
51991
52064
|
}
|
|
51992
52065
|
});
|
|
51993
52066
|
text2 += "\n";
|
|
@@ -52004,31 +52077,31 @@ function replaceBootstrapCallExpression(analysis, providers, modules, tracker) {
|
|
|
52004
52077
|
const combinedProviders = [];
|
|
52005
52078
|
if (modules.length > 0) {
|
|
52006
52079
|
const importProvidersExpression = tracker.addImport(sourceFile, "importProvidersFrom", "@angular/core");
|
|
52007
|
-
combinedProviders.push(
|
|
52080
|
+
combinedProviders.push(import_typescript130.default.factory.createCallExpression(importProvidersExpression, [], modules));
|
|
52008
52081
|
}
|
|
52009
52082
|
combinedProviders.push(...providers);
|
|
52010
|
-
const providersArray =
|
|
52011
|
-
const initializer = remapDynamicImports(sourceFile.fileName,
|
|
52012
|
-
args.push(
|
|
52083
|
+
const providersArray = import_typescript130.default.factory.createNodeArray(combinedProviders, analysis.metadata.properties.hasTrailingComma && combinedProviders.length > 2);
|
|
52084
|
+
const initializer = remapDynamicImports(sourceFile.fileName, import_typescript130.default.factory.createArrayLiteralExpression(providersArray, combinedProviders.length > 1));
|
|
52085
|
+
args.push(import_typescript130.default.factory.createObjectLiteralExpression([import_typescript130.default.factory.createPropertyAssignment("providers", initializer)], true));
|
|
52013
52086
|
}
|
|
52014
52087
|
tracker.replaceNode(
|
|
52015
52088
|
analysis.call,
|
|
52016
|
-
|
|
52089
|
+
import_typescript130.default.factory.createCallExpression(bootstrapExpression, [], args),
|
|
52017
52090
|
void 0,
|
|
52018
52091
|
analysis.metadata.getSourceFile()
|
|
52019
52092
|
);
|
|
52020
52093
|
}
|
|
52021
52094
|
function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, importsForNewCall, providersInNewCall, tracker, nodesToCopy, referenceResolver, typeChecker) {
|
|
52022
|
-
if (!
|
|
52095
|
+
if (!import_typescript130.default.isArrayLiteralExpression(imports.initializer)) {
|
|
52023
52096
|
importsForNewCall.push(imports.initializer);
|
|
52024
52097
|
return;
|
|
52025
52098
|
}
|
|
52026
52099
|
for (const element2 of imports.initializer.elements) {
|
|
52027
|
-
if (
|
|
52100
|
+
if (import_typescript130.default.isCallExpression(element2) && import_typescript130.default.isPropertyAccessExpression(element2.expression) && element2.arguments.length > 0 && element2.expression.name.text === "forRoot" && isClassReferenceInAngularModule(element2.expression.expression, "RouterModule", "router", typeChecker)) {
|
|
52028
52101
|
const options = element2.arguments[1];
|
|
52029
52102
|
const features = options ? getRouterModuleForRootFeatures(sourceFile, options, tracker) : [];
|
|
52030
52103
|
if (features !== null) {
|
|
52031
|
-
providersInNewCall.push(
|
|
52104
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideRouter", "@angular/router"), [], [element2.arguments[0], ...features]));
|
|
52032
52105
|
addNodesToCopy(sourceFile, element2.arguments[0], nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
52033
52106
|
if (options) {
|
|
52034
52107
|
addNodesToCopy(sourceFile, options, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
@@ -52036,30 +52109,30 @@ function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, imports
|
|
|
52036
52109
|
continue;
|
|
52037
52110
|
}
|
|
52038
52111
|
}
|
|
52039
|
-
if (
|
|
52112
|
+
if (import_typescript130.default.isIdentifier(element2)) {
|
|
52040
52113
|
const animationsModule = "platform-browser/animations";
|
|
52041
52114
|
const animationsImport = `@angular/${animationsModule}`;
|
|
52042
52115
|
if (isClassReferenceInAngularModule(element2, "BrowserAnimationsModule", animationsModule, typeChecker)) {
|
|
52043
|
-
providersInNewCall.push(
|
|
52116
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideAnimations", animationsImport), [], []));
|
|
52044
52117
|
continue;
|
|
52045
52118
|
}
|
|
52046
52119
|
if (isClassReferenceInAngularModule(element2, "NoopAnimationsModule", animationsModule, typeChecker)) {
|
|
52047
|
-
providersInNewCall.push(
|
|
52120
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideNoopAnimations", animationsImport), [], []));
|
|
52048
52121
|
continue;
|
|
52049
52122
|
}
|
|
52050
52123
|
const httpClientModule = "common/http";
|
|
52051
52124
|
const httpClientImport = `@angular/${httpClientModule}`;
|
|
52052
52125
|
if (isClassReferenceInAngularModule(element2, "HttpClientModule", httpClientModule, typeChecker)) {
|
|
52053
52126
|
const callArgs = [
|
|
52054
|
-
|
|
52127
|
+
import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "withInterceptorsFromDi", httpClientImport), [], [])
|
|
52055
52128
|
];
|
|
52056
|
-
providersInNewCall.push(
|
|
52129
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideHttpClient", httpClientImport), [], callArgs));
|
|
52057
52130
|
continue;
|
|
52058
52131
|
}
|
|
52059
52132
|
}
|
|
52060
|
-
const target =
|
|
52133
|
+
const target = import_typescript130.default.isCallExpression(element2) && import_typescript130.default.isPropertyAccessExpression(element2.expression) ? element2.expression.expression : element2;
|
|
52061
52134
|
const classDeclaration = findClassDeclaration(target, typeChecker);
|
|
52062
|
-
const decorators = classDeclaration ? getAngularDecorators2(typeChecker,
|
|
52135
|
+
const decorators = classDeclaration ? getAngularDecorators2(typeChecker, import_typescript130.default.getDecorators(classDeclaration) || []) : void 0;
|
|
52063
52136
|
if (!decorators || decorators.length === 0 || decorators.every(({ name }) => name !== "Directive" && name !== "Component" && name !== "Pipe")) {
|
|
52064
52137
|
importsForNewCall.push(element2);
|
|
52065
52138
|
addNodesToCopy(sourceFile, element2, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
@@ -52067,7 +52140,7 @@ function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, imports
|
|
|
52067
52140
|
}
|
|
52068
52141
|
}
|
|
52069
52142
|
function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
52070
|
-
if (!
|
|
52143
|
+
if (!import_typescript130.default.isObjectLiteralExpression(options)) {
|
|
52071
52144
|
return null;
|
|
52072
52145
|
}
|
|
52073
52146
|
const featureExpressions = [];
|
|
@@ -52075,7 +52148,7 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52075
52148
|
const inMemoryScrollingOptions = [];
|
|
52076
52149
|
const features = new UniqueItemTracker();
|
|
52077
52150
|
for (const prop of options.properties) {
|
|
52078
|
-
if (!
|
|
52151
|
+
if (!import_typescript130.default.isPropertyAssignment(prop) || !import_typescript130.default.isIdentifier(prop.name) && !import_typescript130.default.isStringLiteralLike(prop.name)) {
|
|
52079
52152
|
return null;
|
|
52080
52153
|
}
|
|
52081
52154
|
switch (prop.name.text) {
|
|
@@ -52083,12 +52156,12 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52083
52156
|
features.track("withPreloading", prop.initializer);
|
|
52084
52157
|
break;
|
|
52085
52158
|
case "enableTracing":
|
|
52086
|
-
if (prop.initializer.kind ===
|
|
52159
|
+
if (prop.initializer.kind === import_typescript130.default.SyntaxKind.TrueKeyword) {
|
|
52087
52160
|
features.track("withDebugTracing", null);
|
|
52088
52161
|
}
|
|
52089
52162
|
break;
|
|
52090
52163
|
case "initialNavigation":
|
|
52091
|
-
if (!
|
|
52164
|
+
if (!import_typescript130.default.isStringLiteralLike(prop.initializer)) {
|
|
52092
52165
|
return null;
|
|
52093
52166
|
}
|
|
52094
52167
|
if (prop.initializer.text === "enabledBlocking" || prop.initializer.text === "enabled") {
|
|
@@ -52098,7 +52171,7 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52098
52171
|
}
|
|
52099
52172
|
break;
|
|
52100
52173
|
case "useHash":
|
|
52101
|
-
if (prop.initializer.kind ===
|
|
52174
|
+
if (prop.initializer.kind === import_typescript130.default.SyntaxKind.TrueKeyword) {
|
|
52102
52175
|
features.track("withHashLocation", null);
|
|
52103
52176
|
}
|
|
52104
52177
|
break;
|
|
@@ -52115,10 +52188,10 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52115
52188
|
}
|
|
52116
52189
|
}
|
|
52117
52190
|
if (inMemoryScrollingOptions.length > 0) {
|
|
52118
|
-
features.track("withInMemoryScrolling",
|
|
52191
|
+
features.track("withInMemoryScrolling", import_typescript130.default.factory.createObjectLiteralExpression(inMemoryScrollingOptions));
|
|
52119
52192
|
}
|
|
52120
52193
|
if (configOptions.length > 0) {
|
|
52121
|
-
features.track("withRouterConfig",
|
|
52194
|
+
features.track("withRouterConfig", import_typescript130.default.factory.createObjectLiteralExpression(configOptions));
|
|
52122
52195
|
}
|
|
52123
52196
|
for (const [feature, featureArgs] of features.getEntries()) {
|
|
52124
52197
|
const callArgs = [];
|
|
@@ -52127,25 +52200,25 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52127
52200
|
callArgs.push(arg);
|
|
52128
52201
|
}
|
|
52129
52202
|
});
|
|
52130
|
-
featureExpressions.push(
|
|
52203
|
+
featureExpressions.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, feature, "@angular/router"), [], callArgs));
|
|
52131
52204
|
}
|
|
52132
52205
|
return featureExpressions;
|
|
52133
52206
|
}
|
|
52134
52207
|
function addNodesToCopy(targetFile, rootNode, nodeLookup, tracker, nodesToCopy, referenceResolver) {
|
|
52135
52208
|
const refs = findAllSameFileReferences(rootNode, nodeLookup, referenceResolver);
|
|
52136
52209
|
for (const ref of refs) {
|
|
52137
|
-
const importSpecifier = closestOrSelf(ref,
|
|
52138
|
-
const importDeclaration = importSpecifier ? closestNode(importSpecifier,
|
|
52139
|
-
if (importDeclaration && importSpecifier &&
|
|
52210
|
+
const importSpecifier = closestOrSelf(ref, import_typescript130.default.isImportSpecifier);
|
|
52211
|
+
const importDeclaration = importSpecifier ? closestNode(importSpecifier, import_typescript130.default.isImportDeclaration) : null;
|
|
52212
|
+
if (importDeclaration && importSpecifier && import_typescript130.default.isStringLiteralLike(importDeclaration.moduleSpecifier)) {
|
|
52140
52213
|
const moduleName = importDeclaration.moduleSpecifier.text.startsWith(".") ? remapRelativeImport(targetFile.fileName, importDeclaration.moduleSpecifier) : importDeclaration.moduleSpecifier.text;
|
|
52141
52214
|
const symbolName = importSpecifier.propertyName ? importSpecifier.propertyName.text : importSpecifier.name.text;
|
|
52142
52215
|
const alias = importSpecifier.propertyName ? importSpecifier.name.text : null;
|
|
52143
52216
|
tracker.addImport(targetFile, symbolName, moduleName, alias);
|
|
52144
52217
|
continue;
|
|
52145
52218
|
}
|
|
52146
|
-
const variableDeclaration = closestOrSelf(ref,
|
|
52147
|
-
const variableStatement = variableDeclaration ? closestNode(variableDeclaration,
|
|
52148
|
-
if (variableDeclaration && variableStatement &&
|
|
52219
|
+
const variableDeclaration = closestOrSelf(ref, import_typescript130.default.isVariableDeclaration);
|
|
52220
|
+
const variableStatement = variableDeclaration ? closestNode(variableDeclaration, import_typescript130.default.isVariableStatement) : null;
|
|
52221
|
+
if (variableDeclaration && variableStatement && import_typescript130.default.isIdentifier(variableDeclaration.name)) {
|
|
52149
52222
|
if (isExported(variableStatement)) {
|
|
52150
52223
|
tracker.addImport(targetFile, variableDeclaration.name.text, getRelativeImportPath(targetFile.fileName, ref.getSourceFile().fileName));
|
|
52151
52224
|
} else {
|
|
@@ -52186,7 +52259,7 @@ function findAllSameFileReferences(rootNode, nodeLookup, referenceResolver) {
|
|
|
52186
52259
|
if (!closestTopLevel || traversedTopLevelNodes.has(closestTopLevel)) {
|
|
52187
52260
|
continue;
|
|
52188
52261
|
}
|
|
52189
|
-
if (!
|
|
52262
|
+
if (!import_typescript130.default.isImportDeclaration(closestTopLevel) && isOutsideRange(excludeStart, excludeEnd, closestTopLevel.getStart(), closestTopLevel.getEnd())) {
|
|
52190
52263
|
traversedTopLevelNodes.add(closestTopLevel);
|
|
52191
52264
|
walk(closestTopLevel);
|
|
52192
52265
|
}
|
|
@@ -52207,25 +52280,25 @@ function referencesToNodeWithinSameFile(node, nodeLookup, excludeStart, excludeE
|
|
|
52207
52280
|
function remapDynamicImports(targetFileName, rootNode) {
|
|
52208
52281
|
let hasChanged = false;
|
|
52209
52282
|
const transformer = (context) => {
|
|
52210
|
-
return (sourceFile) =>
|
|
52211
|
-
if (
|
|
52283
|
+
return (sourceFile) => import_typescript130.default.visitNode(sourceFile, function walk(node) {
|
|
52284
|
+
if (import_typescript130.default.isCallExpression(node) && node.expression.kind === import_typescript130.default.SyntaxKind.ImportKeyword && node.arguments.length > 0 && import_typescript130.default.isStringLiteralLike(node.arguments[0]) && node.arguments[0].text.startsWith(".")) {
|
|
52212
52285
|
hasChanged = true;
|
|
52213
52286
|
return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [
|
|
52214
52287
|
context.factory.createStringLiteral(remapRelativeImport(targetFileName, node.arguments[0])),
|
|
52215
52288
|
...node.arguments.slice(1)
|
|
52216
52289
|
]);
|
|
52217
52290
|
}
|
|
52218
|
-
return
|
|
52291
|
+
return import_typescript130.default.visitEachChild(node, walk, context);
|
|
52219
52292
|
});
|
|
52220
52293
|
};
|
|
52221
|
-
const result =
|
|
52294
|
+
const result = import_typescript130.default.transform(rootNode, [transformer]).transformed[0];
|
|
52222
52295
|
return hasChanged ? result : rootNode;
|
|
52223
52296
|
}
|
|
52224
52297
|
function isTopLevelStatement(node) {
|
|
52225
|
-
return node.parent != null &&
|
|
52298
|
+
return node.parent != null && import_typescript130.default.isSourceFile(node.parent);
|
|
52226
52299
|
}
|
|
52227
52300
|
function isReferenceIdentifier(node) {
|
|
52228
|
-
return
|
|
52301
|
+
return import_typescript130.default.isIdentifier(node) && (!import_typescript130.default.isPropertyAssignment(node.parent) && !import_typescript130.default.isParameter(node.parent) || node.parent.name !== node);
|
|
52229
52302
|
}
|
|
52230
52303
|
function isOutsideRange(excludeStart, excludeEnd, start, end) {
|
|
52231
52304
|
return start < excludeStart && end < excludeStart || start > excludeEnd;
|
|
@@ -52234,15 +52307,15 @@ function remapRelativeImport(targetFileName, specifier) {
|
|
|
52234
52307
|
return getRelativeImportPath(targetFileName, (0, import_path7.join)((0, import_path7.dirname)(specifier.getSourceFile().fileName), specifier.text));
|
|
52235
52308
|
}
|
|
52236
52309
|
function isExported(node) {
|
|
52237
|
-
return
|
|
52310
|
+
return import_typescript130.default.canHaveModifiers(node) && node.modifiers ? node.modifiers.some((modifier) => modifier.kind === import_typescript130.default.SyntaxKind.ExportKeyword) : false;
|
|
52238
52311
|
}
|
|
52239
52312
|
function isExportableDeclaration(node) {
|
|
52240
|
-
return
|
|
52313
|
+
return import_typescript130.default.isEnumDeclaration(node) || import_typescript130.default.isClassDeclaration(node) || import_typescript130.default.isFunctionDeclaration(node) || import_typescript130.default.isInterfaceDeclaration(node) || import_typescript130.default.isTypeAliasDeclaration(node);
|
|
52241
52314
|
}
|
|
52242
52315
|
function getLastImportEnd(sourceFile) {
|
|
52243
52316
|
let index = 0;
|
|
52244
52317
|
for (const statement of sourceFile.statements) {
|
|
52245
|
-
if (
|
|
52318
|
+
if (import_typescript130.default.isImportDeclaration(statement)) {
|
|
52246
52319
|
index = Math.max(index, statement.getEnd());
|
|
52247
52320
|
} else {
|
|
52248
52321
|
break;
|
|
@@ -52259,7 +52332,7 @@ function hasImport(program, rootFileNames, moduleName) {
|
|
|
52259
52332
|
continue;
|
|
52260
52333
|
}
|
|
52261
52334
|
for (const statement of sourceFile.statements) {
|
|
52262
|
-
if (
|
|
52335
|
+
if (import_typescript130.default.isImportDeclaration(statement) && import_typescript130.default.isStringLiteralLike(statement.moduleSpecifier) && (statement.moduleSpecifier.text === moduleName || statement.moduleSpecifier.text.startsWith(deepImportStart))) {
|
|
52263
52336
|
return true;
|
|
52264
52337
|
}
|
|
52265
52338
|
}
|
|
@@ -52307,7 +52380,7 @@ function standaloneMigration(tree, tsconfigPath, basePath, pathToMigrate, schema
|
|
|
52307
52380
|
});
|
|
52308
52381
|
const referenceLookupExcludedFiles = /node_modules|\.ngtypecheck\.ts/;
|
|
52309
52382
|
const program = createProgram({ rootNames, host, options, oldProgram });
|
|
52310
|
-
const printer =
|
|
52383
|
+
const printer = import_typescript131.default.createPrinter();
|
|
52311
52384
|
if ((0, import_fs2.existsSync)(pathToMigrate) && !(0, import_fs2.statSync)(pathToMigrate).isDirectory()) {
|
|
52312
52385
|
throw new import_schematics.SchematicsException(`Migration path ${pathToMigrate} has to be a directory. Cannot run the standalone migration.`);
|
|
52313
52386
|
}
|