@angular-devkit/build-angular 18.2.0-rc.0 → 18.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -13
- package/src/builders/browser-esbuild/index.d.ts +8 -6
- package/src/builders/browser-esbuild/index.js +9 -47
- package/src/builders/dev-server/builder.js +4 -2
- package/src/builders/extract-i18n/application-extraction.js +11 -13
- package/src/utils/normalize-cache.js +1 -1
- package/src/babel-bazel.d.ts +0 -17
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "18.2.0
|
|
3
|
+
"version": "18.2.0",
|
|
4
4
|
"description": "Angular Webpack Build Facade",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
7
7
|
"builders": "builders.json",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@ampproject/remapping": "2.3.0",
|
|
10
|
-
"@angular-devkit/architect": "0.1802.0
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1802.0
|
|
12
|
-
"@angular-devkit/core": "18.2.0
|
|
13
|
-
"@angular/build": "18.2.0
|
|
10
|
+
"@angular-devkit/architect": "0.1802.0",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1802.0",
|
|
12
|
+
"@angular-devkit/core": "18.2.0",
|
|
13
|
+
"@angular/build": "18.2.0",
|
|
14
14
|
"@babel/core": "7.25.2",
|
|
15
15
|
"@babel/generator": "7.25.0",
|
|
16
16
|
"@babel/helper-annotate-as-pure": "7.24.7",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@babel/preset-env": "7.25.3",
|
|
22
22
|
"@babel/runtime": "7.25.0",
|
|
23
23
|
"@discoveryjs/json-ext": "0.6.1",
|
|
24
|
-
"@ngtools/webpack": "18.2.0
|
|
24
|
+
"@ngtools/webpack": "18.2.0",
|
|
25
25
|
"@vitejs/plugin-basic-ssl": "1.1.0",
|
|
26
26
|
"ansi-colors": "4.1.3",
|
|
27
27
|
"autoprefixer": "10.4.20",
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"semver": "7.6.3",
|
|
59
59
|
"source-map-loader": "5.0.0",
|
|
60
60
|
"source-map-support": "0.5.21",
|
|
61
|
-
"terser": "5.31.
|
|
61
|
+
"terser": "5.31.6",
|
|
62
62
|
"tree-kill": "1.2.2",
|
|
63
63
|
"tslib": "2.6.3",
|
|
64
|
-
"vite": "5.
|
|
64
|
+
"vite": "5.4.0",
|
|
65
65
|
"watchpack": "2.4.1",
|
|
66
66
|
"webpack": "5.93.0",
|
|
67
67
|
"webpack-dev-middleware": "7.3.0",
|
|
@@ -73,16 +73,16 @@
|
|
|
73
73
|
"esbuild": "0.23.0"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@angular/compiler-cli": "^18.0.0
|
|
77
|
-
"@angular/localize": "^18.0.0
|
|
78
|
-
"@angular/platform-server": "^18.0.0
|
|
79
|
-
"@angular/service-worker": "^18.0.0
|
|
76
|
+
"@angular/compiler-cli": "^18.0.0",
|
|
77
|
+
"@angular/localize": "^18.0.0",
|
|
78
|
+
"@angular/platform-server": "^18.0.0",
|
|
79
|
+
"@angular/service-worker": "^18.0.0",
|
|
80
80
|
"@web/test-runner": "^0.18.0",
|
|
81
81
|
"browser-sync": "^3.0.2",
|
|
82
82
|
"jest": "^29.5.0",
|
|
83
83
|
"jest-environment-jsdom": "^29.5.0",
|
|
84
84
|
"karma": "^6.3.0",
|
|
85
|
-
"ng-packagr": "^18.0.0
|
|
85
|
+
"ng-packagr": "^18.0.0",
|
|
86
86
|
"protractor": "^7.0.0",
|
|
87
87
|
"tailwindcss": "^2.0.0 || ^3.0.0",
|
|
88
88
|
"typescript": ">=5.4 <5.6"
|
|
@@ -5,10 +5,12 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { BuilderContext } from '@angular-devkit/architect';
|
|
8
|
+
import { type ApplicationBuilderOptions } from '@angular/build';
|
|
9
|
+
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
10
10
|
import type { Plugin } from 'esbuild';
|
|
11
11
|
import type { Schema as BrowserBuilderOptions } from './schema';
|
|
12
|
+
export type { BrowserBuilderOptions };
|
|
13
|
+
type OutputPathClass = Exclude<ApplicationBuilderOptions['outputPath'], string | undefined>;
|
|
12
14
|
/**
|
|
13
15
|
* Main execution function for the esbuild-based application builder.
|
|
14
16
|
* The options are compatible with the Webpack-based builder.
|
|
@@ -18,9 +20,9 @@ import type { Schema as BrowserBuilderOptions } from './schema';
|
|
|
18
20
|
*/
|
|
19
21
|
export declare function buildEsbuildBrowser(userOptions: BrowserBuilderOptions, context: BuilderContext, infrastructureSettings?: {
|
|
20
22
|
write?: boolean;
|
|
21
|
-
}, plugins?: Plugin[]): AsyncIterable<
|
|
22
|
-
export declare function
|
|
23
|
-
|
|
24
|
-
}
|
|
23
|
+
}, plugins?: Plugin[]): AsyncIterable<BuilderOutput>;
|
|
24
|
+
export declare function convertBrowserOptions(options: BrowserBuilderOptions): Omit<ApplicationBuilderOptions, 'outputPath'> & {
|
|
25
|
+
outputPath: OutputPathClass;
|
|
26
|
+
};
|
|
25
27
|
declare const _default: import("../../../../architect/src/internal").Builder<BrowserBuilderOptions & import("../../../../core/src").JsonObject>;
|
|
26
28
|
export default _default;
|
|
@@ -6,16 +6,11 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
10
|
exports.buildEsbuildBrowser = buildEsbuildBrowser;
|
|
14
|
-
exports.
|
|
15
|
-
const
|
|
11
|
+
exports.convertBrowserOptions = convertBrowserOptions;
|
|
12
|
+
const build_1 = require("@angular/build");
|
|
16
13
|
const architect_1 = require("@angular-devkit/architect");
|
|
17
|
-
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
18
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
19
14
|
const builder_status_warnings_1 = require("./builder-status-warnings");
|
|
20
15
|
/**
|
|
21
16
|
* Main execution function for the esbuild-based application builder.
|
|
@@ -27,41 +22,11 @@ const builder_status_warnings_1 = require("./builder-status-warnings");
|
|
|
27
22
|
async function* buildEsbuildBrowser(userOptions, context, infrastructureSettings, plugins) {
|
|
28
23
|
// Inform user of status of builder and options
|
|
29
24
|
(0, builder_status_warnings_1.logBuilderStatusWarnings)(userOptions, context);
|
|
30
|
-
const normalizedOptions =
|
|
31
|
-
|
|
32
|
-
const fullOutputPath = node_path_1.default.join(context.workspaceRoot, outputPath.base);
|
|
33
|
-
if (deleteOutputPath && infrastructureSettings?.write !== false) {
|
|
34
|
-
await (0, private_1.deleteOutputDir)(context.workspaceRoot, outputPath.base);
|
|
35
|
-
}
|
|
36
|
-
for await (const result of (0, private_1.buildApplicationInternal)(normalizedOptions, context, plugins && { codePlugins: plugins })) {
|
|
37
|
-
// Write the file directly from this builder to maintain webpack output compatibility
|
|
38
|
-
// and not output browser files into '/browser'.
|
|
39
|
-
if (infrastructureSettings?.write !== false &&
|
|
40
|
-
(result.kind === private_1.ResultKind.Full || result.kind === private_1.ResultKind.Incremental)) {
|
|
41
|
-
const directoryExists = new Set();
|
|
42
|
-
// Writes the output file to disk and ensures the containing directories are present
|
|
43
|
-
await (0, private_1.emitFilesToDisk)(Object.entries(result.files), async ([filePath, file]) => {
|
|
44
|
-
// Ensure output subdirectories exist
|
|
45
|
-
const basePath = node_path_1.default.dirname(filePath);
|
|
46
|
-
if (basePath && !directoryExists.has(basePath)) {
|
|
47
|
-
await promises_1.default.mkdir(node_path_1.default.join(fullOutputPath, basePath), { recursive: true });
|
|
48
|
-
directoryExists.add(basePath);
|
|
49
|
-
}
|
|
50
|
-
if (file.origin === 'memory') {
|
|
51
|
-
// Write file contents
|
|
52
|
-
await promises_1.default.writeFile(node_path_1.default.join(fullOutputPath, filePath), file.contents);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
// Copy file contents
|
|
56
|
-
await promises_1.default.copyFile(file.inputPath, node_path_1.default.join(fullOutputPath, filePath), promises_1.default.constants.COPYFILE_FICLONE);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
yield result;
|
|
61
|
-
}
|
|
25
|
+
const normalizedOptions = convertBrowserOptions(userOptions);
|
|
26
|
+
yield* (0, build_1.buildApplication)(normalizedOptions, context, { codePlugins: plugins });
|
|
62
27
|
}
|
|
63
|
-
function
|
|
64
|
-
const { main: browser, outputPath, ngswConfigPath, serviceWorker, polyfills, ...otherOptions } = options;
|
|
28
|
+
function convertBrowserOptions(options) {
|
|
29
|
+
const { main: browser, outputPath, ngswConfigPath, serviceWorker, polyfills, resourcesOutputPath, ...otherOptions } = options;
|
|
65
30
|
return {
|
|
66
31
|
browser,
|
|
67
32
|
serviceWorker: serviceWorker ? ngswConfigPath : false,
|
|
@@ -69,13 +34,10 @@ function normalizeOptions(options) {
|
|
|
69
34
|
outputPath: {
|
|
70
35
|
base: outputPath,
|
|
71
36
|
browser: '',
|
|
37
|
+
server: '',
|
|
38
|
+
media: resourcesOutputPath ?? 'media',
|
|
72
39
|
},
|
|
73
40
|
...otherOptions,
|
|
74
41
|
};
|
|
75
42
|
}
|
|
76
|
-
|
|
77
|
-
for await (const result of buildEsbuildBrowser(options, context)) {
|
|
78
|
-
yield { success: result.kind !== private_1.ResultKind.Failure };
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
exports.default = (0, architect_1.createBuilder)(buildEsbuildBrowserArchitect);
|
|
43
|
+
exports.default = (0, architect_1.createBuilder)(buildEsbuildBrowser);
|
|
@@ -72,10 +72,12 @@ function execute(options, context, transforms = {}, extensions) {
|
|
|
72
72
|
if (options.disableHostCheck) {
|
|
73
73
|
context.logger.warn(`The "disableHostCheck" option will not be used because it is not supported by the "${builderName}" builder.`);
|
|
74
74
|
}
|
|
75
|
-
return (0, rxjs_1.defer)(() => Promise.all([Promise.resolve().then(() => __importStar(require('@angular/build/private'))), Promise.resolve().then(() => __importStar(require('../browser-esbuild')))])).pipe((0, rxjs_1.switchMap)(([{ serveWithVite, buildApplicationInternal }, {
|
|
75
|
+
return (0, rxjs_1.defer)(() => Promise.all([Promise.resolve().then(() => __importStar(require('@angular/build/private'))), Promise.resolve().then(() => __importStar(require('../browser-esbuild')))])).pipe((0, rxjs_1.switchMap)(([{ serveWithVite, buildApplicationInternal }, { convertBrowserOptions }]) => serveWithVite(normalizedOptions, builderName, (options, context, codePlugins) => {
|
|
76
76
|
return builderName === '@angular-devkit/build-angular:browser-esbuild'
|
|
77
77
|
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
-
|
|
78
|
+
buildApplicationInternal(convertBrowserOptions(options), context, {
|
|
79
|
+
codePlugins,
|
|
80
|
+
})
|
|
79
81
|
: buildApplicationInternal(options, context, { codePlugins });
|
|
80
82
|
}, context, transforms, extensions)));
|
|
81
83
|
}
|
|
@@ -17,25 +17,23 @@ const browser_esbuild_1 = require("../browser-esbuild");
|
|
|
17
17
|
async function extractMessages(options, builderName, context, extractorConstructor) {
|
|
18
18
|
const messages = [];
|
|
19
19
|
// Setup the build options for the application based on the buildTarget option
|
|
20
|
-
|
|
20
|
+
let buildOptions;
|
|
21
|
+
if (builderName === '@angular-devkit/build-angular:application') {
|
|
22
|
+
buildOptions = (await context.validateOptions(await context.getTargetOptions(options.buildTarget), builderName));
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
buildOptions = (0, browser_esbuild_1.convertBrowserOptions)((await context.validateOptions(await context.getTargetOptions(options.buildTarget), builderName)));
|
|
26
|
+
}
|
|
21
27
|
buildOptions.optimization = false;
|
|
22
28
|
buildOptions.sourceMap = { scripts: true, vendor: true, styles: false };
|
|
23
29
|
buildOptions.localize = false;
|
|
24
30
|
buildOptions.budgets = undefined;
|
|
25
31
|
buildOptions.index = false;
|
|
26
32
|
buildOptions.serviceWorker = false;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
buildOptions.appShell = false;
|
|
32
|
-
buildOptions.prerender = false;
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
build = browser_esbuild_1.buildEsbuildBrowser;
|
|
36
|
-
}
|
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
-
const builderResult = await first(build(buildOptions, context, { write: false }));
|
|
33
|
+
buildOptions.ssr = false;
|
|
34
|
+
buildOptions.appShell = false;
|
|
35
|
+
buildOptions.prerender = false;
|
|
36
|
+
const builderResult = await first((0, private_1.buildApplicationInternal)(buildOptions, context));
|
|
39
37
|
let success = false;
|
|
40
38
|
if (!builderResult || builderResult.kind === private_1.ResultKind.Failure) {
|
|
41
39
|
context.logger.error('Application build failed.');
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.normalizeCacheOptions = normalizeCacheOptions;
|
|
11
11
|
const node_path_1 = require("node:path");
|
|
12
12
|
/** Version placeholder is replaced during the build process with actual package version */
|
|
13
|
-
const VERSION = '18.2.0
|
|
13
|
+
const VERSION = '18.2.0';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|
package/src/babel-bazel.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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.dev/license
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/* eslint-disable import/no-extraneous-dependencies */
|
|
10
|
-
// Workaround for https://github.com/bazelbuild/rules_nodejs/issues/1033
|
|
11
|
-
// Alternative approach instead of https://github.com/angular/angular/pull/33226
|
|
12
|
-
declare module '@babel/core' {
|
|
13
|
-
export * from '@types/babel__core';
|
|
14
|
-
}
|
|
15
|
-
declare module '@babel/generator' {
|
|
16
|
-
export { default } from '@types/babel__generator';
|
|
17
|
-
}
|