@angular/core 15.2.0-rc.0 → 15.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/di/interface/defs.mjs +4 -5
- package/esm2020/src/di/provider_collection.mjs +2 -2
- package/esm2020/src/metadata/directives.mjs +1 -1
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +5 -6
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +5 -6
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +5 -6
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +5 -6
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/schematics/ng-generate/standalone-migration/bundle.js +248 -207
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
- package/esm2020/src/view/index.mjs +0 -9
|
@@ -16114,7 +16114,7 @@ function publishFacade(global2) {
|
|
|
16114
16114
|
}
|
|
16115
16115
|
|
|
16116
16116
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
16117
|
-
var VERSION2 = new Version("15.2.0
|
|
16117
|
+
var VERSION2 = new Version("15.2.0");
|
|
16118
16118
|
|
|
16119
16119
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
16120
16120
|
var _I18N_ATTR = "i18n";
|
|
@@ -17429,7 +17429,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
17429
17429
|
function compileDeclareClassMetadata(metadata) {
|
|
17430
17430
|
const definitionMap = new DefinitionMap();
|
|
17431
17431
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
17432
|
-
definitionMap.set("version", literal("15.2.0
|
|
17432
|
+
definitionMap.set("version", literal("15.2.0"));
|
|
17433
17433
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17434
17434
|
definitionMap.set("type", metadata.type);
|
|
17435
17435
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -17498,7 +17498,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
17498
17498
|
var _a;
|
|
17499
17499
|
const definitionMap = new DefinitionMap();
|
|
17500
17500
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
17501
|
-
definitionMap.set("version", literal("15.2.0
|
|
17501
|
+
definitionMap.set("version", literal("15.2.0"));
|
|
17502
17502
|
definitionMap.set("type", meta.internalType);
|
|
17503
17503
|
if (meta.isStandalone) {
|
|
17504
17504
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -17680,7 +17680,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION3 = "12.0.0";
|
|
|
17680
17680
|
function compileDeclareFactoryFunction(meta) {
|
|
17681
17681
|
const definitionMap = new DefinitionMap();
|
|
17682
17682
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
17683
|
-
definitionMap.set("version", literal("15.2.0
|
|
17683
|
+
definitionMap.set("version", literal("15.2.0"));
|
|
17684
17684
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17685
17685
|
definitionMap.set("type", meta.internalType);
|
|
17686
17686
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -17703,7 +17703,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
17703
17703
|
function createInjectableDefinitionMap(meta) {
|
|
17704
17704
|
const definitionMap = new DefinitionMap();
|
|
17705
17705
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
17706
|
-
definitionMap.set("version", literal("15.2.0
|
|
17706
|
+
definitionMap.set("version", literal("15.2.0"));
|
|
17707
17707
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17708
17708
|
definitionMap.set("type", meta.internalType);
|
|
17709
17709
|
if (meta.providedIn !== void 0) {
|
|
@@ -17741,7 +17741,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
17741
17741
|
function createInjectorDefinitionMap(meta) {
|
|
17742
17742
|
const definitionMap = new DefinitionMap();
|
|
17743
17743
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
17744
|
-
definitionMap.set("version", literal("15.2.0
|
|
17744
|
+
definitionMap.set("version", literal("15.2.0"));
|
|
17745
17745
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17746
17746
|
definitionMap.set("type", meta.internalType);
|
|
17747
17747
|
definitionMap.set("providers", meta.providers);
|
|
@@ -17762,7 +17762,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
17762
17762
|
function createNgModuleDefinitionMap(meta) {
|
|
17763
17763
|
const definitionMap = new DefinitionMap();
|
|
17764
17764
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
17765
|
-
definitionMap.set("version", literal("15.2.0
|
|
17765
|
+
definitionMap.set("version", literal("15.2.0"));
|
|
17766
17766
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17767
17767
|
definitionMap.set("type", meta.internalType);
|
|
17768
17768
|
if (meta.bootstrap.length > 0) {
|
|
@@ -17797,7 +17797,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
17797
17797
|
function createPipeDefinitionMap(meta) {
|
|
17798
17798
|
const definitionMap = new DefinitionMap();
|
|
17799
17799
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION7));
|
|
17800
|
-
definitionMap.set("version", literal("15.2.0
|
|
17800
|
+
definitionMap.set("version", literal("15.2.0"));
|
|
17801
17801
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
17802
17802
|
definitionMap.set("type", meta.internalType);
|
|
17803
17803
|
if (meta.isStandalone) {
|
|
@@ -17814,7 +17814,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
17814
17814
|
publishFacade(_global);
|
|
17815
17815
|
|
|
17816
17816
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
17817
|
-
var VERSION3 = new Version("15.2.0
|
|
17817
|
+
var VERSION3 = new Version("15.2.0");
|
|
17818
17818
|
|
|
17819
17819
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
17820
17820
|
var EmitFlags;
|
|
@@ -19228,8 +19228,42 @@ function validateAndRewriteCoreSymbol(name) {
|
|
|
19228
19228
|
return CORE_SUPPORTED_SYMBOLS.get(name);
|
|
19229
19229
|
}
|
|
19230
19230
|
|
|
19231
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/
|
|
19231
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/patch_alias_reference_resolution.mjs
|
|
19232
19232
|
var import_typescript14 = __toESM(require("typescript"), 1);
|
|
19233
|
+
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
19234
|
+
function loadIsReferencedAliasDeclarationPatch(context) {
|
|
19235
|
+
if (!isTransformationContextWithEmitResolver(context)) {
|
|
19236
|
+
throwIncompatibleTransformationContextError();
|
|
19237
|
+
}
|
|
19238
|
+
const emitResolver = context.getEmitResolver();
|
|
19239
|
+
const existingReferencedAliases = emitResolver[patchedReferencedAliasesSymbol];
|
|
19240
|
+
if (existingReferencedAliases !== void 0) {
|
|
19241
|
+
return existingReferencedAliases;
|
|
19242
|
+
}
|
|
19243
|
+
const originalIsReferencedAliasDeclaration = emitResolver.isReferencedAliasDeclaration;
|
|
19244
|
+
if (originalIsReferencedAliasDeclaration === void 0) {
|
|
19245
|
+
throwIncompatibleTransformationContextError();
|
|
19246
|
+
}
|
|
19247
|
+
const referencedAliases = /* @__PURE__ */ new Set();
|
|
19248
|
+
emitResolver.isReferencedAliasDeclaration = function(node, ...args) {
|
|
19249
|
+
if (isAliasImportDeclaration(node) && referencedAliases.has(node)) {
|
|
19250
|
+
return true;
|
|
19251
|
+
}
|
|
19252
|
+
return originalIsReferencedAliasDeclaration.call(emitResolver, node, ...args);
|
|
19253
|
+
};
|
|
19254
|
+
return emitResolver[patchedReferencedAliasesSymbol] = referencedAliases;
|
|
19255
|
+
}
|
|
19256
|
+
function isAliasImportDeclaration(node) {
|
|
19257
|
+
return import_typescript14.default.isImportSpecifier(node) || import_typescript14.default.isNamespaceImport(node) || import_typescript14.default.isImportClause(node);
|
|
19258
|
+
}
|
|
19259
|
+
function isTransformationContextWithEmitResolver(context) {
|
|
19260
|
+
return context.getEmitResolver !== void 0;
|
|
19261
|
+
}
|
|
19262
|
+
function throwIncompatibleTransformationContextError() {
|
|
19263
|
+
throw Error("Angular compiler is incompatible with this version of the TypeScript compiler.\n\nIf you recently updated TypeScript and this issue surfaces now, consider downgrading.\n\nPlease report an issue on the Angular repositories when this issue surfaces and you are using a supposedly compatible TypeScript version.");
|
|
19264
|
+
}
|
|
19265
|
+
|
|
19266
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/default.mjs
|
|
19233
19267
|
var DefaultImportDeclaration = Symbol("DefaultImportDeclaration");
|
|
19234
19268
|
function attachDefaultImportDeclaration(expr, importDecl) {
|
|
19235
19269
|
expr[DefaultImportDeclaration] = importDecl;
|
|
@@ -19243,34 +19277,31 @@ var DefaultImportTracker = class {
|
|
|
19243
19277
|
this.sourceFileToUsedImports = /* @__PURE__ */ new Map();
|
|
19244
19278
|
}
|
|
19245
19279
|
recordUsedImport(importDecl) {
|
|
19246
|
-
|
|
19247
|
-
|
|
19248
|
-
this.sourceFileToUsedImports.
|
|
19280
|
+
if (importDecl.importClause) {
|
|
19281
|
+
const sf = getSourceFile(importDecl);
|
|
19282
|
+
if (!this.sourceFileToUsedImports.has(sf.fileName)) {
|
|
19283
|
+
this.sourceFileToUsedImports.set(sf.fileName, /* @__PURE__ */ new Set());
|
|
19284
|
+
}
|
|
19285
|
+
this.sourceFileToUsedImports.get(sf.fileName).add(importDecl.importClause);
|
|
19249
19286
|
}
|
|
19250
|
-
this.sourceFileToUsedImports.get(sf).add(importDecl);
|
|
19251
19287
|
}
|
|
19252
19288
|
importPreservingTransformer() {
|
|
19253
19289
|
return (context) => {
|
|
19254
|
-
|
|
19255
|
-
|
|
19290
|
+
let clausesToPreserve = null;
|
|
19291
|
+
return (sourceFile) => {
|
|
19292
|
+
const clausesForFile = this.sourceFileToUsedImports.get(sourceFile.fileName);
|
|
19293
|
+
if (clausesForFile !== void 0) {
|
|
19294
|
+
for (const clause of clausesForFile) {
|
|
19295
|
+
if (clausesToPreserve === null) {
|
|
19296
|
+
clausesToPreserve = loadIsReferencedAliasDeclarationPatch(context);
|
|
19297
|
+
}
|
|
19298
|
+
clausesToPreserve.add(clause);
|
|
19299
|
+
}
|
|
19300
|
+
}
|
|
19301
|
+
return sourceFile;
|
|
19256
19302
|
};
|
|
19257
19303
|
};
|
|
19258
19304
|
}
|
|
19259
|
-
transformSourceFile(sf) {
|
|
19260
|
-
const originalSf = import_typescript14.default.getOriginalNode(sf);
|
|
19261
|
-
if (!this.sourceFileToUsedImports.has(originalSf)) {
|
|
19262
|
-
return sf;
|
|
19263
|
-
}
|
|
19264
|
-
const importsToPreserve = this.sourceFileToUsedImports.get(originalSf);
|
|
19265
|
-
const statements = sf.statements.map((stmt) => {
|
|
19266
|
-
if (import_typescript14.default.isImportDeclaration(stmt) && importsToPreserve.has(stmt)) {
|
|
19267
|
-
stmt = import_typescript14.default.getMutableClone(stmt);
|
|
19268
|
-
}
|
|
19269
|
-
return stmt;
|
|
19270
|
-
});
|
|
19271
|
-
this.sourceFileToUsedImports.delete(originalSf);
|
|
19272
|
-
return import_typescript14.default.factory.updateSourceFile(sf, statements);
|
|
19273
|
-
}
|
|
19274
19305
|
};
|
|
19275
19306
|
|
|
19276
19307
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/imports/src/references.mjs
|
|
@@ -34545,11 +34576,7 @@ var import_typescript99 = __toESM(require("typescript"), 1);
|
|
|
34545
34576
|
var import_typescript98 = __toESM(require("typescript"), 1);
|
|
34546
34577
|
|
|
34547
34578
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/downlevel_decorators_transform.mjs
|
|
34548
|
-
var import_typescript101 = __toESM(require("typescript"), 1);
|
|
34549
|
-
|
|
34550
|
-
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/downlevel_decorators_transform/patch_alias_reference_resolution.mjs
|
|
34551
34579
|
var import_typescript100 = __toESM(require("typescript"), 1);
|
|
34552
|
-
var patchedReferencedAliasesSymbol = Symbol("patchedReferencedAliases");
|
|
34553
34580
|
|
|
34554
34581
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/private/tooling.mjs
|
|
34555
34582
|
var GLOBAL_DEFS_FOR_TERSER = {
|
|
@@ -34584,7 +34611,7 @@ setFileSystem(new NodeJSFileSystem());
|
|
|
34584
34611
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/index.mjs
|
|
34585
34612
|
var import_fs2 = require("fs");
|
|
34586
34613
|
var import_path8 = require("path");
|
|
34587
|
-
var
|
|
34614
|
+
var import_typescript112 = __toESM(require("typescript"), 1);
|
|
34588
34615
|
|
|
34589
34616
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
|
|
34590
34617
|
var import_core13 = require("@angular-devkit/core");
|
|
@@ -34668,23 +34695,23 @@ function getWorkspace(tree) {
|
|
|
34668
34695
|
|
|
34669
34696
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
34670
34697
|
var import_path4 = require("path");
|
|
34671
|
-
var
|
|
34698
|
+
var import_typescript102 = __toESM(require("typescript"), 1);
|
|
34672
34699
|
|
|
34673
34700
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
|
|
34674
34701
|
var path2 = __toESM(require("path"), 1);
|
|
34675
|
-
var
|
|
34702
|
+
var import_typescript101 = __toESM(require("typescript"), 1);
|
|
34676
34703
|
function parseTsconfigFile(tsconfigPath, basePath) {
|
|
34677
|
-
const { config } =
|
|
34704
|
+
const { config } = import_typescript101.default.readConfigFile(tsconfigPath, import_typescript101.default.sys.readFile);
|
|
34678
34705
|
const parseConfigHost = {
|
|
34679
|
-
useCaseSensitiveFileNames:
|
|
34680
|
-
fileExists:
|
|
34681
|
-
readDirectory:
|
|
34682
|
-
readFile:
|
|
34706
|
+
useCaseSensitiveFileNames: import_typescript101.default.sys.useCaseSensitiveFileNames,
|
|
34707
|
+
fileExists: import_typescript101.default.sys.fileExists,
|
|
34708
|
+
readDirectory: import_typescript101.default.sys.readDirectory,
|
|
34709
|
+
readFile: import_typescript101.default.sys.readFile
|
|
34683
34710
|
};
|
|
34684
34711
|
if (!path2.isAbsolute(basePath)) {
|
|
34685
34712
|
throw Error("Unexpected relative base path has been specified.");
|
|
34686
34713
|
}
|
|
34687
|
-
return
|
|
34714
|
+
return import_typescript101.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
|
|
34688
34715
|
}
|
|
34689
34716
|
|
|
34690
34717
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
@@ -34696,7 +34723,7 @@ function createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additi
|
|
|
34696
34723
|
return { rootNames: parsed.fileNames.concat(additionalFiles || []), options, host };
|
|
34697
34724
|
}
|
|
34698
34725
|
function createMigrationCompilerHost(tree, options, basePath, fakeRead) {
|
|
34699
|
-
const host =
|
|
34726
|
+
const host = import_typescript102.default.createCompilerHost(options, true);
|
|
34700
34727
|
const defaultReadFile = host.readFile;
|
|
34701
34728
|
host.readFile = (fileName) => {
|
|
34702
34729
|
var _a;
|
|
@@ -34717,24 +34744,24 @@ function canMigrateFile(basePath, sourceFile, program) {
|
|
|
34717
34744
|
}
|
|
34718
34745
|
|
|
34719
34746
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/prune-modules.mjs
|
|
34720
|
-
var
|
|
34747
|
+
var import_typescript108 = __toESM(require("typescript"), 1);
|
|
34721
34748
|
|
|
34722
34749
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
34723
|
-
var
|
|
34750
|
+
var import_typescript104 = __toESM(require("typescript"), 1);
|
|
34724
34751
|
|
|
34725
34752
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
|
|
34726
|
-
var
|
|
34753
|
+
var import_typescript103 = __toESM(require("typescript"), 1);
|
|
34727
34754
|
function getImportOfIdentifier(typeChecker, node) {
|
|
34728
34755
|
const symbol = typeChecker.getSymbolAtLocation(node);
|
|
34729
34756
|
if (!symbol || symbol.declarations === void 0 || !symbol.declarations.length) {
|
|
34730
34757
|
return null;
|
|
34731
34758
|
}
|
|
34732
34759
|
const decl = symbol.declarations[0];
|
|
34733
|
-
if (!
|
|
34760
|
+
if (!import_typescript103.default.isImportSpecifier(decl)) {
|
|
34734
34761
|
return null;
|
|
34735
34762
|
}
|
|
34736
34763
|
const importDecl = decl.parent.parent.parent;
|
|
34737
|
-
if (!
|
|
34764
|
+
if (!import_typescript103.default.isStringLiteral(importDecl.moduleSpecifier)) {
|
|
34738
34765
|
return null;
|
|
34739
34766
|
}
|
|
34740
34767
|
return {
|
|
@@ -34746,10 +34773,10 @@ function getImportOfIdentifier(typeChecker, node) {
|
|
|
34746
34773
|
function getImportSpecifier(sourceFile, moduleName, specifierName) {
|
|
34747
34774
|
var _a;
|
|
34748
34775
|
for (const node of sourceFile.statements) {
|
|
34749
|
-
if (
|
|
34776
|
+
if (import_typescript103.default.isImportDeclaration(node) && import_typescript103.default.isStringLiteral(node.moduleSpecifier)) {
|
|
34750
34777
|
const isMatch = typeof moduleName === "string" ? node.moduleSpecifier.text === moduleName : moduleName.test(node.moduleSpecifier.text);
|
|
34751
34778
|
const namedBindings = (_a = node.importClause) == null ? void 0 : _a.namedBindings;
|
|
34752
|
-
if (isMatch && namedBindings &&
|
|
34779
|
+
if (isMatch && namedBindings && import_typescript103.default.isNamedImports(namedBindings)) {
|
|
34753
34780
|
const match = findImportSpecifier(namedBindings.elements, specifierName);
|
|
34754
34781
|
if (match) {
|
|
34755
34782
|
return match;
|
|
@@ -34768,7 +34795,7 @@ function findImportSpecifier(nodes, specifierName) {
|
|
|
34768
34795
|
|
|
34769
34796
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
|
|
34770
34797
|
function getCallDecoratorImport(typeChecker, decorator) {
|
|
34771
|
-
if (!
|
|
34798
|
+
if (!import_typescript104.default.isCallExpression(decorator.expression) || !import_typescript104.default.isIdentifier(decorator.expression.expression)) {
|
|
34772
34799
|
return null;
|
|
34773
34800
|
}
|
|
34774
34801
|
const identifier = decorator.expression.expression;
|
|
@@ -34786,10 +34813,10 @@ function getAngularDecorators(typeChecker, decorators) {
|
|
|
34786
34813
|
}
|
|
34787
34814
|
|
|
34788
34815
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs
|
|
34789
|
-
var
|
|
34816
|
+
var import_typescript105 = __toESM(require("typescript"), 1);
|
|
34790
34817
|
function closestNode(node, predicate) {
|
|
34791
34818
|
let current = node.parent;
|
|
34792
|
-
while (current && !
|
|
34819
|
+
while (current && !import_typescript105.default.isSourceFile(current)) {
|
|
34793
34820
|
if (predicate(current)) {
|
|
34794
34821
|
return current;
|
|
34795
34822
|
}
|
|
@@ -34800,11 +34827,11 @@ function closestNode(node, predicate) {
|
|
|
34800
34827
|
|
|
34801
34828
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/util.mjs
|
|
34802
34829
|
var import_path6 = require("path");
|
|
34803
|
-
var
|
|
34830
|
+
var import_typescript107 = __toESM(require("typescript"), 1);
|
|
34804
34831
|
|
|
34805
34832
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
|
|
34806
34833
|
var import_path5 = require("path");
|
|
34807
|
-
var
|
|
34834
|
+
var import_typescript106 = __toESM(require("typescript"), 1);
|
|
34808
34835
|
var IS_AFTER_TS_492 = isAfterVersion2(4, 9);
|
|
34809
34836
|
var ImportManager2 = class {
|
|
34810
34837
|
constructor(getUpdateRecorder, printer) {
|
|
@@ -34826,7 +34853,7 @@ var ImportManager2 = class {
|
|
|
34826
34853
|
}
|
|
34827
34854
|
for (let i = sourceFile.statements.length - 1; i >= 0; i--) {
|
|
34828
34855
|
const statement = sourceFile.statements[i];
|
|
34829
|
-
if (!
|
|
34856
|
+
if (!import_typescript106.default.isImportDeclaration(statement) || !import_typescript106.default.isStringLiteral(statement.moduleSpecifier) || !statement.importClause) {
|
|
34830
34857
|
continue;
|
|
34831
34858
|
}
|
|
34832
34859
|
if (importStartIndex === 0) {
|
|
@@ -34838,9 +34865,9 @@ var ImportManager2 = class {
|
|
|
34838
34865
|
}
|
|
34839
34866
|
if (statement.importClause.namedBindings) {
|
|
34840
34867
|
const namedBindings = statement.importClause.namedBindings;
|
|
34841
|
-
if (
|
|
34842
|
-
return
|
|
34843
|
-
} else if (
|
|
34868
|
+
if (import_typescript106.default.isNamespaceImport(namedBindings) && !typeImport) {
|
|
34869
|
+
return import_typescript106.default.factory.createPropertyAccessExpression(import_typescript106.default.factory.createIdentifier(namedBindings.name.text), import_typescript106.default.factory.createIdentifier(alias || symbolName || "default"));
|
|
34870
|
+
} else if (import_typescript106.default.isNamedImports(namedBindings) && symbolName) {
|
|
34844
34871
|
const existingElement = namedBindings.elements.find((e) => {
|
|
34845
34872
|
if (alias) {
|
|
34846
34873
|
return e.propertyName && e.name.text === alias && e.propertyName.text === symbolName;
|
|
@@ -34848,12 +34875,12 @@ var ImportManager2 = class {
|
|
|
34848
34875
|
return e.propertyName ? e.propertyName.text === symbolName : e.name.text === symbolName;
|
|
34849
34876
|
});
|
|
34850
34877
|
if (existingElement) {
|
|
34851
|
-
return
|
|
34878
|
+
return import_typescript106.default.factory.createIdentifier(existingElement.name.text);
|
|
34852
34879
|
}
|
|
34853
34880
|
existingImport = statement;
|
|
34854
34881
|
}
|
|
34855
34882
|
} else if (statement.importClause.name && !symbolName) {
|
|
34856
|
-
return
|
|
34883
|
+
return import_typescript106.default.factory.createIdentifier(statement.importClause.name.text);
|
|
34857
34884
|
}
|
|
34858
34885
|
}
|
|
34859
34886
|
if (existingImport) {
|
|
@@ -34873,11 +34900,11 @@ var ImportManager2 = class {
|
|
|
34873
34900
|
if (symbolName) {
|
|
34874
34901
|
const { propertyName, name } = this._getImportParts(sourceFile, symbolName, alias);
|
|
34875
34902
|
const importMap = this.newImports.get(sourceFile).namedImports;
|
|
34876
|
-
identifier =
|
|
34903
|
+
identifier = name;
|
|
34877
34904
|
if (!importMap.has(moduleName)) {
|
|
34878
34905
|
importMap.set(moduleName, []);
|
|
34879
34906
|
}
|
|
34880
|
-
importMap.get(moduleName).push(
|
|
34907
|
+
importMap.get(moduleName).push(import_typescript106.default.factory.createImportSpecifier(false, propertyName, name));
|
|
34881
34908
|
} else {
|
|
34882
34909
|
const importMap = this.newImports.get(sourceFile).defaultImports;
|
|
34883
34910
|
identifier = this._getUniqueIdentifier(sourceFile, "defaultExport");
|
|
@@ -34891,19 +34918,19 @@ var ImportManager2 = class {
|
|
|
34891
34918
|
const sourceFile = importDecl.getSourceFile();
|
|
34892
34919
|
const recorder = this.getUpdateRecorder(sourceFile);
|
|
34893
34920
|
const namedBindings = importDecl.importClause.namedBindings;
|
|
34894
|
-
const newNamedBindings =
|
|
34895
|
-
const newNamedBindingsText = this.printer.printNode(
|
|
34921
|
+
const newNamedBindings = import_typescript106.default.factory.updateNamedImports(namedBindings, namedBindings.elements.concat(expressions.map(({ propertyName, importName }) => import_typescript106.default.factory.createImportSpecifier(false, propertyName, importName))));
|
|
34922
|
+
const newNamedBindingsText = this.printer.printNode(import_typescript106.default.EmitHint.Unspecified, newNamedBindings, sourceFile);
|
|
34896
34923
|
recorder.updateExistingImport(namedBindings, newNamedBindingsText);
|
|
34897
34924
|
});
|
|
34898
34925
|
this.newImports.forEach(({ importStartIndex, defaultImports, namedImports }, sourceFile) => {
|
|
34899
34926
|
const recorder = this.getUpdateRecorder(sourceFile);
|
|
34900
34927
|
const useSingleQuotes = this._getQuoteStyle(sourceFile) === 0;
|
|
34901
34928
|
defaultImports.forEach((identifier, moduleName) => {
|
|
34902
|
-
const newImport = createImportDeclaration2(void 0,
|
|
34929
|
+
const newImport = createImportDeclaration2(void 0, import_typescript106.default.factory.createImportClause(false, identifier, void 0), import_typescript106.default.factory.createStringLiteral(moduleName, useSingleQuotes));
|
|
34903
34930
|
recorder.addNewImport(importStartIndex, this._getNewImportText(importStartIndex, newImport, sourceFile));
|
|
34904
34931
|
});
|
|
34905
34932
|
namedImports.forEach((specifiers, moduleName) => {
|
|
34906
|
-
const newImport = createImportDeclaration2(void 0,
|
|
34933
|
+
const newImport = createImportDeclaration2(void 0, import_typescript106.default.factory.createImportClause(false, void 0, import_typescript106.default.factory.createNamedImports(specifiers)), import_typescript106.default.factory.createStringLiteral(moduleName, useSingleQuotes));
|
|
34907
34934
|
recorder.addNewImport(importStartIndex, this._getNewImportText(importStartIndex, newImport, sourceFile));
|
|
34908
34935
|
});
|
|
34909
34936
|
});
|
|
@@ -34911,7 +34938,7 @@ var ImportManager2 = class {
|
|
|
34911
34938
|
_getUniqueIdentifier(sourceFile, baseName) {
|
|
34912
34939
|
if (this.isUniqueIdentifierName(sourceFile, baseName)) {
|
|
34913
34940
|
this._recordUsedIdentifier(sourceFile, baseName);
|
|
34914
|
-
return
|
|
34941
|
+
return import_typescript106.default.factory.createIdentifier(baseName);
|
|
34915
34942
|
}
|
|
34916
34943
|
let name = null;
|
|
34917
34944
|
let counter = 1;
|
|
@@ -34919,7 +34946,7 @@ var ImportManager2 = class {
|
|
|
34919
34946
|
name = `${baseName}_${counter++}`;
|
|
34920
34947
|
} while (!this.isUniqueIdentifierName(sourceFile, name));
|
|
34921
34948
|
this._recordUsedIdentifier(sourceFile, name);
|
|
34922
|
-
return
|
|
34949
|
+
return import_typescript106.default.factory.createIdentifier(name);
|
|
34923
34950
|
}
|
|
34924
34951
|
isUniqueIdentifierName(sourceFile, name) {
|
|
34925
34952
|
if (this.usedIdentifierNames.has(sourceFile) && this.usedIdentifierNames.get(sourceFile).indexOf(name) !== -1) {
|
|
@@ -34928,7 +34955,7 @@ var ImportManager2 = class {
|
|
|
34928
34955
|
const nodeQueue = [sourceFile];
|
|
34929
34956
|
while (nodeQueue.length) {
|
|
34930
34957
|
const node = nodeQueue.shift();
|
|
34931
|
-
if (
|
|
34958
|
+
if (import_typescript106.default.isIdentifier(node) && node.text === name && (!import_typescript106.default.isImportSpecifier(node.parent) || node.parent.propertyName !== node)) {
|
|
34932
34959
|
return false;
|
|
34933
34960
|
}
|
|
34934
34961
|
nodeQueue.push(...node.getChildren());
|
|
@@ -34940,21 +34967,21 @@ var ImportManager2 = class {
|
|
|
34940
34967
|
}
|
|
34941
34968
|
_getEndPositionOfNode(node) {
|
|
34942
34969
|
const nodeEndPos = node.getEnd();
|
|
34943
|
-
const commentRanges =
|
|
34970
|
+
const commentRanges = import_typescript106.default.getTrailingCommentRanges(node.getSourceFile().text, nodeEndPos);
|
|
34944
34971
|
if (!commentRanges || !commentRanges.length) {
|
|
34945
34972
|
return nodeEndPos;
|
|
34946
34973
|
}
|
|
34947
34974
|
return commentRanges[commentRanges.length - 1].end;
|
|
34948
34975
|
}
|
|
34949
34976
|
_getNewImportText(importStartIndex, newImport, sourceFile) {
|
|
34950
|
-
const text = this.printer.printNode(
|
|
34977
|
+
const text = this.printer.printNode(import_typescript106.default.EmitHint.Unspecified, newImport, sourceFile);
|
|
34951
34978
|
return importStartIndex === 0 ? `${text}
|
|
34952
34979
|
` : `
|
|
34953
34980
|
${text}`;
|
|
34954
34981
|
}
|
|
34955
34982
|
_getImportParts(sourceFile, symbolName, alias) {
|
|
34956
|
-
const symbolIdentifier =
|
|
34957
|
-
const aliasIdentifier = alias ?
|
|
34983
|
+
const symbolIdentifier = import_typescript106.default.factory.createIdentifier(symbolName);
|
|
34984
|
+
const aliasIdentifier = alias ? import_typescript106.default.factory.createIdentifier(alias) : null;
|
|
34958
34985
|
const generatedUniqueIdentifier = this._getUniqueIdentifier(sourceFile, alias || symbolName);
|
|
34959
34986
|
const needsGeneratedUniqueName = generatedUniqueIdentifier.text !== (alias || symbolName);
|
|
34960
34987
|
let propertyName;
|
|
@@ -34974,7 +35001,7 @@ ${text}`;
|
|
|
34974
35001
|
if (!this.quoteStyles.hasOwnProperty(sourceFile.fileName)) {
|
|
34975
35002
|
let quoteStyle;
|
|
34976
35003
|
for (const statement of sourceFile.statements) {
|
|
34977
|
-
if (
|
|
35004
|
+
if (import_typescript106.default.isImportDeclaration(statement) && import_typescript106.default.isStringLiteralLike(statement.moduleSpecifier)) {
|
|
34978
35005
|
quoteStyle = statement.moduleSpecifier.getText().trim().startsWith('"') ? 1 : 0;
|
|
34979
35006
|
break;
|
|
34980
35007
|
}
|
|
@@ -34985,10 +35012,10 @@ ${text}`;
|
|
|
34985
35012
|
}
|
|
34986
35013
|
};
|
|
34987
35014
|
function createImportDeclaration2(modifiers, importClause, moduleSpecifier, assertClause) {
|
|
34988
|
-
return IS_AFTER_TS_492 ?
|
|
35015
|
+
return IS_AFTER_TS_492 ? import_typescript106.default.factory.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) : import_typescript106.default.factory.createImportDeclaration(void 0, modifiers, importClause, moduleSpecifier, assertClause);
|
|
34989
35016
|
}
|
|
34990
35017
|
function isAfterVersion2(targetMajor, targetMinor) {
|
|
34991
|
-
const [major, minor] =
|
|
35018
|
+
const [major, minor] = import_typescript106.default.versionMajorMinor.split(".").map((part) => parseInt(part));
|
|
34992
35019
|
if (major < targetMajor) {
|
|
34993
35020
|
return false;
|
|
34994
35021
|
}
|
|
@@ -35012,7 +35039,7 @@ var ChangeTracker = class {
|
|
|
35012
35039
|
replaceText(sourceFile, start, removeLength, text) {
|
|
35013
35040
|
this._trackChange(sourceFile, { start, removeLength, text });
|
|
35014
35041
|
}
|
|
35015
|
-
replaceNode(oldNode, newNode, emitHint =
|
|
35042
|
+
replaceNode(oldNode, newNode, emitHint = import_typescript107.default.EmitHint.Unspecified, sourceFileWhenPrinting) {
|
|
35016
35043
|
const sourceFile = oldNode.getSourceFile();
|
|
35017
35044
|
this.replaceText(sourceFile, oldNode.getStart(), oldNode.getWidth(), this._printer.printNode(emitHint, newNode, sourceFileWhenPrinting || sourceFile));
|
|
35018
35045
|
}
|
|
@@ -35083,7 +35110,7 @@ var ReferenceResolver = class {
|
|
|
35083
35110
|
const results = /* @__PURE__ */ new Map();
|
|
35084
35111
|
for (const symbol of referencedSymbols) {
|
|
35085
35112
|
for (const ref of symbol.references) {
|
|
35086
|
-
if (!ref.isDefinition || symbol.definition.kind ===
|
|
35113
|
+
if (!ref.isDefinition || symbol.definition.kind === import_typescript107.default.ScriptElementKind.alias) {
|
|
35087
35114
|
if (!results.has(ref.fileName)) {
|
|
35088
35115
|
results.set(ref.fileName, []);
|
|
35089
35116
|
}
|
|
@@ -35107,7 +35134,7 @@ var ReferenceResolver = class {
|
|
|
35107
35134
|
for (const file of highlights) {
|
|
35108
35135
|
if (file.fileName === fileName) {
|
|
35109
35136
|
for (const { textSpan: { start, length }, kind } of file.highlightSpans) {
|
|
35110
|
-
if (kind !==
|
|
35137
|
+
if (kind !== import_typescript107.default.HighlightSpanKind.none) {
|
|
35111
35138
|
results.push([start, start + length]);
|
|
35112
35139
|
}
|
|
35113
35140
|
}
|
|
@@ -35133,19 +35160,19 @@ var ReferenceResolver = class {
|
|
|
35133
35160
|
rootFileNames.push(fileName);
|
|
35134
35161
|
}
|
|
35135
35162
|
});
|
|
35136
|
-
this._languageService =
|
|
35163
|
+
this._languageService = import_typescript107.default.createLanguageService({
|
|
35137
35164
|
getCompilationSettings: () => this._program.getTsProgram().getCompilerOptions(),
|
|
35138
35165
|
getScriptFileNames: () => rootFileNames,
|
|
35139
35166
|
getScriptVersion: () => "0",
|
|
35140
35167
|
getScriptSnapshot: (path3) => {
|
|
35141
35168
|
const content = this._readFile(path3);
|
|
35142
|
-
return content ?
|
|
35169
|
+
return content ? import_typescript107.default.ScriptSnapshot.fromString(content) : void 0;
|
|
35143
35170
|
},
|
|
35144
35171
|
getCurrentDirectory: () => this._basePath,
|
|
35145
|
-
getDefaultLibFileName: (options) =>
|
|
35172
|
+
getDefaultLibFileName: (options) => import_typescript107.default.getDefaultLibFilePath(options),
|
|
35146
35173
|
readFile: (path3) => this._readFile(path3),
|
|
35147
35174
|
fileExists: (path3) => this._host.fileExists(path3)
|
|
35148
|
-
},
|
|
35175
|
+
}, import_typescript107.default.createDocumentRegistry(), import_typescript107.default.LanguageServiceMode.PartialSemantic);
|
|
35149
35176
|
}
|
|
35150
35177
|
return this._languageService;
|
|
35151
35178
|
}
|
|
@@ -35175,10 +35202,10 @@ function offsetsToNodes(lookup, offsets, results) {
|
|
|
35175
35202
|
}
|
|
35176
35203
|
function findClassDeclaration(reference, typeChecker) {
|
|
35177
35204
|
var _a, _b;
|
|
35178
|
-
return ((_b = (_a = typeChecker.getTypeAtLocation(reference).getSymbol()) == null ? void 0 : _a.declarations) == null ? void 0 : _b.find(
|
|
35205
|
+
return ((_b = (_a = typeChecker.getTypeAtLocation(reference).getSymbol()) == null ? void 0 : _a.declarations) == null ? void 0 : _b.find(import_typescript107.default.isClassDeclaration)) || null;
|
|
35179
35206
|
}
|
|
35180
35207
|
function findLiteralProperty(literal3, name) {
|
|
35181
|
-
return literal3.properties.find((prop) => prop.name &&
|
|
35208
|
+
return literal3.properties.find((prop) => prop.name && import_typescript107.default.isIdentifier(prop.name) && prop.name.text === name);
|
|
35182
35209
|
}
|
|
35183
35210
|
function getRelativeImportPath(fromFile, toFile) {
|
|
35184
35211
|
let path3 = (0, import_path6.relative)((0, import_path6.dirname)(fromFile), toFile).replace(/\.ts$/, "");
|
|
@@ -35193,6 +35220,23 @@ function normalizePath(path3) {
|
|
|
35193
35220
|
function knownInternalAliasRemapper(imports) {
|
|
35194
35221
|
return imports.map((current) => current.moduleSpecifier === "@angular/common" && current.symbolName === "NgForOf" ? __spreadProps(__spreadValues({}, current), { symbolName: "NgFor" }) : current);
|
|
35195
35222
|
}
|
|
35223
|
+
function closestOrSelf(node, predicate) {
|
|
35224
|
+
return predicate(node) ? node : closestNode(node, predicate);
|
|
35225
|
+
}
|
|
35226
|
+
function isClassReferenceInAngularModule(node, className, moduleName, typeChecker) {
|
|
35227
|
+
var _a;
|
|
35228
|
+
const symbol = typeChecker.getTypeAtLocation(node).getSymbol();
|
|
35229
|
+
const externalName = `@angular/${moduleName}`;
|
|
35230
|
+
const internalName = `angular2/rc/packages/${moduleName}`;
|
|
35231
|
+
return !!((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.some((decl) => {
|
|
35232
|
+
const closestClass = closestOrSelf(decl, import_typescript107.default.isClassDeclaration);
|
|
35233
|
+
const closestClassFileName = closestClass == null ? void 0 : closestClass.getSourceFile().fileName;
|
|
35234
|
+
if (!closestClass || !closestClassFileName || !closestClass.name || !import_typescript107.default.isIdentifier(closestClass.name) || !closestClassFileName.includes(externalName) && !closestClassFileName.includes(internalName)) {
|
|
35235
|
+
return false;
|
|
35236
|
+
}
|
|
35237
|
+
return typeof className === "string" ? closestClass.name.text === className : className.test(closestClass.name.text);
|
|
35238
|
+
}));
|
|
35239
|
+
}
|
|
35196
35240
|
|
|
35197
35241
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/prune-modules.mjs
|
|
35198
35242
|
function pruneNgModules(program, host, basePath, rootFileNames, sourceFiles, printer, importRemapper, referenceLookupExcludedFiles) {
|
|
@@ -35208,7 +35252,7 @@ function pruneNgModules(program, host, basePath, rootFileNames, sourceFiles, pri
|
|
|
35208
35252
|
unknown: /* @__PURE__ */ new Set()
|
|
35209
35253
|
};
|
|
35210
35254
|
sourceFiles.forEach(function walk(node) {
|
|
35211
|
-
if (
|
|
35255
|
+
if (import_typescript108.default.isClassDeclaration(node) && canRemoveClass(node, typeChecker)) {
|
|
35212
35256
|
collectRemovalLocations(node, removalLocations, referenceResolver, program);
|
|
35213
35257
|
removalLocations.classes.add(node);
|
|
35214
35258
|
}
|
|
@@ -35239,17 +35283,17 @@ function collectRemovalLocations(ngModule, removalLocations, referenceResolver,
|
|
|
35239
35283
|
}
|
|
35240
35284
|
}
|
|
35241
35285
|
for (const node of nodes) {
|
|
35242
|
-
const closestArray = closestNode(node,
|
|
35286
|
+
const closestArray = closestNode(node, import_typescript108.default.isArrayLiteralExpression);
|
|
35243
35287
|
if (closestArray) {
|
|
35244
35288
|
removalLocations.arrays.track(closestArray, node);
|
|
35245
35289
|
continue;
|
|
35246
35290
|
}
|
|
35247
|
-
const closestImport = closestNode(node,
|
|
35291
|
+
const closestImport = closestNode(node, import_typescript108.default.isNamedImports);
|
|
35248
35292
|
if (closestImport) {
|
|
35249
35293
|
removalLocations.imports.track(closestImport, node);
|
|
35250
35294
|
continue;
|
|
35251
35295
|
}
|
|
35252
|
-
const closestExport = closestNode(node,
|
|
35296
|
+
const closestExport = closestNode(node, import_typescript108.default.isNamedExports);
|
|
35253
35297
|
if (closestExport) {
|
|
35254
35298
|
removalLocations.exports.track(closestExport, node);
|
|
35255
35299
|
continue;
|
|
@@ -35260,24 +35304,24 @@ function collectRemovalLocations(ngModule, removalLocations, referenceResolver,
|
|
|
35260
35304
|
function removeArrayReferences(locations, tracker) {
|
|
35261
35305
|
for (const [array, toRemove] of locations.getEntries()) {
|
|
35262
35306
|
const newElements = filterRemovedElements(array.elements, toRemove);
|
|
35263
|
-
tracker.replaceNode(array,
|
|
35307
|
+
tracker.replaceNode(array, import_typescript108.default.factory.updateArrayLiteralExpression(array, newElements));
|
|
35264
35308
|
}
|
|
35265
35309
|
}
|
|
35266
35310
|
function removeImportReferences(locations, tracker) {
|
|
35267
35311
|
for (const [namedImports, toRemove] of locations.getEntries()) {
|
|
35268
35312
|
const newElements = filterRemovedElements(namedImports.elements, toRemove);
|
|
35269
35313
|
if (newElements.length === 0) {
|
|
35270
|
-
const importClause = closestNode(namedImports,
|
|
35314
|
+
const importClause = closestNode(namedImports, import_typescript108.default.isImportClause);
|
|
35271
35315
|
if (importClause && importClause.name) {
|
|
35272
|
-
tracker.replaceNode(importClause,
|
|
35316
|
+
tracker.replaceNode(importClause, import_typescript108.default.factory.updateImportClause(importClause, importClause.isTypeOnly, importClause.name, void 0));
|
|
35273
35317
|
} else {
|
|
35274
|
-
const declaration = closestNode(namedImports,
|
|
35318
|
+
const declaration = closestNode(namedImports, import_typescript108.default.isImportDeclaration);
|
|
35275
35319
|
if (declaration) {
|
|
35276
35320
|
tracker.removeNode(declaration);
|
|
35277
35321
|
}
|
|
35278
35322
|
}
|
|
35279
35323
|
} else {
|
|
35280
|
-
tracker.replaceNode(namedImports,
|
|
35324
|
+
tracker.replaceNode(namedImports, import_typescript108.default.factory.updateNamedImports(namedImports, newElements));
|
|
35281
35325
|
}
|
|
35282
35326
|
}
|
|
35283
35327
|
}
|
|
@@ -35285,22 +35329,22 @@ function removeExportReferences(locations, tracker) {
|
|
|
35285
35329
|
for (const [namedExports, toRemove] of locations.getEntries()) {
|
|
35286
35330
|
const newElements = filterRemovedElements(namedExports.elements, toRemove);
|
|
35287
35331
|
if (newElements.length === 0) {
|
|
35288
|
-
const declaration = closestNode(namedExports,
|
|
35332
|
+
const declaration = closestNode(namedExports, import_typescript108.default.isExportDeclaration);
|
|
35289
35333
|
if (declaration) {
|
|
35290
35334
|
tracker.removeNode(declaration);
|
|
35291
35335
|
}
|
|
35292
35336
|
} else {
|
|
35293
|
-
tracker.replaceNode(namedExports,
|
|
35337
|
+
tracker.replaceNode(namedExports, import_typescript108.default.factory.updateNamedExports(namedExports, newElements));
|
|
35294
35338
|
}
|
|
35295
35339
|
}
|
|
35296
35340
|
}
|
|
35297
35341
|
function canRemoveClass(node, typeChecker) {
|
|
35298
35342
|
var _a;
|
|
35299
35343
|
const decorator = (_a = findNgModuleDecorator(node, typeChecker)) == null ? void 0 : _a.node;
|
|
35300
|
-
if (!decorator || !
|
|
35344
|
+
if (!decorator || !import_typescript108.default.isCallExpression(decorator.expression)) {
|
|
35301
35345
|
return false;
|
|
35302
35346
|
}
|
|
35303
|
-
if (decorator.expression.arguments.length > 0 && !
|
|
35347
|
+
if (decorator.expression.arguments.length > 0 && !import_typescript108.default.isObjectLiteralExpression(decorator.expression.arguments[0])) {
|
|
35304
35348
|
return false;
|
|
35305
35349
|
}
|
|
35306
35350
|
if (node.members.length > 0 && node.members.some((member) => !isEmptyConstructor(member))) {
|
|
@@ -35313,7 +35357,7 @@ function canRemoveClass(node, typeChecker) {
|
|
|
35313
35357
|
const imports = findLiteralProperty(literal3, "imports");
|
|
35314
35358
|
if (imports && isNonEmptyNgModuleProperty(imports)) {
|
|
35315
35359
|
for (const dep of imports.initializer.elements) {
|
|
35316
|
-
if (!
|
|
35360
|
+
if (!import_typescript108.default.isIdentifier(dep)) {
|
|
35317
35361
|
return false;
|
|
35318
35362
|
}
|
|
35319
35363
|
const depDeclaration = findClassDeclaration(dep, typeChecker);
|
|
@@ -35331,15 +35375,15 @@ function canRemoveClass(node, typeChecker) {
|
|
|
35331
35375
|
return true;
|
|
35332
35376
|
}
|
|
35333
35377
|
function isNonEmptyNgModuleProperty(node) {
|
|
35334
|
-
return
|
|
35378
|
+
return import_typescript108.default.isPropertyAssignment(node) && import_typescript108.default.isIdentifier(node.name) && import_typescript108.default.isArrayLiteralExpression(node.initializer) && node.initializer.elements.length > 0;
|
|
35335
35379
|
}
|
|
35336
35380
|
function canRemoveFile(sourceFile, classesToBeRemoved) {
|
|
35337
35381
|
var _a;
|
|
35338
35382
|
for (const node of sourceFile.statements) {
|
|
35339
|
-
if (
|
|
35383
|
+
if (import_typescript108.default.isImportDeclaration(node) || import_typescript108.default.isClassDeclaration(node) && classesToBeRemoved.has(node)) {
|
|
35340
35384
|
continue;
|
|
35341
35385
|
}
|
|
35342
|
-
if (
|
|
35386
|
+
if (import_typescript108.default.canHaveModifiers(node) && ((_a = import_typescript108.default.getModifiers(node)) == null ? void 0 : _a.some((m) => m.kind === import_typescript108.default.SyntaxKind.ExportKeyword))) {
|
|
35343
35387
|
return false;
|
|
35344
35388
|
}
|
|
35345
35389
|
}
|
|
@@ -35359,7 +35403,7 @@ function filterRemovedElements(elements, toRemove) {
|
|
|
35359
35403
|
});
|
|
35360
35404
|
}
|
|
35361
35405
|
function isEmptyConstructor(node) {
|
|
35362
|
-
return
|
|
35406
|
+
return import_typescript108.default.isConstructorDeclaration(node) && node.parameters.length === 0 && (node.body == null || node.body.statements.length === 0);
|
|
35363
35407
|
}
|
|
35364
35408
|
function addRemovalTodos(nodes, tracker) {
|
|
35365
35409
|
for (const node of nodes) {
|
|
@@ -35367,19 +35411,19 @@ function addRemovalTodos(nodes, tracker) {
|
|
|
35367
35411
|
}
|
|
35368
35412
|
}
|
|
35369
35413
|
function findNgModuleDecorator(node, typeChecker) {
|
|
35370
|
-
const decorators = getAngularDecorators(typeChecker,
|
|
35414
|
+
const decorators = getAngularDecorators(typeChecker, import_typescript108.default.getDecorators(node) || []);
|
|
35371
35415
|
return decorators.find((decorator) => decorator.name === "NgModule") || null;
|
|
35372
35416
|
}
|
|
35373
35417
|
|
|
35374
35418
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/standalone-bootstrap.mjs
|
|
35375
35419
|
var import_path7 = require("path");
|
|
35376
|
-
var
|
|
35420
|
+
var import_typescript111 = __toESM(require("typescript"), 1);
|
|
35377
35421
|
|
|
35378
35422
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/standalone-migration/to-standalone.mjs
|
|
35379
|
-
var
|
|
35423
|
+
var import_typescript110 = __toESM(require("typescript"), 1);
|
|
35380
35424
|
|
|
35381
35425
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/symbol.mjs
|
|
35382
|
-
var
|
|
35426
|
+
var import_typescript109 = __toESM(require("typescript"), 1);
|
|
35383
35427
|
function isReferenceToImport(typeChecker, node, importSpecifier) {
|
|
35384
35428
|
var _a, _b;
|
|
35385
35429
|
const nodeSymbol = typeChecker.getTypeAtLocation(node).getSymbol();
|
|
@@ -35424,7 +35468,7 @@ function convertNgModuleDeclarationToStandalone(ref, allDeclarations, tracker, t
|
|
|
35424
35468
|
if (directiveMeta.isComponent) {
|
|
35425
35469
|
const importsToAdd = getComponentImportExpressions(ref, allDeclarations, tracker, typeChecker, importRemapper);
|
|
35426
35470
|
if (importsToAdd.length > 0) {
|
|
35427
|
-
decorator = addPropertyToAngularDecorator(decorator,
|
|
35471
|
+
decorator = addPropertyToAngularDecorator(decorator, import_typescript110.default.factory.createPropertyAssignment("imports", import_typescript110.default.factory.createArrayLiteralExpression(importsToAdd)));
|
|
35428
35472
|
}
|
|
35429
35473
|
}
|
|
35430
35474
|
tracker.replaceNode(directiveMeta.decorator, decorator);
|
|
@@ -35454,11 +35498,11 @@ function getComponentImportExpressions(ref, allDeclarations, tracker, typeChecke
|
|
|
35454
35498
|
const identifier = tracker.addImport(ref.node.getSourceFile(), importLocation.symbolName, importLocation.moduleSpecifier);
|
|
35455
35499
|
imports.push(identifier);
|
|
35456
35500
|
} else {
|
|
35457
|
-
const identifier =
|
|
35501
|
+
const identifier = import_typescript110.default.factory.createIdentifier(importLocation.symbolName);
|
|
35458
35502
|
if (importLocation.isForwardReference) {
|
|
35459
35503
|
const forwardRefExpression = tracker.addImport(ref.node.getSourceFile(), "forwardRef", "@angular/core");
|
|
35460
|
-
const arrowFunction =
|
|
35461
|
-
imports.push(
|
|
35504
|
+
const arrowFunction = import_typescript110.default.factory.createArrowFunction(void 0, void 0, [], void 0, void 0, identifier);
|
|
35505
|
+
imports.push(import_typescript110.default.factory.createCallExpression(forwardRefExpression, void 0, [arrowFunction]));
|
|
35462
35506
|
} else {
|
|
35463
35507
|
imports.push(identifier);
|
|
35464
35508
|
}
|
|
@@ -35483,10 +35527,10 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
35483
35527
|
const declarationsToCopy = [];
|
|
35484
35528
|
const properties = [];
|
|
35485
35529
|
const importsProp = findLiteralProperty(literal3, "imports");
|
|
35486
|
-
if (
|
|
35487
|
-
if (
|
|
35530
|
+
if (import_typescript110.default.isPropertyAssignment(declarationsProp)) {
|
|
35531
|
+
if (import_typescript110.default.isArrayLiteralExpression(declarationsProp.initializer)) {
|
|
35488
35532
|
for (const el of declarationsProp.initializer.elements) {
|
|
35489
|
-
if (
|
|
35533
|
+
if (import_typescript110.default.isIdentifier(el)) {
|
|
35490
35534
|
const correspondingClass = findClassDeclaration(el, typeChecker);
|
|
35491
35535
|
if (!correspondingClass || isStandaloneDeclaration(correspondingClass, allDeclarations, templateTypeChecker)) {
|
|
35492
35536
|
declarationsToCopy.push(el);
|
|
@@ -35498,11 +35542,11 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
35498
35542
|
}
|
|
35499
35543
|
}
|
|
35500
35544
|
} else {
|
|
35501
|
-
declarationsToCopy.push(
|
|
35545
|
+
declarationsToCopy.push(import_typescript110.default.factory.createSpreadElement(declarationsProp.initializer));
|
|
35502
35546
|
}
|
|
35503
35547
|
}
|
|
35504
35548
|
if (!importsProp && declarationsToCopy.length > 0) {
|
|
35505
|
-
properties.push(
|
|
35549
|
+
properties.push(import_typescript110.default.factory.createPropertyAssignment("imports", import_typescript110.default.factory.createArrayLiteralExpression(declarationsToCopy)));
|
|
35506
35550
|
}
|
|
35507
35551
|
for (const prop of literal3.properties) {
|
|
35508
35552
|
if (!isNamedPropertyAssignment(prop)) {
|
|
@@ -35511,43 +35555,43 @@ function moveDeclarationsToImports(literal3, allDeclarations, typeChecker, templ
|
|
|
35511
35555
|
}
|
|
35512
35556
|
if (prop === declarationsProp) {
|
|
35513
35557
|
if (declarationsToPreserve.length > 0) {
|
|
35514
|
-
properties.push(
|
|
35558
|
+
properties.push(import_typescript110.default.factory.updatePropertyAssignment(prop, prop.name, import_typescript110.default.factory.createArrayLiteralExpression(declarationsToPreserve)));
|
|
35515
35559
|
}
|
|
35516
35560
|
continue;
|
|
35517
35561
|
}
|
|
35518
35562
|
if (prop === importsProp && declarationsToCopy.length > 0) {
|
|
35519
35563
|
let initializer;
|
|
35520
|
-
if (
|
|
35521
|
-
initializer =
|
|
35564
|
+
if (import_typescript110.default.isArrayLiteralExpression(prop.initializer)) {
|
|
35565
|
+
initializer = import_typescript110.default.factory.updateArrayLiteralExpression(prop.initializer, [...prop.initializer.elements, ...declarationsToCopy]);
|
|
35522
35566
|
} else {
|
|
35523
|
-
initializer =
|
|
35567
|
+
initializer = import_typescript110.default.factory.createArrayLiteralExpression([import_typescript110.default.factory.createSpreadElement(prop.initializer), ...declarationsToCopy]);
|
|
35524
35568
|
}
|
|
35525
|
-
properties.push(
|
|
35569
|
+
properties.push(import_typescript110.default.factory.updatePropertyAssignment(prop, prop.name, initializer));
|
|
35526
35570
|
continue;
|
|
35527
35571
|
}
|
|
35528
35572
|
properties.push(prop);
|
|
35529
35573
|
}
|
|
35530
|
-
tracker.replaceNode(literal3,
|
|
35574
|
+
tracker.replaceNode(literal3, import_typescript110.default.factory.updateObjectLiteralExpression(literal3, properties), import_typescript110.default.EmitHint.Expression);
|
|
35531
35575
|
}
|
|
35532
35576
|
function addStandaloneToDecorator(node) {
|
|
35533
|
-
return addPropertyToAngularDecorator(node,
|
|
35577
|
+
return addPropertyToAngularDecorator(node, import_typescript110.default.factory.createPropertyAssignment("standalone", import_typescript110.default.factory.createToken(import_typescript110.default.SyntaxKind.TrueKeyword)));
|
|
35534
35578
|
}
|
|
35535
35579
|
function addPropertyToAngularDecorator(node, property) {
|
|
35536
|
-
if (!
|
|
35580
|
+
if (!import_typescript110.default.isCallExpression(node.expression) || node.expression.arguments.length > 1) {
|
|
35537
35581
|
return node;
|
|
35538
35582
|
}
|
|
35539
35583
|
let literalProperties;
|
|
35540
35584
|
if (node.expression.arguments.length === 0) {
|
|
35541
35585
|
literalProperties = [property];
|
|
35542
|
-
} else if (
|
|
35586
|
+
} else if (import_typescript110.default.isObjectLiteralExpression(node.expression.arguments[0])) {
|
|
35543
35587
|
literalProperties = [...node.expression.arguments[0].properties, property];
|
|
35544
35588
|
} else {
|
|
35545
35589
|
return node;
|
|
35546
35590
|
}
|
|
35547
|
-
return
|
|
35591
|
+
return import_typescript110.default.factory.createDecorator(import_typescript110.default.factory.createCallExpression(node.expression.expression, node.expression.typeArguments, [import_typescript110.default.factory.createObjectLiteralExpression(literalProperties, literalProperties.length > 1)]));
|
|
35548
35592
|
}
|
|
35549
35593
|
function isNamedPropertyAssignment(node) {
|
|
35550
|
-
return
|
|
35594
|
+
return import_typescript110.default.isPropertyAssignment(node) && node.name && import_typescript110.default.isIdentifier(node.name);
|
|
35551
35595
|
}
|
|
35552
35596
|
function findImportLocation(target, inComponent, importMode, typeChecker) {
|
|
35553
35597
|
const importLocations = typeChecker.getPotentialImportsFor(target, inComponent.node, importMode);
|
|
@@ -35567,14 +35611,14 @@ function findImportLocation(target, inComponent, importMode, typeChecker) {
|
|
|
35567
35611
|
return firstSameFileImport || firstModuleImport || importLocations[0] || null;
|
|
35568
35612
|
}
|
|
35569
35613
|
function hasNgModuleMetadataElements(node) {
|
|
35570
|
-
return
|
|
35614
|
+
return import_typescript110.default.isPropertyAssignment(node) && (!import_typescript110.default.isArrayLiteralExpression(node.initializer) || node.initializer.elements.length > 0);
|
|
35571
35615
|
}
|
|
35572
35616
|
function findNgModuleClassesToMigrate(sourceFile, typeChecker) {
|
|
35573
35617
|
const modules = [];
|
|
35574
35618
|
if (getImportSpecifier(sourceFile, "@angular/core", "NgModule")) {
|
|
35575
35619
|
sourceFile.forEachChild(function walk(node) {
|
|
35576
|
-
if (
|
|
35577
|
-
const decorator = getAngularDecorators(typeChecker,
|
|
35620
|
+
if (import_typescript110.default.isClassDeclaration(node)) {
|
|
35621
|
+
const decorator = getAngularDecorators(typeChecker, import_typescript110.default.getDecorators(node) || []).find((current) => current.name === "NgModule");
|
|
35578
35622
|
const metadata = decorator ? extractMetadataLiteral(decorator.node) : null;
|
|
35579
35623
|
if (metadata) {
|
|
35580
35624
|
const declarations = findLiteralProperty(metadata, "declarations");
|
|
@@ -35594,8 +35638,8 @@ function findTestObjectsToMigrate(sourceFile, typeChecker) {
|
|
|
35594
35638
|
const catalystImport = getImportSpecifier(sourceFile, /testing\/catalyst$/, "setupModule");
|
|
35595
35639
|
if (testBedImport || catalystImport) {
|
|
35596
35640
|
sourceFile.forEachChild(function walk(node) {
|
|
35597
|
-
if (
|
|
35598
|
-
if (testBedImport &&
|
|
35641
|
+
if (import_typescript110.default.isCallExpression(node) && node.arguments.length > 0 && import_typescript110.default.isObjectLiteralExpression(node.arguments[0])) {
|
|
35642
|
+
if (testBedImport && import_typescript110.default.isPropertyAccessExpression(node.expression) && node.expression.name.text === "configureTestingModule" && isReferenceToImport(typeChecker, node.expression.expression, testBedImport) || catalystImport && import_typescript110.default.isIdentifier(node.expression) && isReferenceToImport(typeChecker, node.expression, catalystImport)) {
|
|
35599
35643
|
testObjects.push(node.arguments[0]);
|
|
35600
35644
|
}
|
|
35601
35645
|
}
|
|
@@ -35610,7 +35654,7 @@ function findTemplateDependencies(ref, typeChecker) {
|
|
|
35610
35654
|
const usedPipes = typeChecker.getUsedPipes(ref.node);
|
|
35611
35655
|
if (usedDirectives !== null) {
|
|
35612
35656
|
for (const dir of usedDirectives) {
|
|
35613
|
-
if (
|
|
35657
|
+
if (import_typescript110.default.isClassDeclaration(dir.ref.node)) {
|
|
35614
35658
|
results.push(dir.ref);
|
|
35615
35659
|
}
|
|
35616
35660
|
}
|
|
@@ -35618,7 +35662,7 @@ function findTemplateDependencies(ref, typeChecker) {
|
|
|
35618
35662
|
if (usedPipes !== null) {
|
|
35619
35663
|
const potentialPipes = typeChecker.getPotentialPipes(ref.node);
|
|
35620
35664
|
for (const pipe of potentialPipes) {
|
|
35621
|
-
if (
|
|
35665
|
+
if (import_typescript110.default.isClassDeclaration(pipe.ref.node) && usedPipes.some((current) => pipe.name === current)) {
|
|
35622
35666
|
results.push(pipe.ref);
|
|
35623
35667
|
}
|
|
35624
35668
|
}
|
|
@@ -35632,12 +35676,12 @@ function filterNonBootstrappedDeclarations(declarations, ngModule, templateTypeC
|
|
|
35632
35676
|
if (!bootstrapProp) {
|
|
35633
35677
|
return declarations;
|
|
35634
35678
|
}
|
|
35635
|
-
if (!
|
|
35679
|
+
if (!import_typescript110.default.isPropertyAssignment(bootstrapProp) || !import_typescript110.default.isArrayLiteralExpression(bootstrapProp.initializer)) {
|
|
35636
35680
|
return [];
|
|
35637
35681
|
}
|
|
35638
35682
|
const bootstrappedClasses = /* @__PURE__ */ new Set();
|
|
35639
35683
|
for (const el of bootstrapProp.initializer.elements) {
|
|
35640
|
-
const referencedClass =
|
|
35684
|
+
const referencedClass = import_typescript110.default.isIdentifier(el) ? findClassDeclaration(el, typeChecker) : null;
|
|
35641
35685
|
if (referencedClass) {
|
|
35642
35686
|
bootstrappedClasses.add(referencedClass);
|
|
35643
35687
|
} else {
|
|
@@ -35648,13 +35692,13 @@ function filterNonBootstrappedDeclarations(declarations, ngModule, templateTypeC
|
|
|
35648
35692
|
}
|
|
35649
35693
|
function extractDeclarationsFromModule(ngModule, templateTypeChecker) {
|
|
35650
35694
|
const metadata = templateTypeChecker.getNgModuleMetadata(ngModule);
|
|
35651
|
-
return metadata ? metadata.declarations.filter((decl) =>
|
|
35695
|
+
return metadata ? metadata.declarations.filter((decl) => import_typescript110.default.isClassDeclaration(decl.node)) : [];
|
|
35652
35696
|
}
|
|
35653
35697
|
function migrateTestDeclarations(testObjects, declarationsOutsideOfTestFiles, tracker, templateTypeChecker, typeChecker) {
|
|
35654
35698
|
const { decorators, componentImports } = analyzeTestingModules(testObjects, typeChecker);
|
|
35655
35699
|
const allDeclarations = declarationsOutsideOfTestFiles.map((ref) => ref.node);
|
|
35656
35700
|
for (const decorator of decorators) {
|
|
35657
|
-
const closestClass = closestNode(decorator.node,
|
|
35701
|
+
const closestClass = closestNode(decorator.node, import_typescript110.default.isClassDeclaration);
|
|
35658
35702
|
if (decorator.name === "Pipe" || decorator.name === "Directive") {
|
|
35659
35703
|
tracker.replaceNode(decorator.node, addStandaloneToDecorator(decorator.node));
|
|
35660
35704
|
if (closestClass) {
|
|
@@ -35667,7 +35711,7 @@ function migrateTestDeclarations(testObjects, declarationsOutsideOfTestFiles, tr
|
|
|
35667
35711
|
allDeclarations.push(closestClass);
|
|
35668
35712
|
}
|
|
35669
35713
|
if (importsToAdd && importsToAdd.size > 0) {
|
|
35670
|
-
tracker.replaceNode(decorator.node, addPropertyToAngularDecorator(newDecorator,
|
|
35714
|
+
tracker.replaceNode(decorator.node, addPropertyToAngularDecorator(newDecorator, import_typescript110.default.factory.createPropertyAssignment("imports", import_typescript110.default.factory.createArrayLiteralExpression(Array.from(importsToAdd)))));
|
|
35671
35715
|
} else {
|
|
35672
35716
|
tracker.replaceNode(decorator.node, newDecorator);
|
|
35673
35717
|
}
|
|
@@ -35687,12 +35731,14 @@ function analyzeTestingModules(testObjects, typeChecker) {
|
|
|
35687
35731
|
continue;
|
|
35688
35732
|
}
|
|
35689
35733
|
const importsProp = findLiteralProperty(obj, "imports");
|
|
35690
|
-
const importElements = importsProp && hasNgModuleMetadataElements(importsProp) ? importsProp.initializer.elements.filter((el) =>
|
|
35734
|
+
const importElements = importsProp && hasNgModuleMetadataElements(importsProp) ? importsProp.initializer.elements.filter((el) => {
|
|
35735
|
+
return !import_typescript110.default.isCallExpression(el) && !isClassReferenceInAngularModule(el, /^BrowserAnimationsModule|NoopAnimationsModule$/, "platform-browser/animations", typeChecker);
|
|
35736
|
+
}) : null;
|
|
35691
35737
|
for (const decl of declarations) {
|
|
35692
35738
|
if (seenDeclarations.has(decl)) {
|
|
35693
35739
|
continue;
|
|
35694
35740
|
}
|
|
35695
|
-
const [decorator] = getAngularDecorators(typeChecker,
|
|
35741
|
+
const [decorator] = getAngularDecorators(typeChecker, import_typescript110.default.getDecorators(decl) || []);
|
|
35696
35742
|
if (decorator) {
|
|
35697
35743
|
seenDeclarations.add(decl);
|
|
35698
35744
|
decorators.push(decorator);
|
|
@@ -35723,7 +35769,7 @@ function extractDeclarationsFromTestObject(obj, typeChecker) {
|
|
|
35723
35769
|
return results;
|
|
35724
35770
|
}
|
|
35725
35771
|
function extractMetadataLiteral(decorator) {
|
|
35726
|
-
return
|
|
35772
|
+
return import_typescript110.default.isCallExpression(decorator.expression) && decorator.expression.arguments.length === 1 && import_typescript110.default.isObjectLiteralExpression(decorator.expression.arguments[0]) ? decorator.expression.arguments[0] : null;
|
|
35727
35773
|
}
|
|
35728
35774
|
function isStandaloneDeclaration(node, declarationsInMigration, templateTypeChecker) {
|
|
35729
35775
|
if (declarationsInMigration.includes(node)) {
|
|
@@ -35744,7 +35790,7 @@ function toStandaloneBootstrap(program, host, basePath, rootFileNames, sourceFil
|
|
|
35744
35790
|
const allDeclarations = [];
|
|
35745
35791
|
for (const sourceFile of sourceFiles) {
|
|
35746
35792
|
sourceFile.forEachChild(function walk(node) {
|
|
35747
|
-
if (
|
|
35793
|
+
if (import_typescript111.default.isCallExpression(node) && import_typescript111.default.isPropertyAccessExpression(node.expression) && node.expression.name.text === "bootstrapModule" && isClassReferenceInAngularModule(node.expression, "PlatformRef", "core", typeChecker)) {
|
|
35748
35794
|
const call = analyzeBootstrapCall(node, typeChecker, templateTypeChecker);
|
|
35749
35795
|
if (call) {
|
|
35750
35796
|
bootstrapCalls.push(call);
|
|
@@ -35765,24 +35811,24 @@ function toStandaloneBootstrap(program, host, basePath, rootFileNames, sourceFil
|
|
|
35765
35811
|
return tracker.recordChanges();
|
|
35766
35812
|
}
|
|
35767
35813
|
function analyzeBootstrapCall(call, typeChecker, templateTypeChecker) {
|
|
35768
|
-
if (call.arguments.length === 0 || !
|
|
35814
|
+
if (call.arguments.length === 0 || !import_typescript111.default.isIdentifier(call.arguments[0])) {
|
|
35769
35815
|
return null;
|
|
35770
35816
|
}
|
|
35771
35817
|
const declaration = findClassDeclaration(call.arguments[0], typeChecker);
|
|
35772
35818
|
if (!declaration) {
|
|
35773
35819
|
return null;
|
|
35774
35820
|
}
|
|
35775
|
-
const decorator = getAngularDecorators(typeChecker,
|
|
35776
|
-
if (!decorator || decorator.node.expression.arguments.length === 0 || !
|
|
35821
|
+
const decorator = getAngularDecorators(typeChecker, import_typescript111.default.getDecorators(declaration) || []).find((decorator2) => decorator2.name === "NgModule");
|
|
35822
|
+
if (!decorator || decorator.node.expression.arguments.length === 0 || !import_typescript111.default.isObjectLiteralExpression(decorator.node.expression.arguments[0])) {
|
|
35777
35823
|
return null;
|
|
35778
35824
|
}
|
|
35779
35825
|
const metadata = decorator.node.expression.arguments[0];
|
|
35780
35826
|
const bootstrapProp = findLiteralProperty(metadata, "bootstrap");
|
|
35781
|
-
if (!bootstrapProp || !
|
|
35827
|
+
if (!bootstrapProp || !import_typescript111.default.isPropertyAssignment(bootstrapProp) || !import_typescript111.default.isArrayLiteralExpression(bootstrapProp.initializer) || bootstrapProp.initializer.elements.length === 0 || !import_typescript111.default.isIdentifier(bootstrapProp.initializer.elements[0])) {
|
|
35782
35828
|
return null;
|
|
35783
35829
|
}
|
|
35784
35830
|
const component = findClassDeclaration(bootstrapProp.initializer.elements[0], typeChecker);
|
|
35785
|
-
if (component && component.name &&
|
|
35831
|
+
if (component && component.name && import_typescript111.default.isIdentifier(component.name)) {
|
|
35786
35832
|
return {
|
|
35787
35833
|
module: declaration,
|
|
35788
35834
|
metadata,
|
|
@@ -35804,16 +35850,16 @@ function migrateBootstrapCall(analysis, tracker, referenceResolver, typeChecker,
|
|
|
35804
35850
|
let nodeLookup = null;
|
|
35805
35851
|
tracker.insertText(moduleSourceFile, analysis.metadata.getStart(), "/* TODO(standalone-migration): clean up removed NgModule class manually. \n");
|
|
35806
35852
|
tracker.insertText(moduleSourceFile, analysis.metadata.getEnd(), " */");
|
|
35807
|
-
if (providers &&
|
|
35853
|
+
if (providers && import_typescript111.default.isPropertyAssignment(providers)) {
|
|
35808
35854
|
nodeLookup = nodeLookup || getNodeLookup(moduleSourceFile);
|
|
35809
|
-
if (
|
|
35855
|
+
if (import_typescript111.default.isArrayLiteralExpression(providers.initializer)) {
|
|
35810
35856
|
providersInNewCall.push(...providers.initializer.elements);
|
|
35811
35857
|
} else {
|
|
35812
|
-
providersInNewCall.push(
|
|
35858
|
+
providersInNewCall.push(import_typescript111.default.factory.createSpreadElement(providers.initializer));
|
|
35813
35859
|
}
|
|
35814
35860
|
addNodesToCopy(sourceFile, providers, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
35815
35861
|
}
|
|
35816
|
-
if (imports &&
|
|
35862
|
+
if (imports && import_typescript111.default.isPropertyAssignment(imports)) {
|
|
35817
35863
|
nodeLookup = nodeLookup || getNodeLookup(moduleSourceFile);
|
|
35818
35864
|
migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, moduleImportsInNewCall, providersInNewCall, tracker, nodesToCopy, referenceResolver, typeChecker);
|
|
35819
35865
|
}
|
|
@@ -35824,7 +35870,7 @@ function migrateBootstrapCall(analysis, tracker, referenceResolver, typeChecker,
|
|
|
35824
35870
|
if (transformedNode === node) {
|
|
35825
35871
|
text += transformedNode.getText() + "\n";
|
|
35826
35872
|
} else {
|
|
35827
|
-
text += printer.printNode(
|
|
35873
|
+
text += printer.printNode(import_typescript111.default.EmitHint.Unspecified, transformedNode, node.getSourceFile());
|
|
35828
35874
|
}
|
|
35829
35875
|
});
|
|
35830
35876
|
text += "\n";
|
|
@@ -35841,30 +35887,30 @@ function replaceBootstrapCallExpression(analysis, providers, modules, tracker) {
|
|
|
35841
35887
|
const combinedProviders = [];
|
|
35842
35888
|
if (modules.length > 0) {
|
|
35843
35889
|
const importProvidersExpression = tracker.addImport(sourceFile, "importProvidersFrom", "@angular/core");
|
|
35844
|
-
combinedProviders.push(
|
|
35890
|
+
combinedProviders.push(import_typescript111.default.factory.createCallExpression(importProvidersExpression, [], modules));
|
|
35845
35891
|
}
|
|
35846
35892
|
combinedProviders.push(...providers);
|
|
35847
|
-
const initializer = remapDynamicImports(sourceFile.fileName,
|
|
35848
|
-
args.push(
|
|
35893
|
+
const initializer = remapDynamicImports(sourceFile.fileName, import_typescript111.default.factory.createArrayLiteralExpression(combinedProviders, combinedProviders.length > 1));
|
|
35894
|
+
args.push(import_typescript111.default.factory.createObjectLiteralExpression([import_typescript111.default.factory.createPropertyAssignment("providers", initializer)], true));
|
|
35849
35895
|
}
|
|
35850
35896
|
tracker.replaceNode(
|
|
35851
35897
|
analysis.call,
|
|
35852
|
-
|
|
35898
|
+
import_typescript111.default.factory.createCallExpression(bootstrapExpression, [], args),
|
|
35853
35899
|
void 0,
|
|
35854
35900
|
analysis.metadata.getSourceFile()
|
|
35855
35901
|
);
|
|
35856
35902
|
}
|
|
35857
35903
|
function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, importsForNewCall, providersInNewCall, tracker, nodesToCopy, referenceResolver, typeChecker) {
|
|
35858
|
-
if (!
|
|
35904
|
+
if (!import_typescript111.default.isArrayLiteralExpression(imports.initializer)) {
|
|
35859
35905
|
importsForNewCall.push(imports.initializer);
|
|
35860
35906
|
return;
|
|
35861
35907
|
}
|
|
35862
35908
|
for (const element of imports.initializer.elements) {
|
|
35863
|
-
if (
|
|
35909
|
+
if (import_typescript111.default.isCallExpression(element) && import_typescript111.default.isPropertyAccessExpression(element.expression) && element.arguments.length > 0 && element.expression.name.text === "forRoot" && isClassReferenceInAngularModule(element.expression.expression, "RouterModule", "router", typeChecker)) {
|
|
35864
35910
|
const options = element.arguments[1];
|
|
35865
35911
|
const features = options ? getRouterModuleForRootFeatures(sourceFile, options, tracker) : [];
|
|
35866
35912
|
if (features !== null) {
|
|
35867
|
-
providersInNewCall.push(
|
|
35913
|
+
providersInNewCall.push(import_typescript111.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideRouter", "@angular/router"), [], [element.arguments[0], ...features]));
|
|
35868
35914
|
addNodesToCopy(sourceFile, element.arguments[0], nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
35869
35915
|
if (options) {
|
|
35870
35916
|
addNodesToCopy(sourceFile, options, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
@@ -35872,21 +35918,30 @@ function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, imports
|
|
|
35872
35918
|
continue;
|
|
35873
35919
|
}
|
|
35874
35920
|
}
|
|
35875
|
-
if (
|
|
35921
|
+
if (import_typescript111.default.isIdentifier(element)) {
|
|
35876
35922
|
const animationsModule = "platform-browser/animations";
|
|
35877
35923
|
const animationsImport = `@angular/${animationsModule}`;
|
|
35878
35924
|
if (isClassReferenceInAngularModule(element, "BrowserAnimationsModule", animationsModule, typeChecker)) {
|
|
35879
|
-
providersInNewCall.push(
|
|
35925
|
+
providersInNewCall.push(import_typescript111.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideAnimations", animationsImport), [], []));
|
|
35880
35926
|
continue;
|
|
35881
35927
|
}
|
|
35882
35928
|
if (isClassReferenceInAngularModule(element, "NoopAnimationsModule", animationsModule, typeChecker)) {
|
|
35883
|
-
providersInNewCall.push(
|
|
35929
|
+
providersInNewCall.push(import_typescript111.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideNoopAnimations", animationsImport), [], []));
|
|
35930
|
+
continue;
|
|
35931
|
+
}
|
|
35932
|
+
const httpClientModule = "common/http";
|
|
35933
|
+
const httpClientImport = `@angular/${httpClientModule}`;
|
|
35934
|
+
if (isClassReferenceInAngularModule(element, "HttpClientModule", httpClientModule, typeChecker)) {
|
|
35935
|
+
const callArgs = [
|
|
35936
|
+
import_typescript111.default.factory.createCallExpression(tracker.addImport(sourceFile, "withInterceptorsFromDi", httpClientImport), [], [])
|
|
35937
|
+
];
|
|
35938
|
+
providersInNewCall.push(import_typescript111.default.factory.createCallExpression(tracker.addImport(sourceFile, "provideHttpClient", httpClientImport), [], callArgs));
|
|
35884
35939
|
continue;
|
|
35885
35940
|
}
|
|
35886
35941
|
}
|
|
35887
|
-
const target =
|
|
35942
|
+
const target = import_typescript111.default.isCallExpression(element) && import_typescript111.default.isPropertyAccessExpression(element.expression) ? element.expression.expression : element;
|
|
35888
35943
|
const classDeclaration = findClassDeclaration(target, typeChecker);
|
|
35889
|
-
const decorators = classDeclaration ? getAngularDecorators(typeChecker,
|
|
35944
|
+
const decorators = classDeclaration ? getAngularDecorators(typeChecker, import_typescript111.default.getDecorators(classDeclaration) || []) : void 0;
|
|
35890
35945
|
if (!decorators || decorators.length === 0 || decorators.every(({ name }) => name !== "Directive" && name !== "Component" && name !== "Pipe")) {
|
|
35891
35946
|
importsForNewCall.push(element);
|
|
35892
35947
|
addNodesToCopy(sourceFile, element, nodeLookup, tracker, nodesToCopy, referenceResolver);
|
|
@@ -35894,7 +35949,7 @@ function migrateImportsForBootstrapCall(sourceFile, imports, nodeLookup, imports
|
|
|
35894
35949
|
}
|
|
35895
35950
|
}
|
|
35896
35951
|
function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
35897
|
-
if (!
|
|
35952
|
+
if (!import_typescript111.default.isObjectLiteralExpression(options)) {
|
|
35898
35953
|
return null;
|
|
35899
35954
|
}
|
|
35900
35955
|
const featureExpressions = [];
|
|
@@ -35902,7 +35957,7 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
35902
35957
|
const inMemoryScrollingOptions = [];
|
|
35903
35958
|
const features = new UniqueItemTracker();
|
|
35904
35959
|
for (const prop of options.properties) {
|
|
35905
|
-
if (!
|
|
35960
|
+
if (!import_typescript111.default.isPropertyAssignment(prop) || !import_typescript111.default.isIdentifier(prop.name) && !import_typescript111.default.isStringLiteralLike(prop.name)) {
|
|
35906
35961
|
return null;
|
|
35907
35962
|
}
|
|
35908
35963
|
switch (prop.name.text) {
|
|
@@ -35910,12 +35965,12 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
35910
35965
|
features.track("withPreloading", prop.initializer);
|
|
35911
35966
|
break;
|
|
35912
35967
|
case "enableTracing":
|
|
35913
|
-
if (prop.initializer.kind ===
|
|
35968
|
+
if (prop.initializer.kind === import_typescript111.default.SyntaxKind.TrueKeyword) {
|
|
35914
35969
|
features.track("withDebugTracing", null);
|
|
35915
35970
|
}
|
|
35916
35971
|
break;
|
|
35917
35972
|
case "initialNavigation":
|
|
35918
|
-
if (!
|
|
35973
|
+
if (!import_typescript111.default.isStringLiteralLike(prop.initializer)) {
|
|
35919
35974
|
return null;
|
|
35920
35975
|
}
|
|
35921
35976
|
if (prop.initializer.text === "enabledBlocking" || prop.initializer.text === "enabled") {
|
|
@@ -35925,7 +35980,7 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
35925
35980
|
}
|
|
35926
35981
|
break;
|
|
35927
35982
|
case "useHash":
|
|
35928
|
-
if (prop.initializer.kind ===
|
|
35983
|
+
if (prop.initializer.kind === import_typescript111.default.SyntaxKind.TrueKeyword) {
|
|
35929
35984
|
features.track("withHashLocation", null);
|
|
35930
35985
|
}
|
|
35931
35986
|
break;
|
|
@@ -35942,10 +35997,10 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
35942
35997
|
}
|
|
35943
35998
|
}
|
|
35944
35999
|
if (inMemoryScrollingOptions.length > 0) {
|
|
35945
|
-
features.track("withInMemoryScrolling",
|
|
36000
|
+
features.track("withInMemoryScrolling", import_typescript111.default.factory.createObjectLiteralExpression(inMemoryScrollingOptions));
|
|
35946
36001
|
}
|
|
35947
36002
|
if (configOptions.length > 0) {
|
|
35948
|
-
features.track("withRouterConfig",
|
|
36003
|
+
features.track("withRouterConfig", import_typescript111.default.factory.createObjectLiteralExpression(configOptions));
|
|
35949
36004
|
}
|
|
35950
36005
|
for (const [feature, featureArgs] of features.getEntries()) {
|
|
35951
36006
|
const callArgs = [];
|
|
@@ -35954,25 +36009,25 @@ function getRouterModuleForRootFeatures(sourceFile, options, tracker) {
|
|
|
35954
36009
|
callArgs.push(arg);
|
|
35955
36010
|
}
|
|
35956
36011
|
});
|
|
35957
|
-
featureExpressions.push(
|
|
36012
|
+
featureExpressions.push(import_typescript111.default.factory.createCallExpression(tracker.addImport(sourceFile, feature, "@angular/router"), [], callArgs));
|
|
35958
36013
|
}
|
|
35959
36014
|
return featureExpressions;
|
|
35960
36015
|
}
|
|
35961
36016
|
function addNodesToCopy(targetFile, rootNode, nodeLookup, tracker, nodesToCopy, referenceResolver) {
|
|
35962
36017
|
const refs = findAllSameFileReferences(rootNode, nodeLookup, referenceResolver);
|
|
35963
36018
|
for (const ref of refs) {
|
|
35964
|
-
const importSpecifier = closestOrSelf(ref,
|
|
35965
|
-
const importDeclaration = importSpecifier ? closestNode(importSpecifier,
|
|
35966
|
-
if (importDeclaration && importSpecifier &&
|
|
36019
|
+
const importSpecifier = closestOrSelf(ref, import_typescript111.default.isImportSpecifier);
|
|
36020
|
+
const importDeclaration = importSpecifier ? closestNode(importSpecifier, import_typescript111.default.isImportDeclaration) : null;
|
|
36021
|
+
if (importDeclaration && importSpecifier && import_typescript111.default.isStringLiteralLike(importDeclaration.moduleSpecifier)) {
|
|
35967
36022
|
const moduleName = importDeclaration.moduleSpecifier.text.startsWith(".") ? remapRelativeImport(targetFile.fileName, importDeclaration.moduleSpecifier) : importDeclaration.moduleSpecifier.text;
|
|
35968
36023
|
const symbolName = importSpecifier.propertyName ? importSpecifier.propertyName.text : importSpecifier.name.text;
|
|
35969
36024
|
const alias = importSpecifier.propertyName ? importSpecifier.name.text : null;
|
|
35970
36025
|
tracker.addImport(targetFile, symbolName, moduleName, alias);
|
|
35971
36026
|
continue;
|
|
35972
36027
|
}
|
|
35973
|
-
const variableDeclaration = closestOrSelf(ref,
|
|
35974
|
-
const variableStatement = variableDeclaration ? closestNode(variableDeclaration,
|
|
35975
|
-
if (variableDeclaration && variableStatement &&
|
|
36028
|
+
const variableDeclaration = closestOrSelf(ref, import_typescript111.default.isVariableDeclaration);
|
|
36029
|
+
const variableStatement = variableDeclaration ? closestNode(variableDeclaration, import_typescript111.default.isVariableStatement) : null;
|
|
36030
|
+
if (variableDeclaration && variableStatement && import_typescript111.default.isIdentifier(variableDeclaration.name)) {
|
|
35976
36031
|
if (isExported3(variableStatement)) {
|
|
35977
36032
|
tracker.addImport(targetFile, variableDeclaration.name.text, getRelativeImportPath(targetFile.fileName, ref.getSourceFile().fileName));
|
|
35978
36033
|
} else {
|
|
@@ -36013,7 +36068,7 @@ function findAllSameFileReferences(rootNode, nodeLookup, referenceResolver) {
|
|
|
36013
36068
|
if (!closestTopLevel || traversedTopLevelNodes.has(closestTopLevel)) {
|
|
36014
36069
|
continue;
|
|
36015
36070
|
}
|
|
36016
|
-
if (!
|
|
36071
|
+
if (!import_typescript111.default.isImportDeclaration(closestTopLevel) && isOutsideRange(excludeStart, excludeEnd, closestTopLevel.getStart(), closestTopLevel.getEnd())) {
|
|
36017
36072
|
traversedTopLevelNodes.add(closestTopLevel);
|
|
36018
36073
|
walk(closestTopLevel);
|
|
36019
36074
|
}
|
|
@@ -36034,25 +36089,25 @@ function referencesToNodeWithinSameFile(node, nodeLookup, excludeStart, excludeE
|
|
|
36034
36089
|
function remapDynamicImports(targetFileName, rootNode) {
|
|
36035
36090
|
let hasChanged = false;
|
|
36036
36091
|
const transformer = (context) => {
|
|
36037
|
-
return (sourceFile) =>
|
|
36038
|
-
if (
|
|
36092
|
+
return (sourceFile) => import_typescript111.default.visitNode(sourceFile, function walk(node) {
|
|
36093
|
+
if (import_typescript111.default.isCallExpression(node) && node.expression.kind === import_typescript111.default.SyntaxKind.ImportKeyword && node.arguments.length > 0 && import_typescript111.default.isStringLiteralLike(node.arguments[0]) && node.arguments[0].text.startsWith(".")) {
|
|
36039
36094
|
hasChanged = true;
|
|
36040
36095
|
return context.factory.updateCallExpression(node, node.expression, node.typeArguments, [
|
|
36041
36096
|
context.factory.createStringLiteral(remapRelativeImport(targetFileName, node.arguments[0])),
|
|
36042
36097
|
...node.arguments.slice(1)
|
|
36043
36098
|
]);
|
|
36044
36099
|
}
|
|
36045
|
-
return
|
|
36100
|
+
return import_typescript111.default.visitEachChild(node, walk, context);
|
|
36046
36101
|
});
|
|
36047
36102
|
};
|
|
36048
|
-
const result =
|
|
36103
|
+
const result = import_typescript111.default.transform(rootNode, [transformer]).transformed[0];
|
|
36049
36104
|
return hasChanged ? result : rootNode;
|
|
36050
36105
|
}
|
|
36051
36106
|
function isTopLevelStatement(node) {
|
|
36052
|
-
return node.parent != null &&
|
|
36107
|
+
return node.parent != null && import_typescript111.default.isSourceFile(node.parent);
|
|
36053
36108
|
}
|
|
36054
36109
|
function isReferenceIdentifier(node) {
|
|
36055
|
-
return
|
|
36110
|
+
return import_typescript111.default.isIdentifier(node) && (!import_typescript111.default.isPropertyAssignment(node.parent) && !import_typescript111.default.isParameter(node.parent) || node.parent.name !== node);
|
|
36056
36111
|
}
|
|
36057
36112
|
function isOutsideRange(excludeStart, excludeEnd, start, end) {
|
|
36058
36113
|
return start < excludeStart && end < excludeStart || start > excludeEnd;
|
|
@@ -36061,29 +36116,15 @@ function remapRelativeImport(targetFileName, specifier) {
|
|
|
36061
36116
|
return getRelativeImportPath(targetFileName, (0, import_path7.join)((0, import_path7.dirname)(specifier.getSourceFile().fileName), specifier.text));
|
|
36062
36117
|
}
|
|
36063
36118
|
function isExported3(node) {
|
|
36064
|
-
return
|
|
36065
|
-
}
|
|
36066
|
-
function closestOrSelf(node, predicate) {
|
|
36067
|
-
return predicate(node) ? node : closestNode(node, predicate);
|
|
36119
|
+
return import_typescript111.default.canHaveModifiers(node) && node.modifiers ? node.modifiers.some((modifier) => modifier.kind === import_typescript111.default.SyntaxKind.ExportKeyword) : false;
|
|
36068
36120
|
}
|
|
36069
36121
|
function isExportableDeclaration(node) {
|
|
36070
|
-
return
|
|
36071
|
-
}
|
|
36072
|
-
function isClassReferenceInAngularModule(node, className, moduleName, typeChecker) {
|
|
36073
|
-
var _a;
|
|
36074
|
-
const symbol = typeChecker.getTypeAtLocation(node).getSymbol();
|
|
36075
|
-
const externalName = `@angular/${moduleName}`;
|
|
36076
|
-
const internalName = `angular2/rc/packages/${moduleName}`;
|
|
36077
|
-
return !!((_a = symbol == null ? void 0 : symbol.declarations) == null ? void 0 : _a.some((decl) => {
|
|
36078
|
-
const closestClass = closestOrSelf(decl, import_typescript112.default.isClassDeclaration);
|
|
36079
|
-
const closestClassFileName = closestClass == null ? void 0 : closestClass.getSourceFile().fileName;
|
|
36080
|
-
return closestClass && closestClassFileName && closestClass.name && import_typescript112.default.isIdentifier(closestClass.name) && closestClass.name.text === className && (closestClassFileName.includes(externalName) || closestClassFileName.includes(internalName));
|
|
36081
|
-
}));
|
|
36122
|
+
return import_typescript111.default.isEnumDeclaration(node) || import_typescript111.default.isClassDeclaration(node) || import_typescript111.default.isFunctionDeclaration(node) || import_typescript111.default.isInterfaceDeclaration(node) || import_typescript111.default.isTypeAliasDeclaration(node);
|
|
36082
36123
|
}
|
|
36083
36124
|
function getLastImportEnd(sourceFile) {
|
|
36084
36125
|
let index = 0;
|
|
36085
36126
|
for (const statement of sourceFile.statements) {
|
|
36086
|
-
if (
|
|
36127
|
+
if (import_typescript111.default.isImportDeclaration(statement)) {
|
|
36087
36128
|
index = Math.max(index, statement.getEnd());
|
|
36088
36129
|
} else {
|
|
36089
36130
|
break;
|
|
@@ -36131,7 +36172,7 @@ function standaloneMigration(tree, tsconfigPath, basePath, pathToMigrate, schema
|
|
|
36131
36172
|
});
|
|
36132
36173
|
const referenceLookupExcludedFiles = /node_modules|\.ngtypecheck\.ts/;
|
|
36133
36174
|
const program = createProgram({ rootNames, host, options, oldProgram });
|
|
36134
|
-
const printer =
|
|
36175
|
+
const printer = import_typescript112.default.createPrinter();
|
|
36135
36176
|
if ((0, import_fs2.existsSync)(pathToMigrate) && !(0, import_fs2.statSync)(pathToMigrate).isDirectory()) {
|
|
36136
36177
|
throw new import_schematics.SchematicsException(`Migration path ${pathToMigrate} has to be a directory. Cannot run the standalone migration.`);
|
|
36137
36178
|
}
|