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 core_1 = require("@angular-devkit/core");
|
---|
11 | const workspace_1 = require("../../utility/workspace");
|
---|
12 | function default_1() {
|
---|
13 | return workspace_1.updateWorkspace((workspace) => {
|
---|
14 | // Update root level schematics options if present
|
---|
15 | const rootSchematics = workspace.extensions.schematics;
|
---|
16 | if (rootSchematics && core_1.json.isJsonObject(rootSchematics)) {
|
---|
17 | updateSchematicsField(rootSchematics);
|
---|
18 | }
|
---|
19 | // Update project level schematics options if present
|
---|
20 | for (const [, project] of workspace.projects) {
|
---|
21 | const projectSchematics = project.extensions.schematics;
|
---|
22 | if (projectSchematics && core_1.json.isJsonObject(projectSchematics)) {
|
---|
23 | updateSchematicsField(projectSchematics);
|
---|
24 | }
|
---|
25 | }
|
---|
26 | });
|
---|
27 | }
|
---|
28 | exports.default = default_1;
|
---|
29 | function updateSchematicsField(schematics) {
|
---|
30 | for (const [schematicName, schematicOptions] of Object.entries(schematics)) {
|
---|
31 | if (!core_1.json.isJsonObject(schematicOptions)) {
|
---|
32 | continue;
|
---|
33 | }
|
---|
34 | if (schematicName === '@schematics/angular:module') {
|
---|
35 | delete schematicOptions.skipTests;
|
---|
36 | }
|
---|
37 | }
|
---|
38 | }
|
---|