vitest 1.3.1 → 1.4.0
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/dist/browser.d.ts +1 -1
- package/dist/browser.js +1 -1
- package/dist/chunks/{integrations-globals.THajbSRg.js → integrations-globals.trMeEBob.js} +3 -3
- package/dist/chunks/{runtime-console.Iloo9fIt.js → runtime-console.tUKE_2UJ.js} +4 -4
- package/dist/chunks/{runtime-runBaseTests.9RbsHRbU.js → runtime-runBaseTests.SKlFOhuq.js} +6 -6
- package/dist/cli.js +4 -4
- package/dist/config.d.ts +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/environments.d.ts +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +2 -2
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -4
- package/dist/node.d.ts +2 -2
- package/dist/node.js +4 -4
- package/dist/{reporters-MmQN-57K.d.ts → reporters-P7C2ytIv.d.ts} +198 -166
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +3 -3
- package/dist/runners.d.ts +2 -1
- package/dist/runners.js +8 -3
- package/dist/{suite-UrZdHRff.d.ts → suite-a18diDsI.d.ts} +1 -1
- package/dist/suite.d.ts +2 -2
- package/dist/utils.d.ts +5 -0
- package/dist/utils.js +6 -0
- package/dist/vendor/{base.N3JkKp7j.js → base.Xt0Omgh7.js} +9 -3
- package/dist/vendor/{base.Z38YsPLm.js → base.nhvUBzQY.js} +2 -2
- package/dist/vendor/{cac.wWT9ELdg.js → cac.RvTIWZBK.js} +115 -68
- package/dist/vendor/{execute.27Kk4lQF.js → execute.2_yoIC01.js} +1 -1
- package/dist/vendor/{index.JZMafwT-.js → index.BeX1oZht.js} +1 -1
- package/dist/vendor/{index.9hqYxJUw.js → index.LNWuEnUT.js} +1 -1
- package/dist/vendor/{index.c1V_jzyZ.js → index.e9RDLAeW.js} +39 -21
- package/dist/vendor/{setup-common.snyQUvE3.js → setup-common.vyF1kALR.js} +1 -1
- package/dist/vendor/{utils.GbToHGHI.js → utils.w0xgzP1h.js} +15 -10
- package/dist/vendor/{vi.C5mroSoP.js → vi.JYQecGiw.js} +16 -1
- package/dist/vendor/{vm.o1IruPAo.js → vm.cAHVDF92.js} +2 -2
- package/dist/worker.js +20 -5
- package/dist/workers/forks.js +5 -5
- package/dist/workers/runVmTests.js +5 -5
- package/dist/workers/threads.js +4 -4
- package/dist/workers/vmForks.js +6 -6
- package/dist/workers/vmThreads.js +5 -5
- package/dist/workers.d.ts +6 -3
- package/dist/workers.js +6 -6
- package/package.json +10 -10
|
@@ -2,7 +2,7 @@ import { dirname, resolve, relative, normalize, join, basename, toNamespacedPath
|
|
|
2
2
|
import require$$0$3, { EventEmitter as EventEmitter$2 } from 'events';
|
|
3
3
|
import c from 'picocolors';
|
|
4
4
|
import { b as removeUndefinedValues, c as isWindows } from './index.ir9i0ywP.js';
|
|
5
|
-
import { f as Typechecker, R as ReportersMap, e as BenchmarkReportsMap, g as RandomSequencer, B as BaseSequencer, h as generateCodeFrame, i as highlightCode, j as divider, L as Logger, s as stripAnsi } from './index.
|
|
5
|
+
import { w as wrapSerializableConfig, f as Typechecker, R as ReportersMap, e as BenchmarkReportsMap, g as RandomSequencer, B as BaseSequencer, h as generateCodeFrame, i as highlightCode, j as divider, L as Logger, s as stripAnsi } from './index.e9RDLAeW.js';
|
|
6
6
|
import { A as API_PATH, c as configFiles, d as defaultPort, e as extraInlineDeps, a as defaultBrowserPort, E as EXIT_CODE_RESTART, w as workspacesFiles, C as CONFIG_NAMES } from './constants.K-Wf1PUy.js';
|
|
7
7
|
import { g as getCoverageProvider, C as CoverageProviderMap } from './coverage.E7sG1b3r.js';
|
|
8
8
|
import { g as getEnvPackageName } from './index.GVFv9dZ0.js';
|
|
@@ -32,7 +32,7 @@ import require$$4 from 'tls';
|
|
|
32
32
|
import require$$7 from 'url';
|
|
33
33
|
import { createDefer, toArray as toArray$1, notNullish } from '@vitest/utils';
|
|
34
34
|
import { parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
35
|
-
import { b as isPrimitive, c as groupBy, A as AggregateErrorPonyfill, a as slash$1, t as toArray, d as deepMerge,
|
|
35
|
+
import { n as noop$2, b as isPrimitive, c as groupBy, A as AggregateErrorPonyfill, a as slash$1, t as toArray, d as deepMerge, w as wildcardPatternToRegExp, e as stdout } from './base.Xt0Omgh7.js';
|
|
36
36
|
import v8 from 'node:v8';
|
|
37
37
|
import * as nodeos from 'node:os';
|
|
38
38
|
import nodeos__default from 'node:os';
|
|
@@ -728,7 +728,7 @@ class CAC extends EventEmitter$2 {
|
|
|
728
728
|
|
|
729
729
|
const cac = (name = "") => new CAC(name);
|
|
730
730
|
|
|
731
|
-
var version = "1.
|
|
731
|
+
var version = "1.4.0";
|
|
732
732
|
|
|
733
733
|
/*
|
|
734
734
|
How it works:
|
|
@@ -8327,6 +8327,13 @@ function setup(vitestOrWorkspace, _server) {
|
|
|
8327
8327
|
getConfig() {
|
|
8328
8328
|
return vitestOrWorkspace.config;
|
|
8329
8329
|
},
|
|
8330
|
+
async getBrowserFileSourceMap(id) {
|
|
8331
|
+
var _a2, _b;
|
|
8332
|
+
if (!("ctx" in vitestOrWorkspace))
|
|
8333
|
+
return void 0;
|
|
8334
|
+
const mod = (_a2 = vitestOrWorkspace.browser) == null ? void 0 : _a2.moduleGraph.getModuleById(id);
|
|
8335
|
+
return (_b = mod == null ? void 0 : mod.transformResult) == null ? void 0 : _b.map;
|
|
8336
|
+
},
|
|
8330
8337
|
async getTransformResult(id) {
|
|
8331
8338
|
const result = await ctx.vitenode.transformRequest(id);
|
|
8332
8339
|
if (result) {
|
|
@@ -8377,7 +8384,7 @@ function setup(vitestOrWorkspace, _server) {
|
|
|
8377
8384
|
{
|
|
8378
8385
|
post: (msg) => ws.send(msg),
|
|
8379
8386
|
on: (fn) => ws.on("message", fn),
|
|
8380
|
-
eventNames: ["onUserConsoleLog", "onFinished", "onFinishedReportCoverage", "onCollected", "onCancel"],
|
|
8387
|
+
eventNames: ["onUserConsoleLog", "onFinished", "onFinishedReportCoverage", "onCollected", "onCancel", "onTaskUpdate"],
|
|
8381
8388
|
serialize: (data) => stringify(data, stringifyReplace),
|
|
8382
8389
|
deserialize: parse$3,
|
|
8383
8390
|
onTimeoutError(functionName) {
|
|
@@ -8403,8 +8410,8 @@ class WebSocketReporter {
|
|
|
8403
8410
|
if (this.clients.size === 0)
|
|
8404
8411
|
return;
|
|
8405
8412
|
this.clients.forEach((client) => {
|
|
8406
|
-
var _a;
|
|
8407
|
-
(_a = client.onCollected) == null ? void 0 : _a.call(client, files);
|
|
8413
|
+
var _a, _b, _c;
|
|
8414
|
+
(_c = (_b = (_a = client.onCollected) == null ? void 0 : _a.call(client, files)) == null ? void 0 : _b.catch) == null ? void 0 : _c.call(_b, noop$2);
|
|
8408
8415
|
});
|
|
8409
8416
|
}
|
|
8410
8417
|
async onTaskUpdate(packs) {
|
|
@@ -8422,26 +8429,26 @@ class WebSocketReporter {
|
|
|
8422
8429
|
});
|
|
8423
8430
|
});
|
|
8424
8431
|
this.clients.forEach((client) => {
|
|
8425
|
-
var _a;
|
|
8426
|
-
(_a = client.onTaskUpdate) == null ? void 0 : _a.call(client, packs);
|
|
8432
|
+
var _a, _b, _c;
|
|
8433
|
+
(_c = (_b = (_a = client.onTaskUpdate) == null ? void 0 : _a.call(client, packs)) == null ? void 0 : _b.catch) == null ? void 0 : _c.call(_b, noop$2);
|
|
8427
8434
|
});
|
|
8428
8435
|
}
|
|
8429
8436
|
onFinished(files, errors) {
|
|
8430
8437
|
this.clients.forEach((client) => {
|
|
8431
|
-
var _a;
|
|
8432
|
-
(_a = client.onFinished) == null ? void 0 : _a.call(client, files, errors);
|
|
8438
|
+
var _a, _b, _c;
|
|
8439
|
+
(_c = (_b = (_a = client.onFinished) == null ? void 0 : _a.call(client, files, errors)) == null ? void 0 : _b.catch) == null ? void 0 : _c.call(_b, noop$2);
|
|
8433
8440
|
});
|
|
8434
8441
|
}
|
|
8435
8442
|
onFinishedReportCoverage() {
|
|
8436
8443
|
this.clients.forEach((client) => {
|
|
8437
|
-
var _a;
|
|
8438
|
-
(_a = client.onFinishedReportCoverage) == null ? void 0 : _a.call(client);
|
|
8444
|
+
var _a, _b, _c;
|
|
8445
|
+
(_c = (_b = (_a = client.onFinishedReportCoverage) == null ? void 0 : _a.call(client)) == null ? void 0 : _b.catch) == null ? void 0 : _c.call(_b, noop$2);
|
|
8439
8446
|
});
|
|
8440
8447
|
}
|
|
8441
8448
|
onUserConsoleLog(log) {
|
|
8442
8449
|
this.clients.forEach((client) => {
|
|
8443
|
-
var _a;
|
|
8444
|
-
(_a = client.onUserConsoleLog) == null ? void 0 : _a.call(client, log);
|
|
8450
|
+
var _a, _b, _c;
|
|
8451
|
+
(_c = (_b = (_a = client.onUserConsoleLog) == null ? void 0 : _a.call(client, log)) == null ? void 0 : _b.catch) == null ? void 0 : _c.call(_b, noop$2);
|
|
8445
8452
|
});
|
|
8446
8453
|
}
|
|
8447
8454
|
}
|
|
@@ -8586,11 +8593,6 @@ function createChildProcessChannel$1(project) {
|
|
|
8586
8593
|
project.ctx.onCancel((reason) => rpc.onCancel(reason));
|
|
8587
8594
|
return { channel, cleanup };
|
|
8588
8595
|
}
|
|
8589
|
-
function stringifyRegex$1(input) {
|
|
8590
|
-
if (typeof input === "string")
|
|
8591
|
-
return input;
|
|
8592
|
-
return `$$vitest:${input.toString()}`;
|
|
8593
|
-
}
|
|
8594
8596
|
function createForksPool(ctx, { execArgv, env }) {
|
|
8595
8597
|
var _a;
|
|
8596
8598
|
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length;
|
|
@@ -8657,11 +8659,7 @@ function createForksPool(ctx, { execArgv, env }) {
|
|
|
8657
8659
|
if (configs.has(project))
|
|
8658
8660
|
return configs.get(project);
|
|
8659
8661
|
const _config = project.getSerializableConfig();
|
|
8660
|
-
const config =
|
|
8661
|
-
..._config,
|
|
8662
|
-
// v8 serialize does not support regex
|
|
8663
|
-
testNamePattern: _config.testNamePattern ? stringifyRegex$1(_config.testNamePattern) : void 0
|
|
8664
|
-
};
|
|
8662
|
+
const config = wrapSerializableConfig(_config);
|
|
8665
8663
|
configs.set(project, config);
|
|
8666
8664
|
return config;
|
|
8667
8665
|
};
|
|
@@ -9242,11 +9240,6 @@ function createChildProcessChannel(project) {
|
|
|
9242
9240
|
project.ctx.onCancel((reason) => rpc.onCancel(reason));
|
|
9243
9241
|
return { channel, cleanup };
|
|
9244
9242
|
}
|
|
9245
|
-
function stringifyRegex(input) {
|
|
9246
|
-
if (typeof input === "string")
|
|
9247
|
-
return input;
|
|
9248
|
-
return `$$vitest:${input.toString()}`;
|
|
9249
|
-
}
|
|
9250
9243
|
function createVmForksPool(ctx, { execArgv, env }) {
|
|
9251
9244
|
var _a;
|
|
9252
9245
|
const numCpus = typeof nodeos.availableParallelism === "function" ? nodeos.availableParallelism() : nodeos.cpus().length;
|
|
@@ -9315,11 +9308,7 @@ function createVmForksPool(ctx, { execArgv, env }) {
|
|
|
9315
9308
|
if (configs.has(project))
|
|
9316
9309
|
return configs.get(project);
|
|
9317
9310
|
const _config = project.getSerializableConfig();
|
|
9318
|
-
const config =
|
|
9319
|
-
..._config,
|
|
9320
|
-
// v8 serialize does not support regex
|
|
9321
|
-
testNamePattern: _config.testNamePattern ? stringifyRegex(_config.testNamePattern) : void 0
|
|
9322
|
-
};
|
|
9311
|
+
const config = wrapSerializableConfig(_config);
|
|
9323
9312
|
configs.set(project, config);
|
|
9324
9313
|
return config;
|
|
9325
9314
|
};
|
|
@@ -9871,7 +9860,7 @@ class VitestCache {
|
|
|
9871
9860
|
return this.stats.getStats(key);
|
|
9872
9861
|
}
|
|
9873
9862
|
static resolveCacheDir(root, dir, projectName) {
|
|
9874
|
-
const baseDir = slash$1(dir || "node_modules/.vitest");
|
|
9863
|
+
const baseDir = slash$1(dir || "node_modules/.vite/vitest");
|
|
9875
9864
|
return projectName ? resolve(root, baseDir, crypto.createHash("md5").update(projectName, "utf-8").digest("hex")) : resolve(root, baseDir);
|
|
9876
9865
|
}
|
|
9877
9866
|
static async clearCache(options) {
|
|
@@ -9927,7 +9916,7 @@ function resolveApiServerConfig(options) {
|
|
|
9927
9916
|
return api;
|
|
9928
9917
|
}
|
|
9929
9918
|
function resolveConfig(mode, options, viteConfig) {
|
|
9930
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
|
|
9919
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K;
|
|
9931
9920
|
if (options.dom) {
|
|
9932
9921
|
if (((_a = viteConfig.test) == null ? void 0 : _a.environment) != null && viteConfig.test.environment !== "happy-dom") {
|
|
9933
9922
|
console.warn(
|
|
@@ -9948,6 +9937,7 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
9948
9937
|
resolved.inspectBrk = Boolean(resolved.inspectBrk);
|
|
9949
9938
|
if (viteConfig.base !== "/")
|
|
9950
9939
|
resolved.base = viteConfig.base;
|
|
9940
|
+
resolved.clearScreen = resolved.clearScreen ?? viteConfig.clearScreen ?? true;
|
|
9951
9941
|
if (options.shard) {
|
|
9952
9942
|
if (resolved.watch)
|
|
9953
9943
|
throw new Error("You cannot use --shard option with enabled watch");
|
|
@@ -9981,6 +9971,11 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
9981
9971
|
throw new Error('"coverage.provider: c8" is not supported anymore. Use "coverage.provider: v8" instead');
|
|
9982
9972
|
if (resolved.coverage.provider === "v8" && resolved.coverage.enabled && isBrowserEnabled(resolved))
|
|
9983
9973
|
throw new Error("@vitest/coverage-v8 does not work with --browser. Use @vitest/coverage-istanbul instead");
|
|
9974
|
+
if (resolved.coverage.enabled && resolved.coverage.reportsDirectory) {
|
|
9975
|
+
const reportsDirectory = resolve(resolved.root, resolved.coverage.reportsDirectory);
|
|
9976
|
+
if (reportsDirectory === resolved.root || reportsDirectory === process.cwd())
|
|
9977
|
+
throw new Error(`You cannot set "coverage.reportsDirectory" as ${reportsDirectory}. Vitest needs to be able to remove this directory before test run`);
|
|
9978
|
+
}
|
|
9984
9979
|
resolved.deps ?? (resolved.deps = {});
|
|
9985
9980
|
(_f = resolved.deps).moduleDirectories ?? (_f.moduleDirectories = []);
|
|
9986
9981
|
resolved.deps.moduleDirectories = resolved.deps.moduleDirectories.map((dir) => {
|
|
@@ -10197,30 +10192,44 @@ function resolveConfig(mode, options, viteConfig) {
|
|
|
10197
10192
|
(_A = resolved.css).modules ?? (_A.modules = {});
|
|
10198
10193
|
(_B = resolved.css.modules).classNameStrategy ?? (_B.classNameStrategy = "stable");
|
|
10199
10194
|
}
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
resolved.cache
|
|
10195
|
+
if (resolved.cache !== false) {
|
|
10196
|
+
let cacheDir = VitestCache.resolveCacheDir("", resolve(viteConfig.cacheDir, "vitest"), resolved.name);
|
|
10197
|
+
if (resolved.cache && resolved.cache.dir) {
|
|
10198
|
+
console.warn(
|
|
10199
|
+
c.yellow(
|
|
10200
|
+
`${c.inverse(c.yellow(" Vitest "))} "cache.dir" is deprecated, use Vite's "cacheDir" instead if you want to change the cache director. Note caches will be written to "cacheDir/vitest"`
|
|
10201
|
+
)
|
|
10202
|
+
);
|
|
10203
|
+
cacheDir = VitestCache.resolveCacheDir(resolved.root, resolved.cache.dir, resolved.name);
|
|
10204
|
+
}
|
|
10205
|
+
resolved.cache = { dir: cacheDir };
|
|
10206
|
+
}
|
|
10203
10207
|
resolved.sequence ?? (resolved.sequence = {});
|
|
10204
|
-
if (
|
|
10208
|
+
if (resolved.sequence.shuffle && typeof resolved.sequence.shuffle === "object") {
|
|
10209
|
+
const { files, tests } = resolved.sequence.shuffle;
|
|
10210
|
+
(_C = resolved.sequence).sequencer ?? (_C.sequencer = files ? RandomSequencer : BaseSequencer);
|
|
10211
|
+
resolved.sequence.shuffle = tests;
|
|
10212
|
+
}
|
|
10213
|
+
if (!((_D = resolved.sequence) == null ? void 0 : _D.sequencer)) {
|
|
10205
10214
|
resolved.sequence.sequencer = resolved.sequence.shuffle ? RandomSequencer : BaseSequencer;
|
|
10206
10215
|
}
|
|
10207
|
-
(
|
|
10216
|
+
(_E = resolved.sequence).hooks ?? (_E.hooks = "parallel");
|
|
10208
10217
|
if (resolved.sequence.sequencer === RandomSequencer)
|
|
10209
|
-
(
|
|
10218
|
+
(_F = resolved.sequence).seed ?? (_F.seed = Date.now());
|
|
10210
10219
|
resolved.typecheck = {
|
|
10211
10220
|
...configDefaults.typecheck,
|
|
10212
10221
|
...resolved.typecheck
|
|
10213
10222
|
};
|
|
10214
10223
|
resolved.environmentMatchGlobs = (resolved.environmentMatchGlobs || []).map((i) => [resolve(resolved.root, i[0]), i[1]]);
|
|
10215
10224
|
resolved.typecheck ?? (resolved.typecheck = {});
|
|
10216
|
-
(
|
|
10225
|
+
(_G = resolved.typecheck).enabled ?? (_G.enabled = false);
|
|
10217
10226
|
if (resolved.typecheck.enabled)
|
|
10218
10227
|
console.warn(c.yellow("Testing types with tsc and vue-tsc is an experimental feature.\nBreaking changes might not follow SemVer, please pin Vitest's version when using it."));
|
|
10219
10228
|
resolved.browser ?? (resolved.browser = {});
|
|
10220
|
-
(
|
|
10221
|
-
(
|
|
10222
|
-
(
|
|
10223
|
-
(
|
|
10229
|
+
(_H = resolved.browser).enabled ?? (_H.enabled = false);
|
|
10230
|
+
(_I = resolved.browser).headless ?? (_I.headless = isCI);
|
|
10231
|
+
(_J = resolved.browser).slowHijackESM ?? (_J.slowHijackESM = false);
|
|
10232
|
+
(_K = resolved.browser).isolate ?? (_K.isolate = true);
|
|
10224
10233
|
if (resolved.browser.enabled && provider$1 === "stackblitz")
|
|
10225
10234
|
resolved.browser.provider = "none";
|
|
10226
10235
|
resolved.browser.api = resolveApiServerConfig(resolved.browser) || {
|
|
@@ -11188,7 +11197,14 @@ ${c.red(divider(c.bold(c.inverse(" Error during global setup "))))}`);
|
|
|
11188
11197
|
return project;
|
|
11189
11198
|
}
|
|
11190
11199
|
async setServer(options, server) {
|
|
11191
|
-
this.config = resolveConfig(
|
|
11200
|
+
this.config = resolveConfig(
|
|
11201
|
+
this.ctx.mode,
|
|
11202
|
+
{
|
|
11203
|
+
...options,
|
|
11204
|
+
coverage: this.ctx.config.coverage
|
|
11205
|
+
},
|
|
11206
|
+
server.config
|
|
11207
|
+
);
|
|
11192
11208
|
this.server = server;
|
|
11193
11209
|
this.vitenode = new ViteNodeServer(server, this.config.server);
|
|
11194
11210
|
const node = this.vitenode;
|
|
@@ -11214,7 +11230,6 @@ ${c.red(divider(c.bold(c.inverse(" Error during global setup "))))}`);
|
|
|
11214
11230
|
const isolate = (_d = (_c = (_b = this.server) == null ? void 0 : _b.config) == null ? void 0 : _c.test) == null ? void 0 : _d.isolate;
|
|
11215
11231
|
return deepMerge({
|
|
11216
11232
|
...this.config,
|
|
11217
|
-
coverage: this.ctx.config.coverage,
|
|
11218
11233
|
poolOptions: {
|
|
11219
11234
|
forks: {
|
|
11220
11235
|
singleFork: ((_e = poolOptions == null ? void 0 : poolOptions.forks) == null ? void 0 : _e.singleFork) ?? ((_g = (_f = this.ctx.config.poolOptions) == null ? void 0 : _f.forks) == null ? void 0 : _g.singleFork) ?? false,
|
|
@@ -11257,7 +11272,8 @@ ${c.red(divider(c.bold(c.inverse(" Error during global setup "))))}`);
|
|
|
11257
11272
|
},
|
|
11258
11273
|
inspect: this.ctx.config.inspect,
|
|
11259
11274
|
inspectBrk: this.ctx.config.inspectBrk,
|
|
11260
|
-
alias: []
|
|
11275
|
+
alias: [],
|
|
11276
|
+
includeTaskLocation: this.config.includeTaskLocation ?? this.ctx.config.includeTaskLocation
|
|
11261
11277
|
}, this.ctx.configOverride || {});
|
|
11262
11278
|
}
|
|
11263
11279
|
close() {
|
|
@@ -11343,12 +11359,12 @@ class Vitest {
|
|
|
11343
11359
|
cache = void 0;
|
|
11344
11360
|
reporters = void 0;
|
|
11345
11361
|
coverageProvider;
|
|
11346
|
-
browserProvider;
|
|
11347
11362
|
logger;
|
|
11348
11363
|
pool;
|
|
11349
11364
|
vitenode = void 0;
|
|
11350
11365
|
invalidates = /* @__PURE__ */ new Set();
|
|
11351
11366
|
changedTests = /* @__PURE__ */ new Set();
|
|
11367
|
+
watchedTests = /* @__PURE__ */ new Set();
|
|
11352
11368
|
filenamePattern;
|
|
11353
11369
|
runningPromise;
|
|
11354
11370
|
closingPromise;
|
|
@@ -11426,11 +11442,14 @@ class Vitest {
|
|
|
11426
11442
|
}
|
|
11427
11443
|
await Promise.all(this._onSetServer.map((fn) => fn()));
|
|
11428
11444
|
const projects = await this.resolveWorkspace(cliOptions);
|
|
11429
|
-
this.projects = projects;
|
|
11430
11445
|
this.resolvedProjects = projects;
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11446
|
+
this.projects = projects;
|
|
11447
|
+
const filters = toArray(resolved.project).map((s) => wildcardPatternToRegExp(s));
|
|
11448
|
+
if (filters.length > 0) {
|
|
11449
|
+
this.projects = this.projects.filter(
|
|
11450
|
+
(p) => filters.some((pattern) => pattern.test(p.getName()))
|
|
11451
|
+
);
|
|
11452
|
+
}
|
|
11434
11453
|
if (!this.coreWorkspaceProject)
|
|
11435
11454
|
this.coreWorkspaceProject = WorkspaceProject.createBasicProject(this);
|
|
11436
11455
|
if (this.config.testNamePattern)
|
|
@@ -11597,8 +11616,6 @@ class Vitest {
|
|
|
11597
11616
|
process.exit(exitCode);
|
|
11598
11617
|
}
|
|
11599
11618
|
}
|
|
11600
|
-
this.config.changed = false;
|
|
11601
|
-
this.config.related = void 0;
|
|
11602
11619
|
if (files.length) {
|
|
11603
11620
|
await this.cache.stats.populateStats(this.config.root, files);
|
|
11604
11621
|
await this.runFiles(files, true);
|
|
@@ -11709,6 +11726,8 @@ class Vitest {
|
|
|
11709
11726
|
await this.reportCoverage(allTestsRun);
|
|
11710
11727
|
this.runningPromise = void 0;
|
|
11711
11728
|
this.isFirstRun = false;
|
|
11729
|
+
this.config.changed = false;
|
|
11730
|
+
this.config.related = void 0;
|
|
11712
11731
|
});
|
|
11713
11732
|
return await this.runningPromise;
|
|
11714
11733
|
}
|
|
@@ -11774,6 +11793,12 @@ class Vitest {
|
|
|
11774
11793
|
if (this.restartsCount !== currentCount)
|
|
11775
11794
|
return;
|
|
11776
11795
|
this._rerunTimer = setTimeout(async () => {
|
|
11796
|
+
if (this.watchedTests.size) {
|
|
11797
|
+
this.changedTests.forEach((test) => {
|
|
11798
|
+
if (!this.watchedTests.has(test))
|
|
11799
|
+
this.changedTests.delete(test);
|
|
11800
|
+
});
|
|
11801
|
+
}
|
|
11777
11802
|
if (this.changedTests.size === 0) {
|
|
11778
11803
|
this.invalidates.clear();
|
|
11779
11804
|
return;
|
|
@@ -11802,6 +11827,14 @@ class Vitest {
|
|
|
11802
11827
|
return project.getModulesByFilepath(filepath).size;
|
|
11803
11828
|
});
|
|
11804
11829
|
}
|
|
11830
|
+
/**
|
|
11831
|
+
* Watch only the specified tests. If no tests are provided, all tests will be watched.
|
|
11832
|
+
*/
|
|
11833
|
+
watchTests(tests) {
|
|
11834
|
+
this.watchedTests = new Set(
|
|
11835
|
+
tests.map((test) => slash$1(test))
|
|
11836
|
+
);
|
|
11837
|
+
}
|
|
11805
11838
|
unregisterWatcher = noop$2;
|
|
11806
11839
|
registerWatcher() {
|
|
11807
11840
|
const updateLastChanged = (filepath) => {
|
|
@@ -11945,6 +11978,7 @@ class Vitest {
|
|
|
11945
11978
|
results.filter((r) => r.status === "rejected").forEach((err) => {
|
|
11946
11979
|
this.logger.error("error during close", err.reason);
|
|
11947
11980
|
});
|
|
11981
|
+
this.logger.logUpdate.done();
|
|
11948
11982
|
});
|
|
11949
11983
|
})();
|
|
11950
11984
|
}
|
|
@@ -12041,8 +12075,8 @@ async function VitestPlugin(options = {}, ctx = new Vitest("test")) {
|
|
|
12041
12075
|
const testConfig = deepMerge(
|
|
12042
12076
|
{},
|
|
12043
12077
|
configDefaults,
|
|
12044
|
-
|
|
12045
|
-
|
|
12078
|
+
removeUndefinedValues(viteConfig.test ?? {}),
|
|
12079
|
+
options
|
|
12046
12080
|
);
|
|
12047
12081
|
testConfig.api = resolveApiServerConfig(testConfig);
|
|
12048
12082
|
const defines = deleteDefineConfig(viteConfig);
|
|
@@ -19190,7 +19224,16 @@ const cliOptionsConfig = {
|
|
|
19190
19224
|
argument: "<options>",
|
|
19191
19225
|
subcommands: {
|
|
19192
19226
|
shuffle: {
|
|
19193
|
-
description: "Run tests in a random order. Enabling this option will impact Vitest's cache and have a performance impact. May be useful to find tests that accidentally depend on another run previously (default: false)"
|
|
19227
|
+
description: "Run files and tests in a random order. Enabling this option will impact Vitest's cache and have a performance impact. May be useful to find tests that accidentally depend on another run previously (default: false)",
|
|
19228
|
+
argument: "",
|
|
19229
|
+
subcommands: {
|
|
19230
|
+
files: {
|
|
19231
|
+
description: "Run files in a random order. Long running tests will not start earlier if you enable this option. (default: false)"
|
|
19232
|
+
},
|
|
19233
|
+
tests: {
|
|
19234
|
+
description: "Run tests in a random oder (default: false)"
|
|
19235
|
+
}
|
|
19236
|
+
}
|
|
19194
19237
|
},
|
|
19195
19238
|
concurrent: {
|
|
19196
19239
|
description: "Make tests run in parallel (default: false)"
|
|
@@ -19279,8 +19322,9 @@ const cliOptionsConfig = {
|
|
|
19279
19322
|
}
|
|
19280
19323
|
},
|
|
19281
19324
|
project: {
|
|
19282
|
-
description: "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2",
|
|
19283
|
-
argument: "<name>"
|
|
19325
|
+
description: "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2. You can also filter projects using wildcards like --project=packages*",
|
|
19326
|
+
argument: "<name>",
|
|
19327
|
+
array: true
|
|
19284
19328
|
},
|
|
19285
19329
|
slowTestThreshold: {
|
|
19286
19330
|
description: "Threshold in milliseconds for a test to be considered slow (default: 300)",
|
|
@@ -19295,14 +19339,13 @@ const cliOptionsConfig = {
|
|
|
19295
19339
|
argument: "",
|
|
19296
19340
|
// allow only boolean
|
|
19297
19341
|
subcommands: {
|
|
19298
|
-
dir:
|
|
19299
|
-
description: "Path to the cache directory",
|
|
19300
|
-
argument: "<path>",
|
|
19301
|
-
normalize: true
|
|
19302
|
-
}
|
|
19342
|
+
dir: null
|
|
19303
19343
|
},
|
|
19344
|
+
default: true,
|
|
19304
19345
|
// cache can only be "false" or an object
|
|
19305
19346
|
transform(cache) {
|
|
19347
|
+
if (typeof cache !== "boolean" && cache)
|
|
19348
|
+
throw new Error("--cache.dir is deprecated");
|
|
19306
19349
|
if (cache)
|
|
19307
19350
|
return {};
|
|
19308
19351
|
return cache;
|
|
@@ -19325,6 +19368,9 @@ const cliOptionsConfig = {
|
|
|
19325
19368
|
description: "Removes colors from the console output",
|
|
19326
19369
|
alias: "no-color"
|
|
19327
19370
|
},
|
|
19371
|
+
clearScreen: {
|
|
19372
|
+
description: "Clear terminal screen when re-running tests during watch mode (default: true)"
|
|
19373
|
+
},
|
|
19328
19374
|
// disable CLI options
|
|
19329
19375
|
cliExclude: null,
|
|
19330
19376
|
server: null,
|
|
@@ -19355,7 +19401,8 @@ const cliOptionsConfig = {
|
|
|
19355
19401
|
css: null,
|
|
19356
19402
|
poolMatchGlobs: null,
|
|
19357
19403
|
deps: null,
|
|
19358
|
-
name: null
|
|
19404
|
+
name: null,
|
|
19405
|
+
includeTaskLocation: null
|
|
19359
19406
|
};
|
|
19360
19407
|
|
|
19361
19408
|
function addCommand(cli, name, option) {
|
|
@@ -7,7 +7,7 @@ import { processError } from '@vitest/utils/error';
|
|
|
7
7
|
import { distDir } from '../path.js';
|
|
8
8
|
import { existsSync, readdirSync } from 'node:fs';
|
|
9
9
|
import { highlight, getType } from '@vitest/utils';
|
|
10
|
-
import { g as getAllMockableProperties } from './base.
|
|
10
|
+
import { g as getAllMockableProperties } from './base.Xt0Omgh7.js';
|
|
11
11
|
|
|
12
12
|
const spyModulePath = resolve(distDir, "spy.js");
|
|
13
13
|
class RefTracker {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { afterAll, afterEach, beforeAll, beforeEach, describe, it, onTestFailed, onTestFinished, suite, test } from '@vitest/runner';
|
|
2
2
|
import { b as bench } from './benchmark.eeqk2rd8.js';
|
|
3
3
|
import { i as isFirstRun, a as runOnce } from './run-once.Olz_Zkd8.js';
|
|
4
|
-
import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.
|
|
4
|
+
import { c as createExpect, a as globalExpect, v as vi, b as vitest } from './vi.JYQecGiw.js';
|
|
5
5
|
import { g as getWorkerState } from './global.CkGT_TMy.js';
|
|
6
6
|
import * as chai from 'chai';
|
|
7
7
|
import { assert, should } from 'chai';
|
|
@@ -5,7 +5,7 @@ import { distDir } from '../path.js';
|
|
|
5
5
|
import { g as getWorkerState } from './global.CkGT_TMy.js';
|
|
6
6
|
import { r as rpc } from './rpc.joBhAkyK.js';
|
|
7
7
|
import { t as takeCoverageInsideWorker } from './coverage.E7sG1b3r.js';
|
|
8
|
-
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.
|
|
8
|
+
import { l as loadDiffConfig, a as loadSnapshotSerializers } from './setup-common.vyF1kALR.js';
|
|
9
9
|
|
|
10
10
|
function setupChaiConfig(config) {
|
|
11
11
|
Object.assign(chai.config, config);
|
|
@@ -5,8 +5,8 @@ import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes,
|
|
|
5
5
|
import c from 'picocolors';
|
|
6
6
|
import { getSafeTimers, notNullish, inspect, positionToOffset, lineSplitRE, highlight, shuffle } from '@vitest/utils';
|
|
7
7
|
import { performance } from 'node:perf_hooks';
|
|
8
|
-
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.
|
|
9
|
-
import { a as slash, t as toArray, b as isPrimitive } from './base.
|
|
8
|
+
import { UNKNOWN_TEST_ID } from '../chunks/runtime-console.tUKE_2UJ.js';
|
|
9
|
+
import { a as slash, t as toArray, b as isPrimitive } from './base.Xt0Omgh7.js';
|
|
10
10
|
import { g as getFullName, h as hasFailedSnapshot } from './tasks.IknbGB2n.js';
|
|
11
11
|
import { isCI } from 'std-env';
|
|
12
12
|
import { TraceMap, generatedPositionFor, parseErrorStacktrace } from '@vitest/utils/source-map';
|
|
@@ -221,11 +221,33 @@ function formatProjectName(name, suffix = " ") {
|
|
|
221
221
|
return colors[index % colors.length](`|${name}|`) + suffix;
|
|
222
222
|
}
|
|
223
223
|
|
|
224
|
+
const REGEXP_WRAP_PREFIX = "$$vitest:";
|
|
225
|
+
function getOutputFile(config, reporter) {
|
|
226
|
+
if (!(config == null ? void 0 : config.outputFile))
|
|
227
|
+
return;
|
|
228
|
+
if (typeof config.outputFile === "string")
|
|
229
|
+
return config.outputFile;
|
|
230
|
+
return config.outputFile[reporter];
|
|
231
|
+
}
|
|
232
|
+
function wrapSerializableConfig(config) {
|
|
233
|
+
let testNamePattern = config.testNamePattern;
|
|
234
|
+
let defines = config.defines;
|
|
235
|
+
if (testNamePattern && typeof testNamePattern !== "string")
|
|
236
|
+
testNamePattern = `${REGEXP_WRAP_PREFIX}${testNamePattern.toString()}`;
|
|
237
|
+
if (defines)
|
|
238
|
+
defines = { keys: Object.keys(defines), original: defines };
|
|
239
|
+
return {
|
|
240
|
+
...config,
|
|
241
|
+
testNamePattern,
|
|
242
|
+
defines
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
|
|
224
246
|
const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_$1="ERR_INVALID_PACKAGE_CONFIG",E$1="ERR_INVALID_PACKAGE_TARGET",I$1="ERR_PACKAGE_PATH_NOT_EXPORTED",R$1=/^\d+$/,O=/^(\.{1,2}|node_modules)$/i,w=/\/|\\/;var h$1=(r=>(r.Export="exports",r.Import="imports",r))(h$1||{});const f=(r,t,e,o,c)=>{if(t==null)return [];if(typeof t=="string"){const[n,...i]=t.split(w);if(n===".."||i.some(l=>O.test(l)))throw a(E$1,`Invalid "${r}" target "${t}" defined in the package config`);return [c?t.replace(/\*/g,c):t]}if(Array.isArray(t))return t.flatMap(n=>f(r,n,e,o,c));if(A(t)){for(const n of Object.keys(t)){if(R$1.test(n))throw a(_$1,"Cannot contain numeric property keys");if(n==="default"||o.includes(n))return f(r,t[n],e,o,c)}return []}throw a(E$1,`Invalid "${r}" target "${t}"`)},s="*",m=(r,t)=>{const e=r.indexOf(s),o=t.indexOf(s);return e===o?t.length>r.length:o>e};function d(r,t){if(!t.includes(s)&&r.hasOwnProperty(t))return [t];let e,o;for(const c of Object.keys(r))if(c.includes(s)){const[n,i,l]=c.split(s);if(l===void 0&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||void 0);g&&(!e||m(e,c))&&(e=c,o=g);}}return [e,o]}const p=r=>Object.keys(r).reduce((t,e)=>{const o=e===""||e[0]!==".";if(t===void 0||t===o)return o;throw a(_$1,'"exports" cannot contain some keys starting with "." and some not')},void 0),u=/^\w+:/,v=(r,t,e)=>{if(!r)throw new Error('"exports" is required');t=t===""?".":`./${t}`,(typeof r=="string"||Array.isArray(r)||A(r)&&p(r))&&(r={".":r});const[o,c]=d(r,t),n=f(h$1.Export,r[o],t,e,c);if(n.length===0)throw a(I$1,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of n)if(!i.startsWith("./")&&!u.test(i))throw a(E$1,`Invalid "exports" target "${i}" defined in the package config`);return n};
|
|
225
247
|
|
|
226
|
-
function B(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}const x=e=>{const o=require$$0[e];return
|
|
227
|
-
`;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:const O=L(4,!0);O>=0?u+=String.fromCharCode(O):c=4;break;default:c=5;}g=n;continue}if(f>=0&&f<=31)if(_(f)){u+=e.substring(g,n),c=2;break}else c=6;n++;}return u}function
|
|
228
|
-
`),m++,b=n,s=14;switch(u){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,t=k(),s=10;case 47:const g=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<i&&!_(e.charCodeAt(n));)n++;return t=e.substring(g,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;const f=i-1;let $=!1;for(;n<f;){const O=e.charCodeAt(n);if(O===42&&e.charCodeAt(n+1)===47){n+=2,$=!0;break}n++,_(O)&&(O===13&&e.charCodeAt(n)===10&&n++,m++,b=n);}return $||(n++,c=1),t=e.substring(g,n),s=13}return t+=String.fromCharCode(u),n++,s=16;case 45:if(t+=String.fromCharCode(u),n++,n===i||!N(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return t+=w(),s=11;default:for(;n<i&&U(u);)n++,u=e.charCodeAt(n);if(l!==n){switch(t=e.substring(l,n),t){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return t+=String.fromCharCode(u),n++,s=16}}function U(u){if(J(u)||_(u))return !1;switch(u){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return !1}return !0}function F(){let u;do u=A();while(u>=12&&u<=15);return u}return {setPosition:T,getPosition:()=>n,scan:o?F:A,getToken:()=>s,getTokenValue:()=>t,getTokenOffset:()=>l,getTokenLength:()=>n-l,getTokenStartLine:()=>r,getTokenStartCharacter:()=>l-v,getTokenError:()=>c}}function J(e){return e===32||e===9}function _(e){return e===10||e===13}function N(e){return e>=48&&e<=57}var q;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab";})(q||(q={}));var I;(function(e){e.DEFAULT={allowTrailingComma:!1};})(I||(I={}));function Te(e,o=[],i=I.DEFAULT){let n=null,t=[];const l=[];function s(r){Array.isArray(t)?t.push(r):n!==null&&(t[n]=r);}return we(e,{onObjectBegin:()=>{const r={};s(r),l.push(t),t=r,n=null;},onObjectProperty:r=>{n=r;},onObjectEnd:()=>{t=l.pop();},onArrayBegin:()=>{const r=[];s(r),l.push(t),t=r,n=null;},onArrayEnd:()=>{t=l.pop();},onLiteralValue:s,onError:(r,b,v)=>{o.push({error:r,offset:b,length:v});}},i),t[0]}function we(e,o,i=I.DEFAULT){const n=be(e,!1),t=[];function l(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function s(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}function m(a){return a?j=>a(j,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function r(a){return a?j=>a(j,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}const b=s(o.onObjectBegin),v=r(o.onObjectProperty),c=l(o.onObjectEnd),L=s(o.onArrayBegin),T=l(o.onArrayEnd),w=r(o.onLiteralValue),k=m(o.onSeparator),A=l(o.onComment),U=m(o.onError),F=i&&i.disallowComments,u=i&&i.allowTrailingComma;function g(){for(;;){const a=n.scan();switch(n.getTokenError()){case 4:f(14);break;case 5:f(15);break;case 3:f(13);break;case 1:F||f(11);break;case 2:f(12);break;case 6:f(16);break}switch(a){case 12:case 13:F?f(10):A();break;case 16:f(1);break;case 15:case 14:break;default:return a}}}function f(a,j=[],Y=[]){if(U(a),j.length+Y.length>0){let y=n.getToken();for(;y!==17;){if(j.indexOf(y)!==-1){g();break}else if(Y.indexOf(y)!==-1)break;y=g();}}}function $(a){const j=n.getTokenValue();return a?w(j):(v(j),t.push(j)),g(),!0}function O(){switch(n.getToken()){case 11:const a=n.getTokenValue();let j=Number(a);isNaN(j)&&(f(2),j=0),w(j);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return !1}return g(),!0}function ce(){return n.getToken()!==10?(f(3,[],[2,5]),!1):($(!1),n.getToken()===6?(k(":"),g(),V()||f(4,[],[2,5])):f(5,[],[2,5]),t.pop(),!0)}function fe(){b(),g();let a=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(a||f(4,[],[]),k(","),g(),n.getToken()===2&&u)break}else a&&f(6,[],[]);ce()||f(4,[],[2,5]),a=!0;}return c(),n.getToken()!==2?f(7,[2],[]):g(),!0}function pe(){L(),g();let a=!0,j=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(j||f(4,[],[]),k(","),g(),n.getToken()===4&&u)break}else j&&f(6,[],[]);a?(t.push(0),a=!1):t[t.length-1]++,V()||f(4,[],[4,5]),j=!0;}return T(),a||t.pop(),n.getToken()!==4?f(8,[4],[]):g(),!0}function V(){switch(n.getToken()){case 3:return pe();case 1:return fe();case 10:return $(!0);default:return O()}}return g(),n.getToken()===17?i.allowEmptyContent?!0:(f(4,[],[]),!1):V()?(n.getToken()!==17&&f(9,[],[]),!0):(f(4,[],[]),!1)}var K;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter";})(K||(K={}));var C;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF";})(C||(C={}));const ve=Te;var ee;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter";})(ee||(ee={}));const ne=(e,o)=>ve(ke(o,e,"utf8")),M=Symbol("implicitBaseUrl"),Oe=()=>{const{findPnpApi:e}=ge;return e&&e(process.cwd())},R=(e,o,i,n)=>{const t=`resolveFromPackageJsonPath:${e}:${o}:${i}`;if(n!=null&&n.has(t))return n.get(t);const l=ne(e,n);if(!l)return;let s=o||"tsconfig.json";if(!i&&l.exports)try{const[m]=v(l.exports,o,["require","types"]);s=m;}catch{return !1}else !o&&l.tsconfig&&(s=l.tsconfig);return s=p$1.join(e,"..",s),n==null||n.set(t,s),s},G="package.json",z="tsconfig.json",je=(e,o,i)=>{let n=e;if(e===".."&&(n=p$1.join(n,z)),e[0]==="."&&(n=p$1.resolve(o,n)),p$1.isAbsolute(n)){if(E(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const T=`${n}.json`;if(E(i,T))return T}return}const[t,...l]=e.split("/"),s=t[0]==="@"?`${t}/${l.shift()}`:t,m=l.join("/"),r=Oe();if(r){const{resolveRequest:T}=r;try{if(s===e){const w=T(p$1.join(s,G),o);if(w){const k=R(w,m,!1,i);if(k&&E(i,k))return k}}else {let w;try{w=T(e,o,{extensions:[".json"]});}catch{w=T(p$1.join(e,z),o);}if(w)return w}}catch{}}const b=Z(o,p$1.join("node_modules",s),i);if(!b||!P(i,b).isDirectory())return;const v=p$1.join(b,G);if(E(i,v)){const T=R(v,m,!1,i);if(T===!1)return;if(T&&E(i,T)&&P(i,T).isFile())return T}const c=p$1.join(b,m),L=c.endsWith(".json");if(!L){const T=`${c}.json`;if(E(i,T))return T}if(E(i,c)){if(P(i,c).isDirectory()){const T=p$1.join(c,G);if(E(i,T)){const k=R(T,"",!0,i);if(k&&E(i,k))return k}const w=p$1.join(c,z);if(E(i,w))return w}else if(L)return c}},Ae=(e,o,i,n)=>{const t=je(e,o,n);if(!t)throw new Error(`File '${e}' not found.`);if(i.has(t))throw new Error(`Circularity detected while resolving configuration: ${t}`);i.add(t);const l=p$1.dirname(t),s=te(t,n,i);delete s.references;const{compilerOptions:m}=s;if(m){const r=["baseUrl","outDir"];for(const b of r){const v=m[b];v&&(m[b]=B(p$1.relative(o,p$1.join(l,v)))||"./");}}return s.files&&(s.files=s.files.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.include&&(s.include=s.include.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.exclude&&(s.exclude=s.exclude.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s},te=(e,o,i=new Set)=>{let n;try{n=ae(o,e);}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}let t=ne(n,o)||{};if(typeof t!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const l=p$1.dirname(n);if(t.compilerOptions){const{compilerOptions:s}=t;s.paths&&!s.baseUrl&&(s[M]=l);}if(t.extends){const s=Array.isArray(t.extends)?t.extends:[t.extends];delete t.extends;for(const m of s.reverse()){const r=Ae(m,l,i,o),b={...r,...t,compilerOptions:{...r.compilerOptions,...t.compilerOptions}};r.watchOptions&&(b.watchOptions={...r.watchOptions,...t.watchOptions}),t=b;}}if(t.compilerOptions){const{compilerOptions:s}=t,m=["baseUrl","rootDir"];for(const b of m){const v=s[b];if(v){const c=p$1.resolve(l,v),L=W(p$1.relative(l,c));s[b]=L;}}const{outDir:r}=s;r&&(Array.isArray(t.exclude)||(t.exclude=[]),t.exclude.includes(r)||t.exclude.push(r),s.outDir=W(r));}else t.compilerOptions={};if(t.files&&(t.files=t.files.map(W)),t.include&&(t.include=t.include.map(B)),t.watchOptions){const{watchOptions:s}=t;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(m=>B(p$1.resolve(l,m))));}return t},ie=(e,o=new Map)=>te(e,o),$e=(e=process.cwd(),o="tsconfig.json",i=new Map)=>{const n=Z(B(e),o,i);if(!n)return null;const t=ie(n,i);return {path:n,config:t}};p$1.posix;process.platform==="win32";
|
|
248
|
+
function B(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}const x=e=>{const o=require$$0[e];return (i,...n)=>{const t=`${e}:${n.join(":")}`;let l=i==null?void 0:i.get(t);return l===void 0&&(l=Reflect.apply(o,require$$0,n),i==null||i.set(t,l)),l}},E=x("existsSync"),ae=x("realpathSync"),ke=x("readFileSync"),P=x("statSync"),Z=(e,o,i)=>{for(;;){const n=p$1.posix.join(e,o);if(E(i,n))return n;const t=p$1.dirname(e);if(t===e)return;e=t;}},h=/^\.{1,2}(\/.*)?$/,W=e=>{const o=B(e);return h.test(o)?o:`./${o}`};function be(e,o=!1){const i=e.length;let n=0,t="",l=0,s=16,m=0,r=0,b=0,v=0,c=0;function L(u,g){let f=0,$=0;for(;f<u||!g;){let O=e.charCodeAt(n);if(O>=48&&O<=57)$=$*16+O-48;else if(O>=65&&O<=70)$=$*16+O-65+10;else if(O>=97&&O<=102)$=$*16+O-97+10;else break;n++,f++;}return f<u&&($=-1),$}function T(u){n=u,t="",l=0,s=16,c=0;}function w(){let u=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&N(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&N(e.charCodeAt(n)))for(n++;n<e.length&&N(e.charCodeAt(n));)n++;else return c=3,e.substring(u,n);let g=n;if(n<e.length&&(e.charCodeAt(n)===69||e.charCodeAt(n)===101))if(n++,(n<e.length&&e.charCodeAt(n)===43||e.charCodeAt(n)===45)&&n++,n<e.length&&N(e.charCodeAt(n))){for(n++;n<e.length&&N(e.charCodeAt(n));)n++;g=n;}else c=3;return e.substring(u,g)}function k(){let u="",g=n;for(;;){if(n>=i){u+=e.substring(g,n),c=2;break}const f=e.charCodeAt(n);if(f===34){u+=e.substring(g,n),n++;break}if(f===92){if(u+=e.substring(g,n),n++,n>=i){c=2;break}switch(e.charCodeAt(n++)){case 34:u+='"';break;case 92:u+="\\";break;case 47:u+="/";break;case 98:u+="\b";break;case 102:u+="\f";break;case 110:u+=`
|
|
249
|
+
`;break;case 114:u+="\r";break;case 116:u+=" ";break;case 117:const O=L(4,!0);O>=0?u+=String.fromCharCode(O):c=4;break;default:c=5;}g=n;continue}if(f>=0&&f<=31)if(_(f)){u+=e.substring(g,n),c=2;break}else c=6;n++;}return u}function j(){if(t="",c=0,l=n,r=m,v=b,n>=i)return l=i,s=17;let u=e.charCodeAt(n);if(J(u)){do n++,t+=String.fromCharCode(u),u=e.charCodeAt(n);while(J(u));return s=15}if(_(u))return n++,t+=String.fromCharCode(u),u===13&&e.charCodeAt(n)===10&&(n++,t+=`
|
|
250
|
+
`),m++,b=n,s=14;switch(u){case 123:return n++,s=1;case 125:return n++,s=2;case 91:return n++,s=3;case 93:return n++,s=4;case 58:return n++,s=6;case 44:return n++,s=5;case 34:return n++,t=k(),s=10;case 47:const g=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<i&&!_(e.charCodeAt(n));)n++;return t=e.substring(g,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;const f=i-1;let $=!1;for(;n<f;){const O=e.charCodeAt(n);if(O===42&&e.charCodeAt(n+1)===47){n+=2,$=!0;break}n++,_(O)&&(O===13&&e.charCodeAt(n)===10&&n++,m++,b=n);}return $||(n++,c=1),t=e.substring(g,n),s=13}return t+=String.fromCharCode(u),n++,s=16;case 45:if(t+=String.fromCharCode(u),n++,n===i||!N(e.charCodeAt(n)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return t+=w(),s=11;default:for(;n<i&&U(u);)n++,u=e.charCodeAt(n);if(l!==n){switch(t=e.substring(l,n),t){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return t+=String.fromCharCode(u),n++,s=16}}function U(u){if(J(u)||_(u))return !1;switch(u){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return !1}return !0}function F(){let u;do u=j();while(u>=12&&u<=15);return u}return {setPosition:T,getPosition:()=>n,scan:o?F:j,getToken:()=>s,getTokenValue:()=>t,getTokenOffset:()=>l,getTokenLength:()=>n-l,getTokenStartLine:()=>r,getTokenStartCharacter:()=>l-v,getTokenError:()=>c}}function J(e){return e===32||e===9}function _(e){return e===10||e===13}function N(e){return e>=48&&e<=57}var q;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab";})(q||(q={}));var I;(function(e){e.DEFAULT={allowTrailingComma:!1};})(I||(I={}));function Te(e,o=[],i=I.DEFAULT){let n=null,t=[];const l=[];function s(r){Array.isArray(t)?t.push(r):n!==null&&(t[n]=r);}return we(e,{onObjectBegin:()=>{const r={};s(r),l.push(t),t=r,n=null;},onObjectProperty:r=>{n=r;},onObjectEnd:()=>{t=l.pop();},onArrayBegin:()=>{const r=[];s(r),l.push(t),t=r,n=null;},onArrayEnd:()=>{t=l.pop();},onLiteralValue:s,onError:(r,b,v)=>{o.push({error:r,offset:b,length:v});}},i),t[0]}function we(e,o,i=I.DEFAULT){const n=be(e,!1),t=[];function l(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function s(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}function m(a){return a?A=>a(A,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}function r(a){return a?A=>a(A,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>t.slice()):()=>!0}const b=s(o.onObjectBegin),v=r(o.onObjectProperty),c=l(o.onObjectEnd),L=s(o.onArrayBegin),T=l(o.onArrayEnd),w=r(o.onLiteralValue),k=m(o.onSeparator),j=l(o.onComment),U=m(o.onError),F=i&&i.disallowComments,u=i&&i.allowTrailingComma;function g(){for(;;){const a=n.scan();switch(n.getTokenError()){case 4:f(14);break;case 5:f(15);break;case 3:f(13);break;case 1:F||f(11);break;case 2:f(12);break;case 6:f(16);break}switch(a){case 12:case 13:F?f(10):j();break;case 16:f(1);break;case 15:case 14:break;default:return a}}}function f(a,A=[],Y=[]){if(U(a),A.length+Y.length>0){let y=n.getToken();for(;y!==17;){if(A.indexOf(y)!==-1){g();break}else if(Y.indexOf(y)!==-1)break;y=g();}}}function $(a){const A=n.getTokenValue();return a?w(A):(v(A),t.push(A)),g(),!0}function O(){switch(n.getToken()){case 11:const a=n.getTokenValue();let A=Number(a);isNaN(A)&&(f(2),A=0),w(A);break;case 7:w(null);break;case 8:w(!0);break;case 9:w(!1);break;default:return !1}return g(),!0}function ce(){return n.getToken()!==10?(f(3,[],[2,5]),!1):($(!1),n.getToken()===6?(k(":"),g(),V()||f(4,[],[2,5])):f(5,[],[2,5]),t.pop(),!0)}function fe(){b(),g();let a=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(a||f(4,[],[]),k(","),g(),n.getToken()===2&&u)break}else a&&f(6,[],[]);ce()||f(4,[],[2,5]),a=!0;}return c(),n.getToken()!==2?f(7,[2],[]):g(),!0}function pe(){L(),g();let a=!0,A=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(A||f(4,[],[]),k(","),g(),n.getToken()===4&&u)break}else A&&f(6,[],[]);a?(t.push(0),a=!1):t[t.length-1]++,V()||f(4,[],[4,5]),A=!0;}return T(),a||t.pop(),n.getToken()!==4?f(8,[4],[]):g(),!0}function V(){switch(n.getToken()){case 3:return pe();case 1:return fe();case 10:return $(!0);default:return O()}}return g(),n.getToken()===17?i.allowEmptyContent?!0:(f(4,[],[]),!1):V()?(n.getToken()!==17&&f(9,[],[]),!0):(f(4,[],[]),!1)}var K;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter";})(K||(K={}));var C;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF";})(C||(C={}));const ve=Te;var ee;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter";})(ee||(ee={}));const ne=(e,o)=>ve(ke(o,e,"utf8")),M=Symbol("implicitBaseUrl"),Oe=()=>{const{findPnpApi:e}=ge;return e&&e(process.cwd())},R=(e,o,i,n)=>{const t=`resolveFromPackageJsonPath:${e}:${o}:${i}`;if(n!=null&&n.has(t))return n.get(t);const l=ne(e,n);if(!l)return;let s=o||"tsconfig.json";if(!i&&l.exports)try{const[m]=v(l.exports,o,["require","types"]);s=m;}catch{return !1}else !o&&l.tsconfig&&(s=l.tsconfig);return s=p$1.join(e,"..",s),n==null||n.set(t,s),s},G="package.json",z="tsconfig.json",Ae=(e,o,i)=>{let n=e;if(e===".."&&(n=p$1.join(n,z)),e[0]==="."&&(n=p$1.resolve(o,n)),p$1.isAbsolute(n)){if(E(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const T=`${n}.json`;if(E(i,T))return T}return}const[t,...l]=e.split("/"),s=t[0]==="@"?`${t}/${l.shift()}`:t,m=l.join("/"),r=Oe();if(r){const{resolveRequest:T}=r;try{if(s===e){const w=T(p$1.join(s,G),o);if(w){const k=R(w,m,!1,i);if(k&&E(i,k))return k}}else {let w;try{w=T(e,o,{extensions:[".json"]});}catch{w=T(p$1.join(e,z),o);}if(w)return w}}catch{}}const b=Z(o,p$1.join("node_modules",s),i);if(!b||!P(i,b).isDirectory())return;const v=p$1.join(b,G);if(E(i,v)){const T=R(v,m,!1,i);if(T===!1)return;if(T&&E(i,T)&&P(i,T).isFile())return T}const c=p$1.join(b,m),L=c.endsWith(".json");if(!L){const T=`${c}.json`;if(E(i,T))return T}if(E(i,c)){if(P(i,c).isDirectory()){const T=p$1.join(c,G);if(E(i,T)){const k=R(T,"",!0,i);if(k&&E(i,k))return k}const w=p$1.join(c,z);if(E(i,w))return w}else if(L)return c}},je=(e,o,i,n)=>{const t=Ae(e,o,n);if(!t)throw new Error(`File '${e}' not found.`);if(i.has(t))throw new Error(`Circularity detected while resolving configuration: ${t}`);i.add(t);const l=p$1.dirname(t),s=te(t,n,i);delete s.references;const{compilerOptions:m}=s;if(m){const r=["baseUrl","outDir"];for(const b of r){const v=m[b];v&&(m[b]=B(p$1.relative(o,p$1.join(l,v)))||"./");}}return s.files&&(s.files=s.files.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.include&&(s.include=s.include.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s.exclude&&(s.exclude=s.exclude.map(r=>B(p$1.relative(o,p$1.join(l,r))))),s},te=(e,o,i=new Set)=>{let n;try{n=ae(o,e);}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}let t=ne(n,o)||{};if(typeof t!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const l=p$1.dirname(n);if(t.compilerOptions){const{compilerOptions:s}=t;s.paths&&!s.baseUrl&&(s[M]=l);}if(t.extends){const s=Array.isArray(t.extends)?t.extends:[t.extends];delete t.extends;for(const m of s.reverse()){const r=je(m,l,new Set(i),o),b={...r,...t,compilerOptions:{...r.compilerOptions,...t.compilerOptions}};r.watchOptions&&(b.watchOptions={...r.watchOptions,...t.watchOptions}),t=b;}}if(t.compilerOptions){const{compilerOptions:s}=t,m=["baseUrl","rootDir"];for(const b of m){const v=s[b];if(v){const c=p$1.resolve(l,v),L=W(p$1.relative(l,c));s[b]=L;}}const{outDir:r}=s;r&&(Array.isArray(t.exclude)||(t.exclude=[]),t.exclude.includes(r)||t.exclude.push(r),s.outDir=W(r));}else t.compilerOptions={};if(t.files&&(t.files=t.files.map(W)),t.include&&(t.include=t.include.map(B)),t.watchOptions){const{watchOptions:s}=t;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(m=>B(p$1.resolve(l,m))));}return t},ie=(e,o=new Map)=>te(e,o),$e=(e=process.cwd(),o="tsconfig.json",i=new Map)=>{const n=Z(B(e),o,i);if(!n)return null;const t=ie(n,i);return {path:n,config:t}};p$1.posix;process.platform==="win32";
|
|
229
251
|
|
|
230
252
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
231
253
|
const newLineRegExp = /\r?\n/;
|
|
@@ -2340,14 +2362,6 @@ class DotReporter extends BaseReporter {
|
|
|
2340
2362
|
}
|
|
2341
2363
|
}
|
|
2342
2364
|
|
|
2343
|
-
function getOutputFile(config, reporter) {
|
|
2344
|
-
if (!(config == null ? void 0 : config.outputFile))
|
|
2345
|
-
return;
|
|
2346
|
-
if (typeof config.outputFile === "string")
|
|
2347
|
-
return config.outputFile;
|
|
2348
|
-
return config.outputFile[reporter];
|
|
2349
|
-
}
|
|
2350
|
-
|
|
2351
2365
|
const StatusMap = {
|
|
2352
2366
|
fail: "failed",
|
|
2353
2367
|
only: "pending",
|
|
@@ -4310,7 +4324,7 @@ createLogUpdate(process$2.stdout);
|
|
|
4310
4324
|
|
|
4311
4325
|
createLogUpdate(process$2.stderr);
|
|
4312
4326
|
|
|
4313
|
-
var version = "1.
|
|
4327
|
+
var version = "1.4.0";
|
|
4314
4328
|
|
|
4315
4329
|
const HIGHLIGHT_SUPPORTED_EXTS = new Set(["js", "ts"].flatMap((lang) => [
|
|
4316
4330
|
`.${lang}`,
|
|
@@ -4409,14 +4423,14 @@ class Logger {
|
|
|
4409
4423
|
this.console.warn(...args);
|
|
4410
4424
|
}
|
|
4411
4425
|
clearFullScreen(message) {
|
|
4412
|
-
if (this.ctx.
|
|
4426
|
+
if (!this.ctx.config.clearScreen) {
|
|
4413
4427
|
this.console.log(message);
|
|
4414
4428
|
return;
|
|
4415
4429
|
}
|
|
4416
4430
|
this.console.log(`${ERASE_SCROLLBACK}${CLEAR_SCREEN}${message}`);
|
|
4417
4431
|
}
|
|
4418
4432
|
clearScreen(message, force = false) {
|
|
4419
|
-
if (this.ctx.
|
|
4433
|
+
if (!this.ctx.config.clearScreen) {
|
|
4420
4434
|
this.console.log(message);
|
|
4421
4435
|
return;
|
|
4422
4436
|
}
|
|
@@ -4493,7 +4507,7 @@ No ${config.mode} files found, exiting with code 1`));
|
|
|
4493
4507
|
}
|
|
4494
4508
|
}
|
|
4495
4509
|
printBanner() {
|
|
4496
|
-
var _a, _b
|
|
4510
|
+
var _a, _b;
|
|
4497
4511
|
this.log();
|
|
4498
4512
|
const versionTest = this.ctx.config.watch ? c.blue(`v${version}`) : c.cyan(`v${version}`);
|
|
4499
4513
|
const mode = this.ctx.config.watch ? c.blue(" DEV ") : c.cyan(" RUN ");
|
|
@@ -4509,10 +4523,14 @@ No ${config.mode} files found, exiting with code 1`));
|
|
|
4509
4523
|
const origin = (resolvedUrls == null ? void 0 : resolvedUrls.local[0]) ?? (resolvedUrls == null ? void 0 : resolvedUrls.network[0]);
|
|
4510
4524
|
this.log(c.dim(c.green(` ${output} Browser runner started at ${new URL("/", origin)}`)));
|
|
4511
4525
|
});
|
|
4512
|
-
if (this.ctx.config.ui)
|
|
4526
|
+
if (this.ctx.config.ui) {
|
|
4513
4527
|
this.log(c.dim(c.green(` UI started at http://${((_a = this.ctx.config.api) == null ? void 0 : _a.host) || "localhost"}:${c.bold(`${this.ctx.server.config.server.port}`)}${this.ctx.config.uiBase}`)));
|
|
4514
|
-
else if ((_b = this.ctx.config.api) == null ? void 0 : _b.port)
|
|
4515
|
-
|
|
4528
|
+
} else if ((_b = this.ctx.config.api) == null ? void 0 : _b.port) {
|
|
4529
|
+
const resolvedUrls = this.ctx.server.resolvedUrls;
|
|
4530
|
+
const fallbackUrl = `http://${this.ctx.config.api.host || "localhost"}:${this.ctx.config.api.port}`;
|
|
4531
|
+
const origin = (resolvedUrls == null ? void 0 : resolvedUrls.local[0]) ?? (resolvedUrls == null ? void 0 : resolvedUrls.network[0]) ?? fallbackUrl;
|
|
4532
|
+
this.log(c.dim(c.green(` API started at ${new URL("/", origin)}`)));
|
|
4533
|
+
}
|
|
4516
4534
|
if (this.ctx.coverageProvider)
|
|
4517
4535
|
this.log(c.dim(" Coverage enabled with ") + c.yellow(this.ctx.coverageProvider.name));
|
|
4518
4536
|
this.log();
|
|
@@ -4924,4 +4942,4 @@ const ReportersMap = {
|
|
|
4924
4942
|
"github-actions": GithubActionsReporter
|
|
4925
4943
|
};
|
|
4926
4944
|
|
|
4927
|
-
export { BaseSequencer as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JsonReporter$1 as J, Logger as L, ReportersMap as R, TapReporter as T, VerboseReporter as V, BasicReporter as a, DotReporter as b, JUnitReporter as c, TapFlatReporter as d, BenchmarkReportsMap as e, Typechecker as f, RandomSequencer as g, generateCodeFrame as h, highlightCode as i, divider as j, stripAnsi as s };
|
|
4945
|
+
export { BaseSequencer as B, DefaultReporter as D, GithubActionsReporter as G, HangingProcessReporter as H, JsonReporter$1 as J, Logger as L, ReportersMap as R, TapReporter as T, VerboseReporter as V, BasicReporter as a, DotReporter as b, JUnitReporter as c, TapFlatReporter as d, BenchmarkReportsMap as e, Typechecker as f, RandomSequencer as g, generateCodeFrame as h, highlightCode as i, divider as j, stripAnsi as s, wrapSerializableConfig as w };
|