Skip to content

Commit 7f6f1bf

Browse files
author
Angular Builds
committed
6530aa1 feat(@schematics/angular): replace assets with public directory
1 parent ed534d8 commit 7f6f1bf

18 files changed

+37
-22
lines changed

Diff for: package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "18.0.0-next.0+sha-9d3aa46",
3+
"version": "18.0.0-next.0+sha-6530aa1",
44
"description": "Angular Webpack Build Facade",
55
"main": "src/index.js",
66
"typings": "src/index.d.ts",
77
"builders": "builders.json",
88
"dependencies": {
99
"@ampproject/remapping": "2.3.0",
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#9d3aa46",
11-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#9d3aa46",
12-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#9d3aa46",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#6530aa1",
11+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#6530aa1",
12+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#6530aa1",
1313
"@babel/core": "7.24.3",
1414
"@babel/generator": "7.24.1",
1515
"@babel/helper-annotate-as-pure": "7.22.5",
@@ -20,7 +20,7 @@
2020
"@babel/preset-env": "7.24.3",
2121
"@babel/runtime": "7.24.1",
2222
"@discoveryjs/json-ext": "0.5.7",
23-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#9d3aa46",
23+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#6530aa1",
2424
"@vitejs/plugin-basic-ssl": "1.1.0",
2525
"ansi-colors": "4.1.3",
2626
"autoprefixer": "10.4.19",

Diff for: src/builders/application/options.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ export declare function normalizeOptions(context: BuilderContext, projectName: s
9999
sourcemapOptions: import("../..").SourceMapObject;
100100
tsconfig: string;
101101
projectRoot: string;
102-
assets: import("../..").AssetPatternObject[] | undefined;
102+
assets: (import("../..").AssetPatternObject & {
103+
output: string;
104+
})[] | undefined;
103105
outputNames: {
104106
bundles: string;
105107
media: string;

Diff for: src/builders/application/schema.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export interface AssetPatternClass {
221221
/**
222222
* Absolute path within the output.
223223
*/
224-
output: string;
224+
output?: string;
225225
}
226226
export interface Budget {
227227
/**

Diff for: src/builders/application/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,12 @@
560560
},
561561
"output": {
562562
"type": "string",
563+
"default": "",
563564
"description": "Absolute path within the output."
564565
}
565566
},
566567
"additionalProperties": false,
567-
"required": ["glob", "input", "output"]
568+
"required": ["glob", "input"]
568569
},
569570
{
570571
"type": "string"

Diff for: src/builders/browser-esbuild/schema.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export interface AssetPatternClass {
201201
/**
202202
* Absolute path within the output.
203203
*/
204-
output: string;
204+
output?: string;
205205
}
206206
export interface Budget {
207207
/**

Diff for: src/builders/browser-esbuild/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -466,11 +466,12 @@
466466
},
467467
"output": {
468468
"type": "string",
469+
"default": "",
469470
"description": "Absolute path within the output."
470471
}
471472
},
472473
"additionalProperties": false,
473-
"required": ["glob", "input", "output"]
474+
"required": ["glob", "input"]
474475
},
475476
{
476477
"type": "string"

Diff for: src/builders/browser/schema.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export interface AssetPatternClass {
196196
/**
197197
* Absolute path within the output.
198198
*/
199-
output: string;
199+
output?: string;
200200
}
201201
export interface Budget {
202202
/**

Diff for: src/builders/browser/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,12 @@
454454
},
455455
"output": {
456456
"type": "string",
457+
"default": "",
457458
"description": "Absolute path within the output."
458459
}
459460
},
460461
"additionalProperties": false,
461-
"required": ["glob", "input", "output"]
462+
"required": ["glob", "input"]
462463
},
463464
{
464465
"type": "string"

Diff for: src/builders/karma/schema.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export interface AssetPatternClass {
115115
/**
116116
* Absolute path within the output.
117117
*/
118-
output: string;
118+
output?: string;
119119
}
120120
/**
121121
* Override which browsers tests are run against. Set to `false` to not use any browser.

Diff for: src/builders/karma/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@
290290
},
291291
"output": {
292292
"type": "string",
293+
"default": "",
293294
"description": "Absolute path within the output."
294295
},
295296
"ignore": {
@@ -301,7 +302,7 @@
301302
}
302303
},
303304
"additionalProperties": false,
304-
"required": ["glob", "input", "output"]
305+
"required": ["glob", "input"]
305306
},
306307
{
307308
"type": "string"

Diff for: src/builders/server/schema.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export interface AssetPatternClass {
139139
/**
140140
* Absolute path within the output.
141141
*/
142-
output: string;
142+
output?: string;
143143
}
144144
export interface FileReplacement {
145145
replace?: string;

Diff for: src/builders/server/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,12 @@
251251
},
252252
"output": {
253253
"type": "string",
254+
"default": "",
254255
"description": "Absolute path within the output."
255256
}
256257
},
257258
"additionalProperties": false,
258-
"required": ["glob", "input", "output"]
259+
"required": ["glob", "input"]
259260
},
260261
{
261262
"type": "string"

Diff for: src/builders/web-test-runner/schema.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export interface AssetPatternClass {
107107
/**
108108
* Absolute path within the output.
109109
*/
110-
output: string;
110+
output?: string;
111111
}
112112
export interface FileReplacement {
113113
replace?: string;

Diff for: src/builders/web-test-runner/schema.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@
269269
},
270270
"output": {
271271
"type": "string",
272+
"default": "",
272273
"description": "Absolute path within the output."
273274
},
274275
"ignore": {
@@ -280,7 +281,7 @@
280281
}
281282
},
282283
"additionalProperties": false,
283-
"required": ["glob", "input", "output"]
284+
"required": ["glob", "input"]
284285
},
285286
{
286287
"type": "string"

Diff for: src/tools/webpack/utils/helpers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function assetPatterns(root, assets) {
206206
return assets.map((asset, index) => {
207207
// Resolve input paths relative to workspace root and add slash at the end.
208208
// eslint-disable-next-line prefer-const
209-
let { input, output, ignore = [], glob } = asset;
209+
let { input, output = '', ignore = [], glob } = asset;
210210
input = path.resolve(root, input).replace(/\\/g, '/');
211211
input = input.endsWith('/') ? input : input + '/';
212212
output = output.endsWith('/') ? output : output + '/';

Diff for: src/utils/normalize-asset-patterns.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ import { AssetPattern, AssetPatternClass } from '../builders/browser/schema';
99
export declare class MissingAssetSourceRootException extends Error {
1010
constructor(path: string);
1111
}
12-
export declare function normalizeAssetPatterns(assetPatterns: AssetPattern[], workspaceRoot: string, projectRoot: string, projectSourceRoot: string | undefined): AssetPatternClass[];
12+
export declare function normalizeAssetPatterns(assetPatterns: AssetPattern[], workspaceRoot: string, projectRoot: string, projectSourceRoot: string | undefined): (AssetPatternClass & {
13+
output: string;
14+
})[];

Diff for: src/utils/normalize-asset-patterns.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,13 @@ var __importStar = (this && this.__importStar) || function (mod) {
2929
__setModuleDefault(result, mod);
3030
return result;
3131
};
32+
var __importDefault = (this && this.__importDefault) || function (mod) {
33+
return (mod && mod.__esModule) ? mod : { "default": mod };
34+
};
3235
Object.defineProperty(exports, "__esModule", { value: true });
3336
exports.normalizeAssetPatterns = exports.MissingAssetSourceRootException = void 0;
3437
const fs_1 = require("fs");
38+
const node_assert_1 = __importDefault(require("node:assert"));
3539
const path = __importStar(require("path"));
3640
class MissingAssetSourceRootException extends Error {
3741
constructor(path) {
@@ -80,8 +84,9 @@ function normalizeAssetPatterns(assetPatterns, workspaceRoot, projectRoot, proje
8084
assetPattern = { glob, input, output };
8185
}
8286
else {
83-
assetPattern.output = path.join('.', assetPattern.output);
87+
assetPattern.output = path.join('.', assetPattern.output ?? '');
8488
}
89+
(0, node_assert_1.default)(assetPattern.output !== undefined);
8590
if (assetPattern.output.startsWith('..')) {
8691
throw new Error('An asset cannot be written to a location outside of the output path.');
8792
}

Diff for: uniqueId

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Mon Mar 25 2024 14:24:20 GMT+0000 (Coordinated Universal Time)
1+
Mon Mar 25 2024 16:14:42 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)