Skip to content

Commit 5c82d0d

Browse files
author
Angular Builds
committed
1fcb744 fix(@schematics/angular): use string assets when updating
1 parent 41ff1e5 commit 5c82d0d

File tree

19 files changed

+171
-78
lines changed

19 files changed

+171
-78
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"typings": "src/index.d.ts",
77
"builders": "builders.json",
88
"dependencies": {
9-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#27cecc6",
10-
"@angular-devkit/build-optimizer": "github:angular/angular-devkit-build-optimizer-builds#27cecc6",
11-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#27cecc6",
12-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#27cecc6",
9+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#1fcb744",
10+
"@angular-devkit/build-optimizer": "github:angular/angular-devkit-build-optimizer-builds#1fcb744",
11+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#1fcb744",
12+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#1fcb744",
1313
"ajv": "~6.4.0",
1414
"autoprefixer": "^8.1.0",
1515
"cache-loader": "^1.2.2",

src/angular-cli-files/models/build-options.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88
import * as ts from 'typescript';
9-
import { AssetPattern, Budget, ExtraEntryPoint } from '../../browser/schema';
9+
import { AssetPatternObject, Budget, ExtraEntryPoint } from '../../browser/schema';
1010
export interface BuildOptions {
1111
optimization: boolean;
1212
environment?: string;
@@ -45,7 +45,7 @@ export interface BuildOptions {
4545
index: string;
4646
polyfills?: string;
4747
budgets: Budget[];
48-
assets: AssetPattern[];
48+
assets: AssetPatternObject[];
4949
scripts: ExtraEntryPoint[];
5050
styles: ExtraEntryPoint[];
5151
stylePreprocessorOptions?: {

src/angular-cli-files/models/build-options.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/angular-cli-files/models/webpack-configs/common.js

Lines changed: 4 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/browser/index.d.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,16 @@ import { BuildEvent, Builder, BuilderConfiguration, BuilderContext } from '@angu
1010
import { Path, virtualFs } from '@angular-devkit/core';
1111
import * as fs from 'fs';
1212
import { Observable } from 'rxjs';
13-
import * as ts from 'typescript';
14-
import { BrowserBuilderSchema } from './schema';
15-
export interface WebpackConfigOptions {
16-
root: string;
17-
projectRoot: string;
18-
buildOptions: BrowserBuilderSchema;
19-
tsConfig: ts.ParsedCommandLine;
20-
tsConfigPath: string;
21-
supportES2015: boolean;
13+
import { AssetPatternObject, BrowserBuilderSchema, CurrentFileReplacement } from './schema';
14+
export interface NormalizedBrowserBuilderSchema extends BrowserBuilderSchema {
15+
assets: AssetPatternObject[];
16+
fileReplacements: CurrentFileReplacement[];
2217
}
2318
export declare class BrowserBuilder implements Builder<BrowserBuilderSchema> {
2419
context: BuilderContext;
2520
constructor(context: BuilderContext);
2621
run(builderConfig: BuilderConfiguration<BrowserBuilderSchema>): Observable<BuildEvent>;
27-
buildWebpackConfig(root: Path, projectRoot: Path, host: virtualFs.Host<fs.Stats>, options: BrowserBuilderSchema): any;
22+
buildWebpackConfig(root: Path, projectRoot: Path, host: virtualFs.Host<fs.Stats>, options: NormalizedBrowserBuilderSchema): any;
2823
private _deleteOutputDir(root, outputPath, host);
2924
}
3025
export default BrowserBuilder;

src/browser/index.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/browser/schema.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,9 @@ export interface BrowserBuilderSchema {
219219
budgets: Budget[];
220220
}
221221

222-
export interface AssetPattern {
222+
export type AssetPattern = string | AssetPatternObject;
223+
224+
export interface AssetPatternObject {
223225
/**
224226
* The pattern to match.
225227
*/

src/browser/schema.json

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -243,26 +243,33 @@
243243
],
244244
"definitions": {
245245
"assetPattern": {
246-
"type": "object",
247-
"properties": {
248-
"glob": {
249-
"type": "string",
250-
"description": "The pattern to match."
251-
},
252-
"input": {
253-
"type": "string",
254-
"description": "The input path dir in which to apply 'glob'. Defaults to the project root."
246+
"oneOf": [
247+
{
248+
"type": "object",
249+
"properties": {
250+
"glob": {
251+
"type": "string",
252+
"description": "The pattern to match."
253+
},
254+
"input": {
255+
"type": "string",
256+
"description": "The input path dir in which to apply 'glob'. Defaults to the project root."
257+
},
258+
"output": {
259+
"type": "string",
260+
"description": "Absolute path within the output."
261+
}
262+
},
263+
"additionalProperties": false,
264+
"required": [
265+
"glob",
266+
"input",
267+
"output"
268+
]
255269
},
256-
"output": {
257-
"type": "string",
258-
"description": "Absolute path within the output."
270+
{
271+
"type": "string"
259272
}
260-
},
261-
"additionalProperties": false,
262-
"required": [
263-
"glob",
264-
"input",
265-
"output"
266273
]
267274
},
268275
"fileReplacement": {

src/dev-server/index.js

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/extract-i18n/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import { BuildEvent, Builder, BuilderConfiguration, BuilderContext } from '@angular-devkit/architect';
99
import { Path } from '@angular-devkit/core';
1010
import { Observable } from 'rxjs';
11-
import { BrowserBuilderSchema } from '../browser/schema';
11+
import { NormalizedBrowserBuilderSchema } from '../browser';
1212
export interface ExtractI18nBuilderOptions {
1313
browserTarget: string;
1414
i18nFormat: string;
@@ -20,6 +20,6 @@ export declare class ExtractI18nBuilder implements Builder<ExtractI18nBuilderOpt
2020
context: BuilderContext;
2121
constructor(context: BuilderContext);
2222
run(builderConfig: BuilderConfiguration<ExtractI18nBuilderOptions>): Observable<BuildEvent>;
23-
buildWebpackConfig(root: Path, projectRoot: Path, options: BrowserBuilderSchema): any;
23+
buildWebpackConfig(root: Path, projectRoot: Path, options: NormalizedBrowserBuilderSchema): any;
2424
}
2525
export default ExtractI18nBuilder;

0 commit comments

Comments
 (0)