Skip to content

fix(@angular-devkit/build-angular): add missing declaration types … #13421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import {
Budget,
CurrentFileReplacement,
ExtraEntryPoint,
NormalizedOptimization,
NormalizedSourceMaps,
} from '../../browser/schema';
import { NormalizedOptimization, NormalizedSourceMaps } from '../../utils/index';

export interface BuildOptions {
optimization: NormalizedOptimization;
Expand Down
13 changes: 13 additions & 0 deletions packages/angular_devkit/build_angular/src/browser/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

export interface BrowserBuilderSchema {
/**
* List of static application assets.
Expand Down Expand Up @@ -409,6 +410,18 @@ export enum BudgetType {
// Right now this normalization has to be done in all other builders that make use of the
// BrowserBuildSchema and BrowserBuilder.buildWebpackConfig.
// It would really help if it happens during architect.validateBuilderOptions, or similar.
export interface NormalizedOptimization {
scripts: boolean;
styles: boolean;
}

export interface NormalizedSourceMaps {
scripts: boolean;
styles: boolean;
hidden: boolean;
vendor: boolean;
}

export interface NormalizedBrowserBuilderSchema extends
Pick<
BrowserBuilderSchema,
Expand Down
7 changes: 6 additions & 1 deletion packages/angular_devkit/build_angular/src/karma/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import { BrowserBuilderSchema } from '../browser/schema';
import {
AssetPatternObject,
BrowserBuilderSchema,
CurrentFileReplacement,
NormalizedSourceMaps,
} from '../browser/schema';

export interface KarmaBuilderSchema extends Pick<BrowserBuilderSchema,
'assets' | 'main' | 'polyfills' | 'tsConfig' | 'scripts' | 'styles' | 'stylePreprocessorOptions'
Expand Down
3 changes: 3 additions & 0 deletions packages/angular_devkit/build_angular/src/server/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@

import {
BrowserBuilderSchema,
CurrentFileReplacement,
FileReplacement,
NormalizedOptimization,
NormalizedSourceMaps,
OptimizationObject,
SourceMapOptions,
} from '../browser/schema';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/

import { OptimizationOptions, SourceMapOptions } from '../browser/schema';

export interface NormalizedOptimization {
scripts: boolean;
styles: boolean;
}
import {
NormalizedOptimization,
OptimizationOptions,
SourceMapOptions,
} from '../browser/schema';

export function normalizeOptimization(optimization: OptimizationOptions): NormalizedOptimization {
const scripts = !!(typeof optimization === 'object' ? optimization.scripts : optimization);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import { SourceMapOptions } from '../browser/schema';

export interface NormalizedSourceMaps {
scripts: boolean;
styles: boolean;
hidden: boolean;
vendor: boolean;
}
import { NormalizedSourceMaps, SourceMapOptions } from '../browser/schema';

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