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 | */
|
---|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
10 | const schematics_1 = require("@angular-devkit/schematics");
|
---|
11 | const dependencies_1 = require("../../utility/dependencies");
|
---|
12 | const latest_versions_1 = require("../../utility/latest-versions");
|
---|
13 | const workspace_1 = require("../../utility/workspace");
|
---|
14 | const workspace_models_1 = require("../../utility/workspace-models");
|
---|
15 | function default_1() {
|
---|
16 | return schematics_1.chain([
|
---|
17 | workspace_1.updateWorkspace((workspace) => {
|
---|
18 | for (const [, project] of workspace.projects) {
|
---|
19 | for (const [, target] of project.targets) {
|
---|
20 | if (target.builder === workspace_models_1.Builders.DeprecatedNgPackagr) {
|
---|
21 | target.builder = workspace_models_1.Builders.NgPackagr;
|
---|
22 | }
|
---|
23 | }
|
---|
24 | }
|
---|
25 | }),
|
---|
26 | (host) => {
|
---|
27 | dependencies_1.removePackageJsonDependency(host, '@angular-devkit/build-ng-packagr');
|
---|
28 | dependencies_1.addPackageJsonDependency(host, {
|
---|
29 | type: dependencies_1.NodeDependencyType.Dev,
|
---|
30 | name: '@angular-devkit/build-angular',
|
---|
31 | version: latest_versions_1.latestVersions.DevkitBuildAngular,
|
---|
32 | overwrite: false,
|
---|
33 | });
|
---|
34 | },
|
---|
35 | ]);
|
---|
36 | }
|
---|
37 | exports.default = default_1;
|
---|