source: trip-planner-front/node_modules/@schematics/angular/migrations/update-9/remove-tsickle.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.7 KB
Line 
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.removeTsickle = void 0;
11const dependencies_1 = require("../../utility/dependencies");
12const json_file_1 = require("../../utility/json-file");
13const workspace_1 = require("../../utility/workspace");
14const workspace_models_1 = require("../../utility/workspace-models");
15/**
16 * Remove tsickle from libraries
17 */
18function removeTsickle() {
19 return async (tree, { logger }) => {
20 dependencies_1.removePackageJsonDependency(tree, 'tsickle');
21 const workspace = await workspace_1.getWorkspace(tree);
22 for (const [targetName, target] of workspace_1.allWorkspaceTargets(workspace)) {
23 if (targetName !== 'build' || target.builder !== workspace_models_1.Builders.DeprecatedNgPackagr) {
24 continue;
25 }
26 for (const [, options] of workspace_1.allTargetOptions(target)) {
27 const tsConfigPath = options.tsConfig;
28 if (!tsConfigPath || typeof tsConfigPath !== 'string') {
29 continue;
30 }
31 let tsConfigJson;
32 try {
33 tsConfigJson = new json_file_1.JSONFile(tree, tsConfigPath);
34 }
35 catch {
36 logger.warn(`Cannot find file: ${tsConfigPath}`);
37 continue;
38 }
39 tsConfigJson.remove(['angularCompilerOptions', 'annotateForClosureCompiler']);
40 }
41 }
42 };
43}
44exports.removeTsickle = removeTsickle;
Note: See TracBrowser for help on using the repository browser.