vitest 3.0.0-beta.4 → 3.0.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/dist/browser.d.ts +2 -2
- package/dist/browser.js +1 -1
- package/dist/chunks/{base.BJ8KO-VX.js → base.gZAre3Yy.js} +3 -3
- package/dist/chunks/{cac.BAYqQ2aM.js → cac.Davy6Tyx.js} +24 -24
- package/dist/chunks/{cli-api.Dhl34Trr.js → cli-api.DO-hp2Kx.js} +1031 -162
- package/dist/chunks/{console.CN7AiMGV.js → console.BxE0RUCr.js} +3 -3
- package/dist/chunks/{creator.Ot9GlSGw.js → creator.B8v1wNyQ.js} +3 -3
- package/dist/chunks/{execute.BMOaRArH.js → execute.4vt3NSmG.js} +3 -4
- package/dist/chunks/global.CnI8_G5V.d.ts +133 -0
- package/dist/chunks/{globals.C5RQxaV3.js → globals.BSNBk3vE.js} +2 -2
- package/dist/chunks/{index.BQbxGbG9.js → index.Bf4FgyZN.js} +1 -1
- package/dist/chunks/{index.BJDntFik.js → index.Bh7wTRhh.js} +8 -8
- package/dist/chunks/{index.B2M9nD1V.js → index.C2XSkjNu.js} +5 -5
- package/dist/chunks/{index.DQboAxJm.js → index.DfqWks-F.js} +2 -1
- package/dist/chunks/{index.CAueP3cK.js → index.DyQPL4DO.js} +200 -945
- package/dist/chunks/{index.68735LiX.js → index.TH3f4LSA.js} +2 -2
- package/dist/chunks/{index.K90BXFOx.js → index.cYxyd29h.js} +12 -12
- package/dist/chunks/{inspector.DKLceBVD.js → inspector.CU9GlB9I.js} +1 -1
- package/dist/chunks/{reporters.Dcdq51WE.d.ts → reporters.Y8BYiXBN.d.ts} +340 -239
- package/dist/chunks/{resolveConfig.kZFMjKCQ.js → resolveConfig.DATSOo7x.js} +150 -65
- package/dist/chunks/{rpc.C3q9uwRX.js → rpc.Bf456uf4.js} +1 -2
- package/dist/chunks/{runBaseTests.URiUrnWK.js → runBaseTests.Ba8jtu6O.js} +8 -8
- package/dist/chunks/{setup-common.D0zLenuv.js → setup-common.jLbIuaww.js} +1 -1
- package/dist/chunks/{RandomSequencer.DB__To1b.js → typechecker.ChNaIV36.js} +62 -115
- package/dist/chunks/{utils.yHKcm4dz.js → utils.DJWL04yX.js} +1 -1
- package/dist/chunks/{vi.Da_PT3Vw.js → vi.CjhMlMwf.js} +6 -6
- package/dist/chunks/{vite.DzluO1Kj.d.ts → vite.CQ0dHgkN.d.ts} +1 -1
- package/dist/chunks/{vm.DrFVeTXo.js → vm.CUw7ChSp.js} +5 -5
- package/dist/chunks/{worker.BIVMnzXw.d.ts → worker.B1y96qmv.d.ts} +1 -1
- package/dist/chunks/{worker.Hz_LAzfd.d.ts → worker.CIpff8Eg.d.ts} +2 -4
- package/dist/cli.js +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.ts +3 -3
- package/dist/config.js +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.js +12 -11
- package/dist/environments.js +1 -1
- package/dist/execute.d.ts +1 -1
- package/dist/execute.js +1 -1
- package/dist/index.d.ts +17 -118
- package/dist/index.js +2 -2
- package/dist/node.d.ts +11 -8
- package/dist/node.js +27 -25
- package/dist/reporters.d.ts +1 -1
- package/dist/reporters.js +4 -6
- package/dist/runners.d.ts +1 -0
- package/dist/runners.js +10 -10
- package/dist/worker.js +5 -5
- package/dist/workers/forks.js +2 -2
- package/dist/workers/runVmTests.js +7 -7
- package/dist/workers/threads.js +2 -2
- package/dist/workers/vmForks.js +3 -3
- package/dist/workers/vmThreads.js +3 -3
- package/dist/workers.d.ts +2 -2
- package/dist/workers.js +8 -8
- package/package.json +17 -17
- package/dist/chunks/types.BOjykUpq.d.ts +0 -27
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isCI } from 'std-env';
|
|
2
2
|
import { writeFile, rm } from 'node:fs/promises';
|
|
3
3
|
import { performance } from 'node:perf_hooks';
|
|
4
|
-
import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks } from '@vitest/runner/utils';
|
|
5
4
|
import { TraceMap, generatedPositionFor, eachMapping } from '@vitest/utils/source-map';
|
|
6
5
|
import { relative, basename, dirname, resolve, join, extname } from 'pathe';
|
|
7
6
|
import { x as x$1 } from 'tinyexec';
|
|
7
|
+
import { getTests, generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes } from '@vitest/runner/utils';
|
|
8
|
+
import '@vitest/utils';
|
|
8
9
|
import { parseAstAsync } from 'vite';
|
|
9
10
|
import nodeos__default from 'node:os';
|
|
10
11
|
import url from 'node:url';
|
|
@@ -12,14 +13,40 @@ import a$1 from 'node:path';
|
|
|
12
13
|
import fs from 'node:fs';
|
|
13
14
|
import Te from 'node:module';
|
|
14
15
|
import require$$0 from 'fs';
|
|
15
|
-
import { shuffle } from '@vitest/utils';
|
|
16
|
-
import { slash } from 'vite-node/utils';
|
|
17
|
-
import crypto from 'node:crypto';
|
|
18
16
|
|
|
19
|
-
|
|
17
|
+
function hasFailedSnapshot(suite) {
|
|
18
|
+
return getTests(suite).some((s) => {
|
|
19
|
+
return s.result?.errors?.some(
|
|
20
|
+
(e) => typeof e?.message === "string" && e.message.match(/Snapshot .* mismatched/)
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function convertTasksToEvents(file, onTask) {
|
|
25
|
+
const packs = [];
|
|
26
|
+
const events = [];
|
|
27
|
+
function visit(suite) {
|
|
28
|
+
onTask?.(suite);
|
|
29
|
+
packs.push([suite.id, suite.result, suite.meta]);
|
|
30
|
+
events.push([suite.id, "suite-prepare"]);
|
|
31
|
+
suite.tasks.forEach((task) => {
|
|
32
|
+
if (task.type === "suite") {
|
|
33
|
+
visit(task);
|
|
34
|
+
} else {
|
|
35
|
+
onTask?.(task);
|
|
36
|
+
packs.push([task.id, task.result, task.meta]);
|
|
37
|
+
if (task.mode !== "skip" && task.mode !== "todo") {
|
|
38
|
+
events.push([task.id, "test-prepare"], [task.id, "test-finished"]);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
events.push([suite.id, "suite-finished"]);
|
|
43
|
+
}
|
|
44
|
+
visit(file);
|
|
45
|
+
return { packs, events };
|
|
46
|
+
}
|
|
20
47
|
|
|
21
48
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
|
|
22
|
-
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !==
|
|
49
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== undefined;
|
|
23
50
|
const isWindows = (isNode || isDeno) && process.platform === "win32";
|
|
24
51
|
const isTTY = (isNode || isDeno) && process.stdout?.isTTY && !isCI;
|
|
25
52
|
|
|
@@ -363,17 +390,13 @@ async function collectTests(ctx, filepath) {
|
|
|
363
390
|
return getName(callee.tag);
|
|
364
391
|
}
|
|
365
392
|
if (callee.type === "MemberExpression") {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
return getName(callee.property);
|
|
393
|
+
if (callee.object?.type === "Identifier" && ["it", "test", "describe", "suite"].includes(callee.object.name)) {
|
|
394
|
+
return callee.object?.name;
|
|
369
395
|
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (callee.type === "SequenceExpression" && callee.expressions.length === 2) {
|
|
373
|
-
const [e0, e1] = callee.expressions;
|
|
374
|
-
if (e0.type === "Literal" && e0.value === 0) {
|
|
375
|
-
return getName(e1);
|
|
396
|
+
if (callee.object?.name?.startsWith("__vite_ssr_")) {
|
|
397
|
+
return getName(callee.property);
|
|
376
398
|
}
|
|
399
|
+
return getName(callee.object?.property);
|
|
377
400
|
}
|
|
378
401
|
return null;
|
|
379
402
|
};
|
|
@@ -388,8 +411,8 @@ async function collectTests(ctx, filepath) {
|
|
|
388
411
|
return;
|
|
389
412
|
}
|
|
390
413
|
const property = callee?.property?.name;
|
|
391
|
-
|
|
392
|
-
if (
|
|
414
|
+
let mode = !property || property === name ? "run" : property;
|
|
415
|
+
if (["each", "for", "skipIf", "runIf"].includes(mode)) {
|
|
393
416
|
return;
|
|
394
417
|
}
|
|
395
418
|
let start;
|
|
@@ -404,10 +427,11 @@ async function collectTests(ctx, filepath) {
|
|
|
404
427
|
const {
|
|
405
428
|
arguments: [messageNode]
|
|
406
429
|
} = node;
|
|
407
|
-
|
|
408
|
-
|
|
430
|
+
const isQuoted = messageNode?.type === "Literal" || messageNode?.type === "TemplateLiteral";
|
|
431
|
+
const message = isQuoted ? request.code.slice(messageNode.start + 1, messageNode.end - 1) : request.code.slice(messageNode.start, messageNode.end);
|
|
432
|
+
if (mode === "skipIf" || mode === "runIf") {
|
|
433
|
+
mode = "skip";
|
|
409
434
|
}
|
|
410
|
-
const message = getNodeAsString(messageNode, request.code);
|
|
411
435
|
definitions.push({
|
|
412
436
|
start,
|
|
413
437
|
end,
|
|
@@ -474,7 +498,7 @@ async function collectTests(ctx, filepath) {
|
|
|
474
498
|
interpretTaskModes(
|
|
475
499
|
file,
|
|
476
500
|
ctx.config.testNamePattern,
|
|
477
|
-
|
|
501
|
+
undefined,
|
|
478
502
|
hasOnly,
|
|
479
503
|
false,
|
|
480
504
|
ctx.config.allowOnly
|
|
@@ -487,45 +511,16 @@ async function collectTests(ctx, filepath) {
|
|
|
487
511
|
definitions
|
|
488
512
|
};
|
|
489
513
|
}
|
|
490
|
-
function getNodeAsString(node, code) {
|
|
491
|
-
if (node.type === "Literal") {
|
|
492
|
-
return String(node.value);
|
|
493
|
-
} else if (node.type === "Identifier") {
|
|
494
|
-
return node.name;
|
|
495
|
-
} else if (node.type === "TemplateLiteral") {
|
|
496
|
-
return mergeTemplateLiteral(node, code);
|
|
497
|
-
} else {
|
|
498
|
-
return code.slice(node.start, node.end);
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
function mergeTemplateLiteral(node, code) {
|
|
502
|
-
let result = "";
|
|
503
|
-
let expressionsIndex = 0;
|
|
504
|
-
for (let quasisIndex = 0; quasisIndex < node.quasis.length; quasisIndex++) {
|
|
505
|
-
result += node.quasis[quasisIndex].value.raw;
|
|
506
|
-
if (expressionsIndex in node.expressions) {
|
|
507
|
-
const expression = node.expressions[expressionsIndex];
|
|
508
|
-
const string = expression.type === "Literal" ? expression.raw : getNodeAsString(expression, code);
|
|
509
|
-
if (expression.type === "TemplateLiteral") {
|
|
510
|
-
result += `\${\`${string}\`}`;
|
|
511
|
-
} else {
|
|
512
|
-
result += `\${${string}}`;
|
|
513
|
-
}
|
|
514
|
-
expressionsIndex++;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
return result;
|
|
518
|
-
}
|
|
519
514
|
|
|
520
|
-
const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_="ERR_INVALID_PACKAGE_CONFIG",E="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,`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(_,"Cannot contain numeric property keys");if(n==="default"||o.includes(n))return f(r,t[n],e,o,c)}return []}throw a(E,`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===
|
|
515
|
+
const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_="ERR_INVALID_PACKAGE_CONFIG",E="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,`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(_,"Cannot contain numeric property keys");if(n==="default"||o.includes(n))return f(r,t[n],e,o,c)}return []}throw a(E,`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===undefined&&t.startsWith(n)&&t.endsWith(i)){const g=t.slice(n.length,-i.length||undefined);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===undefined||t===o)return o;throw a(_,'"exports" cannot contain some keys starting with "." and some not')},undefined),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,`Invalid "exports" target "${i}" defined in the package config`);return n};
|
|
521
516
|
|
|
522
|
-
var ve=Object.defineProperty;var l=(e,t)=>ve(e,"name",{value:t,configurable
|
|
523
|
-
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:const j=O(4
|
|
524
|
-
`),f++,p=n,r=14;switch(c){case 123:return n++,r=1;case 125:return n++,r=2;case 91:return n++,r=3;case 93:return n++,r=4;case 58:return n++,r=6;case 44:return n++,r=5;case 34:return n++,o=b(),r=10;case 47:const m=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<i&&!h(e.charCodeAt(n));)n++;return o=e.substring(m,n),r=12}if(e.charCodeAt(n+1)===42){n+=2;const g=i-1;let y
|
|
517
|
+
var ve=Object.defineProperty;var l=(e,t)=>ve(e,"name",{value:t,configurable:true});function B(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}l(B,"slash");const R=l(e=>{const t=fs[e];return (i,...n)=>{const o=`${e}:${n.join(":")}`;let s=i==null?undefined:i.get(o);return s===undefined&&(s=Reflect.apply(t,fs,n),i==null||i.set(o,s)),s}},"cacheFs"),F=R("existsSync"),je=R("readFileSync"),P=R("statSync"),ne=l((e,t,i)=>{for(;;){const n=a$1.posix.join(e,t);if(F(i,n))return n;const o=a$1.dirname(e);if(o===e)return;e=o;}},"findUp"),J=/^\.{1,2}(\/.*)?$/,M=l(e=>{const t=B(e);return J.test(t)?t:`./${t}`},"normalizeRelativePath");function _e(e,t=false){const i=e.length;let n=0,o="",s=0,r=16,f=0,u=0,p=0,T=0,w=0;function O(c,m){let g=0,y=0;for(;g<c||!m;){let j=e.charCodeAt(n);if(j>=48&&j<=57)y=y*16+j-48;else if(j>=65&&j<=70)y=y*16+j-65+10;else if(j>=97&&j<=102)y=y*16+j-97+10;else break;n++,g++;}return g<c&&(y=-1),y}l(O,"scanHexDigits");function v(c){n=c,o="",s=0,r=16,w=0;}l(v,"setPosition");function A(){let c=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 w=3,e.substring(c,n);let m=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++;m=n;}else w=3;return e.substring(c,m)}l(A,"scanNumber");function b(){let c="",m=n;for(;;){if(n>=i){c+=e.substring(m,n),w=2;break}const g=e.charCodeAt(n);if(g===34){c+=e.substring(m,n),n++;break}if(g===92){if(c+=e.substring(m,n),n++,n>=i){w=2;break}switch(e.charCodeAt(n++)){case 34:c+='"';break;case 92:c+="\\";break;case 47:c+="/";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
518
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:const j=O(4,true);j>=0?c+=String.fromCharCode(j):w=4;break;default:w=5;}m=n;continue}if(g>=0&&g<=31)if(h(g)){c+=e.substring(m,n),w=2;break}else w=6;n++;}return c}l(b,"scanString");function $(){if(o="",w=0,s=n,u=f,T=p,n>=i)return s=i,r=17;let c=e.charCodeAt(n);if(G(c)){do n++,o+=String.fromCharCode(c),c=e.charCodeAt(n);while(G(c));return r=15}if(h(c))return n++,o+=String.fromCharCode(c),c===13&&e.charCodeAt(n)===10&&(n++,o+=`
|
|
519
|
+
`),f++,p=n,r=14;switch(c){case 123:return n++,r=1;case 125:return n++,r=2;case 91:return n++,r=3;case 93:return n++,r=4;case 58:return n++,r=6;case 44:return n++,r=5;case 34:return n++,o=b(),r=10;case 47:const m=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<i&&!h(e.charCodeAt(n));)n++;return o=e.substring(m,n),r=12}if(e.charCodeAt(n+1)===42){n+=2;const g=i-1;let y=false;for(;n<g;){const j=e.charCodeAt(n);if(j===42&&e.charCodeAt(n+1)===47){n+=2,y=true;break}n++,h(j)&&(j===13&&e.charCodeAt(n)===10&&n++,f++,p=n);}return y||(n++,w=1),o=e.substring(m,n),r=13}return o+=String.fromCharCode(c),n++,r=16;case 45:if(o+=String.fromCharCode(c),n++,n===i||!N(e.charCodeAt(n)))return r=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return o+=A(),r=11;default:for(;n<i&&U(c);)n++,c=e.charCodeAt(n);if(s!==n){switch(o=e.substring(s,n),o){case "true":return r=8;case "false":return r=9;case "null":return r=7}return r=16}return o+=String.fromCharCode(c),n++,r=16}}l($,"scanNext");function U(c){if(G(c)||h(c))return false;switch(c){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return false}return true}l(U,"isUnknownContentCharacter");function E(){let c;do c=$();while(c>=12&&c<=15);return c}return l(E,"scanNextNonTrivia"),{setPosition:v,getPosition:l(()=>n,"getPosition"),scan:t?E:$,getToken:l(()=>r,"getToken"),getTokenValue:l(()=>o,"getTokenValue"),getTokenOffset:l(()=>s,"getTokenOffset"),getTokenLength:l(()=>n-s,"getTokenLength"),getTokenStartLine:l(()=>u,"getTokenStartLine"),getTokenStartCharacter:l(()=>s-T,"getTokenStartCharacter"),getTokenError:l(()=>w,"getTokenError")}}l(_e,"createScanner");function G(e){return e===32||e===9}l(G,"isWhiteSpace");function h(e){return e===10||e===13}l(h,"isLineBreak");function N(e){return e>=48&&e<=57}l(N,"isDigit");var te;((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";}))(te||(te={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const D=200;new Array(D).fill(0).map((e,t)=>`
|
|
525
520
|
`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>`\r
|
|
526
521
|
`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>`
|
|
527
522
|
`+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(D).fill(0).map((e,t)=>`\r
|
|
528
|
-
`+" ".repeat(t));var x;(function(e){e.DEFAULT={allowTrailingComma:!1};})(x||(x={}));function $e(e,t=[],i=x.DEFAULT){let n=null,o=[];const s=[];function r(u){Array.isArray(o)?o.push(u):n!==null&&(o[n]=u);}return l(r,"onValue"),ye(e,{onObjectBegin:l(()=>{const u={};r(u),s.push(o),o=u,n=null;},"onObjectBegin"),onObjectProperty:l(u=>{n=u;},"onObjectProperty"),onObjectEnd:l(()=>{o=s.pop();},"onObjectEnd"),onArrayBegin:l(()=>{const u=[];r(u),s.push(o),o=u,n=null;},"onArrayBegin"),onArrayEnd:l(()=>{o=s.pop();},"onArrayEnd"),onLiteralValue:r,onError:l((u,p,T)=>{t.push({error:u,offset:p,length:T});},"onError")},i),o[0]}l($e,"parse$1");function ye(e,t,i=x.DEFAULT){const n=_e(e,!1),o=[];function s(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(s,"toNoArgVisit");function r(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}l(r,"toNoArgVisitWithPath");function f(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}l(f,"toOneArgVisit");function u(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>!0}l(u,"toOneArgVisitWithPath");const p=r(t.onObjectBegin),T=u(t.onObjectProperty),w=s(t.onObjectEnd),O=r(t.onArrayBegin),v=s(t.onArrayEnd),A=u(t.onLiteralValue),b=f(t.onSeparator),$=s(t.onComment),U=f(t.onError),E=i&&i.disallowComments,c=i&&i.allowTrailingComma;function m(){for(;;){const k=n.scan();switch(n.getTokenError()){case 4:g(14);break;case 5:g(15);break;case 3:g(13);break;case 1:E||g(11);break;case 2:g(12);break;case 6:g(16);break}switch(k){case 12:case 13:E?g(10):$();break;case 16:g(1);break;case 15:case 14:break;default:return k}}}l(m,"scanNext");function g(k,_=[],C=[]){if(U(k),_.length+C.length>0){let d=n.getToken();for(;d!==17;){if(_.indexOf(d)!==-1){m();break}else if(C.indexOf(d)!==-1)break;d=m();}}}l(g,"handleError");function y(k){const _=n.getTokenValue();return k?A(_):(T(_),o.push(_)),m(),!0}l(y,"parseString");function j(){switch(n.getToken()){case 11:const k=n.getTokenValue();let _=Number(k);isNaN(_)&&(g(2),_=0),A(_);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return !1}return m(),!0}l(j,"parseLiteral");function ke(){return n.getToken()!==10?(g(3,[],[2,5]),!1):(y(!1),n.getToken()===6?(b(":"),m(),V()||g(4,[],[2,5])):g(5,[],[2,5]),o.pop(),!0)}l(ke,"parseProperty");function be(){p(),m();let k=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(k||g(4,[],[]),b(","),m(),n.getToken()===2&&c)break}else k&&g(6,[],[]);ke()||g(4,[],[2,5]),k=!0;}return w(),n.getToken()!==2?g(7,[2],[]):m(),!0}l(be,"parseObject");function we(){O(),m();let k=!0,_=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(_||g(4,[],[]),b(","),m(),n.getToken()===4&&c)break}else _&&g(6,[],[]);k?(o.push(0),k=!1):o[o.length-1]++,V()||g(4,[],[4,5]),_=!0;}return v(),k||o.pop(),n.getToken()!==4?g(8,[4],[]):m(),!0}l(we,"parseArray");function V(){switch(n.getToken()){case 3:return we();case 1:return be();case 10:return y(!0);default:return j()}}return l(V,"parseValue"),m(),n.getToken()===17?i.allowEmptyContent?!0:(g(4,[],[]),!1):V()?(n.getToken()!==17&&g(9,[],[]),!0):(g(4,[],[]),!1)}l(ye,"visit");var ie;(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";})(ie||(ie={}));var oe;(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";})(oe||(oe={}));const Be=$e;var se;(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";})(se||(se={}));const le=l((e,t)=>Be(je(t,e,"utf8")),"readJsonc"),z=Symbol("implicitBaseUrl"),L="${configDir}",Fe=l(()=>{const{findPnpApi:e}=Te;return e&&e(process.cwd())},"getPnpApi"),Q=l((e,t,i,n)=>{const o=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(n!=null&&n.has(o))return n.get(o);const s=le(e,n);if(!s)return;let r=t||"tsconfig.json";if(!i&&s.exports)try{const[f]=v(s.exports,t,["require","types"]);r=f;}catch{return !1}else !t&&s.tsconfig&&(r=s.tsconfig);return r=a$1.join(e,"..",r),n==null||n.set(o,r),r},"resolveFromPackageJsonPath"),H="package.json",X="tsconfig.json",Le=l((e,t,i)=>{let n=e;if(e===".."&&(n=a$1.join(n,X)),e[0]==="."&&(n=a$1.resolve(t,n)),a$1.isAbsolute(n)){if(F(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const v=`${n}.json`;if(F(i,v))return v}return}const[o,...s]=e.split("/"),r=o[0]==="@"?`${o}/${s.shift()}`:o,f=s.join("/"),u=Fe();if(u){const{resolveRequest:v}=u;try{if(r===e){const A=v(a$1.join(r,H),t);if(A){const b=Q(A,f,!1,i);if(b&&F(i,b))return b}}else {let A;try{A=v(e,t,{extensions:[".json"]});}catch{A=v(a$1.join(e,X),t);}if(A)return A}}catch{}}const p=ne(a$1.resolve(t),a$1.join("node_modules",r),i);if(!p||!P(i,p).isDirectory())return;const T=a$1.join(p,H);if(F(i,T)){const v=Q(T,f,!1,i);if(v===!1)return;if(v&&F(i,v)&&P(i,v).isFile())return v}const w=a$1.join(p,f),O=w.endsWith(".json");if(!O){const v=`${w}.json`;if(F(i,v))return v}if(F(i,w)){if(P(i,w).isDirectory()){const v=a$1.join(w,H);if(F(i,v)){const b=Q(v,"",!0,i);if(b&&F(i,b))return b}const A=a$1.join(w,X);if(F(i,A))return A}else if(O)return w}},"resolveExtendsPath"),Y=l((e,t)=>M(a$1.relative(e,t)),"pathRelative"),re=["files","include","exclude"],Ue=l((e,t,i,n)=>{const o=Le(e,t,n);if(!o)throw new Error(`File '${e}' not found.`);if(i.has(o))throw new Error(`Circularity detected while resolving configuration: ${o}`);i.add(o);const s=a$1.dirname(o),r=ue(o,n,i);delete r.references;const{compilerOptions:f}=r;if(f){const{baseUrl:u}=f;u&&!u.startsWith(L)&&(f.baseUrl=B(a$1.relative(t,a$1.join(s,u)))||"./");let{outDir:p}=f;p&&(p.startsWith(L)||(p=a$1.relative(t,a$1.join(s,p))),f.outDir=B(p)||"./");}for(const u of re){const p=r[u];p&&(r[u]=p.map(T=>T.startsWith(L)?T:B(a$1.relative(t,a$1.join(s,T)))));}return r},"resolveExtends"),Ee=["outDir","declarationDir"],ue=l((e,t,i=new Set)=>{let n;try{n=le(e,t)||{};}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof n!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const o=a$1.dirname(e);if(n.compilerOptions){const{compilerOptions:s}=n;s.paths&&!s.baseUrl&&(s[z]=o);}if(n.extends){const s=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const r of s.reverse()){const f=Ue(r,o,new Set(i),t),u={...f,...n,compilerOptions:{...f.compilerOptions,...n.compilerOptions}};f.watchOptions&&(u.watchOptions={...f.watchOptions,...n.watchOptions}),n=u;}}if(n.compilerOptions){const{compilerOptions:s}=n,r=["baseUrl","rootDir"];for(const f of r){const u=s[f];if(u&&!u.startsWith(L)){const p=a$1.resolve(o,u),T=Y(o,p);s[f]=T;}}for(const f of Ee){let u=s[f];u&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(u)||n.exclude.push(u),u.startsWith(L)||(u=M(u)),s[f]=u);}}else n.compilerOptions={};if(n.include?(n.include=n.include.map(B),n.files&&delete n.files):n.files&&(n.files=n.files.map(s=>s.startsWith(L)?s:M(s))),n.watchOptions){const{watchOptions:s}=n;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(r=>B(a$1.resolve(o,r))));}return n},"_parseTsconfig"),I=l((e,t)=>{if(e.startsWith(L))return B(a$1.join(t,e.slice(L.length)))},"interpolateConfigDir"),Ne=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],fe=l((e,t=new Map)=>{const i=a$1.resolve(e),n=ue(i,t),o=a$1.dirname(i),{compilerOptions:s}=n;if(s){for(const f of Ne){const u=s[f];if(u){const p=I(u,o);s[f]=p?Y(o,p):u;}}for(const f of ["rootDirs","typeRoots"]){const u=s[f];u&&(s[f]=u.map(p=>{const T=I(p,o);return T?Y(o,T):p}));}const{paths:r}=s;if(r)for(const f of Object.keys(r))r[f]=r[f].map(u=>{var p;return (p=I(u,o))!=null?p:u});}for(const r of re){const f=n[r];f&&(n[r]=f.map(u=>{var p;return (p=I(u,o))!=null?p:u}));}return n},"parseTsconfig"),De=l((e=process.cwd(),t="tsconfig.json",i=new Map)=>{const n=ne(B(e),t,i);if(!n)return null;const o=fe(n,i);return {path:n,config:o}},"getTsconfig"),he=/\*/g,ce=l((e,t)=>{const i=e.match(he);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),de=l(e=>{if(e.includes("*")){const[t,i]=e.split("*");return {prefix:t,suffix:i}}return e},"parsePattern"),Pe=l(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),xe=l((e,t,i)=>Object.entries(e).map(([n,o])=>(ce(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:de(n),substitutions:o.map(s=>{if(ce(s,`Substitution '${s}' in pattern '${n}' can have at most one '*' character.`),!t&&!J.test(s))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return a$1.resolve(i,s)})})),"parsePaths");l(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const o=z in t&&t[z],s=a$1.resolve(a$1.dirname(e.path),i||o||"."),r=n?xe(n,i,s):[];return f=>{if(J.test(f))return [];const u=[];for(const O of r){if(O.pattern===f)return O.substitutions.map(B);typeof O.pattern!="string"&&u.push(O);}let p,T=-1;for(const O of u)Pe(O.pattern,f)&&O.pattern.prefix.length>T&&(T=O.pattern.prefix.length,p=O);if(!p)return i?[B(a$1.join(s,f))]:[];const w=f.slice(p.pattern.prefix.length,f.length-p.pattern.suffix.length);return p.substitutions.map(O=>B(O.replace("*",w)))}},"createPathsMatcher");const pe=l(e=>{let t="";for(let i=0;i<e.length;i+=1){const n=e[i],o=n.toUpperCase();t+=n===o?n.toLowerCase():o;}return t},"s"),Se=65,We=97,Ve=l(()=>Math.floor(Math.random()*26),"m"),Re=l(e=>Array.from({length:e},()=>String.fromCodePoint(Ve()+(Math.random()>.5?Se:We))).join(""),"S"),Je=l((e=require$$0)=>{const t=process.execPath;if(e.existsSync(t))return !e.existsSync(pe(t));const i=`/${Re(10)}`;e.writeFileSync(i,"");const n=!e.existsSync(pe(i));return e.unlinkSync(i),n},"l"),{join:S}=a$1.posix,Z={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Me=l(e=>{const t=[...Z.ts],i=[...Z.cts],n=[...Z.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Ge=l(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),ae=l(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),ze=["node_modules","bower_components","jspm_packages"],q=`(?!(${ze.join("|")})(/|$))`,Qe=/(?:^|\/)[^.*?]+$/,ge="**/*",W="[^/]",K="[^./]",me=process.platform==="win32";l(({config:e,path:t},i=Je())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!a$1.isAbsolute(t))throw new Error("The tsconfig path must be absolute");me&&(t=B(t));const n=a$1.dirname(t),{files:o,include:s,exclude:r,compilerOptions:f}=e,u=o==null?void 0:o.map(b=>S(n,b)),p=Me(f),T=i?"":"i",O=(r||Ge(f)).map(b=>{const $=S(n,b),U=ae($).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${W}*`).replaceAll(String.raw`\?`,W);return new RegExp(`^${U}($|/)`,T)}),v=o||s?s:[ge],A=v?v.map(b=>{let $=S(n,b);Qe.test($)&&($=S($,ge));const U=ae($).replaceAll(String.raw`/\*\*`,`(/${q}${K}${W}*)*?`).replaceAll(/(\/)?\\\*/g,(E,c)=>{const m=`(${K}|(\\.(?!min\\.js$))?)*`;return c?`/${q}${K}${m}`:m}).replaceAll(/(\/)?\\\?/g,(E,c)=>{const m=W;return c?`/${q}${m}`:m});return new RegExp(`^${U}$`,T)}):void 0;return b=>{if(!a$1.isAbsolute(b))throw new Error("filePath must be absolute");if(me&&(b=B(b)),u!=null&&u.includes(b))return e;if(!(!p.some($=>b.endsWith($))||O.some($=>$.test(b)))&&A&&A.some($=>$.test(b)))return e}},"createFilesMatcher");
|
|
523
|
+
`+" ".repeat(t));var x;(function(e){e.DEFAULT={allowTrailingComma:false};})(x||(x={}));function $e(e,t=[],i=x.DEFAULT){let n=null,o=[];const s=[];function r(u){Array.isArray(o)?o.push(u):n!==null&&(o[n]=u);}return l(r,"onValue"),ye(e,{onObjectBegin:l(()=>{const u={};r(u),s.push(o),o=u,n=null;},"onObjectBegin"),onObjectProperty:l(u=>{n=u;},"onObjectProperty"),onObjectEnd:l(()=>{o=s.pop();},"onObjectEnd"),onArrayBegin:l(()=>{const u=[];r(u),s.push(o),o=u,n=null;},"onArrayBegin"),onArrayEnd:l(()=>{o=s.pop();},"onArrayEnd"),onLiteralValue:r,onError:l((u,p,T)=>{t.push({error:u,offset:p,length:T});},"onError")},i),o[0]}l($e,"parse$1");function ye(e,t,i=x.DEFAULT){const n=_e(e,false),o=[];function s(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>true}l(s,"toNoArgVisit");function r(k){return k?()=>k(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>true}l(r,"toNoArgVisitWithPath");function f(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>true}l(f,"toOneArgVisit");function u(k){return k?_=>k(_,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>o.slice()):()=>true}l(u,"toOneArgVisitWithPath");const p=r(t.onObjectBegin),T=u(t.onObjectProperty),w=s(t.onObjectEnd),O=r(t.onArrayBegin),v=s(t.onArrayEnd),A=u(t.onLiteralValue),b=f(t.onSeparator),$=s(t.onComment),U=f(t.onError),E=i&&i.disallowComments,c=i&&i.allowTrailingComma;function m(){for(;;){const k=n.scan();switch(n.getTokenError()){case 4:g(14);break;case 5:g(15);break;case 3:g(13);break;case 1:E||g(11);break;case 2:g(12);break;case 6:g(16);break}switch(k){case 12:case 13:E?g(10):$();break;case 16:g(1);break;case 15:case 14:break;default:return k}}}l(m,"scanNext");function g(k,_=[],C=[]){if(U(k),_.length+C.length>0){let d=n.getToken();for(;d!==17;){if(_.indexOf(d)!==-1){m();break}else if(C.indexOf(d)!==-1)break;d=m();}}}l(g,"handleError");function y(k){const _=n.getTokenValue();return k?A(_):(T(_),o.push(_)),m(),true}l(y,"parseString");function j(){switch(n.getToken()){case 11:const k=n.getTokenValue();let _=Number(k);isNaN(_)&&(g(2),_=0),A(_);break;case 7:A(null);break;case 8:A(true);break;case 9:A(false);break;default:return false}return m(),true}l(j,"parseLiteral");function ke(){return n.getToken()!==10?(g(3,[],[2,5]),false):(y(false),n.getToken()===6?(b(":"),m(),V()||g(4,[],[2,5])):g(5,[],[2,5]),o.pop(),true)}l(ke,"parseProperty");function be(){p(),m();let k=false;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(k||g(4,[],[]),b(","),m(),n.getToken()===2&&c)break}else k&&g(6,[],[]);ke()||g(4,[],[2,5]),k=true;}return w(),n.getToken()!==2?g(7,[2],[]):m(),true}l(be,"parseObject");function we(){O(),m();let k=true,_=false;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if(_||g(4,[],[]),b(","),m(),n.getToken()===4&&c)break}else _&&g(6,[],[]);k?(o.push(0),k=false):o[o.length-1]++,V()||g(4,[],[4,5]),_=true;}return v(),k||o.pop(),n.getToken()!==4?g(8,[4],[]):m(),true}l(we,"parseArray");function V(){switch(n.getToken()){case 3:return we();case 1:return be();case 10:return y(true);default:return j()}}return l(V,"parseValue"),m(),n.getToken()===17?i.allowEmptyContent?true:(g(4,[],[]),false):V()?(n.getToken()!==17&&g(9,[],[]),true):(g(4,[],[]),false)}l(ye,"visit");var ie;(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";})(ie||(ie={}));var oe;(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";})(oe||(oe={}));const Be=$e;var se;(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";})(se||(se={}));const le=l((e,t)=>Be(je(t,e,"utf8")),"readJsonc"),z=Symbol("implicitBaseUrl"),L="${configDir}",Fe=l(()=>{const{findPnpApi:e}=Te;return e&&e(process.cwd())},"getPnpApi"),Q=l((e,t,i,n)=>{const o=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(n!=null&&n.has(o))return n.get(o);const s=le(e,n);if(!s)return;let r=t||"tsconfig.json";if(!i&&s.exports)try{const[f]=v(s.exports,t,["require","types"]);r=f;}catch{return false}else !t&&s.tsconfig&&(r=s.tsconfig);return r=a$1.join(e,"..",r),n==null||n.set(o,r),r},"resolveFromPackageJsonPath"),H="package.json",X="tsconfig.json",Le=l((e,t,i)=>{let n=e;if(e===".."&&(n=a$1.join(n,X)),e[0]==="."&&(n=a$1.resolve(t,n)),a$1.isAbsolute(n)){if(F(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const v=`${n}.json`;if(F(i,v))return v}return}const[o,...s]=e.split("/"),r=o[0]==="@"?`${o}/${s.shift()}`:o,f=s.join("/"),u=Fe();if(u){const{resolveRequest:v}=u;try{if(r===e){const A=v(a$1.join(r,H),t);if(A){const b=Q(A,f,!1,i);if(b&&F(i,b))return b}}else {let A;try{A=v(e,t,{extensions:[".json"]});}catch{A=v(a$1.join(e,X),t);}if(A)return A}}catch{}}const p=ne(a$1.resolve(t),a$1.join("node_modules",r),i);if(!p||!P(i,p).isDirectory())return;const T=a$1.join(p,H);if(F(i,T)){const v=Q(T,f,false,i);if(v===false)return;if(v&&F(i,v)&&P(i,v).isFile())return v}const w=a$1.join(p,f),O=w.endsWith(".json");if(!O){const v=`${w}.json`;if(F(i,v))return v}if(F(i,w)){if(P(i,w).isDirectory()){const v=a$1.join(w,H);if(F(i,v)){const b=Q(v,"",true,i);if(b&&F(i,b))return b}const A=a$1.join(w,X);if(F(i,A))return A}else if(O)return w}},"resolveExtendsPath"),Y=l((e,t)=>M(a$1.relative(e,t)),"pathRelative"),re=["files","include","exclude"],Ue=l((e,t,i,n)=>{const o=Le(e,t,n);if(!o)throw new Error(`File '${e}' not found.`);if(i.has(o))throw new Error(`Circularity detected while resolving configuration: ${o}`);i.add(o);const s=a$1.dirname(o),r=ue(o,n,i);delete r.references;const{compilerOptions:f}=r;if(f){const{baseUrl:u}=f;u&&!u.startsWith(L)&&(f.baseUrl=B(a$1.relative(t,a$1.join(s,u)))||"./");let{outDir:p}=f;p&&(p.startsWith(L)||(p=a$1.relative(t,a$1.join(s,p))),f.outDir=B(p)||"./");}for(const u of re){const p=r[u];p&&(r[u]=p.map(T=>T.startsWith(L)?T:B(a$1.relative(t,a$1.join(s,T)))));}return r},"resolveExtends"),Ee=["outDir","declarationDir"],ue=l((e,t,i=new Set)=>{let n;try{n=le(e,t)||{};}catch{throw new Error(`Cannot resolve tsconfig at path: ${e}`)}if(typeof n!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const o=a$1.dirname(e);if(n.compilerOptions){const{compilerOptions:s}=n;s.paths&&!s.baseUrl&&(s[z]=o);}if(n.extends){const s=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const r of s.reverse()){const f=Ue(r,o,new Set(i),t),u={...f,...n,compilerOptions:{...f.compilerOptions,...n.compilerOptions}};f.watchOptions&&(u.watchOptions={...f.watchOptions,...n.watchOptions}),n=u;}}if(n.compilerOptions){const{compilerOptions:s}=n,r=["baseUrl","rootDir"];for(const f of r){const u=s[f];if(u&&!u.startsWith(L)){const p=a$1.resolve(o,u),T=Y(o,p);s[f]=T;}}for(const f of Ee){let u=s[f];u&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(u)||n.exclude.push(u),u.startsWith(L)||(u=M(u)),s[f]=u);}}else n.compilerOptions={};if(n.include?(n.include=n.include.map(B),n.files&&delete n.files):n.files&&(n.files=n.files.map(s=>s.startsWith(L)?s:M(s))),n.watchOptions){const{watchOptions:s}=n;s.excludeDirectories&&(s.excludeDirectories=s.excludeDirectories.map(r=>B(a$1.resolve(o,r))));}return n},"_parseTsconfig"),I=l((e,t)=>{if(e.startsWith(L))return B(a$1.join(t,e.slice(L.length)))},"interpolateConfigDir"),Ne=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],fe=l((e,t=new Map)=>{const i=a$1.resolve(e),n=ue(i,t),o=a$1.dirname(i),{compilerOptions:s}=n;if(s){for(const f of Ne){const u=s[f];if(u){const p=I(u,o);s[f]=p?Y(o,p):u;}}for(const f of ["rootDirs","typeRoots"]){const u=s[f];u&&(s[f]=u.map(p=>{const T=I(p,o);return T?Y(o,T):p}));}const{paths:r}=s;if(r)for(const f of Object.keys(r))r[f]=r[f].map(u=>{var p;return (p=I(u,o))!=null?p:u});}for(const r of re){const f=n[r];f&&(n[r]=f.map(u=>{var p;return (p=I(u,o))!=null?p:u}));}return n},"parseTsconfig"),De=l((e=process.cwd(),t="tsconfig.json",i=new Map)=>{const n=ne(B(e),t,i);if(!n)return null;const o=fe(n,i);return {path:n,config:o}},"getTsconfig"),he=/\*/g,ce=l((e,t)=>{const i=e.match(he);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),de=l(e=>{if(e.includes("*")){const[t,i]=e.split("*");return {prefix:t,suffix:i}}return e},"parsePattern"),Pe=l(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),xe=l((e,t,i)=>Object.entries(e).map(([n,o])=>(ce(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:de(n),substitutions:o.map(s=>{if(ce(s,`Substitution '${s}' in pattern '${n}' can have at most one '*' character.`),!t&&!J.test(s))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return a$1.resolve(i,s)})})),"parsePaths");l(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const o=z in t&&t[z],s=a$1.resolve(a$1.dirname(e.path),i||o||"."),r=n?xe(n,i,s):[];return f=>{if(J.test(f))return [];const u=[];for(const O of r){if(O.pattern===f)return O.substitutions.map(B);typeof O.pattern!="string"&&u.push(O);}let p,T=-1;for(const O of u)Pe(O.pattern,f)&&O.pattern.prefix.length>T&&(T=O.pattern.prefix.length,p=O);if(!p)return i?[B(a$1.join(s,f))]:[];const w=f.slice(p.pattern.prefix.length,f.length-p.pattern.suffix.length);return p.substitutions.map(O=>B(O.replace("*",w)))}},"createPathsMatcher");const pe=l(e=>{let t="";for(let i=0;i<e.length;i+=1){const n=e[i],o=n.toUpperCase();t+=n===o?n.toLowerCase():o;}return t},"s"),Se=65,We=97,Ve=l(()=>Math.floor(Math.random()*26),"m"),Re=l(e=>Array.from({length:e},()=>String.fromCodePoint(Ve()+(Math.random()>.5?Se:We))).join(""),"S"),Je=l((e=require$$0)=>{const t=process.execPath;if(e.existsSync(t))return !e.existsSync(pe(t));const i=`/${Re(10)}`;e.writeFileSync(i,"");const n=!e.existsSync(pe(i));return e.unlinkSync(i),n},"l"),{join:S}=a$1.posix,Z={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Me=l(e=>{const t=[...Z.ts],i=[...Z.cts],n=[...Z.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Ge=l(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),ae=l(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`),"escapeForRegexp"),ze=["node_modules","bower_components","jspm_packages"],q=`(?!(${ze.join("|")})(/|$))`,Qe=/(?:^|\/)[^.*?]+$/,ge="**/*",W="[^/]",K="[^./]",me=process.platform==="win32";l(({config:e,path:t},i=Je())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!a$1.isAbsolute(t))throw new Error("The tsconfig path must be absolute");me&&(t=B(t));const n=a$1.dirname(t),{files:o,include:s,exclude:r,compilerOptions:f}=e,u=o==null?undefined:o.map(b=>S(n,b)),p=Me(f),T=i?"":"i",O=(r||Ge(f)).map(b=>{const $=S(n,b),U=ae($).replaceAll(String.raw`\*\*/`,"(.+/)?").replaceAll(String.raw`\*`,`${W}*`).replaceAll(String.raw`\?`,W);return new RegExp(`^${U}($|/)`,T)}),v=o||s?s:[ge],A=v?v.map(b=>{let $=S(n,b);Qe.test($)&&($=S($,ge));const U=ae($).replaceAll(String.raw`/\*\*`,`(/${q}${K}${W}*)*?`).replaceAll(/(\/)?\\\*/g,(E,c)=>{const m=`(${K}|(\\.(?!min\\.js$))?)*`;return c?`/${q}${K}${m}`:m}).replaceAll(/(\/)?\\\?/g,(E,c)=>{const m=W;return c?`/${q}${m}`:m});return new RegExp(`^${U}$`,T)}):undefined;return b=>{if(!a$1.isAbsolute(b))throw new Error("filePath must be absolute");if(me&&(b=B(b)),u!=null&&u.includes(b))return e;if(!(!p.some($=>b.endsWith($))||O.some($=>$.test(b)))&&A&&A.some($=>$.test(b)))return e}},"createFilesMatcher");
|
|
529
524
|
|
|
530
525
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
531
526
|
const newLineRegExp = /\r?\n/;
|
|
@@ -567,7 +562,7 @@ async function makeTscErrorInfo(errInfo) {
|
|
|
567
562
|
];
|
|
568
563
|
}
|
|
569
564
|
async function getTsconfig(root, config) {
|
|
570
|
-
const configName = config.tsconfig ? basename(config.tsconfig) :
|
|
565
|
+
const configName = config.tsconfig ? basename(config.tsconfig) : undefined;
|
|
571
566
|
const configSearchPath = config.tsconfig ? dirname(resolve(root, config.tsconfig)) : root;
|
|
572
567
|
const tsconfig = De(configSearchPath, configName);
|
|
573
568
|
if (!tsconfig) {
|
|
@@ -839,7 +834,7 @@ class Typechecker {
|
|
|
839
834
|
async stop() {
|
|
840
835
|
await this.clear();
|
|
841
836
|
this.process?.kill();
|
|
842
|
-
this.process =
|
|
837
|
+
this.process = undefined;
|
|
843
838
|
}
|
|
844
839
|
async ensurePackageInstalled(ctx, checker) {
|
|
845
840
|
if (checker !== "tsc" && checker !== "vue-tsc") {
|
|
@@ -921,8 +916,15 @@ class Typechecker {
|
|
|
921
916
|
getTestFiles() {
|
|
922
917
|
return Object.values(this._tests || {}).map((i) => i.file);
|
|
923
918
|
}
|
|
924
|
-
|
|
925
|
-
|
|
919
|
+
getTestPacksAndEvents() {
|
|
920
|
+
const packs = [];
|
|
921
|
+
const events = [];
|
|
922
|
+
for (const { file } of Object.values(this._tests || {})) {
|
|
923
|
+
const result = convertTasksToEvents(file);
|
|
924
|
+
packs.push(...result.packs);
|
|
925
|
+
events.push(...result.events);
|
|
926
|
+
}
|
|
927
|
+
return { packs, events };
|
|
926
928
|
}
|
|
927
929
|
}
|
|
928
930
|
function findGeneratedPosition(traceMap, { line, column, source }) {
|
|
@@ -952,59 +954,4 @@ function findGeneratedPosition(traceMap, { line, column, source }) {
|
|
|
952
954
|
return { line: null, column: null };
|
|
953
955
|
}
|
|
954
956
|
|
|
955
|
-
|
|
956
|
-
ctx;
|
|
957
|
-
constructor(ctx) {
|
|
958
|
-
this.ctx = ctx;
|
|
959
|
-
}
|
|
960
|
-
// async so it can be extended by other sequelizers
|
|
961
|
-
async shard(files) {
|
|
962
|
-
const { config } = this.ctx;
|
|
963
|
-
const { index, count } = config.shard;
|
|
964
|
-
const shardSize = Math.ceil(files.length / count);
|
|
965
|
-
const shardStart = shardSize * (index - 1);
|
|
966
|
-
const shardEnd = shardSize * index;
|
|
967
|
-
return [...files].map((spec) => {
|
|
968
|
-
const fullPath = resolve(slash(config.root), slash(spec.moduleId));
|
|
969
|
-
const specPath = fullPath?.slice(config.root.length);
|
|
970
|
-
return {
|
|
971
|
-
spec,
|
|
972
|
-
hash: hash("sha1", specPath, "hex")
|
|
973
|
-
};
|
|
974
|
-
}).sort((a, b) => a.hash < b.hash ? -1 : a.hash > b.hash ? 1 : 0).slice(shardStart, shardEnd).map(({ spec }) => spec);
|
|
975
|
-
}
|
|
976
|
-
// async so it can be extended by other sequelizers
|
|
977
|
-
async sort(files) {
|
|
978
|
-
const cache = this.ctx.cache;
|
|
979
|
-
return [...files].sort((a, b) => {
|
|
980
|
-
const keyA = `${a.project.name}:${relative(this.ctx.config.root, a.moduleId)}`;
|
|
981
|
-
const keyB = `${b.project.name}:${relative(this.ctx.config.root, b.moduleId)}`;
|
|
982
|
-
const aState = cache.getFileTestResults(keyA);
|
|
983
|
-
const bState = cache.getFileTestResults(keyB);
|
|
984
|
-
if (!aState || !bState) {
|
|
985
|
-
const statsA = cache.getFileStats(keyA);
|
|
986
|
-
const statsB = cache.getFileStats(keyB);
|
|
987
|
-
if (!statsA || !statsB) {
|
|
988
|
-
return !statsA && statsB ? -1 : !statsB && statsA ? 1 : 0;
|
|
989
|
-
}
|
|
990
|
-
return statsB.size - statsA.size;
|
|
991
|
-
}
|
|
992
|
-
if (aState.failed && !bState.failed) {
|
|
993
|
-
return -1;
|
|
994
|
-
}
|
|
995
|
-
if (!aState.failed && bState.failed) {
|
|
996
|
-
return 1;
|
|
997
|
-
}
|
|
998
|
-
return bState.duration - aState.duration;
|
|
999
|
-
});
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
|
|
1003
|
-
class RandomSequencer extends BaseSequencer {
|
|
1004
|
-
async sort(files) {
|
|
1005
|
-
const { sequence } = this.ctx.config;
|
|
1006
|
-
return shuffle(files, sequence.seed);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
export { BaseSequencer as B, RandomSequencer as R, TypeCheckError as T, Typechecker as a, isWindows as b, getOutputFile as g, hash as h, isTTY as i, wrapSerializableConfig as w };
|
|
957
|
+
export { TypeCheckError as T, Typechecker as a, isWindows as b, convertTasksToEvents as c, getOutputFile as g, hasFailedSnapshot as h, isTTY as i, wrapSerializableConfig as w };
|
|
@@ -195,4 +195,4 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
195
195
|
withLabel: withLabel
|
|
196
196
|
});
|
|
197
197
|
|
|
198
|
-
export { F_POINTER as F,
|
|
198
|
+
export { F_POINTER as F, formatProjectName as a, taskFail as b, F_RIGHT as c, divider as d, F_CHECK as e, formatTimeString as f, getStateSymbol as g, getStateString as h, formatTime as i, countTestErrors as j, F_TREE_NODE_END as k, F_TREE_NODE_MIDDLE as l, padSummaryTitle as p, renderSnapshotSummary as r, truncateString as t, utils as u, withLabel as w };
|
|
@@ -138,7 +138,7 @@ await ${assertionString}
|
|
|
138
138
|
};
|
|
139
139
|
}
|
|
140
140
|
function copyStackTrace$1(target, source) {
|
|
141
|
-
if (source.stack !==
|
|
141
|
+
if (source.stack !== undefined) {
|
|
142
142
|
target.stack = source.stack.replace(source.message, target.message);
|
|
143
143
|
}
|
|
144
144
|
return target;
|
|
@@ -353,7 +353,7 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
353
353
|
const test = getTest(key, this);
|
|
354
354
|
if (typeof properties === "string" && typeof message === "undefined") {
|
|
355
355
|
message = properties;
|
|
356
|
-
properties =
|
|
356
|
+
properties = undefined;
|
|
357
357
|
}
|
|
358
358
|
const errorMessage = utils.flag(this, "message");
|
|
359
359
|
getSnapshotClient().assert({
|
|
@@ -419,7 +419,7 @@ const SnapshotPlugin = (chai, utils) => {
|
|
|
419
419
|
if (typeof properties === "string") {
|
|
420
420
|
message = inlineSnapshot;
|
|
421
421
|
inlineSnapshot = properties;
|
|
422
|
-
properties =
|
|
422
|
+
properties = undefined;
|
|
423
423
|
}
|
|
424
424
|
if (inlineSnapshot) {
|
|
425
425
|
inlineSnapshot = stripSnapshotIndentation(inlineSnapshot);
|
|
@@ -3844,7 +3844,7 @@ class FakeTimers {
|
|
|
3844
3844
|
}
|
|
3845
3845
|
|
|
3846
3846
|
function copyStackTrace(target, source) {
|
|
3847
|
-
if (source.stack !==
|
|
3847
|
+
if (source.stack !== undefined) {
|
|
3848
3848
|
target.stack = source.stack.replace(source.message, target.message);
|
|
3849
3849
|
}
|
|
3850
3850
|
return target;
|
|
@@ -4196,7 +4196,7 @@ function createVitest() {
|
|
|
4196
4196
|
}
|
|
4197
4197
|
if (_envBooleans.includes(name)) {
|
|
4198
4198
|
process.env[name] = value ? "1" : "";
|
|
4199
|
-
} else if (value ===
|
|
4199
|
+
} else if (value === undefined) {
|
|
4200
4200
|
delete process.env[name];
|
|
4201
4201
|
} else {
|
|
4202
4202
|
process.env[name] = String(value);
|
|
@@ -4216,7 +4216,7 @@ function createVitest() {
|
|
|
4216
4216
|
},
|
|
4217
4217
|
unstubAllEnvs() {
|
|
4218
4218
|
_stubsEnv.forEach((original, name) => {
|
|
4219
|
-
if (original ===
|
|
4219
|
+
if (original === undefined) {
|
|
4220
4220
|
delete process.env[name];
|
|
4221
4221
|
} else {
|
|
4222
4222
|
process.env[name] = original;
|
|
@@ -2,8 +2,8 @@ import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
|
2
2
|
import vm, { isContext } from 'node:vm';
|
|
3
3
|
import { dirname, basename, extname, normalize, join, resolve } from 'pathe';
|
|
4
4
|
import { distDir } from '../path.js';
|
|
5
|
-
import { createCustomConsole } from './console.
|
|
6
|
-
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.
|
|
5
|
+
import { createCustomConsole } from './console.BxE0RUCr.js';
|
|
6
|
+
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.4vt3NSmG.js';
|
|
7
7
|
import fs from 'node:fs';
|
|
8
8
|
import { dirname as dirname$1 } from 'node:path';
|
|
9
9
|
import { isNodeBuiltin, isPrimitive, toArray, getCachedData, setCacheData } from 'vite-node/utils';
|
|
@@ -151,7 +151,7 @@ class CommonjsExecutor {
|
|
|
151
151
|
},
|
|
152
152
|
configurable: true
|
|
153
153
|
});
|
|
154
|
-
require.main =
|
|
154
|
+
require.main = undefined;
|
|
155
155
|
require.cache = this.publicRequireCache;
|
|
156
156
|
return require;
|
|
157
157
|
};
|
|
@@ -353,7 +353,7 @@ class EsmExecutor {
|
|
|
353
353
|
const imports = WebAssembly.Module.imports(wasmModule);
|
|
354
354
|
const moduleLookup = {};
|
|
355
355
|
for (const { module } of imports) {
|
|
356
|
-
if (moduleLookup[module] ===
|
|
356
|
+
if (moduleLookup[module] === undefined) {
|
|
357
357
|
moduleLookup[module] = await this.executor.resolveModule(
|
|
358
358
|
module,
|
|
359
359
|
identifier
|
|
@@ -832,7 +832,7 @@ async function runVmTests(method, state) {
|
|
|
832
832
|
entryFile
|
|
833
833
|
);
|
|
834
834
|
const fileSpecs = ctx.files.map(
|
|
835
|
-
(f) => typeof f === "string" ? { filepath: f, testLocations:
|
|
835
|
+
(f) => typeof f === "string" ? { filepath: f, testLocations: undefined } : f
|
|
836
836
|
);
|
|
837
837
|
try {
|
|
838
838
|
await run(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { File, TaskResultPack, CancelReason, FileSpecification, Task } from '@vitest/runner';
|
|
1
|
+
import { File, TaskResultPack, TaskEventPack, CancelReason, FileSpecification, Task } from '@vitest/runner';
|
|
2
2
|
import { ViteNodeResolveId, ModuleCacheMap } from 'vite-node';
|
|
3
3
|
import { S as SerializedConfig } from './config.BRtC-JeT.js';
|
|
4
4
|
import { T as TransformMode, U as UserConsoleLog, A as AfterSuiteRunMeta, E as Environment } from './environment.d8YfPkTm.js';
|
|
@@ -100,14 +100,12 @@ interface RuntimeRPC {
|
|
|
100
100
|
* @deprecated unused
|
|
101
101
|
*/
|
|
102
102
|
getSourceMap: (id: string, force?: boolean) => Promise<any>;
|
|
103
|
-
onFinished: (files: File[], errors?: unknown[]) => void;
|
|
104
|
-
onPathsCollected: (paths: string[]) => void;
|
|
105
103
|
onUserConsoleLog: (log: UserConsoleLog) => void;
|
|
106
104
|
onUnhandledError: (err: unknown, type: string) => void;
|
|
107
105
|
onQueued: (file: File) => void;
|
|
108
106
|
onCollected: (files: File[]) => Promise<void>;
|
|
109
107
|
onAfterSuiteRun: (meta: AfterSuiteRunMeta) => void;
|
|
110
|
-
onTaskUpdate: (pack: TaskResultPack[]) => Promise<void>;
|
|
108
|
+
onTaskUpdate: (pack: TaskResultPack[], events: TaskEventPack[]) => Promise<void>;
|
|
111
109
|
onCancel: (reason: CancelReason) => void;
|
|
112
110
|
getCountOfFailedTests: () => number;
|
|
113
111
|
snapshotSaved: (snapshot: SnapshotResult) => void;
|
package/dist/cli.js
CHANGED
package/dist/config.cjs
CHANGED
|
@@ -13,7 +13,7 @@ const extraInlineDeps = [
|
|
|
13
13
|
];
|
|
14
14
|
|
|
15
15
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
|
|
16
|
-
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !==
|
|
16
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== undefined;
|
|
17
17
|
(isNode || isDeno) && process.platform === "win32";
|
|
18
18
|
(isNode || isDeno) && process.stdout?.isTTY && !stdEnv.isCI;
|
|
19
19
|
|
package/dist/config.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { UserConfig as UserConfig$1, ConfigEnv } from 'vite';
|
|
2
2
|
export { ConfigEnv, Plugin, UserConfig as ViteUserConfig, mergeConfig } from 'vite';
|
|
3
|
-
import { R as ResolvedCoverageOptions, d as CoverageV8Options, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.
|
|
4
|
-
export { W as WorkspaceProjectConfiguration } from './chunks/reporters.
|
|
5
|
-
import './chunks/vite.
|
|
3
|
+
import { R as ResolvedCoverageOptions, d as CoverageV8Options, U as UserWorkspaceConfig, e as UserProjectConfigFn, f as UserProjectConfigExport, T as TestProjectConfiguration } from './chunks/reporters.Y8BYiXBN.js';
|
|
4
|
+
export { W as WorkspaceProjectConfiguration } from './chunks/reporters.Y8BYiXBN.js';
|
|
5
|
+
import './chunks/vite.CQ0dHgkN.js';
|
|
6
6
|
import '@vitest/runner';
|
|
7
7
|
import './chunks/environment.d8YfPkTm.js';
|
|
8
8
|
import '@vitest/utils';
|
package/dist/config.js
CHANGED
|
@@ -11,7 +11,7 @@ const extraInlineDeps = [
|
|
|
11
11
|
];
|
|
12
12
|
|
|
13
13
|
const isNode = typeof process < "u" && typeof process.stdout < "u" && !process.versions?.deno && !globalThis.window;
|
|
14
|
-
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !==
|
|
14
|
+
const isDeno = typeof process < "u" && typeof process.stdout < "u" && process.versions?.deno !== undefined;
|
|
15
15
|
(isNode || isDeno) && process.platform === "win32";
|
|
16
16
|
(isNode || isDeno) && process.stdout?.isTTY && !isCI;
|
|
17
17
|
|
package/dist/coverage.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as vite from 'vite';
|
|
2
|
-
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.
|
|
2
|
+
import { R as ResolvedCoverageOptions, V as Vitest, C as CoverageMap, a as ReportContext } from './chunks/reporters.Y8BYiXBN.js';
|
|
3
3
|
import { A as AfterSuiteRunMeta } from './chunks/environment.d8YfPkTm.js';
|
|
4
4
|
import '@vitest/runner';
|
|
5
5
|
import '@vitest/utils';
|
package/dist/coverage.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, promises, readdirSync, writeFileSync } from 'node:fs';
|
|
2
|
-
import { c as coverageConfigDefaults, r as resolveCoverageReporters, m as mm } from './chunks/resolveConfig.
|
|
2
|
+
import { c as coverageConfigDefaults, r as resolveCoverageReporters, m as mm } from './chunks/resolveConfig.DATSOo7x.js';
|
|
3
3
|
import { resolve, relative } from 'pathe';
|
|
4
4
|
import c from 'tinyrainbow';
|
|
5
5
|
import '@vitest/utils';
|
|
@@ -13,24 +13,25 @@ import 'node:v8';
|
|
|
13
13
|
import 'node:util';
|
|
14
14
|
import './chunks/constants.fzPh7AOq.js';
|
|
15
15
|
import 'node:os';
|
|
16
|
-
import './chunks/
|
|
16
|
+
import './chunks/typechecker.ChNaIV36.js';
|
|
17
17
|
import 'std-env';
|
|
18
18
|
import 'node:perf_hooks';
|
|
19
|
-
import '@vitest/runner/utils';
|
|
20
19
|
import '@vitest/utils/source-map';
|
|
21
20
|
import 'tinyexec';
|
|
21
|
+
import '@vitest/runner/utils';
|
|
22
22
|
import 'vite';
|
|
23
23
|
import 'fs';
|
|
24
|
-
import 'vite-node/utils';
|
|
25
24
|
import 'node:crypto';
|
|
25
|
+
import 'node:tty';
|
|
26
26
|
import './chunks/_commonjsHelpers.BFTU3MAI.js';
|
|
27
27
|
import 'util';
|
|
28
28
|
import 'path';
|
|
29
29
|
import 'node:events';
|
|
30
|
-
import './chunks/index.
|
|
30
|
+
import './chunks/index.TH3f4LSA.js';
|
|
31
31
|
import 'tinypool';
|
|
32
32
|
import 'node:worker_threads';
|
|
33
33
|
import './path.js';
|
|
34
|
+
import 'vite-node/utils';
|
|
34
35
|
|
|
35
36
|
const THRESHOLD_KEYS = [
|
|
36
37
|
"lines",
|
|
@@ -261,7 +262,7 @@ Update your dependencies and make sure the versions match.`
|
|
|
261
262
|
*/
|
|
262
263
|
checkThresholds(allThresholds) {
|
|
263
264
|
for (const { coverageMap, thresholds, name } of allThresholds) {
|
|
264
|
-
if (thresholds.branches ===
|
|
265
|
+
if (thresholds.branches === undefined && thresholds.functions === undefined && thresholds.lines === undefined && thresholds.statements === undefined) {
|
|
265
266
|
continue;
|
|
266
267
|
}
|
|
267
268
|
const summaries = this.options.thresholds?.perFile ? coverageMap.files().map((file) => ({
|
|
@@ -271,7 +272,7 @@ Update your dependencies and make sure the versions match.`
|
|
|
271
272
|
for (const { summary, file } of summaries) {
|
|
272
273
|
for (const thresholdKey of THRESHOLD_KEYS) {
|
|
273
274
|
const threshold = thresholds[thresholdKey];
|
|
274
|
-
if (threshold ===
|
|
275
|
+
if (threshold === undefined) {
|
|
275
276
|
continue;
|
|
276
277
|
}
|
|
277
278
|
if (threshold >= 0) {
|
|
@@ -413,10 +414,10 @@ function resolveGlobThresholds(thresholds) {
|
|
|
413
414
|
};
|
|
414
415
|
}
|
|
415
416
|
return {
|
|
416
|
-
lines: "lines" in thresholds && typeof thresholds.lines === "number" ? thresholds.lines :
|
|
417
|
-
branches: "branches" in thresholds && typeof thresholds.branches === "number" ? thresholds.branches :
|
|
418
|
-
functions: "functions" in thresholds && typeof thresholds.functions === "number" ? thresholds.functions :
|
|
419
|
-
statements: "statements" in thresholds && typeof thresholds.statements === "number" ? thresholds.statements :
|
|
417
|
+
lines: "lines" in thresholds && typeof thresholds.lines === "number" ? thresholds.lines : undefined,
|
|
418
|
+
branches: "branches" in thresholds && typeof thresholds.branches === "number" ? thresholds.branches : undefined,
|
|
419
|
+
functions: "functions" in thresholds && typeof thresholds.functions === "number" ? thresholds.functions : undefined,
|
|
420
|
+
statements: "statements" in thresholds && typeof thresholds.statements === "number" ? thresholds.statements : undefined
|
|
420
421
|
};
|
|
421
422
|
}
|
|
422
423
|
function assertConfigurationModule(config) {
|
package/dist/environments.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.
|
|
1
|
+
export { e as builtinEnvironments, p as populateGlobal } from './chunks/index.cYxyd29h.js';
|
|
2
2
|
import 'node:console';
|
package/dist/execute.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ViteNodeRunnerOptions } from 'vite-node';
|
|
2
2
|
import { ViteNodeRunner } from 'vite-node/client';
|
|
3
|
-
import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.
|
|
3
|
+
import { R as RuntimeRPC, W as WorkerGlobalState } from './chunks/worker.CIpff8Eg.js';
|
|
4
4
|
import vm from 'node:vm';
|
|
5
5
|
import * as _vitest_mocker from '@vitest/mocker';
|
|
6
6
|
import { MockedModuleType } from '@vitest/mocker';
|