1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | (function (factory) {
|
---|
9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
10 | var v = factory(require, exports);
|
---|
11 | if (v !== undefined) module.exports = v;
|
---|
12 | }
|
---|
13 | else if (typeof define === "function" && define.amd) {
|
---|
14 | define("@angular/core/schematics/migrations/move-document", ["require", "exports", "@angular-devkit/schematics", "path", "@angular/core/schematics/utils/project_tsconfig_paths", "@angular/core/schematics/utils/typescript/compiler_host", "@angular/core/schematics/migrations/move-document/document_import_visitor", "@angular/core/schematics/migrations/move-document/move-import"], factory);
|
---|
15 | }
|
---|
16 | })(function (require, exports) {
|
---|
17 | "use strict";
|
---|
18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
19 | const schematics_1 = require("@angular-devkit/schematics");
|
---|
20 | const path_1 = require("path");
|
---|
21 | const project_tsconfig_paths_1 = require("@angular/core/schematics/utils/project_tsconfig_paths");
|
---|
22 | const compiler_host_1 = require("@angular/core/schematics/utils/typescript/compiler_host");
|
---|
23 | const document_import_visitor_1 = require("@angular/core/schematics/migrations/move-document/document_import_visitor");
|
---|
24 | const move_import_1 = require("@angular/core/schematics/migrations/move-document/move-import");
|
---|
25 | /** Entry point for the V8 move-document migration. */
|
---|
26 | function default_1() {
|
---|
27 | return (tree) => {
|
---|
28 | const { buildPaths, testPaths } = project_tsconfig_paths_1.getProjectTsConfigPaths(tree);
|
---|
29 | const basePath = process.cwd();
|
---|
30 | if (!buildPaths.length && !testPaths.length) {
|
---|
31 | throw new schematics_1.SchematicsException(`Could not find any tsconfig file. Cannot migrate DOCUMENT
|
---|
32 | to new import source.`);
|
---|
33 | }
|
---|
34 | for (const tsconfigPath of [...buildPaths, ...testPaths]) {
|
---|
35 | runMoveDocumentMigration(tree, tsconfigPath, basePath);
|
---|
36 | }
|
---|
37 | };
|
---|
38 | }
|
---|
39 | exports.default = default_1;
|
---|
40 | /**
|
---|
41 | * Runs the DOCUMENT InjectionToken import migration for the given TypeScript project. The
|
---|
42 | * schematic analyzes the imports within the project and moves the deprecated symbol to the
|
---|
43 | * new import source.
|
---|
44 | */
|
---|
45 | function runMoveDocumentMigration(tree, tsconfigPath, basePath) {
|
---|
46 | const { program } = compiler_host_1.createMigrationProgram(tree, tsconfigPath, basePath);
|
---|
47 | const typeChecker = program.getTypeChecker();
|
---|
48 | const visitor = new document_import_visitor_1.DocumentImportVisitor(typeChecker);
|
---|
49 | const sourceFiles = program.getSourceFiles().filter(sourceFile => compiler_host_1.canMigrateFile(basePath, sourceFile, program));
|
---|
50 | // Analyze source files by finding imports.
|
---|
51 | sourceFiles.forEach(sourceFile => visitor.visitNode(sourceFile));
|
---|
52 | const { importsMap } = visitor;
|
---|
53 | // Walk through all source files that contain resolved queries and update
|
---|
54 | // the source files if needed. Note that we need to update multiple queries
|
---|
55 | // within a source file within the same recorder in order to not throw off
|
---|
56 | // the TypeScript node offsets.
|
---|
57 | importsMap.forEach((resolvedImport, sourceFile) => {
|
---|
58 | const { platformBrowserImport, commonImport, documentElement } = resolvedImport;
|
---|
59 | if (!documentElement || !platformBrowserImport) {
|
---|
60 | return;
|
---|
61 | }
|
---|
62 | const update = tree.beginUpdate(path_1.relative(basePath, sourceFile.fileName));
|
---|
63 | const platformBrowserDeclaration = platformBrowserImport.parent.parent;
|
---|
64 | const newPlatformBrowserText = move_import_1.removeFromImport(platformBrowserImport, sourceFile, document_import_visitor_1.DOCUMENT_TOKEN_NAME);
|
---|
65 | const newCommonText = commonImport ?
|
---|
66 | move_import_1.addToImport(commonImport, sourceFile, documentElement.name, documentElement.propertyName) :
|
---|
67 | move_import_1.createImport(document_import_visitor_1.COMMON_IMPORT, sourceFile, documentElement.name, documentElement.propertyName);
|
---|
68 | // Replace the existing query decorator call expression with the updated
|
---|
69 | // call expression node.
|
---|
70 | update.remove(platformBrowserDeclaration.getStart(), platformBrowserDeclaration.getWidth());
|
---|
71 | update.insertRight(platformBrowserDeclaration.getStart(), newPlatformBrowserText);
|
---|
72 | if (commonImport) {
|
---|
73 | const commonDeclaration = commonImport.parent.parent;
|
---|
74 | update.remove(commonDeclaration.getStart(), commonDeclaration.getWidth());
|
---|
75 | update.insertRight(commonDeclaration.getStart(), newCommonText);
|
---|
76 | }
|
---|
77 | else {
|
---|
78 | update.insertRight(platformBrowserDeclaration.getStart(), newCommonText);
|
---|
79 | }
|
---|
80 | tree.commitUpdate(update);
|
---|
81 | });
|
---|
82 | }
|
---|
83 | });
|
---|
84 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NjaGVtYXRpY3MvbWlncmF0aW9ucy9tb3ZlLWRvY3VtZW50L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7O0lBRUgsMkRBQTJFO0lBQzNFLCtCQUE4QjtJQUc5QixrR0FBMkU7SUFDM0UsMkZBQTRGO0lBRTVGLHVIQUE0SDtJQUM1SCwrRkFBMEU7SUFHMUUsc0RBQXNEO0lBQ3REO1FBQ0UsT0FBTyxDQUFDLElBQVUsRUFBRSxFQUFFO1lBQ3BCLE1BQU0sRUFBQyxVQUFVLEVBQUUsU0FBUyxFQUFDLEdBQUcsZ0RBQXVCLENBQUMsSUFBSSxDQUFDLENBQUM7WUFDOUQsTUFBTSxRQUFRLEdBQUcsT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDO1lBRS9CLElBQUksQ0FBQyxVQUFVLENBQUMsTUFBTSxJQUFJLENBQUMsU0FBUyxDQUFDLE1BQU0sRUFBRTtnQkFDM0MsTUFBT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