|
6 | 6 | * found in the LICENSE file at https://angular.io/license
|
7 | 7 | */
|
8 | 8 |
|
9 |
| -import { workspaces } from '@angular-devkit/core'; |
| 9 | +import { JsonObject, JsonValue, isJsonObject, workspaces } from '@angular-devkit/core'; |
10 | 10 | import { Rule } from '@angular-devkit/schematics';
|
11 | 11 | import { updateWorkspace } from '../../utility/workspace';
|
12 | 12 | import { Builders, ProjectType } from '../../utility/workspace-models';
|
13 | 13 |
|
14 | 14 | export default function (): Rule {
|
15 | 15 | return updateWorkspace(workspace => {
|
| 16 | + // Remove deprecated CLI root level options |
| 17 | + removeDeprecatedCLIOptions(workspace.extensions); |
| 18 | + |
16 | 19 | for (const [, project] of workspace.projects) {
|
| 20 | + // Project level |
| 21 | + removeDeprecatedCLIOptions(project.extensions); |
| 22 | + |
17 | 23 | if (project.extensions.projectType !== ProjectType.Application) {
|
18 | 24 | // Only interested in application projects since these changes only effects application builders
|
19 | 25 | continue;
|
@@ -104,3 +110,13 @@ function updateVendorSourceMap(options: TargetOptions): TargetOptions {
|
104 | 110 | vendorSourceMap: undefined,
|
105 | 111 | };
|
106 | 112 | }
|
| 113 | + |
| 114 | +function removeDeprecatedCLIOptions(extensions: Record<string, JsonValue | undefined>) { |
| 115 | + const cliOptions = extensions?.cli; |
| 116 | + if (cliOptions && isJsonObject(cliOptions) && isJsonObject(cliOptions.warnings)) { |
| 117 | + (cliOptions.warnings as Partial<JsonObject>) = { |
| 118 | + ...cliOptions.warnings, |
| 119 | + typescriptMismatch: undefined, |
| 120 | + }; |
| 121 | + } |
| 122 | +} |
0 commit comments