@angular/build 20.1.0-next.1 → 20.1.0-next.2
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 +3 -3
- package/src/builders/karma/application_builder.js +21 -10
- package/src/builders/unit-test/builder.js +2 -2
- package/src/builders/unit-test/schema.d.ts +2 -0
- package/src/builders/unit-test/schema.js +2 -0
- package/src/builders/unit-test/schema.json +10 -1
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/worker-pool.js +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/build",
|
|
3
|
-
"version": "20.1.0-next.
|
|
3
|
+
"version": "20.1.0-next.2",
|
|
4
4
|
"description": "Official build system for Angular",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Angular CLI",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"builders": "builders.json",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ampproject/remapping": "2.3.0",
|
|
26
|
-
"@angular-devkit/architect": "0.2001.0-next.
|
|
26
|
+
"@angular-devkit/architect": "0.2001.0-next.2",
|
|
27
27
|
"@babel/core": "7.27.4",
|
|
28
28
|
"@babel/helper-annotate-as-pure": "7.27.3",
|
|
29
29
|
"@babel/helper-split-export-declaration": "7.24.7",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@angular/platform-browser": "^20.0.0 || ^20.1.0-next.0",
|
|
61
61
|
"@angular/platform-server": "^20.0.0 || ^20.1.0-next.0",
|
|
62
62
|
"@angular/service-worker": "^20.0.0 || ^20.1.0-next.0",
|
|
63
|
-
"@angular/ssr": "^20.1.0-next.
|
|
63
|
+
"@angular/ssr": "^20.1.0-next.2",
|
|
64
64
|
"karma": "^6.4.0",
|
|
65
65
|
"less": "^4.2.0",
|
|
66
66
|
"ng-packagr": "^20.0.0 || ^20.1.0-next.0",
|
|
@@ -112,7 +112,7 @@ class AngularAssetsMiddleware {
|
|
|
112
112
|
class AngularPolyfillsPlugin {
|
|
113
113
|
static $inject = ['config.files'];
|
|
114
114
|
static NAME = 'angular-polyfills';
|
|
115
|
-
static createPlugin(polyfillsFile, jasmineCleanupFiles) {
|
|
115
|
+
static createPlugin(polyfillsFile, jasmineCleanupFiles, scriptsFiles) {
|
|
116
116
|
return {
|
|
117
117
|
// This has to be a "reporter" because reporters run _after_ frameworks
|
|
118
118
|
// and karma-jasmine-html-reporter injects additional scripts that may
|
|
@@ -155,6 +155,8 @@ class AngularPolyfillsPlugin {
|
|
|
155
155
|
f.type = 'module';
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
+
// Add "scripts" option files as classic scripts
|
|
159
|
+
files.unshift(...scriptsFiles);
|
|
158
160
|
// Add browser sourcemap support as a classic script
|
|
159
161
|
files.unshift({
|
|
160
162
|
pattern: localResolve('source-map-support/browser-source-map-support.js'),
|
|
@@ -394,16 +396,25 @@ async function initializeApplication(options, context, karmaOptions, transforms
|
|
|
394
396
|
watched: false,
|
|
395
397
|
};
|
|
396
398
|
karmaOptions.basePath = outputPath;
|
|
397
|
-
|
|
399
|
+
const scriptsFiles = [];
|
|
398
400
|
if (options.scripts?.length) {
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
401
|
+
const outputScripts = new Set();
|
|
402
|
+
for (const scriptEntry of options.scripts) {
|
|
403
|
+
const outputName = typeof scriptEntry === 'string'
|
|
404
|
+
? 'scripts.js'
|
|
405
|
+
: `${scriptEntry.bundleName ?? 'scripts'}.js`;
|
|
406
|
+
if (outputScripts.has(outputName)) {
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
outputScripts.add(outputName);
|
|
410
|
+
scriptsFiles.push({
|
|
411
|
+
pattern: `${outputPath}/${outputName}`,
|
|
412
|
+
watched: false,
|
|
413
|
+
type: 'js',
|
|
414
|
+
});
|
|
415
|
+
}
|
|
406
416
|
}
|
|
417
|
+
karmaOptions.files ??= [];
|
|
407
418
|
karmaOptions.files.push(
|
|
408
419
|
// Serve global setup script.
|
|
409
420
|
{ pattern: `${mainName}.js`, type: 'module', watched: false },
|
|
@@ -454,7 +465,7 @@ async function initializeApplication(options, context, karmaOptions, transforms
|
|
|
454
465
|
parsedKarmaConfig.plugins.push(AngularAssetsMiddleware.createPlugin(buildOutput));
|
|
455
466
|
parsedKarmaConfig.middleware ??= [];
|
|
456
467
|
parsedKarmaConfig.middleware.push(AngularAssetsMiddleware.NAME);
|
|
457
|
-
parsedKarmaConfig.plugins.push(AngularPolyfillsPlugin.createPlugin(polyfillsFile, jasmineCleanupFiles));
|
|
468
|
+
parsedKarmaConfig.plugins.push(AngularPolyfillsPlugin.createPlugin(polyfillsFile, jasmineCleanupFiles, scriptsFiles));
|
|
458
469
|
parsedKarmaConfig.reporters ??= [];
|
|
459
470
|
parsedKarmaConfig.reporters.push(AngularPolyfillsPlugin.NAME);
|
|
460
471
|
// Adjust karma junit reporter outDir location to maintain previous (devkit) behavior
|
|
@@ -179,10 +179,10 @@ async function* execute(options, context, extensions = {}) {
|
|
|
179
179
|
coverage: {
|
|
180
180
|
enabled: !!normalizedOptions.codeCoverage,
|
|
181
181
|
excludeAfterRemap: true,
|
|
182
|
-
exclude: normalizedOptions.codeCoverage?.exclude,
|
|
182
|
+
exclude: normalizedOptions.codeCoverage?.exclude ?? [],
|
|
183
183
|
// Special handling for `reporter` due to an undefined value causing upstream failures
|
|
184
184
|
...(normalizedOptions.codeCoverage?.reporters
|
|
185
|
-
? {
|
|
185
|
+
? { reporter: normalizedOptions.codeCoverage.reporters }
|
|
186
186
|
: {}),
|
|
187
187
|
},
|
|
188
188
|
...debugOptions,
|
|
@@ -71,6 +71,8 @@ export type CodeCoverageReporterCodeCoverageReporter = CoverageReporters | {
|
|
|
71
71
|
export declare enum CoverageReporters {
|
|
72
72
|
Cobertura = "cobertura",
|
|
73
73
|
Html = "html",
|
|
74
|
+
Json = "json",
|
|
75
|
+
JsonSummary = "json-summary",
|
|
74
76
|
Lcov = "lcov",
|
|
75
77
|
Lcovonly = "lcovonly",
|
|
76
78
|
Text = "text",
|
|
@@ -7,6 +7,8 @@ var CoverageReporters;
|
|
|
7
7
|
(function (CoverageReporters) {
|
|
8
8
|
CoverageReporters["Cobertura"] = "cobertura";
|
|
9
9
|
CoverageReporters["Html"] = "html";
|
|
10
|
+
CoverageReporters["Json"] = "json";
|
|
11
|
+
CoverageReporters["JsonSummary"] = "json-summary";
|
|
10
12
|
CoverageReporters["Lcov"] = "lcov";
|
|
11
13
|
CoverageReporters["Lcovonly"] = "lcovonly";
|
|
12
14
|
CoverageReporters["Text"] = "text";
|
|
@@ -98,7 +98,16 @@
|
|
|
98
98
|
"required": ["buildTarget", "tsConfig", "runner"],
|
|
99
99
|
"definitions": {
|
|
100
100
|
"coverage-reporters": {
|
|
101
|
-
"enum": [
|
|
101
|
+
"enum": [
|
|
102
|
+
"html",
|
|
103
|
+
"lcov",
|
|
104
|
+
"lcovonly",
|
|
105
|
+
"text",
|
|
106
|
+
"text-summary",
|
|
107
|
+
"cobertura",
|
|
108
|
+
"json",
|
|
109
|
+
"json-summary"
|
|
110
|
+
]
|
|
102
111
|
}
|
|
103
112
|
}
|
|
104
113
|
}
|
|
@@ -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 = '20.1.0-next.
|
|
13
|
+
const VERSION = '20.1.0-next.2';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|
package/src/utils/worker-pool.js
CHANGED
|
@@ -14,7 +14,8 @@ class WorkerPool extends piscina_1.Piscina {
|
|
|
14
14
|
constructor(options) {
|
|
15
15
|
const piscinaOptions = {
|
|
16
16
|
minThreads: 1,
|
|
17
|
-
|
|
17
|
+
// Workaround for https://github.com/piscinajs/piscina/issues/816
|
|
18
|
+
idleTimeout: 10_000,
|
|
18
19
|
// Web containers do not support transferable objects with receiveOnMessagePort which
|
|
19
20
|
// is used when the Atomics based wait loop is enable.
|
|
20
21
|
atomics: process.versions.webcontainer ? 'disabled' : 'sync',
|