Skip to content

Commit e58b442

Browse files
author
Angular Builds
committed
ef23b39dd ci: add initial E2E test subset for experimental esbuild builder
1 parent 425f643 commit e58b442

19 files changed

+1118
-9
lines changed

builders.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
"schema": "./src/builders/browser/schema.json",
1212
"description": "Build a browser application."
1313
},
14+
"browser-esbuild": {
15+
"implementation": "./src/builders/browser-esbuild",
16+
"schema": "./src/builders/browser/schema.json",
17+
"description": "Build a browser application."
18+
},
1419
"dev-server": {
1520
"implementation": "./src/builders/dev-server",
1621
"schema": "./src/builders/dev-server/schema.json",

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "14.0.0-next.11+sha-ba92525",
3+
"version": "14.0.0-next.11+sha-ef23b39",
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.1.2",
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ba92525e0",
11-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#ba92525e0",
12-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#ba92525e0",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#ef23b39dd",
11+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#ef23b39dd",
12+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#ef23b39dd",
1313
"@babel/core": "7.17.9",
1414
"@babel/generator": "7.17.9",
1515
"@babel/helper-annotate-as-pure": "7.16.7",
@@ -20,7 +20,7 @@
2020
"@babel/runtime": "7.17.9",
2121
"@babel/template": "7.16.7",
2222
"@discoveryjs/json-ext": "0.5.7",
23-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#ba92525e0",
23+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#ef23b39dd",
2424
"ansi-colors": "4.1.1",
2525
"babel-loader": "8.2.4",
2626
"babel-plugin-istanbul": "6.1.1",

src/babel/webpack-loader.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ interface AngularCustomOptions extends Omit<ApplicationPresetOptions, 'instrumen
1414
};
1515
}
1616
export declare type AngularBabelLoaderOptions = AngularCustomOptions & Record<string, unknown>;
17+
export declare function requiresLinking(path: string, source: string): Promise<boolean>;
1718
declare const _default: any;
1819
export default _default;

src/babel/webpack-loader.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
import type { Plugin } from 'esbuild';
9+
import { BundleStylesheetOptions } from './stylesheets';
10+
export declare function createCompilerPlugin(pluginOptions: {
11+
sourcemap: boolean;
12+
tsconfig: string;
13+
advancedOptimizations?: boolean;
14+
}, styleOptions: BundleStylesheetOptions): Plugin;

src/builders/browser-esbuild/compiler-plugin.js

Lines changed: 339 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
import { BuilderContext } from '@angular-devkit/architect';
9+
import { BuildFailure, BuildOptions, BuildResult, Message, OutputFile } from 'esbuild';
10+
/**
11+
* Determines if an unknown value is an esbuild BuildFailure error object thrown by esbuild.
12+
* @param value A potential esbuild BuildFailure error object.
13+
* @returns `true` if the object is determined to be a BuildFailure object; otherwise, `false`.
14+
*/
15+
export declare function isEsBuildFailure(value: unknown): value is BuildFailure;
16+
/**
17+
* Executes the esbuild build function and normalizes the build result in the event of a
18+
* build failure that results in no output being generated.
19+
* All builds use the `write` option with a value of `false` to allow for the output files
20+
* build result array to be populated.
21+
*
22+
* @param options The esbuild options object to use when building.
23+
* @returns If output files are generated, the full esbuild BuildResult; if not, the
24+
* warnings and errors for the attempted build.
25+
*/
26+
export declare function bundle(options: BuildOptions): Promise<(BuildResult & {
27+
outputFiles: OutputFile[];
28+
}) | (BuildFailure & {
29+
outputFiles?: never;
30+
})>;
31+
export declare function logMessages(context: BuilderContext, { errors, warnings }: {
32+
errors: Message[];
33+
warnings: Message[];
34+
}): Promise<void>;

src/builders/browser-esbuild/esbuild.js

Lines changed: 60 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
import { BuilderContext } from '@angular-devkit/architect';
9+
import { Schema as BrowserBuilderOptions } from '../browser/schema';
10+
export declare function logExperimentalWarnings(options: BrowserBuilderOptions, context: BuilderContext): void;

src/builders/browser-esbuild/experimental-warnings.js

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

0 commit comments

Comments
 (0)