@angular-devkit/build-angular 19.0.2 → 19.0.4

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 CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@angular-devkit/build-angular",
3
- "version": "19.0.2",
3
+ "version": "19.0.4",
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.2",
11
- "@angular-devkit/build-webpack": "0.1900.2",
12
- "@angular-devkit/core": "19.0.2",
13
- "@angular/build": "19.0.2",
10
+ "@angular-devkit/architect": "0.1900.4",
11
+ "@angular-devkit/build-webpack": "0.1900.4",
12
+ "@angular-devkit/core": "19.0.4",
13
+ "@angular/build": "19.0.4",
14
14
  "@babel/core": "7.26.0",
15
15
  "@babel/generator": "7.26.2",
16
16
  "@babel/helper-annotate-as-pure": "7.25.9",
@@ -21,7 +21,7 @@
21
21
  "@babel/preset-env": "7.26.0",
22
22
  "@babel/runtime": "7.26.0",
23
23
  "@discoveryjs/json-ext": "0.6.3",
24
- "@ngtools/webpack": "19.0.2",
24
+ "@ngtools/webpack": "19.0.4",
25
25
  "@vitejs/plugin-basic-ssl": "1.1.0",
26
26
  "ansi-colors": "4.1.3",
27
27
  "autoprefixer": "10.4.20",
@@ -70,7 +70,7 @@
70
70
  "@angular/localize": "^19.0.0",
71
71
  "@angular/platform-server": "^19.0.0",
72
72
  "@angular/service-worker": "^19.0.0",
73
- "@angular/ssr": "^19.0.2",
73
+ "@angular/ssr": "^19.0.4",
74
74
  "@web/test-runner": "^0.19.0",
75
75
  "browser-sync": "^3.0.2",
76
76
  "jest": "^29.5.0",
@@ -196,21 +196,7 @@ function normalizePolyfills(polyfills) {
196
196
  async function collectEntrypoints(options, context, projectSourceRoot) {
197
197
  // Glob for files to test.
198
198
  const testFiles = await (0, find_tests_1.findTests)(options.include ?? [], options.exclude ?? [], context.workspaceRoot, projectSourceRoot);
199
- const seen = new Set();
200
- return new Map(Array.from(testFiles, (testFile) => {
201
- const relativePath = path
202
- .relative(testFile.startsWith(projectSourceRoot) ? projectSourceRoot : context.workspaceRoot, testFile)
203
- .replace(/^[./]+/, '_')
204
- .replace(/\//g, '-');
205
- let uniqueName = `spec-${path.basename(relativePath, path.extname(relativePath))}`;
206
- let suffix = 2;
207
- while (seen.has(uniqueName)) {
208
- uniqueName = `${relativePath}-${suffix}`;
209
- ++suffix;
210
- }
211
- seen.add(uniqueName);
212
- return [uniqueName, testFile];
213
- }));
199
+ return (0, find_tests_1.getTestEntrypoints)(testFiles, { projectSourceRoot, workspaceRoot: context.workspaceRoot });
214
200
  }
215
201
  async function initializeApplication(options, context, karmaOptions, transforms = {}) {
216
202
  if (transforms.webpackConfiguration) {
@@ -6,3 +6,10 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  export declare function findTests(include: string[], exclude: string[], workspaceRoot: string, projectSourceRoot: string): Promise<string[]>;
9
+ interface TestEntrypointsOptions {
10
+ projectSourceRoot: string;
11
+ workspaceRoot: string;
12
+ }
13
+ /** Generate unique bundle names for a set of test files. */
14
+ export declare function getTestEntrypoints(testFiles: string[], { projectSourceRoot, workspaceRoot }: TestEntrypointsOptions): Map<string, string>;
15
+ export {};
@@ -31,6 +31,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
31
31
  };
32
32
  Object.defineProperty(exports, "__esModule", { value: true });
33
33
  exports.findTests = findTests;
34
+ exports.getTestEntrypoints = getTestEntrypoints;
34
35
  const fast_glob_1 = __importStar(require("fast-glob"));
35
36
  const fs_1 = require("fs");
36
37
  const path_1 = require("path");
@@ -41,6 +42,26 @@ async function findTests(include, exclude, workspaceRoot, projectSourceRoot) {
41
42
  // Unique file names
42
43
  return [...new Set(files.flat())];
43
44
  }
45
+ /** Generate unique bundle names for a set of test files. */
46
+ function getTestEntrypoints(testFiles, { projectSourceRoot, workspaceRoot }) {
47
+ const seen = new Set();
48
+ return new Map(Array.from(testFiles, (testFile) => {
49
+ const relativePath = removeRoots(testFile, [projectSourceRoot, workspaceRoot])
50
+ // Strip leading dots and path separators.
51
+ .replace(/^[./\\]+/, '')
52
+ // Replace any path separators with dashes.
53
+ .replace(/[/\\]/g, '-');
54
+ const baseName = `spec-${(0, path_1.basename)(relativePath, (0, path_1.extname)(relativePath))}`;
55
+ let uniqueName = baseName;
56
+ let suffix = 2;
57
+ while (seen.has(uniqueName)) {
58
+ uniqueName = `${baseName}-${suffix}`.replace(/([^\w](?:spec|test))-([\d]+)$/, '-$2$1');
59
+ ++suffix;
60
+ }
61
+ seen.add(uniqueName);
62
+ return [uniqueName, testFile];
63
+ }));
64
+ }
44
65
  const normalizePath = (path) => path.replace(/\\/g, '/');
45
66
  const removeLeadingSlash = (pattern) => {
46
67
  if (pattern.charAt(0) === '/') {
@@ -54,6 +75,14 @@ const removeRelativeRoot = (path, root) => {
54
75
  }
55
76
  return path;
56
77
  };
78
+ function removeRoots(path, roots) {
79
+ for (const root of roots) {
80
+ if (path.startsWith(root)) {
81
+ return path.substring(root.length);
82
+ }
83
+ }
84
+ return (0, path_1.basename)(path);
85
+ }
57
86
  async function findMatchingTests(pattern, ignore, workspaceRoot, projectSourceRoot) {
58
87
  // normalize pattern, glob lib only accepts forward slashes
59
88
  let normalizedPattern = normalizePath(pattern);
@@ -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.2';
13
+ const VERSION = '19.0.4';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&