@angular/build 21.0.0-rc.0 → 21.0.0-rc.1
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 +5 -5
- package/src/builders/application/schema.d.ts +6 -6
- package/src/builders/application/schema.js +3 -3
- package/src/builders/application/schema.json +1 -1
- package/src/builders/unit-test/runners/vitest/executor.js +22 -69
- package/src/builders/unit-test/runners/vitest/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/plugins.d.ts +12 -5
- package/src/builders/unit-test/runners/vitest/plugins.js +188 -114
- package/src/builders/unit-test/runners/vitest/plugins.js.map +1 -1
- 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-rc.
|
|
3
|
+
"version": "21.0.0-rc.1",
|
|
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-rc.
|
|
26
|
+
"@angular-devkit/architect": "0.2100.0-rc.1",
|
|
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",
|
|
@@ -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-rc.
|
|
63
|
+
"@angular/ssr": "^21.0.0-rc.1",
|
|
64
64
|
"karma": "^6.4.0",
|
|
65
65
|
"less": "^4.2.0",
|
|
66
66
|
"ng-packagr": "^21.0.0-next.0",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0",
|
|
69
69
|
"tslib": "^2.3.0",
|
|
70
70
|
"typescript": ">=5.9 <6.0",
|
|
71
|
-
"vitest": "^4.0.
|
|
71
|
+
"vitest": "^4.0.6"
|
|
72
72
|
},
|
|
73
73
|
"peerDependenciesMeta": {
|
|
74
74
|
"@angular/core": {
|
|
@@ -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.20.0",
|
|
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",
|
|
@@ -136,9 +136,9 @@ export type Schema = {
|
|
|
136
136
|
*/
|
|
137
137
|
outputHashing?: OutputHashing;
|
|
138
138
|
/**
|
|
139
|
-
* Defines the build output
|
|
140
|
-
* static hosting service. 'server':
|
|
141
|
-
*
|
|
139
|
+
* Defines the type of build output artifact. 'static': Generates a static site build
|
|
140
|
+
* artifact for deployment on any static hosting service. 'server': Generates a server
|
|
141
|
+
* application build artifact, required for applications using hybrid rendering or APIs.
|
|
142
142
|
*/
|
|
143
143
|
outputMode?: OutputMode;
|
|
144
144
|
/**
|
|
@@ -428,9 +428,9 @@ export declare enum OutputHashing {
|
|
|
428
428
|
None = "none"
|
|
429
429
|
}
|
|
430
430
|
/**
|
|
431
|
-
* Defines the build output
|
|
432
|
-
* static hosting service. 'server':
|
|
433
|
-
*
|
|
431
|
+
* Defines the type of build output artifact. 'static': Generates a static site build
|
|
432
|
+
* artifact for deployment on any static hosting service. 'server': Generates a server
|
|
433
|
+
* application build artifact, required for applications using hybrid rendering or APIs.
|
|
434
434
|
*/
|
|
435
435
|
export declare enum OutputMode {
|
|
436
436
|
Server = "server",
|
|
@@ -63,9 +63,9 @@ var OutputHashing;
|
|
|
63
63
|
OutputHashing["None"] = "none";
|
|
64
64
|
})(OutputHashing || (exports.OutputHashing = OutputHashing = {}));
|
|
65
65
|
/**
|
|
66
|
-
* Defines the build output
|
|
67
|
-
* static hosting service. 'server':
|
|
68
|
-
*
|
|
66
|
+
* Defines the type of build output artifact. 'static': Generates a static site build
|
|
67
|
+
* artifact for deployment on any static hosting service. 'server': Generates a server
|
|
68
|
+
* application build artifact, required for applications using hybrid rendering or APIs.
|
|
69
69
|
*/
|
|
70
70
|
var OutputMode;
|
|
71
71
|
(function (OutputMode) {
|
|
@@ -611,7 +611,7 @@
|
|
|
611
611
|
},
|
|
612
612
|
"outputMode": {
|
|
613
613
|
"type": "string",
|
|
614
|
-
"description": "Defines the build output
|
|
614
|
+
"description": "Defines the type of build output artifact. 'static': Generates a static site build artifact for deployment on any static hosting service. 'server': Generates a server application build artifact, required for applications using hybrid rendering or APIs.",
|
|
615
615
|
"enum": ["static", "server"]
|
|
616
616
|
}
|
|
617
617
|
},
|
|
@@ -46,9 +46,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
46
46
|
exports.VitestExecutor = void 0;
|
|
47
47
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
48
48
|
const node_path_1 = __importDefault(require("node:path"));
|
|
49
|
-
const picomatch_1 = require("picomatch");
|
|
50
49
|
const error_1 = require("../../../../utils/error");
|
|
51
|
-
const path_1 = require("../../../../utils/path");
|
|
52
50
|
const results_1 = require("../../../application/results");
|
|
53
51
|
const browser_provider_1 = require("./browser-provider");
|
|
54
52
|
const configuration_1 = require("./configuration");
|
|
@@ -105,7 +103,7 @@ class VitestExecutor {
|
|
|
105
103
|
if (source) {
|
|
106
104
|
modifiedSourceFiles.add(source);
|
|
107
105
|
}
|
|
108
|
-
vitest.invalidateFile(
|
|
106
|
+
vitest.invalidateFile(this.normalizePath(node_path_1.default.join(this.options.workspaceRoot, modifiedFile)));
|
|
109
107
|
}
|
|
110
108
|
const specsToRerun = [];
|
|
111
109
|
for (const file of modifiedSourceFiles) {
|
|
@@ -138,10 +136,9 @@ class VitestExecutor {
|
|
|
138
136
|
}
|
|
139
137
|
async initializeVitest() {
|
|
140
138
|
const { coverage, reporters, outputFile, workspaceRoot, browsers, debug, watch, browserViewport, ui, } = this.options;
|
|
139
|
+
const projectName = this.projectName;
|
|
141
140
|
let vitestNodeModule;
|
|
142
|
-
let vitestCoverageModule;
|
|
143
141
|
try {
|
|
144
|
-
vitestCoverageModule = await Promise.resolve().then(() => __importStar(require('vitest/coverage')));
|
|
145
142
|
vitestNodeModule = await Promise.resolve().then(() => __importStar(require('vitest/node')));
|
|
146
143
|
}
|
|
147
144
|
catch (error) {
|
|
@@ -152,21 +149,6 @@ class VitestExecutor {
|
|
|
152
149
|
throw new Error('The `vitest` package was not found. Please install the package and rerun the test command.');
|
|
153
150
|
}
|
|
154
151
|
const { startVitest } = vitestNodeModule;
|
|
155
|
-
// Augment BaseCoverageProvider to include logic to support the built virtual files.
|
|
156
|
-
// Temporary workaround to avoid the direct filesystem checks in the base provider that
|
|
157
|
-
// were introduced in v4. Also ensures that all built virtual files are available.
|
|
158
|
-
const builtVirtualFiles = this.buildResultFiles;
|
|
159
|
-
vitestCoverageModule.BaseCoverageProvider.prototype.isIncluded = function (filename) {
|
|
160
|
-
const relativeFilename = node_path_1.default.relative(workspaceRoot, filename);
|
|
161
|
-
if (!this.options.include || builtVirtualFiles.has(relativeFilename)) {
|
|
162
|
-
return !(0, picomatch_1.isMatch)(relativeFilename, this.options.exclude);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
return (0, picomatch_1.isMatch)(relativeFilename, this.options.include, {
|
|
166
|
-
ignore: this.options.exclude,
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
152
|
// Setup vitest browser options if configured
|
|
171
153
|
const browserOptions = await (0, browser_provider_1.setupBrowserConfiguration)(browsers, debug, this.options.projectSourceRoot, browserViewport);
|
|
172
154
|
if (browserOptions.errors?.length) {
|
|
@@ -174,12 +156,10 @@ class VitestExecutor {
|
|
|
174
156
|
}
|
|
175
157
|
(0, node_assert_1.default)(this.buildResultFiles.size > 0, 'buildResult must be available before initializing vitest');
|
|
176
158
|
const testSetupFiles = this.prepareSetupFiles();
|
|
177
|
-
const
|
|
159
|
+
const projectPlugins = (0, plugins_1.createVitestPlugins)({
|
|
178
160
|
workspaceRoot,
|
|
179
161
|
projectSourceRoot: this.options.projectSourceRoot,
|
|
180
|
-
projectName
|
|
181
|
-
include: this.options.include,
|
|
182
|
-
exclude: this.options.exclude,
|
|
162
|
+
projectName,
|
|
183
163
|
buildResultFiles: this.buildResultFiles,
|
|
184
164
|
testFileToEntryPoint: this.testFileToEntryPoint,
|
|
185
165
|
});
|
|
@@ -191,64 +171,37 @@ class VitestExecutor {
|
|
|
191
171
|
}
|
|
192
172
|
: {};
|
|
193
173
|
const runnerConfig = this.options.runnerConfig;
|
|
174
|
+
const externalConfigPath = runnerConfig === true
|
|
175
|
+
? await (0, configuration_1.findVitestBaseConfig)([this.options.projectRoot, this.options.workspaceRoot])
|
|
176
|
+
: runnerConfig;
|
|
194
177
|
return startVitest('test', undefined, {
|
|
195
|
-
config:
|
|
196
|
-
? await (0, configuration_1.findVitestBaseConfig)([this.options.projectRoot, this.options.workspaceRoot])
|
|
197
|
-
: runnerConfig,
|
|
178
|
+
config: externalConfigPath,
|
|
198
179
|
root: workspaceRoot,
|
|
199
|
-
project:
|
|
200
|
-
|
|
201
|
-
include: [],
|
|
180
|
+
project: projectName,
|
|
181
|
+
outputFile,
|
|
202
182
|
testNamePattern: this.options.filter,
|
|
203
183
|
watch,
|
|
204
184
|
ui,
|
|
185
|
+
...debugOptions,
|
|
205
186
|
}, {
|
|
206
|
-
test: {
|
|
207
|
-
coverage: await generateCoverageOption(coverage, this.projectName),
|
|
208
|
-
outputFile,
|
|
209
|
-
...debugOptions,
|
|
210
|
-
...(reporters ? { reporters } : {}),
|
|
211
|
-
},
|
|
212
187
|
server: {
|
|
213
188
|
// Disable the actual file watcher. The boolean watch option above should still
|
|
214
189
|
// be enabled as it controls other internal behavior related to rerunning tests.
|
|
215
190
|
watch: null,
|
|
216
191
|
},
|
|
217
|
-
plugins
|
|
192
|
+
plugins: [
|
|
193
|
+
(0, plugins_1.createVitestConfigPlugin)({
|
|
194
|
+
browser: browserOptions.browser,
|
|
195
|
+
coverage,
|
|
196
|
+
projectName,
|
|
197
|
+
reporters,
|
|
198
|
+
setupFiles: testSetupFiles,
|
|
199
|
+
projectPlugins,
|
|
200
|
+
include: [...this.testFileToEntryPoint.keys()],
|
|
201
|
+
}),
|
|
202
|
+
],
|
|
218
203
|
});
|
|
219
204
|
}
|
|
220
205
|
}
|
|
221
206
|
exports.VitestExecutor = VitestExecutor;
|
|
222
|
-
async function generateCoverageOption(coverage, projectName) {
|
|
223
|
-
let defaultExcludes = [];
|
|
224
|
-
if (coverage.exclude) {
|
|
225
|
-
try {
|
|
226
|
-
const vitestConfig = await Promise.resolve().then(() => __importStar(require('vitest/config')));
|
|
227
|
-
defaultExcludes = vitestConfig.coverageConfigDefaults.exclude;
|
|
228
|
-
}
|
|
229
|
-
catch { }
|
|
230
|
-
}
|
|
231
|
-
return {
|
|
232
|
-
enabled: coverage.enabled,
|
|
233
|
-
excludeAfterRemap: true,
|
|
234
|
-
include: coverage.include,
|
|
235
|
-
reportsDirectory: (0, path_1.toPosixPath)(node_path_1.default.join('coverage', projectName)),
|
|
236
|
-
thresholds: coverage.thresholds,
|
|
237
|
-
watermarks: coverage.watermarks,
|
|
238
|
-
// Special handling for `exclude`/`reporters` due to an undefined value causing upstream failures
|
|
239
|
-
...(coverage.exclude
|
|
240
|
-
? {
|
|
241
|
-
exclude: [
|
|
242
|
-
// Augment the default exclude https://vitest.dev/config/#coverage-exclude
|
|
243
|
-
// with the user defined exclusions
|
|
244
|
-
...coverage.exclude,
|
|
245
|
-
...defaultExcludes,
|
|
246
|
-
],
|
|
247
|
-
}
|
|
248
|
-
: {}),
|
|
249
|
-
...(coverage.reporters
|
|
250
|
-
? { reporter: coverage.reporters }
|
|
251
|
-
: {}),
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
207
|
//# sourceMappingURL=executor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["executor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,8DAAiC;AACjC,0DAA6B;
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["executor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,8DAAiC;AACjC,0DAA6B;AAG7B,mDAAwD;AACxD,0DAKsC;AAGtC,yDAA+D;AAC/D,mDAAuD;AACvD,uCAA0E;AAE1E,MAAa,cAAc;IACjB,MAAM,CAAqB;IAC3B,aAAa,CAAuC;IAC3C,WAAW,CAAS;IACpB,OAAO,CAAmC;IAC1C,gBAAgB,GAAG,IAAI,GAAG,EAAsB,CAAC;IAElE,2EAA2E;IAC3E,6EAA6E;IAC7E,wCAAwC;IACxC,kEAAkE;IACjD,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAC;IACjD,oBAAoB,GAAG,IAAI,GAAG,EAAkB,CAAC;IAElE,YACE,WAAmB,EACnB,OAAyC,EACzC,sBAAuD;QAEvD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,sBAAsB,EAAE,CAAC;YAC3B,KAAK,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,sBAAsB,EAAE,CAAC;gBAC5D,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;gBACpD,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EAAE,IAAI;aACZ;YACD,OAAO,EAAE;gBACP,IAAA,kCAAwB,EAAC;oBACvB,OAAO,EAAE,cAAc,CAAC,OAAO;oBAC/B,QAAQ;oBACR,WAAW;oBACX,SAAS;oBACT,UAAU,EAAE,cAAc;oBAC1B,cAAc;oBACd,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;iBAC/C,CAAC;aACH;SACF,CACF,CAAC;IACJ,CAAC;CACF;AA5MD,wCA4MC"}
|
|
@@ -5,19 +5,26 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import type { VitestPlugin } from 'vitest/node';
|
|
8
|
+
import type { BrowserConfigOptions, VitestPlugin } from 'vitest/node';
|
|
9
9
|
import type { ResultFile } from '../../../application/results';
|
|
10
10
|
import type { NormalizedUnitTestBuilderOptions } from '../../options';
|
|
11
|
-
import type { BrowserConfiguration } from './browser-provider';
|
|
12
11
|
type VitestPlugins = Awaited<ReturnType<typeof VitestPlugin>>;
|
|
13
12
|
interface PluginOptions {
|
|
14
13
|
workspaceRoot: string;
|
|
15
14
|
projectSourceRoot: string;
|
|
16
15
|
projectName: string;
|
|
17
|
-
include?: string[];
|
|
18
|
-
exclude?: string[];
|
|
19
16
|
buildResultFiles: ReadonlyMap<string, ResultFile>;
|
|
20
17
|
testFileToEntryPoint: ReadonlyMap<string, string>;
|
|
21
18
|
}
|
|
22
|
-
|
|
19
|
+
interface VitestConfigPluginOptions {
|
|
20
|
+
browser: BrowserConfigOptions | undefined;
|
|
21
|
+
coverage: NormalizedUnitTestBuilderOptions['coverage'];
|
|
22
|
+
projectName: string;
|
|
23
|
+
reporters?: string[] | [string, object][];
|
|
24
|
+
setupFiles: string[];
|
|
25
|
+
projectPlugins: VitestPlugins;
|
|
26
|
+
include: string[];
|
|
27
|
+
}
|
|
28
|
+
export declare function createVitestConfigPlugin(options: VitestConfigPluginOptions): VitestPlugins[0];
|
|
29
|
+
export declare function createVitestPlugins(pluginOptions: PluginOptions): VitestPlugins;
|
|
23
30
|
export {};
|
|
@@ -6,136 +6,210 @@
|
|
|
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
|
};
|
|
12
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
+
exports.createVitestConfigPlugin = createVitestConfigPlugin;
|
|
13
47
|
exports.createVitestPlugins = createVitestPlugins;
|
|
14
48
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
49
|
const promises_1 = require("node:fs/promises");
|
|
16
50
|
const node_path_1 = __importDefault(require("node:path"));
|
|
17
51
|
const assets_middleware_1 = require("../../../../tools/vite/middlewares/assets-middleware");
|
|
18
52
|
const path_1 = require("../../../../utils/path");
|
|
19
|
-
function
|
|
20
|
-
const {
|
|
53
|
+
function createVitestConfigPlugin(options) {
|
|
54
|
+
const { include, browser, projectName, reporters, setupFiles, projectPlugins } = options;
|
|
55
|
+
return {
|
|
56
|
+
name: 'angular:vitest-configuration',
|
|
57
|
+
async config(config) {
|
|
58
|
+
const testConfig = config.test;
|
|
59
|
+
const projectConfig = {
|
|
60
|
+
test: {
|
|
61
|
+
...testConfig,
|
|
62
|
+
name: projectName,
|
|
63
|
+
setupFiles,
|
|
64
|
+
include,
|
|
65
|
+
globals: testConfig?.globals ?? true,
|
|
66
|
+
...(browser ? { browser } : {}),
|
|
67
|
+
// If the user has not specified an environment, use `jsdom`.
|
|
68
|
+
...(!testConfig?.environment ? { environment: 'jsdom' } : {}),
|
|
69
|
+
},
|
|
70
|
+
optimizeDeps: {
|
|
71
|
+
noDiscovery: true,
|
|
72
|
+
},
|
|
73
|
+
plugins: projectPlugins,
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
test: {
|
|
77
|
+
coverage: await generateCoverageOption(options.coverage, projectName),
|
|
78
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
79
|
+
...(reporters ? { reporters } : {}),
|
|
80
|
+
projects: [projectConfig],
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function createVitestPlugins(pluginOptions) {
|
|
87
|
+
const { workspaceRoot, buildResultFiles, testFileToEntryPoint } = pluginOptions;
|
|
21
88
|
return [
|
|
22
89
|
{
|
|
23
|
-
name: 'angular:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (map) {
|
|
105
|
-
if (!map.sources?.length && !map.sourcesContent?.length && !map.mappings) {
|
|
106
|
-
map.sources = ['virtual:builder'];
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
code,
|
|
111
|
-
map,
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
configureServer: (server) => {
|
|
116
|
-
server.middlewares.use((0, assets_middleware_1.createBuildAssetsMiddleware)(server.config.base, buildResultFiles));
|
|
117
|
-
},
|
|
118
|
-
},
|
|
90
|
+
name: 'angular:test-in-memory-provider',
|
|
91
|
+
enforce: 'pre',
|
|
92
|
+
resolveId: (id, importer) => {
|
|
93
|
+
if (importer && (id[0] === '.' || id[0] === '/')) {
|
|
94
|
+
let fullPath;
|
|
95
|
+
if (testFileToEntryPoint.has(importer)) {
|
|
96
|
+
fullPath = (0, path_1.toPosixPath)(node_path_1.default.join(workspaceRoot, id));
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
fullPath = (0, path_1.toPosixPath)(node_path_1.default.join(node_path_1.default.dirname(importer), id));
|
|
100
|
+
}
|
|
101
|
+
const relativePath = node_path_1.default.relative(workspaceRoot, fullPath);
|
|
102
|
+
if (buildResultFiles.has((0, path_1.toPosixPath)(relativePath))) {
|
|
103
|
+
return fullPath;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (testFileToEntryPoint.has(id)) {
|
|
107
|
+
return id;
|
|
108
|
+
}
|
|
109
|
+
(0, node_assert_1.default)(buildResultFiles.size > 0, 'buildResult must be available for resolving.');
|
|
110
|
+
const relativePath = node_path_1.default.relative(workspaceRoot, id);
|
|
111
|
+
if (buildResultFiles.has((0, path_1.toPosixPath)(relativePath))) {
|
|
112
|
+
return id;
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
load: async (id) => {
|
|
116
|
+
(0, node_assert_1.default)(buildResultFiles.size > 0, 'buildResult must be available for in-memory loading.');
|
|
117
|
+
// Attempt to load as a source test file.
|
|
118
|
+
const entryPoint = testFileToEntryPoint.get(id);
|
|
119
|
+
let outputPath;
|
|
120
|
+
if (entryPoint) {
|
|
121
|
+
outputPath = entryPoint + '.js';
|
|
122
|
+
// To support coverage exclusion of the actual test file, the virtual
|
|
123
|
+
// test entry point only references the built and bundled intermediate file.
|
|
124
|
+
return {
|
|
125
|
+
code: `import "./${outputPath}";`,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
// Attempt to load as a built artifact.
|
|
130
|
+
const relativePath = node_path_1.default.relative(workspaceRoot, id);
|
|
131
|
+
outputPath = (0, path_1.toPosixPath)(relativePath);
|
|
132
|
+
}
|
|
133
|
+
const outputFile = buildResultFiles.get(outputPath);
|
|
134
|
+
if (outputFile) {
|
|
135
|
+
const sourceMapPath = outputPath + '.map';
|
|
136
|
+
const sourceMapFile = buildResultFiles.get(sourceMapPath);
|
|
137
|
+
const code = outputFile.origin === 'memory'
|
|
138
|
+
? Buffer.from(outputFile.contents).toString('utf-8')
|
|
139
|
+
: await (0, promises_1.readFile)(outputFile.inputPath, 'utf-8');
|
|
140
|
+
const sourceMapText = sourceMapFile
|
|
141
|
+
? sourceMapFile.origin === 'memory'
|
|
142
|
+
? Buffer.from(sourceMapFile.contents).toString('utf-8')
|
|
143
|
+
: await (0, promises_1.readFile)(sourceMapFile.inputPath, 'utf-8')
|
|
144
|
+
: undefined;
|
|
145
|
+
// Vitest will include files in the coverage report if the sourcemap contains no sources.
|
|
146
|
+
// For builder-internal generated code chunks, which are typically helper functions,
|
|
147
|
+
// a virtual source is added to the sourcemap to prevent them from being incorrectly
|
|
148
|
+
// included in the final coverage report.
|
|
149
|
+
const map = sourceMapText ? JSON.parse(sourceMapText) : undefined;
|
|
150
|
+
if (map) {
|
|
151
|
+
if (!map.sources?.length && !map.sourcesContent?.length && !map.mappings) {
|
|
152
|
+
map.sources = ['virtual:builder'];
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return {
|
|
156
|
+
code,
|
|
157
|
+
map,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
configureServer: (server) => {
|
|
162
|
+
server.middlewares.use((0, assets_middleware_1.createBuildAssetsMiddleware)(server.config.base, buildResultFiles));
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'angular:html-index',
|
|
167
|
+
transformIndexHtml: () => {
|
|
168
|
+
// Add all global stylesheets
|
|
169
|
+
if (buildResultFiles.has('styles.css')) {
|
|
170
|
+
return [
|
|
119
171
|
{
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (buildResultFiles.has('styles.css')) {
|
|
124
|
-
return [
|
|
125
|
-
{
|
|
126
|
-
tag: 'link',
|
|
127
|
-
attrs: { href: 'styles.css', rel: 'stylesheet' },
|
|
128
|
-
injectTo: 'head',
|
|
129
|
-
},
|
|
130
|
-
];
|
|
131
|
-
}
|
|
132
|
-
return [];
|
|
133
|
-
},
|
|
172
|
+
tag: 'link',
|
|
173
|
+
attrs: { href: 'styles.css', rel: 'stylesheet' },
|
|
174
|
+
injectTo: 'head',
|
|
134
175
|
},
|
|
135
|
-
]
|
|
136
|
-
}
|
|
176
|
+
];
|
|
177
|
+
}
|
|
178
|
+
return [];
|
|
137
179
|
},
|
|
138
180
|
},
|
|
139
181
|
];
|
|
140
182
|
}
|
|
183
|
+
async function generateCoverageOption(coverage, projectName) {
|
|
184
|
+
let defaultExcludes = [];
|
|
185
|
+
if (coverage.exclude) {
|
|
186
|
+
try {
|
|
187
|
+
const vitestConfig = await Promise.resolve().then(() => __importStar(require('vitest/config')));
|
|
188
|
+
defaultExcludes = vitestConfig.coverageConfigDefaults.exclude;
|
|
189
|
+
}
|
|
190
|
+
catch { }
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
enabled: coverage.enabled,
|
|
194
|
+
excludeAfterRemap: true,
|
|
195
|
+
include: coverage.include,
|
|
196
|
+
reportsDirectory: (0, path_1.toPosixPath)(node_path_1.default.join('coverage', projectName)),
|
|
197
|
+
thresholds: coverage.thresholds,
|
|
198
|
+
watermarks: coverage.watermarks,
|
|
199
|
+
// Special handling for `exclude`/`reporters` due to an undefined value causing upstream failures
|
|
200
|
+
...(coverage.exclude
|
|
201
|
+
? {
|
|
202
|
+
exclude: [
|
|
203
|
+
// Augment the default exclude https://vitest.dev/config/#coverage-exclude
|
|
204
|
+
// with the user defined exclusions
|
|
205
|
+
...coverage.exclude,
|
|
206
|
+
...defaultExcludes,
|
|
207
|
+
],
|
|
208
|
+
}
|
|
209
|
+
: {}),
|
|
210
|
+
...(coverage.reporters
|
|
211
|
+
? { reporter: coverage.reporters }
|
|
212
|
+
: {}),
|
|
213
|
+
};
|
|
214
|
+
}
|
|
141
215
|
//# sourceMappingURL=plugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["plugins.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["plugins.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCH,4DAmCC;AAED,kDAyGC;AAlLD,8DAAiC;AACjC,+CAA4C;AAC5C,0DAA6B;AAO7B,4FAAmG;AACnG,iDAAqD;AA0BrD,SAAgB,wBAAwB,CAAC,OAAkC;IACzE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IAEzF,OAAO;QACL,IAAI,EAAE,8BAA8B;QACpC,KAAK,CAAC,MAAM,CAAC,MAAM;YACjB,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC;YAE/B,MAAM,aAAa,GAAwB;gBACzC,IAAI,EAAE;oBACJ,GAAG,UAAU;oBACb,IAAI,EAAE,WAAW;oBACjB,UAAU;oBACV,OAAO;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EAAC,mBAAI,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACjE,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,UAAU,EAAE,QAAQ,CAAC,UAAU;QAC/B,iGAAiG;QACjG,GAAG,CAAC,QAAQ,CAAC,OAAO;YAClB,CAAC,CAAC;gBACE,OAAO,EAAE;oBACP,0EAA0E;oBAC1E,mCAAmC;oBACnC,GAAG,QAAQ,CAAC,OAAO;oBACnB,GAAG,eAAe;iBACnB;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,QAAQ,CAAC,SAAS;YACpB,CAAC,CAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,SAAS,EAAkC;YACnE,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -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-rc.
|
|
13
|
+
const VERSION = '21.0.0-rc.1';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|