@angular/core 17.3.0-rc.0 → 17.3.1
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/src/application/application_ref.mjs +14 -11
- package/esm2022/src/authoring/input/input.mjs +4 -1
- package/esm2022/src/authoring/output/output.mjs +2 -2
- package/esm2022/src/authoring/output/output_emitter_ref.mjs +14 -3
- package/esm2022/src/authoring/queries.mjs +7 -1
- 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 +2 -3
- package/esm2022/src/defer/instructions.mjs +2 -2
- package/esm2022/src/di/contextual.mjs +9 -3
- package/esm2022/src/event_emitter.mjs +6 -7
- package/esm2022/src/hydration/annotate.mjs +4 -2
- package/esm2022/src/hydration/api.mjs +27 -2
- package/esm2022/src/hydration/cleanup.mjs +18 -2
- package/esm2022/src/hydration/error_handling.mjs +6 -3
- 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/hydration/utils.mjs +5 -4
- package/esm2022/src/i18n/utils.mjs +16 -0
- package/esm2022/src/linker/template_ref.mjs +2 -2
- package/esm2022/src/render3/after_render_hooks.mjs +11 -8
- package/esm2022/src/render3/component_ref.mjs +1 -1
- 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/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/node_manipulation.mjs +6 -2
- package/esm2022/src/render3/node_selector_matcher.mjs +37 -51
- package/esm2022/src/render3/queue_state_update.mjs +2 -4
- package/esm2022/src/render3/util/view_utils.mjs +2 -1
- package/esm2022/src/render3/view_manipulation.mjs +2 -2
- package/esm2022/src/sanitization/html_sanitizer.mjs +54 -14
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/component_fixture.mjs +11 -66
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +1460 -1264
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +11 -66
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +96 -12
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +14 -2
- package/schematics/migrations/block-template-entities/bundle.js.map +2 -2
- package/schematics/migrations/invalid-two-way-bindings/bundle.js +14 -2
- package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +2 -2
- package/schematics/ng-generate/control-flow-migration/bundle.js +14 -2
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +2 -2
- package/schematics/ng-generate/standalone-migration/bundle.js +386 -299
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
- package/esm2022/src/is_internal.mjs +0 -15
|
@@ -22043,10 +22043,13 @@ function transformTwoWayBindingSet(job) {
|
|
|
22043
22043
|
}
|
|
22044
22044
|
}
|
|
22045
22045
|
function wrapSetOperation(target, value) {
|
|
22046
|
+
if (target instanceof ReadVariableExpr) {
|
|
22047
|
+
return twoWayBindingSet(target, value);
|
|
22048
|
+
}
|
|
22046
22049
|
return twoWayBindingSet(target, value).or(target.set(value));
|
|
22047
22050
|
}
|
|
22048
22051
|
function isReadExpression2(value) {
|
|
22049
|
-
return value instanceof ReadPropExpr || value instanceof ReadKeyExpr;
|
|
22052
|
+
return value instanceof ReadPropExpr || value instanceof ReadKeyExpr || value instanceof ReadVariableExpr;
|
|
22050
22053
|
}
|
|
22051
22054
|
function wrapAction(target, value) {
|
|
22052
22055
|
if (isReadExpression2(target)) {
|
|
@@ -23604,6 +23607,12 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
23604
23607
|
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
|
|
23605
23608
|
unit.update.push(createBindingOp(xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
|
|
23606
23609
|
}
|
|
23610
|
+
for (const attr of root.inputs) {
|
|
23611
|
+
if (attr.type !== 4 && attr.type !== 1) {
|
|
23612
|
+
const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true);
|
|
23613
|
+
unit.create.push(createExtractedAttributeOp(xref, BindingKind.Property, null, attr.name, null, null, null, securityContext));
|
|
23614
|
+
}
|
|
23615
|
+
}
|
|
23607
23616
|
const tagName = root instanceof Element ? root.name : root.tagName;
|
|
23608
23617
|
return tagName === NG_TEMPLATE_TAG_NAME ? null : tagName;
|
|
23609
23618
|
}
|
|
@@ -24248,6 +24257,9 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
24248
24257
|
errors.push(new ParseError(param.sourceSpan, '@for loop can only have one "track" expression'));
|
|
24249
24258
|
} else {
|
|
24250
24259
|
const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
|
|
24260
|
+
if (expression.ast instanceof EmptyExpr) {
|
|
24261
|
+
errors.push(new ParseError(param.sourceSpan, '@for loop must have a "track" expression'));
|
|
24262
|
+
}
|
|
24251
24263
|
const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy("track".length));
|
|
24252
24264
|
result.trackBy = { expression, keywordSpan };
|
|
24253
24265
|
}
|
|
@@ -29329,7 +29341,7 @@ function publishFacade(global) {
|
|
|
29329
29341
|
}
|
|
29330
29342
|
|
|
29331
29343
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
29332
|
-
var VERSION2 = new Version("17.3.
|
|
29344
|
+
var VERSION2 = new Version("17.3.1");
|
|
29333
29345
|
|
|
29334
29346
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
29335
29347
|
var _I18N_ATTR = "i18n";
|
|
@@ -30395,7 +30407,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
30395
30407
|
function compileDeclareClassMetadata(metadata) {
|
|
30396
30408
|
const definitionMap = new DefinitionMap();
|
|
30397
30409
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
30398
|
-
definitionMap.set("version", literal("17.3.
|
|
30410
|
+
definitionMap.set("version", literal("17.3.1"));
|
|
30399
30411
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30400
30412
|
definitionMap.set("type", metadata.type);
|
|
30401
30413
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -30464,7 +30476,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30464
30476
|
const definitionMap = new DefinitionMap();
|
|
30465
30477
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30466
30478
|
definitionMap.set("minVersion", literal(minVersion));
|
|
30467
|
-
definitionMap.set("version", literal("17.3.
|
|
30479
|
+
definitionMap.set("version", literal("17.3.1"));
|
|
30468
30480
|
definitionMap.set("type", meta.type.value);
|
|
30469
30481
|
if (meta.isStandalone) {
|
|
30470
30482
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -30763,7 +30775,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
|
|
|
30763
30775
|
function compileDeclareFactoryFunction(meta) {
|
|
30764
30776
|
const definitionMap = new DefinitionMap();
|
|
30765
30777
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
30766
|
-
definitionMap.set("version", literal("17.3.
|
|
30778
|
+
definitionMap.set("version", literal("17.3.1"));
|
|
30767
30779
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30768
30780
|
definitionMap.set("type", meta.type.value);
|
|
30769
30781
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -30786,7 +30798,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
30786
30798
|
function createInjectableDefinitionMap(meta) {
|
|
30787
30799
|
const definitionMap = new DefinitionMap();
|
|
30788
30800
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
30789
|
-
definitionMap.set("version", literal("17.3.
|
|
30801
|
+
definitionMap.set("version", literal("17.3.1"));
|
|
30790
30802
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30791
30803
|
definitionMap.set("type", meta.type.value);
|
|
30792
30804
|
if (meta.providedIn !== void 0) {
|
|
@@ -30824,7 +30836,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
30824
30836
|
function createInjectorDefinitionMap(meta) {
|
|
30825
30837
|
const definitionMap = new DefinitionMap();
|
|
30826
30838
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
30827
|
-
definitionMap.set("version", literal("17.3.
|
|
30839
|
+
definitionMap.set("version", literal("17.3.1"));
|
|
30828
30840
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30829
30841
|
definitionMap.set("type", meta.type.value);
|
|
30830
30842
|
definitionMap.set("providers", meta.providers);
|
|
@@ -30848,7 +30860,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
30848
30860
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
30849
30861
|
}
|
|
30850
30862
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
30851
|
-
definitionMap.set("version", literal("17.3.
|
|
30863
|
+
definitionMap.set("version", literal("17.3.1"));
|
|
30852
30864
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30853
30865
|
definitionMap.set("type", meta.type.value);
|
|
30854
30866
|
if (meta.bootstrap.length > 0) {
|
|
@@ -30883,7 +30895,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
30883
30895
|
function createPipeDefinitionMap(meta) {
|
|
30884
30896
|
const definitionMap = new DefinitionMap();
|
|
30885
30897
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
30886
|
-
definitionMap.set("version", literal("17.3.
|
|
30898
|
+
definitionMap.set("version", literal("17.3.1"));
|
|
30887
30899
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
30888
30900
|
definitionMap.set("type", meta.type.value);
|
|
30889
30901
|
if (meta.isStandalone) {
|
|
@@ -30900,7 +30912,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
30900
30912
|
publishFacade(_global);
|
|
30901
30913
|
|
|
30902
30914
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
30903
|
-
var VERSION3 = new Version("17.3.
|
|
30915
|
+
var VERSION3 = new Version("17.3.1");
|
|
30904
30916
|
|
|
30905
30917
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/emitter.mjs
|
|
30906
30918
|
var import_typescript5 = __toESM(require("typescript"), 1);
|
|
@@ -33362,7 +33374,7 @@ var DtsMetadataReader = class {
|
|
|
33362
33374
|
const inputs = ClassPropertyMapping.fromMappedObject(readInputsType(def.type.typeArguments[3]));
|
|
33363
33375
|
const outputs = ClassPropertyMapping.fromMappedObject(readMapType(def.type.typeArguments[4], readStringType));
|
|
33364
33376
|
const hostDirectives = def.type.typeArguments.length > 8 ? readHostDirectivesType(this.checker, def.type.typeArguments[8], ref.bestGuessOwningModule) : null;
|
|
33365
|
-
const
|
|
33377
|
+
const isSignal = def.type.typeArguments.length > 9 && ((_b2 = readBooleanType(def.type.typeArguments[9])) != null ? _b2 : false);
|
|
33366
33378
|
return __spreadProps(__spreadValues({
|
|
33367
33379
|
kind: MetaKind.Directive,
|
|
33368
33380
|
matchSource: MatchSource.Selector,
|
|
@@ -33382,7 +33394,7 @@ var DtsMetadataReader = class {
|
|
|
33382
33394
|
animationTriggerNames: null,
|
|
33383
33395
|
ngContentSelectors,
|
|
33384
33396
|
isStandalone,
|
|
33385
|
-
isSignal
|
|
33397
|
+
isSignal,
|
|
33386
33398
|
imports: null,
|
|
33387
33399
|
deferredImports: null,
|
|
33388
33400
|
schemas: null,
|
|
@@ -35298,7 +35310,7 @@ var TraitCompiler = class {
|
|
|
35298
35310
|
}
|
|
35299
35311
|
}
|
|
35300
35312
|
}
|
|
35301
|
-
|
|
35313
|
+
runAdditionalChecks(sf, check) {
|
|
35302
35314
|
if (this.compilationMode === CompilationMode.LOCAL) {
|
|
35303
35315
|
return [];
|
|
35304
35316
|
}
|
|
@@ -35313,10 +35325,10 @@ var TraitCompiler = class {
|
|
|
35313
35325
|
}
|
|
35314
35326
|
const record = this.classes.get(clazz);
|
|
35315
35327
|
for (const trait of record.traits) {
|
|
35316
|
-
|
|
35317
|
-
|
|
35328
|
+
const result = check(clazz, trait.handler);
|
|
35329
|
+
if (result !== null) {
|
|
35330
|
+
diagnostics.push(...result);
|
|
35318
35331
|
}
|
|
35319
|
-
diagnostics.push(...trait.handler.extendedTemplateCheck(clazz, extendedTemplateChecker));
|
|
35320
35332
|
}
|
|
35321
35333
|
}
|
|
35322
35334
|
return diagnostics;
|
|
@@ -38291,14 +38303,14 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
38291
38303
|
}
|
|
38292
38304
|
isStandalone = resolved;
|
|
38293
38305
|
}
|
|
38294
|
-
let
|
|
38306
|
+
let isSignal = false;
|
|
38295
38307
|
if (directive.has("signals")) {
|
|
38296
38308
|
const expr = directive.get("signals");
|
|
38297
38309
|
const resolved = evaluator.evaluate(expr);
|
|
38298
38310
|
if (typeof resolved !== "boolean") {
|
|
38299
38311
|
throw createValueHasWrongTypeError(expr, resolved, `signals flag must be a boolean`);
|
|
38300
38312
|
}
|
|
38301
|
-
|
|
38313
|
+
isSignal = resolved;
|
|
38302
38314
|
}
|
|
38303
38315
|
const usesInheritance = reflector.hasBaseClass(clazz);
|
|
38304
38316
|
const sourceFile = clazz.getSourceFile();
|
|
@@ -38335,7 +38347,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
|
|
|
38335
38347
|
exportAs,
|
|
38336
38348
|
providers,
|
|
38337
38349
|
isStandalone,
|
|
38338
|
-
isSignal
|
|
38350
|
+
isSignal,
|
|
38339
38351
|
hostDirectives: (hostDirectives == null ? void 0 : hostDirectives.map((hostDir) => toHostDirectiveMetadata(hostDir, sourceFile, refEmitter))) || null
|
|
38340
38352
|
};
|
|
38341
38353
|
return {
|
|
@@ -40882,6 +40894,9 @@ var ComponentDecoratorHandler = class {
|
|
|
40882
40894
|
extendedTemplateCheck(component, extendedTemplateChecker) {
|
|
40883
40895
|
return extendedTemplateChecker.getDiagnosticsForComponent(component);
|
|
40884
40896
|
}
|
|
40897
|
+
templateSemanticsCheck(component, templateSemanticsChecker) {
|
|
40898
|
+
return templateSemanticsChecker.getDiagnosticsForComponent(component);
|
|
40899
|
+
}
|
|
40885
40900
|
resolve(node, analysis, symbol) {
|
|
40886
40901
|
const metadata = analysis.meta;
|
|
40887
40902
|
const diagnostics = [];
|
|
@@ -41844,7 +41859,7 @@ var EmitFlags;
|
|
|
41844
41859
|
var import_typescript67 = __toESM(require("typescript"), 1);
|
|
41845
41860
|
|
|
41846
41861
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
|
|
41847
|
-
var
|
|
41862
|
+
var import_typescript116 = __toESM(require("typescript"), 1);
|
|
41848
41863
|
|
|
41849
41864
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/i18n.mjs
|
|
41850
41865
|
var path2 = __toESM(require("path"), 1);
|
|
@@ -41948,7 +41963,7 @@ function verifySupportedTypeScriptVersion() {
|
|
|
41948
41963
|
}
|
|
41949
41964
|
|
|
41950
41965
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/compiler.mjs
|
|
41951
|
-
var
|
|
41966
|
+
var import_typescript112 = __toESM(require("typescript"), 1);
|
|
41952
41967
|
|
|
41953
41968
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/cycles/src/analyzer.mjs
|
|
41954
41969
|
var CycleAnalyzer = class {
|
|
@@ -45126,8 +45141,8 @@ function constructTypeCtorParameter(env, meta, rawType) {
|
|
|
45126
45141
|
const plainKeys = [];
|
|
45127
45142
|
const coercedKeys = [];
|
|
45128
45143
|
const signalInputKeys = [];
|
|
45129
|
-
for (const { classPropertyName, transform: transform2, isSignal
|
|
45130
|
-
if (
|
|
45144
|
+
for (const { classPropertyName, transform: transform2, isSignal } of meta.fields.inputs) {
|
|
45145
|
+
if (isSignal) {
|
|
45131
45146
|
signalInputKeys.push(import_typescript95.default.factory.createLiteralTypeNode(import_typescript95.default.factory.createStringLiteral(classPropertyName)));
|
|
45132
45147
|
} else if (!meta.coercedInputFields.has(classPropertyName)) {
|
|
45133
45148
|
plainKeys.push(import_typescript95.default.factory.createLiteralTypeNode(import_typescript95.default.factory.createStringLiteral(classPropertyName)));
|
|
@@ -45317,21 +45332,6 @@ var OutOfBandDiagnosticRecorderImpl = class {
|
|
|
45317
45332
|
}
|
|
45318
45333
|
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, import_typescript97.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFERRED_DIRECTIVE_USED_EAGERLY), errorMsg));
|
|
45319
45334
|
}
|
|
45320
|
-
illegalAssignmentToTemplateVar(templateId, assignment, target) {
|
|
45321
|
-
var _a2, _b2;
|
|
45322
|
-
const mapping = this.resolver.getSourceMapping(templateId);
|
|
45323
|
-
const errorMsg = `Cannot use variable '${assignment.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
|
|
45324
|
-
const sourceSpan = this.resolver.toParseSourceSpan(templateId, assignment.sourceSpan);
|
|
45325
|
-
if (sourceSpan === null) {
|
|
45326
|
-
throw new Error(`Assertion failure: no SourceLocation found for property binding.`);
|
|
45327
|
-
}
|
|
45328
|
-
this._diagnostics.push(makeTemplateDiagnostic(templateId, mapping, sourceSpan, import_typescript97.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMsg, [{
|
|
45329
|
-
text: `The variable ${assignment.name} is declared here.`,
|
|
45330
|
-
start: ((_a2 = target.valueSpan) == null ? void 0 : _a2.start.offset) || target.sourceSpan.start.offset,
|
|
45331
|
-
end: ((_b2 = target.valueSpan) == null ? void 0 : _b2.end.offset) || target.sourceSpan.end.offset,
|
|
45332
|
-
sourceFile: mapping.node.getSourceFile()
|
|
45333
|
-
}]));
|
|
45334
|
-
}
|
|
45335
45335
|
duplicateTemplateVar(templateId, variable2, firstDecl) {
|
|
45336
45336
|
const mapping = this.resolver.getSourceMapping(templateId);
|
|
45337
45337
|
const errorMsg = `Cannot redeclare variable '${variable2.name}' as it was previously declared elsewhere for the same template.`;
|
|
@@ -45861,29 +45861,6 @@ var VeSafeLhsInferenceBugDetector = _VeSafeLhsInferenceBugDetector;
|
|
|
45861
45861
|
_VeSafeLhsInferenceBugDetector.SINGLETON = new _VeSafeLhsInferenceBugDetector();
|
|
45862
45862
|
})();
|
|
45863
45863
|
|
|
45864
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/template_semantics.mjs
|
|
45865
|
-
var ExpressionSemanticVisitor = class extends RecursiveAstVisitor2 {
|
|
45866
|
-
constructor(templateId, boundTarget, oob) {
|
|
45867
|
-
super();
|
|
45868
|
-
this.templateId = templateId;
|
|
45869
|
-
this.boundTarget = boundTarget;
|
|
45870
|
-
this.oob = oob;
|
|
45871
|
-
}
|
|
45872
|
-
visitPropertyWrite(ast, context) {
|
|
45873
|
-
super.visitPropertyWrite(ast, context);
|
|
45874
|
-
if (!(ast.receiver instanceof ImplicitReceiver)) {
|
|
45875
|
-
return;
|
|
45876
|
-
}
|
|
45877
|
-
const target = this.boundTarget.getExpressionTarget(ast);
|
|
45878
|
-
if (target instanceof Variable) {
|
|
45879
|
-
this.oob.illegalAssignmentToTemplateVar(this.templateId, ast, target);
|
|
45880
|
-
}
|
|
45881
|
-
}
|
|
45882
|
-
static visit(ast, id, boundTarget, oob) {
|
|
45883
|
-
ast.visit(new ExpressionSemanticVisitor(id, boundTarget, oob));
|
|
45884
|
-
}
|
|
45885
|
-
};
|
|
45886
|
-
|
|
45887
45864
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/type_check_block.mjs
|
|
45888
45865
|
var TcbGenericContextBehavior;
|
|
45889
45866
|
(function(TcbGenericContextBehavior2) {
|
|
@@ -46239,7 +46216,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
46239
46216
|
for (const attr of boundAttrs) {
|
|
46240
46217
|
const expr = widenBinding(translateInput(attr.attribute, this.tcb, this.scope), this.tcb);
|
|
46241
46218
|
let assignment = wrapForDiagnostics(expr);
|
|
46242
|
-
for (const { fieldName, required, transformType, isSignal
|
|
46219
|
+
for (const { fieldName, required, transformType, isSignal, isTwoWayBinding } of attr.inputs) {
|
|
46243
46220
|
let target;
|
|
46244
46221
|
if (required) {
|
|
46245
46222
|
seenRequiredInputs.add(fieldName);
|
|
@@ -46279,7 +46256,7 @@ var TcbDirectiveInputsOp = class extends TcbOp {
|
|
|
46279
46256
|
}
|
|
46280
46257
|
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));
|
|
46281
46258
|
}
|
|
46282
|
-
if (
|
|
46259
|
+
if (isSignal) {
|
|
46283
46260
|
const inputSignalBrandWriteSymbol = this.tcb.env.referenceExternalSymbol(Identifiers.InputSignalBrandWriteType.moduleName, Identifiers.InputSignalBrandWriteType.name);
|
|
46284
46261
|
if (!import_typescript101.default.isIdentifier(inputSignalBrandWriteSymbol) && !import_typescript101.default.isPropertyAccessExpression(inputSignalBrandWriteSymbol)) {
|
|
46285
46262
|
throw new Error(`Expected identifier or property access for reference to ${Identifiers.InputSignalBrandWriteType.name}`);
|
|
@@ -46523,7 +46500,6 @@ var TcbDirectiveOutputsOp = class extends TcbOp {
|
|
|
46523
46500
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
46524
46501
|
this.scope.addStatement(import_typescript101.default.factory.createExpressionStatement(handler));
|
|
46525
46502
|
}
|
|
46526
|
-
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
46527
46503
|
}
|
|
46528
46504
|
return null;
|
|
46529
46505
|
}
|
|
@@ -46573,7 +46549,6 @@ var TcbUnclaimedOutputsOp = class extends TcbOp {
|
|
|
46573
46549
|
const handler = tcbCreateEventHandler(output, this.tcb, this.scope, 1);
|
|
46574
46550
|
this.scope.addStatement(import_typescript101.default.factory.createExpressionStatement(handler));
|
|
46575
46551
|
}
|
|
46576
|
-
ExpressionSemanticVisitor.visit(output.handler, this.tcb.id, this.tcb.boundTarget, this.tcb.oobRecorder);
|
|
46577
46552
|
}
|
|
46578
46553
|
return null;
|
|
46579
46554
|
}
|
|
@@ -48493,6 +48468,10 @@ var TemplateTypeCheckerImpl = class {
|
|
|
48493
48468
|
fileData.isComplete = false;
|
|
48494
48469
|
this.isComplete = false;
|
|
48495
48470
|
}
|
|
48471
|
+
getExpressionTarget(expression, clazz) {
|
|
48472
|
+
var _a2;
|
|
48473
|
+
return ((_a2 = this.getLatestComponentState(clazz).data) == null ? void 0 : _a2.boundTarget.getExpressionTarget(expression)) || null;
|
|
48474
|
+
}
|
|
48496
48475
|
makeTemplateDiagnostic(clazz, sourceSpan, category, errorCode, message, relatedInformation) {
|
|
48497
48476
|
const sfPath = absoluteFromSourceFile(clazz.getSourceFile());
|
|
48498
48477
|
const fileRecord = this.state.get(sfPath);
|
|
@@ -48978,8 +48957,25 @@ var SingleShimTypeCheckingHost = class extends SingleFileTypeCheckingHost {
|
|
|
48978
48957
|
}
|
|
48979
48958
|
};
|
|
48980
48959
|
|
|
48981
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/
|
|
48960
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/src/symbol_util.mjs
|
|
48982
48961
|
var import_typescript107 = __toESM(require("typescript"), 1);
|
|
48962
|
+
var SIGNAL_FNS = /* @__PURE__ */ new Set([
|
|
48963
|
+
"WritableSignal",
|
|
48964
|
+
"Signal",
|
|
48965
|
+
"InputSignal",
|
|
48966
|
+
"InputSignalWithTransform",
|
|
48967
|
+
"ModelSignal"
|
|
48968
|
+
]);
|
|
48969
|
+
function isSignalReference(symbol) {
|
|
48970
|
+
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));
|
|
48971
|
+
}
|
|
48972
|
+
function isSignalSymbol(symbol) {
|
|
48973
|
+
const declarations = symbol.getDeclarations();
|
|
48974
|
+
return declarations !== void 0 && declarations.some((decl) => {
|
|
48975
|
+
const fileName = decl.getSourceFile().fileName;
|
|
48976
|
+
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"));
|
|
48977
|
+
});
|
|
48978
|
+
}
|
|
48983
48979
|
|
|
48984
48980
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/api/api.mjs
|
|
48985
48981
|
var TemplateCheckWithVisitor = class {
|
|
@@ -49105,13 +49101,6 @@ var TemplateVisitor2 = class extends RecursiveAstVisitor2 {
|
|
|
49105
49101
|
};
|
|
49106
49102
|
|
|
49107
49103
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/extended/checks/interpolated_signal_not_invoked/index.mjs
|
|
49108
|
-
var SIGNAL_FNS = /* @__PURE__ */ new Set([
|
|
49109
|
-
"WritableSignal",
|
|
49110
|
-
"Signal",
|
|
49111
|
-
"InputSignal",
|
|
49112
|
-
"InputSignalWithTransform",
|
|
49113
|
-
"ModelSignal"
|
|
49114
|
-
]);
|
|
49115
49104
|
var SIGNAL_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["set", "update", "asReadonly"]);
|
|
49116
49105
|
var FUNCTION_INSTANCE_PROPERTIES = /* @__PURE__ */ new Set(["name", "length", "prototype"]);
|
|
49117
49106
|
var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
@@ -49126,13 +49115,6 @@ var InterpolatedSignalCheck = class extends TemplateCheckWithVisitor {
|
|
|
49126
49115
|
return [];
|
|
49127
49116
|
}
|
|
49128
49117
|
};
|
|
49129
|
-
function isSignal(symbol) {
|
|
49130
|
-
const declarations = symbol == null ? void 0 : symbol.getDeclarations();
|
|
49131
|
-
return declarations !== void 0 && declarations.some((decl) => {
|
|
49132
|
-
const fileName = decl.getSourceFile().fileName;
|
|
49133
|
-
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"));
|
|
49134
|
-
});
|
|
49135
|
-
}
|
|
49136
49118
|
function isFunctionInstanceProperty(name) {
|
|
49137
49119
|
return FUNCTION_INSTANCE_PROPERTIES.has(name);
|
|
49138
49120
|
}
|
|
@@ -49141,14 +49123,14 @@ function isSignalInstanceProperty(name) {
|
|
|
49141
49123
|
}
|
|
49142
49124
|
function buildDiagnosticForSignal(ctx, node, component) {
|
|
49143
49125
|
const symbol = ctx.templateTypeChecker.getSymbolOfNode(node, component);
|
|
49144
|
-
if (
|
|
49126
|
+
if (symbol !== null && symbol.kind === SymbolKind.Expression && isSignalReference(symbol)) {
|
|
49145
49127
|
const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbol.tcbLocation);
|
|
49146
49128
|
const errorString = `${node.name} is a function and should be invoked: ${node.name}()`;
|
|
49147
49129
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
49148
49130
|
return [diagnostic];
|
|
49149
49131
|
}
|
|
49150
49132
|
const symbolOfReceiver = ctx.templateTypeChecker.getSymbolOfNode(node.receiver, component);
|
|
49151
|
-
if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) &&
|
|
49133
|
+
if ((isFunctionInstanceProperty(node.name) || isSignalInstanceProperty(node.name)) && symbolOfReceiver !== null && symbolOfReceiver.kind === SymbolKind.Expression && isSignalReference(symbolOfReceiver)) {
|
|
49152
49134
|
const templateMapping = ctx.templateTypeChecker.getTemplateMappingAtTcbLocation(symbolOfReceiver.tcbLocation);
|
|
49153
49135
|
const errorString = `${node.receiver.name} is a function and should be invoked: ${node.receiver.name}()`;
|
|
49154
49136
|
const diagnostic = ctx.makeTemplateDiagnostic(templateMapping.span, errorString);
|
|
@@ -49492,6 +49474,106 @@ var SUPPORTED_DIAGNOSTIC_NAMES = /* @__PURE__ */ new Set([
|
|
|
49492
49474
|
...ALL_DIAGNOSTIC_FACTORIES.map((factory9) => factory9.name)
|
|
49493
49475
|
]);
|
|
49494
49476
|
|
|
49477
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/typecheck/template_semantics/src/template_semantics_checker.mjs
|
|
49478
|
+
var import_typescript111 = __toESM(require("typescript"), 1);
|
|
49479
|
+
var TemplateSemanticsCheckerImpl = class {
|
|
49480
|
+
constructor(templateTypeChecker) {
|
|
49481
|
+
this.templateTypeChecker = templateTypeChecker;
|
|
49482
|
+
}
|
|
49483
|
+
getDiagnosticsForComponent(component) {
|
|
49484
|
+
const template2 = this.templateTypeChecker.getTemplate(component);
|
|
49485
|
+
return template2 !== null ? TemplateSemanticsVisitor.visit(template2, component, this.templateTypeChecker) : [];
|
|
49486
|
+
}
|
|
49487
|
+
};
|
|
49488
|
+
var TemplateSemanticsVisitor = class extends RecursiveVisitor {
|
|
49489
|
+
constructor(expressionVisitor) {
|
|
49490
|
+
super();
|
|
49491
|
+
this.expressionVisitor = expressionVisitor;
|
|
49492
|
+
}
|
|
49493
|
+
static visit(nodes, component, templateTypeChecker) {
|
|
49494
|
+
const diagnostics = [];
|
|
49495
|
+
const expressionVisitor = new ExpressionsSemanticsVisitor(templateTypeChecker, component, diagnostics);
|
|
49496
|
+
const templateVisitor = new TemplateSemanticsVisitor(expressionVisitor);
|
|
49497
|
+
nodes.forEach((node) => node.visit(templateVisitor));
|
|
49498
|
+
return diagnostics;
|
|
49499
|
+
}
|
|
49500
|
+
visitBoundEvent(event) {
|
|
49501
|
+
super.visitBoundEvent(event);
|
|
49502
|
+
event.handler.visit(this.expressionVisitor, event);
|
|
49503
|
+
}
|
|
49504
|
+
};
|
|
49505
|
+
var ExpressionsSemanticsVisitor = class extends RecursiveAstVisitor2 {
|
|
49506
|
+
constructor(templateTypeChecker, component, diagnostics) {
|
|
49507
|
+
super();
|
|
49508
|
+
this.templateTypeChecker = templateTypeChecker;
|
|
49509
|
+
this.component = component;
|
|
49510
|
+
this.diagnostics = diagnostics;
|
|
49511
|
+
}
|
|
49512
|
+
visitPropertyWrite(ast, context) {
|
|
49513
|
+
super.visitPropertyWrite(ast, context);
|
|
49514
|
+
this.checkForIllegalWriteInEventBinding(ast, context);
|
|
49515
|
+
}
|
|
49516
|
+
visitPropertyRead(ast, context) {
|
|
49517
|
+
super.visitPropertyRead(ast, context);
|
|
49518
|
+
this.checkForIllegalWriteInTwoWayBinding(ast, context);
|
|
49519
|
+
}
|
|
49520
|
+
checkForIllegalWriteInEventBinding(ast, context) {
|
|
49521
|
+
if (!(context instanceof BoundEvent) || !(ast.receiver instanceof ImplicitReceiver)) {
|
|
49522
|
+
return;
|
|
49523
|
+
}
|
|
49524
|
+
const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
|
|
49525
|
+
if (target instanceof Variable) {
|
|
49526
|
+
const errorMessage = `Cannot use variable '${target.name}' as the left-hand side of an assignment expression. Template variables are read-only.`;
|
|
49527
|
+
this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
|
|
49528
|
+
}
|
|
49529
|
+
}
|
|
49530
|
+
checkForIllegalWriteInTwoWayBinding(ast, context) {
|
|
49531
|
+
if (!(context instanceof BoundEvent) || context.type !== 2 || !(ast.receiver instanceof ImplicitReceiver) || ast !== unwrapAstWithSource(context.handler)) {
|
|
49532
|
+
return;
|
|
49533
|
+
}
|
|
49534
|
+
const target = this.templateTypeChecker.getExpressionTarget(ast, this.component);
|
|
49535
|
+
if (!(target instanceof Variable)) {
|
|
49536
|
+
return;
|
|
49537
|
+
}
|
|
49538
|
+
const symbol = this.templateTypeChecker.getSymbolOfNode(target, this.component);
|
|
49539
|
+
if (symbol !== null && !isSignalReference(symbol)) {
|
|
49540
|
+
const errorMessage = `Cannot use a non-signal variable '${target.name}' in a two-way binding expression. Template variables are read-only.`;
|
|
49541
|
+
this.diagnostics.push(this.makeIllegalTemplateVarDiagnostic(target, context, errorMessage));
|
|
49542
|
+
}
|
|
49543
|
+
}
|
|
49544
|
+
makeIllegalTemplateVarDiagnostic(target, expressionNode, errorMessage) {
|
|
49545
|
+
var _a2, _b2;
|
|
49546
|
+
return this.templateTypeChecker.makeTemplateDiagnostic(this.component, expressionNode.handlerSpan, import_typescript111.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.WRITE_TO_READ_ONLY_VARIABLE), errorMessage, [{
|
|
49547
|
+
text: `The variable ${target.name} is declared here.`,
|
|
49548
|
+
start: ((_a2 = target.valueSpan) == null ? void 0 : _a2.start.offset) || target.sourceSpan.start.offset,
|
|
49549
|
+
end: ((_b2 = target.valueSpan) == null ? void 0 : _b2.end.offset) || target.sourceSpan.end.offset,
|
|
49550
|
+
sourceFile: this.component.getSourceFile()
|
|
49551
|
+
}]);
|
|
49552
|
+
}
|
|
49553
|
+
};
|
|
49554
|
+
function unwrapAstWithSource(ast) {
|
|
49555
|
+
return ast instanceof ASTWithSource ? ast.ast : ast;
|
|
49556
|
+
}
|
|
49557
|
+
|
|
49558
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/core_version.mjs
|
|
49559
|
+
function coreHasSymbol(program, symbol) {
|
|
49560
|
+
const checker = program.getTypeChecker();
|
|
49561
|
+
for (const sf of program.getSourceFiles().filter(isMaybeCore)) {
|
|
49562
|
+
const sym = checker.getSymbolAtLocation(sf);
|
|
49563
|
+
if (sym === void 0 || sym.exports === void 0) {
|
|
49564
|
+
continue;
|
|
49565
|
+
}
|
|
49566
|
+
if (!sym.exports.has("\u0275\u0275template")) {
|
|
49567
|
+
continue;
|
|
49568
|
+
}
|
|
49569
|
+
return sym.exports.has(symbol.name);
|
|
49570
|
+
}
|
|
49571
|
+
return null;
|
|
49572
|
+
}
|
|
49573
|
+
function isMaybeCore(sf) {
|
|
49574
|
+
return sf.isDeclarationFile && sf.fileName.includes("@angular/core") && sf.fileName.endsWith("index.d.ts");
|
|
49575
|
+
}
|
|
49576
|
+
|
|
49495
49577
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/feature_detection.mjs
|
|
49496
49578
|
var import_semver = __toESM(require_semver2(), 1);
|
|
49497
49579
|
function coreVersionSupportsFeature(coreVersion, minVersion) {
|
|
@@ -49577,7 +49659,7 @@ var NgCompiler = class {
|
|
|
49577
49659
|
this.currentProgram = inputProgram;
|
|
49578
49660
|
this.closureCompilerEnabled = !!this.options.annotateForClosureCompiler;
|
|
49579
49661
|
this.entryPoint = adapter.entryPoint !== null ? getSourceFileOrNull(inputProgram, adapter.entryPoint) : null;
|
|
49580
|
-
const moduleResolutionCache =
|
|
49662
|
+
const moduleResolutionCache = import_typescript112.default.createModuleResolutionCache(
|
|
49581
49663
|
this.adapter.getCurrentDirectory(),
|
|
49582
49664
|
this.adapter.getCanonicalFileName.bind(this.adapter)
|
|
49583
49665
|
);
|
|
@@ -49621,7 +49703,7 @@ var NgCompiler = class {
|
|
|
49621
49703
|
}
|
|
49622
49704
|
for (const clazz of classesToUpdate) {
|
|
49623
49705
|
this.compilation.traitCompiler.updateResources(clazz);
|
|
49624
|
-
if (!
|
|
49706
|
+
if (!import_typescript112.default.isClassDeclaration(clazz)) {
|
|
49625
49707
|
continue;
|
|
49626
49708
|
}
|
|
49627
49709
|
this.compilation.templateTypeChecker.invalidateClass(clazz);
|
|
@@ -49637,10 +49719,7 @@ var NgCompiler = class {
|
|
|
49637
49719
|
...this.getNonTemplateDiagnostics()
|
|
49638
49720
|
];
|
|
49639
49721
|
try {
|
|
49640
|
-
diagnostics.push(...this.getTemplateDiagnostics());
|
|
49641
|
-
if (this.options.strictTemplates) {
|
|
49642
|
-
diagnostics.push(...this.getExtendedTemplateDiagnostics());
|
|
49643
|
-
}
|
|
49722
|
+
diagnostics.push(...this.getTemplateDiagnostics(), ...this.runAdditionalChecks());
|
|
49644
49723
|
} catch (err) {
|
|
49645
49724
|
if (!isFatalDiagnosticError(err)) {
|
|
49646
49725
|
throw err;
|
|
@@ -49652,10 +49731,7 @@ var NgCompiler = class {
|
|
|
49652
49731
|
getDiagnosticsForFile(file, optimizeFor) {
|
|
49653
49732
|
const diagnostics = [...this.getNonTemplateDiagnostics().filter((diag) => diag.file === file)];
|
|
49654
49733
|
try {
|
|
49655
|
-
diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor));
|
|
49656
|
-
if (this.options.strictTemplates) {
|
|
49657
|
-
diagnostics.push(...this.getExtendedTemplateDiagnostics(file));
|
|
49658
|
-
}
|
|
49734
|
+
diagnostics.push(...this.getTemplateDiagnosticsForFile(file, optimizeFor), ...this.runAdditionalChecks(file));
|
|
49659
49735
|
} catch (err) {
|
|
49660
49736
|
if (!isFatalDiagnosticError(err)) {
|
|
49661
49737
|
throw err;
|
|
@@ -49670,8 +49746,11 @@ var NgCompiler = class {
|
|
|
49670
49746
|
const diagnostics = [];
|
|
49671
49747
|
try {
|
|
49672
49748
|
diagnostics.push(...ttc.getDiagnosticsForComponent(component));
|
|
49673
|
-
const extendedTemplateChecker = compilation
|
|
49674
|
-
if (
|
|
49749
|
+
const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
|
|
49750
|
+
if (templateSemanticsChecker !== null) {
|
|
49751
|
+
diagnostics.push(...templateSemanticsChecker.getDiagnosticsForComponent(component));
|
|
49752
|
+
}
|
|
49753
|
+
if (this.options.strictTemplates && extendedTemplateChecker !== null) {
|
|
49675
49754
|
diagnostics.push(...extendedTemplateChecker.getDiagnosticsForComponent(component));
|
|
49676
49755
|
}
|
|
49677
49756
|
} catch (err) {
|
|
@@ -49837,10 +49916,10 @@ var NgCompiler = class {
|
|
|
49837
49916
|
return strictTemplates || !!this.options.fullTemplateTypeCheck;
|
|
49838
49917
|
}
|
|
49839
49918
|
getTypeCheckingConfig() {
|
|
49840
|
-
var _a2, _b2, _c2, _d2;
|
|
49919
|
+
var _a2, _b2, _c2, _d2, _e2;
|
|
49841
49920
|
const strictTemplates = !!this.options.strictTemplates;
|
|
49842
49921
|
const useInlineTypeConstructors = this.programDriver.supportsInlineOperations;
|
|
49843
|
-
|
|
49922
|
+
let allowSignalsInTwoWayBindings = (_a2 = coreHasSymbol(this.inputProgram, Identifiers.unwrapWritableSignal)) != null ? _a2 : this.angularCoreVersion === null || coreVersionSupportsFeature(this.angularCoreVersion, ">= 17.2.0-0");
|
|
49844
49923
|
let typeCheckingConfig;
|
|
49845
49924
|
if (this.fullTemplateTypeCheck) {
|
|
49846
49925
|
typeCheckingConfig = {
|
|
@@ -49865,7 +49944,7 @@ var NgCompiler = class {
|
|
|
49865
49944
|
enableTemplateTypeChecker: this.enableTemplateTypeChecker,
|
|
49866
49945
|
useInlineTypeConstructors,
|
|
49867
49946
|
suggestionsForSuboptimalTypeInference: this.enableTemplateTypeChecker && !strictTemplates,
|
|
49868
|
-
controlFlowPreventingContentProjection: ((
|
|
49947
|
+
controlFlowPreventingContentProjection: ((_b2 = this.options.extendedDiagnostics) == null ? void 0 : _b2.defaultCategory) || DiagnosticCategoryLabel.Warning,
|
|
49869
49948
|
allowSignalsInTwoWayBindings
|
|
49870
49949
|
};
|
|
49871
49950
|
} else {
|
|
@@ -49891,7 +49970,7 @@ var NgCompiler = class {
|
|
|
49891
49970
|
enableTemplateTypeChecker: this.enableTemplateTypeChecker,
|
|
49892
49971
|
useInlineTypeConstructors,
|
|
49893
49972
|
suggestionsForSuboptimalTypeInference: false,
|
|
49894
|
-
controlFlowPreventingContentProjection: ((
|
|
49973
|
+
controlFlowPreventingContentProjection: ((_c2 = this.options.extendedDiagnostics) == null ? void 0 : _c2.defaultCategory) || DiagnosticCategoryLabel.Warning,
|
|
49895
49974
|
allowSignalsInTwoWayBindings
|
|
49896
49975
|
};
|
|
49897
49976
|
}
|
|
@@ -49927,7 +50006,7 @@ var NgCompiler = class {
|
|
|
49927
50006
|
if (this.options.strictLiteralTypes !== void 0) {
|
|
49928
50007
|
typeCheckingConfig.strictLiteralTypes = this.options.strictLiteralTypes;
|
|
49929
50008
|
}
|
|
49930
|
-
if (((
|
|
50009
|
+
if (((_e2 = (_d2 = this.options.extendedDiagnostics) == null ? void 0 : _d2.checks) == null ? void 0 : _e2.controlFlowPreventingContentProjection) !== void 0) {
|
|
49931
50010
|
typeCheckingConfig.controlFlowPreventingContentProjection = this.options.extendedDiagnostics.checks.controlFlowPreventingContentProjection;
|
|
49932
50011
|
}
|
|
49933
50012
|
return typeCheckingConfig;
|
|
@@ -49967,18 +50046,24 @@ var NgCompiler = class {
|
|
|
49967
50046
|
}
|
|
49968
50047
|
return this.nonTemplateDiagnostics;
|
|
49969
50048
|
}
|
|
49970
|
-
|
|
50049
|
+
runAdditionalChecks(sf) {
|
|
49971
50050
|
const diagnostics = [];
|
|
49972
50051
|
const compilation = this.ensureAnalyzed();
|
|
49973
|
-
const extendedTemplateChecker = compilation
|
|
49974
|
-
|
|
49975
|
-
|
|
49976
|
-
|
|
49977
|
-
|
|
49978
|
-
|
|
49979
|
-
|
|
49980
|
-
|
|
49981
|
-
|
|
50052
|
+
const { extendedTemplateChecker, templateSemanticsChecker } = compilation;
|
|
50053
|
+
const files = sf ? [sf] : this.inputProgram.getSourceFiles();
|
|
50054
|
+
for (const sf2 of files) {
|
|
50055
|
+
if (templateSemanticsChecker !== null) {
|
|
50056
|
+
diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
|
|
50057
|
+
var _a2;
|
|
50058
|
+
return ((_a2 = handler.templateSemanticsCheck) == null ? void 0 : _a2.call(handler, clazz, templateSemanticsChecker)) || null;
|
|
50059
|
+
}));
|
|
50060
|
+
}
|
|
50061
|
+
if (this.options.strictTemplates && extendedTemplateChecker !== null) {
|
|
50062
|
+
diagnostics.push(...compilation.traitCompiler.runAdditionalChecks(sf2, (clazz, handler) => {
|
|
50063
|
+
var _a2;
|
|
50064
|
+
return ((_a2 = handler.extendedTemplateCheck) == null ? void 0 : _a2.call(handler, clazz, extendedTemplateChecker)) || null;
|
|
50065
|
+
}));
|
|
50066
|
+
}
|
|
49982
50067
|
}
|
|
49983
50068
|
return diagnostics;
|
|
49984
50069
|
}
|
|
@@ -50087,6 +50172,7 @@ var NgCompiler = class {
|
|
|
50087
50172
|
});
|
|
50088
50173
|
const templateTypeChecker = new TemplateTypeCheckerImpl(this.inputProgram, notifyingDriver, traitCompiler, this.getTypeCheckingConfig(), refEmitter, reflector, this.adapter, this.incrementalCompilation, metaReader, localMetaReader, ngModuleIndex, scopeReader, typeCheckScopeRegistry, this.delegatingPerfRecorder);
|
|
50089
50174
|
const extendedTemplateChecker = this.constructionDiagnostics.length === 0 ? new ExtendedTemplateCheckerImpl(templateTypeChecker, checker, ALL_DIAGNOSTIC_FACTORIES, this.options) : null;
|
|
50175
|
+
const templateSemanticsChecker = this.constructionDiagnostics.length === 0 ? new TemplateSemanticsCheckerImpl(templateTypeChecker) : null;
|
|
50090
50176
|
return {
|
|
50091
50177
|
isCore,
|
|
50092
50178
|
traitCompiler,
|
|
@@ -50101,7 +50187,8 @@ var NgCompiler = class {
|
|
|
50101
50187
|
templateTypeChecker,
|
|
50102
50188
|
resourceRegistry,
|
|
50103
50189
|
extendedTemplateChecker,
|
|
50104
|
-
localCompilationExtraImportsTracker
|
|
50190
|
+
localCompilationExtraImportsTracker,
|
|
50191
|
+
templateSemanticsChecker
|
|
50105
50192
|
};
|
|
50106
50193
|
}
|
|
50107
50194
|
};
|
|
@@ -50111,18 +50198,18 @@ function isAngularCorePackage(program) {
|
|
|
50111
50198
|
return false;
|
|
50112
50199
|
}
|
|
50113
50200
|
return r3Symbols.statements.some((stmt) => {
|
|
50114
|
-
if (!
|
|
50201
|
+
if (!import_typescript112.default.isVariableStatement(stmt)) {
|
|
50115
50202
|
return false;
|
|
50116
50203
|
}
|
|
50117
|
-
const modifiers =
|
|
50118
|
-
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind ===
|
|
50204
|
+
const modifiers = import_typescript112.default.getModifiers(stmt);
|
|
50205
|
+
if (modifiers === void 0 || !modifiers.some((mod) => mod.kind === import_typescript112.default.SyntaxKind.ExportKeyword)) {
|
|
50119
50206
|
return false;
|
|
50120
50207
|
}
|
|
50121
50208
|
return stmt.declarationList.declarations.some((decl) => {
|
|
50122
|
-
if (!
|
|
50209
|
+
if (!import_typescript112.default.isIdentifier(decl.name) || decl.name.text !== "ITS_JUST_ANGULAR") {
|
|
50123
50210
|
return false;
|
|
50124
50211
|
}
|
|
50125
|
-
if (decl.initializer === void 0 || decl.initializer.kind !==
|
|
50212
|
+
if (decl.initializer === void 0 || decl.initializer.kind !== import_typescript112.default.SyntaxKind.TrueKeyword) {
|
|
50126
50213
|
return false;
|
|
50127
50214
|
}
|
|
50128
50215
|
return true;
|
|
@@ -50136,7 +50223,7 @@ function* verifyCompatibleTypeCheckOptions(options) {
|
|
|
50136
50223
|
var _a2, _b2, _c2;
|
|
50137
50224
|
if (options.fullTemplateTypeCheck === false && options.strictTemplates === true) {
|
|
50138
50225
|
yield makeConfigDiagnostic({
|
|
50139
|
-
category:
|
|
50226
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50140
50227
|
code: ErrorCode.CONFIG_STRICT_TEMPLATES_IMPLIES_FULL_TEMPLATE_TYPECHECK,
|
|
50141
50228
|
messageText: `
|
|
50142
50229
|
Angular compiler option "strictTemplates" is enabled, however "fullTemplateTypeCheck" is disabled.
|
|
@@ -50155,7 +50242,7 @@ https://angular.io/guide/template-typecheck
|
|
|
50155
50242
|
}
|
|
50156
50243
|
if (options.extendedDiagnostics && options.strictTemplates === false) {
|
|
50157
50244
|
yield makeConfigDiagnostic({
|
|
50158
|
-
category:
|
|
50245
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50159
50246
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_IMPLIES_STRICT_TEMPLATES,
|
|
50160
50247
|
messageText: `
|
|
50161
50248
|
Angular compiler option "extendedDiagnostics" is configured, however "strictTemplates" is disabled.
|
|
@@ -50172,7 +50259,7 @@ One of the following actions is required:
|
|
|
50172
50259
|
const defaultCategory = (_a2 = options.extendedDiagnostics) == null ? void 0 : _a2.defaultCategory;
|
|
50173
50260
|
if (defaultCategory && !allowedCategoryLabels.includes(defaultCategory)) {
|
|
50174
50261
|
yield makeConfigDiagnostic({
|
|
50175
|
-
category:
|
|
50262
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50176
50263
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
50177
50264
|
messageText: `
|
|
50178
50265
|
Angular compiler option "extendedDiagnostics.defaultCategory" has an unknown diagnostic category: "${defaultCategory}".
|
|
@@ -50185,7 +50272,7 @@ ${allowedCategoryLabels.join("\n")}
|
|
|
50185
50272
|
for (const [checkName, category] of Object.entries((_c2 = (_b2 = options.extendedDiagnostics) == null ? void 0 : _b2.checks) != null ? _c2 : {})) {
|
|
50186
50273
|
if (!SUPPORTED_DIAGNOSTIC_NAMES.has(checkName)) {
|
|
50187
50274
|
yield makeConfigDiagnostic({
|
|
50188
|
-
category:
|
|
50275
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50189
50276
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CHECK,
|
|
50190
50277
|
messageText: `
|
|
50191
50278
|
Angular compiler option "extendedDiagnostics.checks" has an unknown check: "${checkName}".
|
|
@@ -50197,7 +50284,7 @@ ${Array.from(SUPPORTED_DIAGNOSTIC_NAMES).join("\n")}
|
|
|
50197
50284
|
}
|
|
50198
50285
|
if (!allowedCategoryLabels.includes(category)) {
|
|
50199
50286
|
yield makeConfigDiagnostic({
|
|
50200
|
-
category:
|
|
50287
|
+
category: import_typescript112.default.DiagnosticCategory.Error,
|
|
50201
50288
|
code: ErrorCode.CONFIG_EXTENDED_DIAGNOSTICS_UNKNOWN_CATEGORY_LABEL,
|
|
50202
50289
|
messageText: `
|
|
50203
50290
|
Angular compiler option "extendedDiagnostics.checks['${checkName}']" has an unknown diagnostic category: "${category}".
|
|
@@ -50227,7 +50314,7 @@ var ReferenceGraphAdapter = class {
|
|
|
50227
50314
|
for (const { node } of references) {
|
|
50228
50315
|
let sourceFile = node.getSourceFile();
|
|
50229
50316
|
if (sourceFile === void 0) {
|
|
50230
|
-
sourceFile =
|
|
50317
|
+
sourceFile = import_typescript112.default.getOriginalNode(node).getSourceFile();
|
|
50231
50318
|
}
|
|
50232
50319
|
if (sourceFile === void 0 || !isDtsPath(sourceFile.fileName)) {
|
|
50233
50320
|
this.graph.add(source, node);
|
|
@@ -50266,7 +50353,7 @@ function versionMapFromProgram(program, driver) {
|
|
|
50266
50353
|
}
|
|
50267
50354
|
|
|
50268
50355
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/core/src/host.mjs
|
|
50269
|
-
var
|
|
50356
|
+
var import_typescript114 = __toESM(require("typescript"), 1);
|
|
50270
50357
|
var DelegatingCompilerHost2 = class {
|
|
50271
50358
|
get jsDocParsingMode() {
|
|
50272
50359
|
return this.delegate.jsDocParsingMode;
|
|
@@ -50351,7 +50438,7 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
50351
50438
|
entryPoint = findFlatIndexEntryPoint(normalizedTsInputFiles);
|
|
50352
50439
|
if (entryPoint === null) {
|
|
50353
50440
|
diagnostics.push({
|
|
50354
|
-
category:
|
|
50441
|
+
category: import_typescript114.default.DiagnosticCategory.Error,
|
|
50355
50442
|
code: ngErrorCode(ErrorCode.CONFIG_FLAT_MODULE_NO_INDEX),
|
|
50356
50443
|
file: void 0,
|
|
50357
50444
|
start: void 0,
|
|
@@ -50394,10 +50481,10 @@ var NgCompilerHost = class extends DelegatingCompilerHost2 {
|
|
|
50394
50481
|
return this.fileNameToModuleName !== void 0 ? this : null;
|
|
50395
50482
|
}
|
|
50396
50483
|
createCachedResolveModuleNamesFunction() {
|
|
50397
|
-
const moduleResolutionCache =
|
|
50484
|
+
const moduleResolutionCache = import_typescript114.default.createModuleResolutionCache(this.getCurrentDirectory(), this.getCanonicalFileName.bind(this));
|
|
50398
50485
|
return (moduleNames, containingFile, reusedNames, redirectedReference, options) => {
|
|
50399
50486
|
return moduleNames.map((moduleName) => {
|
|
50400
|
-
const module2 =
|
|
50487
|
+
const module2 = import_typescript114.default.resolveModuleName(moduleName, containingFile, options, this, moduleResolutionCache, redirectedReference);
|
|
50401
50488
|
return module2.resolvedModule;
|
|
50402
50489
|
});
|
|
50403
50490
|
};
|
|
@@ -50421,7 +50508,7 @@ var NgtscProgram = class {
|
|
|
50421
50508
|
if (reuseProgram !== void 0) {
|
|
50422
50509
|
retagAllTsFiles(reuseProgram);
|
|
50423
50510
|
}
|
|
50424
|
-
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () =>
|
|
50511
|
+
this.tsProgram = perfRecorder.inPhase(PerfPhase.TypeScriptProgramCreate, () => import_typescript116.default.createProgram(this.host.inputFiles, options, this.host, reuseProgram));
|
|
50425
50512
|
perfRecorder.phase(PerfPhase.Unaccounted);
|
|
50426
50513
|
perfRecorder.memory(PerfCheckpoint.TypeScriptProgramCreate);
|
|
50427
50514
|
this.host.postProgramCreationCleanup();
|
|
@@ -50637,10 +50724,10 @@ function createProgram({ rootNames, options, host, oldProgram }) {
|
|
|
50637
50724
|
}
|
|
50638
50725
|
|
|
50639
50726
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/perform_compile.mjs
|
|
50640
|
-
var
|
|
50727
|
+
var import_typescript118 = __toESM(require("typescript"), 1);
|
|
50641
50728
|
|
|
50642
50729
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/util.mjs
|
|
50643
|
-
var
|
|
50730
|
+
var import_typescript117 = __toESM(require("typescript"), 1);
|
|
50644
50731
|
|
|
50645
50732
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/private/tooling.mjs
|
|
50646
50733
|
var GLOBAL_DEFS_FOR_TERSER = {
|
|
@@ -50675,14 +50762,14 @@ setFileSystem(new NodeJSFileSystem());
|
|
|
50675
50762
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/index.mjs
|
|
50676
50763
|
var import_fs2 = require("fs");
|
|
50677
50764
|
var import_path8 = require("path");
|
|
50678
|
-
var
|
|
50765
|
+
var import_typescript131 = __toESM(require("typescript"), 1);
|
|
50679
50766
|
|
|
50680
50767
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
|
|
50681
|
-
var
|
|
50768
|
+
var import_typescript120 = __toESM(require("typescript"), 1);
|
|
50682
50769
|
|
|
50683
50770
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
|
|
50684
50771
|
var import_path4 = require("path");
|
|
50685
|
-
var
|
|
50772
|
+
var import_typescript119 = __toESM(require("typescript"), 1);
|
|
50686
50773
|
var ImportManager2 = class {
|
|
50687
50774
|
constructor(getUpdateRecorder, printer) {
|
|
50688
50775
|
__publicField(this, "getUpdateRecorder");
|
|
@@ -50705,7 +50792,7 @@ var ImportManager2 = class {
|
|
|
50705
50792
|
}
|
|
50706
50793
|
for (let i = sourceFile.statements.length - 1; i >= 0; i--) {
|
|
50707
50794
|
const statement = sourceFile.statements[i];
|
|
50708
|
-
if (!
|
|
50795
|
+
if (!import_typescript119.default.isImportDeclaration(statement) || !import_typescript119.default.isStringLiteral(statement.moduleSpecifier) || !statement.importClause) {
|
|
50709
50796
|
continue;
|
|
50710
50797
|
}
|
|
50711
50798
|
if (importStartIndex === 0) {
|
|
@@ -50717,9 +50804,9 @@ var ImportManager2 = class {
|
|
|
50717
50804
|
}
|
|
50718
50805
|
if (statement.importClause.namedBindings) {
|
|
50719
50806
|
const namedBindings = statement.importClause.namedBindings;
|
|
50720
|
-
if (
|
|
50721
|
-
return
|
|
50722
|
-
} else if (
|
|
50807
|
+
if (import_typescript119.default.isNamespaceImport(namedBindings) && !typeImport) {
|
|
50808
|
+
return import_typescript119.default.factory.createPropertyAccessExpression(import_typescript119.default.factory.createIdentifier(namedBindings.name.text), import_typescript119.default.factory.createIdentifier(alias || symbolName || "default"));
|
|
50809
|
+
} else if (import_typescript119.default.isNamedImports(namedBindings) && symbolName) {
|
|
50723
50810
|
const existingElement = namedBindings.elements.find((e) => {
|
|
50724
50811
|
if (alias) {
|
|
50725
50812
|
return e.propertyName && e.name.text === alias && e.propertyName.text === symbolName;
|
|
@@ -50727,12 +50814,12 @@ var ImportManager2 = class {
|
|
|
50727
50814
|
return e.propertyName ? e.propertyName.text === symbolName : e.name.text === symbolName;
|
|
50728
50815
|
});
|
|
50729
50816
|
if (existingElement) {
|
|
50730
|
-
return
|
|
50817
|
+
return import_typescript119.default.factory.createIdentifier(existingElement.name.text);
|
|
50731
50818
|
}
|
|
50732
50819
|
existingImport = statement;
|
|
50733
50820
|
}
|
|
50734
50821
|
} else if (statement.importClause.name && !symbolName) {
|
|
50735
|
-
return
|
|
50822
|
+
return import_typescript119.default.factory.createIdentifier(statement.importClause.name.text);
|
|
50736
50823
|
}
|
|
50737
50824
|
}
|
|
50738
50825
|
if (existingImport) {
|
|
@@ -50756,7 +50843,7 @@ var ImportManager2 = class {
|
|
|
50756
50843
|
if (!importMap.has(moduleName)) {
|
|
50757
50844
|
importMap.set(moduleName, []);
|
|
50758
50845
|
}
|
|
50759
|
-
importMap.get(moduleName).push(
|
|
50846
|
+
importMap.get(moduleName).push(import_typescript119.default.factory.createImportSpecifier(false, propertyName, name));
|
|
50760
50847
|
} else {
|
|
50761
50848
|
const importMap = this.newImports.get(sourceFile).defaultImports;
|
|
50762
50849
|
identifier = this._getUniqueIdentifier(sourceFile, "defaultExport");
|
|
@@ -50770,19 +50857,19 @@ var ImportManager2 = class {
|
|
|
50770
50857
|
const sourceFile = importDecl.getSourceFile();
|
|
50771
50858
|
const recorder = this.getUpdateRecorder(sourceFile);
|
|
50772
50859
|
const namedBindings = importDecl.importClause.namedBindings;
|
|
50773
|
-
const newNamedBindings =
|
|
50774
|
-
const newNamedBindingsText = this.printer.printNode(
|
|
50860
|
+
const newNamedBindings = import_typescript119.default.factory.updateNamedImports(namedBindings, namedBindings.elements.concat(expressions.map(({ propertyName, importName }) => import_typescript119.default.factory.createImportSpecifier(false, propertyName, importName))));
|
|
50861
|
+
const newNamedBindingsText = this.printer.printNode(import_typescript119.default.EmitHint.Unspecified, newNamedBindings, sourceFile);
|
|
50775
50862
|
recorder.updateExistingImport(namedBindings, newNamedBindingsText);
|
|
50776
50863
|
});
|
|
50777
50864
|
this.newImports.forEach(({ importStartIndex, defaultImports, namedImports }, sourceFile) => {
|
|
50778
50865
|
const recorder = this.getUpdateRecorder(sourceFile);
|
|
50779
50866
|
const useSingleQuotes = this._getQuoteStyle(sourceFile) === 0;
|
|
50780
50867
|
defaultImports.forEach((identifier, moduleName) => {
|
|
50781
|
-
const newImport =
|
|
50868
|
+
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));
|
|
50782
50869
|
recorder.addNewImport(importStartIndex, this._getNewImportText(importStartIndex, newImport, sourceFile));
|
|
50783
50870
|
});
|
|
50784
50871
|
namedImports.forEach((specifiers, moduleName) => {
|
|
50785
|
-
const newImport =
|
|
50872
|
+
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));
|
|
50786
50873
|
recorder.addNewImport(importStartIndex, this._getNewImportText(importStartIndex, newImport, sourceFile));
|
|
50787
50874
|
});
|
|
50788
50875
|
});
|
|
@@ -50790,7 +50877,7 @@ var ImportManager2 = class {
|
|
|
50790
50877
|
_getUniqueIdentifier(sourceFile, baseName) {
|
|
50791
50878
|
if (this.isUniqueIdentifierName(sourceFile, baseName)) {
|
|
50792
50879
|
this._recordUsedIdentifier(sourceFile, baseName);
|
|
50793
|
-
return
|
|
50880
|
+
return import_typescript119.default.factory.createIdentifier(baseName);
|
|
50794
50881
|
}
|
|
50795
50882
|
let name = null;
|
|
50796
50883
|
let counter = 1;
|
|
@@ -50798,7 +50885,7 @@ var ImportManager2 = class {
|
|
|
50798
50885
|
name = `${baseName}_${counter++}`;
|
|
50799
50886
|
} while (!this.isUniqueIdentifierName(sourceFile, name));
|
|
50800
50887
|
this._recordUsedIdentifier(sourceFile, name);
|
|
50801
|
-
return
|
|
50888
|
+
return import_typescript119.default.factory.createIdentifier(name);
|
|
50802
50889
|
}
|
|
50803
50890
|
isUniqueIdentifierName(sourceFile, name) {
|
|
50804
50891
|
if (this.usedIdentifierNames.has(sourceFile) && this.usedIdentifierNames.get(sourceFile).indexOf(name) !== -1) {
|
|
@@ -50807,7 +50894,7 @@ var ImportManager2 = class {
|
|
|
50807
50894
|
const nodeQueue = [sourceFile];
|
|
50808
50895
|
while (nodeQueue.length) {
|
|
50809
50896
|
const node = nodeQueue.shift();
|
|
50810
|
-
if (
|
|
50897
|
+
if (import_typescript119.default.isIdentifier(node) && node.text === name && (!import_typescript119.default.isImportSpecifier(node.parent) || node.parent.propertyName !== node)) {
|
|
50811
50898
|
return false;
|
|
50812
50899
|
}
|
|
50813
50900
|
nodeQueue.push(...node.getChildren());
|
|
@@ -50819,21 +50906,21 @@ var ImportManager2 = class {
|
|
|
50819
50906
|
}
|
|
50820
50907
|
_getEndPositionOfNode(node) {
|
|
50821
50908
|
const nodeEndPos = node.getEnd();
|
|
50822
|
-
const commentRanges =
|
|
50909
|
+
const commentRanges = import_typescript119.default.getTrailingCommentRanges(node.getSourceFile().text, nodeEndPos);
|
|
50823
50910
|
if (!commentRanges || !commentRanges.length) {
|
|
50824
50911
|
return nodeEndPos;
|
|
50825
50912
|
}
|
|
50826
50913
|
return commentRanges[commentRanges.length - 1].end;
|
|
50827
50914
|
}
|
|
50828
50915
|
_getNewImportText(importStartIndex, newImport, sourceFile) {
|
|
50829
|
-
const text2 = this.printer.printNode(
|
|
50916
|
+
const text2 = this.printer.printNode(import_typescript119.default.EmitHint.Unspecified, newImport, sourceFile);
|
|
50830
50917
|
return importStartIndex === 0 ? `${text2}
|
|
50831
50918
|
` : `
|
|
50832
50919
|
${text2}`;
|
|
50833
50920
|
}
|
|
50834
50921
|
_getImportParts(sourceFile, symbolName, alias, keepSymbolName) {
|
|
50835
|
-
const symbolIdentifier =
|
|
50836
|
-
const aliasIdentifier = alias ?
|
|
50922
|
+
const symbolIdentifier = import_typescript119.default.factory.createIdentifier(symbolName);
|
|
50923
|
+
const aliasIdentifier = alias ? import_typescript119.default.factory.createIdentifier(alias) : null;
|
|
50837
50924
|
const generatedUniqueIdentifier = this._getUniqueIdentifier(sourceFile, alias || symbolName);
|
|
50838
50925
|
const needsGeneratedUniqueName = generatedUniqueIdentifier.text !== (alias || symbolName);
|
|
50839
50926
|
let propertyName;
|
|
@@ -50853,7 +50940,7 @@ ${text2}`;
|
|
|
50853
50940
|
if (!this.quoteStyles.hasOwnProperty(sourceFile.fileName)) {
|
|
50854
50941
|
let quoteStyle;
|
|
50855
50942
|
for (const statement of sourceFile.statements) {
|
|
50856
|
-
if (
|
|
50943
|
+
if (import_typescript119.default.isImportDeclaration(statement) && import_typescript119.default.isStringLiteralLike(statement.moduleSpecifier)) {
|
|
50857
50944
|
quoteStyle = statement.moduleSpecifier.getText().trim().startsWith('"') ? 1 : 0;
|
|
50858
50945
|
break;
|
|
50859
50946
|
}
|
|
@@ -50884,7 +50971,7 @@ var ChangeTracker = class {
|
|
|
50884
50971
|
replaceText(sourceFile, start, removeLength, text2) {
|
|
50885
50972
|
this._trackChange(sourceFile, { start, removeLength, text: text2 });
|
|
50886
50973
|
}
|
|
50887
|
-
replaceNode(oldNode, newNode, emitHint =
|
|
50974
|
+
replaceNode(oldNode, newNode, emitHint = import_typescript120.default.EmitHint.Unspecified, sourceFileWhenPrinting) {
|
|
50888
50975
|
const sourceFile = oldNode.getSourceFile();
|
|
50889
50976
|
this.replaceText(sourceFile, oldNode.getStart(), oldNode.getWidth(), this._printer.printNode(emitHint, newNode, sourceFileWhenPrinting || sourceFile));
|
|
50890
50977
|
}
|
|
@@ -51005,23 +51092,23 @@ function getWorkspace(tree) {
|
|
|
51005
51092
|
|
|
51006
51093
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
51007
51094
|
var import_path5 = require("path");
|
|
51008
|
-
var
|
|
51095
|
+
var import_typescript122 = __toESM(require("typescript"), 1);
|
|
51009
51096
|
|
|
51010
51097
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
|
|
51011
51098
|
var path3 = __toESM(require("path"), 1);
|
|
51012
|
-
var
|
|
51099
|
+
var import_typescript121 = __toESM(require("typescript"), 1);
|
|
51013
51100
|
function parseTsconfigFile(tsconfigPath, basePath) {
|
|
51014
|
-
const { config } =
|
|
51101
|
+
const { config } = import_typescript121.default.readConfigFile(tsconfigPath, import_typescript121.default.sys.readFile);
|
|
51015
51102
|
const parseConfigHost = {
|
|
51016
|
-
useCaseSensitiveFileNames:
|
|
51017
|
-
fileExists:
|
|
51018
|
-
readDirectory:
|
|
51019
|
-
readFile:
|
|
51103
|
+
useCaseSensitiveFileNames: import_typescript121.default.sys.useCaseSensitiveFileNames,
|
|
51104
|
+
fileExists: import_typescript121.default.sys.fileExists,
|
|
51105
|
+
readDirectory: import_typescript121.default.sys.readDirectory,
|
|
51106
|
+
readFile: import_typescript121.default.sys.readFile
|
|
51020
51107
|
};
|
|
51021
51108
|
if (!path3.isAbsolute(basePath)) {
|
|
51022
51109
|
throw Error("Unexpected relative base path has been specified.");
|
|
51023
51110
|
}
|
|
51024
|
-
return
|
|
51111
|
+
return import_typescript121.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
|
|
51025
51112
|
}
|
|
51026
51113
|
|
|
51027
51114
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
@@ -51033,7 +51120,7 @@ function createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additi
|
|
|
51033
51120
|
return { rootNames: parsed.fileNames.concat(additionalFiles || []), options, host };
|
|
51034
51121
|
}
|
|
51035
51122
|
function createMigrationCompilerHost(tree, options, basePath, fakeRead) {
|
|
51036
|
-
const host =
|
|
51123
|
+
const host = import_typescript122.default.createCompilerHost(options, true);
|
|
51037
51124
|
const defaultReadFile = host.readFile;
|
|
51038
51125
|
host.readFile = (fileName) => {
|
|
51039
51126
|
var _a2;
|
|
@@ -51054,24 +51141,24 @@ function canMigrateFile(basePath, sourceFile, program) {
|
|
|
51054
51141
|
}
|
|
51055
51142
|
|
|
51056
51143
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/prune-modules.mjs
|
|
51057
|
-
var
|
|
51144
|
+
var import_typescript127 = __toESM(require("typescript"), 1);
|
|
51058
51145
|
|
|
51059
51146
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
51060
|
-
var
|
|
51147
|
+
var import_typescript124 = __toESM(require("typescript"), 1);
|
|
51061
51148
|
|
|
51062
51149
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
|
|
51063
|
-
var
|
|
51150
|
+
var import_typescript123 = __toESM(require("typescript"), 1);
|
|
51064
51151
|
function getImportOfIdentifier(typeChecker, node) {
|
|
51065
51152
|
const symbol = typeChecker.getSymbolAtLocation(node);
|
|
51066
51153
|
if (!symbol || symbol.declarations === void 0 || !symbol.declarations.length) {
|
|
51067
51154
|
return null;
|
|
51068
51155
|
}
|
|
51069
51156
|
const decl = symbol.declarations[0];
|
|
51070
|
-
if (!
|
|
51157
|
+
if (!import_typescript123.default.isImportSpecifier(decl)) {
|
|
51071
51158
|
return null;
|
|
51072
51159
|
}
|
|
51073
51160
|
const importDecl = decl.parent.parent.parent;
|
|
51074
|
-
if (!
|
|
51161
|
+
if (!import_typescript123.default.isStringLiteral(importDecl.moduleSpecifier)) {
|
|
51075
51162
|
return null;
|
|
51076
51163
|
}
|
|
51077
51164
|
return {
|
|
@@ -51088,10 +51175,10 @@ function getImportSpecifiers(sourceFile, moduleName, specifierNames) {
|
|
|
51088
51175
|
var _a2;
|
|
51089
51176
|
const matches = [];
|
|
51090
51177
|
for (const node of sourceFile.statements) {
|
|
51091
|
-
if (
|
|
51178
|
+
if (import_typescript123.default.isImportDeclaration(node) && import_typescript123.default.isStringLiteral(node.moduleSpecifier)) {
|
|
51092
51179
|
const isMatch = typeof moduleName === "string" ? node.moduleSpecifier.text === moduleName : moduleName.test(node.moduleSpecifier.text);
|
|
51093
51180
|
const namedBindings = (_a2 = node.importClause) == null ? void 0 : _a2.namedBindings;
|
|
51094
|
-
if (isMatch && namedBindings &&
|
|
51181
|
+
if (isMatch && namedBindings && import_typescript123.default.isNamedImports(namedBindings)) {
|
|
51095
51182
|
for (const specifierName of specifierNames) {
|
|
51096
51183
|
const match = findImportSpecifier(namedBindings.elements, specifierName);
|
|
51097
51184
|
if (match) {
|
|
@@ -51112,7 +51199,7 @@ function findImportSpecifier(nodes, specifierName) {
|
|
|
51112
51199
|
|
|
51113
51200
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
51114
51201
|
function getCallDecoratorImport(typeChecker, decorator) {
|
|
51115
|
-
if (!
|
|
51202
|
+
if (!import_typescript124.default.isCallExpression(decorator.expression) || !import_typescript124.default.isIdentifier(decorator.expression.expression)) {
|
|
51116
51203
|
return null;
|
|
51117
51204
|
}
|
|
51118
51205
|
const identifier = decorator.expression.expression;
|
|
@@ -51130,10 +51217,10 @@ function getAngularDecorators2(typeChecker, decorators) {
|
|
|
51130
51217
|
}
|
|
51131
51218
|
|
|
51132
51219
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs
|
|
51133
|
-
var
|
|
51220
|
+
var import_typescript125 = __toESM(require("typescript"), 1);
|
|
51134
51221
|
function closestNode(node, predicate) {
|
|
51135
51222
|
let current = node.parent;
|
|
51136
|
-
while (current && !
|
|
51223
|
+
while (current && !import_typescript125.default.isSourceFile(current)) {
|
|
51137
51224
|
if (predicate(current)) {
|
|
51138
51225
|
return current;
|
|
51139
51226
|
}
|
|
@@ -51144,7 +51231,7 @@ function closestNode(node, predicate) {
|
|
|
51144
51231
|
|
|
51145
51232
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/util.mjs
|
|
51146
51233
|
var import_path6 = require("path");
|
|
51147
|
-
var
|
|
51234
|
+
var import_typescript126 = __toESM(require("typescript"), 1);
|
|
51148
51235
|
var UniqueItemTracker = class {
|
|
51149
51236
|
constructor() {
|
|
51150
51237
|
__publicField(this, "_nodes", /* @__PURE__ */ new Map());
|
|
@@ -51193,7 +51280,7 @@ var ReferenceResolver = class {
|
|
|
51193
51280
|
const results = /* @__PURE__ */ new Map();
|
|
51194
51281
|
for (const symbol of referencedSymbols) {
|
|
51195
51282
|
for (const ref of symbol.references) {
|
|
51196
|
-
if (!ref.isDefinition || symbol.definition.kind ===
|
|
51283
|
+
if (!ref.isDefinition || symbol.definition.kind === import_typescript126.default.ScriptElementKind.alias) {
|
|
51197
51284
|
if (!results.has(ref.fileName)) {
|
|
51198
51285
|
results.set(ref.fileName, []);
|
|
51199
51286
|
}
|
|
@@ -51217,7 +51304,7 @@ var ReferenceResolver = class {
|
|
|
51217
51304
|
for (const file of highlights) {
|
|
51218
51305
|
if (file.fileName === fileName) {
|
|
51219
51306
|
for (const { textSpan: { start, length }, kind } of file.highlightSpans) {
|
|
51220
|
-
if (kind !==
|
|
51307
|
+
if (kind !== import_typescript126.default.HighlightSpanKind.none) {
|
|
51221
51308
|
results.push([start, start + length]);
|
|
51222
51309
|
}
|
|
51223
51310
|
}
|
|
@@ -51243,19 +51330,19 @@ var ReferenceResolver = class {
|
|
|
51243
51330
|
rootFileNames.push(fileName);
|
|
51244
51331
|
}
|
|
51245
51332
|
});
|
|
51246
|
-
this._languageService =
|
|
51333
|
+
this._languageService = import_typescript126.default.createLanguageService({
|
|
51247
51334
|
getCompilationSettings: () => this._program.getTsProgram().getCompilerOptions(),
|
|
51248
51335
|
getScriptFileNames: () => rootFileNames,
|
|
51249
51336
|
getScriptVersion: () => "0",
|
|
51250
51337
|
getScriptSnapshot: (path4) => {
|
|
51251
51338
|
const content = this._readFile(path4);
|
|
51252
|
-
return content ?
|
|
51339
|
+
return content ? import_typescript126.default.ScriptSnapshot.fromString(content) : void 0;
|
|
51253
51340
|
},
|
|
51254
51341
|
getCurrentDirectory: () => this._basePath,
|
|
51255
|
-
getDefaultLibFileName: (options) =>
|
|
51342
|
+
getDefaultLibFileName: (options) => import_typescript126.default.getDefaultLibFilePath(options),
|
|
51256
51343
|
readFile: (path4) => this._readFile(path4),
|
|
51257
51344
|
fileExists: (path4) => this._host.fileExists(path4)
|
|
51258
|
-
},
|
|
51345
|
+
}, import_typescript126.default.createDocumentRegistry(), import_typescript126.default.LanguageServiceMode.PartialSemantic);
|
|
51259
51346
|
}
|
|
51260
51347
|
return this._languageService;
|
|
51261
51348
|
}
|
|
@@ -51285,10 +51372,10 @@ function offsetsToNodes(lookup, offsets, results) {
|
|
|
51285
51372
|
}
|
|
51286
51373
|
function findClassDeclaration(reference2, typeChecker) {
|
|
51287
51374
|
var _a2, _b2;
|
|
51288
|
-
return ((_b2 = (_a2 = typeChecker.getTypeAtLocation(reference2).getSymbol()) == null ? void 0 : _a2.declarations) == null ? void 0 : _b2.find(
|
|
51375
|
+
return ((_b2 = (_a2 = typeChecker.getTypeAtLocation(reference2).getSymbol()) == null ? void 0 : _a2.declarations) == null ? void 0 : _b2.find(import_typescript126.default.isClassDeclaration)) || null;
|
|
51289
51376
|
}
|
|
51290
51377
|
function findLiteralProperty(literal3, name) {
|
|
51291
|
-
return literal3.properties.find((prop) => prop.name &&
|
|
51378
|
+
return literal3.properties.find((prop) => prop.name && import_typescript126.default.isIdentifier(prop.name) && prop.name.text === name);
|
|
51292
51379
|
}
|
|
51293
51380
|
function getRelativeImportPath(fromFile, toFile) {
|
|
51294
51381
|
let path4 = (0, import_path6.relative)((0, import_path6.dirname)(fromFile), toFile).replace(/\.ts$/, "");
|
|
@@ -51309,9 +51396,9 @@ function isClassReferenceInAngularModule(node, className, moduleName, typeChecke
|
|
|
51309
51396
|
const externalName = `@angular/${moduleName}`;
|
|
51310
51397
|
const internalName = `angular2/rc/packages/${moduleName}`;
|
|
51311
51398
|
return !!((_a2 = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a2.some((decl) => {
|
|
51312
|
-
const closestClass = closestOrSelf(decl,
|
|
51399
|
+
const closestClass = closestOrSelf(decl, import_typescript126.default.isClassDeclaration);
|
|
51313
51400
|
const closestClassFileName = closestClass == null ? void 0 : closestClass.getSourceFile().fileName;
|
|
51314
|
-
if (!closestClass || !closestClassFileName || !closestClass.name || !
|
|
51401
|
+
if (!closestClass || !closestClassFileName || !closestClass.name || !import_typescript126.default.isIdentifier(closestClass.name) || !closestClassFileName.includes(externalName) && !closestClassFileName.includes(internalName)) {
|
|
51315
51402
|
return false;
|
|
51316
51403
|
}
|
|
51317
51404
|
return typeof className === "string" ? closestClass.name.text === className : className.test(closestClass.name.text);
|
|
@@ -51336,10 +51423,10 @@ function pruneNgModules(program, host, basePath, rootFileNames, sourceFiles, pri
|
|
|
51336
51423
|
const nodesToRemove = /* @__PURE__ */ new Set();
|
|
51337
51424
|
sourceFiles.forEach(function walk(node) {
|
|
51338
51425
|
var _a2, _b2;
|
|
51339
|
-
if (
|
|
51426
|
+
if (import_typescript127.default.isClassDeclaration(node) && canRemoveClass(node, typeChecker)) {
|
|
51340
51427
|
collectRemovalLocations(node, removalLocations, referenceResolver, program);
|
|
51341
51428
|
classesToRemove.add(node);
|
|
51342
|
-
} else if (
|
|
51429
|
+
} else if (import_typescript127.default.isExportDeclaration(node) && !node.exportClause && node.moduleSpecifier && import_typescript127.default.isStringLiteralLike(node.moduleSpecifier) && node.moduleSpecifier.text.startsWith(".")) {
|
|
51343
51430
|
const exportedSourceFile = (_b2 = (_a2 = typeChecker.getSymbolAtLocation(node.moduleSpecifier)) == null ? void 0 : _a2.valueDeclaration) == null ? void 0 : _b2.getSourceFile();
|
|
51344
51431
|
if (exportedSourceFile) {
|
|
51345
51432
|
barrelExports.track(exportedSourceFile, node);
|
|
@@ -51385,17 +51472,17 @@ function collectRemovalLocations(ngModule, removalLocations, referenceResolver,
|
|
|
51385
51472
|
}
|
|
51386
51473
|
}
|
|
51387
51474
|
for (const node of nodes) {
|
|
51388
|
-
const closestArray = closestNode(node,
|
|
51475
|
+
const closestArray = closestNode(node, import_typescript127.default.isArrayLiteralExpression);
|
|
51389
51476
|
if (closestArray) {
|
|
51390
51477
|
removalLocations.arrays.track(closestArray, node);
|
|
51391
51478
|
continue;
|
|
51392
51479
|
}
|
|
51393
|
-
const closestImport = closestNode(node,
|
|
51480
|
+
const closestImport = closestNode(node, import_typescript127.default.isNamedImports);
|
|
51394
51481
|
if (closestImport) {
|
|
51395
51482
|
removalLocations.imports.track(closestImport, node);
|
|
51396
51483
|
continue;
|
|
51397
51484
|
}
|
|
51398
|
-
const closestExport = closestNode(node,
|
|
51485
|
+
const closestExport = closestNode(node, import_typescript127.default.isNamedExports);
|
|
51399
51486
|
if (closestExport) {
|
|
51400
51487
|
removalLocations.exports.track(closestExport, node);
|
|
51401
51488
|
continue;
|
|
@@ -51406,24 +51493,24 @@ function collectRemovalLocations(ngModule, removalLocations, referenceResolver,
|
|
|
51406
51493
|
function removeArrayReferences(locations, tracker) {
|
|
51407
51494
|
for (const [array, toRemove] of locations.getEntries()) {
|
|
51408
51495
|
const newElements = filterRemovedElements(array.elements, toRemove);
|
|
51409
|
-
tracker.replaceNode(array,
|
|
51496
|
+
tracker.replaceNode(array, import_typescript127.default.factory.updateArrayLiteralExpression(array, import_typescript127.default.factory.createNodeArray(newElements, array.elements.hasTrailingComma)));
|
|
51410
51497
|
}
|
|
51411
51498
|
}
|
|
51412
51499
|
function removeImportReferences(locations, tracker) {
|
|
51413
51500
|
for (const [namedImports, toRemove] of locations.getEntries()) {
|
|
51414
51501
|
const newElements = filterRemovedElements(namedImports.elements, toRemove);
|
|
51415
51502
|
if (newElements.length === 0) {
|
|
51416
|
-
const importClause = closestNode(namedImports,
|
|
51503
|
+
const importClause = closestNode(namedImports, import_typescript127.default.isImportClause);
|
|
51417
51504
|
if (importClause && importClause.name) {
|
|
51418
|
-
tracker.replaceNode(importClause,
|
|
51505
|
+
tracker.replaceNode(importClause, import_typescript127.default.factory.updateImportClause(importClause, importClause.isTypeOnly, importClause.name, void 0));
|
|
51419
51506
|
} else {
|
|
51420
|
-
const declaration = closestNode(namedImports,
|
|
51507
|
+
const declaration = closestNode(namedImports, import_typescript127.default.isImportDeclaration);
|
|
51421
51508
|
if (declaration) {
|
|
51422
51509
|
tracker.removeNode(declaration);
|
|
51423
51510
|
}
|
|
51424
51511
|
}
|
|
51425
51512
|
} else {
|
|
51426
|
-
tracker.replaceNode(namedImports,
|
|
51513
|
+
tracker.replaceNode(namedImports, import_typescript127.default.factory.updateNamedImports(namedImports, newElements));
|
|
51427
51514
|
}
|
|
51428
51515
|
}
|
|
51429
51516
|
}
|
|
@@ -51431,22 +51518,22 @@ function removeExportReferences(locations, tracker) {
|
|
|
51431
51518
|
for (const [namedExports, toRemove] of locations.getEntries()) {
|
|
51432
51519
|
const newElements = filterRemovedElements(namedExports.elements, toRemove);
|
|
51433
51520
|
if (newElements.length === 0) {
|
|
51434
|
-
const declaration = closestNode(namedExports,
|
|
51521
|
+
const declaration = closestNode(namedExports, import_typescript127.default.isExportDeclaration);
|
|
51435
51522
|
if (declaration) {
|
|
51436
51523
|
tracker.removeNode(declaration);
|
|
51437
51524
|
}
|
|
51438
51525
|
} else {
|
|
51439
|
-
tracker.replaceNode(namedExports,
|
|
51526
|
+
tracker.replaceNode(namedExports, import_typescript127.default.factory.updateNamedExports(namedExports, newElements));
|
|
51440
51527
|
}
|
|
51441
51528
|
}
|
|
51442
51529
|
}
|
|
51443
51530
|
function canRemoveClass(node, typeChecker) {
|
|
51444
51531
|
var _a2;
|
|
51445
51532
|
const decorator = (_a2 = findNgModuleDecorator(node, typeChecker)) == null ? void 0 : _a2.node;
|
|
51446
|
-
if (!decorator || !
|
|
51533
|
+
if (!decorator || !import_typescript127.default.isCallExpression(decorator.expression)) {
|
|
51447
51534
|
return false;
|
|
51448
51535
|
}
|
|
51449
|
-
if (decorator.expression.arguments.length > 0 && !
|
|
51536
|
+
if (decorator.expression.arguments.length > 0 && !import_typescript127.default.isObjectLiteralExpression(decorator.expression.arguments[0])) {
|
|
51450
51537
|
return false;
|
|
51451
51538
|
}
|
|
51452
51539
|
if (node.members.length > 0 && node.members.some((member) => !isEmptyConstructor(member))) {
|
|
@@ -51459,7 +51546,7 @@ function canRemoveClass(node, typeChecker) {
|
|
|
51459
51546
|
const imports = findLiteralProperty(literal3, "imports");
|
|
51460
51547
|
if (imports && isNonEmptyNgModuleProperty(imports)) {
|
|
51461
51548
|
for (const dep of imports.initializer.elements) {
|
|
51462
|
-
if (!
|
|
51549
|
+
if (!import_typescript127.default.isIdentifier(dep)) {
|
|
51463
51550
|
return false;
|
|
51464
51551
|
}
|
|
51465
51552
|
const depDeclaration = findClassDeclaration(dep, typeChecker);
|
|
@@ -51477,15 +51564,15 @@ function canRemoveClass(node, typeChecker) {
|
|
|
51477
51564
|
return true;
|
|
51478
51565
|
}
|
|
51479
51566
|
function isNonEmptyNgModuleProperty(node) {
|
|
51480
|
-
return
|
|
51567
|
+
return import_typescript127.default.isPropertyAssignment(node) && import_typescript127.default.isIdentifier(node.name) && import_typescript127.default.isArrayLiteralExpression(node.initializer) && node.initializer.elements.length > 0;
|
|
51481
51568
|
}
|
|
51482
51569
|
function canRemoveFile(sourceFile, nodesToBeRemoved) {
|
|
51483
51570
|
var _a2;
|
|
51484
51571
|
for (const node of sourceFile.statements) {
|
|
51485
|
-
if (
|
|
51572
|
+
if (import_typescript127.default.isImportDeclaration(node) || nodesToBeRemoved.has(node)) {
|
|
51486
51573
|
continue;
|
|
51487
51574
|
}
|
|
51488
|
-
if (
|
|
51575
|
+
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))) {
|
|
51489
51576
|
return false;
|
|
51490
51577
|
}
|
|
51491
51578
|
}
|
|
@@ -51505,7 +51592,7 @@ function filterRemovedElements(elements, toRemove) {
|
|
|
51505
51592
|
});
|
|
51506
51593
|
}
|
|
51507
51594
|
function isEmptyConstructor(node) {
|
|
51508
|
-
return
|
|
51595
|
+
return import_typescript127.default.isConstructorDeclaration(node) && node.parameters.length === 0 && (node.body == null || node.body.statements.length === 0);
|
|
51509
51596
|
}
|
|
51510
51597
|
function addRemovalTodos(nodes, tracker) {
|
|
51511
51598
|
for (const node of nodes) {
|
|
@@ -51513,19 +51600,19 @@ function addRemovalTodos(nodes, tracker) {
|
|
|
51513
51600
|
}
|
|
51514
51601
|
}
|
|
51515
51602
|
function findNgModuleDecorator(node, typeChecker) {
|
|
51516
|
-
const decorators = getAngularDecorators2(typeChecker,
|
|
51603
|
+
const decorators = getAngularDecorators2(typeChecker, import_typescript127.default.getDecorators(node) || []);
|
|
51517
51604
|
return decorators.find((decorator) => decorator.name === "NgModule") || null;
|
|
51518
51605
|
}
|
|
51519
51606
|
|
|
51520
51607
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/standalone-bootstrap.mjs
|
|
51521
51608
|
var import_path7 = require("path");
|
|
51522
|
-
var
|
|
51609
|
+
var import_typescript130 = __toESM(require("typescript"), 1);
|
|
51523
51610
|
|
|
51524
51611
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/to-standalone.mjs
|
|
51525
|
-
var
|
|
51612
|
+
var import_typescript129 = __toESM(require("typescript"), 1);
|
|
51526
51613
|
|
|
51527
51614
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/symbol.mjs
|
|
51528
|
-
var
|
|
51615
|
+
var import_typescript128 = __toESM(require("typescript"), 1);
|
|
51529
51616
|
function isReferenceToImport(typeChecker, node, importSpecifier) {
|
|
51530
51617
|
var _a2, _b2;
|
|
51531
51618
|
const nodeSymbol = typeChecker.getTypeAtLocation(node).getSymbol();
|
|
@@ -51572,8 +51659,8 @@ function convertNgModuleDeclarationToStandalone(decl, allDeclarations, tracker,
|
|
|
51572
51659
|
const importsToAdd = getComponentImportExpressions(decl, allDeclarations, tracker, typeChecker, importRemapper);
|
|
51573
51660
|
if (importsToAdd.length > 0) {
|
|
51574
51661
|
const hasTrailingComma = importsToAdd.length > 2 && !!((_a2 = extractMetadataLiteral(directiveMeta.decorator)) == null ? void 0 : _a2.properties.hasTrailingComma);
|
|
51575
|
-
decorator = addPropertyToAngularDecorator(decorator,
|
|
51576
|
-
|
|
51662
|
+
decorator = addPropertyToAngularDecorator(decorator, import_typescript129.default.factory.createPropertyAssignment("imports", import_typescript129.default.factory.createArrayLiteralExpression(
|
|
51663
|
+
import_typescript129.default.factory.createNodeArray(importsToAdd, hasTrailingComma),
|
|
51577
51664
|
hasTrailingComma
|
|
51578
51665
|
)));
|
|
51579
51666
|
}
|
|
@@ -51605,11 +51692,11 @@ function getComponentImportExpressions(decl, allDeclarations, tracker, typeCheck
|
|
|
51605
51692
|
const identifier = tracker.addImport(decl.getSourceFile(), importLocation.symbolName, importLocation.moduleSpecifier);
|
|
51606
51693
|
imports.push(identifier);
|
|
51607
51694
|
} else {
|
|
51608
|
-
const identifier =
|
|
51695
|
+
const identifier = import_typescript129.default.factory.createIdentifier(importLocation.symbolName);
|
|
51609
51696
|
if (importLocation.isForwardReference) {
|
|
51610
51697
|
const forwardRefExpression = tracker.addImport(decl.getSourceFile(), "forwardRef", "@angular/core");
|
|
51611
|
-
const arrowFunction =
|
|
51612
|
-
imports.push(
|
|
51698
|
+
const arrowFunction = import_typescript129.default.factory.createArrowFunction(void 0, void 0, [], void 0, void 0, identifier);
|
|
51699
|
+
imports.push(import_typescript129.default.factory.createCallExpression(forwardRefExpression, void 0, [arrowFunction]));
|
|
51613
51700
|
} else {
|
|
51614
51701
|
imports.push(identifier);
|
|
51615
51702
|
}
|
|
@@ -51634,11 +51721,11 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
51634
51721
|
const declarationsToCopy = [];
|
|
51635
51722
|
const properties = [];
|
|
51636
51723
|
const importsProp = findLiteralProperty(literal3, "imports");
|
|
51637
|
-
const hasAnyArrayTrailingComma = literal3.properties.some((prop) =>
|
|
51638
|
-
if (
|
|
51639
|
-
if (
|
|
51724
|
+
const hasAnyArrayTrailingComma = literal3.properties.some((prop) => import_typescript129.default.isPropertyAssignment(prop) && import_typescript129.default.isArrayLiteralExpression(prop.initializer) && prop.initializer.elements.hasTrailingComma);
|
|
51725
|
+
if (import_typescript129.default.isPropertyAssignment(declarationsProp)) {
|
|
51726
|
+
if (import_typescript129.default.isArrayLiteralExpression(declarationsProp.initializer)) {
|
|
51640
51727
|
for (const el of declarationsProp.initializer.elements) {
|
|
51641
|
-
if (
|
|
51728
|
+
if (import_typescript129.default.isIdentifier(el)) {
|
|
51642
51729
|
const correspondingClass = findClassDeclaration(el, typeChecker);
|
|
51643
51730
|
if (!correspondingClass || isStandaloneDeclaration(correspondingClass, allDeclarations, templateTypeChecker)) {
|
|
51644
51731
|
declarationsToCopy.push(el);
|
|
@@ -51650,11 +51737,11 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
51650
51737
|
}
|
|
51651
51738
|
}
|
|
51652
51739
|
} else {
|
|
51653
|
-
declarationsToCopy.push(
|
|
51740
|
+
declarationsToCopy.push(import_typescript129.default.factory.createSpreadElement(declarationsProp.initializer));
|
|
51654
51741
|
}
|
|
51655
51742
|
}
|
|
51656
51743
|
if (!importsProp && declarationsToCopy.length > 0) {
|
|
51657
|
-
properties.push(
|
|
51744
|
+
properties.push(import_typescript129.default.factory.createPropertyAssignment("imports", import_typescript129.default.factory.createArrayLiteralExpression(import_typescript129.default.factory.createNodeArray(declarationsToCopy, hasAnyArrayTrailingComma && declarationsToCopy.length > 2))));
|
|
51658
51745
|
}
|
|
51659
51746
|
for (const prop of literal3.properties) {
|
|
51660
51747
|
if (!isNamedPropertyAssignment(prop)) {
|
|
@@ -51663,49 +51750,49 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
51663
51750
|
}
|
|
51664
51751
|
if (prop === declarationsProp) {
|
|
51665
51752
|
if (declarationsToPreserve.length > 0) {
|
|
51666
|
-
const hasTrailingComma =
|
|
51667
|
-
properties.push(
|
|
51753
|
+
const hasTrailingComma = import_typescript129.default.isArrayLiteralExpression(prop.initializer) ? prop.initializer.elements.hasTrailingComma : hasAnyArrayTrailingComma;
|
|
51754
|
+
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))));
|
|
51668
51755
|
}
|
|
51669
51756
|
continue;
|
|
51670
51757
|
}
|
|
51671
51758
|
if (prop === importsProp && declarationsToCopy.length > 0) {
|
|
51672
51759
|
let initializer;
|
|
51673
|
-
if (
|
|
51674
|
-
initializer =
|
|
51760
|
+
if (import_typescript129.default.isArrayLiteralExpression(prop.initializer)) {
|
|
51761
|
+
initializer = import_typescript129.default.factory.updateArrayLiteralExpression(prop.initializer, import_typescript129.default.factory.createNodeArray([...prop.initializer.elements, ...declarationsToCopy], prop.initializer.elements.hasTrailingComma));
|
|
51675
51762
|
} else {
|
|
51676
|
-
initializer =
|
|
51677
|
-
[
|
|
51763
|
+
initializer = import_typescript129.default.factory.createArrayLiteralExpression(import_typescript129.default.factory.createNodeArray(
|
|
51764
|
+
[import_typescript129.default.factory.createSpreadElement(prop.initializer), ...declarationsToCopy],
|
|
51678
51765
|
hasAnyArrayTrailingComma && declarationsToCopy.length > 1
|
|
51679
51766
|
));
|
|
51680
51767
|
}
|
|
51681
|
-
properties.push(
|
|
51768
|
+
properties.push(import_typescript129.default.factory.updatePropertyAssignment(prop, prop.name, initializer));
|
|
51682
51769
|
continue;
|
|
51683
51770
|
}
|
|
51684
51771
|
properties.push(prop);
|
|
51685
51772
|
}
|
|
51686
|
-
tracker.replaceNode(literal3,
|
|
51773
|
+
tracker.replaceNode(literal3, import_typescript129.default.factory.updateObjectLiteralExpression(literal3, import_typescript129.default.factory.createNodeArray(properties, literal3.properties.hasTrailingComma)), import_typescript129.default.EmitHint.Expression);
|
|
51687
51774
|
}
|
|
51688
51775
|
function addStandaloneToDecorator(node) {
|
|
51689
|
-
return addPropertyToAngularDecorator(node,
|
|
51776
|
+
return addPropertyToAngularDecorator(node, import_typescript129.default.factory.createPropertyAssignment("standalone", import_typescript129.default.factory.createToken(import_typescript129.default.SyntaxKind.TrueKeyword)));
|
|
51690
51777
|
}
|
|
51691
51778
|
function addPropertyToAngularDecorator(node, property2) {
|
|
51692
|
-
if (!
|
|
51779
|
+
if (!import_typescript129.default.isCallExpression(node.expression) || node.expression.arguments.length > 1) {
|
|
51693
51780
|
return node;
|
|
51694
51781
|
}
|
|
51695
51782
|
let literalProperties;
|
|
51696
51783
|
let hasTrailingComma = false;
|
|
51697
51784
|
if (node.expression.arguments.length === 0) {
|
|
51698
51785
|
literalProperties = [property2];
|
|
51699
|
-
} else if (
|
|
51786
|
+
} else if (import_typescript129.default.isObjectLiteralExpression(node.expression.arguments[0])) {
|
|
51700
51787
|
hasTrailingComma = node.expression.arguments[0].properties.hasTrailingComma;
|
|
51701
51788
|
literalProperties = [...node.expression.arguments[0].properties, property2];
|
|
51702
51789
|
} else {
|
|
51703
51790
|
return node;
|
|
51704
51791
|
}
|
|
51705
|
-
return
|
|
51792
|
+
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)]));
|
|
51706
51793
|
}
|
|
51707
51794
|
function isNamedPropertyAssignment(node) {
|
|
51708
|
-
return
|
|
51795
|
+
return import_typescript129.default.isPropertyAssignment(node) && node.name && import_typescript129.default.isIdentifier(node.name);
|
|
51709
51796
|
}
|
|
51710
51797
|
function findImportLocation(target, inComponent, importMode, typeChecker) {
|
|
51711
51798
|
const importLocations = typeChecker.getPotentialImportsFor(target, inComponent, importMode);
|
|
@@ -51725,14 +51812,14 @@ function findImportLocation(target, inComponent, importMode, typeChecker) {
|
|
|
51725
51812
|
return firstSameFileImport || firstModuleImport || importLocations[0] || null;
|
|
51726
51813
|
}
|
|
51727
51814
|
function hasNgModuleMetadataElements(node) {
|
|
51728
|
-
return
|
|
51815
|
+
return import_typescript129.default.isPropertyAssignment(node) && (!import_typescript129.default.isArrayLiteralExpression(node.initializer) || node.initializer.elements.length > 0);
|
|
51729
51816
|
}
|
|
51730
51817
|
function findNgModuleClassesToMigrate(sourceFile, typeChecker) {
|
|
51731
51818
|
const modules = [];
|
|
51732
51819
|
if (getImportSpecifier(sourceFile, "@angular/core", "NgModule")) {
|
|
51733
51820
|
sourceFile.forEachChild(function walk(node) {
|
|
51734
|
-
if (
|
|
51735
|
-
const decorator = getAngularDecorators2(typeChecker,
|
|
51821
|
+
if (import_typescript129.default.isClassDeclaration(node)) {
|
|
51822
|
+
const decorator = getAngularDecorators2(typeChecker, import_typescript129.default.getDecorators(node) || []).find((current) => current.name === "NgModule");
|
|
51736
51823
|
const metadata = decorator ? extractMetadataLiteral(decorator.node) : null;
|
|
51737
51824
|
if (metadata) {
|
|
51738
51825
|
const declarations = findLiteralProperty(metadata, "declarations");
|
|
@@ -51752,13 +51839,13 @@ function findTestObjectsToMigrate(sourceFile, typeChecker) {
|
|
|
51752
51839
|
const catalystImport = getImportSpecifier(sourceFile, /testing\/catalyst$/, "setupModule");
|
|
51753
51840
|
if (testBedImport || catalystImport) {
|
|
51754
51841
|
sourceFile.forEachChild(function walk(node) {
|
|
51755
|
-
const isObjectLiteralCall =
|
|
51842
|
+
const isObjectLiteralCall = import_typescript129.default.isCallExpression(node) && node.arguments.length > 0 && import_typescript129.default.isObjectLiteralExpression(node.arguments[0]);
|
|
51756
51843
|
const config = isObjectLiteralCall ? node.arguments[0] : null;
|
|
51757
|
-
const isTestBedCall = isObjectLiteralCall && (testBedImport &&
|
|
51758
|
-
const isCatalystCall = isObjectLiteralCall && (catalystImport &&
|
|
51844
|
+
const isTestBedCall = isObjectLiteralCall && (testBedImport && import_typescript129.default.isPropertyAccessExpression(node.expression) && node.expression.name.text === "configureTestingModule" && isReferenceToImport(typeChecker, node.expression.expression, testBedImport));
|
|
51845
|
+
const isCatalystCall = isObjectLiteralCall && (catalystImport && import_typescript129.default.isIdentifier(node.expression) && isReferenceToImport(typeChecker, node.expression, catalystImport));
|
|
51759
51846
|
if ((isTestBedCall || isCatalystCall) && config) {
|
|
51760
51847
|
const declarations = findLiteralProperty(config, "declarations");
|
|
51761
|
-
if (declarations &&
|
|
51848
|
+
if (declarations && import_typescript129.default.isPropertyAssignment(declarations) && import_typescript129.default.isArrayLiteralExpression(declarations.initializer) && declarations.initializer.elements.length > 0) {
|
|
51762
51849
|
testObjects.push(config);
|
|
51763
51850
|
}
|
|
51764
51851
|
}
|
|
@@ -51773,7 +51860,7 @@ function findTemplateDependencies(decl, typeChecker) {
|
|
|
51773
51860
|
const usedPipes = typeChecker.getUsedPipes(decl);
|
|
51774
51861
|
if (usedDirectives !== null) {
|
|
51775
51862
|
for (const dir of usedDirectives) {
|
|
51776
|
-
if (
|
|
51863
|
+
if (import_typescript129.default.isClassDeclaration(dir.ref.node)) {
|
|
51777
51864
|
results.push(dir.ref);
|
|
51778
51865
|
}
|
|
51779
51866
|
}
|
|
@@ -51781,7 +51868,7 @@ function findTemplateDependencies(decl, typeChecker) {
|
|
|
51781
51868
|
if (usedPipes !== null) {
|
|
51782
51869
|
const potentialPipes = typeChecker.getPotentialPipes(decl);
|
|
51783
51870
|
for (const pipe2 of potentialPipes) {
|
|
51784
|
-
if (
|
|
51871
|
+
if (import_typescript129.default.isClassDeclaration(pipe2.ref.node) && usedPipes.some((current) => pipe2.name === current)) {
|
|
51785
51872
|
results.push(pipe2.ref);
|
|
51786
51873
|
}
|
|
51787
51874
|
}
|
|
@@ -51795,12 +51882,12 @@ function filterNonBootstrappedDeclarations(declarations, ngModule, templateTypeC
|
|
|
51795
51882
|
if (!bootstrapProp) {
|
|
51796
51883
|
return declarations;
|
|
51797
51884
|
}
|
|
51798
|
-
if (!
|
|
51885
|
+
if (!import_typescript129.default.isPropertyAssignment(bootstrapProp) || !import_typescript129.default.isArrayLiteralExpression(bootstrapProp.initializer)) {
|
|
51799
51886
|
return [];
|
|
51800
51887
|
}
|
|
51801
51888
|
const bootstrappedClasses = /* @__PURE__ */ new Set();
|
|
51802
51889
|
for (const el of bootstrapProp.initializer.elements) {
|
|
51803
|
-
const referencedClass =
|
|
51890
|
+
const referencedClass = import_typescript129.default.isIdentifier(el) ? findClassDeclaration(el, typeChecker) : null;
|
|
51804
51891
|
if (referencedClass) {
|
|
51805
51892
|
bootstrappedClasses.add(referencedClass);
|
|
51806
51893
|
} else {
|
|
@@ -51811,14 +51898,14 @@ function filterNonBootstrappedDeclarations(declarations, ngModule, templateTypeC
|
|
|
51811
51898
|
}
|
|
51812
51899
|
function extractDeclarationsFromModule(ngModule, templateTypeChecker) {
|
|
51813
51900
|
const metadata = templateTypeChecker.getNgModuleMetadata(ngModule);
|
|
51814
|
-
return metadata ? metadata.declarations.filter((decl) =>
|
|
51901
|
+
return metadata ? metadata.declarations.filter((decl) => import_typescript129.default.isClassDeclaration(decl.node)).map((decl) => decl.node) : [];
|
|
51815
51902
|
}
|
|
51816
51903
|
function migrateTestDeclarations(testObjects, declarationsOutsideOfTestFiles, tracker, templateTypeChecker, typeChecker) {
|
|
51817
51904
|
var _a2;
|
|
51818
51905
|
const { decorators, componentImports } = analyzeTestingModules(testObjects, typeChecker);
|
|
51819
51906
|
const allDeclarations = new Set(declarationsOutsideOfTestFiles);
|
|
51820
51907
|
for (const decorator of decorators) {
|
|
51821
|
-
const closestClass = closestNode(decorator.node,
|
|
51908
|
+
const closestClass = closestNode(decorator.node, import_typescript129.default.isClassDeclaration);
|
|
51822
51909
|
if (decorator.name === "Pipe" || decorator.name === "Directive") {
|
|
51823
51910
|
tracker.replaceNode(decorator.node, addStandaloneToDecorator(decorator.node));
|
|
51824
51911
|
if (closestClass) {
|
|
@@ -51832,8 +51919,8 @@ function migrateTestDeclarations(testObjects, declarationsOutsideOfTestFiles, tr
|
|
|
51832
51919
|
}
|
|
51833
51920
|
if (importsToAdd && importsToAdd.size > 0) {
|
|
51834
51921
|
const hasTrailingComma = importsToAdd.size > 2 && !!((_a2 = extractMetadataLiteral(decorator.node)) == null ? void 0 : _a2.properties.hasTrailingComma);
|
|
51835
|
-
const importsArray =
|
|
51836
|
-
tracker.replaceNode(decorator.node, addPropertyToAngularDecorator(newDecorator,
|
|
51922
|
+
const importsArray = import_typescript129.default.factory.createNodeArray(Array.from(importsToAdd), hasTrailingComma);
|
|
51923
|
+
tracker.replaceNode(decorator.node, addPropertyToAngularDecorator(newDecorator, import_typescript129.default.factory.createPropertyAssignment("imports", import_typescript129.default.factory.createArrayLiteralExpression(importsArray))));
|
|
51837
51924
|
} else {
|
|
51838
51925
|
tracker.replaceNode(decorator.node, newDecorator);
|
|
51839
51926
|
}
|
|
@@ -51854,13 +51941,13 @@ function analyzeTestingModules(testObjects, typeChecker) {
|
|
|
51854
51941
|
}
|
|
51855
51942
|
const importsProp = findLiteralProperty(obj, "imports");
|
|
51856
51943
|
const importElements = importsProp && hasNgModuleMetadataElements(importsProp) ? importsProp.initializer.elements.filter((el) => {
|
|
51857
|
-
return !
|
|
51944
|
+
return !import_typescript129.default.isCallExpression(el) && !isClassReferenceInAngularModule(el, /^BrowserAnimationsModule|NoopAnimationsModule$/, "platform-browser/animations", typeChecker);
|
|
51858
51945
|
}) : null;
|
|
51859
51946
|
for (const decl of declarations) {
|
|
51860
51947
|
if (seenDeclarations.has(decl)) {
|
|
51861
51948
|
continue;
|
|
51862
51949
|
}
|
|
51863
|
-
const [decorator] = getAngularDecorators2(typeChecker,
|
|
51950
|
+
const [decorator] = getAngularDecorators2(typeChecker, import_typescript129.default.getDecorators(decl) || []);
|
|
51864
51951
|
if (decorator) {
|
|
51865
51952
|
seenDeclarations.add(decl);
|
|
51866
51953
|
decorators.push(decorator);
|
|
@@ -51891,7 +51978,7 @@ function extractDeclarationsFromTestObject(obj, typeChecker) {
|
|
|
51891
51978
|
return results;
|
|
51892
51979
|
}
|
|
51893
51980
|
function extractMetadataLiteral(decorator) {
|
|
51894
|
-
return
|
|
51981
|
+
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;
|
|
51895
51982
|
}
|
|
51896
51983
|
function isStandaloneDeclaration(node, declarationsInMigration, templateTypeChecker) {
|
|
51897
51984
|
if (declarationsInMigration.has(node)) {
|
|
@@ -51913,7 +52000,7 @@ function toStandaloneBootstrap(program, host, basePath, rootFileNames, sourceFil
|
|
|
51913
52000
|
const additionalProviders = hasImport(program, rootFileNames, "protractor") ? /* @__PURE__ */ new Map([["provideProtractorTestingSupport", "@angular/platform-browser"]]) : null;
|
|
51914
52001
|
for (const sourceFile of sourceFiles) {
|
|
51915
52002
|
sourceFile.forEachChild(function walk(node) {
|
|
51916
|
-
if (
|
|
52003
|
+
if (import_typescript130.default.isCallExpression(node) && import_typescript130.default.isPropertyAccessExpression(node.expression) && node.expression.name.text === "bootstrapModule" && isClassReferenceInAngularModule(node.expression, "PlatformRef", "core", typeChecker)) {
|
|
51917
52004
|
const call2 = analyzeBootstrapCall(node, typeChecker, templateTypeChecker);
|
|
51918
52005
|
if (call2) {
|
|
51919
52006
|
bootstrapCalls.push(call2);
|
|
@@ -51934,24 +52021,24 @@ function toStandaloneBootstrap(program, host, basePath, rootFileNames, sourceFil
|
|
|
51934
52021
|
return tracker.recordChanges();
|
|
51935
52022
|
}
|
|
51936
52023
|
function analyzeBootstrapCall(call2, typeChecker, templateTypeChecker) {
|
|
51937
|
-
if (call2.arguments.length === 0 || !
|
|
52024
|
+
if (call2.arguments.length === 0 || !import_typescript130.default.isIdentifier(call2.arguments[0])) {
|
|
51938
52025
|
return null;
|
|
51939
52026
|
}
|
|
51940
52027
|
const declaration = findClassDeclaration(call2.arguments[0], typeChecker);
|
|
51941
52028
|
if (!declaration) {
|
|
51942
52029
|
return null;
|
|
51943
52030
|
}
|
|
51944
|
-
const decorator = getAngularDecorators2(typeChecker,
|
|
51945
|
-
if (!decorator || decorator.node.expression.arguments.length === 0 || !
|
|
52031
|
+
const decorator = getAngularDecorators2(typeChecker, import_typescript130.default.getDecorators(declaration) || []).find((decorator2) => decorator2.name === "NgModule");
|
|
52032
|
+
if (!decorator || decorator.node.expression.arguments.length === 0 || !import_typescript130.default.isObjectLiteralExpression(decorator.node.expression.arguments[0])) {
|
|
51946
52033
|
return null;
|
|
51947
52034
|
}
|
|
51948
52035
|
const metadata = decorator.node.expression.arguments[0];
|
|
51949
52036
|
const bootstrapProp = findLiteralProperty(metadata, "bootstrap");
|
|
51950
|
-
if (!bootstrapProp || !
|
|
52037
|
+
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])) {
|
|
51951
52038
|
return null;
|
|
51952
52039
|
}
|
|
51953
52040
|
const component = findClassDeclaration(bootstrapProp.initializer.elements[0], typeChecker);
|
|
51954
|
-
if (component && component.name &&
|
|
52041
|
+
if (component && component.name && import_typescript130.default.isIdentifier(component.name)) {
|
|
51955
52042
|
return {
|
|
51956
52043
|
module: declaration,
|
|
51957
52044
|
metadata,
|
|
@@ -51973,22 +52060,22 @@ function migrateBootstrapCall(analysis, tracker, additionalProviders, referenceR
|
|
|
51973
52060
|
let nodeLookup = null;
|
|
51974
52061
|
tracker.insertText(moduleSourceFile, analysis.metadata.getStart(), "/* TODO(standalone-migration): clean up removed NgModule class manually. \n");
|
|
51975
52062
|
tracker.insertText(moduleSourceFile, analysis.metadata.getEnd(), " */");
|
|
51976
|
-
if (providers &&
|
|
52063
|
+
if (providers && import_typescript130.default.isPropertyAssignment(providers)) {
|
|
51977
52064
|
nodeLookup = nodeLookup || getNodeLookup(moduleSourceFile);
|
|
51978
|
-
if (
|
|
52065
|
+
if (import_typescript130.default.isArrayLiteralExpression(providers.initializer)) {
|
|
51979
52066
|
providersInNewCall.push(...providers.initializer.elements);
|
|
51980
52067
|
} else {
|
|
51981
|
-
providersInNewCall.push(
|
|
52068
|
+
providersInNewCall.push(import_typescript130.default.factory.createSpreadElement(providers.initializer));
|
|
51982
52069
|
}
|
|
51983
52070
|
addNodesToCopy(sourceFile, providers, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
51984
52071
|
}
|
|
51985
|
-
if (imports &&
|
|
52072
|
+
if (imports && import_typescript130.default.isPropertyAssignment(imports)) {
|
|
51986
52073
|
nodeLookup = nodeLookup || getNodeLookup(moduleSourceFile);
|
|
51987
52074
|
migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, moduleImportsInNewCall, providersInNewCall, tracker, nodesToCopy, referenceResolver, typeChecker);
|
|
51988
52075
|
}
|
|
51989
52076
|
if (additionalProviders) {
|
|
51990
52077
|
additionalProviders.forEach((moduleSpecifier, name) => {
|
|
51991
|
-
providersInNewCall.push(
|
|
52078
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, name, moduleSpecifier), void 0, void 0));
|
|
51992
52079
|
});
|
|
51993
52080
|
}
|
|
51994
52081
|
if (nodesToCopy.size > 0) {
|
|
@@ -51998,7 +52085,7 @@ function migrateBootstrapCall(analysis, tracker, additionalProviders, referenceR
|
|
|
51998
52085
|
if (transformedNode === node) {
|
|
51999
52086
|
text2 += transformedNode.getText() + "\n";
|
|
52000
52087
|
} else {
|
|
52001
|
-
text2 += printer.printNode(
|
|
52088
|
+
text2 += printer.printNode(import_typescript130.default.EmitHint.Unspecified, transformedNode, node.getSourceFile());
|
|
52002
52089
|
}
|
|
52003
52090
|
});
|
|
52004
52091
|
text2 += "\n";
|
|
@@ -52015,31 +52102,31 @@ function replaceBootstrapCallExpression(analysis, providers, modules, tracker) {
|
|
|
52015
52102
|
const combinedProviders = [];
|
|
52016
52103
|
if (modules.length > 0) {
|
|
52017
52104
|
const importProvidersExpression = tracker.addImport(sourceFile, "importProvidersFrom", "@angular/core");
|
|
52018
|
-
combinedProviders.push(
|
|
52105
|
+
combinedProviders.push(import_typescript130.default.factory.createCallExpression(importProvidersExpression, [], modules));
|
|
52019
52106
|
}
|
|
52020
52107
|
combinedProviders.push(...providers);
|
|
52021
|
-
const providersArray =
|
|
52022
|
-
const initializer = remapDynamicImports(sourceFile.fileName,
|
|
52023
|
-
args.push(
|
|
52108
|
+
const providersArray = import_typescript130.default.factory.createNodeArray(combinedProviders, analysis.metadata.properties.hasTrailingComma && combinedProviders.length > 2);
|
|
52109
|
+
const initializer = remapDynamicImports(sourceFile.fileName, import_typescript130.default.factory.createArrayLiteralExpression(providersArray, combinedProviders.length > 1));
|
|
52110
|
+
args.push(import_typescript130.default.factory.createObjectLiteralExpression([import_typescript130.default.factory.createPropertyAssignment("providers", initializer)], true));
|
|
52024
52111
|
}
|
|
52025
52112
|
tracker.replaceNode(
|
|
52026
52113
|
analysis.call,
|
|
52027
|
-
|
|
52114
|
+
import_typescript130.default.factory.createCallExpression(bootstrapExpression, [], args),
|
|
52028
52115
|
void 0,
|
|
52029
52116
|
analysis.metadata.getSourceFile()
|
|
52030
52117
|
);
|
|
52031
52118
|
}
|
|
52032
52119
|
function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, importsForNewCall, providersInNewCall, tracker, nodesToCopy, referenceResolver, typeChecker) {
|
|
52033
|
-
if (!
|
|
52120
|
+
if (!import_typescript130.default.isArrayLiteralExpression(imports.initializer)) {
|
|
52034
52121
|
importsForNewCall.push(imports.initializer);
|
|
52035
52122
|
return;
|
|
52036
52123
|
}
|
|
52037
52124
|
for (const element2 of imports.initializer.elements) {
|
|
52038
|
-
if (
|
|
52125
|
+
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)) {
|
|
52039
52126
|
const options = element2.arguments[1];
|
|
52040
52127
|
const features = options ? getRouterModuleForRootFeatures(sourceFile, options, tracker) : [];
|
|
52041
52128
|
if (features !== null) {
|
|
52042
|
-
providersInNewCall.push(
|
|
52129
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideRouter", "@angular/router"), [], [element2.arguments[0], ...features]));
|
|
52043
52130
|
addNodesToCopy(sourceFile, element2.arguments[0], nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
52044
52131
|
if (options) {
|
|
52045
52132
|
addNodesToCopy(sourceFile, options, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
@@ -52047,30 +52134,30 @@ function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, imports
|
|
|
52047
52134
|
continue;
|
|
52048
52135
|
}
|
|
52049
52136
|
}
|
|
52050
|
-
if (
|
|
52137
|
+
if (import_typescript130.default.isIdentifier(element2)) {
|
|
52051
52138
|
const animationsModule = "platform-browser/animations";
|
|
52052
52139
|
const animationsImport = `@angular/${animationsModule}`;
|
|
52053
52140
|
if (isClassReferenceInAngularModule(element2, "BrowserAnimationsModule", animationsModule, typeChecker)) {
|
|
52054
|
-
providersInNewCall.push(
|
|
52141
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideAnimations", animationsImport), [], []));
|
|
52055
52142
|
continue;
|
|
52056
52143
|
}
|
|
52057
52144
|
if (isClassReferenceInAngularModule(element2, "NoopAnimationsModule", animationsModule, typeChecker)) {
|
|
52058
|
-
providersInNewCall.push(
|
|
52145
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideNoopAnimations", animationsImport), [], []));
|
|
52059
52146
|
continue;
|
|
52060
52147
|
}
|
|
52061
52148
|
const httpClientModule = "common/http";
|
|
52062
52149
|
const httpClientImport = `@angular/${httpClientModule}`;
|
|
52063
52150
|
if (isClassReferenceInAngularModule(element2, "HttpClientModule", httpClientModule, typeChecker)) {
|
|
52064
52151
|
const callArgs = [
|
|
52065
|
-
|
|
52152
|
+
import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "withInterceptorsFromDi", httpClientImport), [], [])
|
|
52066
52153
|
];
|
|
52067
|
-
providersInNewCall.push(
|
|
52154
|
+
providersInNewCall.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideHttpClient", httpClientImport), [], callArgs));
|
|
52068
52155
|
continue;
|
|
52069
52156
|
}
|
|
52070
52157
|
}
|
|
52071
|
-
const target =
|
|
52158
|
+
const target = import_typescript130.default.isCallExpression(element2) && import_typescript130.default.isPropertyAccessExpression(element2.expression) ? element2.expression.expression : element2;
|
|
52072
52159
|
const classDeclaration = findClassDeclaration(target, typeChecker);
|
|
52073
|
-
const decorators = classDeclaration ? getAngularDecorators2(typeChecker,
|
|
52160
|
+
const decorators = classDeclaration ? getAngularDecorators2(typeChecker, import_typescript130.default.getDecorators(classDeclaration) || []) : void 0;
|
|
52074
52161
|
if (!decorators || decorators.length === 0 || decorators.every(({ name }) => name !== "Directive" && name !== "Component" && name !== "Pipe")) {
|
|
52075
52162
|
importsForNewCall.push(element2);
|
|
52076
52163
|
addNodesToCopy(sourceFile, element2, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
@@ -52078,7 +52165,7 @@ function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, imports
|
|
|
52078
52165
|
}
|
|
52079
52166
|
}
|
|
52080
52167
|
function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
52081
|
-
if (!
|
|
52168
|
+
if (!import_typescript130.default.isObjectLiteralExpression(options)) {
|
|
52082
52169
|
return null;
|
|
52083
52170
|
}
|
|
52084
52171
|
const featureExpressions = [];
|
|
@@ -52086,7 +52173,7 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52086
52173
|
const inMemoryScrollingOptions = [];
|
|
52087
52174
|
const features = new UniqueItemTracker();
|
|
52088
52175
|
for (const prop of options.properties) {
|
|
52089
|
-
if (!
|
|
52176
|
+
if (!import_typescript130.default.isPropertyAssignment(prop) || !import_typescript130.default.isIdentifier(prop.name) && !import_typescript130.default.isStringLiteralLike(prop.name)) {
|
|
52090
52177
|
return null;
|
|
52091
52178
|
}
|
|
52092
52179
|
switch (prop.name.text) {
|
|
@@ -52094,12 +52181,12 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52094
52181
|
features.track("withPreloading", prop.initializer);
|
|
52095
52182
|
break;
|
|
52096
52183
|
case "enableTracing":
|
|
52097
|
-
if (prop.initializer.kind ===
|
|
52184
|
+
if (prop.initializer.kind === import_typescript130.default.SyntaxKind.TrueKeyword) {
|
|
52098
52185
|
features.track("withDebugTracing", null);
|
|
52099
52186
|
}
|
|
52100
52187
|
break;
|
|
52101
52188
|
case "initialNavigation":
|
|
52102
|
-
if (!
|
|
52189
|
+
if (!import_typescript130.default.isStringLiteralLike(prop.initializer)) {
|
|
52103
52190
|
return null;
|
|
52104
52191
|
}
|
|
52105
52192
|
if (prop.initializer.text === "enabledBlocking" || prop.initializer.text === "enabled") {
|
|
@@ -52109,7 +52196,7 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52109
52196
|
}
|
|
52110
52197
|
break;
|
|
52111
52198
|
case "useHash":
|
|
52112
|
-
if (prop.initializer.kind ===
|
|
52199
|
+
if (prop.initializer.kind === import_typescript130.default.SyntaxKind.TrueKeyword) {
|
|
52113
52200
|
features.track("withHashLocation", null);
|
|
52114
52201
|
}
|
|
52115
52202
|
break;
|
|
@@ -52126,10 +52213,10 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52126
52213
|
}
|
|
52127
52214
|
}
|
|
52128
52215
|
if (inMemoryScrollingOptions.length > 0) {
|
|
52129
|
-
features.track("withInMemoryScrolling",
|
|
52216
|
+
features.track("withInMemoryScrolling", import_typescript130.default.factory.createObjectLiteralExpression(inMemoryScrollingOptions));
|
|
52130
52217
|
}
|
|
52131
52218
|
if (configOptions.length > 0) {
|
|
52132
|
-
features.track("withRouterConfig",
|
|
52219
|
+
features.track("withRouterConfig", import_typescript130.default.factory.createObjectLiteralExpression(configOptions));
|
|
52133
52220
|
}
|
|
52134
52221
|
for (const [feature, featureArgs] of features.getEntries()) {
|
|
52135
52222
|
const callArgs = [];
|
|
@@ -52138,25 +52225,25 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
52138
52225
|
callArgs.push(arg);
|
|
52139
52226
|
}
|
|
52140
52227
|
});
|
|
52141
|
-
featureExpressions.push(
|
|
52228
|
+
featureExpressions.push(import_typescript130.default.factory.createCallExpression(tracker.addImport(sourceFile, feature, "@angular/router"), [], callArgs));
|
|
52142
52229
|
}
|
|
52143
52230
|
return featureExpressions;
|
|
52144
52231
|
}
|
|
52145
52232
|
function addNodesToCopy(targetFile, rootNode, nodeLookup, tracker, nodesToCopy, referenceResolver) {
|
|
52146
52233
|
const refs = findAllSameFileReferences(rootNode, nodeLookup, referenceResolver);
|
|
52147
52234
|
for (const ref of refs) {
|
|
52148
|
-
const importSpecifier = closestOrSelf(ref,
|
|
52149
|
-
const importDeclaration = importSpecifier ? closestNode(importSpecifier,
|
|
52150
|
-
if (importDeclaration && importSpecifier &&
|
|
52235
|
+
const importSpecifier = closestOrSelf(ref, import_typescript130.default.isImportSpecifier);
|
|
52236
|
+
const importDeclaration = importSpecifier ? closestNode(importSpecifier, import_typescript130.default.isImportDeclaration) : null;
|
|
52237
|
+
if (importDeclaration && importSpecifier && import_typescript130.default.isStringLiteralLike(importDeclaration.moduleSpecifier)) {
|
|
52151
52238
|
const moduleName = importDeclaration.moduleSpecifier.text.startsWith(".") ? remapRelativeImport(targetFile.fileName, importDeclaration.moduleSpecifier) : importDeclaration.moduleSpecifier.text;
|
|
52152
52239
|
const symbolName = importSpecifier.propertyName ? importSpecifier.propertyName.text : importSpecifier.name.text;
|
|
52153
52240
|
const alias = importSpecifier.propertyName ? importSpecifier.name.text : null;
|
|
52154
52241
|
tracker.addImport(targetFile, symbolName, moduleName, alias);
|
|
52155
52242
|
continue;
|
|
52156
52243
|
}
|
|
52157
|
-
const variableDeclaration = closestOrSelf(ref,
|
|
52158
|
-
const variableStatement = variableDeclaration ? closestNode(variableDeclaration,
|
|
52159
|
-
if (variableDeclaration && variableStatement &&
|
|
52244
|
+
const variableDeclaration = closestOrSelf(ref, import_typescript130.default.isVariableDeclaration);
|
|
52245
|
+
const variableStatement = variableDeclaration ? closestNode(variableDeclaration, import_typescript130.default.isVariableStatement) : null;
|
|
52246
|
+
if (variableDeclaration && variableStatement && import_typescript130.default.isIdentifier(variableDeclaration.name)) {
|
|
52160
52247
|
if (isExported(variableStatement)) {
|
|
52161
52248
|
tracker.addImport(targetFile, variableDeclaration.name.text, getRelativeImportPath(targetFile.fileName, ref.getSourceFile().fileName));
|
|
52162
52249
|
} else {
|
|
@@ -52197,7 +52284,7 @@ function findAllSameFileReferences(rootNode, nodeLookup, referenceResolver) {
|
|
|
52197
52284
|
if (!closestTopLevel || traversedTopLevelNodes.has(closestTopLevel)) {
|
|
52198
52285
|
continue;
|
|
52199
52286
|
}
|
|
52200
|
-
if (!
|
|
52287
|
+
if (!import_typescript130.default.isImportDeclaration(closestTopLevel) && isOutsideRange(excludeStart, excludeEnd, closestTopLevel.getStart(), closestTopLevel.getEnd())) {
|
|
52201
52288
|
traversedTopLevelNodes.add(closestTopLevel);
|
|
52202
52289
|
walk(closestTopLevel);
|
|
52203
52290
|
}
|
|
@@ -52218,25 +52305,25 @@ function referencesToNodeWithinSameFile(node, nodeLookup, excludeStart, excludeE
|
|
|
52218
52305
|
function remapDynamicImports(targetFileName, rootNode) {
|
|
52219
52306
|
let hasChanged = false;
|
|
52220
52307
|
const transformer = (context) => {
|
|
52221
|
-
return (sourceFile) =>
|
|
52222
|
-
if (
|
|
52308
|
+
return (sourceFile) => import_typescript130.default.visitNode(sourceFile, function walk(node) {
|
|
52309
|
+
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(".")) {
|
|
52223
52310
|
hasChanged = true;
|
|
52224
52311
|
return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [
|
|
52225
52312
|
context.factory.createStringLiteral(remapRelativeImport(targetFileName, node.arguments[0])),
|
|
52226
52313
|
...node.arguments.slice(1)
|
|
52227
52314
|
]);
|
|
52228
52315
|
}
|
|
52229
|
-
return
|
|
52316
|
+
return import_typescript130.default.visitEachChild(node, walk, context);
|
|
52230
52317
|
});
|
|
52231
52318
|
};
|
|
52232
|
-
const result =
|
|
52319
|
+
const result = import_typescript130.default.transform(rootNode, [transformer]).transformed[0];
|
|
52233
52320
|
return hasChanged ? result : rootNode;
|
|
52234
52321
|
}
|
|
52235
52322
|
function isTopLevelStatement(node) {
|
|
52236
|
-
return node.parent != null &&
|
|
52323
|
+
return node.parent != null && import_typescript130.default.isSourceFile(node.parent);
|
|
52237
52324
|
}
|
|
52238
52325
|
function isReferenceIdentifier(node) {
|
|
52239
|
-
return
|
|
52326
|
+
return import_typescript130.default.isIdentifier(node) && (!import_typescript130.default.isPropertyAssignment(node.parent) && !import_typescript130.default.isParameter(node.parent) || node.parent.name !== node);
|
|
52240
52327
|
}
|
|
52241
52328
|
function isOutsideRange(excludeStart, excludeEnd, start, end) {
|
|
52242
52329
|
return start < excludeStart && end < excludeStart || start > excludeEnd;
|
|
@@ -52245,15 +52332,15 @@ function remapRelativeImport(targetFileName, specifier) {
|
|
|
52245
52332
|
return getRelativeImportPath(targetFileName, (0, import_path7.join)((0, import_path7.dirname)(specifier.getSourceFile().fileName), specifier.text));
|
|
52246
52333
|
}
|
|
52247
52334
|
function isExported(node) {
|
|
52248
|
-
return
|
|
52335
|
+
return import_typescript130.default.canHaveModifiers(node) && node.modifiers ? node.modifiers.some((modifier) => modifier.kind === import_typescript130.default.SyntaxKind.ExportKeyword) : false;
|
|
52249
52336
|
}
|
|
52250
52337
|
function isExportableDeclaration(node) {
|
|
52251
|
-
return
|
|
52338
|
+
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);
|
|
52252
52339
|
}
|
|
52253
52340
|
function getLastImportEnd(sourceFile) {
|
|
52254
52341
|
let index = 0;
|
|
52255
52342
|
for (const statement of sourceFile.statements) {
|
|
52256
|
-
if (
|
|
52343
|
+
if (import_typescript130.default.isImportDeclaration(statement)) {
|
|
52257
52344
|
index = Math.max(index, statement.getEnd());
|
|
52258
52345
|
} else {
|
|
52259
52346
|
break;
|
|
@@ -52270,7 +52357,7 @@ function hasImport(program, rootFileNames, moduleName) {
|
|
|
52270
52357
|
continue;
|
|
52271
52358
|
}
|
|
52272
52359
|
for (const statement of sourceFile.statements) {
|
|
52273
|
-
if (
|
|
52360
|
+
if (import_typescript130.default.isImportDeclaration(statement) && import_typescript130.default.isStringLiteralLike(statement.moduleSpecifier) && (statement.moduleSpecifier.text === moduleName || statement.moduleSpecifier.text.startsWith(deepImportStart))) {
|
|
52274
52361
|
return true;
|
|
52275
52362
|
}
|
|
52276
52363
|
}
|
|
@@ -52318,7 +52405,7 @@ function standaloneMigration(tree, tsconfigPath, basePath, pathToMigrate, schema
|
|
|
52318
52405
|
});
|
|
52319
52406
|
const referenceLookupExcludedFiles = /node_modules|\.ngtypecheck\.ts/;
|
|
52320
52407
|
const program = createProgram({ rootNames, host, options, oldProgram });
|
|
52321
|
-
const printer =
|
|
52408
|
+
const printer = import_typescript131.default.createPrinter();
|
|
52322
52409
|
if ((0, import_fs2.existsSync)(pathToMigrate) && !(0, import_fs2.statSync)(pathToMigrate).isDirectory()) {
|
|
52323
52410
|
throw new import_schematics.SchematicsException(`Migration path ${pathToMigrate} has to be a directory. Cannot run the standalone migration.`);
|
|
52324
52411
|
}
|