Skip to content

Commit a99018c

Browse files
alan-agius4angular-robot[bot]
authored andcommitted
refactor(@angular-devkit/build-angular): remove deprecated outputPaths and outputPath Builder output
Remove the deprecated `outputPath` and `outputPaths` from the server and browser builder. BREAKING CHANGE: Deprecated `outputPath` and `outputPaths` from the server and browser builder have been removed from the builder output. Use `outputs` instead. Note: this change does not effect application developers.
1 parent d4c4508 commit a99018c

File tree

9 files changed

+20
-43
lines changed

9 files changed

+20
-43
lines changed

goldens/public-api/angular_devkit/build_angular/index.md

-3
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ export interface BrowserBuilderOptions {
7575
export type BrowserBuilderOutput = BuilderOutput & {
7676
stats: BuildEventStats;
7777
baseOutputPath: string;
78-
outputPaths: string[];
79-
outputPath: string;
8078
outputs: {
8179
locale?: string;
8280
path: string;
@@ -279,7 +277,6 @@ export interface ServerBuilderOptions {
279277
// @public
280278
export type ServerBuilderOutput = BuilderOutput & {
281279
baseOutputPath: string;
282-
outputPaths: string[];
283280
outputPath: string;
284281
outputs: {
285282
locale?: string;

packages/angular_devkit/build_angular/src/builders/browser/index.ts

-12
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,7 @@ import { Schema as BrowserBuilderSchema } from './schema';
6565
*/
6666
export type BrowserBuilderOutput = BuilderOutput & {
6767
stats: BuildEventStats;
68-
6968
baseOutputPath: string;
70-
/**
71-
* @deprecated in version 14. Use 'outputs' instead.
72-
*/
73-
outputPaths: string[];
74-
/**
75-
* @deprecated in version 9. Use 'outputs' instead.
76-
*/
77-
outputPath: string;
78-
7969
outputs: {
8070
locale?: string;
8171
path: string;
@@ -413,8 +403,6 @@ export function buildWebpackBrowser(
413403
...event,
414404
stats: generateBuildEventStats(webpackStats, options),
415405
baseOutputPath,
416-
outputPath: baseOutputPath,
417-
outputPaths: (outputPaths && Array.from(outputPaths.values())) || [baseOutputPath],
418406
outputs: (outputPaths &&
419407
[...outputPaths.entries()].map(([locale, path]) => ({
420408
locale,

packages/angular_devkit/build_angular/src/builders/browser/specs/allow-js_spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('Browser Builder allow js', () => {
3939
expect(output.success).toBe(true);
4040

4141
const content = virtualFs.fileBufferToString(
42-
await lastValueFrom(host.read(join(normalize(output.outputPath), 'main.js'))),
42+
await lastValueFrom(host.read(join(normalize(output.outputs[0].path), 'main.js'))),
4343
);
4444

4545
expect(content).toContain('const a = 2');
@@ -66,7 +66,7 @@ describe('Browser Builder allow js', () => {
6666
expect(output.success).toBe(true);
6767

6868
const content = virtualFs.fileBufferToString(
69-
await lastValueFrom(host.read(join(normalize(output.outputPath), 'main.js'))),
69+
await lastValueFrom(host.read(join(normalize(output.outputs[0].path), 'main.js'))),
7070
);
7171

7272
expect(content).toContain('const a = 2');
@@ -94,7 +94,7 @@ describe('Browser Builder allow js', () => {
9494
await lastValueFrom(
9595
(run.output as Observable<BrowserBuilderOutput>).pipe(
9696
tap((output) => {
97-
const path = relative(host.root(), join(normalize(output.outputPath), 'main.js'));
97+
const path = relative(host.root(), join(normalize(output.outputs[0].path), 'main.js'));
9898
const content = virtualFs.fileBufferToString(host.scopedSync().read(path));
9999

100100
switch (buildCount) {

packages/angular_devkit/build_angular/src/builders/browser/specs/base-href_spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('Browser Builder base href', () => {
3333
const output = (await run.result) as BrowserBuilderOutput;
3434

3535
expect(output.success).toBe(true);
36-
const fileName = join(normalize(output.outputPath), 'index.html');
36+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
3737
const content = virtualFs.fileBufferToString(await lastValueFrom(host.read(fileName)));
3838
expect(content).toMatch(/<base href="\/myUrl">/);
3939

@@ -73,7 +73,7 @@ describe('Browser Builder base href', () => {
7373
const run = await architect.scheduleTarget(targetSpec, overrides);
7474
const output = (await run.result) as BrowserBuilderOutput;
7575
expect(output.success).toBe(true);
76-
const fileName = join(normalize(output.outputPath), 'index.html');
76+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
7777
const content = virtualFs.fileBufferToString(
7878
await lastValueFrom(host.read(normalize(fileName))),
7979
);

packages/angular_devkit/build_angular/src/builders/browser/specs/build-optimizer_spec.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ describe('Browser Builder build optimizer', () => {
4444

4545
expect(output.success).toBe(true);
4646

47-
const noBoStats = await lastValueFrom(host.stat(join(normalize(output.outputPath), 'main.js')));
47+
const noBoStats = await lastValueFrom(
48+
host.stat(join(normalize(output.outputs[0].path), 'main.js')),
49+
);
4850
if (!noBoStats) {
4951
throw new Error('Main file has no stats');
5052
}
@@ -56,7 +58,7 @@ describe('Browser Builder build optimizer', () => {
5658
expect(boOutput.success).toBe(true);
5759

5860
const boStats = await await lastValueFrom(
59-
host.stat(join(normalize(output.outputPath), 'main.js')),
61+
host.stat(join(normalize(output.outputs[0].path), 'main.js')),
6062
);
6163
if (!boStats) {
6264
throw new Error('Main file has no stats');

packages/angular_devkit/build_angular/src/builders/browser/specs/cross-origin_spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe('Browser Builder crossOrigin', () => {
3535
const run = await architect.scheduleTarget(targetSpec, overrides);
3636
const output = (await run.result) as BrowserBuilderOutput;
3737
expect(output.success).toBe(true);
38-
const fileName = join(normalize(output.outputPath), 'index.html');
38+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
3939
const content = virtualFs.fileBufferToString(
4040
await lastValueFrom(host.read(normalize(fileName))),
4141
);
@@ -55,7 +55,7 @@ describe('Browser Builder crossOrigin', () => {
5555
const run = await architect.scheduleTarget(targetSpec, overrides);
5656
const output = (await run.result) as BrowserBuilderOutput;
5757
expect(output.success).toBe(true);
58-
const fileName = join(normalize(output.outputPath), 'index.html');
58+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
5959
const content = virtualFs.fileBufferToString(
6060
await lastValueFrom(host.read(normalize(fileName))),
6161
);
@@ -76,7 +76,7 @@ describe('Browser Builder crossOrigin', () => {
7676
const run = await architect.scheduleTarget(targetSpec, overrides);
7777
const output = (await run.result) as BrowserBuilderOutput;
7878
expect(output.success).toBe(true);
79-
const fileName = join(normalize(output.outputPath), 'index.html');
79+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
8080
const content = virtualFs.fileBufferToString(
8181
await lastValueFrom(host.read(normalize(fileName))),
8282
);
@@ -103,7 +103,7 @@ describe('Browser Builder crossOrigin', () => {
103103
const output = (await run.result) as BrowserBuilderOutput;
104104
expect(output.success).toBe(true);
105105

106-
const fileName = join(normalize(output.outputPath), 'runtime.js');
106+
const fileName = join(normalize(output.outputs[0].path), 'runtime.js');
107107
const content = virtualFs.fileBufferToString(
108108
await lastValueFrom(host.read(normalize(fileName))),
109109
);

packages/angular_devkit/build_angular/src/builders/browser/specs/deploy-url_spec.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ describe('Browser Builder deploy url', () => {
3636
const run = await architect.scheduleTarget(targetSpec, overrides);
3737
const output = (await run.result) as BrowserBuilderOutput;
3838
expect(output.success).toBe(true);
39-
expect(output.outputPath).not.toBeUndefined();
40-
const outputPath = normalize(output.outputPath);
39+
expect(output.outputs[0].path).not.toBeUndefined();
40+
const outputPath = normalize(output.outputs[0].path);
4141

4242
const fileName = join(outputPath, 'index.html');
4343
const runtimeFileName = join(outputPath, 'runtime.js');
@@ -52,7 +52,7 @@ describe('Browser Builder deploy url', () => {
5252

5353
const run2 = await architect.scheduleTarget(targetSpec, overrides2);
5454
const output2 = (await run2.result) as BrowserBuilderOutput;
55-
expect(output2.outputPath).toEqual(outputPath); // These should be the same.
55+
expect(output2.outputs[0].path).toEqual(outputPath); // These should be the same.
5656

5757
const content2 = virtualFs.fileBufferToString(
5858
await lastValueFrom(host.read(normalize(fileName))),

packages/angular_devkit/build_angular/src/builders/browser/specs/index_spec.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('Browser Builder index HTML processing', () => {
3333
const run = await architect.scheduleTarget(targetSpec);
3434
const output = (await run.result) as BrowserBuilderOutput;
3535
expect(output.success).toBe(true);
36-
const fileName = join(normalize(output.outputPath), 'index.html');
36+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
3737
const content = virtualFs.fileBufferToString(
3838
await lastValueFrom(host.read(normalize(fileName))),
3939
);
@@ -58,7 +58,7 @@ describe('Browser Builder index HTML processing', () => {
5858
const run = await architect.scheduleTarget(targetSpec);
5959
const output = (await run.result) as BrowserBuilderOutput;
6060
expect(output.success).toBe(true);
61-
const fileName = join(normalize(output.outputPath), 'index.html');
61+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
6262
const content = virtualFs.fileBufferToString(
6363
await lastValueFrom(host.read(normalize(fileName))),
6464
);
@@ -83,7 +83,7 @@ describe('Browser Builder index HTML processing', () => {
8383
const run = await architect.scheduleTarget(targetSpec);
8484
const output = (await run.result) as BrowserBuilderOutput;
8585
expect(output.success).toBe(true);
86-
const fileName = join(normalize(output.outputPath), 'index.html');
86+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
8787
const content = virtualFs.fileBufferToString(
8888
await lastValueFrom(host.read(normalize(fileName))),
8989
);
@@ -107,7 +107,7 @@ describe('Browser Builder index HTML processing', () => {
107107
const run = await architect.scheduleTarget(targetSpec);
108108
const output = (await run.result) as BrowserBuilderOutput;
109109
expect(output.success).toBe(true);
110-
const fileName = join(normalize(output.outputPath), 'index.html');
110+
const fileName = join(normalize(output.outputs[0].path), 'index.html');
111111
const content = virtualFs.fileBufferToString(
112112
await lastValueFrom(host.read(normalize(fileName))),
113113
);

packages/angular_devkit/build_angular/src/builders/server/index.ts

-10
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,7 @@ import { Schema as ServerBuilderOptions } from './schema';
4646
*/
4747
export type ServerBuilderOutput = BuilderOutput & {
4848
baseOutputPath: string;
49-
/**
50-
* @deprecated in version 14. Use 'outputs' instead.
51-
*/
52-
outputPaths: string[];
53-
/**
54-
* @deprecated in version 9. Use 'outputs' instead.
55-
*/
5649
outputPath: string;
57-
5850
outputs: {
5951
locale?: string;
6052
path: string;
@@ -172,8 +164,6 @@ export function execute(
172164
return {
173165
...output,
174166
baseOutputPath,
175-
outputPath: baseOutputPath,
176-
outputPaths: outputPaths || [baseOutputPath],
177167
outputs: (outputPaths &&
178168
[...outputPaths.entries()].map(([locale, path]) => ({
179169
locale,

0 commit comments

Comments
 (0)