@storybook/addon-vitest 0.0.0-pr-31014-sha-9708fd9e
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/README.md +3 -0
- package/dist/chunk-JKRQGT2U.mjs +10 -0
- package/dist/chunk-VCBOXNQL.mjs +11 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +7 -0
- package/dist/index.mjs +5 -0
- package/dist/manager.js +8 -0
- package/dist/node/coverage-reporter.d.ts +185 -0
- package/dist/node/coverage-reporter.js +6 -0
- package/dist/node/coverage-reporter.mjs +12 -0
- package/dist/node/vitest.d.ts +2 -0
- package/dist/node/vitest.js +21 -0
- package/dist/node/vitest.mjs +18 -0
- package/dist/postinstall.js +167 -0
- package/dist/preset.js +38 -0
- package/dist/vitest-plugin/global-setup.d.ts +6 -0
- package/dist/vitest-plugin/global-setup.js +9 -0
- package/dist/vitest-plugin/global-setup.mjs +13 -0
- package/dist/vitest-plugin/index.d.ts +36 -0
- package/dist/vitest-plugin/index.js +46 -0
- package/dist/vitest-plugin/index.mjs +26 -0
- package/dist/vitest-plugin/setup-file.d.ts +14 -0
- package/dist/vitest-plugin/setup-file.js +11 -0
- package/dist/vitest-plugin/setup-file.mjs +9 -0
- package/dist/vitest-plugin/test-utils.d.ts +13 -0
- package/dist/vitest-plugin/test-utils.js +10 -0
- package/dist/vitest-plugin/test-utils.mjs +8 -0
- package/manager.js +1 -0
- package/manager.mjs +1 -0
- package/package.json +197 -0
- package/postinstall.js +1 -0
- package/postinstall.mjs +1 -0
- package/preset.js +1 -0
- package/preset.mjs +1 -0
- package/templates/vitest.config.template.ts +30 -0
- package/templates/vitest.workspace.template.ts +27 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import ESM_COMPAT_Module, { createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname } from 'node:path';
|
|
4
|
+
import { require_picocolors, resolve as resolve$1, join as join$1 } from '../chunk-VCBOXNQL.mjs';
|
|
5
|
+
import { __export, __esm, __commonJS, __require, __toCommonJS, __toESM } from '../chunk-JKRQGT2U.mjs';
|
|
6
|
+
import { resolve, join } from 'path';
|
|
7
|
+
import { readdirSync, statSync } from 'fs';
|
|
8
|
+
import * as qs from 'node:querystring';
|
|
9
|
+
import { mergeConfig } from 'vitest/config';
|
|
10
|
+
import { getInterpretedFile, normalizeStories, validateConfigurationFiles } from 'storybook/internal/common';
|
|
11
|
+
import { readConfig, vitestTransform } from 'storybook/internal/csf-tools';
|
|
12
|
+
import { MainFileMissingError } from 'storybook/internal/server-errors';
|
|
13
|
+
import { dedent } from 'ts-dedent';
|
|
14
|
+
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
dirname(__filename);
|
|
17
|
+
ESM_COMPAT_Module.createRequire(import.meta.url);
|
|
18
|
+
var sync_exports={};__export(sync_exports,{totalist:()=>totalist});function totalist(dir,callback,pre=""){dir=resolve(".",dir);let arr=readdirSync(dir),i=0,abs,stats;for(;i<arr.length;i++)abs=join(dir,arr[i]),stats=statSync(abs),stats.isDirectory()?totalist(abs,callback,join(pre,arr[i])):callback(join(pre,arr[i]),abs,stats);}var init_sync=__esm({"../../node_modules/totalist/sync/index.mjs"(){}});var build_exports={};__export(build_exports,{parse:()=>parse2});function parse2(req){let raw=req.url;if(raw==null)return;let prev=req._parsedUrl;if(prev&&prev.raw===raw)return prev;let pathname=raw,search="",query;if(raw.length>1){let idx=raw.indexOf("?",1);idx!==-1&&(search=raw.substring(idx),pathname=raw.substring(0,idx),search.length>1&&(query=qs.parse(search.substring(1))));}return req._parsedUrl={pathname,search,query,raw}}var init_build=__esm({"../../node_modules/@polka/url/build.mjs"(){}});var mrmime_exports={};__export(mrmime_exports,{lookup:()=>lookup,mimes:()=>mimes});function lookup(extn){let tmp=(""+extn).trim().toLowerCase(),idx=tmp.lastIndexOf(".");return mimes[~idx?tmp.substring(++idx):tmp]}var mimes,init_mrmime=__esm({"../../node_modules/mrmime/index.mjs"(){mimes={"3g2":"video/3gpp2","3gp":"video/3gpp","3gpp":"video/3gpp","3mf":"model/3mf",aac:"audio/aac",ac:"application/pkix-attr-cert",adp:"audio/adpcm",adts:"audio/aac",ai:"application/postscript",aml:"application/automationml-aml+xml",amlx:"application/automationml-amlx+zip",amr:"audio/amr",apng:"image/apng",appcache:"text/cache-manifest",appinstaller:"application/appinstaller",appx:"application/appx",appxbundle:"application/appxbundle",asc:"application/pgp-keys",atom:"application/atom+xml",atomcat:"application/atomcat+xml",atomdeleted:"application/atomdeleted+xml",atomsvc:"application/atomsvc+xml",au:"audio/basic",avci:"image/avci",avcs:"image/avcs",avif:"image/avif",aw:"application/applixware",bdoc:"application/bdoc",bin:"application/octet-stream",bmp:"image/bmp",bpk:"application/octet-stream",btf:"image/prs.btif",btif:"image/prs.btif",buffer:"application/octet-stream",ccxml:"application/ccxml+xml",cdfx:"application/cdfx+xml",cdmia:"application/cdmi-capability",cdmic:"application/cdmi-container",cdmid:"application/cdmi-domain",cdmio:"application/cdmi-object",cdmiq:"application/cdmi-queue",cer:"application/pkix-cert",cgm:"image/cgm",cjs:"application/node",class:"application/java-vm",coffee:"text/coffeescript",conf:"text/plain",cpl:"application/cpl+xml",cpt:"application/mac-compactpro",crl:"application/pkix-crl",css:"text/css",csv:"text/csv",cu:"application/cu-seeme",cwl:"application/cwl",cww:"application/prs.cww",davmount:"application/davmount+xml",dbk:"application/docbook+xml",deb:"application/octet-stream",def:"text/plain",deploy:"application/octet-stream",dib:"image/bmp","disposition-notification":"message/disposition-notification",dist:"application/octet-stream",distz:"application/octet-stream",dll:"application/octet-stream",dmg:"application/octet-stream",dms:"application/octet-stream",doc:"application/msword",dot:"application/msword",dpx:"image/dpx",drle:"image/dicom-rle",dsc:"text/prs.lines.tag",dssc:"application/dssc+der",dtd:"application/xml-dtd",dump:"application/octet-stream",dwd:"application/atsc-dwd+xml",ear:"application/java-archive",ecma:"application/ecmascript",elc:"application/octet-stream",emf:"image/emf",eml:"message/rfc822",emma:"application/emma+xml",emotionml:"application/emotionml+xml",eps:"application/postscript",epub:"application/epub+zip",exe:"application/octet-stream",exi:"application/exi",exp:"application/express",exr:"image/aces",ez:"application/andrew-inset",fdf:"application/fdf",fdt:"application/fdt+xml",fits:"image/fits",g3:"image/g3fax",gbr:"application/rpki-ghostbusters",geojson:"application/geo+json",gif:"image/gif",glb:"model/gltf-binary",gltf:"model/gltf+json",gml:"application/gml+xml",gpx:"application/gpx+xml",gram:"application/srgs",grxml:"application/srgs+xml",gxf:"application/gxf",gz:"application/gzip",h261:"video/h261",h263:"video/h263",h264:"video/h264",heic:"image/heic",heics:"image/heic-sequence",heif:"image/heif",heifs:"image/heif-sequence",hej2:"image/hej2k",held:"application/atsc-held+xml",hjson:"application/hjson",hlp:"application/winhlp",hqx:"application/mac-binhex40",hsj2:"image/hsj2",htm:"text/html",html:"text/html",ics:"text/calendar",ief:"image/ief",ifb:"text/calendar",iges:"model/iges",igs:"model/iges",img:"application/octet-stream",in:"text/plain",ini:"text/plain",ink:"application/inkml+xml",inkml:"application/inkml+xml",ipfix:"application/ipfix",iso:"application/octet-stream",its:"application/its+xml",jade:"text/jade",jar:"application/java-archive",jhc:"image/jphc",jls:"image/jls",jp2:"image/jp2",jpe:"image/jpeg",jpeg:"image/jpeg",jpf:"image/jpx",jpg:"image/jpeg",jpg2:"image/jp2",jpgm:"image/jpm",jpgv:"video/jpeg",jph:"image/jph",jpm:"image/jpm",jpx:"image/jpx",js:"text/javascript",json:"application/json",json5:"application/json5",jsonld:"application/ld+json",jsonml:"application/jsonml+json",jsx:"text/jsx",jt:"model/jt",jxr:"image/jxr",jxra:"image/jxra",jxrs:"image/jxrs",jxs:"image/jxs",jxsc:"image/jxsc",jxsi:"image/jxsi",jxss:"image/jxss",kar:"audio/midi",ktx:"image/ktx",ktx2:"image/ktx2",less:"text/less",lgr:"application/lgr+xml",list:"text/plain",litcoffee:"text/coffeescript",log:"text/plain",lostxml:"application/lost+xml",lrf:"application/octet-stream",m1v:"video/mpeg",m21:"application/mp21",m2a:"audio/mpeg",m2v:"video/mpeg",m3a:"audio/mpeg",m4a:"audio/mp4",m4p:"application/mp4",m4s:"video/iso.segment",ma:"application/mathematica",mads:"application/mads+xml",maei:"application/mmt-aei+xml",man:"text/troff",manifest:"text/cache-manifest",map:"application/json",mar:"application/octet-stream",markdown:"text/markdown",mathml:"application/mathml+xml",mb:"application/mathematica",mbox:"application/mbox",md:"text/markdown",mdx:"text/mdx",me:"text/troff",mesh:"model/mesh",meta4:"application/metalink4+xml",metalink:"application/metalink+xml",mets:"application/mets+xml",mft:"application/rpki-manifest",mid:"audio/midi",midi:"audio/midi",mime:"message/rfc822",mj2:"video/mj2",mjp2:"video/mj2",mjs:"text/javascript",mml:"text/mathml",mods:"application/mods+xml",mov:"video/quicktime",mp2:"audio/mpeg",mp21:"application/mp21",mp2a:"audio/mpeg",mp3:"audio/mpeg",mp4:"video/mp4",mp4a:"audio/mp4",mp4s:"application/mp4",mp4v:"video/mp4",mpd:"application/dash+xml",mpe:"video/mpeg",mpeg:"video/mpeg",mpf:"application/media-policy-dataset+xml",mpg:"video/mpeg",mpg4:"video/mp4",mpga:"audio/mpeg",mpp:"application/dash-patch+xml",mrc:"application/marc",mrcx:"application/marcxml+xml",ms:"text/troff",mscml:"application/mediaservercontrol+xml",msh:"model/mesh",msi:"application/octet-stream",msix:"application/msix",msixbundle:"application/msixbundle",msm:"application/octet-stream",msp:"application/octet-stream",mtl:"model/mtl",musd:"application/mmt-usd+xml",mxf:"application/mxf",mxmf:"audio/mobile-xmf",mxml:"application/xv+xml",n3:"text/n3",nb:"application/mathematica",nq:"application/n-quads",nt:"application/n-triples",obj:"model/obj",oda:"application/oda",oga:"audio/ogg",ogg:"audio/ogg",ogv:"video/ogg",ogx:"application/ogg",omdoc:"application/omdoc+xml",onepkg:"application/onenote",onetmp:"application/onenote",onetoc:"application/onenote",onetoc2:"application/onenote",opf:"application/oebps-package+xml",opus:"audio/ogg",otf:"font/otf",owl:"application/rdf+xml",oxps:"application/oxps",p10:"application/pkcs10",p7c:"application/pkcs7-mime",p7m:"application/pkcs7-mime",p7s:"application/pkcs7-signature",p8:"application/pkcs8",pdf:"application/pdf",pfr:"application/font-tdpfr",pgp:"application/pgp-encrypted",pkg:"application/octet-stream",pki:"application/pkixcmp",pkipath:"application/pkix-pkipath",pls:"application/pls+xml",png:"image/png",prc:"model/prc",prf:"application/pics-rules",provx:"application/provenance+xml",ps:"application/postscript",pskcxml:"application/pskc+xml",pti:"image/prs.pti",qt:"video/quicktime",raml:"application/raml+yaml",rapd:"application/route-apd+xml",rdf:"application/rdf+xml",relo:"application/p2p-overlay+xml",rif:"application/reginfo+xml",rl:"application/resource-lists+xml",rld:"application/resource-lists-diff+xml",rmi:"audio/midi",rnc:"application/relax-ng-compact-syntax",rng:"application/xml",roa:"application/rpki-roa",roff:"text/troff",rq:"application/sparql-query",rs:"application/rls-services+xml",rsat:"application/atsc-rsat+xml",rsd:"application/rsd+xml",rsheet:"application/urc-ressheet+xml",rss:"application/rss+xml",rtf:"text/rtf",rtx:"text/richtext",rusd:"application/route-usd+xml",s3m:"audio/s3m",sbml:"application/sbml+xml",scq:"application/scvp-cv-request",scs:"application/scvp-cv-response",sdp:"application/sdp",senmlx:"application/senml+xml",sensmlx:"application/sensml+xml",ser:"application/java-serialized-object",setpay:"application/set-payment-initiation",setreg:"application/set-registration-initiation",sgi:"image/sgi",sgm:"text/sgml",sgml:"text/sgml",shex:"text/shex",shf:"application/shf+xml",shtml:"text/html",sieve:"application/sieve",sig:"application/pgp-signature",sil:"audio/silk",silo:"model/mesh",siv:"application/sieve",slim:"text/slim",slm:"text/slim",sls:"application/route-s-tsid+xml",smi:"application/smil+xml",smil:"application/smil+xml",snd:"audio/basic",so:"application/octet-stream",spdx:"text/spdx",spp:"application/scvp-vp-response",spq:"application/scvp-vp-request",spx:"audio/ogg",sql:"application/sql",sru:"application/sru+xml",srx:"application/sparql-results+xml",ssdl:"application/ssdl+xml",ssml:"application/ssml+xml",stk:"application/hyperstudio",stl:"model/stl",stpx:"model/step+xml",stpxz:"model/step-xml+zip",stpz:"model/step+zip",styl:"text/stylus",stylus:"text/stylus",svg:"image/svg+xml",svgz:"image/svg+xml",swidtag:"application/swid+xml",t:"text/troff",t38:"image/t38",td:"application/urc-targetdesc+xml",tei:"application/tei+xml",teicorpus:"application/tei+xml",text:"text/plain",tfi:"application/thraud+xml",tfx:"image/tiff-fx",tif:"image/tiff",tiff:"image/tiff",toml:"application/toml",tr:"text/troff",trig:"application/trig",ts:"video/mp2t",tsd:"application/timestamped-data",tsv:"text/tab-separated-values",ttc:"font/collection",ttf:"font/ttf",ttl:"text/turtle",ttml:"application/ttml+xml",txt:"text/plain",u3d:"model/u3d",u8dsn:"message/global-delivery-status",u8hdr:"message/global-headers",u8mdn:"message/global-disposition-notification",u8msg:"message/global",ubj:"application/ubjson",uri:"text/uri-list",uris:"text/uri-list",urls:"text/uri-list",vcard:"text/vcard",vrml:"model/vrml",vtt:"text/vtt",vxml:"application/voicexml+xml",war:"application/java-archive",wasm:"application/wasm",wav:"audio/wav",weba:"audio/webm",webm:"video/webm",webmanifest:"application/manifest+json",webp:"image/webp",wgsl:"text/wgsl",wgt:"application/widget",wif:"application/watcherinfo+xml",wmf:"image/wmf",woff:"font/woff",woff2:"font/woff2",wrl:"model/vrml",wsdl:"application/wsdl+xml",wspolicy:"application/wspolicy+xml",x3d:"model/x3d+xml",x3db:"model/x3d+fastinfoset",x3dbz:"model/x3d+binary",x3dv:"model/x3d-vrml",x3dvz:"model/x3d+vrml",x3dz:"model/x3d+xml",xaml:"application/xaml+xml",xav:"application/xcap-att+xml",xca:"application/xcap-caps+xml",xcs:"application/calendar+xml",xdf:"application/xcap-diff+xml",xdssc:"application/dssc+xml",xel:"application/xcap-el+xml",xenc:"application/xenc+xml",xer:"application/patch-ops-error+xml",xfdf:"application/xfdf",xht:"application/xhtml+xml",xhtml:"application/xhtml+xml",xhvml:"application/xv+xml",xlf:"application/xliff+xml",xm:"audio/xm",xml:"text/xml",xns:"application/xcap-ns+xml",xop:"application/xop+xml",xpl:"application/xproc+xml",xsd:"application/xml",xsf:"application/prs.xsf+xml",xsl:"application/xml",xslt:"application/xml",xspf:"application/xspf+xml",xvm:"application/xv+xml",xvml:"application/xv+xml",yaml:"text/yaml",yang:"application/yang",yin:"application/yin+xml",yml:"text/yaml",zip:"application/zip"};}});var require_build=__commonJS({"../../node_modules/sirv/build.js"(exports,module){var fs=__require("fs"),{join:join3,normalize,resolve:resolve3}=__require("path"),{totalist:totalist2}=(init_sync(),__toCommonJS(sync_exports)),{parse:parse3}=(init_build(),__toCommonJS(build_exports)),{lookup:lookup2}=(init_mrmime(),__toCommonJS(mrmime_exports)),noop=()=>{};function isMatch(uri,arr){for(let i=0;i<arr.length;i++)if(arr[i].test(uri))return !0}function toAssume(uri,extns){let i=0,x,len=uri.length-1;uri.charCodeAt(len)===47&&(uri=uri.substring(0,len));let arr=[],tmp=`${uri}/index`;for(;i<extns.length;i++)x=extns[i]?`.${extns[i]}`:"",uri&&arr.push(uri+x),arr.push(tmp+x);return arr}function viaCache(cache,uri,extns){let i=0,data,arr=toAssume(uri,extns);for(;i<arr.length;i++)if(data=cache[arr[i]])return data}function viaLocal(dir,isEtag,uri,extns){let i=0,arr=toAssume(uri,extns),abs,stats,name,headers;for(;i<arr.length;i++)if(abs=normalize(join3(dir,name=arr[i])),abs.startsWith(dir)&&fs.existsSync(abs)){if(stats=fs.statSync(abs),stats.isDirectory())continue;return headers=toHeaders(name,stats,isEtag),headers["Cache-Control"]=isEtag?"no-cache":"no-store",{abs,stats,headers}}}function is404(req,res){return res.statusCode=404,res.end()}function send(req,res,file,stats,headers){let code=200,tmp,opts={};headers={...headers};for(let key in headers)tmp=res.getHeader(key),tmp&&(headers[key]=tmp);if((tmp=res.getHeader("content-type"))&&(headers["Content-Type"]=tmp),req.headers.range){code=206;let[x,y]=req.headers.range.replace("bytes=","").split("-"),end=opts.end=parseInt(y,10)||stats.size-1,start=opts.start=parseInt(x,10)||0;if(end>=stats.size&&(end=stats.size-1),start>=stats.size)return res.setHeader("Content-Range",`bytes */${stats.size}`),res.statusCode=416,res.end();headers["Content-Range"]=`bytes ${start}-${end}/${stats.size}`,headers["Content-Length"]=end-start+1,headers["Accept-Ranges"]="bytes";}res.writeHead(code,headers),fs.createReadStream(file,opts).pipe(res);}var ENCODING={".br":"br",".gz":"gzip"};function toHeaders(name,stats,isEtag){let enc=ENCODING[name.slice(-3)],ctype=lookup2(name.slice(0,enc&&-3))||"";ctype==="text/html"&&(ctype+=";charset=utf-8");let headers={"Content-Length":stats.size,"Content-Type":ctype,"Last-Modified":stats.mtime.toUTCString()};return enc&&(headers["Content-Encoding"]=enc),isEtag&&(headers.ETag=`W/"${stats.size}-${stats.mtime.getTime()}"`),headers}module.exports=function(dir,opts={}){dir=resolve3(dir||".");let isNotFound=opts.onNoMatch||is404,setHeaders=opts.setHeaders||noop,extensions=opts.extensions||["html","htm"],gzips=opts.gzip&&extensions.map(x=>`${x}.gz`).concat("gz"),brots=opts.brotli&&extensions.map(x=>`${x}.br`).concat("br"),FILES={},fallback="/",isEtag=!!opts.etag,isSPA=!!opts.single;if(typeof opts.single=="string"){let idx=opts.single.lastIndexOf(".");fallback+=~idx?opts.single.substring(0,idx):opts.single;}let ignores=[];opts.ignores!==!1&&(ignores.push(/[/]([A-Za-z\s\d~$._-]+\.\w+){1,}$/),opts.dotfiles?ignores.push(/\/\.\w/):ignores.push(/\/\.well-known/),[].concat(opts.ignores||[]).forEach(x=>{ignores.push(new RegExp(x,"i"));}));let cc=opts.maxAge!=null&&`public,max-age=${opts.maxAge}`;cc&&opts.immutable?cc+=",immutable":cc&&opts.maxAge===0&&(cc+=",must-revalidate"),opts.dev||totalist2(dir,(name,abs,stats)=>{if(!/\.well-known[\\+\/]/.test(name)){if(!opts.dotfiles&&/(^\.|[\\+|\/+]\.)/.test(name))return}let headers=toHeaders(name,stats,isEtag);cc&&(headers["Cache-Control"]=cc),FILES["/"+name.normalize().replace(/\\+/g,"/")]={abs,stats,headers};});let lookup3=opts.dev?viaLocal.bind(0,dir,isEtag):viaCache.bind(0,FILES);return function(req,res,next){let extns=[""],pathname=parse3(req).pathname,val=req.headers["accept-encoding"]||"";if(gzips&&val.includes("gzip")&&extns.unshift(...gzips),brots&&/(br|brotli)/i.test(val)&&extns.unshift(...brots),extns.push(...extensions),pathname.indexOf("%")!==-1)try{pathname=decodeURI(pathname);}catch{}let data=lookup3(pathname,extns)||isSPA&&!isMatch(pathname,ignores)&&lookup3(fallback,extns);if(!data)return next?next():isNotFound(req,res);if(isEtag&&req.headers["if-none-match"]===data.headers.ETag)return res.writeHead(304),res.end();(gzips||brots)&&res.setHeader("Vary","Accept-Encoding"),setHeaders(res,pathname,data.stats),send(req,res,data.abs,data.stats,data.headers);}};}});var require_utils=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/utils.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.normalizePath=exports.convertSlashes=exports.cleanPath=void 0;var path_1=__require("path");function cleanPath(path2){let normalized=(0, path_1.normalize)(path2);return normalized.length>1&&normalized[normalized.length-1]===path_1.sep&&(normalized=normalized.substring(0,normalized.length-1)),normalized}exports.cleanPath=cleanPath;var SLASHES_REGEX=/[\\/]/g;function convertSlashes(path2,separator){return path2.replace(SLASHES_REGEX,separator)}exports.convertSlashes=convertSlashes;function normalizePath(path2,options){let{resolvePaths,normalizePath:normalizePath2,pathSeparator}=options,pathNeedsCleaning=process.platform==="win32"&&path2.includes("/")||path2.startsWith(".");if(resolvePaths&&(path2=(0, path_1.resolve)(path2)),(normalizePath2||pathNeedsCleaning)&&(path2=cleanPath(path2)),path2===".")return "";let needsSeperator=path2[path2.length-1]!==pathSeparator;return convertSlashes(needsSeperator?path2+pathSeparator:path2,pathSeparator)}exports.normalizePath=normalizePath;}});var require_join_path=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/join-path.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.build=exports.joinDirectoryPath=exports.joinPathWithBasePath=void 0;var path_1=__require("path"),utils_1=require_utils();function joinPathWithBasePath(filename,directoryPath){return directoryPath+filename}exports.joinPathWithBasePath=joinPathWithBasePath;function joinPathWithRelativePath(root,options){return function(filename,directoryPath){return directoryPath.startsWith(root)?directoryPath.replace(root,"")+filename:(0, utils_1.convertSlashes)((0, path_1.relative)(root,directoryPath),options.pathSeparator)+options.pathSeparator+filename}}function joinPath(filename){return filename}function joinDirectoryPath(filename,directoryPath,separator){return directoryPath+filename+separator}exports.joinDirectoryPath=joinDirectoryPath;function build(root,options){let{relativePaths,includeBasePath}=options;return relativePaths&&root?joinPathWithRelativePath(root,options):includeBasePath?joinPathWithBasePath:joinPath}exports.build=build;}});var require_push_directory=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-directory.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.build=void 0;function pushDirectoryWithRelativePath(root){return function(directoryPath,paths){paths.push(directoryPath.substring(root.length)||".");}}function pushDirectoryFilterWithRelativePath(root){return function(directoryPath,paths,filters){let relativePath=directoryPath.substring(root.length)||".";filters.every(filter=>filter(relativePath,!0))&&paths.push(relativePath);}}var pushDirectory=(directoryPath,paths)=>{paths.push(directoryPath||".");},pushDirectoryFilter=(directoryPath,paths,filters)=>{let path2=directoryPath||".";filters.every(filter=>filter(path2,!0))&&paths.push(path2);},empty=()=>{};function build(root,options){let{includeDirs,filters,relativePaths}=options;return includeDirs?relativePaths?filters&&filters.length?pushDirectoryFilterWithRelativePath(root):pushDirectoryWithRelativePath(root):filters&&filters.length?pushDirectoryFilter:pushDirectory:empty}exports.build=build;}});var require_push_file=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/push-file.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.build=void 0;var pushFileFilterAndCount=(filename,_paths,counts,filters)=>{filters.every(filter=>filter(filename,!1))&&counts.files++;},pushFileFilter=(filename,paths,_counts,filters)=>{filters.every(filter=>filter(filename,!1))&&paths.push(filename);},pushFileCount=(_filename,_paths,counts,_filters)=>{counts.files++;},pushFile=(filename,paths)=>{paths.push(filename);},empty=()=>{};function build(options){let{excludeFiles,filters,onlyCounts}=options;return excludeFiles?empty:filters&&filters.length?onlyCounts?pushFileFilterAndCount:pushFileFilter:onlyCounts?pushFileCount:pushFile}exports.build=build;}});var require_get_array=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/get-array.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.build=void 0;var getArray=paths=>paths,getArrayGroup=()=>[""].slice(0,0);function build(options){return options.group?getArrayGroup:getArray}exports.build=build;}});var require_group_files=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/group-files.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.build=void 0;var groupFiles=(groups,directory,files)=>{groups.push({directory,files,dir:directory});},empty=()=>{};function build(options){return options.group?groupFiles:empty}exports.build=build;}});var require_resolve_symlink=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/resolve-symlink.js"(exports){var __importDefault=exports&&exports.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});exports.build=void 0;var fs_1=__importDefault(__require("fs")),path_1=__require("path"),resolveSymlinksAsync=function(path2,state,callback){let{queue,options:{suppressErrors}}=state;queue.enqueue(),fs_1.default.realpath(path2,(error,resolvedPath)=>{if(error)return queue.dequeue(suppressErrors?null:error,state);fs_1.default.stat(resolvedPath,(error2,stat)=>{if(error2)return queue.dequeue(suppressErrors?null:error2,state);if(stat.isDirectory()&&isRecursive(path2,resolvedPath,state))return queue.dequeue(null,state);callback(stat,resolvedPath),queue.dequeue(null,state);});});},resolveSymlinks=function(path2,state,callback){let{queue,options:{suppressErrors}}=state;queue.enqueue();try{let resolvedPath=fs_1.default.realpathSync(path2),stat=fs_1.default.statSync(resolvedPath);if(stat.isDirectory()&&isRecursive(path2,resolvedPath,state))return;callback(stat,resolvedPath);}catch(e){if(!suppressErrors)throw e}};function build(options,isSynchronous){return !options.resolveSymlinks||options.excludeSymlinks?null:isSynchronous?resolveSymlinks:resolveSymlinksAsync}exports.build=build;function isRecursive(path2,resolved,state){if(state.options.useRealPaths)return isRecursiveUsingRealPaths(resolved,state);let parent=(0, path_1.dirname)(path2),depth=1;for(;parent!==state.root&&depth<2;){let resolvedPath=state.symlinks.get(parent);!!resolvedPath&&(resolvedPath===resolved||resolvedPath.startsWith(resolved)||resolved.startsWith(resolvedPath))?depth++:parent=(0, path_1.dirname)(parent);}return state.symlinks.set(path2,resolved),depth>1}function isRecursiveUsingRealPaths(resolved,state){return state.visited.includes(resolved+state.options.pathSeparator)}}});var require_invoke_callback=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/invoke-callback.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.build=void 0;var onlyCountsSync=state=>state.counts,groupsSync=state=>state.groups,defaultSync=state=>state.paths,limitFilesSync=state=>state.paths.slice(0,state.options.maxFiles),onlyCountsAsync=(state,error,callback)=>(report(error,callback,state.counts,state.options.suppressErrors),null),defaultAsync=(state,error,callback)=>(report(error,callback,state.paths,state.options.suppressErrors),null),limitFilesAsync=(state,error,callback)=>(report(error,callback,state.paths.slice(0,state.options.maxFiles),state.options.suppressErrors),null),groupsAsync=(state,error,callback)=>(report(error,callback,state.groups,state.options.suppressErrors),null);function report(error,callback,output,suppressErrors){callback(error&&!suppressErrors?error:null,output);}function build(options,isSynchronous){let{onlyCounts,group,maxFiles}=options;return onlyCounts?isSynchronous?onlyCountsSync:onlyCountsAsync:group?isSynchronous?groupsSync:groupsAsync:maxFiles?isSynchronous?limitFilesSync:limitFilesAsync:isSynchronous?defaultSync:defaultAsync}exports.build=build;}});var require_walk_directory=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/functions/walk-directory.js"(exports){var __importDefault=exports&&exports.__importDefault||function(mod){return mod&&mod.__esModule?mod:{default:mod}};Object.defineProperty(exports,"__esModule",{value:!0});exports.build=void 0;var fs_1=__importDefault(__require("fs")),readdirOpts={withFileTypes:!0},walkAsync=(state,crawlPath,directoryPath,currentDepth,callback)=>{if(currentDepth<0)return state.queue.dequeue(null,state);state.visited.push(crawlPath),state.counts.directories++,state.queue.enqueue(),fs_1.default.readdir(crawlPath||".",readdirOpts,(error,entries=[])=>{callback(entries,directoryPath,currentDepth),state.queue.dequeue(state.options.suppressErrors?null:error,state);});},walkSync=(state,crawlPath,directoryPath,currentDepth,callback)=>{if(currentDepth<0)return;state.visited.push(crawlPath),state.counts.directories++;let entries=[];try{entries=fs_1.default.readdirSync(crawlPath||".",readdirOpts);}catch(e){if(!state.options.suppressErrors)throw e}callback(entries,directoryPath,currentDepth);};function build(isSynchronous){return isSynchronous?walkSync:walkAsync}exports.build=build;}});var require_queue=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/queue.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.Queue=void 0;var Queue=class{onQueueEmpty;count=0;constructor(onQueueEmpty){this.onQueueEmpty=onQueueEmpty;}enqueue(){this.count++;}dequeue(error,output){(--this.count<=0||error)&&this.onQueueEmpty(error,output);}};exports.Queue=Queue;}});var require_counter=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/counter.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.Counter=void 0;var Counter=class{_files=0;_directories=0;set files(num){this._files=num;}get files(){return this._files}set directories(num){this._directories=num;}get directories(){return this._directories}get dirs(){return this._directories}};exports.Counter=Counter;}});var require_walker=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/walker.js"(exports){var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc);}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k];}),__setModuleDefault=exports&&exports.__setModuleDefault||(Object.create?function(o,v){Object.defineProperty(o,"default",{enumerable:!0,value:v});}:function(o,v){o.default=v;}),__importStar=exports&&exports.__importStar||function(mod){if(mod&&mod.__esModule)return mod;var result={};if(mod!=null)for(var k in mod)k!=="default"&&Object.prototype.hasOwnProperty.call(mod,k)&&__createBinding(result,mod,k);return __setModuleDefault(result,mod),result};Object.defineProperty(exports,"__esModule",{value:!0});exports.Walker=void 0;var path_1=__require("path"),utils_1=require_utils(),joinPath=__importStar(require_join_path()),pushDirectory=__importStar(require_push_directory()),pushFile=__importStar(require_push_file()),getArray=__importStar(require_get_array()),groupFiles=__importStar(require_group_files()),resolveSymlink=__importStar(require_resolve_symlink()),invokeCallback=__importStar(require_invoke_callback()),walkDirectory=__importStar(require_walk_directory()),queue_1=require_queue(),counter_1=require_counter(),Walker=class{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(root,options,callback){this.isSynchronous=!callback,this.callbackInvoker=invokeCallback.build(options,this.isSynchronous),this.root=(0, utils_1.normalizePath)(root,options),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new counter_1.Counter,options,queue:new queue_1.Queue((error,state)=>this.callbackInvoker(state,error,callback)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=joinPath.build(this.root,options),this.pushDirectory=pushDirectory.build(this.root,options),this.pushFile=pushFile.build(options),this.getArray=getArray.build(options),this.groupFiles=groupFiles.build(options),this.resolveSymlink=resolveSymlink.build(options,this.isSynchronous),this.walkDirectory=walkDirectory.build(this.isSynchronous);}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(entries,directoryPath,depth)=>{let{paths,options:{filters,resolveSymlinks,excludeSymlinks,exclude,maxFiles,signal,useRealPaths,pathSeparator}}=this.state;if(signal&&signal.aborted||maxFiles&&paths.length>maxFiles)return;this.pushDirectory(directoryPath,paths,filters);let files=this.getArray(this.state.paths);for(let i=0;i<entries.length;++i){let entry=entries[i];if(entry.isFile()||entry.isSymbolicLink()&&!resolveSymlinks&&!excludeSymlinks){let filename=this.joinPath(entry.name,directoryPath);this.pushFile(filename,files,this.state.counts,filters);}else if(entry.isDirectory()){let path2=joinPath.joinDirectoryPath(entry.name,directoryPath,this.state.options.pathSeparator);if(exclude&&exclude(entry.name,path2))continue;this.walkDirectory(this.state,path2,path2,depth-1,this.walk);}else if(entry.isSymbolicLink()&&this.resolveSymlink){let path2=joinPath.joinPathWithBasePath(entry.name,directoryPath);this.resolveSymlink(path2,this.state,(stat,resolvedPath)=>{if(stat.isDirectory()){if(resolvedPath=(0, utils_1.normalizePath)(resolvedPath,this.state.options),exclude&&exclude(entry.name,resolvedPath))return;this.walkDirectory(this.state,resolvedPath,useRealPaths?resolvedPath:path2+pathSeparator,depth-1,this.walk);}else {resolvedPath=useRealPaths?resolvedPath:path2;let filename=(0, path_1.basename)(resolvedPath),directoryPath2=(0, utils_1.normalizePath)((0, path_1.dirname)(resolvedPath),this.state.options);resolvedPath=this.joinPath(filename,directoryPath2),this.pushFile(resolvedPath,files,this.state.counts,filters);}});}}this.groupFiles(this.state.groups,directoryPath,files);}};exports.Walker=Walker;}});var require_async=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/async.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.callback=exports.promise=void 0;var walker_1=require_walker();function promise(root,options){return new Promise((resolve3,reject)=>{callback(root,options,(err,output)=>{if(err)return reject(err);resolve3(output);});})}exports.promise=promise;function callback(root,options,callback2){new walker_1.Walker(root,options,callback2).start();}exports.callback=callback;}});var require_sync=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/api/sync.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.sync=void 0;var walker_1=require_walker();function sync(root,options){return new walker_1.Walker(root,options).start()}exports.sync=sync;}});var require_api_builder=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/builder/api-builder.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.APIBuilder=void 0;var async_1=require_async(),sync_1=require_sync(),APIBuilder=class{root;options;constructor(root,options){this.root=root,this.options=options;}withPromise(){return (0, async_1.promise)(this.root,this.options)}withCallback(cb){(0, async_1.callback)(this.root,this.options,cb);}sync(){return (0, sync_1.sync)(this.root,this.options)}};exports.APIBuilder=APIBuilder;}});var require_constants=__commonJS({"../../node_modules/tinyglobby/node_modules/picomatch/lib/constants.js"(exports,module){var WIN_SLASH="\\\\/",WIN_NO_SLASH=`[^${WIN_SLASH}]`,DOT_LITERAL="\\.",PLUS_LITERAL="\\+",QMARK_LITERAL="\\?",SLASH_LITERAL="\\/",ONE_CHAR="(?=.)",QMARK="[^/]",END_ANCHOR=`(?:${SLASH_LITERAL}|$)`,START_ANCHOR=`(?:^|${SLASH_LITERAL})`,DOTS_SLASH=`${DOT_LITERAL}{1,2}${END_ANCHOR}`,NO_DOT=`(?!${DOT_LITERAL})`,NO_DOTS=`(?!${START_ANCHOR}${DOTS_SLASH})`,NO_DOT_SLASH=`(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`,NO_DOTS_SLASH=`(?!${DOTS_SLASH})`,QMARK_NO_DOT=`[^.${SLASH_LITERAL}]`,STAR=`${QMARK}*?`,SEP="/",POSIX_CHARS={DOT_LITERAL,PLUS_LITERAL,QMARK_LITERAL,SLASH_LITERAL,ONE_CHAR,QMARK,END_ANCHOR,DOTS_SLASH,NO_DOT,NO_DOTS,NO_DOT_SLASH,NO_DOTS_SLASH,QMARK_NO_DOT,STAR,START_ANCHOR,SEP},WINDOWS_CHARS={...POSIX_CHARS,SLASH_LITERAL:`[${WIN_SLASH}]`,QMARK:WIN_NO_SLASH,STAR:`${WIN_NO_SLASH}*?`,DOTS_SLASH:`${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,NO_DOT:`(?!${DOT_LITERAL})`,NO_DOTS:`(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,NO_DOT_SLASH:`(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,NO_DOTS_SLASH:`(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,QMARK_NO_DOT:`[^.${WIN_SLASH}]`,START_ANCHOR:`(?:^|[${WIN_SLASH}])`,END_ANCHOR:`(?:[${WIN_SLASH}]|$)`,SEP:"\\"},POSIX_REGEX_SOURCE={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};module.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(chars){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${chars.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(win32){return win32===!0?WINDOWS_CHARS:POSIX_CHARS}};}});var require_utils2=__commonJS({"../../node_modules/tinyglobby/node_modules/picomatch/lib/utils.js"(exports){var{REGEX_BACKSLASH,REGEX_REMOVE_BACKSLASH,REGEX_SPECIAL_CHARS,REGEX_SPECIAL_CHARS_GLOBAL}=require_constants();exports.isObject=val=>val!==null&&typeof val=="object"&&!Array.isArray(val);exports.hasRegexChars=str=>REGEX_SPECIAL_CHARS.test(str);exports.isRegexChar=str=>str.length===1&&exports.hasRegexChars(str);exports.escapeRegex=str=>str.replace(REGEX_SPECIAL_CHARS_GLOBAL,"\\$1");exports.toPosixSlashes=str=>str.replace(REGEX_BACKSLASH,"/");exports.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){let platform=navigator.platform.toLowerCase();return platform==="win32"||platform==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1};exports.removeBackslashes=str=>str.replace(REGEX_REMOVE_BACKSLASH,match=>match==="\\"?"":match);exports.escapeLast=(input,char,lastIdx)=>{let idx=input.lastIndexOf(char,lastIdx);return idx===-1?input:input[idx-1]==="\\"?exports.escapeLast(input,char,idx-1):`${input.slice(0,idx)}\\${input.slice(idx)}`};exports.removePrefix=(input,state={})=>{let output=input;return output.startsWith("./")&&(output=output.slice(2),state.prefix="./"),output};exports.wrapOutput=(input,state={},options={})=>{let prepend=options.contains?"":"^",append=options.contains?"":"$",output=`${prepend}(?:${input})${append}`;return state.negated===!0&&(output=`(?:^(?!${output}).*$)`),output};exports.basename=(path2,{windows}={})=>{let segs=path2.split(windows?/[\\/]/:"/"),last=segs[segs.length-1];return last===""?segs[segs.length-2]:last};}});var require_scan=__commonJS({"../../node_modules/tinyglobby/node_modules/picomatch/lib/scan.js"(exports,module){var utils=require_utils2(),{CHAR_ASTERISK,CHAR_AT,CHAR_BACKWARD_SLASH,CHAR_COMMA,CHAR_DOT,CHAR_EXCLAMATION_MARK,CHAR_FORWARD_SLASH,CHAR_LEFT_CURLY_BRACE,CHAR_LEFT_PARENTHESES,CHAR_LEFT_SQUARE_BRACKET,CHAR_PLUS,CHAR_QUESTION_MARK,CHAR_RIGHT_CURLY_BRACE,CHAR_RIGHT_PARENTHESES,CHAR_RIGHT_SQUARE_BRACKET}=require_constants(),isPathSeparator=code=>code===CHAR_FORWARD_SLASH||code===CHAR_BACKWARD_SLASH,depth=token=>{token.isPrefix!==!0&&(token.depth=token.isGlobstar?1/0:1);},scan=(input,options)=>{let opts=options||{},length=input.length-1,scanToEnd=opts.parts===!0||opts.scanToEnd===!0,slashes=[],tokens=[],parts=[],str=input,index=-1,start=0,lastIndex=0,isBrace=!1,isBracket=!1,isGlob=!1,isExtglob=!1,isGlobstar=!1,braceEscaped=!1,backslashes=!1,negated=!1,negatedExtglob=!1,finished=!1,braces=0,prev,code,token={value:"",depth:0,isGlob:!1},eos=()=>index>=length,peek=()=>str.charCodeAt(index+1),advance=()=>(prev=code,str.charCodeAt(++index));for(;index<length;){code=advance();let next;if(code===CHAR_BACKWARD_SLASH){backslashes=token.backslashes=!0,code=advance(),code===CHAR_LEFT_CURLY_BRACE&&(braceEscaped=!0);continue}if(braceEscaped===!0||code===CHAR_LEFT_CURLY_BRACE){for(braces++;eos()!==!0&&(code=advance());){if(code===CHAR_BACKWARD_SLASH){backslashes=token.backslashes=!0,advance();continue}if(code===CHAR_LEFT_CURLY_BRACE){braces++;continue}if(braceEscaped!==!0&&code===CHAR_DOT&&(code=advance())===CHAR_DOT){if(isBrace=token.isBrace=!0,isGlob=token.isGlob=!0,finished=!0,scanToEnd===!0)continue;break}if(braceEscaped!==!0&&code===CHAR_COMMA){if(isBrace=token.isBrace=!0,isGlob=token.isGlob=!0,finished=!0,scanToEnd===!0)continue;break}if(code===CHAR_RIGHT_CURLY_BRACE&&(braces--,braces===0)){braceEscaped=!1,isBrace=token.isBrace=!0,finished=!0;break}}if(scanToEnd===!0)continue;break}if(code===CHAR_FORWARD_SLASH){if(slashes.push(index),tokens.push(token),token={value:"",depth:0,isGlob:!1},finished===!0)continue;if(prev===CHAR_DOT&&index===start+1){start+=2;continue}lastIndex=index+1;continue}if(opts.noext!==!0&&(code===CHAR_PLUS||code===CHAR_AT||code===CHAR_ASTERISK||code===CHAR_QUESTION_MARK||code===CHAR_EXCLAMATION_MARK)===!0&&peek()===CHAR_LEFT_PARENTHESES){if(isGlob=token.isGlob=!0,isExtglob=token.isExtglob=!0,finished=!0,code===CHAR_EXCLAMATION_MARK&&index===start&&(negatedExtglob=!0),scanToEnd===!0){for(;eos()!==!0&&(code=advance());){if(code===CHAR_BACKWARD_SLASH){backslashes=token.backslashes=!0,code=advance();continue}if(code===CHAR_RIGHT_PARENTHESES){isGlob=token.isGlob=!0,finished=!0;break}}continue}break}if(code===CHAR_ASTERISK){if(prev===CHAR_ASTERISK&&(isGlobstar=token.isGlobstar=!0),isGlob=token.isGlob=!0,finished=!0,scanToEnd===!0)continue;break}if(code===CHAR_QUESTION_MARK){if(isGlob=token.isGlob=!0,finished=!0,scanToEnd===!0)continue;break}if(code===CHAR_LEFT_SQUARE_BRACKET){for(;eos()!==!0&&(next=advance());){if(next===CHAR_BACKWARD_SLASH){backslashes=token.backslashes=!0,advance();continue}if(next===CHAR_RIGHT_SQUARE_BRACKET){isBracket=token.isBracket=!0,isGlob=token.isGlob=!0,finished=!0;break}}if(scanToEnd===!0)continue;break}if(opts.nonegate!==!0&&code===CHAR_EXCLAMATION_MARK&&index===start){negated=token.negated=!0,start++;continue}if(opts.noparen!==!0&&code===CHAR_LEFT_PARENTHESES){if(isGlob=token.isGlob=!0,scanToEnd===!0){for(;eos()!==!0&&(code=advance());){if(code===CHAR_LEFT_PARENTHESES){backslashes=token.backslashes=!0,code=advance();continue}if(code===CHAR_RIGHT_PARENTHESES){finished=!0;break}}continue}break}if(isGlob===!0){if(finished=!0,scanToEnd===!0)continue;break}}opts.noext===!0&&(isExtglob=!1,isGlob=!1);let base=str,prefix="",glob="";start>0&&(prefix=str.slice(0,start),str=str.slice(start),lastIndex-=start),base&&isGlob===!0&&lastIndex>0?(base=str.slice(0,lastIndex),glob=str.slice(lastIndex)):isGlob===!0?(base="",glob=str):base=str,base&&base!==""&&base!=="/"&&base!==str&&isPathSeparator(base.charCodeAt(base.length-1))&&(base=base.slice(0,-1)),opts.unescape===!0&&(glob&&(glob=utils.removeBackslashes(glob)),base&&backslashes===!0&&(base=utils.removeBackslashes(base)));let state={prefix,input,start,base,glob,isBrace,isBracket,isGlob,isExtglob,isGlobstar,negated,negatedExtglob};if(opts.tokens===!0&&(state.maxDepth=0,isPathSeparator(code)||tokens.push(token),state.tokens=tokens),opts.parts===!0||opts.tokens===!0){let prevIndex;for(let idx=0;idx<slashes.length;idx++){let n=prevIndex?prevIndex+1:start,i=slashes[idx],value=input.slice(n,i);opts.tokens&&(idx===0&&start!==0?(tokens[idx].isPrefix=!0,tokens[idx].value=prefix):tokens[idx].value=value,depth(tokens[idx]),state.maxDepth+=tokens[idx].depth),(idx!==0||value!=="")&&parts.push(value),prevIndex=i;}if(prevIndex&&prevIndex+1<input.length){let value=input.slice(prevIndex+1);parts.push(value),opts.tokens&&(tokens[tokens.length-1].value=value,depth(tokens[tokens.length-1]),state.maxDepth+=tokens[tokens.length-1].depth);}state.slashes=slashes,state.parts=parts;}return state};module.exports=scan;}});var require_parse=__commonJS({"../../node_modules/tinyglobby/node_modules/picomatch/lib/parse.js"(exports,module){var constants=require_constants(),utils=require_utils2(),{MAX_LENGTH,POSIX_REGEX_SOURCE,REGEX_NON_SPECIAL_CHARS,REGEX_SPECIAL_CHARS_BACKREF,REPLACEMENTS}=constants,expandRange=(args,options)=>{if(typeof options.expandRange=="function")return options.expandRange(...args,options);args.sort();let value=`[${args.join("-")}]`;try{new RegExp(value);}catch{return args.map(v=>utils.escapeRegex(v)).join("..")}return value},syntaxError=(type,char)=>`Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`,parse3=(input,options)=>{if(typeof input!="string")throw new TypeError("Expected a string");input=REPLACEMENTS[input]||input;let opts={...options},max=typeof opts.maxLength=="number"?Math.min(MAX_LENGTH,opts.maxLength):MAX_LENGTH,len=input.length;if(len>max)throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);let bos={type:"bos",value:"",output:opts.prepend||""},tokens=[bos],capture=opts.capture?"":"?:",PLATFORM_CHARS=constants.globChars(opts.windows),EXTGLOB_CHARS=constants.extglobChars(PLATFORM_CHARS),{DOT_LITERAL,PLUS_LITERAL,SLASH_LITERAL,ONE_CHAR,DOTS_SLASH,NO_DOT,NO_DOT_SLASH,NO_DOTS_SLASH,QMARK,QMARK_NO_DOT,STAR,START_ANCHOR}=PLATFORM_CHARS,globstar=opts2=>`(${capture}(?:(?!${START_ANCHOR}${opts2.dot?DOTS_SLASH:DOT_LITERAL}).)*?)`,nodot=opts.dot?"":NO_DOT,qmarkNoDot=opts.dot?QMARK:QMARK_NO_DOT,star=opts.bash===!0?globstar(opts):STAR;opts.capture&&(star=`(${star})`),typeof opts.noext=="boolean"&&(opts.noextglob=opts.noext);let state={input,index:-1,start:0,dot:opts.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens};input=utils.removePrefix(input,state),len=input.length;let extglobs=[],braces=[],stack=[],prev=bos,value,eos=()=>state.index===len-1,peek=state.peek=(n=1)=>input[state.index+n],advance=state.advance=()=>input[++state.index]||"",remaining=()=>input.slice(state.index+1),consume=(value2="",num=0)=>{state.consumed+=value2,state.index+=num;},append=token=>{state.output+=token.output!=null?token.output:token.value,consume(token.value);},negate=()=>{let count=1;for(;peek()==="!"&&(peek(2)!=="("||peek(3)==="?");)advance(),state.start++,count++;return count%2===0?!1:(state.negated=!0,state.start++,!0)},increment=type=>{state[type]++,stack.push(type);},decrement=type=>{state[type]--,stack.pop();},push=tok=>{if(prev.type==="globstar"){let isBrace=state.braces>0&&(tok.type==="comma"||tok.type==="brace"),isExtglob=tok.extglob===!0||extglobs.length&&(tok.type==="pipe"||tok.type==="paren");tok.type!=="slash"&&tok.type!=="paren"&&!isBrace&&!isExtglob&&(state.output=state.output.slice(0,-prev.output.length),prev.type="star",prev.value="*",prev.output=star,state.output+=prev.output);}if(extglobs.length&&tok.type!=="paren"&&(extglobs[extglobs.length-1].inner+=tok.value),(tok.value||tok.output)&&append(tok),prev&&prev.type==="text"&&tok.type==="text"){prev.output=(prev.output||prev.value)+tok.value,prev.value+=tok.value;return}tok.prev=prev,tokens.push(tok),prev=tok;},extglobOpen=(type,value2)=>{let token={...EXTGLOB_CHARS[value2],conditions:1,inner:""};token.prev=prev,token.parens=state.parens,token.output=state.output;let output=(opts.capture?"(":"")+token.open;increment("parens"),push({type,value:value2,output:state.output?"":ONE_CHAR}),push({type:"paren",extglob:!0,value:advance(),output}),extglobs.push(token);},extglobClose=token=>{let output=token.close+(opts.capture?")":""),rest;if(token.type==="negate"){let extglobStar=star;if(token.inner&&token.inner.length>1&&token.inner.includes("/")&&(extglobStar=globstar(opts)),(extglobStar!==star||eos()||/^\)+$/.test(remaining()))&&(output=token.close=`)$))${extglobStar}`),token.inner.includes("*")&&(rest=remaining())&&/^\.[^\\/.]+$/.test(rest)){let expression=parse3(rest,{...options,fastpaths:!1}).output;output=token.close=`)${expression})${extglobStar})`;}token.prev.type==="bos"&&(state.negatedExtglob=!0);}push({type:"paren",extglob:!0,value,output}),decrement("parens");};if(opts.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(input)){let backslashes=!1,output=input.replace(REGEX_SPECIAL_CHARS_BACKREF,(m,esc,chars,first,rest,index)=>first==="\\"?(backslashes=!0,m):first==="?"?esc?esc+first+(rest?QMARK.repeat(rest.length):""):index===0?qmarkNoDot+(rest?QMARK.repeat(rest.length):""):QMARK.repeat(chars.length):first==="."?DOT_LITERAL.repeat(chars.length):first==="*"?esc?esc+first+(rest?star:""):star:esc?m:`\\${m}`);return backslashes===!0&&(opts.unescape===!0?output=output.replace(/\\/g,""):output=output.replace(/\\+/g,m=>m.length%2===0?"\\\\":m?"\\":"")),output===input&&opts.contains===!0?(state.output=input,state):(state.output=utils.wrapOutput(output,state,options),state)}for(;!eos();){if(value=advance(),value==="\0")continue;if(value==="\\"){let next=peek();if(next==="/"&&opts.bash!==!0||next==="."||next===";")continue;if(!next){value+="\\",push({type:"text",value});continue}let match=/^\\+/.exec(remaining()),slashes=0;if(match&&match[0].length>2&&(slashes=match[0].length,state.index+=slashes,slashes%2!==0&&(value+="\\")),opts.unescape===!0?value=advance():value+=advance(),state.brackets===0){push({type:"text",value});continue}}if(state.brackets>0&&(value!=="]"||prev.value==="["||prev.value==="[^")){if(opts.posix!==!1&&value===":"){let inner=prev.value.slice(1);if(inner.includes("[")&&(prev.posix=!0,inner.includes(":"))){let idx=prev.value.lastIndexOf("["),pre=prev.value.slice(0,idx),rest2=prev.value.slice(idx+2),posix2=POSIX_REGEX_SOURCE[rest2];if(posix2){prev.value=pre+posix2,state.backtrack=!0,advance(),!bos.output&&tokens.indexOf(prev)===1&&(bos.output=ONE_CHAR);continue}}}(value==="["&&peek()!==":"||value==="-"&&peek()==="]")&&(value=`\\${value}`),value==="]"&&(prev.value==="["||prev.value==="[^")&&(value=`\\${value}`),opts.posix===!0&&value==="!"&&prev.value==="["&&(value="^"),prev.value+=value,append({value});continue}if(state.quotes===1&&value!=='"'){value=utils.escapeRegex(value),prev.value+=value,append({value});continue}if(value==='"'){state.quotes=state.quotes===1?0:1,opts.keepQuotes===!0&&push({type:"text",value});continue}if(value==="("){increment("parens"),push({type:"paren",value});continue}if(value===")"){if(state.parens===0&&opts.strictBrackets===!0)throw new SyntaxError(syntaxError("opening","("));let extglob=extglobs[extglobs.length-1];if(extglob&&state.parens===extglob.parens+1){extglobClose(extglobs.pop());continue}push({type:"paren",value,output:state.parens?")":"\\)"}),decrement("parens");continue}if(value==="["){if(opts.nobracket===!0||!remaining().includes("]")){if(opts.nobracket!==!0&&opts.strictBrackets===!0)throw new SyntaxError(syntaxError("closing","]"));value=`\\${value}`;}else increment("brackets");push({type:"bracket",value});continue}if(value==="]"){if(opts.nobracket===!0||prev&&prev.type==="bracket"&&prev.value.length===1){push({type:"text",value,output:`\\${value}`});continue}if(state.brackets===0){if(opts.strictBrackets===!0)throw new SyntaxError(syntaxError("opening","["));push({type:"text",value,output:`\\${value}`});continue}decrement("brackets");let prevValue=prev.value.slice(1);if(prev.posix!==!0&&prevValue[0]==="^"&&!prevValue.includes("/")&&(value=`/${value}`),prev.value+=value,append({value}),opts.literalBrackets===!1||utils.hasRegexChars(prevValue))continue;let escaped=utils.escapeRegex(prev.value);if(state.output=state.output.slice(0,-prev.value.length),opts.literalBrackets===!0){state.output+=escaped,prev.value=escaped;continue}prev.value=`(${capture}${escaped}|${prev.value})`,state.output+=prev.value;continue}if(value==="{"&&opts.nobrace!==!0){increment("braces");let open={type:"brace",value,output:"(",outputIndex:state.output.length,tokensIndex:state.tokens.length};braces.push(open),push(open);continue}if(value==="}"){let brace=braces[braces.length-1];if(opts.nobrace===!0||!brace){push({type:"text",value,output:value});continue}let output=")";if(brace.dots===!0){let arr=tokens.slice(),range=[];for(let i=arr.length-1;i>=0&&(tokens.pop(),arr[i].type!=="brace");i--)arr[i].type!=="dots"&&range.unshift(arr[i].value);output=expandRange(range,opts),state.backtrack=!0;}if(brace.comma!==!0&&brace.dots!==!0){let out=state.output.slice(0,brace.outputIndex),toks=state.tokens.slice(brace.tokensIndex);brace.value=brace.output="\\{",value=output="\\}",state.output=out;for(let t of toks)state.output+=t.output||t.value;}push({type:"brace",value,output}),decrement("braces"),braces.pop();continue}if(value==="|"){extglobs.length>0&&extglobs[extglobs.length-1].conditions++,push({type:"text",value});continue}if(value===","){let output=value,brace=braces[braces.length-1];brace&&stack[stack.length-1]==="braces"&&(brace.comma=!0,output="|"),push({type:"comma",value,output});continue}if(value==="/"){if(prev.type==="dot"&&state.index===state.start+1){state.start=state.index+1,state.consumed="",state.output="",tokens.pop(),prev=bos;continue}push({type:"slash",value,output:SLASH_LITERAL});continue}if(value==="."){if(state.braces>0&&prev.type==="dot"){prev.value==="."&&(prev.output=DOT_LITERAL);let brace=braces[braces.length-1];prev.type="dots",prev.output+=value,prev.value+=value,brace.dots=!0;continue}if(state.braces+state.parens===0&&prev.type!=="bos"&&prev.type!=="slash"){push({type:"text",value,output:DOT_LITERAL});continue}push({type:"dot",value,output:DOT_LITERAL});continue}if(value==="?"){if(!(prev&&prev.value==="(")&&opts.noextglob!==!0&&peek()==="("&&peek(2)!=="?"){extglobOpen("qmark",value);continue}if(prev&&prev.type==="paren"){let next=peek(),output=value;(prev.value==="("&&!/[!=<:]/.test(next)||next==="<"&&!/<([!=]|\w+>)/.test(remaining()))&&(output=`\\${value}`),push({type:"text",value,output});continue}if(opts.dot!==!0&&(prev.type==="slash"||prev.type==="bos")){push({type:"qmark",value,output:QMARK_NO_DOT});continue}push({type:"qmark",value,output:QMARK});continue}if(value==="!"){if(opts.noextglob!==!0&&peek()==="("&&(peek(2)!=="?"||!/[!=<:]/.test(peek(3)))){extglobOpen("negate",value);continue}if(opts.nonegate!==!0&&state.index===0){negate();continue}}if(value==="+"){if(opts.noextglob!==!0&&peek()==="("&&peek(2)!=="?"){extglobOpen("plus",value);continue}if(prev&&prev.value==="("||opts.regex===!1){push({type:"plus",value,output:PLUS_LITERAL});continue}if(prev&&(prev.type==="bracket"||prev.type==="paren"||prev.type==="brace")||state.parens>0){push({type:"plus",value});continue}push({type:"plus",value:PLUS_LITERAL});continue}if(value==="@"){if(opts.noextglob!==!0&&peek()==="("&&peek(2)!=="?"){push({type:"at",extglob:!0,value,output:""});continue}push({type:"text",value});continue}if(value!=="*"){(value==="$"||value==="^")&&(value=`\\${value}`);let match=REGEX_NON_SPECIAL_CHARS.exec(remaining());match&&(value+=match[0],state.index+=match[0].length),push({type:"text",value});continue}if(prev&&(prev.type==="globstar"||prev.star===!0)){prev.type="star",prev.star=!0,prev.value+=value,prev.output=star,state.backtrack=!0,state.globstar=!0,consume(value);continue}let rest=remaining();if(opts.noextglob!==!0&&/^\([^?]/.test(rest)){extglobOpen("star",value);continue}if(prev.type==="star"){if(opts.noglobstar===!0){consume(value);continue}let prior=prev.prev,before=prior.prev,isStart=prior.type==="slash"||prior.type==="bos",afterStar=before&&(before.type==="star"||before.type==="globstar");if(opts.bash===!0&&(!isStart||rest[0]&&rest[0]!=="/")){push({type:"star",value,output:""});continue}let isBrace=state.braces>0&&(prior.type==="comma"||prior.type==="brace"),isExtglob=extglobs.length&&(prior.type==="pipe"||prior.type==="paren");if(!isStart&&prior.type!=="paren"&&!isBrace&&!isExtglob){push({type:"star",value,output:""});continue}for(;rest.slice(0,3)==="/**";){let after=input[state.index+4];if(after&&after!=="/")break;rest=rest.slice(3),consume("/**",3);}if(prior.type==="bos"&&eos()){prev.type="globstar",prev.value+=value,prev.output=globstar(opts),state.output=prev.output,state.globstar=!0,consume(value);continue}if(prior.type==="slash"&&prior.prev.type!=="bos"&&!afterStar&&eos()){state.output=state.output.slice(0,-(prior.output+prev.output).length),prior.output=`(?:${prior.output}`,prev.type="globstar",prev.output=globstar(opts)+(opts.strictSlashes?")":"|$)"),prev.value+=value,state.globstar=!0,state.output+=prior.output+prev.output,consume(value);continue}if(prior.type==="slash"&&prior.prev.type!=="bos"&&rest[0]==="/"){let end=rest[1]!==void 0?"|$":"";state.output=state.output.slice(0,-(prior.output+prev.output).length),prior.output=`(?:${prior.output}`,prev.type="globstar",prev.output=`${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`,prev.value+=value,state.output+=prior.output+prev.output,state.globstar=!0,consume(value+advance()),push({type:"slash",value:"/",output:""});continue}if(prior.type==="bos"&&rest[0]==="/"){prev.type="globstar",prev.value+=value,prev.output=`(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`,state.output=prev.output,state.globstar=!0,consume(value+advance()),push({type:"slash",value:"/",output:""});continue}state.output=state.output.slice(0,-prev.output.length),prev.type="globstar",prev.output=globstar(opts),prev.value+=value,state.output+=prev.output,state.globstar=!0,consume(value);continue}let token={type:"star",value,output:star};if(opts.bash===!0){token.output=".*?",(prev.type==="bos"||prev.type==="slash")&&(token.output=nodot+token.output),push(token);continue}if(prev&&(prev.type==="bracket"||prev.type==="paren")&&opts.regex===!0){token.output=value,push(token);continue}(state.index===state.start||prev.type==="slash"||prev.type==="dot")&&(prev.type==="dot"?(state.output+=NO_DOT_SLASH,prev.output+=NO_DOT_SLASH):opts.dot===!0?(state.output+=NO_DOTS_SLASH,prev.output+=NO_DOTS_SLASH):(state.output+=nodot,prev.output+=nodot),peek()!=="*"&&(state.output+=ONE_CHAR,prev.output+=ONE_CHAR)),push(token);}for(;state.brackets>0;){if(opts.strictBrackets===!0)throw new SyntaxError(syntaxError("closing","]"));state.output=utils.escapeLast(state.output,"["),decrement("brackets");}for(;state.parens>0;){if(opts.strictBrackets===!0)throw new SyntaxError(syntaxError("closing",")"));state.output=utils.escapeLast(state.output,"("),decrement("parens");}for(;state.braces>0;){if(opts.strictBrackets===!0)throw new SyntaxError(syntaxError("closing","}"));state.output=utils.escapeLast(state.output,"{"),decrement("braces");}if(opts.strictSlashes!==!0&&(prev.type==="star"||prev.type==="bracket")&&push({type:"maybe_slash",value:"",output:`${SLASH_LITERAL}?`}),state.backtrack===!0){state.output="";for(let token of state.tokens)state.output+=token.output!=null?token.output:token.value,token.suffix&&(state.output+=token.suffix);}return state};parse3.fastpaths=(input,options)=>{let opts={...options},max=typeof opts.maxLength=="number"?Math.min(MAX_LENGTH,opts.maxLength):MAX_LENGTH,len=input.length;if(len>max)throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);input=REPLACEMENTS[input]||input;let{DOT_LITERAL,SLASH_LITERAL,ONE_CHAR,DOTS_SLASH,NO_DOT,NO_DOTS,NO_DOTS_SLASH,STAR,START_ANCHOR}=constants.globChars(opts.windows),nodot=opts.dot?NO_DOTS:NO_DOT,slashDot=opts.dot?NO_DOTS_SLASH:NO_DOT,capture=opts.capture?"":"?:",state={negated:!1,prefix:""},star=opts.bash===!0?".*?":STAR;opts.capture&&(star=`(${star})`);let globstar=opts2=>opts2.noglobstar===!0?star:`(${capture}(?:(?!${START_ANCHOR}${opts2.dot?DOTS_SLASH:DOT_LITERAL}).)*?)`,create=str=>{switch(str){case"*":return `${nodot}${ONE_CHAR}${star}`;case".*":return `${DOT_LITERAL}${ONE_CHAR}${star}`;case"*.*":return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;case"*/*":return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;case"**":return nodot+globstar(opts);case"**/*":return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;case"**/*.*":return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;case"**/.*":return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;default:{let match=/^(.*?)\.(\w+)$/.exec(str);if(!match)return;let source2=create(match[1]);return source2?source2+DOT_LITERAL+match[2]:void 0}}},output=utils.removePrefix(input,state),source=create(output);return source&&opts.strictSlashes!==!0&&(source+=`${SLASH_LITERAL}?`),source};module.exports=parse3;}});var require_picomatch=__commonJS({"../../node_modules/tinyglobby/node_modules/picomatch/lib/picomatch.js"(exports,module){var scan=require_scan(),parse3=require_parse(),utils=require_utils2(),constants=require_constants(),isObject=val=>val&&typeof val=="object"&&!Array.isArray(val),picomatch=(glob,options,returnState=!1)=>{if(Array.isArray(glob)){let fns=glob.map(input=>picomatch(input,options,returnState));return str=>{for(let isMatch of fns){let state2=isMatch(str);if(state2)return state2}return !1}}let isState=isObject(glob)&&glob.tokens&&glob.input;if(glob===""||typeof glob!="string"&&!isState)throw new TypeError("Expected pattern to be a non-empty string");let opts=options||{},posix2=opts.windows,regex=isState?picomatch.compileRe(glob,options):picomatch.makeRe(glob,options,!1,!0),state=regex.state;delete regex.state;let isIgnored=()=>!1;if(opts.ignore){let ignoreOpts={...options,ignore:null,onMatch:null,onResult:null};isIgnored=picomatch(opts.ignore,ignoreOpts,returnState);}let matcher=(input,returnObject=!1)=>{let{isMatch,match,output}=picomatch.test(input,regex,options,{glob,posix:posix2}),result={glob,state,regex,posix:posix2,input,output,match,isMatch};return typeof opts.onResult=="function"&&opts.onResult(result),isMatch===!1?(result.isMatch=!1,returnObject?result:!1):isIgnored(input)?(typeof opts.onIgnore=="function"&&opts.onIgnore(result),result.isMatch=!1,returnObject?result:!1):(typeof opts.onMatch=="function"&&opts.onMatch(result),returnObject?result:!0)};return returnState&&(matcher.state=state),matcher};picomatch.test=(input,regex,options,{glob,posix:posix2}={})=>{if(typeof input!="string")throw new TypeError("Expected input to be a string");if(input==="")return {isMatch:!1,output:""};let opts=options||{},format=opts.format||(posix2?utils.toPosixSlashes:null),match=input===glob,output=match&&format?format(input):input;return match===!1&&(output=format?format(input):input,match=output===glob),(match===!1||opts.capture===!0)&&(opts.matchBase===!0||opts.basename===!0?match=picomatch.matchBase(input,regex,options,posix2):match=regex.exec(output)),{isMatch:!!match,match,output}};picomatch.matchBase=(input,glob,options)=>(glob instanceof RegExp?glob:picomatch.makeRe(glob,options)).test(utils.basename(input));picomatch.isMatch=(str,patterns,options)=>picomatch(patterns,options)(str);picomatch.parse=(pattern,options)=>Array.isArray(pattern)?pattern.map(p=>picomatch.parse(p,options)):parse3(pattern,{...options,fastpaths:!1});picomatch.scan=(input,options)=>scan(input,options);picomatch.compileRe=(state,options,returnOutput=!1,returnState=!1)=>{if(returnOutput===!0)return state.output;let opts=options||{},prepend=opts.contains?"":"^",append=opts.contains?"":"$",source=`${prepend}(?:${state.output})${append}`;state&&state.negated===!0&&(source=`^(?!${source}).*$`);let regex=picomatch.toRegex(source,options);return returnState===!0&&(regex.state=state),regex};picomatch.makeRe=(input,options={},returnOutput=!1,returnState=!1)=>{if(!input||typeof input!="string")throw new TypeError("Expected a non-empty string");let parsed={negated:!1,fastpaths:!0};return options.fastpaths!==!1&&(input[0]==="."||input[0]==="*")&&(parsed.output=parse3.fastpaths(input,options)),parsed.output||(parsed=parse3(input,options)),picomatch.compileRe(parsed,options,returnOutput,returnState)};picomatch.toRegex=(source,options)=>{try{let opts=options||{};return new RegExp(source,opts.flags||(opts.nocase?"i":""))}catch(err){if(options&&options.debug===!0)throw err;return /$^/}};picomatch.constants=constants;module.exports=picomatch;}});var require_picomatch2=__commonJS({"../../node_modules/tinyglobby/node_modules/picomatch/index.js"(exports,module){var pico=require_picomatch(),utils=require_utils2();function picomatch(glob,options,returnState=!1){return options&&(options.windows===null||options.windows===void 0)&&(options={...options,windows:utils.isWindows()}),pico(glob,options,returnState)}Object.assign(picomatch,pico);module.exports=picomatch;}});var require_builder=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/builder/index.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});exports.Builder=void 0;var path_1=__require("path"),api_builder_1=require_api_builder(),pm=null;try{__require.resolve("picomatch"),pm=require_picomatch2();}catch{}var Builder=class{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:path_1.sep,filters:[]};globFunction;constructor(options){this.options={...this.options,...options},this.globFunction=this.options.globFunction;}group(){return this.options.group=!0,this}withPathSeparator(separator){return this.options.pathSeparator=separator,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(depth){return this.options.maxDepth=depth,this}withMaxFiles(limit){return this.options.maxFiles=limit,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=resolvePaths,this.withFullPaths()}withAbortSignal(signal){return this.options.signal=signal,this}normalize(){return this.options.normalizePath=!0,this}filter(predicate){return this.options.filters.push(predicate),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(predicate){return this.options.exclude=predicate,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(root){return new api_builder_1.APIBuilder(root||".",this.options)}withGlobFunction(fn){return this.globFunction=fn,this}crawlWithOptions(root,options){return this.options={...this.options,...options},new api_builder_1.APIBuilder(root||".",this.options)}glob(...patterns){return this.globFunction?this.globWithOptions(patterns):this.globWithOptions(patterns,{dot:!0})}globWithOptions(patterns,...options){let globFn=this.globFunction||pm;if(!globFn)throw new Error("Please specify a glob function to use glob matching.");var isMatch=this.globCache[patterns.join("\0")];return isMatch||(isMatch=globFn(patterns,...options),this.globCache[patterns.join("\0")]=isMatch),this.options.filters.push(path2=>isMatch(path2)),this}};exports.Builder=Builder;}});var require_types=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/types.js"(exports){Object.defineProperty(exports,"__esModule",{value:!0});}});var require_dist=__commonJS({"../../node_modules/tinyglobby/node_modules/fdir/dist/index.js"(exports){var __createBinding=exports&&exports.__createBinding||(Object.create?function(o,m,k,k2){k2===void 0&&(k2=k);var desc=Object.getOwnPropertyDescriptor(m,k);(!desc||("get"in desc?!m.__esModule:desc.writable||desc.configurable))&&(desc={enumerable:!0,get:function(){return m[k]}}),Object.defineProperty(o,k2,desc);}:function(o,m,k,k2){k2===void 0&&(k2=k),o[k2]=m[k];}),__exportStar=exports&&exports.__exportStar||function(m,exports2){for(var p in m)p!=="default"&&!Object.prototype.hasOwnProperty.call(exports2,p)&&__createBinding(exports2,m,p);};Object.defineProperty(exports,"__esModule",{value:!0});exports.fdir=void 0;var builder_1=require_builder();Object.defineProperty(exports,"fdir",{enumerable:!0,get:function(){return builder_1.Builder}});__exportStar(require_types(),exports);}});var import_picocolors=__toESM(require_picocolors()),import_sirv=__toESM(require_build());__toESM(require_dist(),1);var ESCAPED_WIN32_BACKSLASHES=/\\(?![()[\]{}!+@])/g;function convertPosixPathToPattern(path2){return escapePosixPath(path2)}function convertWin32PathToPattern(path2){return escapeWin32Path(path2).replace(ESCAPED_WIN32_BACKSLASHES,"/")}var convertPathToPattern=process.platform==="win32"?convertWin32PathToPattern:convertPosixPathToPattern,POSIX_UNESCAPED_GLOB_SYMBOLS=/(?<!\\)([()[\]{}*?|]|^!|[!+@](?=\()|\\(?![()[\]{}!*+?@|]))/g,WIN32_UNESCAPED_GLOB_SYMBOLS=/(?<!\\)([()[\]{}]|^!|[!+@](?=\())/g,escapePosixPath=path2=>path2.replace(POSIX_UNESCAPED_GLOB_SYMBOLS,"\\$&"),escapeWin32Path=path2=>path2.replace(WIN32_UNESCAPED_GLOB_SYMBOLS,"\\$&");process.platform==="win32"?escapeWin32Path:escapePosixPath;var withoutVitePlugins=async(plugins=[],namesToRemove)=>{let result=[],resolvedPlugins=await Promise.all(plugins);for(let plugin of resolvedPlugins)Array.isArray(plugin)?result.push(await withoutVitePlugins(plugin,namesToRemove)):plugin&&typeof plugin=="object"&&"name"in plugin&&typeof plugin.name=="string"&&!namesToRemove.includes(plugin.name)&&result.push(plugin);return result};var require2=createRequire(import.meta.url),{StoryIndexGenerator,experimental_loadStorybook,mapStaticDir}=require2("storybook/internal/core-server"),WORKING_DIR=process.cwd(),defaultOptions={storybookScript:void 0,configDir:resolve$1(join$1(WORKING_DIR,".storybook")),storybookUrl:"http://localhost:6006"},extractTagsFromPreview=async configDir=>{let previewConfigPath=getInterpretedFile(join$1(resolve$1(configDir),"preview"));return previewConfigPath?(await readConfig(previewConfigPath)).getFieldValue(["tags"])??[]:[]},getStoryGlobsAndFiles=async(presets,directories)=>{let stories=await presets.apply("stories",[]),docs=await presets.apply("docs",{}),indexers=await presets.apply("experimental_indexers",[]),generator=new StoryIndexGenerator(normalizeStories(stories,directories),{...directories,indexers,docs});return await generator.initialize(),{storiesGlobs:stories,storiesFiles:generator.storyFileNames()}},PACKAGE_DIR=dirname(require2.resolve("@storybook/addon-vitest/package.json")),storybookTest=async options=>{let finalOptions={...defaultOptions,...options,configDir:options?.configDir?resolve$1(WORKING_DIR,options.configDir):defaultOptions.configDir,tags:{include:options?.tags?.include??["test"],exclude:options?.tags?.exclude??[],skip:options?.tags?.skip??[]}};process.env.DEBUG&&(finalOptions.debug=!0),process.env.__STORYBOOK_URL__=finalOptions.storybookUrl,process.env.__STORYBOOK_SCRIPT__=finalOptions.storybookScript;let directories={configDir:finalOptions.configDir,workingDir:WORKING_DIR},{presets}=await experimental_loadStorybook({configDir:finalOptions.configDir,packageJson:{}}),[{storiesGlobs,storiesFiles},framework,storybookEnv,viteConfigFromStorybook,staticDirs,previewLevelTags]=await Promise.all([getStoryGlobsAndFiles(presets,directories),presets.apply("framework",void 0),presets.apply("env",{}),presets.apply("viteFinal",{}),presets.apply("staticDirs",[]),extractTagsFromPreview(finalOptions.configDir)]),plugins=await withoutVitePlugins(viteConfigFromStorybook.plugins??[],["storybook:package-deduplication","storybook:mdx-plugin","storybook:react-docgen-plugin","vite:react-docgen-typescript","storybook:svelte-docgen-plugin","storybook:vue-component-meta-plugin","storybook:vue-docgen-plugin"]),storybookTestPlugin={name:"vite-plugin-storybook-test",async transformIndexHtml(html){let[headHtmlSnippet,bodyHtmlSnippet]=await Promise.all([presets.apply("previewHead"),presets.apply("previewBody")]);return html.replace("</head>",`${headHtmlSnippet??""}</head>`).replace("<body>",`<body>${bodyHtmlSnippet??""}`)},async config(inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED){try{await validateConfigurationFiles(finalOptions.configDir);}catch{throw new MainFileMissingError({location:finalOptions.configDir,source:"vitest"})}let frameworkName=typeof framework=="string"?framework:framework.name,vitestStorybook=process.env.VITEST_STORYBOOK??"false",baseConfig={test:{setupFiles:[join$1(PACKAGE_DIR,"dist/vitest-plugin/setup-file.mjs"),typeof inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.setupFiles=="string"&&inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.setupFiles].filter(Boolean),...finalOptions.storybookScript?{globalSetup:[join$1(PACKAGE_DIR,"dist/vitest-plugin/global-setup.mjs")]}:{},env:{...storybookEnv,__STORYBOOK_URL__:finalOptions.storybookUrl,VITEST_STORYBOOK:vitestStorybook,__VITEST_INCLUDE_TAGS__:finalOptions.tags.include.join(","),__VITEST_EXCLUDE_TAGS__:finalOptions.tags.exclude.join(","),__VITEST_SKIP_TAGS__:finalOptions.tags.skip.join(",")},include:storiesFiles.filter(path2=>!path2.endsWith(".mdx")).map(path2=>convertPathToPattern(path2)),...inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.server?.deps?.inline!==!0?{server:{deps:{inline:["@storybook/addon-vitest"]}}}:{},browser:{commands:{getInitialGlobals:()=>{let envConfig=JSON.parse(process.env.VITEST_STORYBOOK_CONFIG??"{}");return {a11y:{manual:!(process.env.VITEST_STORYBOOK?envConfig.a11y??!1:!0)}}}},...inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.browser&&inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test.browser.screenshotFailures===void 0?{screenshotFailures:!1}:{}}},envPrefix:Array.from(new Set([...inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.envPrefix||[],"STORYBOOK_","VITE_"])),resolve:{conditions:["storybook","stories","test","module","browser","development|production"]},optimizeDeps:{include:["@storybook/addon-vitest/internal/setup-file","@storybook/addon-vitest/internal/global-setup","@storybook/addon-vitest/internal/test-utils",...frameworkName?.includes("react")||frameworkName?.includes("nextjs")?["react-dom/test-utils"]:[]]},define:{...frameworkName?.includes("vue3")?{__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:"false"}:{}}},config=mergeConfig(baseConfig,viteConfigFromStorybook);return (inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test?.include?.length??0)>0&&(inputConfig_ONLY_MUTATE_WHEN_STRICTLY_NEEDED_OR_YOU_WILL_BE_FIRED.test.include=[],console.log(import_picocolors.default.yellow(dedent`
|
|
19
|
+
Warning: Starting in Storybook 8.5.0-alpha.18, the "test.include" option in Vitest is discouraged in favor of just using the "stories" field in your Storybook configuration.
|
|
20
|
+
|
|
21
|
+
The values you passed to "test.include" will be ignored, please remove them from your Vitest configuration where the Storybook plugin is applied.
|
|
22
|
+
|
|
23
|
+
More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#addon-test-indexing-behavior-of-storybookaddon-test-is-changed
|
|
24
|
+
`))),config},configureVitest(context){context.vitest.config.coverage.exclude.push("storybook-static");},async configureServer(server){if(staticDirs)for(let staticDir of staticDirs)try{let{staticPath,targetEndpoint}=mapStaticDir(staticDir,directories.configDir);server.middlewares.use(targetEndpoint,(0,import_sirv.default)(staticPath,{dev:!0,etag:!0,extensions:[]}));}catch(e){console.warn(e);}},async transform(code,id){if(process.env.VITEST!=="true")return code;if(storiesFiles.includes(id))return vitestTransform({code,fileName:id,configDir:finalOptions.configDir,tagsFilter:finalOptions.tags,stories:storiesGlobs,previewLevelTags})}};return plugins.push(storybookTestPlugin),plugins},vitest_plugin_default=storybookTest;
|
|
25
|
+
|
|
26
|
+
export { vitest_plugin_default as default, storybookTest };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RunnerTask } from 'vitest';
|
|
2
|
+
import { Channel } from 'storybook/internal/channels';
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
var __STORYBOOK_ADDONS_CHANNEL__: Channel;
|
|
6
|
+
}
|
|
7
|
+
type Task = Partial<RunnerTask> & {
|
|
8
|
+
meta: Record<string, any>;
|
|
9
|
+
};
|
|
10
|
+
declare const modifyErrorMessage: ({ task }: {
|
|
11
|
+
task: Task;
|
|
12
|
+
}) => void;
|
|
13
|
+
|
|
14
|
+
export { Task, modifyErrorMessage };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var vitest = require('vitest');
|
|
4
|
+
var channels = require('storybook/internal/channels');
|
|
5
|
+
|
|
6
|
+
var transport={setHandler:vitest.vi.fn(),send:vitest.vi.fn()};globalThis.__STORYBOOK_ADDONS_CHANNEL__??=new channels.Channel({transport});var modifyErrorMessage=({task})=>{let meta=task.meta;if(task.type==="test"&&task.result?.state==="fail"&&meta.storyId&&task.result.errors?.[0]){let currentError=task.result.errors[0],storyUrl=`${undefined.__STORYBOOK_URL__}/?path=/story/${meta.storyId}&addonPanel=storybook/test/panel`;currentError.message=`
|
|
7
|
+
\x1B[34mClick to debug the error directly in Storybook: ${storyUrl}\x1B[39m
|
|
8
|
+
|
|
9
|
+
${currentError.message}`;}};vitest.afterEach(modifyErrorMessage);
|
|
10
|
+
|
|
11
|
+
exports.modifyErrorMessage = modifyErrorMessage;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { vi, afterEach } from 'vitest';
|
|
2
|
+
import { Channel } from 'storybook/internal/channels';
|
|
3
|
+
|
|
4
|
+
var transport={setHandler:vi.fn(),send:vi.fn()};globalThis.__STORYBOOK_ADDONS_CHANNEL__??=new Channel({transport});var modifyErrorMessage=({task})=>{let meta=task.meta;if(task.type==="test"&&task.result?.state==="fail"&&meta.storyId&&task.result.errors?.[0]){let currentError=task.result.errors[0],storyUrl=`${import.meta.env.__STORYBOOK_URL__}/?path=/story/${meta.storyId}&addonPanel=storybook/test/panel`;currentError.message=`
|
|
5
|
+
\x1B[34mClick to debug the error directly in Storybook: ${storyUrl}\x1B[39m
|
|
6
|
+
|
|
7
|
+
${currentError.message}`;}};afterEach(modifyErrorMessage);
|
|
8
|
+
|
|
9
|
+
export { modifyErrorMessage };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TestContext } from 'vitest';
|
|
2
|
+
import { ComposedStoryFn, ComponentAnnotations } from 'storybook/internal/types';
|
|
3
|
+
|
|
4
|
+
declare module '@vitest/browser/context' {
|
|
5
|
+
interface BrowserCommands {
|
|
6
|
+
getInitialGlobals: () => Promise<Record<string, any>>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
declare const testStory: (exportName: string, story: ComposedStoryFn, meta: ComponentAnnotations, skipTags: string[]) => (context: TestContext & {
|
|
10
|
+
story: ComposedStoryFn;
|
|
11
|
+
}) => Promise<void>;
|
|
12
|
+
|
|
13
|
+
export { testStory };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var context = require('@vitest/browser/context');
|
|
4
|
+
var previewApi = require('storybook/preview-api');
|
|
5
|
+
var previewErrors = require('storybook/internal/preview-errors');
|
|
6
|
+
var viewport = require('storybook/viewport');
|
|
7
|
+
|
|
8
|
+
var DEFAULT_VIEWPORT_DIMENSIONS={width:1200,height:900},validPixelOrNumber=/^\d+(px)?$/,percentagePattern=/^(\d+(\.\d+)?%)$/,vwPattern=/^(\d+(\.\d+)?vw)$/,vhPattern=/^(\d+(\.\d+)?vh)$/,emRemPattern=/^(\d+)(em|rem)$/,parseDimension=(value,dimension)=>{if(validPixelOrNumber.test(value))return Number.parseInt(value,10);if(percentagePattern.test(value)){let percentageValue=parseFloat(value)/100;return Math.round(DEFAULT_VIEWPORT_DIMENSIONS[dimension]*percentageValue)}else if(vwPattern.test(value)){let vwValue=parseFloat(value)/100;return Math.round(DEFAULT_VIEWPORT_DIMENSIONS.width*vwValue)}else if(vhPattern.test(value)){let vhValue=parseFloat(value)/100;return Math.round(DEFAULT_VIEWPORT_DIMENSIONS.height*vhValue)}else {if(emRemPattern.test(value))return Number.parseInt(value,10)*16;throw new previewErrors.UnsupportedViewportDimensionError({dimension,value})}},setViewport=async(parameters={},globals={})=>{let defaultViewport,viewportsParam=parameters.viewport??{},viewportsGlobal=globals.viewport??{},isDisabled=viewportsParam.disable||viewportsParam.disabled;viewportsGlobal.value&&!isDisabled?defaultViewport=viewportsGlobal.value:isDisabled||(defaultViewport=viewportsParam.defaultViewport);let{page}=await import('@vitest/browser/context').catch(()=>({page:null}));if(!page||!globalThis.__vitest_browser__)return;let viewports={...viewport.MINIMAL_VIEWPORTS,...viewportsParam.viewports,...viewportsParam.options},viewportWidth=DEFAULT_VIEWPORT_DIMENSIONS.width,viewportHeight=DEFAULT_VIEWPORT_DIMENSIONS.height;if(defaultViewport&&defaultViewport in viewports){let styles=viewports[defaultViewport].styles;if(styles?.width&&styles?.height){let{width,height}=styles;viewportWidth=parseDimension(width,"width"),viewportHeight=parseDimension(height,"height");}}await page.viewport(viewportWidth,viewportHeight);};var {getInitialGlobals}=context.server.commands,testStory=(exportName,story,meta,skipTags)=>async context=>{let annotations=previewApi.getCsfFactoryAnnotations(story,meta),composedStory=previewApi.composeStory(annotations.story,annotations.meta,{initialGlobals:await getInitialGlobals?.()??{}},annotations.preview??globalThis.globalProjectAnnotations,exportName);(composedStory===void 0||skipTags?.some(tag=>composedStory.tags.includes(tag)))&&context.skip(),context.story=composedStory;let _task=context.task;_task.meta.storyId=composedStory.id,await setViewport(composedStory.parameters,composedStory.globals),await composedStory.run(),_task.meta.reports=composedStory.reporting.reports;};
|
|
9
|
+
|
|
10
|
+
exports.testStory = testStory;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { server } from '@vitest/browser/context';
|
|
2
|
+
import { getCsfFactoryAnnotations, composeStory } from 'storybook/preview-api';
|
|
3
|
+
import { UnsupportedViewportDimensionError } from 'storybook/internal/preview-errors';
|
|
4
|
+
import { MINIMAL_VIEWPORTS } from 'storybook/viewport';
|
|
5
|
+
|
|
6
|
+
var DEFAULT_VIEWPORT_DIMENSIONS={width:1200,height:900},validPixelOrNumber=/^\d+(px)?$/,percentagePattern=/^(\d+(\.\d+)?%)$/,vwPattern=/^(\d+(\.\d+)?vw)$/,vhPattern=/^(\d+(\.\d+)?vh)$/,emRemPattern=/^(\d+)(em|rem)$/,parseDimension=(value,dimension)=>{if(validPixelOrNumber.test(value))return Number.parseInt(value,10);if(percentagePattern.test(value)){let percentageValue=parseFloat(value)/100;return Math.round(DEFAULT_VIEWPORT_DIMENSIONS[dimension]*percentageValue)}else if(vwPattern.test(value)){let vwValue=parseFloat(value)/100;return Math.round(DEFAULT_VIEWPORT_DIMENSIONS.width*vwValue)}else if(vhPattern.test(value)){let vhValue=parseFloat(value)/100;return Math.round(DEFAULT_VIEWPORT_DIMENSIONS.height*vhValue)}else {if(emRemPattern.test(value))return Number.parseInt(value,10)*16;throw new UnsupportedViewportDimensionError({dimension,value})}},setViewport=async(parameters={},globals={})=>{let defaultViewport,viewportsParam=parameters.viewport??{},viewportsGlobal=globals.viewport??{},isDisabled=viewportsParam.disable||viewportsParam.disabled;viewportsGlobal.value&&!isDisabled?defaultViewport=viewportsGlobal.value:isDisabled||(defaultViewport=viewportsParam.defaultViewport);let{page}=await import('@vitest/browser/context').catch(()=>({page:null}));if(!page||!globalThis.__vitest_browser__)return;let viewports={...MINIMAL_VIEWPORTS,...viewportsParam.viewports,...viewportsParam.options},viewportWidth=DEFAULT_VIEWPORT_DIMENSIONS.width,viewportHeight=DEFAULT_VIEWPORT_DIMENSIONS.height;if(defaultViewport&&defaultViewport in viewports){let styles=viewports[defaultViewport].styles;if(styles?.width&&styles?.height){let{width,height}=styles;viewportWidth=parseDimension(width,"width"),viewportHeight=parseDimension(height,"height");}}await page.viewport(viewportWidth,viewportHeight);};var {getInitialGlobals}=server.commands,testStory=(exportName,story,meta,skipTags)=>async context=>{let annotations=getCsfFactoryAnnotations(story,meta),composedStory=composeStory(annotations.story,annotations.meta,{initialGlobals:await getInitialGlobals?.()??{}},annotations.preview??globalThis.globalProjectAnnotations,exportName);(composedStory===void 0||skipTags?.some(tag=>composedStory.tags.includes(tag)))&&context.skip(),context.story=composedStory;let _task=context.task;_task.meta.storyId=composedStory.id,await setViewport(composedStory.parameters,composedStory.globals),await composedStory.run(),_task.meta.reports=composedStory.reporting.reports;};
|
|
7
|
+
|
|
8
|
+
export { testStory };
|
package/manager.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('./dist/manager');
|
package/manager.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './dist/manager';
|
package/package.json
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@storybook/addon-vitest",
|
|
3
|
+
"version": "0.0.0-pr-31014-sha-9708fd9e",
|
|
4
|
+
"description": "Storybook addon for testing components",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"storybook-addons",
|
|
7
|
+
"addon-vitest",
|
|
8
|
+
"vitest",
|
|
9
|
+
"testing",
|
|
10
|
+
"test"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/addons/vitest",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/storybookjs/storybook/issues"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "https://github.com/storybookjs/storybook.git",
|
|
19
|
+
"directory": "code/addons/vitest"
|
|
20
|
+
},
|
|
21
|
+
"funding": {
|
|
22
|
+
"type": "opencollective",
|
|
23
|
+
"url": "https://opencollective.com/storybook"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"imports": {
|
|
27
|
+
"#manager-store": {
|
|
28
|
+
"storybook": "./src/manager-store.mock.ts",
|
|
29
|
+
"default": "./src/manager-store.ts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"types": "./dist/index.d.ts",
|
|
35
|
+
"import": "./dist/index.mjs",
|
|
36
|
+
"require": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"./vitest-plugin": {
|
|
39
|
+
"types": "./dist/vitest-plugin/index.d.ts",
|
|
40
|
+
"import": "./dist/vitest-plugin/index.mjs",
|
|
41
|
+
"require": "./dist/vitest-plugin/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./internal/global-setup": {
|
|
44
|
+
"types": "./dist/vitest-plugin/global-setup.d.ts",
|
|
45
|
+
"import": "./dist/vitest-plugin/global-setup.mjs",
|
|
46
|
+
"require": "./dist/vitest-plugin/global-setup.js"
|
|
47
|
+
},
|
|
48
|
+
"./internal/setup-file": {
|
|
49
|
+
"types": "./dist/vitest-plugin/setup-file.d.ts",
|
|
50
|
+
"import": "./dist/vitest-plugin/setup-file.mjs"
|
|
51
|
+
},
|
|
52
|
+
"./internal/test-utils": {
|
|
53
|
+
"types": "./dist/vitest-plugin/test-utils.d.ts",
|
|
54
|
+
"import": "./dist/vitest-plugin/test-utils.mjs",
|
|
55
|
+
"require": "./dist/vitest-plugin/test-utils.js"
|
|
56
|
+
},
|
|
57
|
+
"./internal/coverage-reporter": {
|
|
58
|
+
"types": "./dist/node/coverage-reporter.d.ts",
|
|
59
|
+
"import": "./dist/node/coverage-reporter.mjs",
|
|
60
|
+
"require": "./dist/node/coverage-reporter.js"
|
|
61
|
+
},
|
|
62
|
+
"./manager": "./dist/manager.js",
|
|
63
|
+
"./preset": "./dist/preset.js",
|
|
64
|
+
"./postinstall": "./dist/postinstall.js",
|
|
65
|
+
"./package.json": "./package.json"
|
|
66
|
+
},
|
|
67
|
+
"main": "dist/index.js",
|
|
68
|
+
"module": "dist/index.mjs",
|
|
69
|
+
"types": "dist/index.d.ts",
|
|
70
|
+
"typesVersions": {
|
|
71
|
+
"*": {
|
|
72
|
+
"*": [
|
|
73
|
+
"dist/index.d.ts"
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"files": [
|
|
78
|
+
"dist/**/*",
|
|
79
|
+
"templates/**/*",
|
|
80
|
+
"!dist/dummy.*",
|
|
81
|
+
"README.md",
|
|
82
|
+
"*.mjs",
|
|
83
|
+
"*.js",
|
|
84
|
+
"*.cjs",
|
|
85
|
+
"*.d.ts",
|
|
86
|
+
"!src/**/*"
|
|
87
|
+
],
|
|
88
|
+
"scripts": {
|
|
89
|
+
"check": "jiti ../../../scripts/prepare/check.ts",
|
|
90
|
+
"prep": "jiti ../../../scripts/prepare/addon-bundle.ts"
|
|
91
|
+
},
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"@storybook/global": "^5.0.0",
|
|
94
|
+
"@storybook/icons": "^1.4.0",
|
|
95
|
+
"prompts": "^2.4.0",
|
|
96
|
+
"ts-dedent": "^2.2.0"
|
|
97
|
+
},
|
|
98
|
+
"devDependencies": {
|
|
99
|
+
"@types/istanbul-lib-report": "^3.0.3",
|
|
100
|
+
"@types/node": "^22.0.0",
|
|
101
|
+
"@types/semver": "^7",
|
|
102
|
+
"@vitest/browser": "^3.1.1",
|
|
103
|
+
"@vitest/runner": "^3.1.1",
|
|
104
|
+
"boxen": "^8.0.1",
|
|
105
|
+
"es-toolkit": "^1.22.0",
|
|
106
|
+
"execa": "^8.0.1",
|
|
107
|
+
"find-up": "^7.0.0",
|
|
108
|
+
"istanbul-lib-report": "^3.0.1",
|
|
109
|
+
"pathe": "^1.1.2",
|
|
110
|
+
"picocolors": "^1.1.0",
|
|
111
|
+
"react": "^18.2.0",
|
|
112
|
+
"react-dom": "^18.2.0",
|
|
113
|
+
"semver": "^7.6.3",
|
|
114
|
+
"sirv": "^2.0.4",
|
|
115
|
+
"slash": "^5.0.0",
|
|
116
|
+
"tinyglobby": "^0.2.10",
|
|
117
|
+
"tree-kill": "^1.2.2",
|
|
118
|
+
"ts-dedent": "^2.2.0",
|
|
119
|
+
"typescript": "^5.7.3",
|
|
120
|
+
"vitest": "^3.1.1"
|
|
121
|
+
},
|
|
122
|
+
"peerDependencies": {
|
|
123
|
+
"@vitest/browser": "^3.0.0",
|
|
124
|
+
"@vitest/runner": "^3.0.0",
|
|
125
|
+
"storybook": "^0.0.0-pr-31014-sha-9708fd9e",
|
|
126
|
+
"vitest": "^3.0.0"
|
|
127
|
+
},
|
|
128
|
+
"peerDependenciesMeta": {
|
|
129
|
+
"@vitest/browser": {
|
|
130
|
+
"optional": true
|
|
131
|
+
},
|
|
132
|
+
"@vitest/runner": {
|
|
133
|
+
"optional": true
|
|
134
|
+
},
|
|
135
|
+
"vitest": {
|
|
136
|
+
"optional": true
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"publishConfig": {
|
|
140
|
+
"access": "public"
|
|
141
|
+
},
|
|
142
|
+
"bundler": {
|
|
143
|
+
"exportEntries": [
|
|
144
|
+
"./src/index.ts",
|
|
145
|
+
"./src/vitest-plugin/test-utils.ts",
|
|
146
|
+
"./src/vitest-plugin/setup-file.ts"
|
|
147
|
+
],
|
|
148
|
+
"managerEntries": [
|
|
149
|
+
"./src/manager.tsx"
|
|
150
|
+
],
|
|
151
|
+
"nodeEntries": [
|
|
152
|
+
"./src/preset.ts",
|
|
153
|
+
"./src/postinstall.ts",
|
|
154
|
+
{
|
|
155
|
+
"file": "./src/dummy.ts",
|
|
156
|
+
"formats": [
|
|
157
|
+
"esm"
|
|
158
|
+
]
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"file": "./src/node/vitest.ts",
|
|
162
|
+
"formats": [
|
|
163
|
+
"esm",
|
|
164
|
+
"cjs"
|
|
165
|
+
]
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"file": "./src/node/coverage-reporter.ts",
|
|
169
|
+
"formats": [
|
|
170
|
+
"esm",
|
|
171
|
+
"cjs"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"file": "./src/vitest-plugin/index.ts",
|
|
176
|
+
"formats": [
|
|
177
|
+
"cjs",
|
|
178
|
+
"esm"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"file": "./src/vitest-plugin/global-setup.ts",
|
|
183
|
+
"formats": [
|
|
184
|
+
"cjs",
|
|
185
|
+
"esm"
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"storybook": {
|
|
191
|
+
"displayName": "Test",
|
|
192
|
+
"unsupportedFrameworks": [
|
|
193
|
+
"react-native"
|
|
194
|
+
],
|
|
195
|
+
"icon": "https://user-images.githubusercontent.com/263385/101991666-479cc600-3c7c-11eb-837b-be4e5ffa1bb8.png"
|
|
196
|
+
}
|
|
197
|
+
}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/postinstall');
|
package/postinstall.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/postinstall.mjs';
|
package/preset.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./dist/preset');
|
package/preset.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/preset.mjs';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import { defineConfig } from 'vitest/config';
|
|
5
|
+
|
|
6
|
+
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
7
|
+
|
|
8
|
+
const dirname =
|
|
9
|
+
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
|
|
11
|
+
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
test: {
|
|
14
|
+
workspace: [
|
|
15
|
+
{
|
|
16
|
+
extends: true,
|
|
17
|
+
plugins: [
|
|
18
|
+
// The plugin will run tests for the stories defined in your Storybook config
|
|
19
|
+
// See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
|
|
20
|
+
storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
|
|
21
|
+
],
|
|
22
|
+
test: {
|
|
23
|
+
name: 'storybook',
|
|
24
|
+
browser: BROWSER_CONFIG,
|
|
25
|
+
setupFiles: ['SETUP_FILE'],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import { defineWorkspace } from 'vitest/config';
|
|
5
|
+
|
|
6
|
+
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
|
|
7
|
+
|
|
8
|
+
const dirname =
|
|
9
|
+
typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
|
|
11
|
+
// More info at: https://storybook.js.org/docs/writing-tests/test-addon
|
|
12
|
+
export default defineWorkspace([
|
|
13
|
+
'ROOT_CONFIG',
|
|
14
|
+
{
|
|
15
|
+
extends: 'EXTENDS_WORKSPACE',
|
|
16
|
+
plugins: [
|
|
17
|
+
// The plugin will run tests for the stories defined in your Storybook config
|
|
18
|
+
// See options at: https://storybook.js.org/docs/writing-tests/test-addon#storybooktest
|
|
19
|
+
storybookTest({ configDir: path.join(dirname, 'CONFIG_DIR') }),
|
|
20
|
+
],
|
|
21
|
+
test: {
|
|
22
|
+
name: 'storybook',
|
|
23
|
+
browser: BROWSER_CONFIG,
|
|
24
|
+
setupFiles: ['SETUP_FILE'],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
]);
|