@angular/build 21.0.0-next.6 → 21.0.0-next.7
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 +7 -7
- package/src/builders/karma/application_builder.js +7 -0
- package/src/builders/unit-test/runners/vitest/executor.d.ts +1 -0
- package/src/builders/unit-test/runners/vitest/executor.js +38 -3
- package/src/builders/unit-test/test-discovery.js +1 -0
- package/src/utils/normalize-cache.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/build",
|
|
3
|
-
"version": "21.0.0-next.
|
|
3
|
+
"version": "21.0.0-next.7",
|
|
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.2100.0-next.
|
|
26
|
+
"@angular-devkit/architect": "0.2100.0-next.7",
|
|
27
27
|
"@babel/core": "7.28.4",
|
|
28
28
|
"@babel/helper-annotate-as-pure": "7.27.3",
|
|
29
29
|
"@babel/helper-split-export-declaration": "7.24.7",
|
|
@@ -41,16 +41,16 @@
|
|
|
41
41
|
"parse5-html-rewriting-stream": "8.0.0",
|
|
42
42
|
"picomatch": "4.0.3",
|
|
43
43
|
"piscina": "5.1.3",
|
|
44
|
-
"rolldown": "1.0.0-beta.
|
|
44
|
+
"rolldown": "1.0.0-beta.42",
|
|
45
45
|
"sass": "1.93.2",
|
|
46
46
|
"semver": "7.7.2",
|
|
47
47
|
"source-map-support": "0.5.21",
|
|
48
48
|
"tinyglobby": "0.2.15",
|
|
49
|
-
"vite": "7.1.
|
|
49
|
+
"vite": "7.1.9",
|
|
50
50
|
"watchpack": "2.4.4"
|
|
51
51
|
},
|
|
52
52
|
"optionalDependencies": {
|
|
53
|
-
"lmdb": "3.4.
|
|
53
|
+
"lmdb": "3.4.3"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@angular/core": "^21.0.0-next.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@angular/platform-browser": "^21.0.0-next.0",
|
|
61
61
|
"@angular/platform-server": "^21.0.0-next.0",
|
|
62
62
|
"@angular/service-worker": "^21.0.0-next.0",
|
|
63
|
-
"@angular/ssr": "^21.0.0-next.
|
|
63
|
+
"@angular/ssr": "^21.0.0-next.7",
|
|
64
64
|
"karma": "^6.4.0",
|
|
65
65
|
"less": "^4.2.0",
|
|
66
66
|
"ng-packagr": "^21.0.0-next.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
"type": "git",
|
|
113
113
|
"url": "https://github.com/angular/angular-cli.git"
|
|
114
114
|
},
|
|
115
|
-
"packageManager": "pnpm@10.
|
|
115
|
+
"packageManager": "pnpm@10.18.1",
|
|
116
116
|
"engines": {
|
|
117
117
|
"node": "^20.19.0 || ^22.12.0 || >=24.0.0",
|
|
118
118
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
@@ -45,6 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.execute = execute;
|
|
47
47
|
const node_crypto_1 = require("node:crypto");
|
|
48
|
+
const node_fs_1 = require("node:fs");
|
|
48
49
|
const fs = __importStar(require("node:fs/promises"));
|
|
49
50
|
const node_path_1 = __importDefault(require("node:path"));
|
|
50
51
|
const web_1 = require("node:stream/web");
|
|
@@ -105,8 +106,14 @@ function execute(options, context, transforms) {
|
|
|
105
106
|
async function initializeApplication(options, context, karmaOptions, transforms) {
|
|
106
107
|
const karma = await Promise.resolve().then(() => __importStar(require('karma')));
|
|
107
108
|
const projectSourceRoot = await (0, utils_1.getProjectSourceRoot)(context);
|
|
109
|
+
// Setup temporary output path and ensure it is empty
|
|
108
110
|
const outputPath = node_path_1.default.join(context.workspaceRoot, 'dist/test-out', (0, node_crypto_1.randomUUID)());
|
|
109
111
|
await fs.rm(outputPath, { recursive: true, force: true });
|
|
112
|
+
// Setup exit cleanup for temporary directory
|
|
113
|
+
const handleProcessExit = () => (0, node_fs_1.rmSync)(outputPath, { recursive: true, force: true });
|
|
114
|
+
process.once('exit', handleProcessExit);
|
|
115
|
+
process.once('SIGINT', handleProcessExit);
|
|
116
|
+
process.once('uncaughtException', handleProcessExit);
|
|
110
117
|
const { buildOptions, mainName } = await setupBuildOptions(options, context, projectSourceRoot, outputPath);
|
|
111
118
|
const [buildOutput, buildIterator] = await runEsbuild(buildOptions, context, projectSourceRoot);
|
|
112
119
|
const karmaConfig = await configureKarma(karma, context, karmaOptions, options, buildOptions, buildOutput, mainName, transforms);
|
|
@@ -11,6 +11,7 @@ import { NormalizedUnitTestBuilderOptions } from '../../options';
|
|
|
11
11
|
import type { TestExecutor } from '../api';
|
|
12
12
|
export declare class VitestExecutor implements TestExecutor {
|
|
13
13
|
private vitest;
|
|
14
|
+
private normalizePath;
|
|
14
15
|
private readonly projectName;
|
|
15
16
|
private readonly options;
|
|
16
17
|
private readonly buildResultFiles;
|
|
@@ -6,6 +6,39 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
9
42
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
43
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
44
|
};
|
|
@@ -21,6 +54,7 @@ const browser_provider_1 = require("./browser-provider");
|
|
|
21
54
|
const plugins_1 = require("./plugins");
|
|
22
55
|
class VitestExecutor {
|
|
23
56
|
vitest;
|
|
57
|
+
normalizePath;
|
|
24
58
|
projectName;
|
|
25
59
|
options;
|
|
26
60
|
buildResultFiles = new Map();
|
|
@@ -41,18 +75,19 @@ class VitestExecutor {
|
|
|
41
75
|
}
|
|
42
76
|
}
|
|
43
77
|
async *execute(buildResult) {
|
|
78
|
+
this.normalizePath ??= (await Promise.resolve().then(() => __importStar(require('vite')))).normalizePath;
|
|
44
79
|
if (buildResult.kind === results_1.ResultKind.Full) {
|
|
45
80
|
this.buildResultFiles.clear();
|
|
46
81
|
for (const [path, file] of Object.entries(buildResult.files)) {
|
|
47
|
-
this.buildResultFiles.set(path, file);
|
|
82
|
+
this.buildResultFiles.set(this.normalizePath(path), file);
|
|
48
83
|
}
|
|
49
84
|
}
|
|
50
85
|
else {
|
|
51
86
|
for (const file of buildResult.removed) {
|
|
52
|
-
this.buildResultFiles.delete(file.path);
|
|
87
|
+
this.buildResultFiles.delete(this.normalizePath(file.path));
|
|
53
88
|
}
|
|
54
89
|
for (const [path, file] of Object.entries(buildResult.files)) {
|
|
55
|
-
this.buildResultFiles.set(path, file);
|
|
90
|
+
this.buildResultFiles.set(this.normalizePath(path), file);
|
|
56
91
|
}
|
|
57
92
|
}
|
|
58
93
|
// Initialize Vitest if not already present.
|
|
@@ -48,6 +48,7 @@ async function findTests(include, exclude, workspaceRoot, projectSourceRoot) {
|
|
|
48
48
|
const globMatches = await (0, tinyglobby_1.glob)(dynamicPatterns, {
|
|
49
49
|
cwd: projectSourceRoot,
|
|
50
50
|
absolute: true,
|
|
51
|
+
expandDirectories: false,
|
|
51
52
|
ignore: ['**/node_modules/**', ...normalizedExcludes],
|
|
52
53
|
});
|
|
53
54
|
for (const match of globMatches) {
|
|
@@ -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 = '21.0.0-next.
|
|
13
|
+
const VERSION = '21.0.0-next.7';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|