@angular-devkit/build-angular 18.1.0-next.2 → 18.1.0-rc.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 +15 -15
- package/src/builders/dev-server/index.d.ts +1 -1
- package/src/builders/dev-server/webpack-server.js +1 -0
- package/src/builders/karma/index.d.ts +1 -1
- package/src/builders/ng-packagr/index.d.ts +1 -1
- package/src/builders/protractor/index.d.ts +1 -1
- package/src/builders/server/index.d.ts +1 -1
- package/src/index.d.ts +11 -10
- package/src/tools/babel/plugins/add-code-coverage.d.ts +14 -0
- package/src/tools/babel/plugins/add-code-coverage.js +44 -0
- package/src/tools/babel/plugins/types.d.ts +20 -0
- package/src/tools/babel/presets/application.js +1 -7
- package/src/tools/webpack/plugins/index.d.ts +3 -3
- package/src/tools/webpack/plugins/javascript-optimizer-worker.d.ts +2 -1
- package/src/utils/environment-options.js +4 -1
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/process-bundle.js +1 -1
- package/src/utils/run-module-as-observable-fork.js +5 -2
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "18.1.0-
|
|
3
|
+
"version": "18.1.0-rc.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.1801.0-
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1801.0-
|
|
12
|
-
"@angular-devkit/core": "18.1.0-
|
|
13
|
-
"@angular/build": "18.1.0-
|
|
10
|
+
"@angular-devkit/architect": "0.1801.0-rc.0",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1801.0-rc.0",
|
|
12
|
+
"@angular-devkit/core": "18.1.0-rc.0",
|
|
13
|
+
"@angular/build": "18.1.0-rc.0",
|
|
14
14
|
"@babel/core": "7.24.7",
|
|
15
15
|
"@babel/generator": "7.24.7",
|
|
16
16
|
"@babel/helper-annotate-as-pure": "7.24.7",
|
|
@@ -21,21 +21,21 @@
|
|
|
21
21
|
"@babel/preset-env": "7.24.7",
|
|
22
22
|
"@babel/runtime": "7.24.7",
|
|
23
23
|
"@discoveryjs/json-ext": "0.5.7",
|
|
24
|
-
"@ngtools/webpack": "18.1.0-
|
|
24
|
+
"@ngtools/webpack": "18.1.0-rc.0",
|
|
25
25
|
"@vitejs/plugin-basic-ssl": "1.1.0",
|
|
26
26
|
"ansi-colors": "4.1.3",
|
|
27
27
|
"autoprefixer": "10.4.19",
|
|
28
28
|
"babel-loader": "9.1.3",
|
|
29
|
-
"babel-plugin-istanbul": "6.1.1",
|
|
30
29
|
"browserslist": "^4.21.5",
|
|
31
30
|
"copy-webpack-plugin": "12.0.2",
|
|
32
|
-
"critters": "0.0.
|
|
31
|
+
"critters": "0.0.24",
|
|
33
32
|
"css-loader": "7.1.2",
|
|
34
33
|
"esbuild-wasm": "0.21.5",
|
|
35
34
|
"fast-glob": "3.3.2",
|
|
36
35
|
"http-proxy-middleware": "3.0.0",
|
|
37
36
|
"https-proxy-agent": "7.0.4",
|
|
38
|
-
"
|
|
37
|
+
"istanbul-lib-instrument": "6.0.2",
|
|
38
|
+
"jsonc-parser": "3.3.1",
|
|
39
39
|
"karma-source-map-support": "1.4.0",
|
|
40
40
|
"less": "4.2.0",
|
|
41
41
|
"less-loader": "12.2.0",
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"ora": "5.4.1",
|
|
49
49
|
"parse5-html-rewriting-stream": "7.0.0",
|
|
50
50
|
"picomatch": "4.0.2",
|
|
51
|
-
"piscina": "4.
|
|
51
|
+
"piscina": "4.6.1",
|
|
52
52
|
"postcss": "8.4.38",
|
|
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": "14.2.1",
|
|
58
58
|
"semver": "7.6.2",
|
|
59
59
|
"source-map-loader": "5.0.0",
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"terser": "5.31.1",
|
|
62
62
|
"tree-kill": "1.2.2",
|
|
63
63
|
"tslib": "2.6.3",
|
|
64
|
-
"undici": "6.
|
|
65
|
-
"vite": "5.
|
|
64
|
+
"undici": "6.19.2",
|
|
65
|
+
"vite": "5.3.1",
|
|
66
66
|
"watchpack": "2.4.1",
|
|
67
|
-
"webpack": "5.92.
|
|
67
|
+
"webpack": "5.92.1",
|
|
68
68
|
"webpack-dev-middleware": "7.2.1",
|
|
69
69
|
"webpack-dev-server": "5.0.4",
|
|
70
70
|
"webpack-merge": "5.10.0",
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"devkit",
|
|
131
131
|
"sdk"
|
|
132
132
|
],
|
|
133
|
-
"packageManager": "yarn@4.
|
|
133
|
+
"packageManager": "yarn@4.3.0",
|
|
134
134
|
"repository": {
|
|
135
135
|
"type": "git",
|
|
136
136
|
"url": "https://github.com/angular/angular-cli.git"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { DevServerBuilderOutput } from '@angular/build';
|
|
9
9
|
import { execute } from './builder';
|
|
10
10
|
import { Schema as DevServerBuilderOptions } from './schema';
|
|
11
|
-
export { DevServerBuilderOptions, DevServerBuilderOutput, execute as executeDevServerBuilder };
|
|
11
|
+
export { type DevServerBuilderOptions, type DevServerBuilderOutput, execute as executeDevServerBuilder, };
|
|
12
12
|
declare const _default: import("../../../../architect/src/internal").Builder<DevServerBuilderOptions & import("../../../../core/src").JsonObject>;
|
|
13
13
|
export default _default;
|
|
14
14
|
export { execute as executeDevServer };
|
|
@@ -75,6 +75,7 @@ function serveWebpackBrowser(options, builderName, context, transforms = {}) {
|
|
|
75
75
|
rawBrowserOptions.outputHashing = schema_1.OutputHashing.None;
|
|
76
76
|
logger.warn(`Warning: 'outputHashing' option is disabled when using the dev-server.`);
|
|
77
77
|
}
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
78
79
|
const browserOptions = (await context.validateOptions({
|
|
79
80
|
...rawBrowserOptions,
|
|
80
81
|
watch: options.watch,
|
|
@@ -22,6 +22,6 @@ export declare function execute(options: KarmaBuilderOptions, context: BuilderCo
|
|
|
22
22
|
webpackConfiguration?: ExecutionTransformer<Configuration>;
|
|
23
23
|
karmaOptions?: (options: KarmaConfigOptions) => KarmaConfigOptions;
|
|
24
24
|
}): Observable<BuilderOutput>;
|
|
25
|
-
export { KarmaBuilderOptions };
|
|
25
|
+
export type { KarmaBuilderOptions };
|
|
26
26
|
declare const _default: import("../../../../architect/src/internal").Builder<Record<string, string> & KarmaBuilderOptions & import("@angular-devkit/core").JsonObject>;
|
|
27
27
|
export default _default;
|
|
@@ -12,6 +12,6 @@ import { Schema as NgPackagrBuilderOptions } from './schema';
|
|
|
12
12
|
* @experimental Direct usage of this function is considered experimental.
|
|
13
13
|
*/
|
|
14
14
|
export declare function execute(options: NgPackagrBuilderOptions, context: BuilderContext): Observable<BuilderOutput>;
|
|
15
|
-
export { NgPackagrBuilderOptions };
|
|
15
|
+
export type { NgPackagrBuilderOptions };
|
|
16
16
|
declare const _default: import("../../../../architect/src/internal").Builder<Record<string, string> & NgPackagrBuilderOptions & import("../../../../core/src").JsonObject>;
|
|
17
17
|
export default _default;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
|
|
9
9
|
import { json } from '@angular-devkit/core';
|
|
10
10
|
import { Schema as ProtractorBuilderOptions } from './schema';
|
|
11
|
-
export { ProtractorBuilderOptions };
|
|
11
|
+
export type { ProtractorBuilderOptions };
|
|
12
12
|
/**
|
|
13
13
|
* @experimental Direct usage of this function is considered experimental.
|
|
14
14
|
*/
|
package/src/index.d.ts
CHANGED
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
export * from './transforms';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export { execute as
|
|
15
|
-
export { execute as
|
|
16
|
-
export { execute as
|
|
17
|
-
export { execute as
|
|
18
|
-
export { execute as
|
|
9
|
+
export { CrossOrigin, OutputHashing, Type } from './builders/browser/schema';
|
|
10
|
+
export type { AssetPattern, AssetPatternClass as AssetPatternObject, Budget, FileReplacement, OptimizationClass as OptimizationObject, OptimizationUnion, Schema as BrowserBuilderOptions, SourceMapClass as SourceMapObject, SourceMapUnion, StylePreprocessorOptions, } from './builders/browser/schema';
|
|
11
|
+
export { buildWebpackBrowser as executeBrowserBuilder, type BrowserBuilderOutput, } from './builders/browser';
|
|
12
|
+
export { buildApplication, type ApplicationBuilderOptions } from '@angular/build';
|
|
13
|
+
export { executeDevServerBuilder, type DevServerBuilderOptions, type DevServerBuilderOutput, } from './builders/dev-server';
|
|
14
|
+
export { execute as executeExtractI18nBuilder, type ExtractI18nBuilderOptions, } from './builders/extract-i18n';
|
|
15
|
+
export { execute as executeKarmaBuilder, type KarmaBuilderOptions, type KarmaConfigOptions, } from './builders/karma';
|
|
16
|
+
export { execute as executeProtractorBuilder, type ProtractorBuilderOptions, } from './builders/protractor';
|
|
17
|
+
export { execute as executeServerBuilder, type ServerBuilderOptions, type ServerBuilderOutput, } from './builders/server';
|
|
18
|
+
export { execute as executeSSRDevServerBuilder, type SSRDevServerBuilderOptions, type SSRDevServerBuilderOutput, } from './builders/ssr-dev-server';
|
|
19
|
+
export { execute as executeNgPackagrBuilder, type NgPackagrBuilderOptions, } from './builders/ng-packagr';
|
|
@@ -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.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { PluginObj } from '@babel/core';
|
|
9
|
+
/**
|
|
10
|
+
* A babel plugin factory function for adding istanbul instrumentation.
|
|
11
|
+
*
|
|
12
|
+
* @returns A babel plugin object instance.
|
|
13
|
+
*/
|
|
14
|
+
export default function (): PluginObj;
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.default = default_1;
|
|
14
|
+
const core_1 = require("@babel/core");
|
|
15
|
+
const istanbul_lib_instrument_1 = require("istanbul-lib-instrument");
|
|
16
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
17
|
+
/**
|
|
18
|
+
* A babel plugin factory function for adding istanbul instrumentation.
|
|
19
|
+
*
|
|
20
|
+
* @returns A babel plugin object instance.
|
|
21
|
+
*/
|
|
22
|
+
function default_1() {
|
|
23
|
+
const visitors = new WeakMap();
|
|
24
|
+
return {
|
|
25
|
+
visitor: {
|
|
26
|
+
Program: {
|
|
27
|
+
enter(path, state) {
|
|
28
|
+
const visitor = (0, istanbul_lib_instrument_1.programVisitor)(core_1.types, state.filename, {
|
|
29
|
+
// Babel returns a Converter object from the `convert-source-map` package
|
|
30
|
+
inputSourceMap: state.file.inputMap?.toObject(),
|
|
31
|
+
});
|
|
32
|
+
visitors.set(path, visitor);
|
|
33
|
+
visitor.enter(path);
|
|
34
|
+
},
|
|
35
|
+
exit(path) {
|
|
36
|
+
const visitor = visitors.get(path);
|
|
37
|
+
(0, node_assert_1.default)(visitor, 'Instrumentation visitor should always be present for program path.');
|
|
38
|
+
visitor.exit(path);
|
|
39
|
+
visitors.delete(path);
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
declare module 'istanbul-lib-instrument' {
|
|
10
|
+
export interface Visitor {
|
|
11
|
+
enter(path: import('@babel/core').NodePath<types.Program>): void;
|
|
12
|
+
exit(path: import('@babel/core').NodePath<types.Program>): void;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function programVisitor(
|
|
16
|
+
types: typeof import('@babel/core').types,
|
|
17
|
+
filePath?: string,
|
|
18
|
+
options?: { inputSourceMap?: object | null },
|
|
19
|
+
): Visitor;
|
|
20
|
+
}
|
|
@@ -158,13 +158,7 @@ function default_1(api, options) {
|
|
|
158
158
|
]);
|
|
159
159
|
}
|
|
160
160
|
if (options.instrumentCode) {
|
|
161
|
-
plugins.push(
|
|
162
|
-
require('babel-plugin-istanbul').default,
|
|
163
|
-
{
|
|
164
|
-
inputSourceMap: options.instrumentCode.inputSourceMap ?? false,
|
|
165
|
-
cwd: options.instrumentCode.includedBasePath,
|
|
166
|
-
},
|
|
167
|
-
]);
|
|
161
|
+
plugins.push(require('../plugins/add-code-coverage').default);
|
|
168
162
|
}
|
|
169
163
|
if (needRuntimeTransform) {
|
|
170
164
|
// Babel equivalent to TypeScript's `importHelpers` option
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
export { AnyComponentStyleBudgetChecker } from './any-component-style-budget-checker';
|
|
9
|
-
export { ScriptsWebpackPlugin, ScriptsWebpackPluginOptions } from './scripts-webpack-plugin';
|
|
9
|
+
export { ScriptsWebpackPlugin, type ScriptsWebpackPluginOptions } from './scripts-webpack-plugin';
|
|
10
10
|
export { SuppressExtractedTextChunksWebpackPlugin } from './suppress-entry-chunks-webpack-plugin';
|
|
11
|
-
export { RemoveHashPlugin, RemoveHashPluginOptions } from './remove-hash-plugin';
|
|
11
|
+
export { RemoveHashPlugin, type RemoveHashPluginOptions } from './remove-hash-plugin';
|
|
12
12
|
export { DedupeModuleResolvePlugin } from './dedupe-module-resolve-plugin';
|
|
13
13
|
export { CommonJsUsageWarnPlugin } from './common-js-usage-warn-plugin';
|
|
14
14
|
export { JsonStatsPlugin } from './json-stats-plugin';
|
|
15
15
|
export { JavaScriptOptimizerPlugin } from './javascript-optimizer-plugin';
|
|
16
|
-
export { default as PostcssCliResources, PostcssCliResourcesOptions, } from './postcss-cli-resources';
|
|
16
|
+
export { default as PostcssCliResources, type PostcssCliResourcesOptions, } from './postcss-cli-resources';
|
|
@@ -5,6 +5,7 @@
|
|
|
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 { SourceMapInput } from '@ampproject/remapping';
|
|
8
9
|
/**
|
|
9
10
|
* The options to use when optimizing.
|
|
10
11
|
*/
|
|
@@ -70,7 +71,7 @@ interface OptimizeRequest {
|
|
|
70
71
|
* The source map of the JavaScript asset, if available.
|
|
71
72
|
* This map is merged with all intermediate source maps during optimization.
|
|
72
73
|
*/
|
|
73
|
-
map:
|
|
74
|
+
map: SourceMapInput;
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
77
|
/**
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.useJSONBuildLogs = exports.useTypeChecking = exports.shouldWatchRoot = exports.debugPerformance = exports.useParallelTs = exports.maxWorkers = exports.allowMinify = exports.shouldBeautify = exports.allowMangle = void 0;
|
|
11
|
+
const node_os_1 = require("node:os");
|
|
11
12
|
function isDisabled(variable) {
|
|
12
13
|
return variable === '0' || variable.toLowerCase() === 'false';
|
|
13
14
|
}
|
|
@@ -66,7 +67,9 @@ exports.allowMinify = debugOptimize.minify;
|
|
|
66
67
|
*
|
|
67
68
|
*/
|
|
68
69
|
const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
|
|
69
|
-
exports.maxWorkers = isPresent(maxWorkersVariable)
|
|
70
|
+
exports.maxWorkers = isPresent(maxWorkersVariable)
|
|
71
|
+
? +maxWorkersVariable
|
|
72
|
+
: Math.min(4, (0, node_os_1.availableParallelism)());
|
|
70
73
|
const parallelTsVariable = process.env['NG_BUILD_PARALLEL_TS'];
|
|
71
74
|
exports.useParallelTs = !isPresent(parallelTsVariable) || !isDisabled(parallelTsVariable);
|
|
72
75
|
const debugPerfVariable = process.env['NG_BUILD_DEBUG_PERF'];
|
|
@@ -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.1.0-
|
|
13
|
+
const VERSION = '18.1.0-rc.0';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|
|
@@ -145,7 +145,7 @@ async function inlineLocales(options) {
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
const { diagnostics: localeDiagnostics, plugins } = await createI18nPlugins(locale, translations, isSourceLocale ? 'ignore' : options.missingTranslation || 'warning', true, localeDataContent);
|
|
148
|
-
const transformResult =
|
|
148
|
+
const transformResult = (0, core_1.transformFromAstSync)(ast, options.code, {
|
|
149
149
|
filename: options.filename,
|
|
150
150
|
// using false ensures that babel will NOT search and process sourcemap comments (large memory usage)
|
|
151
151
|
// The types do not include the false option even though it is valid
|
|
@@ -6,12 +6,15 @@
|
|
|
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
|
+
};
|
|
9
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
13
|
exports.runModuleAsObservableFork = runModuleAsObservableFork;
|
|
11
14
|
const child_process_1 = require("child_process");
|
|
12
15
|
const path_1 = require("path");
|
|
13
16
|
const rxjs_1 = require("rxjs");
|
|
14
|
-
const
|
|
17
|
+
const tree_kill_1 = __importDefault(require("tree-kill"));
|
|
15
18
|
function runModuleAsObservableFork(cwd, modulePath, exportName,
|
|
16
19
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
20
|
args) {
|
|
@@ -39,7 +42,7 @@ args) {
|
|
|
39
42
|
// Cleanup.
|
|
40
43
|
const killForkedProcess = () => {
|
|
41
44
|
if (forkedProcess && forkedProcess.pid) {
|
|
42
|
-
|
|
45
|
+
(0, tree_kill_1.default)(forkedProcess.pid, 'SIGTERM');
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
// Handle child process exit.
|