Skip to content

Commit c775d65

Browse files
author
Angular Builds
committed
4584cff build: update angular
1 parent b20c931 commit c775d65

File tree

4 files changed

+33
-17
lines changed

4 files changed

+33
-17
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
22
"name": "@angular-devkit/build-angular",
3-
"version": "19.0.0-next.9+sha-54cb005",
3+
"version": "19.0.0-next.9+sha-4584cff",
44
"description": "Angular Webpack Build Facade",
55
"main": "src/index.js",
66
"typings": "src/index.d.ts",
77
"builders": "builders.json",
88
"dependencies": {
99
"@ampproject/remapping": "2.3.0",
10-
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#54cb005",
11-
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#54cb005",
12-
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#54cb005",
13-
"@angular/build": "github:angular/angular-build-builds#54cb005",
10+
"@angular-devkit/architect": "github:angular/angular-devkit-architect-builds#4584cff",
11+
"@angular-devkit/build-webpack": "github:angular/angular-devkit-build-webpack-builds#4584cff",
12+
"@angular-devkit/core": "github:angular/angular-devkit-core-builds#4584cff",
13+
"@angular/build": "github:angular/angular-build-builds#4584cff",
1414
"@babel/core": "7.25.7",
1515
"@babel/generator": "7.25.7",
1616
"@babel/helper-annotate-as-pure": "7.25.7",
@@ -21,7 +21,7 @@
2121
"@babel/preset-env": "7.25.7",
2222
"@babel/runtime": "7.25.7",
2323
"@discoveryjs/json-ext": "0.6.1",
24-
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#54cb005",
24+
"@ngtools/webpack": "github:angular/ngtools-webpack-builds#4584cff",
2525
"@vitejs/plugin-basic-ssl": "1.1.0",
2626
"ansi-colors": "4.1.3",
2727
"autoprefixer": "10.4.20",
@@ -77,7 +77,7 @@
7777
"@angular/localize": "^19.0.0-next.0",
7878
"@angular/platform-server": "^19.0.0-next.0",
7979
"@angular/service-worker": "^19.0.0-next.0",
80-
"@angular/ssr": "github:angular/angular-ssr-builds#54cb005",
80+
"@angular/ssr": "github:angular/angular-ssr-builds#4584cff",
8181
"@web/test-runner": "^0.19.0",
8282
"browser-sync": "^3.0.2",
8383
"jest": "^29.5.0",
@@ -98,7 +98,7 @@
9898
"@angular/service-worker": {
9999
"optional": true
100100
},
101-
"@angular/ssr": "github:angular/angular-ssr-builds#54cb005",
101+
"@angular/ssr": "github:angular/angular-ssr-builds#4584cff",
102102
"@web/test-runner": {
103103
"optional": true
104104
},

src/builders/karma/application_builder.js

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,7 @@ function normalizePolyfills(polyfills) {
136136
async function collectEntrypoints(options, context, projectSourceRoot) {
137137
// Glob for files to test.
138138
const testFiles = await (0, find_tests_1.findTests)(options.include ?? [], options.exclude ?? [], context.workspaceRoot, projectSourceRoot);
139-
const entryPoints = new Set([
140-
...testFiles,
141-
'@angular-devkit/build-angular/src/builders/karma/init_test_bed.js',
142-
]);
143-
return entryPoints;
139+
return new Set(testFiles);
144140
}
145141
async function initializeApplication(options, context, karmaOptions, transforms = {}) {
146142
if (transforms.webpackConfiguration) {
@@ -153,6 +149,14 @@ async function initializeApplication(options, context, karmaOptions, transforms
153149
collectEntrypoints(options, context, projectSourceRoot),
154150
fs.rm(outputPath, { recursive: true, force: true }),
155151
]);
152+
let mainName = 'init_test_bed';
153+
if (options.main) {
154+
entryPoints.add(options.main);
155+
mainName = path.basename(options.main, path.extname(options.main));
156+
}
157+
else {
158+
entryPoints.add('@angular-devkit/build-angular/src/builders/karma/init_test_bed.js');
159+
}
156160
const instrumentForCoverage = options.codeCoverage
157161
? createInstrumentationFilter(projectSourceRoot, getInstrumentationExcludedPaths(context.workspaceRoot, options.codeCoverageExclude ?? []))
158162
: undefined;
@@ -188,8 +192,15 @@ async function initializeApplication(options, context, karmaOptions, transforms
188192
karmaOptions.files.push(
189193
// Serve polyfills first.
190194
{ pattern: `${outputPath}/polyfills.js`, type: 'module' },
191-
// Allow loading of chunk-* files but don't include them all on load.
192-
{ pattern: `${outputPath}/{chunk,worker}-*.js`, type: 'module', included: false });
195+
// Serve global setup script.
196+
{ pattern: `${outputPath}/${mainName}.js`, type: 'module' },
197+
// Serve all source maps.
198+
{ pattern: `${outputPath}/*.map`, included: false });
199+
if (hasChunkOrWorkerFiles(buildOutput.files)) {
200+
karmaOptions.files.push(
201+
// Allow loading of chunk-* files but don't include them all on load.
202+
{ pattern: `${outputPath}/{chunk,worker}-*.js`, type: 'module', included: false });
203+
}
193204
karmaOptions.files.push(
194205
// Serve remaining JS on page load, these are the test entrypoints.
195206
{ pattern: `${outputPath}/*.js`, type: 'module' });
@@ -221,6 +232,11 @@ async function initializeApplication(options, context, karmaOptions, transforms
221232
}
222233
return [karma, parsedKarmaConfig, buildOptions];
223234
}
235+
function hasChunkOrWorkerFiles(files) {
236+
return Object.keys(files).some((filename) => {
237+
return /(?:^|\/)(?:worker|chunk)[^/]+\.js$/.test(filename);
238+
});
239+
}
224240
async function writeTestFiles(files, testDir) {
225241
const directoryExists = new Set();
226242
// Writes the test related output files to disk and ensures the containing directories are present

src/utils/normalize-cache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
1010
exports.normalizeCacheOptions = normalizeCacheOptions;
1111
const node_path_1 = require("node:path");
1212
/** Version placeholder is replaced during the build process with actual package version */
13-
const VERSION = '19.0.0-next.9+sha-54cb005';
13+
const VERSION = '19.0.0-next.9+sha-4584cff';
1414
function hasCacheMetadata(value) {
1515
return (!!value &&
1616
typeof value === 'object' &&

uniqueId

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Fri Oct 04 2024 13:30:16 GMT+0000 (Coordinated Universal Time)
1+
Mon Oct 07 2024 16:51:26 GMT+0000 (Coordinated Universal Time)

0 commit comments

Comments
 (0)