@angular-devkit/build-angular 18.2.0-rc.0 → 18.2.1
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 +14 -14
- package/src/builders/browser-esbuild/index.d.ts +8 -6
- package/src/builders/browser-esbuild/index.js +19 -48
- package/src/builders/dev-server/builder.js +4 -2
- package/src/builders/extract-i18n/application-extraction.js +15 -13
- package/src/utils/normalize-cache.js +1 -1
- package/src/babel-bazel.d.ts +0 -17
- package/src/builders/browser-esbuild/builder-status-warnings.d.ts +0 -10
- package/src/builders/browser-esbuild/builder-status-warnings.js +0 -39
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "18.2.
|
|
3
|
+
"version": "18.2.1",
|
|
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.
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1802.
|
|
12
|
-
"@angular-devkit/core": "18.2.
|
|
13
|
-
"@angular/build": "18.2.
|
|
10
|
+
"@angular-devkit/architect": "0.1802.1",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1802.1",
|
|
12
|
+
"@angular-devkit/core": "18.2.1",
|
|
13
|
+
"@angular/build": "18.2.1",
|
|
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.
|
|
24
|
+
"@ngtools/webpack": "18.2.1",
|
|
25
25
|
"@vitejs/plugin-basic-ssl": "1.1.0",
|
|
26
26
|
"ansi-colors": "4.1.3",
|
|
27
27
|
"autoprefixer": "10.4.20",
|
|
@@ -53,15 +53,15 @@
|
|
|
53
53
|
"postcss-loader": "8.1.1",
|
|
54
54
|
"resolve-url-loader": "5.0.0",
|
|
55
55
|
"rxjs": "7.8.1",
|
|
56
|
-
"sass": "1.77.
|
|
56
|
+
"sass": "1.77.6",
|
|
57
57
|
"sass-loader": "16.0.0",
|
|
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,17 +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
|
-
const builder_status_warnings_1 = require("./builder-status-warnings");
|
|
20
14
|
/**
|
|
21
15
|
* Main execution function for the esbuild-based application builder.
|
|
22
16
|
* The options are compatible with the Webpack-based builder.
|
|
@@ -25,43 +19,23 @@ const builder_status_warnings_1 = require("./builder-status-warnings");
|
|
|
25
19
|
* @returns An async iterable with the builder result output
|
|
26
20
|
*/
|
|
27
21
|
async function* buildEsbuildBrowser(userOptions, context, infrastructureSettings, plugins) {
|
|
28
|
-
//
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const { deleteOutputPath, outputPath } = normalizedOptions;
|
|
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);
|
|
22
|
+
// Warn about any unsupported options
|
|
23
|
+
if (userOptions['vendorChunk']) {
|
|
24
|
+
context.logger.warn(`The 'vendorChunk' option is not used by this builder and will be ignored.`);
|
|
35
25
|
}
|
|
36
|
-
|
|
37
|
-
|
|
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;
|
|
26
|
+
if (userOptions['commonChunk'] === false) {
|
|
27
|
+
context.logger.warn(`The 'commonChunk' option is always enabled by this builder and will be ignored.`);
|
|
61
28
|
}
|
|
29
|
+
if (userOptions['webWorkerTsConfig']) {
|
|
30
|
+
context.logger.warn(`The 'webWorkerTsConfig' option is not yet supported by this builder.`);
|
|
31
|
+
}
|
|
32
|
+
// Convert browser builder options to application builder options
|
|
33
|
+
const normalizedOptions = convertBrowserOptions(userOptions);
|
|
34
|
+
// Execute the application builder
|
|
35
|
+
yield* (0, build_1.buildApplication)(normalizedOptions, context, { codePlugins: plugins });
|
|
62
36
|
}
|
|
63
|
-
function
|
|
64
|
-
const { main: browser, outputPath, ngswConfigPath, serviceWorker, polyfills, ...otherOptions } = options;
|
|
37
|
+
function convertBrowserOptions(options) {
|
|
38
|
+
const { main: browser, outputPath, ngswConfigPath, serviceWorker, polyfills, resourcesOutputPath, ...otherOptions } = options;
|
|
65
39
|
return {
|
|
66
40
|
browser,
|
|
67
41
|
serviceWorker: serviceWorker ? ngswConfigPath : false,
|
|
@@ -69,13 +43,10 @@ function normalizeOptions(options) {
|
|
|
69
43
|
outputPath: {
|
|
70
44
|
base: outputPath,
|
|
71
45
|
browser: '',
|
|
46
|
+
server: '',
|
|
47
|
+
media: resourcesOutputPath ?? 'media',
|
|
72
48
|
},
|
|
73
49
|
...otherOptions,
|
|
74
50
|
};
|
|
75
51
|
}
|
|
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);
|
|
52
|
+
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
|
}
|
|
@@ -12,30 +12,29 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.extractMessages = extractMessages;
|
|
14
14
|
const private_1 = require("@angular/build/private");
|
|
15
|
+
const node_fs_1 = require("node:fs");
|
|
15
16
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
17
|
const browser_esbuild_1 = require("../browser-esbuild");
|
|
17
18
|
async function extractMessages(options, builderName, context, extractorConstructor) {
|
|
18
19
|
const messages = [];
|
|
19
20
|
// Setup the build options for the application based on the buildTarget option
|
|
20
|
-
|
|
21
|
+
let buildOptions;
|
|
22
|
+
if (builderName === '@angular-devkit/build-angular:application') {
|
|
23
|
+
buildOptions = (await context.validateOptions(await context.getTargetOptions(options.buildTarget), builderName));
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
buildOptions = (0, browser_esbuild_1.convertBrowserOptions)((await context.validateOptions(await context.getTargetOptions(options.buildTarget), builderName)));
|
|
27
|
+
}
|
|
21
28
|
buildOptions.optimization = false;
|
|
22
29
|
buildOptions.sourceMap = { scripts: true, vendor: true, styles: false };
|
|
23
30
|
buildOptions.localize = false;
|
|
24
31
|
buildOptions.budgets = undefined;
|
|
25
32
|
buildOptions.index = false;
|
|
26
33
|
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 }));
|
|
34
|
+
buildOptions.ssr = false;
|
|
35
|
+
buildOptions.appShell = false;
|
|
36
|
+
buildOptions.prerender = false;
|
|
37
|
+
const builderResult = await first((0, private_1.buildApplicationInternal)(buildOptions, context));
|
|
39
38
|
let success = false;
|
|
40
39
|
if (!builderResult || builderResult.kind === private_1.ResultKind.Failure) {
|
|
41
40
|
context.logger.error('Application build failed.');
|
|
@@ -79,6 +78,9 @@ function setupLocalizeExtractor(extractorConstructor, files, context) {
|
|
|
79
78
|
if (file?.origin === 'memory') {
|
|
80
79
|
content = textDecoder.decode(file.contents);
|
|
81
80
|
}
|
|
81
|
+
else if (file?.origin === 'disk') {
|
|
82
|
+
content = (0, node_fs_1.readFileSync)(file.inputPath, 'utf-8');
|
|
83
|
+
}
|
|
82
84
|
if (content === undefined) {
|
|
83
85
|
throw new Error('Unknown file requested: ' + requestedPath);
|
|
84
86
|
}
|
|
@@ -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.
|
|
13
|
+
const VERSION = '18.2.1';
|
|
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
|
-
}
|
|
@@ -1,10 +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
|
-
import { BuilderContext } from '@angular-devkit/architect';
|
|
9
|
-
import { Schema as BrowserBuilderOptions } from './schema';
|
|
10
|
-
export declare function logBuilderStatusWarnings(options: BrowserBuilderOptions, { logger }: BuilderContext): void;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.logBuilderStatusWarnings = logBuilderStatusWarnings;
|
|
11
|
-
const UNSUPPORTED_OPTIONS = [
|
|
12
|
-
// * Always enabled with esbuild
|
|
13
|
-
// 'commonChunk',
|
|
14
|
-
// * Unused by builder and will be removed in a future release
|
|
15
|
-
'vendorChunk',
|
|
16
|
-
'resourcesOutputPath',
|
|
17
|
-
// * Currently unsupported by esbuild
|
|
18
|
-
'webWorkerTsConfig',
|
|
19
|
-
];
|
|
20
|
-
function logBuilderStatusWarnings(options, { logger }) {
|
|
21
|
-
// Validate supported options
|
|
22
|
-
for (const unsupportedOption of UNSUPPORTED_OPTIONS) {
|
|
23
|
-
const value = options[unsupportedOption];
|
|
24
|
-
if (value === undefined || value === false) {
|
|
25
|
-
continue;
|
|
26
|
-
}
|
|
27
|
-
if (Array.isArray(value) && value.length === 0) {
|
|
28
|
-
continue;
|
|
29
|
-
}
|
|
30
|
-
if (typeof value === 'object' && Object.keys(value).length === 0) {
|
|
31
|
-
continue;
|
|
32
|
-
}
|
|
33
|
-
if (unsupportedOption === 'vendorChunk' || unsupportedOption === 'resourcesOutputPath') {
|
|
34
|
-
logger.warn(`The '${unsupportedOption}' option is not used by this builder and will be ignored.`);
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
logger.warn(`The '${unsupportedOption}' option is not yet supported by this builder.`);
|
|
38
|
-
}
|
|
39
|
-
}
|