@angular-devkit/build-angular 19.0.0-next.9 → 19.0.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/builders.json +6 -1
- package/package.json +20 -27
- package/src/builders/extract-i18n/application-extraction.js +4 -2
- package/src/builders/karma/application_builder.js +26 -8
- package/src/builders/protractor-error/index.d.ts +10 -0
- package/src/builders/protractor-error/index.js +14 -0
- package/src/tools/babel/presets/application.js +0 -25
- package/src/tools/webpack/configs/common.js +4 -1
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/process-bundle.js +0 -5
- package/src/utils/tailwind.js +1 -1
package/builders.json
CHANGED
|
@@ -43,9 +43,14 @@
|
|
|
43
43
|
"description": "Run unit tests with Web Test Runner."
|
|
44
44
|
},
|
|
45
45
|
"protractor": {
|
|
46
|
+
"implementation": "./src/builders/protractor-error",
|
|
47
|
+
"schema": "./src/builders/protractor/schema.json",
|
|
48
|
+
"description": "Throw an error that Protractor is end-of-life and no longer supported."
|
|
49
|
+
},
|
|
50
|
+
"private-protractor": {
|
|
46
51
|
"implementation": "./src/builders/protractor",
|
|
47
52
|
"schema": "./src/builders/protractor/schema.json",
|
|
48
|
-
"description": "
|
|
53
|
+
"description": "PRIVATE API - Do not use."
|
|
49
54
|
},
|
|
50
55
|
"server": {
|
|
51
56
|
"implementation": "./src/builders/server",
|
package/package.json
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/build-angular",
|
|
3
|
-
"version": "19.0.0-
|
|
3
|
+
"version": "19.0.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.1900.0-
|
|
11
|
-
"@angular-devkit/build-webpack": "0.1900.0-
|
|
12
|
-
"@angular-devkit/core": "19.0.0-
|
|
13
|
-
"@angular/build": "19.0.0-
|
|
14
|
-
"@babel/core": "7.
|
|
15
|
-
"@babel/generator": "7.
|
|
16
|
-
"@babel/helper-annotate-as-pure": "7.
|
|
10
|
+
"@angular-devkit/architect": "0.1900.0-rc.0",
|
|
11
|
+
"@angular-devkit/build-webpack": "0.1900.0-rc.0",
|
|
12
|
+
"@angular-devkit/core": "19.0.0-rc.0",
|
|
13
|
+
"@angular/build": "19.0.0-rc.0",
|
|
14
|
+
"@babel/core": "7.26.0",
|
|
15
|
+
"@babel/generator": "7.26.0",
|
|
16
|
+
"@babel/helper-annotate-as-pure": "7.25.9",
|
|
17
17
|
"@babel/helper-split-export-declaration": "7.24.7",
|
|
18
|
-
"@babel/plugin-transform-async-generator-functions": "7.25.
|
|
19
|
-
"@babel/plugin-transform-async-to-generator": "7.
|
|
20
|
-
"@babel/plugin-transform-runtime": "7.25.
|
|
21
|
-
"@babel/preset-env": "7.
|
|
22
|
-
"@babel/runtime": "7.
|
|
23
|
-
"@discoveryjs/json-ext": "0.6.
|
|
24
|
-
"@ngtools/webpack": "19.0.0-
|
|
18
|
+
"@babel/plugin-transform-async-generator-functions": "7.25.9",
|
|
19
|
+
"@babel/plugin-transform-async-to-generator": "7.25.9",
|
|
20
|
+
"@babel/plugin-transform-runtime": "7.25.9",
|
|
21
|
+
"@babel/preset-env": "7.26.0",
|
|
22
|
+
"@babel/runtime": "7.26.0",
|
|
23
|
+
"@discoveryjs/json-ext": "0.6.3",
|
|
24
|
+
"@ngtools/webpack": "19.0.0-rc.0",
|
|
25
25
|
"@vitejs/plugin-basic-ssl": "1.1.0",
|
|
26
26
|
"ansi-colors": "4.1.3",
|
|
27
27
|
"autoprefixer": "10.4.20",
|
|
28
28
|
"babel-loader": "9.2.1",
|
|
29
29
|
"browserslist": "^4.21.5",
|
|
30
30
|
"copy-webpack-plugin": "12.0.2",
|
|
31
|
-
"critters": "0.0.24",
|
|
32
31
|
"css-loader": "7.1.2",
|
|
33
32
|
"esbuild-wasm": "0.24.0",
|
|
34
33
|
"fast-glob": "3.3.2",
|
|
35
|
-
"http-proxy-middleware": "3.0.
|
|
36
|
-
"https-proxy-agent": "7.0.5",
|
|
34
|
+
"http-proxy-middleware": "3.0.3",
|
|
37
35
|
"istanbul-lib-instrument": "6.0.3",
|
|
38
36
|
"jsonc-parser": "3.3.1",
|
|
39
37
|
"karma-source-map-support": "1.4.0",
|
|
@@ -41,28 +39,23 @@
|
|
|
41
39
|
"less-loader": "12.2.0",
|
|
42
40
|
"license-webpack-plugin": "4.0.2",
|
|
43
41
|
"loader-utils": "3.3.1",
|
|
44
|
-
"magic-string": "0.30.11",
|
|
45
42
|
"mini-css-extract-plugin": "2.9.1",
|
|
46
|
-
"mrmime": "2.0.0",
|
|
47
43
|
"open": "10.1.0",
|
|
48
44
|
"ora": "5.4.1",
|
|
49
|
-
"parse5-html-rewriting-stream": "7.0.0",
|
|
50
45
|
"picomatch": "4.0.2",
|
|
51
46
|
"piscina": "4.7.0",
|
|
52
47
|
"postcss": "8.4.47",
|
|
53
48
|
"postcss-loader": "8.1.1",
|
|
54
49
|
"resolve-url-loader": "5.0.0",
|
|
55
50
|
"rxjs": "7.8.1",
|
|
56
|
-
"sass": "1.
|
|
51
|
+
"sass": "1.80.5",
|
|
57
52
|
"sass-loader": "16.0.2",
|
|
58
53
|
"semver": "7.6.3",
|
|
59
54
|
"source-map-loader": "5.0.0",
|
|
60
55
|
"source-map-support": "0.5.21",
|
|
61
|
-
"terser": "5.
|
|
56
|
+
"terser": "5.36.0",
|
|
62
57
|
"tree-kill": "1.2.2",
|
|
63
|
-
"tslib": "2.
|
|
64
|
-
"vite": "5.4.8",
|
|
65
|
-
"watchpack": "2.4.2",
|
|
58
|
+
"tslib": "2.8.0",
|
|
66
59
|
"webpack": "5.95.0",
|
|
67
60
|
"webpack-dev-middleware": "7.4.2",
|
|
68
61
|
"webpack-dev-server": "5.1.0",
|
|
@@ -77,7 +70,7 @@
|
|
|
77
70
|
"@angular/localize": "^19.0.0-next.0",
|
|
78
71
|
"@angular/platform-server": "^19.0.0-next.0",
|
|
79
72
|
"@angular/service-worker": "^19.0.0-next.0",
|
|
80
|
-
"@angular/ssr": "^19.0.0-
|
|
73
|
+
"@angular/ssr": "^19.0.0-rc.0",
|
|
81
74
|
"@web/test-runner": "^0.19.0",
|
|
82
75
|
"browser-sync": "^3.0.2",
|
|
83
76
|
"jest": "^29.5.0",
|
|
@@ -31,9 +31,11 @@ async function extractMessages(options, builderName, context, extractorConstruct
|
|
|
31
31
|
buildOptions.budgets = undefined;
|
|
32
32
|
buildOptions.index = false;
|
|
33
33
|
buildOptions.serviceWorker = false;
|
|
34
|
+
buildOptions.server = undefined;
|
|
34
35
|
buildOptions.ssr = false;
|
|
35
|
-
buildOptions.appShell =
|
|
36
|
-
buildOptions.prerender =
|
|
36
|
+
buildOptions.appShell = undefined;
|
|
37
|
+
buildOptions.prerender = undefined;
|
|
38
|
+
buildOptions.outputMode = undefined;
|
|
37
39
|
const builderResult = await first((0, private_1.buildApplicationInternal)(buildOptions, context));
|
|
38
40
|
let success = false;
|
|
39
41
|
if (!builderResult || builderResult.kind === private_1.ResultKind.Failure) {
|
|
@@ -97,7 +97,9 @@ function injectKarmaReporter(context, buildOptions, karmaConfig, subscriber) {
|
|
|
97
97
|
}
|
|
98
98
|
function execute(options, context, karmaOptions, transforms = {}) {
|
|
99
99
|
return (0, rxjs_1.from)(initializeApplication(options, context, karmaOptions, transforms)).pipe((0, rxjs_1.switchMap)(([karma, karmaConfig, buildOptions]) => new rxjs_1.Observable((subscriber) => {
|
|
100
|
-
|
|
100
|
+
// If `--watch` is explicitly enabled or if we are keeping the Karma
|
|
101
|
+
// process running, we should hook Karma into the build.
|
|
102
|
+
if (options.watch ?? !karmaConfig.singleRun) {
|
|
101
103
|
injectKarmaReporter(context, buildOptions, karmaConfig, subscriber);
|
|
102
104
|
}
|
|
103
105
|
// Complete the observable once the Karma server returns.
|
|
@@ -136,11 +138,7 @@ function normalizePolyfills(polyfills) {
|
|
|
136
138
|
async function collectEntrypoints(options, context, projectSourceRoot) {
|
|
137
139
|
// Glob for files to test.
|
|
138
140
|
const testFiles = await (0, find_tests_1.findTests)(options.include ?? [], options.exclude ?? [], context.workspaceRoot, projectSourceRoot);
|
|
139
|
-
|
|
140
|
-
...testFiles,
|
|
141
|
-
'@angular-devkit/build-angular/src/builders/karma/init_test_bed.js',
|
|
142
|
-
]);
|
|
143
|
-
return entryPoints;
|
|
141
|
+
return new Set(testFiles);
|
|
144
142
|
}
|
|
145
143
|
async function initializeApplication(options, context, karmaOptions, transforms = {}) {
|
|
146
144
|
if (transforms.webpackConfiguration) {
|
|
@@ -153,6 +151,14 @@ async function initializeApplication(options, context, karmaOptions, transforms
|
|
|
153
151
|
collectEntrypoints(options, context, projectSourceRoot),
|
|
154
152
|
fs.rm(outputPath, { recursive: true, force: true }),
|
|
155
153
|
]);
|
|
154
|
+
let mainName = 'init_test_bed';
|
|
155
|
+
if (options.main) {
|
|
156
|
+
entryPoints.add(options.main);
|
|
157
|
+
mainName = path.basename(options.main, path.extname(options.main));
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
entryPoints.add('@angular-devkit/build-angular/src/builders/karma/init_test_bed.js');
|
|
161
|
+
}
|
|
156
162
|
const instrumentForCoverage = options.codeCoverage
|
|
157
163
|
? createInstrumentationFilter(projectSourceRoot, getInstrumentationExcludedPaths(context.workspaceRoot, options.codeCoverageExclude ?? []))
|
|
158
164
|
: undefined;
|
|
@@ -188,8 +194,15 @@ async function initializeApplication(options, context, karmaOptions, transforms
|
|
|
188
194
|
karmaOptions.files.push(
|
|
189
195
|
// Serve polyfills first.
|
|
190
196
|
{ pattern: `${outputPath}/polyfills.js`, type: 'module' },
|
|
191
|
-
//
|
|
192
|
-
{ pattern: `${outputPath}
|
|
197
|
+
// Serve global setup script.
|
|
198
|
+
{ pattern: `${outputPath}/${mainName}.js`, type: 'module' },
|
|
199
|
+
// Serve all source maps.
|
|
200
|
+
{ pattern: `${outputPath}/*.map`, included: false });
|
|
201
|
+
if (hasChunkOrWorkerFiles(buildOutput.files)) {
|
|
202
|
+
karmaOptions.files.push(
|
|
203
|
+
// Allow loading of chunk-* files but don't include them all on load.
|
|
204
|
+
{ pattern: `${outputPath}/{chunk,worker}-*.js`, type: 'module', included: false });
|
|
205
|
+
}
|
|
193
206
|
karmaOptions.files.push(
|
|
194
207
|
// Serve remaining JS on page load, these are the test entrypoints.
|
|
195
208
|
{ pattern: `${outputPath}/*.js`, type: 'module' });
|
|
@@ -221,6 +234,11 @@ async function initializeApplication(options, context, karmaOptions, transforms
|
|
|
221
234
|
}
|
|
222
235
|
return [karma, parsedKarmaConfig, buildOptions];
|
|
223
236
|
}
|
|
237
|
+
function hasChunkOrWorkerFiles(files) {
|
|
238
|
+
return Object.keys(files).some((filename) => {
|
|
239
|
+
return /(?:^|\/)(?:worker|chunk)[^/]+\.js$/.test(filename);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
224
242
|
async function writeTestFiles(files, testDir) {
|
|
225
243
|
const directoryExists = new Set();
|
|
226
244
|
// Writes the test related output files to disk and ensures the containing directories are present
|
|
@@ -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.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import { Schema as ProtractorBuilderOptions } from '../protractor/schema';
|
|
9
|
+
declare const _default: import("../../../../architect/src/internal").Builder<ProtractorBuilderOptions & import("../../../../core/src").JsonObject>;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
const architect_1 = require("@angular-devkit/architect");
|
|
11
|
+
exports.default = (0, architect_1.createBuilder)((_options, context) => {
|
|
12
|
+
context.logger.error('Protractor has reached end-of-life and is no longer supported. For additional information and alternatives, please see https://blog.angular.dev/protractor-deprecation-update-august-2023-2beac7402ce0.');
|
|
13
|
+
return { success: false };
|
|
14
|
+
});
|
|
@@ -20,14 +20,6 @@ const load_esm_1 = require("../../../utils/load-esm");
|
|
|
20
20
|
* Cached instance of the compiler-cli linker's needsLinking function.
|
|
21
21
|
*/
|
|
22
22
|
let needsLinking;
|
|
23
|
-
/**
|
|
24
|
-
* List of browsers which are affected by a WebKit bug where class field
|
|
25
|
-
* initializers might have incorrect variable scopes.
|
|
26
|
-
*
|
|
27
|
-
* See: https://github.com/angular/angular-cli/issues/24355#issuecomment-1333477033
|
|
28
|
-
* See: https://github.com/WebKit/WebKit/commit/e8788a34b3d5f5b4edd7ff6450b80936bff396f2
|
|
29
|
-
*/
|
|
30
|
-
let safariClassFieldScopeBugBrowsers;
|
|
31
23
|
function createI18nDiagnostics(reporter) {
|
|
32
24
|
const diagnostics = new (class {
|
|
33
25
|
messages = [];
|
|
@@ -109,29 +101,12 @@ function default_1(api, options) {
|
|
|
109
101
|
// However, this doesn't effect libraries and hence we use preset-env to downlevel ES features
|
|
110
102
|
// based on the supported browsers in browserslist.
|
|
111
103
|
if (options.supportedBrowsers) {
|
|
112
|
-
const includePlugins = [];
|
|
113
|
-
if (safariClassFieldScopeBugBrowsers === undefined) {
|
|
114
|
-
const browserslist = require('browserslist');
|
|
115
|
-
safariClassFieldScopeBugBrowsers = new Set(browserslist([
|
|
116
|
-
// Safari <15 is technically not supported via https://angular.dev/reference/versions#browser-support
|
|
117
|
-
// but we apply the workaround if forcibly selected.
|
|
118
|
-
'Safari <=15',
|
|
119
|
-
'iOS <=15',
|
|
120
|
-
]));
|
|
121
|
-
}
|
|
122
|
-
// If a Safari browser affected by the class field scope bug is selected, we
|
|
123
|
-
// downlevel class properties by ensuring the class properties Babel plugin
|
|
124
|
-
// is always included- regardless of the preset-env targets.
|
|
125
|
-
if (options.supportedBrowsers.some((b) => safariClassFieldScopeBugBrowsers.has(b))) {
|
|
126
|
-
includePlugins.push('@babel/plugin-proposal-class-properties', '@babel/plugin-proposal-private-methods');
|
|
127
|
-
}
|
|
128
104
|
presets.push([
|
|
129
105
|
require('@babel/preset-env').default,
|
|
130
106
|
{
|
|
131
107
|
bugfixes: true,
|
|
132
108
|
modules: false,
|
|
133
109
|
targets: options.supportedBrowsers,
|
|
134
|
-
include: includePlugins,
|
|
135
110
|
exclude: ['transform-typeof-symbol'],
|
|
136
111
|
},
|
|
137
112
|
]);
|
|
@@ -231,7 +231,10 @@ async function getCommonConfig(wco) {
|
|
|
231
231
|
const extraMinimizers = [];
|
|
232
232
|
if (scriptsOptimization) {
|
|
233
233
|
extraMinimizers.push(new plugins_1.JavaScriptOptimizerPlugin({
|
|
234
|
-
define:
|
|
234
|
+
define: {
|
|
235
|
+
...(buildOptions.aot ? GLOBAL_DEFS_FOR_TERSER_WITH_AOT : GLOBAL_DEFS_FOR_TERSER),
|
|
236
|
+
'ngServerMode': isPlatformServer,
|
|
237
|
+
},
|
|
235
238
|
sourcemap: scriptsSourceMap,
|
|
236
239
|
supportedBrowsers: buildOptions.supportedBrowsers,
|
|
237
240
|
keepIdentifierNames: !environment_options_1.allowMangle || isPlatformServer,
|
|
@@ -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 = '19.0.0-
|
|
13
|
+
const VERSION = '19.0.0-rc.0';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|
|
@@ -273,11 +273,6 @@ function unwrapTemplateLiteral(path, utils) {
|
|
|
273
273
|
const [expressions] = utils.unwrapExpressionsFromTemplateLiteral(path.get('quasi'));
|
|
274
274
|
return [messageParts, expressions];
|
|
275
275
|
}
|
|
276
|
-
function unwrapLocalizeCall(path, utils) {
|
|
277
|
-
const [messageParts] = utils.unwrapMessagePartsFromLocalizeCall(path);
|
|
278
|
-
const [expressions] = utils.unwrapSubstitutionsFromLocalizeCall(path);
|
|
279
|
-
return [messageParts, expressions];
|
|
280
|
-
}
|
|
281
276
|
async function loadLocaleData(path, optimize) {
|
|
282
277
|
// The path is validated during option processing before the build starts
|
|
283
278
|
const content = await fs.readFile(path, 'utf8');
|
package/src/utils/tailwind.js
CHANGED
|
@@ -22,7 +22,7 @@ async function findTailwindConfigurationFile(workspaceRoot, projectRoot) {
|
|
|
22
22
|
files: new Set(entries),
|
|
23
23
|
})));
|
|
24
24
|
// A configuration file can exist in the project or workspace root
|
|
25
|
-
for
|
|
25
|
+
for (const { root, files } of await Promise.all(dirEntries)) {
|
|
26
26
|
for (const potentialConfig of tailwindConfigFiles) {
|
|
27
27
|
if (files.has(potentialConfig)) {
|
|
28
28
|
return (0, node_path_1.join)(root, potentialConfig);
|