vitest 2.1.0-beta.5 → 2.1.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +59 -320
- package/dist/browser.d.ts +6 -3
- package/dist/browser.js +2 -2
- package/dist/chunks/{RandomSequencer.B4M2ux5b.js → RandomSequencer.Bh5-tlNJ.js} +77 -58
- package/dist/chunks/{base.BH-FAiX7.js → base.BlXpj3e_.js} +1 -29
- package/dist/chunks/{base.BYvKfYzm.js → base.CchlWrnV.js} +2 -4
- package/dist/chunks/{cac.DosbLiJg.js → cac.B5XYKv2_.js} +26 -17
- package/dist/chunks/{cli-api.D8zgNrBU.js → cli-api.ByZPnilx.js} +7419 -7959
- package/dist/chunks/{constants.CaAN7icJ.js → constants.fzPh7AOq.js} +1 -1
- package/dist/chunks/{coverage.CqfT4xaf.js → coverage.zlNdAMHK.js} +5 -3
- package/dist/chunks/{creator.COdKw_ZN.js → creator.zfBZSJzo.js} +9 -9
- package/dist/chunks/{environment.0M5R1SX_.d.ts → environment.C5eAp3K6.d.ts} +1 -1
- package/dist/chunks/{execute.DT9BA6zp.js → execute._eQQfgI8.js} +322 -232
- package/dist/chunks/{git.ZtkbKc8u.js → git.B5SDxu-n.js} +5 -5
- package/dist/chunks/{globals.DRPLtPOv.js → globals.jM7MxN2t.js} +4 -4
- package/dist/chunks/{index.CM5UI-4O.js → index.Bn75ITYg.js} +3 -3
- package/dist/chunks/index.CPD77dLA.js +133 -0
- package/dist/chunks/{index.CxWPpGJz.js → index.CSjyR2-v.js} +2 -2
- package/dist/chunks/{index.Dx3f477d.js → index.DpJO1tkB.js} +1110 -1104
- package/dist/chunks/{index.CNZXZ9PJ.js → index.xm8OIiKD.js} +1 -1
- package/dist/chunks/mocker.cRtM890J.d.ts +17 -0
- package/dist/chunks/{reporters.DbwOGCsU.d.ts → reporters.WnPwkmgA.d.ts} +154 -129
- package/dist/chunks/{resolveConfig.RHsAM2_Q.js → resolveConfig.-K5hHm0S.js} +56 -34
- package/dist/chunks/{runBaseTests.BAhL8UH_.js → runBaseTests.Cztfoflv.js} +7 -7
- package/dist/chunks/{setup-common.KBrCO5LJ.js → setup-common.fGBFoQKJ.js} +1 -1
- package/dist/chunks/{utils.C3_cBsyn.js → utils.Cn0zI1t3.js} +16 -3
- package/dist/chunks/{utils.DO38lwfj.js → utils.Dbnmsfq1.js} +1 -1
- package/dist/chunks/{vi.B6QZ938s.js → vi.DGgiNzJE.js} +46 -37
- package/dist/chunks/vite.D2yAwzwa.d.ts +11 -0
- package/dist/chunks/{vm.kl9T_5ai.js → vm.CPXwWp4C.js} +1 -2
- package/dist/chunks/{worker.Cx2xE71X.d.ts → worker.Bws9Zuxu.d.ts} +1 -1
- package/dist/chunks/{worker.BANO5ak1.d.ts → worker.CmPmTxgH.d.ts} +2 -14
- package/dist/cli.js +3 -3
- package/dist/config.cjs +1 -0
- package/dist/config.d.ts +70 -2
- package/dist/config.js +1 -0
- package/dist/coverage.d.ts +4 -3
- package/dist/coverage.js +29 -5
- package/dist/environments.d.ts +2 -2
- package/dist/execute.d.ts +13 -14
- package/dist/execute.js +3 -2
- package/dist/index.d.ts +23 -16
- package/dist/index.js +4 -4
- package/dist/mocker.d.ts +1 -0
- package/dist/mocker.js +1 -0
- package/dist/node.d.ts +27 -9
- package/dist/node.js +44 -39
- package/dist/reporters.d.ts +2 -2
- package/dist/reporters.js +8 -8
- package/dist/runners.js +2 -2
- package/dist/utils.d.ts +1 -0
- package/dist/worker.js +3 -2
- package/dist/workers/forks.js +5 -4
- package/dist/workers/runVmTests.js +6 -6
- package/dist/workers/threads.js +5 -4
- package/dist/workers/vmForks.js +4 -4
- package/dist/workers/vmThreads.js +4 -4
- package/dist/workers.d.ts +4 -16
- package/dist/workers.js +6 -5
- package/mocker.d.ts +1 -0
- package/package.json +22 -17
- package/dist/chunks/index.DNUmWFkO.js +0 -319
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { writeFile, rm } from 'node:fs/promises';
|
|
2
2
|
import { performance } from 'node:perf_hooks';
|
|
3
|
-
import { execa } from 'execa';
|
|
4
3
|
import { basename, dirname, resolve, join, relative, extname } from 'pathe';
|
|
5
4
|
import { TraceMap, generatedPositionFor } from '@vitest/utils/source-map';
|
|
5
|
+
import { x as x$1 } from 'tinyexec';
|
|
6
6
|
import { generateHash, calculateSuiteHash, someTasksAreOnly, interpretTaskModes, getTasks } from '@vitest/runner/utils';
|
|
7
7
|
import { shuffle } from '@vitest/utils';
|
|
8
8
|
import './env.CmHVDJnw.js';
|
|
9
9
|
import url from 'node:url';
|
|
10
10
|
import nodeos__default from 'node:os';
|
|
11
11
|
import p$1 from 'path';
|
|
12
|
-
import
|
|
12
|
+
import W from 'fs';
|
|
13
13
|
import ke from 'module';
|
|
14
14
|
import { parseAstAsync } from 'vite';
|
|
15
15
|
import { createHash } from 'node:crypto';
|
|
@@ -43,13 +43,13 @@ function wrapSerializableConfig(config) {
|
|
|
43
43
|
|
|
44
44
|
const A=r=>r!==null&&typeof r=="object",a=(r,t)=>Object.assign(new Error(`[${r}]: ${t}`),{code:r}),_="ERR_INVALID_PACKAGE_CONFIG",E$1="ERR_INVALID_PACKAGE_TARGET",I="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(_,"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(_,'"exports" cannot contain some keys starting with "." and some not')},void 0),u$1=/^\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,t==="."?'No "exports" main defined':`Package subpath '${t}' is not defined by "exports"`);for(const i of n)if(!i.startsWith("./")&&!u$1.test(i))throw a(E$1,`Invalid "exports" target "${i}" defined in the package config`);return n};
|
|
45
45
|
|
|
46
|
-
var ae=Object.defineProperty;var u=(e,t)=>ae(e,"name",{value:t,configurable:!0});function E(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}u(E,"slash");const h=u(e=>{const t=
|
|
46
|
+
var ae=Object.defineProperty;var u=(e,t)=>ae(e,"name",{value:t,configurable:!0});function E(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}u(E,"slash");const h=u(e=>{const t=W[e];return (i,...n)=>{const l=`${e}:${n.join(":")}`;let o=i==null?void 0:i.get(l);return o===void 0&&(o=Reflect.apply(t,W,n),i==null||i.set(l,o)),o}},"cacheFs"),L=h("existsSync"),we=h("readFileSync"),P=h("statSync"),K=u((e,t,i)=>{for(;;){const n=p$1.posix.join(e,t);if(L(i,n))return n;const l=p$1.dirname(e);if(l===e)return;e=l;}},"findUp"),J=/^\.{1,2}(\/.*)?$/,M=u(e=>{const t=E(e);return J.test(t)?t:`./${t}`},"normalizePath");function Te(e,t=!1){const i=e.length;let n=0,l="",o=0,s=16,c=0,f=0,w=0,A=0,k=0;function O(r,g){let m=0,_=0;for(;m<r||!g;){let j=e.charCodeAt(n);if(j>=48&&j<=57)_=_*16+j-48;else if(j>=65&&j<=70)_=_*16+j-65+10;else if(j>=97&&j<=102)_=_*16+j-97+10;else break;n++,m++;}return m<r&&(_=-1),_}u(O,"scanHexDigits");function T(r){n=r,l="",o=0,s=16,k=0;}u(T,"setPosition");function v(){let r=n;if(e.charCodeAt(n)===48)n++;else for(n++;n<e.length&&F(e.charCodeAt(n));)n++;if(n<e.length&&e.charCodeAt(n)===46)if(n++,n<e.length&&F(e.charCodeAt(n)))for(n++;n<e.length&&F(e.charCodeAt(n));)n++;else return k=3,e.substring(r,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&&F(e.charCodeAt(n))){for(n++;n<e.length&&F(e.charCodeAt(n));)n++;g=n;}else k=3;return e.substring(r,g)}u(v,"scanNumber");function b(){let r="",g=n;for(;;){if(n>=i){r+=e.substring(g,n),k=2;break}const m=e.charCodeAt(n);if(m===34){r+=e.substring(g,n),n++;break}if(m===92){if(r+=e.substring(g,n),n++,n>=i){k=2;break}switch(e.charCodeAt(n++)){case 34:r+='"';break;case 92:r+="\\";break;case 47:r+="/";break;case 98:r+="\b";break;case 102:r+="\f";break;case 110:r+=`
|
|
47
47
|
`;break;case 114:r+="\r";break;case 116:r+=" ";break;case 117:const j=O(4,!0);j>=0?r+=String.fromCharCode(j):k=4;break;default:k=5;}g=n;continue}if(m>=0&&m<=31)if(x(m)){r+=e.substring(g,n),k=2;break}else k=6;n++;}return r}u(b,"scanString");function B(){if(l="",k=0,o=n,f=c,A=w,n>=i)return o=i,s=17;let r=e.charCodeAt(n);if(R(r)){do n++,l+=String.fromCharCode(r),r=e.charCodeAt(n);while(R(r));return s=15}if(x(r))return n++,l+=String.fromCharCode(r),r===13&&e.charCodeAt(n)===10&&(n++,l+=`
|
|
48
48
|
`),c++,w=n,s=14;switch(r){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++,l=b(),s=10;case 47:const g=n-1;if(e.charCodeAt(n+1)===47){for(n+=2;n<i&&!x(e.charCodeAt(n));)n++;return l=e.substring(g,n),s=12}if(e.charCodeAt(n+1)===42){n+=2;const m=i-1;let _=!1;for(;n<m;){const j=e.charCodeAt(n);if(j===42&&e.charCodeAt(n+1)===47){n+=2,_=!0;break}n++,x(j)&&(j===13&&e.charCodeAt(n)===10&&n++,c++,w=n);}return _||(n++,k=1),l=e.substring(g,n),s=13}return l+=String.fromCharCode(r),n++,s=16;case 45:if(l+=String.fromCharCode(r),n++,n===i||!F(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 l+=v(),s=11;default:for(;n<i&&U(r);)n++,r=e.charCodeAt(n);if(o!==n){switch(l=e.substring(o,n),l){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return l+=String.fromCharCode(r),n++,s=16}}u(B,"scanNext");function U(r){if(R(r)||x(r))return !1;switch(r){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return !1}return !0}u(U,"isUnknownContentCharacter");function y(){let r;do r=B();while(r>=12&&r<=15);return r}return u(y,"scanNextNonTrivia"),{setPosition:T,getPosition:()=>n,scan:t?y:B,getToken:()=>s,getTokenValue:()=>l,getTokenOffset:()=>o,getTokenLength:()=>n-o,getTokenStartLine:()=>f,getTokenStartCharacter:()=>o-A,getTokenError:()=>k}}u(Te,"createScanner");function R(e){return e===32||e===9}u(R,"isWhiteSpace");function x(e){return e===10||e===13}u(x,"isLineBreak");function F(e){return e>=48&&e<=57}u(F,"isDigit");var C;((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";}))(C||(C={})),new Array(20).fill(0).map((e,t)=>" ".repeat(t));const N=200;new Array(N).fill(0).map((e,t)=>`
|
|
49
49
|
`+" ".repeat(t)),new Array(N).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(N).fill(0).map((e,t)=>`\r
|
|
50
50
|
`+" ".repeat(t)),new Array(N).fill(0).map((e,t)=>`
|
|
51
51
|
`+" ".repeat(t)),new Array(N).fill(0).map((e,t)=>"\r"+" ".repeat(t)),new Array(N).fill(0).map((e,t)=>`\r
|
|
52
|
-
`+" ".repeat(t));var D;(function(e){e.DEFAULT={allowTrailingComma:!1};})(D||(D={}));function ve(e,t=[],i=D.DEFAULT){let n=null,l=[];const o=[];function s(f){Array.isArray(l)?l.push(f):n!==null&&(l[n]=f);}return u(s,"onValue"),Ae(e,{onObjectBegin:()=>{const f={};s(f),o.push(l),l=f,n=null;},onObjectProperty:f=>{n=f;},onObjectEnd:()=>{l=o.pop();},onArrayBegin:()=>{const f=[];s(f),o.push(l),l=f,n=null;},onArrayEnd:()=>{l=o.pop();},onLiteralValue:s,onError:(f,w,A)=>{t.push({error:f,offset:w,length:A});}},i),l[0]}u(ve,"parse$1");function Ae(e,t,i=D.DEFAULT){const n=Te(e,!1),l=[];function o(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}u(o,"toNoArgVisit");function s(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>l.slice()):()=>!0}u(s,"toNoArgVisitWithPath");function c(a){return a?$=>a($,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}u(c,"toOneArgVisit");function f(a){return a?$=>a($,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>l.slice()):()=>!0}u(f,"toOneArgVisitWithPath");const w=s(t.onObjectBegin),A=f(t.onObjectProperty),k=o(t.onObjectEnd),O=s(t.onArrayBegin),T=o(t.onArrayEnd),v=f(t.onLiteralValue),b=c(t.onSeparator),B=o(t.onComment),U=c(t.onError),y=i&&i.disallowComments,r=i&&i.allowTrailingComma;function g(){for(;;){const a=n.scan();switch(n.getTokenError()){case 4:m(14);break;case 5:m(15);break;case 3:m(13);break;case 1:y||m(11);break;case 2:m(12);break;case 6:m(16);break}switch(a){case 12:case 13:y?m(10):B();break;case 16:m(1);break;case 15:case 14:break;default:return a}}}u(g,"scanNext");function m(a,$=[],q=[]){if(U(a),$.length+q.length>0){let I=n.getToken();for(;I!==17;){if($.indexOf(I)!==-1){g();break}else if(q.indexOf(I)!==-1)break;I=g();}}}u(m,"handleError");function _(a){const $=n.getTokenValue();return a?v($):(A($),l.push($)),g(),!0}u(_,"parseString");function j(){switch(n.getToken()){case 11:const a=n.getTokenValue();let $=Number(a);isNaN($)&&(m(2),$=0),v($);break;case 7:v(null);break;case 8:v(!0);break;case 9:v(!1);break;default:return !1}return g(),!0}u(j,"parseLiteral");function pe(){return n.getToken()!==10?(m(3,[],[2,5]),!1):(_(!1),n.getToken()===6?(b(":"),g(),d()||m(4,[],[2,5])):m(5,[],[2,5]),l.pop(),!0)}u(pe,"parseProperty");function me(){w(),g();let a=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(a||m(4,[],[]),b(","),g(),n.getToken()===2&&r)break}else a&&m(6,[],[]);pe()||m(4,[],[2,5]),a=!0;}return k(),n.getToken()!==2?m(7,[2],[]):g(),!0}u(me,"parseObject");function ge(){O(),g();let a=!0,$=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if($||m(4,[],[]),b(","),g(),n.getToken()===4&&r)break}else $&&m(6,[],[]);a?(l.push(0),a=!1):l[l.length-1]++,d()||m(4,[],[4,5]),$=!0;}return T(),a||l.pop(),n.getToken()!==4?m(8,[4],[]):g(),!0}u(ge,"parseArray");function d(){switch(n.getToken()){case 3:return ge();case 1:return me();case 10:return _(!0);default:return j()}}return u(d,"parseValue"),g(),n.getToken()===17?i.allowEmptyContent?!0:(m(4,[],[]),!1):d()?(n.getToken()!==17&&m(9,[],[]),!0):(m(4,[],[]),!1)}u(Ae,"visit");var ee;(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";})(ee||(ee={}));var ne;(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";})(ne||(ne={}));const Oe=ve;var te;(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";})(te||(te={}));const ie=u((e,t)=>Oe(we(t,e,"utf8")),"readJsonc"),G=Symbol("implicitBaseUrl"),je=u(()=>{const{findPnpApi:e}=ke;return e&&e(process.cwd())},"getPnpApi"),z=u((e,t,i,n)=>{const l=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(n!=null&&n.has(l))return n.get(l);const o=ie(e,n);if(!o)return;let s=t||"tsconfig.json";if(!i&&o.exports)try{const[c]=v(o.exports,t,["require","types"]);s=c;}catch{return !1}else !t&&o.tsconfig&&(s=o.tsconfig);return s=p$1.join(e,"..",s),n==null||n.set(l,s),s},"resolveFromPackageJsonPath"),Q="package.json",H="tsconfig.json",$e=u((e,t,i)=>{let n=e;if(e===".."&&(n=p$1.join(n,H)),e[0]==="."&&(n=p$1.resolve(t,n)),p$1.isAbsolute(n)){if(L(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const T=`${n}.json`;if(L(i,T))return T}return}const[l,...o]=e.split("/"),s=l[0]==="@"?`${l}/${o.shift()}`:l,c=o.join("/"),f=je();if(f){const{resolveRequest:T}=f;try{if(s===e){const v=T(p$1.join(s,Q),t);if(v){const b=z(v,c,!1,i);if(b&&L(i,b))return b}}else {let v;try{v=T(e,t,{extensions:[".json"]});}catch{v=T(p$1.join(e,H),t);}if(v)return v}}catch{}}const w=K(p$1.resolve(t),p$1.join("node_modules",s),i);if(!w||!P(i,w).isDirectory())return;const A=p$1.join(w,Q);if(L(i,A)){const T=z(A,c,!1,i);if(T===!1)return;if(T&&L(i,T)&&P(i,T).isFile())return T}const k=p$1.join(w,c),O=k.endsWith(".json");if(!O){const T=`${k}.json`;if(L(i,T))return T}if(L(i,k)){if(P(i,k).isDirectory()){const T=p$1.join(k,Q);if(L(i,T)){const b=z(T,"",!0,i);if(b&&L(i,b))return b}const v=p$1.join(k,H);if(L(i,v))return v}else if(O)return k}},"resolveExtendsPath"),Be=u((e,t,i,n)=>{const l=$e(e,t,n);if(!l)throw new Error(`File '${e}' not found.`);if(i.has(l))throw new Error(`Circularity detected while resolving configuration: ${l}`);i.add(l);const o=p$1.dirname(l),s=le(l,n,i);delete s.references;const{compilerOptions:c}=s;if(c){const f=["baseUrl","outDir"];for(const w of f){const A=c[w];A&&(c[w]=E(p$1.relative(t,p$1.join(o,A)))||"./");}}return s.files&&(s.files=s.files.map(f=>E(p$1.relative(t,p$1.join(o,f))))),s.include&&(s.include=s.include.map(f=>E(p$1.relative(t,p$1.join(o,f))))),s.exclude&&(s.exclude=s.exclude.map(f=>E(p$1.relative(t,p$1.join(o,f))))),s},"resolveExtends"),le=u((e,t,i=new Set)=>{let n;try{n=ie(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 l=p$1.dirname(e);if(n.compilerOptions){const{compilerOptions:o}=n;o.paths&&!o.baseUrl&&(o[G]=l);}if(n.extends){const o=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const s of o.reverse()){const c=Be(s,l,new Set(i),t),f={...c,...n,compilerOptions:{...c.compilerOptions,...n.compilerOptions}};c.watchOptions&&(f.watchOptions={...c.watchOptions,...n.watchOptions}),n=f;}}if(n.compilerOptions){const{compilerOptions:o}=n,s=["baseUrl","rootDir"];for(const f of s){const w=o[f];if(w){const A=p$1.resolve(l,w),k=M(p$1.relative(l,A));o[f]=k;}}const{outDir:c}=o;c&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(c)||n.exclude.push(c),o.outDir=M(c));}else n.compilerOptions={};if(n.files&&(n.files=n.files.map(M)),n.include&&(n.include=n.include.map(E)),n.watchOptions){const{watchOptions:o}=n;o.excludeDirectories&&(o.excludeDirectories=o.excludeDirectories.map(s=>E(p$1.resolve(l,s))));}return n},"_parseTsconfig"),se=u((e,t=new Map)=>le(p$1.resolve(e),t),"parseTsconfig"),_e=u((e=process.cwd(),t="tsconfig.json",i=new Map)=>{const n=K(E(e),t,i);if(!n)return null;const l=se(n,i);return {path:n,config:l}},"getTsconfig"),Ee=/\*/g,oe=u((e,t)=>{const i=e.match(Ee);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),Le=u(e=>{if(e.includes("*")){const[t,i]=e.split("*");return {prefix:t,suffix:i}}return e},"parsePattern"),Ue=u(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),ye=u((e,t,i)=>Object.entries(e).map(([n,l])=>(oe(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:Le(n),substitutions:l.map(o=>{if(oe(o,`Substitution '${o}' in pattern '${n}' can have at most one '*' character.`),!t&&!J.test(o))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return p$1.resolve(i,o)})})),"parsePaths");u(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const l=G in t&&t[G],o=p$1.resolve(p$1.dirname(e.path),i||l||"."),s=n?ye(n,i,o):[];return c=>{if(J.test(c))return [];const f=[];for(const O of s){if(O.pattern===c)return O.substitutions.map(E);typeof O.pattern!="string"&&f.push(O);}let w,A=-1;for(const O of f)Ue(O.pattern,c)&&O.pattern.prefix.length>A&&(A=O.pattern.prefix.length,w=O);if(!w)return i?[E(p$1.join(o,c))]:[];const k=c.slice(w.pattern.prefix.length,c.length-w.pattern.suffix.length);return w.substitutions.map(O=>E(O.replace("*",k)))}},"createPathsMatcher");const re=u(e=>{let t="";for(let i=0;i<e.length;i+=1){const n=e[i],l=n.toUpperCase();t+=n===l?n.toLowerCase():l;}return t},"s"),Ne=65,xe=97,Ie=u(()=>Math.floor(Math.random()*26),"m"),Pe=u(e=>Array.from({length:e},()=>String.fromCodePoint(Ie()+(Math.random()>.5?Ne:xe))).join(""),"S"),De=u((e=require$$0)=>{const t=process.execPath;if(e.existsSync(t))return !e.existsSync(re(t));const i=`/${Pe(10)}`;e.writeFileSync(i,"");const n=!e.existsSync(re(i));return e.unlinkSync(i),n},"l"),{join:V}=p$1.posix,X={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Ve=u(e=>{const t=[...X.ts],i=[...X.cts],n=[...X.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Se=u(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),ue=u(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeForRegexp"),de=["node_modules","bower_components","jspm_packages"],Y=`(?!(${de.join("|")})(/|$))`,We=/(?:^|\/)[^.*?]+$/,fe="**/*",S="[^/]",Z="[^./]",ce=process.platform==="win32";u(({config:e,path:t},i=De())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!p$1.isAbsolute(t))throw new Error("The tsconfig path must be absolute");ce&&(t=E(t));const n=p$1.dirname(t),{files:l,include:o,exclude:s,compilerOptions:c}=e,f=l==null?void 0:l.map(b=>V(n,b)),w=Ve(c),A=i?"":"i",O=(s||Se(c)).map(b=>{const B=V(n,b),U=ue(B).replaceAll("\\*\\*/","(.+/)?").replaceAll("\\*",`${S}*`).replaceAll("\\?",S);return new RegExp(`^${U}($|/)`,A)}),T=l||o?o:[fe],v=T?T.map(b=>{let B=V(n,b);We.test(B)&&(B=V(B,fe));const U=ue(B).replaceAll("/\\*\\*",`(/${Y}${Z}${S}*)*?`).replaceAll(/(\/)?\\\*/g,(y,r)=>{const g=`(${Z}|(\\.(?!min\\.js$))?)*`;return r?`/${Y}${Z}${g}`:g}).replaceAll(/(\/)?\\\?/g,(y,r)=>{const g=S;return r?`/${Y}${g}`:g});return new RegExp(`^${U}$`,A)}):void 0;return b=>{if(!p$1.isAbsolute(b))throw new Error("filePath must be absolute");if(ce&&(b=E(b)),f!=null&&f.includes(b))return e;if(!(!w.some(B=>b.endsWith(B))||O.some(B=>B.test(b)))&&v&&v.some(B=>B.test(b)))return e}},"createFilesMatcher");
|
|
52
|
+
`+" ".repeat(t));var D;(function(e){e.DEFAULT={allowTrailingComma:!1};})(D||(D={}));function ve(e,t=[],i=D.DEFAULT){let n=null,l=[];const o=[];function s(f){Array.isArray(l)?l.push(f):n!==null&&(l[n]=f);}return u(s,"onValue"),Ae(e,{onObjectBegin:()=>{const f={};s(f),o.push(l),l=f,n=null;},onObjectProperty:f=>{n=f;},onObjectEnd:()=>{l=o.pop();},onArrayBegin:()=>{const f=[];s(f),o.push(l),l=f,n=null;},onArrayEnd:()=>{l=o.pop();},onLiteralValue:s,onError:(f,w,A)=>{t.push({error:f,offset:w,length:A});}},i),l[0]}u(ve,"parse$1");function Ae(e,t,i=D.DEFAULT){const n=Te(e,!1),l=[];function o(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}u(o,"toNoArgVisit");function s(a){return a?()=>a(n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>l.slice()):()=>!0}u(s,"toNoArgVisitWithPath");function c(a){return a?$=>a($,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter()):()=>!0}u(c,"toOneArgVisit");function f(a){return a?$=>a($,n.getTokenOffset(),n.getTokenLength(),n.getTokenStartLine(),n.getTokenStartCharacter(),()=>l.slice()):()=>!0}u(f,"toOneArgVisitWithPath");const w=s(t.onObjectBegin),A=f(t.onObjectProperty),k=o(t.onObjectEnd),O=s(t.onArrayBegin),T=o(t.onArrayEnd),v=f(t.onLiteralValue),b=c(t.onSeparator),B=o(t.onComment),U=c(t.onError),y=i&&i.disallowComments,r=i&&i.allowTrailingComma;function g(){for(;;){const a=n.scan();switch(n.getTokenError()){case 4:m(14);break;case 5:m(15);break;case 3:m(13);break;case 1:y||m(11);break;case 2:m(12);break;case 6:m(16);break}switch(a){case 12:case 13:y?m(10):B();break;case 16:m(1);break;case 15:case 14:break;default:return a}}}u(g,"scanNext");function m(a,$=[],q=[]){if(U(a),$.length+q.length>0){let I=n.getToken();for(;I!==17;){if($.indexOf(I)!==-1){g();break}else if(q.indexOf(I)!==-1)break;I=g();}}}u(m,"handleError");function _(a){const $=n.getTokenValue();return a?v($):(A($),l.push($)),g(),!0}u(_,"parseString");function j(){switch(n.getToken()){case 11:const a=n.getTokenValue();let $=Number(a);isNaN($)&&(m(2),$=0),v($);break;case 7:v(null);break;case 8:v(!0);break;case 9:v(!1);break;default:return !1}return g(),!0}u(j,"parseLiteral");function pe(){return n.getToken()!==10?(m(3,[],[2,5]),!1):(_(!1),n.getToken()===6?(b(":"),g(),d()||m(4,[],[2,5])):m(5,[],[2,5]),l.pop(),!0)}u(pe,"parseProperty");function me(){w(),g();let a=!1;for(;n.getToken()!==2&&n.getToken()!==17;){if(n.getToken()===5){if(a||m(4,[],[]),b(","),g(),n.getToken()===2&&r)break}else a&&m(6,[],[]);pe()||m(4,[],[2,5]),a=!0;}return k(),n.getToken()!==2?m(7,[2],[]):g(),!0}u(me,"parseObject");function ge(){O(),g();let a=!0,$=!1;for(;n.getToken()!==4&&n.getToken()!==17;){if(n.getToken()===5){if($||m(4,[],[]),b(","),g(),n.getToken()===4&&r)break}else $&&m(6,[],[]);a?(l.push(0),a=!1):l[l.length-1]++,d()||m(4,[],[4,5]),$=!0;}return T(),a||l.pop(),n.getToken()!==4?m(8,[4],[]):g(),!0}u(ge,"parseArray");function d(){switch(n.getToken()){case 3:return ge();case 1:return me();case 10:return _(!0);default:return j()}}return u(d,"parseValue"),g(),n.getToken()===17?i.allowEmptyContent?!0:(m(4,[],[]),!1):d()?(n.getToken()!==17&&m(9,[],[]),!0):(m(4,[],[]),!1)}u(Ae,"visit");var ee;(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";})(ee||(ee={}));var ne;(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";})(ne||(ne={}));const Oe=ve;var te;(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";})(te||(te={}));const ie=u((e,t)=>Oe(we(t,e,"utf8")),"readJsonc"),G=Symbol("implicitBaseUrl"),je=u(()=>{const{findPnpApi:e}=ke;return e&&e(process.cwd())},"getPnpApi"),z=u((e,t,i,n)=>{const l=`resolveFromPackageJsonPath:${e}:${t}:${i}`;if(n!=null&&n.has(l))return n.get(l);const o=ie(e,n);if(!o)return;let s=t||"tsconfig.json";if(!i&&o.exports)try{const[c]=v(o.exports,t,["require","types"]);s=c;}catch{return !1}else !t&&o.tsconfig&&(s=o.tsconfig);return s=p$1.join(e,"..",s),n==null||n.set(l,s),s},"resolveFromPackageJsonPath"),Q="package.json",H="tsconfig.json",$e=u((e,t,i)=>{let n=e;if(e===".."&&(n=p$1.join(n,H)),e[0]==="."&&(n=p$1.resolve(t,n)),p$1.isAbsolute(n)){if(L(i,n)){if(P(i,n).isFile())return n}else if(!n.endsWith(".json")){const T=`${n}.json`;if(L(i,T))return T}return}const[l,...o]=e.split("/"),s=l[0]==="@"?`${l}/${o.shift()}`:l,c=o.join("/"),f=je();if(f){const{resolveRequest:T}=f;try{if(s===e){const v=T(p$1.join(s,Q),t);if(v){const b=z(v,c,!1,i);if(b&&L(i,b))return b}}else {let v;try{v=T(e,t,{extensions:[".json"]});}catch{v=T(p$1.join(e,H),t);}if(v)return v}}catch{}}const w=K(p$1.resolve(t),p$1.join("node_modules",s),i);if(!w||!P(i,w).isDirectory())return;const A=p$1.join(w,Q);if(L(i,A)){const T=z(A,c,!1,i);if(T===!1)return;if(T&&L(i,T)&&P(i,T).isFile())return T}const k=p$1.join(w,c),O=k.endsWith(".json");if(!O){const T=`${k}.json`;if(L(i,T))return T}if(L(i,k)){if(P(i,k).isDirectory()){const T=p$1.join(k,Q);if(L(i,T)){const b=z(T,"",!0,i);if(b&&L(i,b))return b}const v=p$1.join(k,H);if(L(i,v))return v}else if(O)return k}},"resolveExtendsPath"),Be=u((e,t,i,n)=>{const l=$e(e,t,n);if(!l)throw new Error(`File '${e}' not found.`);if(i.has(l))throw new Error(`Circularity detected while resolving configuration: ${l}`);i.add(l);const o=p$1.dirname(l),s=le(l,n,i);delete s.references;const{compilerOptions:c}=s;if(c){const f=["baseUrl","outDir"];for(const w of f){const A=c[w];A&&(c[w]=E(p$1.relative(t,p$1.join(o,A)))||"./");}}return s.files&&(s.files=s.files.map(f=>E(p$1.relative(t,p$1.join(o,f))))),s.include&&(s.include=s.include.map(f=>E(p$1.relative(t,p$1.join(o,f))))),s.exclude&&(s.exclude=s.exclude.map(f=>E(p$1.relative(t,p$1.join(o,f))))),s},"resolveExtends"),le=u((e,t,i=new Set)=>{let n;try{n=ie(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 l=p$1.dirname(e);if(n.compilerOptions){const{compilerOptions:o}=n;o.paths&&!o.baseUrl&&(o[G]=l);}if(n.extends){const o=Array.isArray(n.extends)?n.extends:[n.extends];delete n.extends;for(const s of o.reverse()){const c=Be(s,l,new Set(i),t),f={...c,...n,compilerOptions:{...c.compilerOptions,...n.compilerOptions}};c.watchOptions&&(f.watchOptions={...c.watchOptions,...n.watchOptions}),n=f;}}if(n.compilerOptions){const{compilerOptions:o}=n,s=["baseUrl","rootDir"];for(const f of s){const w=o[f];if(w){const A=p$1.resolve(l,w),k=M(p$1.relative(l,A));o[f]=k;}}const{outDir:c}=o;c&&(Array.isArray(n.exclude)||(n.exclude=[]),n.exclude.includes(c)||n.exclude.push(c),o.outDir=M(c));}else n.compilerOptions={};if(n.files&&(n.files=n.files.map(M)),n.include&&(n.include=n.include.map(E)),n.watchOptions){const{watchOptions:o}=n;o.excludeDirectories&&(o.excludeDirectories=o.excludeDirectories.map(s=>E(p$1.resolve(l,s))));}return n},"_parseTsconfig"),se=u((e,t=new Map)=>le(p$1.resolve(e),t),"parseTsconfig"),_e=u((e=process.cwd(),t="tsconfig.json",i=new Map)=>{const n=K(E(e),t,i);if(!n)return null;const l=se(n,i);return {path:n,config:l}},"getTsconfig"),Ee=/\*/g,oe=u((e,t)=>{const i=e.match(Ee);if(i&&i.length>1)throw new Error(t)},"assertStarCount"),Le=u(e=>{if(e.includes("*")){const[t,i]=e.split("*");return {prefix:t,suffix:i}}return e},"parsePattern"),Ue=u(({prefix:e,suffix:t},i)=>i.startsWith(e)&&i.endsWith(t),"isPatternMatch"),ye=u((e,t,i)=>Object.entries(e).map(([n,l])=>(oe(n,`Pattern '${n}' can have at most one '*' character.`),{pattern:Le(n),substitutions:l.map(o=>{if(oe(o,`Substitution '${o}' in pattern '${n}' can have at most one '*' character.`),!t&&!J.test(o))throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");return p$1.resolve(i,o)})})),"parsePaths");u(e=>{const{compilerOptions:t}=e.config;if(!t)return null;const{baseUrl:i,paths:n}=t;if(!i&&!n)return null;const l=G in t&&t[G],o=p$1.resolve(p$1.dirname(e.path),i||l||"."),s=n?ye(n,i,o):[];return c=>{if(J.test(c))return [];const f=[];for(const O of s){if(O.pattern===c)return O.substitutions.map(E);typeof O.pattern!="string"&&f.push(O);}let w,A=-1;for(const O of f)Ue(O.pattern,c)&&O.pattern.prefix.length>A&&(A=O.pattern.prefix.length,w=O);if(!w)return i?[E(p$1.join(o,c))]:[];const k=c.slice(w.pattern.prefix.length,c.length-w.pattern.suffix.length);return w.substitutions.map(O=>E(O.replace("*",k)))}},"createPathsMatcher");const re=u(e=>{let t="";for(let i=0;i<e.length;i+=1){const n=e[i],l=n.toUpperCase();t+=n===l?n.toLowerCase():l;}return t},"s"),Ne=65,xe=97,Ie=u(()=>Math.floor(Math.random()*26),"m"),Pe=u(e=>Array.from({length:e},()=>String.fromCodePoint(Ie()+(Math.random()>.5?Ne:xe))).join(""),"S"),De=u((e=W)=>{const t=process.execPath;if(e.existsSync(t))return !e.existsSync(re(t));const i=`/${Pe(10)}`;e.writeFileSync(i,"");const n=!e.existsSync(re(i));return e.unlinkSync(i),n},"l"),{join:V}=p$1.posix,X={ts:[".ts",".tsx",".d.ts"],cts:[".cts",".d.cts"],mts:[".mts",".d.mts"]},Ve=u(e=>{const t=[...X.ts],i=[...X.cts],n=[...X.mts];return e!=null&&e.allowJs&&(t.push(".js",".jsx"),i.push(".cjs"),n.push(".mjs")),[...t,...i,...n]},"getSupportedExtensions"),Se=u(e=>{const t=[];if(!e)return t;const{outDir:i,declarationDir:n}=e;return i&&t.push(i),n&&t.push(n),t},"getDefaultExcludeSpec"),ue=u(e=>e.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&"),"escapeForRegexp"),de=["node_modules","bower_components","jspm_packages"],Y=`(?!(${de.join("|")})(/|$))`,We=/(?:^|\/)[^.*?]+$/,fe="**/*",S="[^/]",Z="[^./]",ce=process.platform==="win32";u(({config:e,path:t},i=De())=>{if("extends"in e)throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");if(!p$1.isAbsolute(t))throw new Error("The tsconfig path must be absolute");ce&&(t=E(t));const n=p$1.dirname(t),{files:l,include:o,exclude:s,compilerOptions:c}=e,f=l==null?void 0:l.map(b=>V(n,b)),w=Ve(c),A=i?"":"i",O=(s||Se(c)).map(b=>{const B=V(n,b),U=ue(B).replaceAll("\\*\\*/","(.+/)?").replaceAll("\\*",`${S}*`).replaceAll("\\?",S);return new RegExp(`^${U}($|/)`,A)}),T=l||o?o:[fe],v=T?T.map(b=>{let B=V(n,b);We.test(B)&&(B=V(B,fe));const U=ue(B).replaceAll("/\\*\\*",`(/${Y}${Z}${S}*)*?`).replaceAll(/(\/)?\\\*/g,(y,r)=>{const g=`(${Z}|(\\.(?!min\\.js$))?)*`;return r?`/${Y}${Z}${g}`:g}).replaceAll(/(\/)?\\\?/g,(y,r)=>{const g=S;return r?`/${Y}${g}`:g});return new RegExp(`^${U}$`,A)}):void 0;return b=>{if(!p$1.isAbsolute(b))throw new Error("filePath must be absolute");if(ce&&(b=E(b)),f!=null&&f.includes(b))return e;if(!(!w.some(B=>b.endsWith(B))||O.some(B=>B.test(b)))&&v&&v.some(B=>B.test(b)))return e}},"createFilesMatcher");
|
|
53
53
|
|
|
54
54
|
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
55
55
|
const newLineRegExp = /\r?\n/;
|
|
@@ -181,35 +181,6 @@ function ancestor(node, visitors, baseVisitor, state, override) {
|
|
|
181
181
|
})(node, state, override);
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
function makeTest(test) {
|
|
185
|
-
if (typeof test === "string")
|
|
186
|
-
{ return function (type) { return type === test; } }
|
|
187
|
-
else if (!test)
|
|
188
|
-
{ return function () { return true; } }
|
|
189
|
-
else
|
|
190
|
-
{ return test }
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
var Found = function Found(node, state) { this.node = node; this.state = state; };
|
|
194
|
-
|
|
195
|
-
// Find the innermost node of a given type that contains the given
|
|
196
|
-
// position. Interface similar to findNodeAt.
|
|
197
|
-
function findNodeAround(node, pos, test, baseVisitor, state) {
|
|
198
|
-
test = makeTest(test);
|
|
199
|
-
if (!baseVisitor) { baseVisitor = base; }
|
|
200
|
-
try {
|
|
201
|
-
(function c(node, st, override) {
|
|
202
|
-
var type = override || node.type;
|
|
203
|
-
if (node.start > pos || node.end < pos) { return }
|
|
204
|
-
baseVisitor[type](node, st, c);
|
|
205
|
-
if (test(type, node)) { throw new Found(node, st) }
|
|
206
|
-
})(node, state);
|
|
207
|
-
} catch (e) {
|
|
208
|
-
if (e instanceof Found) { return e }
|
|
209
|
-
throw e
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
|
|
213
184
|
function skipThrough(node, st, c) { c(node, st); }
|
|
214
185
|
function ignore(_node, _st, _c) {}
|
|
215
186
|
|
|
@@ -480,16 +451,18 @@ async function collectTests(ctx, filepath) {
|
|
|
480
451
|
}
|
|
481
452
|
const ast = await parseAstAsync(request.code);
|
|
482
453
|
const testFilepath = relative(ctx.config.root, filepath);
|
|
454
|
+
const projectName = ctx.getName();
|
|
455
|
+
const typecheckSubprojectName = projectName ? `${projectName}:__typecheck__` : "__typecheck__";
|
|
483
456
|
const file = {
|
|
484
457
|
filepath,
|
|
485
458
|
type: "suite",
|
|
486
|
-
id: generateHash(`${testFilepath}${
|
|
459
|
+
id: generateHash(`${testFilepath}${typecheckSubprojectName}`),
|
|
487
460
|
name: testFilepath,
|
|
488
461
|
mode: "run",
|
|
489
462
|
tasks: [],
|
|
490
463
|
start: ast.start,
|
|
491
464
|
end: ast.end,
|
|
492
|
-
projectName
|
|
465
|
+
projectName,
|
|
493
466
|
meta: { typecheck: true },
|
|
494
467
|
file: null
|
|
495
468
|
};
|
|
@@ -502,6 +475,12 @@ async function collectTests(ctx, filepath) {
|
|
|
502
475
|
if (callee.type === "Identifier") {
|
|
503
476
|
return callee.name;
|
|
504
477
|
}
|
|
478
|
+
if (callee.type === "CallExpression") {
|
|
479
|
+
return getName(callee.callee);
|
|
480
|
+
}
|
|
481
|
+
if (callee.type === "TaggedTemplateExpression") {
|
|
482
|
+
return getName(callee.tag);
|
|
483
|
+
}
|
|
505
484
|
if (callee.type === "MemberExpression") {
|
|
506
485
|
if (callee.object?.name?.startsWith("__vite_ssr_")) {
|
|
507
486
|
return getName(callee.property);
|
|
@@ -520,25 +499,34 @@ async function collectTests(ctx, filepath) {
|
|
|
520
499
|
if (!["it", "test", "describe", "suite"].includes(name)) {
|
|
521
500
|
return;
|
|
522
501
|
}
|
|
523
|
-
const {
|
|
524
|
-
arguments: [{ value: message }]
|
|
525
|
-
} = node;
|
|
526
502
|
const property = callee?.property?.name;
|
|
527
|
-
|
|
528
|
-
if (
|
|
529
|
-
|
|
530
|
-
`${name}.${mode} syntax is not supported when testing types`
|
|
531
|
-
);
|
|
503
|
+
const mode = !property || property === name ? "run" : property;
|
|
504
|
+
if (mode === "each" || mode === "skipIf" || mode === "runIf" || mode === "for") {
|
|
505
|
+
return;
|
|
532
506
|
}
|
|
533
|
-
|
|
534
|
-
|
|
507
|
+
let start;
|
|
508
|
+
const end = node.end;
|
|
509
|
+
if (callee.type === "CallExpression") {
|
|
510
|
+
start = callee.end;
|
|
511
|
+
} else if (callee.type === "TaggedTemplateExpression") {
|
|
512
|
+
start = callee.end + 1;
|
|
513
|
+
} else {
|
|
514
|
+
start = node.start;
|
|
535
515
|
}
|
|
516
|
+
const {
|
|
517
|
+
arguments: [messageNode]
|
|
518
|
+
} = node;
|
|
519
|
+
if (!messageNode) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
const message = getNodeAsString(messageNode, request.code);
|
|
536
523
|
definitions.push({
|
|
537
|
-
start
|
|
538
|
-
end
|
|
524
|
+
start,
|
|
525
|
+
end,
|
|
539
526
|
name: message,
|
|
540
527
|
type: name === "it" || name === "test" ? "test" : "suite",
|
|
541
|
-
mode
|
|
528
|
+
mode,
|
|
529
|
+
task: null
|
|
542
530
|
});
|
|
543
531
|
}
|
|
544
532
|
});
|
|
@@ -610,6 +598,35 @@ async function collectTests(ctx, filepath) {
|
|
|
610
598
|
definitions
|
|
611
599
|
};
|
|
612
600
|
}
|
|
601
|
+
function getNodeAsString(node, code) {
|
|
602
|
+
if (node.type === "Literal") {
|
|
603
|
+
return String(node.value);
|
|
604
|
+
} else if (node.type === "Identifier") {
|
|
605
|
+
return node.name;
|
|
606
|
+
} else if (node.type === "TemplateLiteral") {
|
|
607
|
+
return mergeTemplateLiteral(node, code);
|
|
608
|
+
} else {
|
|
609
|
+
return code.slice(node.start, node.end);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
function mergeTemplateLiteral(node, code) {
|
|
613
|
+
let result = "";
|
|
614
|
+
let expressionsIndex = 0;
|
|
615
|
+
for (let quasisIndex = 0; quasisIndex < node.quasis.length; quasisIndex++) {
|
|
616
|
+
result += node.quasis[quasisIndex].value.raw;
|
|
617
|
+
if (expressionsIndex in node.expressions) {
|
|
618
|
+
const expression = node.expressions[expressionsIndex];
|
|
619
|
+
const string = expression.type === "Literal" ? expression.raw : getNodeAsString(expression, code);
|
|
620
|
+
if (expression.type === "TemplateLiteral") {
|
|
621
|
+
result += `\${\`${string}\`}`;
|
|
622
|
+
} else {
|
|
623
|
+
result += `\${${string}}`;
|
|
624
|
+
}
|
|
625
|
+
expressionsIndex++;
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
return result;
|
|
629
|
+
}
|
|
613
630
|
|
|
614
631
|
class TypeCheckError extends Error {
|
|
615
632
|
constructor(message, stacks) {
|
|
@@ -847,15 +864,17 @@ class Typechecker {
|
|
|
847
864
|
}
|
|
848
865
|
this._output = "";
|
|
849
866
|
this._startTime = performance.now();
|
|
850
|
-
const child =
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
867
|
+
const child = x$1(typecheck.checker, args, {
|
|
868
|
+
nodeOptions: {
|
|
869
|
+
cwd: root,
|
|
870
|
+
stdio: "pipe"
|
|
871
|
+
},
|
|
872
|
+
throwOnError: false
|
|
854
873
|
});
|
|
855
|
-
this.process = child;
|
|
874
|
+
this.process = child.process;
|
|
856
875
|
await this._onParseStart?.();
|
|
857
876
|
let rerunTriggered = false;
|
|
858
|
-
child.stdout?.on("data", (chunk) => {
|
|
877
|
+
child.process?.stdout?.on("data", (chunk) => {
|
|
859
878
|
this._output += chunk;
|
|
860
879
|
if (!watch) {
|
|
861
880
|
return;
|
|
@@ -907,7 +926,7 @@ class BaseSequencer {
|
|
|
907
926
|
const shardStart = shardSize * (index - 1);
|
|
908
927
|
const shardEnd = shardSize * index;
|
|
909
928
|
return [...files].map((spec) => {
|
|
910
|
-
const fullPath = resolve(slash(config.root), slash(spec
|
|
929
|
+
const fullPath = resolve(slash(config.root), slash(spec.moduleId));
|
|
911
930
|
const specPath = fullPath?.slice(config.root.length);
|
|
912
931
|
return {
|
|
913
932
|
spec,
|
|
@@ -919,8 +938,8 @@ class BaseSequencer {
|
|
|
919
938
|
async sort(files) {
|
|
920
939
|
const cache = this.ctx.cache;
|
|
921
940
|
return [...files].sort((a, b) => {
|
|
922
|
-
const keyA = `${a
|
|
923
|
-
const keyB = `${b
|
|
941
|
+
const keyA = `${a.project.name}:${relative(this.ctx.config.root, a.moduleId)}`;
|
|
942
|
+
const keyB = `${b.project.name}:${relative(this.ctx.config.root, b.moduleId)}`;
|
|
924
943
|
const aState = cache.getFileTestResults(keyA);
|
|
925
944
|
const bState = cache.getFileTestResults(keyB);
|
|
926
945
|
if (!aState || !bState) {
|
|
@@ -949,4 +968,4 @@ class RandomSequencer extends BaseSequencer {
|
|
|
949
968
|
}
|
|
950
969
|
}
|
|
951
970
|
|
|
952
|
-
export { BaseSequencer as B, RandomSequencer as R, Typechecker as T, TypeCheckError as a,
|
|
971
|
+
export { BaseSequencer as B, RandomSequencer as R, Typechecker as T, TypeCheckError as a, getOutputFile as g, wrapSerializableConfig as w };
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import '@vitest/utils';
|
|
2
2
|
|
|
3
|
-
function collectOwnProperties(obj, collector) {
|
|
4
|
-
const collect = typeof collector === "function" ? collector : (key) => collector.add(key);
|
|
5
|
-
Object.getOwnPropertyNames(obj).forEach(collect);
|
|
6
|
-
Object.getOwnPropertySymbols(obj).forEach(collect);
|
|
7
|
-
}
|
|
8
3
|
function groupBy(collection, iteratee) {
|
|
9
4
|
return collection.reduce((acc, item) => {
|
|
10
5
|
const key = iteratee(item);
|
|
@@ -16,29 +11,6 @@ function groupBy(collection, iteratee) {
|
|
|
16
11
|
function isPrimitive(value) {
|
|
17
12
|
return value === null || typeof value !== "function" && typeof value !== "object";
|
|
18
13
|
}
|
|
19
|
-
function getAllMockableProperties(obj, isModule, constructors) {
|
|
20
|
-
const { Map, Object: Object2, Function, RegExp: RegExp2, Array: Array2 } = constructors;
|
|
21
|
-
const allProps = new Map();
|
|
22
|
-
let curr = obj;
|
|
23
|
-
do {
|
|
24
|
-
if (curr === Object2.prototype || curr === Function.prototype || curr === RegExp2.prototype) {
|
|
25
|
-
break;
|
|
26
|
-
}
|
|
27
|
-
collectOwnProperties(curr, (key) => {
|
|
28
|
-
const descriptor = Object2.getOwnPropertyDescriptor(curr, key);
|
|
29
|
-
if (descriptor) {
|
|
30
|
-
allProps.set(key, { key, descriptor });
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
} while (curr = Object2.getPrototypeOf(curr));
|
|
34
|
-
if (isModule && !allProps.has("default") && "default" in obj) {
|
|
35
|
-
const descriptor = Object2.getOwnPropertyDescriptor(obj, "default");
|
|
36
|
-
if (descriptor) {
|
|
37
|
-
allProps.set("default", { key: "default", descriptor });
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return Array2.from(allProps.values());
|
|
41
|
-
}
|
|
42
14
|
function slash(str) {
|
|
43
15
|
return str.replace(/\\/g, "/");
|
|
44
16
|
}
|
|
@@ -123,4 +95,4 @@ function nanoid(size = 21) {
|
|
|
123
95
|
return id;
|
|
124
96
|
}
|
|
125
97
|
|
|
126
|
-
export { AggregateErrorPonyfill as A, slash as a,
|
|
98
|
+
export { AggregateErrorPonyfill as A, slash as a, isPrimitive as b, nanoid as c, deepMerge as d, stdout as e, groupBy as g, isChildProcess as i, noop as n, setProcessTitle as s, toArray as t, wildcardPatternToRegExp as w };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ModuleCacheMap } from 'vite-node/client';
|
|
2
2
|
import { p as provideWorkerState } from './utils.Ck2hJTRs.js';
|
|
3
|
-
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute.
|
|
3
|
+
import { g as getDefaultRequestStubs, s as startVitestExecutor } from './execute._eQQfgI8.js';
|
|
4
4
|
|
|
5
5
|
let _viteNode;
|
|
6
6
|
const moduleCache = new ModuleCacheMap();
|
|
7
|
-
const mockMap = /* @__PURE__ */ new Map();
|
|
8
7
|
async function startViteNode(options) {
|
|
9
8
|
if (_viteNode) {
|
|
10
9
|
return _viteNode;
|
|
@@ -15,7 +14,6 @@ async function startViteNode(options) {
|
|
|
15
14
|
async function runBaseTests(method, state) {
|
|
16
15
|
const { ctx } = state;
|
|
17
16
|
state.moduleCache = moduleCache;
|
|
18
|
-
state.mockMap = mockMap;
|
|
19
17
|
provideWorkerState(globalThis, state);
|
|
20
18
|
if (ctx.invalidates) {
|
|
21
19
|
ctx.invalidates.forEach((fsPath) => {
|
|
@@ -26,7 +24,7 @@ async function runBaseTests(method, state) {
|
|
|
26
24
|
ctx.files.forEach((i) => state.moduleCache.delete(i));
|
|
27
25
|
const [executor, { run }] = await Promise.all([
|
|
28
26
|
startViteNode({ state, requestStubs: getDefaultRequestStubs() }),
|
|
29
|
-
import('./runBaseTests.
|
|
27
|
+
import('./runBaseTests.Cztfoflv.js')
|
|
30
28
|
]);
|
|
31
29
|
await run(
|
|
32
30
|
method,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { normalize } from 'pathe';
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
3
|
import c from 'tinyrainbow';
|
|
4
|
-
import { t as toArray } from './base.
|
|
5
|
-
import { d as defaultPort, a as defaultBrowserPort } from './constants.
|
|
4
|
+
import { t as toArray } from './base.BlXpj3e_.js';
|
|
5
|
+
import { d as defaultPort, a as defaultBrowserPort } from './constants.fzPh7AOq.js';
|
|
6
6
|
|
|
7
7
|
function toArr(any) {
|
|
8
8
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
@@ -618,7 +618,7 @@ class CAC extends EventEmitter {
|
|
|
618
618
|
|
|
619
619
|
const cac = (name = "") => new CAC(name);
|
|
620
620
|
|
|
621
|
-
var version = "2.1.0-beta.
|
|
621
|
+
var version = "2.1.0-beta.7";
|
|
622
622
|
|
|
623
623
|
const apiConfig = (port) => ({
|
|
624
624
|
port: {
|
|
@@ -1305,7 +1305,8 @@ const cliOptionsConfig = {
|
|
|
1305
1305
|
compare: null,
|
|
1306
1306
|
outputJson: null,
|
|
1307
1307
|
json: null,
|
|
1308
|
-
provide: null
|
|
1308
|
+
provide: null,
|
|
1309
|
+
filesOnly: null
|
|
1309
1310
|
};
|
|
1310
1311
|
const benchCliOptionsConfig = {
|
|
1311
1312
|
compare: {
|
|
@@ -1321,6 +1322,9 @@ const collectCliOptionsConfig = {
|
|
|
1321
1322
|
json: {
|
|
1322
1323
|
description: "Print collected tests as JSON or write to a file (Default: false)",
|
|
1323
1324
|
argument: "[true/path]"
|
|
1325
|
+
},
|
|
1326
|
+
filesOnly: {
|
|
1327
|
+
description: "Print only test files with out the test cases"
|
|
1324
1328
|
}
|
|
1325
1329
|
};
|
|
1326
1330
|
|
|
@@ -1497,13 +1501,13 @@ async function start(mode, cliFilters, options) {
|
|
|
1497
1501
|
} catch {
|
|
1498
1502
|
}
|
|
1499
1503
|
try {
|
|
1500
|
-
const { startVitest } = await import('./cli-api.
|
|
1504
|
+
const { startVitest } = await import('./cli-api.ByZPnilx.js').then(function (n) { return n.d; });
|
|
1501
1505
|
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options));
|
|
1502
1506
|
if (!ctx?.shouldKeepServer()) {
|
|
1503
1507
|
await ctx?.exit();
|
|
1504
1508
|
}
|
|
1505
1509
|
} catch (e) {
|
|
1506
|
-
const { divider } = await import('./utils.
|
|
1510
|
+
const { divider } = await import('./utils.Dbnmsfq1.js').then(function (n) { return n.u; });
|
|
1507
1511
|
console.error(`
|
|
1508
1512
|
${c.red(divider(c.bold(c.inverse(" Startup Error "))))}`);
|
|
1509
1513
|
console.error(e);
|
|
@@ -1519,7 +1523,7 @@ async function init(project) {
|
|
|
1519
1523
|
console.error(new Error('Only the "browser" project is supported. Use "vitest init browser" to create a new project.'));
|
|
1520
1524
|
process.exit(1);
|
|
1521
1525
|
}
|
|
1522
|
-
const { create } = await import('./creator.
|
|
1526
|
+
const { create } = await import('./creator.zfBZSJzo.js');
|
|
1523
1527
|
await create();
|
|
1524
1528
|
}
|
|
1525
1529
|
async function collect(mode, cliFilters, options) {
|
|
@@ -1528,24 +1532,29 @@ async function collect(mode, cliFilters, options) {
|
|
|
1528
1532
|
} catch {
|
|
1529
1533
|
}
|
|
1530
1534
|
try {
|
|
1531
|
-
const { prepareVitest, processCollected } = await import('./cli-api.
|
|
1535
|
+
const { prepareVitest, processCollected, outputFileList } = await import('./cli-api.ByZPnilx.js').then(function (n) { return n.d; });
|
|
1532
1536
|
const ctx = await prepareVitest(mode, {
|
|
1533
1537
|
...normalizeCliOptions(options),
|
|
1534
1538
|
watch: false,
|
|
1535
1539
|
run: true
|
|
1536
1540
|
});
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1541
|
+
if (!options.filesOnly) {
|
|
1542
|
+
const { tests, errors } = await ctx.collect(cliFilters.map(normalize));
|
|
1543
|
+
if (errors.length) {
|
|
1544
|
+
console.error("\nThere were unhandled errors during test collection");
|
|
1545
|
+
errors.forEach((e) => console.error(e));
|
|
1546
|
+
console.error("\n\n");
|
|
1547
|
+
await ctx.close();
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
processCollected(ctx, tests, options);
|
|
1551
|
+
} else {
|
|
1552
|
+
const files = await ctx.listFiles(cliFilters.map(normalize));
|
|
1553
|
+
outputFileList(files, options);
|
|
1544
1554
|
}
|
|
1545
|
-
processCollected(ctx, tests, options);
|
|
1546
1555
|
await ctx.close();
|
|
1547
1556
|
} catch (e) {
|
|
1548
|
-
const { divider } = await import('./utils.
|
|
1557
|
+
const { divider } = await import('./utils.Dbnmsfq1.js').then(function (n) { return n.u; });
|
|
1549
1558
|
console.error(`
|
|
1550
1559
|
${c.red(divider(c.bold(c.inverse(" Collect Error "))))}`);
|
|
1551
1560
|
console.error(e);
|