Skip to content

Commit f087948

Browse files
committed
fix(@angular-devkit/build-angular): add missing declaration types in build_angular schemas.
Fixes issue angular#13388
1 parent 63748ab commit f087948

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed

packages/angular_devkit/build_angular/src/angular-cli-files/models/build-options.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import {
1515
Budget,
1616
CurrentFileReplacement,
1717
ExtraEntryPoint,
18+
NormalizedOptimization,
19+
NormalizedSourceMaps,
1820
} from '../../browser/schema';
19-
import { NormalizedOptimization, NormalizedSourceMaps } from '../../utils/index';
2021

2122
export interface BuildOptions {
2223
optimization: NormalizedOptimization;

packages/angular_devkit/build_angular/src/browser/schema.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8+
89
export interface BrowserBuilderSchema {
910
/**
1011
* List of static application assets.
@@ -409,6 +410,18 @@ export enum BudgetType {
409410
// Right now this normalization has to be done in all other builders that make use of the
410411
// BrowserBuildSchema and BrowserBuilder.buildWebpackConfig.
411412
// It would really help if it happens during architect.validateBuilderOptions, or similar.
413+
export interface NormalizedOptimization {
414+
scripts: boolean;
415+
styles: boolean;
416+
}
417+
418+
export interface NormalizedSourceMaps {
419+
scripts: boolean;
420+
styles: boolean;
421+
hidden: boolean;
422+
vendor: boolean;
423+
}
424+
412425
export interface NormalizedBrowserBuilderSchema extends
413426
Pick<
414427
BrowserBuilderSchema,

packages/angular_devkit/build_angular/src/karma/schema.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import { BrowserBuilderSchema } from '../browser/schema';
8+
import {
9+
AssetPatternObject,
10+
BrowserBuilderSchema,
11+
CurrentFileReplacement,
12+
NormalizedSourceMaps,
13+
} from '../browser/schema';
914

1015
export interface KarmaBuilderSchema extends Pick<BrowserBuilderSchema,
1116
'assets' | 'main' | 'polyfills' | 'tsConfig' | 'scripts' | 'styles' | 'stylePreprocessorOptions'

packages/angular_devkit/build_angular/src/server/schema.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
import {
1010
BrowserBuilderSchema,
11+
CurrentFileReplacement,
1112
FileReplacement,
13+
NormalizedOptimization,
14+
NormalizedSourceMaps,
1215
OptimizationObject,
1316
SourceMapOptions,
1417
} from '../browser/schema';

packages/angular_devkit/build_angular/src/utils/normalize-optimization.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { OptimizationOptions, SourceMapOptions } from '../browser/schema';
10-
11-
export interface NormalizedOptimization {
12-
scripts: boolean;
13-
styles: boolean;
14-
}
9+
import {
10+
NormalizedOptimization,
11+
OptimizationOptions,
12+
SourceMapOptions,
13+
} from '../browser/schema';
1514

1615
export function normalizeOptimization(optimization: OptimizationOptions): NormalizedOptimization {
1716
const scripts = !!(typeof optimization === 'object' ? optimization.scripts : optimization);

packages/angular_devkit/build_angular/src/utils/normalize-source-maps.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import { SourceMapOptions } from '../browser/schema';
10-
11-
export interface NormalizedSourceMaps {
12-
scripts: boolean;
13-
styles: boolean;
14-
hidden: boolean;
15-
vendor: boolean;
16-
}
9+
import { NormalizedSourceMaps, SourceMapOptions } from '../browser/schema';
1710

1811
export function normalizeSourceMaps(sourceMap: SourceMapOptions): NormalizedSourceMaps {
1912
const scripts = !!(typeof sourceMap === 'object' ? sourceMap.scripts : sourceMap);

0 commit comments

Comments
 (0)