soonjs 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/deps/acorn-tklbyr11e.js +15 -0
- package/dist/deps/angular-m17t0gdsi.js +1 -0
- package/dist/deps/babel-48ei1aig4.js +15 -0
- package/dist/deps/estree-4o5bj9gvd.js +36 -0
- package/dist/deps/flow-xlruu7boa.js +19 -0
- package/dist/deps/glimmer-kyfivr6g7.js +30 -0
- package/dist/deps/graphql-xojtytb2p.js +29 -0
- package/dist/deps/html-jal5w2b1p.js +23 -0
- package/dist/deps/markdown-qhqqns7vp.js +62 -0
- package/dist/deps/meriyah-sl495y757.js +4 -0
- package/dist/deps/postcss-vq400h6ym.js +52 -0
- package/dist/deps/soon-id-gmzr57ufv.js +1 -0
- package/dist/deps/typescript-jihynpl9y.js +20 -0
- package/dist/deps/yaml-auqgv4vnk.js +161 -0
- package/dist/index.d.ts +2 -7
- package/dist/index.js +10 -54574
- package/dist/types.d.ts +1 -1
- package/dist/vite-plugin-soon-client.js +249 -0
- package/dist/vite-plugin-soon-server.js +272 -0
- package/package.json +2 -2
- package/dist/acorn-BeS7roP3.js +0 -2895
- package/dist/angular-B-EYu3Xp.js +0 -1448
- package/dist/babel-NsGQycRb.js +0 -6844
- package/dist/estree-cBJzAinS.js +0 -4265
- package/dist/flow-CH5Saqka.js +0 -26221
- package/dist/glimmer-D1ryh0Nj.js +0 -2756
- package/dist/graphql-DsBI6lrt.js +0 -1212
- package/dist/html-BCw0gm0V.js +0 -2623
- package/dist/markdown-k-AdjTGy.js +0 -3058
- package/dist/meriyah-CghVgtuf.js +0 -2320
- package/dist/one.d.ts +0 -20
- package/dist/postcss-BC57c3E8.js +0 -4664
- package/dist/testtt.d.ts +0 -1
- package/dist/typescript-DtWxbCCh.js +0 -12794
- package/dist/utils.d.ts +0 -6
- package/dist/yaml-CFlm97O-.js +0 -4088
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import Lt,{existsSync as Hn,rmSync as Mn}from"fs";import k from"path";import{c as In,g as Nn,u as Fn}from"./deps/soon-id-gmzr57ufv.js";import Dt from"os";import jr from"util";import Ke from"stream";import Bn from"events";var V={},F={},Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.splitWhen=Se.flatten=void 0;function jn(t){return t.reduce((e,r)=>[].concat(e,r),[])}Se.flatten=jn;function Gn(t,e){const r=[[]];let n=0;for(const s of t)e(s)?(n++,r[n]=[]):r[n].push(s);return r}Se.splitWhen=Gn;var qe={};Object.defineProperty(qe,"__esModule",{value:!0});qe.isEnoentCodeError=void 0;function Un(t){return t.code==="ENOENT"}qe.isEnoentCodeError=Un;var Qe={};Object.defineProperty(Qe,"__esModule",{value:!0});Qe.createDirentFromStats=void 0;let Wn=class{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}};function Vn(t,e){return new Wn(t,e)}Qe.createDirentFromStats=Vn;var G={};Object.defineProperty(G,"__esModule",{value:!0});G.convertPosixPathToPattern=G.convertWindowsPathToPattern=G.convertPathToPattern=G.escapePosixPath=G.escapeWindowsPath=G.escape=G.removeLeadingDotSegment=G.makeAbsolute=G.unixify=void 0;const Kn=Dt,qn=k,Gr=Kn.platform()==="win32",Qn=2,Yn=/(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g,Xn=/(\\?)([()[\]{}]|^!|[!+@](?=\())/g,Zn=/^\\\\([.?])/,zn=/\\(?![!()+@[\]{}])/g;function Jn(t){return t.replace(/\\/g,"/")}G.unixify=Jn;function es(t,e){return qn.resolve(t,e)}G.makeAbsolute=es;function ts(t){if(t.charAt(0)==="."){const e=t.charAt(1);if(e==="/"||e==="\\")return t.slice(Qn)}return t}G.removeLeadingDotSegment=ts;G.escape=Gr?Ht:Mt;function Ht(t){return t.replace(Xn,"\\$2")}G.escapeWindowsPath=Ht;function Mt(t){return t.replace(Yn,"\\$2")}G.escapePosixPath=Mt;G.convertPathToPattern=Gr?Ur:Wr;function Ur(t){return Ht(t).replace(Zn,"//$1").replace(zn,"/")}G.convertWindowsPathToPattern=Ur;function Wr(t){return Mt(t)}G.convertPosixPathToPattern=Wr;var E={};/*!
|
|
2
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/var rs=function(e){if(typeof e!="string"||e==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return!0;e=e.slice(r.index+r[0].length)}return!1};/*!
|
|
7
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
10
|
+
* Released under the MIT License.
|
|
11
|
+
*/var ns=rs,Vr={"{":"}","(":")","[":"]"},ss=function(t){if(t[0]==="!")return!0;for(var e=0,r=-2,n=-2,s=-2,a=-2,i=-2;e<t.length;){if(t[e]==="*"||t[e+1]==="?"&&/[\].+)]/.test(t[e])||n!==-1&&t[e]==="["&&t[e+1]!=="]"&&(n<e&&(n=t.indexOf("]",e)),n>e&&(i===-1||i>n||(i=t.indexOf("\\",e),i===-1||i>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(i=t.indexOf("\\",e),i===-1||i>s))||a!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(a=t.indexOf(")",e),a>e&&(i=t.indexOf("\\",e),i===-1||i>a))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(r<e&&(r=t.indexOf("|",e)),r!==-1&&t[r+1]!==")"&&(a=t.indexOf(")",r),a>r&&(i=t.indexOf("\\",r),i===-1||i>a))))return!0;if(t[e]==="\\"){var o=t[e+1];e+=2;var u=Vr[o];if(u){var h=t.indexOf(u,e);h!==-1&&(e=h+1)}if(t[e]==="!")return!0}else e++}return!1},is=function(t){if(t[0]==="!")return!0;for(var e=0;e<t.length;){if(/[*?{}()[\]]/.test(t[e]))return!0;if(t[e]==="\\"){var r=t[e+1];e+=2;var n=Vr[r];if(n){var s=t.indexOf(n,e);s!==-1&&(e=s+1)}if(t[e]==="!")return!0}else e++}return!1},as=function(e,r){if(typeof e!="string"||e==="")return!1;if(ns(e))return!0;var n=ss;return r&&r.strict===!1&&(n=is),n(e)},os=as,us=k.posix.dirname,cs=Dt.platform()==="win32",ot="/",ls=/\\/g,fs=/[\{\[].*[\}\]]$/,ps=/(^|[^\\])([\{\[]|\([^\)]+$)/,hs=/\\([\!\*\?\|\[\]\(\)\{\}])/g,ds=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&cs&&e.indexOf(ot)<0&&(e=e.replace(ls,ot)),fs.test(e)&&(e+=ot),e+="a";do e=us(e);while(os(e)||ps.test(e));return e.replace(hs,"$1")},Ye={};(function(t){t.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1,t.find=(e,r)=>e.nodes.find(n=>n.type===r),t.exceedsLimit=(e,r,n=1,s)=>s===!1||!t.isInteger(e)||!t.isInteger(r)?!1:(Number(r)-Number(e))/Number(n)>=s,t.escapeNode=(e,r=0,n)=>{const s=e.nodes[r];s&&(n&&s.type===n||s.type==="open"||s.type==="close")&&s.escaped!==!0&&(s.value="\\"+s.value,s.escaped=!0)},t.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0),t.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1,t.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0,t.reduce=e=>e.reduce((r,n)=>(n.type==="text"&&r.push(n.value),n.type==="range"&&(n.type="text"),r),[]),t.flatten=(...e)=>{const r=[],n=s=>{for(let a=0;a<s.length;a++){const i=s[a];if(Array.isArray(i)){n(i);continue}i!==void 0&&r.push(i)}return r};return n(e),r}})(Ye);const lr=Ye;var It=(t,e={})=>{const r=(n,s={})=>{const a=e.escapeInvalid&&lr.isInvalidBrace(s),i=n.invalid===!0&&e.escapeInvalid===!0;let o="";if(n.value)return(a||i)&&lr.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(const u of n.nodes)o+=r(u);return o};return r(t)};/*!
|
|
12
|
+
* is-number <https://github.com/jonschlinkert/is-number>
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
15
|
+
* Released under the MIT License.
|
|
16
|
+
*/var _s=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};/*!
|
|
17
|
+
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
|
18
|
+
*
|
|
19
|
+
* Copyright (c) 2015-present, Jon Schlinkert.
|
|
20
|
+
* Released under the MIT License.
|
|
21
|
+
*/const fr=_s,ye=(t,e,r)=>{if(fr(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(fr(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),a=String(n.shorthand),i=String(n.capture),o=String(n.wrap),u=t+":"+e+"="+s+a+i+o;if(ye.cache.hasOwnProperty(u))return ye.cache[u].result;let h=Math.min(t,e),c=Math.max(t,e);if(Math.abs(h-c)===1){let m=t+"|"+e;return n.capture?`(${m})`:n.wrap===!1?m:`(?:${m})`}let _=yr(t)||yr(e),f={min:t,max:e,a:h,b:c},$=[],g=[];if(_&&(f.isPadded=_,f.maxLen=String(f.max).length),h<0){let m=c<0?Math.abs(c):1;g=pr(m,Math.abs(h),f,n),h=f.a=0}return c>=0&&($=pr(h,c,f,n)),f.negatives=g,f.positives=$,f.result=gs(g,$),n.capture===!0?f.result=`(${f.result})`:n.wrap!==!1&&$.length+g.length>1&&(f.result=`(?:${f.result})`),ye.cache[u]=f,f.result};function gs(t,e,r){let n=ut(t,e,"-",!1)||[],s=ut(e,t,"",!1)||[],a=ut(t,e,"-?",!0)||[];return n.concat(a).concat(s).join("|")}function ys(t,e){let r=1,n=1,s=dr(t,r),a=new Set([e]);for(;t<=s&&s<=e;)a.add(s),r+=1,s=dr(t,r);for(s=_r(e+1,n)-1;t<s&&s<=e;)a.add(s),n+=1,s=_r(e+1,n)-1;return a=[...a],a.sort(Ss),a}function ms(t,e,r){if(t===e)return{pattern:t,count:[],digits:0};let n=vs(t,e),s=n.length,a="",i=0;for(let o=0;o<s;o++){let[u,h]=n[o];u===h?a+=u:u!=="0"||h!=="9"?a+=As(u,h):i++}return i&&(a+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:a,count:[i],digits:s}}function pr(t,e,r,n){let s=ys(t,e),a=[],i=t,o;for(let u=0;u<s.length;u++){let h=s[u],c=ms(String(i),String(h),n),_="";if(!r.isPadded&&o&&o.pattern===c.pattern){o.count.length>1&&o.count.pop(),o.count.push(c.count[0]),o.string=o.pattern+gr(o.count),i=h+1;continue}r.isPadded&&(_=Es(h,r,n)),c.string=_+c.pattern+gr(c.count),a.push(c),i=h+1,o=c}return a}function ut(t,e,r,n,s){let a=[];for(let i of t){let{string:o}=i;!n&&!hr(e,"string",o)&&a.push(r+o),n&&hr(e,"string",o)&&a.push(r+o)}return a}function vs(t,e){let r=[];for(let n=0;n<t.length;n++)r.push([t[n],e[n]]);return r}function Ss(t,e){return t>e?1:e>t?-1:0}function hr(t,e,r){return t.some(n=>n[e]===r)}function dr(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function _r(t,e){return t-t%Math.pow(10,e)}function gr(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function As(t,e,r){return`[${t}${e-t===1?"":"-"}${e}]`}function yr(t){return/^-?(0+)\d/.test(t)}function Es(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}ye.cache={};ye.clearCache=()=>ye.cache={};var Rs=ye;/*!
|
|
22
|
+
* fill-range <https://github.com/jonschlinkert/fill-range>
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
25
|
+
* Licensed under the MIT License.
|
|
26
|
+
*/const $s=jr,Kr=Rs,mr=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),Ps=t=>e=>t===!0?Number(e):String(e),ct=t=>typeof t=="number"||typeof t=="string"&&t!=="",$e=t=>Number.isInteger(+t),lt=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++r]==="0";);return r>0},bs=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,Cs=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0")}return r===!1?String(t):t},Be=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length<e;)t="0"+t;return r?"-"+t:t},xs=(t,e,r)=>{t.negatives.sort((o,u)=>o<u?-1:o>u?1:0),t.positives.sort((o,u)=>o<u?-1:o>u?1:0);let n=e.capture?"":"?:",s="",a="",i;return t.positives.length&&(s=t.positives.map(o=>Be(String(o),r)).join("|")),t.negatives.length&&(a=`-(${n}${t.negatives.map(o=>Be(String(o),r)).join("|")})`),s&&a?i=`${s}|${a}`:i=s||a,e.wrap?`(${n}${i})`:i},qr=(t,e,r,n)=>{if(r)return Kr(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let a=String.fromCharCode(e);return`[${s}-${a}]`},Qr=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return Kr(t,e,r)},Yr=(...t)=>new RangeError("Invalid range arguments: "+$s.inspect(...t)),Xr=(t,e,r)=>{if(r.strictRanges===!0)throw Yr([t,e]);return[]},Ts=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return[]},ws=(t,e,r=1,n={})=>{let s=Number(t),a=Number(e);if(!Number.isInteger(s)||!Number.isInteger(a)){if(n.strictRanges===!0)throw Yr([t,e]);return[]}s===0&&(s=0),a===0&&(a=0);let i=s>a,o=String(t),u=String(e),h=String(r);r=Math.max(Math.abs(r),1);let c=lt(o)||lt(u)||lt(h),_=c?Math.max(o.length,u.length,h.length):0,f=c===!1&&bs(t,e,n)===!1,$=n.transform||Ps(f);if(n.toRegex&&r===1)return qr(Be(t,_),Be(e,_),!0,n);let g={negatives:[],positives:[]},m=B=>g[B<0?"negatives":"positives"].push(Math.abs(B)),P=[],A=0;for(;i?s>=a:s<=a;)n.toRegex===!0&&r>1?m(s):P.push(Cs($(s,A),_,f)),s=i?s-r:s+r,A++;return n.toRegex===!0?r>1?xs(g,n,_):Qr(P,null,{wrap:!1,...n}):P},Os=(t,e,r=1,n={})=>{if(!$e(t)&&t.length>1||!$e(e)&&e.length>1)return Xr(t,e,n);let s=n.transform||(f=>String.fromCharCode(f)),a=`${t}`.charCodeAt(0),i=`${e}`.charCodeAt(0),o=a>i,u=Math.min(a,i),h=Math.max(a,i);if(n.toRegex&&r===1)return qr(u,h,!1,n);let c=[],_=0;for(;o?a>=i:a<=i;)c.push(s(a,_)),a=o?a-r:a+r,_++;return n.toRegex===!0?Qr(c,null,{wrap:!1,options:n}):c},Ne=(t,e,r,n={})=>{if(e==null&&ct(t))return[t];if(!ct(t)||!ct(e))return Xr(t,e,n);if(typeof r=="function")return Ne(t,e,1,{transform:r});if(mr(r))return Ne(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,$e(r)?$e(t)&&$e(e)?ws(t,e,r,s):Os(t,e,Math.max(Math.abs(r),1),s):r!=null&&!mr(r)?Ts(r,s):Ne(t,e,1,r)};var Zr=Ne;const ks=Zr,vr=Ye,Ls=(t,e={})=>{const r=(n,s={})=>{const a=vr.isInvalidBrace(s),i=n.invalid===!0&&e.escapeInvalid===!0,o=a===!0||i===!0,u=e.escapeInvalid===!0?"\\":"";let h="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return o?u+n.value:"(";if(n.type==="close")return o?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":o?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){const c=vr.reduce(n.nodes),_=ks(...c,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(_.length!==0)return c.length>1&&_.length>1?`(${_})`:_}if(n.nodes)for(const c of n.nodes)h+=r(c,n);return h};return r(t)};var Ds=Ls;const Hs=Zr,Sr=It,ve=Ye,ge=(t="",e="",r=!1)=>{const n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?ve.flatten(e).map(s=>`{${s}}`):e;for(const s of t)if(Array.isArray(s))for(const a of s)n.push(ge(a,e,r));else for(let a of e)r===!0&&typeof a=="string"&&(a=`{${a}}`),n.push(Array.isArray(a)?ge(s,a,r):s+a);return ve.flatten(n)},Ms=(t,e={})=>{const r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,a={})=>{s.queue=[];let i=a,o=a.queue;for(;i.type!=="brace"&&i.type!=="root"&&i.parent;)i=i.parent,o=i.queue;if(s.invalid||s.dollar){o.push(ge(o.pop(),Sr(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){o.push(ge(o.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){const _=ve.reduce(s.nodes);if(ve.exceedsLimit(..._,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let f=Hs(..._,e);f.length===0&&(f=Sr(s,e)),o.push(ge(o.pop(),f)),s.nodes=[];return}const u=ve.encloseBrace(s);let h=s.queue,c=s;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,h=c.queue;for(let _=0;_<s.nodes.length;_++){const f=s.nodes[_];if(f.type==="comma"&&s.type==="brace"){_===1&&h.push(""),h.push("");continue}if(f.type==="close"){o.push(ge(o.pop(),h,u));continue}if(f.value&&f.type!=="open"){h.push(ge(h.pop(),f.value));continue}f.nodes&&n(f,s)}return h};return ve.flatten(n(t))};var Is=Ms,Ns={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
27
|
+
`,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const Fs=It,{MAX_LENGTH:Ar,CHAR_BACKSLASH:ft,CHAR_BACKTICK:Bs,CHAR_COMMA:js,CHAR_DOT:Gs,CHAR_LEFT_PARENTHESES:Us,CHAR_RIGHT_PARENTHESES:Ws,CHAR_LEFT_CURLY_BRACE:Vs,CHAR_RIGHT_CURLY_BRACE:Ks,CHAR_LEFT_SQUARE_BRACKET:Er,CHAR_RIGHT_SQUARE_BRACKET:Rr,CHAR_DOUBLE_QUOTE:qs,CHAR_SINGLE_QUOTE:Qs,CHAR_NO_BREAK_SPACE:Ys,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Xs}=Ns,Zs=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");const r=e||{},n=typeof r.maxLength=="number"?Math.min(Ar,r.maxLength):Ar;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);const s={type:"root",input:t,nodes:[]},a=[s];let i=s,o=s,u=0;const h=t.length;let c=0,_=0,f;const $=()=>t[c++],g=m=>{if(m.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&m.type==="text"){o.value+=m.value;return}return i.nodes.push(m),m.parent=i,m.prev=o,o=m,m};for(g({type:"bos"});c<h;)if(i=a[a.length-1],f=$(),!(f===Xs||f===Ys)){if(f===ft){g({type:"text",value:(e.keepEscaping?f:"")+$()});continue}if(f===Rr){g({type:"text",value:"\\"+f});continue}if(f===Er){u++;let m;for(;c<h&&(m=$());){if(f+=m,m===Er){u++;continue}if(m===ft){f+=$();continue}if(m===Rr&&(u--,u===0))break}g({type:"text",value:f});continue}if(f===Us){i=g({type:"paren",nodes:[]}),a.push(i),g({type:"text",value:f});continue}if(f===Ws){if(i.type!=="paren"){g({type:"text",value:f});continue}i=a.pop(),g({type:"text",value:f}),i=a[a.length-1];continue}if(f===qs||f===Qs||f===Bs){const m=f;let P;for(e.keepQuotes!==!0&&(f="");c<h&&(P=$());){if(P===ft){f+=P+$();continue}if(P===m){e.keepQuotes===!0&&(f+=P);break}f+=P}g({type:"text",value:f});continue}if(f===Vs){_++;const P={type:"brace",open:!0,close:!1,dollar:o.value&&o.value.slice(-1)==="$"||i.dollar===!0,depth:_,commas:0,ranges:0,nodes:[]};i=g(P),a.push(i),g({type:"open",value:f});continue}if(f===Ks){if(i.type!=="brace"){g({type:"text",value:f});continue}const m="close";i=a.pop(),i.close=!0,g({type:m,value:f}),_--,i=a[a.length-1];continue}if(f===js&&_>0){if(i.ranges>0){i.ranges=0;const m=i.nodes.shift();i.nodes=[m,{type:"text",value:Fs(i)}]}g({type:"comma",value:f}),i.commas++;continue}if(f===Gs&&_>0&&i.commas===0){const m=i.nodes;if(_===0||m.length===0){g({type:"text",value:f});continue}if(o.type==="dot"){if(i.range=[],o.value+=f,o.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,o.type="text";continue}i.ranges++,i.args=[];continue}if(o.type==="range"){m.pop();const P=m[m.length-1];P.value+=o.value+f,o=P,i.ranges--;continue}g({type:"dot",value:f});continue}g({type:"text",value:f})}do if(i=a.pop(),i.type!=="root"){i.nodes.forEach(A=>{A.nodes||(A.type==="open"&&(A.isOpen=!0),A.type==="close"&&(A.isClose=!0),A.nodes||(A.type="text"),A.invalid=!0)});const m=a[a.length-1],P=m.nodes.indexOf(i);m.nodes.splice(P,1,...i.nodes)}while(a.length>0);return g({type:"eos"}),s};var zs=Zs;const $r=It,Js=Ds,ei=Is,ti=zs,X=(t,e={})=>{let r=[];if(Array.isArray(t))for(const n of t){const s=X.create(n,e);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(X.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};X.parse=(t,e={})=>ti(t,e);X.stringify=(t,e={})=>$r(typeof t=="string"?X.parse(t,e):t,e);X.compile=(t,e={})=>(typeof t=="string"&&(t=X.parse(t,e)),Js(t,e));X.expand=(t,e={})=>{typeof t=="string"&&(t=X.parse(t,e));let r=ei(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};X.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?X.compile(t,e):X.expand(t,e);var ri=X,Pe={};const ni=k,oe="\\\\/",Pr=`[^${oe}]`,le="\\.",si="\\+",ii="\\?",Xe="\\/",ai="(?=.)",zr="[^/]",Nt=`(?:${Xe}|$)`,Jr=`(?:^|${Xe})`,Ft=`${le}{1,2}${Nt}`,oi=`(?!${le})`,ui=`(?!${Jr}${Ft})`,ci=`(?!${le}{0,1}${Nt})`,li=`(?!${Ft})`,fi=`[^.${Xe}]`,pi=`${zr}*?`,en={DOT_LITERAL:le,PLUS_LITERAL:si,QMARK_LITERAL:ii,SLASH_LITERAL:Xe,ONE_CHAR:ai,QMARK:zr,END_ANCHOR:Nt,DOTS_SLASH:Ft,NO_DOT:oi,NO_DOTS:ui,NO_DOT_SLASH:ci,NO_DOTS_SLASH:li,QMARK_NO_DOT:fi,STAR:pi,START_ANCHOR:Jr},hi={...en,SLASH_LITERAL:`[${oe}]`,QMARK:Pr,STAR:`${Pr}*?`,DOTS_SLASH:`${le}{1,2}(?:[${oe}]|$)`,NO_DOT:`(?!${le})`,NO_DOTS:`(?!(?:^|[${oe}])${le}{1,2}(?:[${oe}]|$))`,NO_DOT_SLASH:`(?!${le}{0,1}(?:[${oe}]|$))`,NO_DOTS_SLASH:`(?!${le}{1,2}(?:[${oe}]|$))`,QMARK_NO_DOT:`[^.${oe}]`,START_ANCHOR:`(?:^|[${oe}])`,END_ANCHOR:`(?:[${oe}]|$)`},di={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"};var Ze={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:di,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,SEP:ni.sep,extglobChars(t){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?hi:en}};(function(t){const e=k,r=process.platform==="win32",{REGEX_BACKSLASH:n,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:i}=Ze;t.isObject=o=>o!==null&&typeof o=="object"&&!Array.isArray(o),t.hasRegexChars=o=>a.test(o),t.isRegexChar=o=>o.length===1&&t.hasRegexChars(o),t.escapeRegex=o=>o.replace(i,"\\$1"),t.toPosixSlashes=o=>o.replace(n,"/"),t.removeBackslashes=o=>o.replace(s,u=>u==="\\"?"":u),t.supportsLookbehinds=()=>{const o=process.version.slice(1).split(".").map(Number);return o.length===3&&o[0]>=9||o[0]===8&&o[1]>=10},t.isWindows=o=>o&&typeof o.windows=="boolean"?o.windows:r===!0||e.sep==="\\",t.escapeLast=(o,u,h)=>{const c=o.lastIndexOf(u,h);return c===-1?o:o[c-1]==="\\"?t.escapeLast(o,u,c-1):`${o.slice(0,c)}\\${o.slice(c)}`},t.removePrefix=(o,u={})=>{let h=o;return h.startsWith("./")&&(h=h.slice(2),u.prefix="./"),h},t.wrapOutput=(o,u={},h={})=>{const c=h.contains?"":"^",_=h.contains?"":"$";let f=`${c}(?:${o})${_}`;return u.negated===!0&&(f=`(?:^(?!${f}).*$)`),f}})(Pe);const br=Pe,{CHAR_ASTERISK:pt,CHAR_AT:_i,CHAR_BACKWARD_SLASH:Re,CHAR_COMMA:gi,CHAR_DOT:ht,CHAR_EXCLAMATION_MARK:dt,CHAR_FORWARD_SLASH:tn,CHAR_LEFT_CURLY_BRACE:_t,CHAR_LEFT_PARENTHESES:gt,CHAR_LEFT_SQUARE_BRACKET:yi,CHAR_PLUS:mi,CHAR_QUESTION_MARK:Cr,CHAR_RIGHT_CURLY_BRACE:vi,CHAR_RIGHT_PARENTHESES:xr,CHAR_RIGHT_SQUARE_BRACKET:Si}=Ze,Tr=t=>t===tn||t===Re,wr=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1)},Ai=(t,e)=>{const r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,a=[],i=[],o=[];let u=t,h=-1,c=0,_=0,f=!1,$=!1,g=!1,m=!1,P=!1,A=!1,B=!1,v=!1,z=!1,x=!1,H=0,b,R,O={value:"",depth:0,isGlob:!1};const W=()=>h>=n,d=()=>u.charCodeAt(h+1),M=()=>(b=R,u.charCodeAt(++h));for(;h<n;){R=M();let K;if(R===Re){B=O.backslashes=!0,R=M(),R===_t&&(A=!0);continue}if(A===!0||R===_t){for(H++;W()!==!0&&(R=M());){if(R===Re){B=O.backslashes=!0,M();continue}if(R===_t){H++;continue}if(A!==!0&&R===ht&&(R=M())===ht){if(f=O.isBrace=!0,g=O.isGlob=!0,x=!0,s===!0)continue;break}if(A!==!0&&R===gi){if(f=O.isBrace=!0,g=O.isGlob=!0,x=!0,s===!0)continue;break}if(R===vi&&(H--,H===0)){A=!1,f=O.isBrace=!0,x=!0;break}}if(s===!0)continue;break}if(R===tn){if(a.push(h),i.push(O),O={value:"",depth:0,isGlob:!1},x===!0)continue;if(b===ht&&h===c+1){c+=2;continue}_=h+1;continue}if(r.noext!==!0&&(R===mi||R===_i||R===pt||R===Cr||R===dt)===!0&&d()===gt){if(g=O.isGlob=!0,m=O.isExtglob=!0,x=!0,R===dt&&h===c&&(z=!0),s===!0){for(;W()!==!0&&(R=M());){if(R===Re){B=O.backslashes=!0,R=M();continue}if(R===xr){g=O.isGlob=!0,x=!0;break}}continue}break}if(R===pt){if(b===pt&&(P=O.isGlobstar=!0),g=O.isGlob=!0,x=!0,s===!0)continue;break}if(R===Cr){if(g=O.isGlob=!0,x=!0,s===!0)continue;break}if(R===yi){for(;W()!==!0&&(K=M());){if(K===Re){B=O.backslashes=!0,M();continue}if(K===Si){$=O.isBracket=!0,g=O.isGlob=!0,x=!0;break}}if(s===!0)continue;break}if(r.nonegate!==!0&&R===dt&&h===c){v=O.negated=!0,c++;continue}if(r.noparen!==!0&&R===gt){if(g=O.isGlob=!0,s===!0){for(;W()!==!0&&(R=M());){if(R===gt){B=O.backslashes=!0,R=M();continue}if(R===xr){x=!0;break}}continue}break}if(g===!0){if(x=!0,s===!0)continue;break}}r.noext===!0&&(m=!1,g=!1);let L=u,fe="",l="";c>0&&(fe=u.slice(0,c),u=u.slice(c),_-=c),L&&g===!0&&_>0?(L=u.slice(0,_),l=u.slice(_)):g===!0?(L="",l=u):L=u,L&&L!==""&&L!=="/"&&L!==u&&Tr(L.charCodeAt(L.length-1))&&(L=L.slice(0,-1)),r.unescape===!0&&(l&&(l=br.removeBackslashes(l)),L&&B===!0&&(L=br.removeBackslashes(L)));const p={prefix:fe,input:t,start:c,base:L,glob:l,isBrace:f,isBracket:$,isGlob:g,isExtglob:m,isGlobstar:P,negated:v,negatedExtglob:z};if(r.tokens===!0&&(p.maxDepth=0,Tr(R)||i.push(O),p.tokens=i),r.parts===!0||r.tokens===!0){let K;for(let w=0;w<a.length;w++){const ie=K?K+1:c,ae=a[w],Q=t.slice(ie,ae);r.tokens&&(w===0&&c!==0?(i[w].isPrefix=!0,i[w].value=fe):i[w].value=Q,wr(i[w]),p.maxDepth+=i[w].depth),(w!==0||Q!=="")&&o.push(Q),K=ae}if(K&&K+1<t.length){const w=t.slice(K+1);o.push(w),r.tokens&&(i[i.length-1].value=w,wr(i[i.length-1]),p.maxDepth+=i[i.length-1].depth)}p.slashes=a,p.parts=o}return p};var Ei=Ai;const je=Ze,Y=Pe,{MAX_LENGTH:Ge,POSIX_REGEX_SOURCE:Ri,REGEX_NON_SPECIAL_CHARS:$i,REGEX_SPECIAL_CHARS_BACKREF:Pi,REPLACEMENTS:rn}=je,bi=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();const r=`[${t.join("-")}]`;try{new RegExp(r)}catch{return t.map(s=>Y.escapeRegex(s)).join("..")}return r},me=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Bt=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=rn[t]||t;const r={...e},n=typeof r.maxLength=="number"?Math.min(Ge,r.maxLength):Ge;let s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);const a={type:"bos",value:"",output:r.prepend||""},i=[a],o=r.capture?"":"?:",u=Y.isWindows(e),h=je.globChars(u),c=je.extglobChars(h),{DOT_LITERAL:_,PLUS_LITERAL:f,SLASH_LITERAL:$,ONE_CHAR:g,DOTS_SLASH:m,NO_DOT:P,NO_DOT_SLASH:A,NO_DOTS_SLASH:B,QMARK:v,QMARK_NO_DOT:z,STAR:x,START_ANCHOR:H}=h,b=S=>`(${o}(?:(?!${H}${S.dot?m:_}).)*?)`,R=r.dot?"":P,O=r.dot?v:z;let W=r.bash===!0?b(r):x;r.capture&&(W=`(${W})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);const d={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:i};t=Y.removePrefix(t,d),s=t.length;const M=[],L=[],fe=[];let l=a,p;const K=()=>d.index===s-1,w=d.peek=(S=1)=>t[d.index+S],ie=d.advance=()=>t[++d.index]||"",ae=()=>t.slice(d.index+1),Q=(S="",D=0)=>{d.consumed+=S,d.index+=D},Oe=S=>{d.output+=S.output!=null?S.output:S.value,Q(S.value)},Ln=()=>{let S=1;for(;w()==="!"&&(w(2)!=="("||w(3)==="?");)ie(),d.start++,S++;return S%2===0?!1:(d.negated=!0,d.start++,!0)},ke=S=>{d[S]++,fe.push(S)},de=S=>{d[S]--,fe.pop()},T=S=>{if(l.type==="globstar"){const D=d.braces>0&&(S.type==="comma"||S.type==="brace"),y=S.extglob===!0||M.length&&(S.type==="pipe"||S.type==="paren");S.type!=="slash"&&S.type!=="paren"&&!D&&!y&&(d.output=d.output.slice(0,-l.output.length),l.type="star",l.value="*",l.output=W,d.output+=l.output)}if(M.length&&S.type!=="paren"&&(M[M.length-1].inner+=S.value),(S.value||S.output)&&Oe(S),l&&l.type==="text"&&S.type==="text"){l.value+=S.value,l.output=(l.output||"")+S.value;return}S.prev=l,i.push(S),l=S},Le=(S,D)=>{const y={...c[D],conditions:1,inner:""};y.prev=l,y.parens=d.parens,y.output=d.output;const C=(r.capture?"(":"")+y.open;ke("parens"),T({type:S,value:D,output:d.output?"":g}),T({type:"paren",extglob:!0,value:ie(),output:C}),M.push(y)},Dn=S=>{let D=S.close+(r.capture?")":""),y;if(S.type==="negate"){let C=W;if(S.inner&&S.inner.length>1&&S.inner.includes("/")&&(C=b(r)),(C!==W||K()||/^\)+$/.test(ae()))&&(D=S.close=`)$))${C}`),S.inner.includes("*")&&(y=ae())&&/^\.[^\\/.]+$/.test(y)){const N=Bt(y,{...e,fastpaths:!1}).output;D=S.close=`)${N})${C})`}S.prev.type==="bos"&&(d.negatedExtglob=!0)}T({type:"paren",extglob:!0,value:p,output:D}),de("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let S=!1,D=t.replace(Pi,(y,C,N,q,U,at)=>q==="\\"?(S=!0,y):q==="?"?C?C+q+(U?v.repeat(U.length):""):at===0?O+(U?v.repeat(U.length):""):v.repeat(N.length):q==="."?_.repeat(N.length):q==="*"?C?C+q+(U?W:""):W:C?y:`\\${y}`);return S===!0&&(r.unescape===!0?D=D.replace(/\\/g,""):D=D.replace(/\\+/g,y=>y.length%2===0?"\\\\":y?"\\":"")),D===t&&r.contains===!0?(d.output=t,d):(d.output=Y.wrapOutput(D,d,e),d)}for(;!K();){if(p=ie(),p==="\0")continue;if(p==="\\"){const y=w();if(y==="/"&&r.bash!==!0||y==="."||y===";")continue;if(!y){p+="\\",T({type:"text",value:p});continue}const C=/^\\+/.exec(ae());let N=0;if(C&&C[0].length>2&&(N=C[0].length,d.index+=N,N%2!==0&&(p+="\\")),r.unescape===!0?p=ie():p+=ie(),d.brackets===0){T({type:"text",value:p});continue}}if(d.brackets>0&&(p!=="]"||l.value==="["||l.value==="[^")){if(r.posix!==!1&&p===":"){const y=l.value.slice(1);if(y.includes("[")&&(l.posix=!0,y.includes(":"))){const C=l.value.lastIndexOf("["),N=l.value.slice(0,C),q=l.value.slice(C+2),U=Ri[q];if(U){l.value=N+U,d.backtrack=!0,ie(),!a.output&&i.indexOf(l)===1&&(a.output=g);continue}}}(p==="["&&w()!==":"||p==="-"&&w()==="]")&&(p=`\\${p}`),p==="]"&&(l.value==="["||l.value==="[^")&&(p=`\\${p}`),r.posix===!0&&p==="!"&&l.value==="["&&(p="^"),l.value+=p,Oe({value:p});continue}if(d.quotes===1&&p!=='"'){p=Y.escapeRegex(p),l.value+=p,Oe({value:p});continue}if(p==='"'){d.quotes=d.quotes===1?0:1,r.keepQuotes===!0&&T({type:"text",value:p});continue}if(p==="("){ke("parens"),T({type:"paren",value:p});continue}if(p===")"){if(d.parens===0&&r.strictBrackets===!0)throw new SyntaxError(me("opening","("));const y=M[M.length-1];if(y&&d.parens===y.parens+1){Dn(M.pop());continue}T({type:"paren",value:p,output:d.parens?")":"\\)"}),de("parens");continue}if(p==="["){if(r.nobracket===!0||!ae().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(me("closing","]"));p=`\\${p}`}else ke("brackets");T({type:"bracket",value:p});continue}if(p==="]"){if(r.nobracket===!0||l&&l.type==="bracket"&&l.value.length===1){T({type:"text",value:p,output:`\\${p}`});continue}if(d.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(me("opening","["));T({type:"text",value:p,output:`\\${p}`});continue}de("brackets");const y=l.value.slice(1);if(l.posix!==!0&&y[0]==="^"&&!y.includes("/")&&(p=`/${p}`),l.value+=p,Oe({value:p}),r.literalBrackets===!1||Y.hasRegexChars(y))continue;const C=Y.escapeRegex(l.value);if(d.output=d.output.slice(0,-l.value.length),r.literalBrackets===!0){d.output+=C,l.value=C;continue}l.value=`(${o}${C}|${l.value})`,d.output+=l.value;continue}if(p==="{"&&r.nobrace!==!0){ke("braces");const y={type:"brace",value:p,output:"(",outputIndex:d.output.length,tokensIndex:d.tokens.length};L.push(y),T(y);continue}if(p==="}"){const y=L[L.length-1];if(r.nobrace===!0||!y){T({type:"text",value:p,output:p});continue}let C=")";if(y.dots===!0){const N=i.slice(),q=[];for(let U=N.length-1;U>=0&&(i.pop(),N[U].type!=="brace");U--)N[U].type!=="dots"&&q.unshift(N[U].value);C=bi(q,r),d.backtrack=!0}if(y.comma!==!0&&y.dots!==!0){const N=d.output.slice(0,y.outputIndex),q=d.tokens.slice(y.tokensIndex);y.value=y.output="\\{",p=C="\\}",d.output=N;for(const U of q)d.output+=U.output||U.value}T({type:"brace",value:p,output:C}),de("braces"),L.pop();continue}if(p==="|"){M.length>0&&M[M.length-1].conditions++,T({type:"text",value:p});continue}if(p===","){let y=p;const C=L[L.length-1];C&&fe[fe.length-1]==="braces"&&(C.comma=!0,y="|"),T({type:"comma",value:p,output:y});continue}if(p==="/"){if(l.type==="dot"&&d.index===d.start+1){d.start=d.index+1,d.consumed="",d.output="",i.pop(),l=a;continue}T({type:"slash",value:p,output:$});continue}if(p==="."){if(d.braces>0&&l.type==="dot"){l.value==="."&&(l.output=_);const y=L[L.length-1];l.type="dots",l.output+=p,l.value+=p,y.dots=!0;continue}if(d.braces+d.parens===0&&l.type!=="bos"&&l.type!=="slash"){T({type:"text",value:p,output:_});continue}T({type:"dot",value:p,output:_});continue}if(p==="?"){if(!(l&&l.value==="(")&&r.noextglob!==!0&&w()==="("&&w(2)!=="?"){Le("qmark",p);continue}if(l&&l.type==="paren"){const C=w();let N=p;if(C==="<"&&!Y.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(l.value==="("&&!/[!=<:]/.test(C)||C==="<"&&!/<([!=]|\w+>)/.test(ae()))&&(N=`\\${p}`),T({type:"text",value:p,output:N});continue}if(r.dot!==!0&&(l.type==="slash"||l.type==="bos")){T({type:"qmark",value:p,output:z});continue}T({type:"qmark",value:p,output:v});continue}if(p==="!"){if(r.noextglob!==!0&&w()==="("&&(w(2)!=="?"||!/[!=<:]/.test(w(3)))){Le("negate",p);continue}if(r.nonegate!==!0&&d.index===0){Ln();continue}}if(p==="+"){if(r.noextglob!==!0&&w()==="("&&w(2)!=="?"){Le("plus",p);continue}if(l&&l.value==="("||r.regex===!1){T({type:"plus",value:p,output:f});continue}if(l&&(l.type==="bracket"||l.type==="paren"||l.type==="brace")||d.parens>0){T({type:"plus",value:p});continue}T({type:"plus",value:f});continue}if(p==="@"){if(r.noextglob!==!0&&w()==="("&&w(2)!=="?"){T({type:"at",extglob:!0,value:p,output:""});continue}T({type:"text",value:p});continue}if(p!=="*"){(p==="$"||p==="^")&&(p=`\\${p}`);const y=$i.exec(ae());y&&(p+=y[0],d.index+=y[0].length),T({type:"text",value:p});continue}if(l&&(l.type==="globstar"||l.star===!0)){l.type="star",l.star=!0,l.value+=p,l.output=W,d.backtrack=!0,d.globstar=!0,Q(p);continue}let S=ae();if(r.noextglob!==!0&&/^\([^?]/.test(S)){Le("star",p);continue}if(l.type==="star"){if(r.noglobstar===!0){Q(p);continue}const y=l.prev,C=y.prev,N=y.type==="slash"||y.type==="bos",q=C&&(C.type==="star"||C.type==="globstar");if(r.bash===!0&&(!N||S[0]&&S[0]!=="/")){T({type:"star",value:p,output:""});continue}const U=d.braces>0&&(y.type==="comma"||y.type==="brace"),at=M.length&&(y.type==="pipe"||y.type==="paren");if(!N&&y.type!=="paren"&&!U&&!at){T({type:"star",value:p,output:""});continue}for(;S.slice(0,3)==="/**";){const De=t[d.index+4];if(De&&De!=="/")break;S=S.slice(3),Q("/**",3)}if(y.type==="bos"&&K()){l.type="globstar",l.value+=p,l.output=b(r),d.output=l.output,d.globstar=!0,Q(p);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&!q&&K()){d.output=d.output.slice(0,-(y.output+l.output).length),y.output=`(?:${y.output}`,l.type="globstar",l.output=b(r)+(r.strictSlashes?")":"|$)"),l.value+=p,d.globstar=!0,d.output+=y.output+l.output,Q(p);continue}if(y.type==="slash"&&y.prev.type!=="bos"&&S[0]==="/"){const De=S[1]!==void 0?"|$":"";d.output=d.output.slice(0,-(y.output+l.output).length),y.output=`(?:${y.output}`,l.type="globstar",l.output=`${b(r)}${$}|${$}${De})`,l.value+=p,d.output+=y.output+l.output,d.globstar=!0,Q(p+ie()),T({type:"slash",value:"/",output:""});continue}if(y.type==="bos"&&S[0]==="/"){l.type="globstar",l.value+=p,l.output=`(?:^|${$}|${b(r)}${$})`,d.output=l.output,d.globstar=!0,Q(p+ie()),T({type:"slash",value:"/",output:""});continue}d.output=d.output.slice(0,-l.output.length),l.type="globstar",l.output=b(r),l.value+=p,d.output+=l.output,d.globstar=!0,Q(p);continue}const D={type:"star",value:p,output:W};if(r.bash===!0){D.output=".*?",(l.type==="bos"||l.type==="slash")&&(D.output=R+D.output),T(D);continue}if(l&&(l.type==="bracket"||l.type==="paren")&&r.regex===!0){D.output=p,T(D);continue}(d.index===d.start||l.type==="slash"||l.type==="dot")&&(l.type==="dot"?(d.output+=A,l.output+=A):r.dot===!0?(d.output+=B,l.output+=B):(d.output+=R,l.output+=R),w()!=="*"&&(d.output+=g,l.output+=g)),T(D)}for(;d.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(me("closing","]"));d.output=Y.escapeLast(d.output,"["),de("brackets")}for(;d.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(me("closing",")"));d.output=Y.escapeLast(d.output,"("),de("parens")}for(;d.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(me("closing","}"));d.output=Y.escapeLast(d.output,"{"),de("braces")}if(r.strictSlashes!==!0&&(l.type==="star"||l.type==="bracket")&&T({type:"maybe_slash",value:"",output:`${$}?`}),d.backtrack===!0){d.output="";for(const S of d.tokens)d.output+=S.output!=null?S.output:S.value,S.suffix&&(d.output+=S.suffix)}return d};Bt.fastpaths=(t,e)=>{const r={...e},n=typeof r.maxLength=="number"?Math.min(Ge,r.maxLength):Ge,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=rn[t]||t;const a=Y.isWindows(e),{DOT_LITERAL:i,SLASH_LITERAL:o,ONE_CHAR:u,DOTS_SLASH:h,NO_DOT:c,NO_DOTS:_,NO_DOTS_SLASH:f,STAR:$,START_ANCHOR:g}=je.globChars(a),m=r.dot?_:c,P=r.dot?f:c,A=r.capture?"":"?:",B={negated:!1,prefix:""};let v=r.bash===!0?".*?":$;r.capture&&(v=`(${v})`);const z=R=>R.noglobstar===!0?v:`(${A}(?:(?!${g}${R.dot?h:i}).)*?)`,x=R=>{switch(R){case"*":return`${m}${u}${v}`;case".*":return`${i}${u}${v}`;case"*.*":return`${m}${v}${i}${u}${v}`;case"*/*":return`${m}${v}${o}${u}${P}${v}`;case"**":return m+z(r);case"**/*":return`(?:${m}${z(r)}${o})?${P}${u}${v}`;case"**/*.*":return`(?:${m}${z(r)}${o})?${P}${v}${i}${u}${v}`;case"**/.*":return`(?:${m}${z(r)}${o})?${i}${u}${v}`;default:{const O=/^(.*?)\.(\w+)$/.exec(R);if(!O)return;const W=x(O[1]);return W?W+i+O[2]:void 0}}},H=Y.removePrefix(t,B);let b=x(H);return b&&r.strictSlashes!==!0&&(b+=`${o}?`),b};var Ci=Bt;const xi=k,Ti=Ei,vt=Ci,jt=Pe,wi=Ze,Oi=t=>t&&typeof t=="object"&&!Array.isArray(t),j=(t,e,r=!1)=>{if(Array.isArray(t)){const c=t.map(f=>j(f,e,r));return f=>{for(const $ of c){const g=$(f);if(g)return g}return!1}}const n=Oi(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");const s=e||{},a=jt.isWindows(e),i=n?j.compileRe(t,e):j.makeRe(t,e,!1,!0),o=i.state;delete i.state;let u=()=>!1;if(s.ignore){const c={...e,ignore:null,onMatch:null,onResult:null};u=j(s.ignore,c,r)}const h=(c,_=!1)=>{const{isMatch:f,match:$,output:g}=j.test(c,i,e,{glob:t,posix:a}),m={glob:t,state:o,regex:i,posix:a,input:c,output:g,match:$,isMatch:f};return typeof s.onResult=="function"&&s.onResult(m),f===!1?(m.isMatch=!1,_?m:!1):u(c)?(typeof s.onIgnore=="function"&&s.onIgnore(m),m.isMatch=!1,_?m:!1):(typeof s.onMatch=="function"&&s.onMatch(m),_?m:!0)};return r&&(h.state=o),h};j.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return{isMatch:!1,output:""};const a=r||{},i=a.format||(s?jt.toPosixSlashes:null);let o=t===n,u=o&&i?i(t):t;return o===!1&&(u=i?i(t):t,o=u===n),(o===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?o=j.matchBase(t,e,r,s):o=e.exec(u)),{isMatch:!!o,match:o,output:u}};j.matchBase=(t,e,r,n=jt.isWindows(r))=>(e instanceof RegExp?e:j.makeRe(e,r)).test(xi.basename(t));j.isMatch=(t,e,r)=>j(e,r)(t);j.parse=(t,e)=>Array.isArray(t)?t.map(r=>j.parse(r,e)):vt(t,{...e,fastpaths:!1});j.scan=(t,e)=>Ti(t,e);j.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;const s=e||{},a=s.contains?"":"^",i=s.contains?"":"$";let o=`${a}(?:${t.output})${i}`;t&&t.negated===!0&&(o=`^(?!${o}).*$`);const u=j.toRegex(o,e);return n===!0&&(u.state=t),u};j.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=vt.fastpaths(t,e)),s.output||(s=vt(t,e)),j.compileRe(s,e,r,n)};j.toRegex=(t,e)=>{try{const r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return/$^/}};j.constants=wi;var ki=j,Li=ki;const nn=jr,sn=ri,ce=Li,St=Pe,Or=t=>t===""||t==="./",I=(t,e,r)=>{e=[].concat(e),t=[].concat(t);let n=new Set,s=new Set,a=new Set,i=0,o=c=>{a.add(c.output),r&&r.onResult&&r.onResult(c)};for(let c=0;c<e.length;c++){let _=ce(String(e[c]),{...r,onResult:o},!0),f=_.state.negated||_.state.negatedExtglob;f&&i++;for(let $ of t){let g=_($,!0);(f?!g.isMatch:g.isMatch)&&(f?n.add(g.output):(n.delete(g.output),s.add(g.output)))}}let h=(i===e.length?[...a]:[...s]).filter(c=>!n.has(c));if(r&&h.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${e.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?e.map(c=>c.replace(/\\/g,"")):e}return h};I.match=I;I.matcher=(t,e)=>ce(t,e);I.isMatch=(t,e,r)=>ce(e,r)(t);I.any=I.isMatch;I.not=(t,e,r={})=>{e=[].concat(e).map(String);let n=new Set,s=[],a=o=>{r.onResult&&r.onResult(o),s.push(o.output)},i=new Set(I(t,e,{...r,onResult:a}));for(let o of s)i.has(o)||n.add(o);return[...n]};I.contains=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${nn.inspect(t)}"`);if(Array.isArray(e))return e.some(n=>I.contains(t,n,r));if(typeof e=="string"){if(Or(t)||Or(e))return!1;if(t.includes(e)||t.startsWith("./")&&t.slice(2).includes(e))return!0}return I.isMatch(t,e,{...r,contains:!0})};I.matchKeys=(t,e,r)=>{if(!St.isObject(t))throw new TypeError("Expected the first argument to be an object");let n=I(Object.keys(t),e,r),s={};for(let a of n)s[a]=t[a];return s};I.some=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let a=ce(String(s),r);if(n.some(i=>a(i)))return!0}return!1};I.every=(t,e,r)=>{let n=[].concat(t);for(let s of[].concat(e)){let a=ce(String(s),r);if(!n.every(i=>a(i)))return!1}return!0};I.all=(t,e,r)=>{if(typeof t!="string")throw new TypeError(`Expected a string: "${nn.inspect(t)}"`);return[].concat(e).every(n=>ce(n,r)(t))};I.capture=(t,e,r)=>{let n=St.isWindows(r),a=ce.makeRe(String(t),{...r,capture:!0}).exec(n?St.toPosixSlashes(e):e);if(a)return a.slice(1).map(i=>i===void 0?"":i)};I.makeRe=(...t)=>ce.makeRe(...t);I.scan=(...t)=>ce.scan(...t);I.parse=(t,e)=>{let r=[];for(let n of[].concat(t||[]))for(let s of sn(String(n),e))r.push(ce.parse(s,e));return r};I.braces=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return e&&e.nobrace===!0||!/\{.*\}/.test(t)?[t]:sn(t,e)};I.braceExpand=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");return I.braces(t,{...e,expand:!0})};var Di=I;Object.defineProperty(E,"__esModule",{value:!0});E.removeDuplicateSlashes=E.matchAny=E.convertPatternsToRe=E.makeRe=E.getPatternParts=E.expandBraceExpansion=E.expandPatternsWithBraceExpansion=E.isAffectDepthOfReadingPattern=E.endsWithSlashGlobStar=E.hasGlobStar=E.getBaseDirectory=E.isPatternRelatedToParentDirectory=E.getPatternsOutsideCurrentDirectory=E.getPatternsInsideCurrentDirectory=E.getPositivePatterns=E.getNegativePatterns=E.isPositivePattern=E.isNegativePattern=E.convertToNegativePattern=E.convertToPositivePattern=E.isDynamicPattern=E.isStaticPattern=void 0;const Hi=k,Mi=ds,Gt=Di,an="**",Ii="\\",Ni=/[*?]|^!/,Fi=/\[[^[]*]/,Bi=/(?:^|[^!*+?@])\([^(]*\|[^|]*\)/,ji=/[!*+?@]\([^(]*\)/,Gi=/,|\.\./,Ui=/(?!^)\/{2,}/g;function on(t,e={}){return!un(t,e)}E.isStaticPattern=on;function un(t,e={}){return t===""?!1:!!(e.caseSensitiveMatch===!1||t.includes(Ii)||Ni.test(t)||Fi.test(t)||Bi.test(t)||e.extglob!==!1&&ji.test(t)||e.braceExpansion!==!1&&Wi(t))}E.isDynamicPattern=un;function Wi(t){const e=t.indexOf("{");if(e===-1)return!1;const r=t.indexOf("}",e+1);if(r===-1)return!1;const n=t.slice(e,r);return Gi.test(n)}function Vi(t){return ze(t)?t.slice(1):t}E.convertToPositivePattern=Vi;function Ki(t){return"!"+t}E.convertToNegativePattern=Ki;function ze(t){return t.startsWith("!")&&t[1]!=="("}E.isNegativePattern=ze;function cn(t){return!ze(t)}E.isPositivePattern=cn;function qi(t){return t.filter(ze)}E.getNegativePatterns=qi;function Qi(t){return t.filter(cn)}E.getPositivePatterns=Qi;function Yi(t){return t.filter(e=>!Ut(e))}E.getPatternsInsideCurrentDirectory=Yi;function Xi(t){return t.filter(Ut)}E.getPatternsOutsideCurrentDirectory=Xi;function Ut(t){return t.startsWith("..")||t.startsWith("./..")}E.isPatternRelatedToParentDirectory=Ut;function Zi(t){return Mi(t,{flipBackslashes:!1})}E.getBaseDirectory=Zi;function zi(t){return t.includes(an)}E.hasGlobStar=zi;function ln(t){return t.endsWith("/"+an)}E.endsWithSlashGlobStar=ln;function Ji(t){const e=Hi.basename(t);return ln(t)||on(e)}E.isAffectDepthOfReadingPattern=Ji;function ea(t){return t.reduce((e,r)=>e.concat(fn(r)),[])}E.expandPatternsWithBraceExpansion=ea;function fn(t){const e=Gt.braces(t,{expand:!0,nodupes:!0,keepEscaping:!0});return e.sort((r,n)=>r.length-n.length),e.filter(r=>r!=="")}E.expandBraceExpansion=fn;function ta(t,e){let{parts:r}=Gt.scan(t,Object.assign(Object.assign({},e),{parts:!0}));return r.length===0&&(r=[t]),r[0].startsWith("/")&&(r[0]=r[0].slice(1),r.unshift("")),r}E.getPatternParts=ta;function pn(t,e){return Gt.makeRe(t,e)}E.makeRe=pn;function ra(t,e){return t.map(r=>pn(r,e))}E.convertPatternsToRe=ra;function na(t,e){return e.some(r=>r.test(t))}E.matchAny=na;function sa(t){return t.replace(Ui,"/")}E.removeDuplicateSlashes=sa;var Je={};const ia=Ke,hn=ia.PassThrough,aa=Array.prototype.slice;var oa=ua;function ua(){const t=[],e=aa.call(arguments);let r=!1,n=e[e.length-1];n&&!Array.isArray(n)&&n.pipe==null?e.pop():n={};const s=n.end!==!1,a=n.pipeError===!0;n.objectMode==null&&(n.objectMode=!0),n.highWaterMark==null&&(n.highWaterMark=64*1024);const i=hn(n);function o(){for(let c=0,_=arguments.length;c<_;c++)t.push(dn(arguments[c],n));return u(),this}function u(){if(r)return;r=!0;let c=t.shift();if(!c){process.nextTick(h);return}Array.isArray(c)||(c=[c]);let _=c.length+1;function f(){--_>0||(r=!1,u())}function $(g){function m(){g.removeListener("merge2UnpipeEnd",m),g.removeListener("end",m),a&&g.removeListener("error",P),f()}function P(A){i.emit("error",A)}if(g._readableState.endEmitted)return f();g.on("merge2UnpipeEnd",m),g.on("end",m),a&&g.on("error",P),g.pipe(i,{end:!1}),g.resume()}for(let g=0;g<c.length;g++)$(c[g]);f()}function h(){r=!1,i.emit("queueDrain"),s&&i.end()}return i.setMaxListeners(0),i.add=o,i.on("unpipe",function(c){c.emit("merge2UnpipeEnd")}),e.length&&o.apply(null,e),i}function dn(t,e){if(Array.isArray(t))for(let r=0,n=t.length;r<n;r++)t[r]=dn(t[r],e);else{if(!t._readableState&&t.pipe&&(t=t.pipe(hn(e))),!t._readableState||!t.pause||!t.pipe)throw new Error("Only readable stream can be merged.");t.pause()}return t}Object.defineProperty(Je,"__esModule",{value:!0});Je.merge=void 0;const ca=oa;function la(t){const e=ca(t);return t.forEach(r=>{r.once("error",n=>e.emit("error",n))}),e.once("close",()=>kr(t)),e.once("end",()=>kr(t)),e}Je.merge=la;function kr(t){t.forEach(e=>e.emit("close"))}var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.isEmpty=Ae.isString=void 0;function fa(t){return typeof t=="string"}Ae.isString=fa;function pa(t){return t===""}Ae.isEmpty=pa;Object.defineProperty(F,"__esModule",{value:!0});F.string=F.stream=F.pattern=F.path=F.fs=F.errno=F.array=void 0;const ha=Se;F.array=ha;const da=qe;F.errno=da;const _a=Qe;F.fs=_a;const ga=G;F.path=ga;const ya=E;F.pattern=ya;const ma=Je;F.stream=ma;const va=Ae;F.string=va;Object.defineProperty(V,"__esModule",{value:!0});V.convertPatternGroupToTask=V.convertPatternGroupsToTasks=V.groupPatternsByBaseDirectory=V.getNegativePatternsAsPositive=V.getPositivePatterns=V.convertPatternsToTasks=V.generate=void 0;const se=F;function Sa(t,e){const r=Lr(t,e),n=Lr(e.ignore,e),s=_n(r),a=gn(r,n),i=s.filter(c=>se.pattern.isStaticPattern(c,e)),o=s.filter(c=>se.pattern.isDynamicPattern(c,e)),u=At(i,a,!1),h=At(o,a,!0);return u.concat(h)}V.generate=Sa;function Lr(t,e){let r=t;return e.braceExpansion&&(r=se.pattern.expandPatternsWithBraceExpansion(r)),e.baseNameMatch&&(r=r.map(n=>n.includes("/")?n:`**/${n}`)),r.map(n=>se.pattern.removeDuplicateSlashes(n))}function At(t,e,r){const n=[],s=se.pattern.getPatternsOutsideCurrentDirectory(t),a=se.pattern.getPatternsInsideCurrentDirectory(t),i=Et(s),o=Et(a);return n.push(...Rt(i,e,r)),"."in o?n.push(Wt(".",a,e,r)):n.push(...Rt(o,e,r)),n}V.convertPatternsToTasks=At;function _n(t){return se.pattern.getPositivePatterns(t)}V.getPositivePatterns=_n;function gn(t,e){return se.pattern.getNegativePatterns(t).concat(e).map(se.pattern.convertToPositivePattern)}V.getNegativePatternsAsPositive=gn;function Et(t){const e={};return t.reduce((r,n)=>{const s=se.pattern.getBaseDirectory(n);return s in r?r[s].push(n):r[s]=[n],r},e)}V.groupPatternsByBaseDirectory=Et;function Rt(t,e,r){return Object.keys(t).map(n=>Wt(n,t[n],e,r))}V.convertPatternGroupsToTasks=Rt;function Wt(t,e,r,n){return{dynamic:n,positive:e,negative:r,base:t,patterns:[].concat(e,r.map(se.pattern.convertToNegativePattern))}}V.convertPatternGroupToTask=Wt;var Vt={},Kt={},te={},qt={},et={},ue={},pe={},Z={},tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.read=void 0;function Aa(t,e,r){e.fs.lstat(t,(n,s)=>{if(n!==null){Dr(r,n);return}if(!s.isSymbolicLink()||!e.followSymbolicLink){yt(r,s);return}e.fs.stat(t,(a,i)=>{if(a!==null){if(e.throwErrorOnBrokenSymbolicLink){Dr(r,a);return}yt(r,s);return}e.markSymbolicLink&&(i.isSymbolicLink=()=>!0),yt(r,i)})})}tt.read=Aa;function Dr(t,e){t(e)}function yt(t,e){t(null,e)}var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.read=void 0;function Ea(t,e){const r=e.fs.lstatSync(t);if(!r.isSymbolicLink()||!e.followSymbolicLink)return r;try{const n=e.fs.statSync(t);return e.markSymbolicLink&&(n.isSymbolicLink=()=>!0),n}catch(n){if(!e.throwErrorOnBrokenSymbolicLink)return r;throw n}}rt.read=Ea;var Qt={},yn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;const e=Lt;t.FILE_SYSTEM_ADAPTER={lstat:e.lstat,stat:e.stat,lstatSync:e.lstatSync,statSync:e.statSync};function r(n){return n===void 0?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),n)}t.createFileSystemAdapter=r})(yn);Object.defineProperty(Qt,"__esModule",{value:!0});const Ra=yn;let $a=class{constructor(e={}){this._options=e,this.followSymbolicLink=this._getValue(this._options.followSymbolicLink,!0),this.fs=Ra.createFileSystemAdapter(this._options.fs),this.markSymbolicLink=this._getValue(this._options.markSymbolicLink,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0)}_getValue(e,r){return e??r}};Qt.default=$a;Object.defineProperty(Z,"__esModule",{value:!0});Z.statSync=Z.stat=Z.Settings=void 0;const Hr=tt,Pa=rt,$t=Qt;Z.Settings=$t.default;function ba(t,e,r){if(typeof e=="function"){Hr.read(t,Pt(),e);return}Hr.read(t,Pt(e),r)}Z.stat=ba;function Ca(t,e){const r=Pt(e);return Pa.read(t,r)}Z.statSync=Ca;function Pt(t={}){return t instanceof $t.default?t:new $t.default(t)}/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */let Mr;var xa=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:In):t=>(Mr||(Mr=Promise.resolve())).then(t).catch(e=>setTimeout(()=>{throw e},0));/*! run-parallel. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Ta=Oa;const wa=xa;function Oa(t,e){let r,n,s,a=!0;Array.isArray(t)?(r=[],n=t.length):(s=Object.keys(t),r={},n=s.length);function i(u){function h(){e&&e(u,r),e=null}a?wa(h):h()}function o(u,h,c){r[u]=c,(--n===0||h)&&i(h)}n?s?s.forEach(function(u){t[u](function(h,c){o(u,h,c)})}):t.forEach(function(u,h){u(function(c,_){o(h,c,_)})}):i(null),a=!1}var be={};Object.defineProperty(be,"__esModule",{value:!0});be.IS_SUPPORT_READDIR_WITH_FILE_TYPES=void 0;const Ue=process.versions.node.split(".");if(Ue[0]===void 0||Ue[1]===void 0)throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);const mn=Number.parseInt(Ue[0],10),ka=Number.parseInt(Ue[1],10),vn=10,La=10,Da=mn>vn,Ha=mn===vn&&ka>=La;be.IS_SUPPORT_READDIR_WITH_FILE_TYPES=Da||Ha;var Ce={},nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.createDirentFromStats=void 0;class Ma{constructor(e,r){this.name=e,this.isBlockDevice=r.isBlockDevice.bind(r),this.isCharacterDevice=r.isCharacterDevice.bind(r),this.isDirectory=r.isDirectory.bind(r),this.isFIFO=r.isFIFO.bind(r),this.isFile=r.isFile.bind(r),this.isSocket=r.isSocket.bind(r),this.isSymbolicLink=r.isSymbolicLink.bind(r)}}function Ia(t,e){return new Ma(t,e)}nt.createDirentFromStats=Ia;Object.defineProperty(Ce,"__esModule",{value:!0});Ce.fs=void 0;const Na=nt;Ce.fs=Na;var xe={};Object.defineProperty(xe,"__esModule",{value:!0});xe.joinPathSegments=void 0;function Fa(t,e,r){return t.endsWith(r)?t+e:t+r+e}xe.joinPathSegments=Fa;Object.defineProperty(pe,"__esModule",{value:!0});pe.readdir=pe.readdirWithFileTypes=pe.read=void 0;const Ba=Z,Sn=Ta,ja=be,An=Ce,En=xe;function Ga(t,e,r){if(!e.stats&&ja.IS_SUPPORT_READDIR_WITH_FILE_TYPES){Rn(t,e,r);return}$n(t,e,r)}pe.read=Ga;function Rn(t,e,r){e.fs.readdir(t,{withFileTypes:!0},(n,s)=>{if(n!==null){We(r,n);return}const a=s.map(o=>({dirent:o,name:o.name,path:En.joinPathSegments(t,o.name,e.pathSegmentSeparator)}));if(!e.followSymbolicLinks){bt(r,a);return}const i=a.map(o=>Ua(o,e));Sn(i,(o,u)=>{if(o!==null){We(r,o);return}bt(r,u)})})}pe.readdirWithFileTypes=Rn;function Ua(t,e){return r=>{if(!t.dirent.isSymbolicLink()){r(null,t);return}e.fs.stat(t.path,(n,s)=>{if(n!==null){if(e.throwErrorOnBrokenSymbolicLink){r(n);return}r(null,t);return}t.dirent=An.fs.createDirentFromStats(t.name,s),r(null,t)})}}function $n(t,e,r){e.fs.readdir(t,(n,s)=>{if(n!==null){We(r,n);return}const a=s.map(i=>{const o=En.joinPathSegments(t,i,e.pathSegmentSeparator);return u=>{Ba.stat(o,e.fsStatSettings,(h,c)=>{if(h!==null){u(h);return}const _={name:i,path:o,dirent:An.fs.createDirentFromStats(i,c)};e.stats&&(_.stats=c),u(null,_)})}});Sn(a,(i,o)=>{if(i!==null){We(r,i);return}bt(r,o)})})}pe.readdir=$n;function We(t,e){t(e)}function bt(t,e){t(null,e)}var he={};Object.defineProperty(he,"__esModule",{value:!0});he.readdir=he.readdirWithFileTypes=he.read=void 0;const Wa=Z,Va=be,Pn=Ce,bn=xe;function Ka(t,e){return!e.stats&&Va.IS_SUPPORT_READDIR_WITH_FILE_TYPES?Cn(t,e):xn(t,e)}he.read=Ka;function Cn(t,e){return e.fs.readdirSync(t,{withFileTypes:!0}).map(n=>{const s={dirent:n,name:n.name,path:bn.joinPathSegments(t,n.name,e.pathSegmentSeparator)};if(s.dirent.isSymbolicLink()&&e.followSymbolicLinks)try{const a=e.fs.statSync(s.path);s.dirent=Pn.fs.createDirentFromStats(s.name,a)}catch(a){if(e.throwErrorOnBrokenSymbolicLink)throw a}return s})}he.readdirWithFileTypes=Cn;function xn(t,e){return e.fs.readdirSync(t).map(n=>{const s=bn.joinPathSegments(t,n,e.pathSegmentSeparator),a=Wa.statSync(s,e.fsStatSettings),i={name:n,path:s,dirent:Pn.fs.createDirentFromStats(n,a)};return e.stats&&(i.stats=a),i})}he.readdir=xn;var Yt={},Tn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createFileSystemAdapter=t.FILE_SYSTEM_ADAPTER=void 0;const e=Lt;t.FILE_SYSTEM_ADAPTER={lstat:e.lstat,stat:e.stat,lstatSync:e.lstatSync,statSync:e.statSync,readdir:e.readdir,readdirSync:e.readdirSync};function r(n){return n===void 0?t.FILE_SYSTEM_ADAPTER:Object.assign(Object.assign({},t.FILE_SYSTEM_ADAPTER),n)}t.createFileSystemAdapter=r})(Tn);Object.defineProperty(Yt,"__esModule",{value:!0});const qa=k,Qa=Z,Ya=Tn;let Xa=class{constructor(e={}){this._options=e,this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!1),this.fs=Ya.createFileSystemAdapter(this._options.fs),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,qa.sep),this.stats=this._getValue(this._options.stats,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!0),this.fsStatSettings=new Qa.Settings({followSymbolicLink:this.followSymbolicLinks,fs:this.fs,throwErrorOnBrokenSymbolicLink:this.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}};Yt.default=Xa;Object.defineProperty(ue,"__esModule",{value:!0});ue.Settings=ue.scandirSync=ue.scandir=void 0;const Ir=pe,Za=he,Ct=Yt;ue.Settings=Ct.default;function za(t,e,r){if(typeof e=="function"){Ir.read(t,xt(),e);return}Ir.read(t,xt(e),r)}ue.scandir=za;function Ja(t,e){const r=xt(e);return Za.read(t,r)}ue.scandirSync=Ja;function xt(t={}){return t instanceof Ct.default?t:new Ct.default(t)}var Xt={exports:{}};function eo(t){var e=new t,r=e;function n(){var a=e;return a.next?e=a.next:(e=new t,r=e),a.next=null,a}function s(a){r.next=a,r=a}return{get:n,release:s}}var to=eo,ro=to;function wn(t,e,r){if(typeof t=="function"&&(r=e,e=t,t=null),!(r>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");var n=ro(no),s=null,a=null,i=0,o=null,u={push:m,drain:ee,saturated:ee,pause:c,paused:!1,get concurrency(){return r},set concurrency(x){if(!(x>=1))throw new Error("fastqueue concurrency must be equal to or greater than 1");if(r=x,!u.paused)for(;s&&i<r;)i++,A()},running:h,resume:$,idle:g,length:_,getQueue:f,unshift:P,empty:ee,kill:B,killAndDrain:v,error:z};return u;function h(){return i}function c(){u.paused=!0}function _(){for(var x=s,H=0;x;)x=x.next,H++;return H}function f(){for(var x=s,H=[];x;)H.push(x.value),x=x.next;return H}function $(){if(u.paused){if(u.paused=!1,s===null){i++,A();return}for(;s&&i<r;)i++,A()}}function g(){return i===0&&u.length()===0}function m(x,H){var b=n.get();b.context=t,b.release=A,b.value=x,b.callback=H||ee,b.errorHandler=o,i>=r||u.paused?a?(a.next=b,a=b):(s=b,a=b,u.saturated()):(i++,e.call(t,b.value,b.worked))}function P(x,H){var b=n.get();b.context=t,b.release=A,b.value=x,b.callback=H||ee,b.errorHandler=o,i>=r||u.paused?s?(b.next=s,s=b):(s=b,a=b,u.saturated()):(i++,e.call(t,b.value,b.worked))}function A(x){x&&n.release(x);var H=s;H&&i<=r?u.paused?i--:(a===s&&(a=null),s=H.next,H.next=null,e.call(t,H.value,H.worked),a===null&&u.empty()):--i===0&&u.drain()}function B(){s=null,a=null,u.drain=ee}function v(){s=null,a=null,u.drain(),u.drain=ee}function z(x){o=x}}function ee(){}function no(){this.value=null,this.callback=ee,this.next=null,this.release=ee,this.context=null,this.errorHandler=null;var t=this;this.worked=function(r,n){var s=t.callback,a=t.errorHandler,i=t.value;t.value=null,t.callback=ee,t.errorHandler&&a(r,i),s.call(t.context,r,n),t.release(t)}}function so(t,e,r){typeof t=="function"&&(r=e,e=t,t=null);function n(c,_){e.call(this,c).then(function(f){_(null,f)},_)}var s=wn(t,n,r),a=s.push,i=s.unshift;return s.push=o,s.unshift=u,s.drained=h,s;function o(c){var _=new Promise(function(f,$){a(c,function(g,m){if(g){$(g);return}f(m)})});return _.catch(ee),_}function u(c){var _=new Promise(function(f,$){i(c,function(g,m){if(g){$(g);return}f(m)})});return _.catch(ee),_}function h(){if(s.idle())return new Promise(function(f){f()});var c=s.drain,_=new Promise(function(f){s.drain=function(){c(),f()}});return _}}Xt.exports=wn;Xt.exports.promise=so;var io=Xt.exports,re={};Object.defineProperty(re,"__esModule",{value:!0});re.joinPathSegments=re.replacePathSegmentSeparator=re.isAppliedFilter=re.isFatalError=void 0;function ao(t,e){return t.errorFilter===null?!0:!t.errorFilter(e)}re.isFatalError=ao;function oo(t,e){return t===null||t(e)}re.isAppliedFilter=oo;function uo(t,e){return t.split(/[/\\]/).join(e)}re.replacePathSegmentSeparator=uo;function co(t,e,r){return t===""?e:t.endsWith(r)?t+e:t+r+e}re.joinPathSegments=co;var st={};Object.defineProperty(st,"__esModule",{value:!0});const lo=re;let fo=class{constructor(e,r){this._root=e,this._settings=r,this._root=lo.replacePathSegmentSeparator(e,r.pathSegmentSeparator)}};st.default=fo;Object.defineProperty(et,"__esModule",{value:!0});const po=Bn,ho=ue,_o=io,He=re,go=st;class yo extends go.default{constructor(e,r){super(e,r),this._settings=r,this._scandir=ho.scandir,this._emitter=new po.EventEmitter,this._queue=_o(this._worker.bind(this),this._settings.concurrency),this._isFatalError=!1,this._isDestroyed=!1,this._queue.drain=()=>{this._isFatalError||this._emitter.emit("end")}}read(){return this._isFatalError=!1,this._isDestroyed=!1,setImmediate(()=>{this._pushToQueue(this._root,this._settings.basePath)}),this._emitter}get isDestroyed(){return this._isDestroyed}destroy(){if(this._isDestroyed)throw new Error("The reader is already destroyed");this._isDestroyed=!0,this._queue.killAndDrain()}onEntry(e){this._emitter.on("entry",e)}onError(e){this._emitter.once("error",e)}onEnd(e){this._emitter.once("end",e)}_pushToQueue(e,r){const n={directory:e,base:r};this._queue.push(n,s=>{s!==null&&this._handleError(s)})}_worker(e,r){this._scandir(e.directory,this._settings.fsScandirSettings,(n,s)=>{if(n!==null){r(n,void 0);return}for(const a of s)this._handleEntry(a,e.base);r(null,void 0)})}_handleError(e){this._isDestroyed||!He.isFatalError(this._settings,e)||(this._isFatalError=!0,this._isDestroyed=!0,this._emitter.emit("error",e))}_handleEntry(e,r){if(this._isDestroyed||this._isFatalError)return;const n=e.path;r!==void 0&&(e.path=He.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),He.isAppliedFilter(this._settings.entryFilter,e)&&this._emitEntry(e),e.dirent.isDirectory()&&He.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_emitEntry(e){this._emitter.emit("entry",e)}}et.default=yo;Object.defineProperty(qt,"__esModule",{value:!0});const mo=et;class vo{constructor(e,r){this._root=e,this._settings=r,this._reader=new mo.default(this._root,this._settings),this._storage=[]}read(e){this._reader.onError(r=>{So(e,r)}),this._reader.onEntry(r=>{this._storage.push(r)}),this._reader.onEnd(()=>{Ao(e,this._storage)}),this._reader.read()}}qt.default=vo;function So(t,e){t(e)}function Ao(t,e){t(null,e)}var Zt={};Object.defineProperty(Zt,"__esModule",{value:!0});const Eo=Ke,Ro=et;class $o{constructor(e,r){this._root=e,this._settings=r,this._reader=new Ro.default(this._root,this._settings),this._stream=new Eo.Readable({objectMode:!0,read:()=>{},destroy:()=>{this._reader.isDestroyed||this._reader.destroy()}})}read(){return this._reader.onError(e=>{this._stream.emit("error",e)}),this._reader.onEntry(e=>{this._stream.push(e)}),this._reader.onEnd(()=>{this._stream.push(null)}),this._reader.read(),this._stream}}Zt.default=$o;var zt={},Jt={};Object.defineProperty(Jt,"__esModule",{value:!0});const Po=ue,Me=re,bo=st;class Co extends bo.default{constructor(){super(...arguments),this._scandir=Po.scandirSync,this._storage=[],this._queue=new Set}read(){return this._pushToQueue(this._root,this._settings.basePath),this._handleQueue(),this._storage}_pushToQueue(e,r){this._queue.add({directory:e,base:r})}_handleQueue(){for(const e of this._queue.values())this._handleDirectory(e.directory,e.base)}_handleDirectory(e,r){try{const n=this._scandir(e,this._settings.fsScandirSettings);for(const s of n)this._handleEntry(s,r)}catch(n){this._handleError(n)}}_handleError(e){if(Me.isFatalError(this._settings,e))throw e}_handleEntry(e,r){const n=e.path;r!==void 0&&(e.path=Me.joinPathSegments(r,e.name,this._settings.pathSegmentSeparator)),Me.isAppliedFilter(this._settings.entryFilter,e)&&this._pushToStorage(e),e.dirent.isDirectory()&&Me.isAppliedFilter(this._settings.deepFilter,e)&&this._pushToQueue(n,r===void 0?void 0:e.path)}_pushToStorage(e){this._storage.push(e)}}Jt.default=Co;Object.defineProperty(zt,"__esModule",{value:!0});const xo=Jt;class To{constructor(e,r){this._root=e,this._settings=r,this._reader=new xo.default(this._root,this._settings)}read(){return this._reader.read()}}zt.default=To;var er={};Object.defineProperty(er,"__esModule",{value:!0});const wo=k,Oo=ue;class ko{constructor(e={}){this._options=e,this.basePath=this._getValue(this._options.basePath,void 0),this.concurrency=this._getValue(this._options.concurrency,Number.POSITIVE_INFINITY),this.deepFilter=this._getValue(this._options.deepFilter,null),this.entryFilter=this._getValue(this._options.entryFilter,null),this.errorFilter=this._getValue(this._options.errorFilter,null),this.pathSegmentSeparator=this._getValue(this._options.pathSegmentSeparator,wo.sep),this.fsScandirSettings=new Oo.Settings({followSymbolicLinks:this._options.followSymbolicLinks,fs:this._options.fs,pathSegmentSeparator:this._options.pathSegmentSeparator,stats:this._options.stats,throwErrorOnBrokenSymbolicLink:this._options.throwErrorOnBrokenSymbolicLink})}_getValue(e,r){return e??r}}er.default=ko;Object.defineProperty(te,"__esModule",{value:!0});te.Settings=te.walkStream=te.walkSync=te.walk=void 0;const Nr=qt,Lo=Zt,Do=zt,Tt=er;te.Settings=Tt.default;function Ho(t,e,r){if(typeof e=="function"){new Nr.default(t,Ve()).read(e);return}new Nr.default(t,Ve(e)).read(r)}te.walk=Ho;function Mo(t,e){const r=Ve(e);return new Do.default(t,r).read()}te.walkSync=Mo;function Io(t,e){const r=Ve(e);return new Lo.default(t,r).read()}te.walkStream=Io;function Ve(t={}){return t instanceof Tt.default?t:new Tt.default(t)}var Te={};Object.defineProperty(Te,"__esModule",{value:!0});const No=k,Fo=Z,Fr=F;class Bo{constructor(e){this._settings=e,this._fsStatSettings=new Fo.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return No.resolve(this._settings.cwd,e)}_makeEntry(e,r){const n={name:r,path:r,dirent:Fr.fs.createDirentFromStats(r,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!Fr.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}Te.default=Bo;var it={};Object.defineProperty(it,"__esModule",{value:!0});const jo=Ke,Go=Z,Uo=te,Wo=Te;class Vo extends Wo.default{constructor(){super(...arguments),this._walkStream=Uo.walkStream,this._stat=Go.stat}dynamic(e,r){return this._walkStream(e,r)}static(e,r){const n=e.map(this._getFullEntryPath,this),s=new jo.PassThrough({objectMode:!0});s._write=(a,i,o)=>this._getEntry(n[a],e[a],r).then(u=>{u!==null&&r.entryFilter(u)&&s.push(u),a===n.length-1&&s.end(),o()}).catch(o);for(let a=0;a<n.length;a++)s.write(a);return s}_getEntry(e,r,n){return this._getStat(e).then(s=>this._makeEntry(s,r)).catch(s=>{if(n.errorFilter(s))return null;throw s})}_getStat(e){return new Promise((r,n)=>{this._stat(e,this._fsStatSettings,(s,a)=>s===null?r(a):n(s))})}}it.default=Vo;Object.defineProperty(Kt,"__esModule",{value:!0});const Ko=te,qo=Te,Qo=it;class Yo extends qo.default{constructor(){super(...arguments),this._walkAsync=Ko.walk,this._readerStream=new Qo.default(this._settings)}dynamic(e,r){return new Promise((n,s)=>{this._walkAsync(e,r,(a,i)=>{a===null?n(i):s(a)})})}async static(e,r){const n=[],s=this._readerStream.static(e,r);return new Promise((a,i)=>{s.once("error",i),s.on("data",o=>n.push(o)),s.once("end",()=>a(n))})}}Kt.default=Yo;var we={},tr={},rr={},nr={};Object.defineProperty(nr,"__esModule",{value:!0});const Ee=F;class Xo{constructor(e,r,n){this._patterns=e,this._settings=r,this._micromatchOptions=n,this._storage=[],this._fillStorage()}_fillStorage(){for(const e of this._patterns){const r=this._getPatternSegments(e),n=this._splitSegmentsIntoSections(r);this._storage.push({complete:n.length<=1,pattern:e,segments:r,sections:n})}}_getPatternSegments(e){return Ee.pattern.getPatternParts(e,this._micromatchOptions).map(n=>Ee.pattern.isDynamicPattern(n,this._settings)?{dynamic:!0,pattern:n,patternRe:Ee.pattern.makeRe(n,this._micromatchOptions)}:{dynamic:!1,pattern:n})}_splitSegmentsIntoSections(e){return Ee.array.splitWhen(e,r=>r.dynamic&&Ee.pattern.hasGlobStar(r.pattern))}}nr.default=Xo;Object.defineProperty(rr,"__esModule",{value:!0});const Zo=nr;class zo extends Zo.default{match(e){const r=e.split("/"),n=r.length,s=this._storage.filter(a=>!a.complete||a.segments.length>n);for(const a of s){const i=a.sections[0];if(!a.complete&&n>i.length||r.every((u,h)=>{const c=a.segments[h];return!!(c.dynamic&&c.patternRe.test(u)||!c.dynamic&&c.pattern===u)}))return!0}return!1}}rr.default=zo;Object.defineProperty(tr,"__esModule",{value:!0});const Ie=F,Jo=rr;class eu{constructor(e,r){this._settings=e,this._micromatchOptions=r}getFilter(e,r,n){const s=this._getMatcher(r),a=this._getNegativePatternsRe(n);return i=>this._filter(e,i,s,a)}_getMatcher(e){return new Jo.default(e,this._settings,this._micromatchOptions)}_getNegativePatternsRe(e){const r=e.filter(Ie.pattern.isAffectDepthOfReadingPattern);return Ie.pattern.convertPatternsToRe(r,this._micromatchOptions)}_filter(e,r,n,s){if(this._isSkippedByDeep(e,r.path)||this._isSkippedSymbolicLink(r))return!1;const a=Ie.path.removeLeadingDotSegment(r.path);return this._isSkippedByPositivePatterns(a,n)?!1:this._isSkippedByNegativePatterns(a,s)}_isSkippedByDeep(e,r){return this._settings.deep===1/0?!1:this._getEntryLevel(e,r)>=this._settings.deep}_getEntryLevel(e,r){const n=r.split("/").length;if(e==="")return n;const s=e.split("/").length;return n-s}_isSkippedSymbolicLink(e){return!this._settings.followSymbolicLinks&&e.dirent.isSymbolicLink()}_isSkippedByPositivePatterns(e,r){return!this._settings.baseNameMatch&&!r.match(e)}_isSkippedByNegativePatterns(e,r){return!Ie.pattern.matchAny(e,r)}}tr.default=eu;var sr={};Object.defineProperty(sr,"__esModule",{value:!0});const _e=F;class tu{constructor(e,r){this._settings=e,this._micromatchOptions=r,this.index=new Map}getFilter(e,r){const n=_e.pattern.convertPatternsToRe(e,this._micromatchOptions),s=_e.pattern.convertPatternsToRe(r,Object.assign(Object.assign({},this._micromatchOptions),{dot:!0}));return a=>this._filter(a,n,s)}_filter(e,r,n){const s=_e.path.removeLeadingDotSegment(e.path);if(this._settings.unique&&this._isDuplicateEntry(s)||this._onlyFileFilter(e)||this._onlyDirectoryFilter(e)||this._isSkippedByAbsoluteNegativePatterns(s,n))return!1;const a=e.dirent.isDirectory(),i=this._isMatchToPatterns(s,r,a)&&!this._isMatchToPatterns(s,n,a);return this._settings.unique&&i&&this._createIndexRecord(s),i}_isDuplicateEntry(e){return this.index.has(e)}_createIndexRecord(e){this.index.set(e,void 0)}_onlyFileFilter(e){return this._settings.onlyFiles&&!e.dirent.isFile()}_onlyDirectoryFilter(e){return this._settings.onlyDirectories&&!e.dirent.isDirectory()}_isSkippedByAbsoluteNegativePatterns(e,r){if(!this._settings.absolute)return!1;const n=_e.path.makeAbsolute(this._settings.cwd,e);return _e.pattern.matchAny(n,r)}_isMatchToPatterns(e,r,n){const s=_e.pattern.matchAny(e,r);return!s&&n?_e.pattern.matchAny(e+"/",r):s}}sr.default=tu;var ir={};Object.defineProperty(ir,"__esModule",{value:!0});const ru=F;class nu{constructor(e){this._settings=e}getFilter(){return e=>this._isNonFatalError(e)}_isNonFatalError(e){return ru.errno.isEnoentCodeError(e)||this._settings.suppressErrors}}ir.default=nu;var ar={};Object.defineProperty(ar,"__esModule",{value:!0});const Br=F;class su{constructor(e){this._settings=e}getTransformer(){return e=>this._transform(e)}_transform(e){let r=e.path;return this._settings.absolute&&(r=Br.path.makeAbsolute(this._settings.cwd,r),r=Br.path.unixify(r)),this._settings.markDirectories&&e.dirent.isDirectory()&&(r+="/"),this._settings.objectMode?Object.assign(Object.assign({},e),{path:r}):r}}ar.default=su;Object.defineProperty(we,"__esModule",{value:!0});const iu=k,au=tr,ou=sr,uu=ir,cu=ar;class lu{constructor(e){this._settings=e,this.errorFilter=new uu.default(this._settings),this.entryFilter=new ou.default(this._settings,this._getMicromatchOptions()),this.deepFilter=new au.default(this._settings,this._getMicromatchOptions()),this.entryTransformer=new cu.default(this._settings)}_getRootDirectory(e){return iu.resolve(this._settings.cwd,e.base)}_getReaderOptions(e){const r=e.base==="."?"":e.base;return{basePath:r,pathSegmentSeparator:"/",concurrency:this._settings.concurrency,deepFilter:this.deepFilter.getFilter(r,e.positive,e.negative),entryFilter:this.entryFilter.getFilter(e.positive,e.negative),errorFilter:this.errorFilter.getFilter(),followSymbolicLinks:this._settings.followSymbolicLinks,fs:this._settings.fs,stats:this._settings.stats,throwErrorOnBrokenSymbolicLink:this._settings.throwErrorOnBrokenSymbolicLink,transform:this.entryTransformer.getTransformer()}}_getMicromatchOptions(){return{dot:this._settings.dot,matchBase:this._settings.baseNameMatch,nobrace:!this._settings.braceExpansion,nocase:!this._settings.caseSensitiveMatch,noext:!this._settings.extglob,noglobstar:!this._settings.globstar,posix:!0,strictSlashes:!1}}}we.default=lu;Object.defineProperty(Vt,"__esModule",{value:!0});const fu=Kt,pu=we;class hu extends pu.default{constructor(){super(...arguments),this._reader=new fu.default(this._settings)}async read(e){const r=this._getRootDirectory(e),n=this._getReaderOptions(e);return(await this.api(r,e,n)).map(a=>n.transform(a))}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}}Vt.default=hu;var or={};Object.defineProperty(or,"__esModule",{value:!0});const du=Ke,_u=it,gu=we;class yu extends gu.default{constructor(){super(...arguments),this._reader=new _u.default(this._settings)}read(e){const r=this._getRootDirectory(e),n=this._getReaderOptions(e),s=this.api(r,e,n),a=new du.Readable({objectMode:!0,read:()=>{}});return s.once("error",i=>a.emit("error",i)).on("data",i=>a.emit("data",n.transform(i))).once("end",()=>a.emit("end")),a.once("close",()=>s.destroy()),a}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}}or.default=yu;var ur={},cr={};Object.defineProperty(cr,"__esModule",{value:!0});const mu=Z,vu=te,Su=Te;class Au extends Su.default{constructor(){super(...arguments),this._walkSync=vu.walkSync,this._statSync=mu.statSync}dynamic(e,r){return this._walkSync(e,r)}static(e,r){const n=[];for(const s of e){const a=this._getFullEntryPath(s),i=this._getEntry(a,s,r);i===null||!r.entryFilter(i)||n.push(i)}return n}_getEntry(e,r,n){try{const s=this._getStat(e);return this._makeEntry(s,r)}catch(s){if(n.errorFilter(s))return null;throw s}}_getStat(e){return this._statSync(e,this._fsStatSettings)}}cr.default=Au;Object.defineProperty(ur,"__esModule",{value:!0});const Eu=cr,Ru=we;class $u extends Ru.default{constructor(){super(...arguments),this._reader=new Eu.default(this._settings)}read(e){const r=this._getRootDirectory(e),n=this._getReaderOptions(e);return this.api(r,e,n).map(n.transform)}api(e,r,n){return r.dynamic?this._reader.dynamic(e,n):this._reader.static(r.patterns,n)}}ur.default=$u;var On={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FILE_SYSTEM_ADAPTER=void 0;const e=Lt,n=Math.max(Dt.cpus().length,1);t.DEFAULT_FILE_SYSTEM_ADAPTER={lstat:e.lstat,lstatSync:e.lstatSync,stat:e.stat,statSync:e.statSync,readdir:e.readdir,readdirSync:e.readdirSync};class s{constructor(i={}){this._options=i,this.absolute=this._getValue(this._options.absolute,!1),this.baseNameMatch=this._getValue(this._options.baseNameMatch,!1),this.braceExpansion=this._getValue(this._options.braceExpansion,!0),this.caseSensitiveMatch=this._getValue(this._options.caseSensitiveMatch,!0),this.concurrency=this._getValue(this._options.concurrency,n),this.cwd=this._getValue(this._options.cwd,process.cwd()),this.deep=this._getValue(this._options.deep,1/0),this.dot=this._getValue(this._options.dot,!1),this.extglob=this._getValue(this._options.extglob,!0),this.followSymbolicLinks=this._getValue(this._options.followSymbolicLinks,!0),this.fs=this._getFileSystemMethods(this._options.fs),this.globstar=this._getValue(this._options.globstar,!0),this.ignore=this._getValue(this._options.ignore,[]),this.markDirectories=this._getValue(this._options.markDirectories,!1),this.objectMode=this._getValue(this._options.objectMode,!1),this.onlyDirectories=this._getValue(this._options.onlyDirectories,!1),this.onlyFiles=this._getValue(this._options.onlyFiles,!0),this.stats=this._getValue(this._options.stats,!1),this.suppressErrors=this._getValue(this._options.suppressErrors,!1),this.throwErrorOnBrokenSymbolicLink=this._getValue(this._options.throwErrorOnBrokenSymbolicLink,!1),this.unique=this._getValue(this._options.unique,!0),this.onlyDirectories&&(this.onlyFiles=!1),this.stats&&(this.objectMode=!0),this.ignore=[].concat(this.ignore)}_getValue(i,o){return i===void 0?o:i}_getFileSystemMethods(i={}){return Object.assign(Object.assign({},t.DEFAULT_FILE_SYSTEM_ADAPTER),i)}}t.default=s})(On);const kn=V,Pu=Vt,bu=or,Cu=ur,wt=On,J=F;async function Ot(t,e){ne(t);const r=kt(t,Pu.default,e),n=await Promise.all(r);return J.array.flatten(n)}(function(t){t.glob=t,t.globSync=e,t.globStream=r,t.async=t;function e(o,u){ne(o);const h=kt(o,Cu.default,u);return J.array.flatten(h)}t.sync=e;function r(o,u){ne(o);const h=kt(o,bu.default,u);return J.stream.merge(h)}t.stream=r;function n(o,u){ne(o);const h=[].concat(o),c=new wt.default(u);return kn.generate(h,c)}t.generateTasks=n;function s(o,u){ne(o);const h=new wt.default(u);return J.pattern.isDynamicPattern(o,h)}t.isDynamicPattern=s;function a(o){return ne(o),J.path.escape(o)}t.escapePath=a;function i(o){return ne(o),J.path.convertPathToPattern(o)}t.convertPathToPattern=i,function(o){function u(c){return ne(c),J.path.escapePosixPath(c)}o.escapePath=u;function h(c){return ne(c),J.path.convertPosixPathToPattern(c)}o.convertPathToPattern=h}(t.posix||(t.posix={})),function(o){function u(c){return ne(c),J.path.escapeWindowsPath(c)}o.escapePath=u;function h(c){return ne(c),J.path.convertWindowsPathToPattern(c)}o.convertPathToPattern=h}(t.win32||(t.win32={}))})(Ot||(Ot={}));function kt(t,e,r){const n=[].concat(t),s=new wt.default(r),a=kn.generate(n,s),i=new e(s);return a.map(i.read,i)}function ne(t){if(![].concat(t).every(n=>J.string.isString(n)&&!J.string.isEmpty(n)))throw new TypeError("Patterns must be a string (non empty) or an array of strings")}var Fe=Ot;const mt=Nn(Fe),xu=`declare module 'soonjs/auto/client' {
|
|
28
|
+
import '.soonjs/src/types';
|
|
29
|
+
import type { Context, SoonFetchOptions, Meta } from '.soonjs/node_modules/soonjs';
|
|
30
|
+
import { z, ZodType } from 'zod';
|
|
31
|
+
|
|
32
|
+
export { type SoonFetchOptions };
|
|
33
|
+
|
|
34
|
+
type NonUndefined<A> = A extends undefined ? never : A;
|
|
35
|
+
type ReturnRealType<T extends (...args: any) => any | Promise<(...args: any) => any>, R = ReturnType<T>> = R extends Promise<infer U> ? U : R;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* ============================================
|
|
39
|
+
* apis
|
|
40
|
+
* ============================================
|
|
41
|
+
*/
|
|
42
|
+
$$$apis$$$
|
|
43
|
+
export { type apis as soonApis }
|
|
44
|
+
/**
|
|
45
|
+
* 调用服务端 api
|
|
46
|
+
*/
|
|
47
|
+
function api<T extends keyof apis>(path: T, body?: apis[T]['body'], options?: Omit<SoonFetchOptions, 'ip' | 'platform'>): Promise<apis[T]['action']>;
|
|
48
|
+
/**
|
|
49
|
+
* ============================================
|
|
50
|
+
* /apis
|
|
51
|
+
* ============================================
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* ============================================
|
|
56
|
+
* services
|
|
57
|
+
* ============================================
|
|
58
|
+
*/
|
|
59
|
+
$$$services$$$
|
|
60
|
+
const service: services;
|
|
61
|
+
/**
|
|
62
|
+
* ============================================
|
|
63
|
+
* /services
|
|
64
|
+
* ============================================
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* ============================================
|
|
69
|
+
* 扩展方法
|
|
70
|
+
* ============================================
|
|
71
|
+
*/
|
|
72
|
+
/** 配置 client **/
|
|
73
|
+
type SoonMethod = 'get' | 'head' | 'post' | 'put' | 'delete' | 'options' | 'patch';
|
|
74
|
+
type SoonFetchOptions = {
|
|
75
|
+
headers?: Record<string, string>;
|
|
76
|
+
method?: SoonMethod;
|
|
77
|
+
body?: any;
|
|
78
|
+
url?: string;
|
|
79
|
+
query?: Record<string, string>;
|
|
80
|
+
extra?: Record<string, any>;
|
|
81
|
+
};
|
|
82
|
+
type SoonOnFetch = (args: SoonFetchOptions) => Promise<any>;
|
|
83
|
+
function soonClientConfig(options: { baseUrl: string; onFetch: SoonOnFetch; defaultMethod: string }): Promise<any>;
|
|
84
|
+
/** 定义了bodySchema */
|
|
85
|
+
function useApi<BodySchema extends ZodType<any, any, any>, CustomBody, Data>(args: {
|
|
86
|
+
/** meta数据 */
|
|
87
|
+
meta?: Meta;
|
|
88
|
+
/** 数据 */
|
|
89
|
+
body?: BodySchema extends undefined ? CustomBody : z.infer<BodySchema>;
|
|
90
|
+
/** api body 验证模式 */
|
|
91
|
+
bodySchema: BodySchema;
|
|
92
|
+
/** api执行方法 */
|
|
93
|
+
action: (
|
|
94
|
+
body: BodySchema extends undefined ? CustomBody : z.infer<BodySchema>,
|
|
95
|
+
context: Context<{
|
|
96
|
+
bodySchema?: BodySchema;
|
|
97
|
+
}>
|
|
98
|
+
) => Promise<Data> | Data;
|
|
99
|
+
}): Promise<Data>;
|
|
100
|
+
/** 不定义 bodySchema */
|
|
101
|
+
function useApi<CustomBody, Data>(args: {
|
|
102
|
+
/** meta数据 */
|
|
103
|
+
meta?: Meta;
|
|
104
|
+
/** 数据 */
|
|
105
|
+
body?: CustomBody;
|
|
106
|
+
/** api执行方法 */
|
|
107
|
+
action: (body: CustomBody, context: Context<{}>) => Promise<Data> | Data;
|
|
108
|
+
}): Promise<Data>;
|
|
109
|
+
/**
|
|
110
|
+
* ============================================
|
|
111
|
+
* /扩展方法
|
|
112
|
+
* ============================================
|
|
113
|
+
*/
|
|
114
|
+
|
|
115
|
+
export default {
|
|
116
|
+
api,
|
|
117
|
+
service,
|
|
118
|
+
soonClientConfig,
|
|
119
|
+
useApi,
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
`,Tu=`declare module 'soonjs/auto/server' {
|
|
123
|
+
export const apis: any[];
|
|
124
|
+
export const middleware: any;
|
|
125
|
+
export const baseUrl: string;
|
|
126
|
+
export const init: any;
|
|
127
|
+
}
|
|
128
|
+
`,wu=`$$$services-imports$$$
|
|
129
|
+
|
|
130
|
+
declare module 'soonjs' {
|
|
131
|
+
interface ServiceContext {
|
|
132
|
+
$$$services-content$$$
|
|
133
|
+
}
|
|
134
|
+
}`;function Gu(t){let e=!1;const r=process.cwd(),n=(t==null?void 0:t.apisDir)||"./src/api",s=k.join(r,n);let a=[];const i="./auto",o=k.join(r,i);let u=[];const h=(t==null?void 0:t.servicesDir)||"./src/service",c=k.join(r,h);let _=[];const f=(t==null?void 0:t.importDirResolve)??(A=>A.replace(/^(\.\/src\/|src\/)/,"~/")),$="soonjs/auto/server",g="\0"+$,m=Fn();let P;return{name:"vite-plugin-soon-server",configureServer(A){P=A},config(A,B){B.command==="build"&&(e=!0)},closeBundle(){try{const A=(t==null?void 0:t.entryPath)||"./dist/entry.js";t!=null&&t.removeEntry&&e&&Hn(A)&&Mn(A)}catch{}},watchChange(A,B){(B.event==="create"||B.event==="delete")&&(!k.relative(s,A).startsWith("..")||!k.relative(c,A).startsWith("..")||!k.relative(o,A).startsWith(".."))&&(P==null||P.moduleGraph.invalidateModule(P==null?void 0:P.moduleGraph.getModuleById(g)),P==null||P.ws.send({type:"full-reload"}))},resolveId(A){if(A===$)return g},async load(A){if(A===g)return t!=null&&t.disableApis?"export const apis = [];":(a=(await mt([Fe.convertPathToPattern(k.join(n,"/**/*.ts"))])).map(v=>({id:"__api__"+m()+"_",importPath:f(v==null?void 0:v.replace(/\.ts$/,"")),file:v,fullPath:k.join(r,v),apiPath:"/"+k.relative(n,v).replace(/\.ts$/,"").replace(/\\/g,"/"),clientDtsImportPath:k.join(".soonjs",v==null?void 0:v.replace(/\.ts$/,"")).replace(/\\/g,"/")})),u=(await mt([Fe.convertPathToPattern(k.join(i,"/**/*.ts"))])).map(v=>({id:"__auto__"+m()+"_",importPath:".soonjs/"+(v==null?void 0:v.replace(/\.ts$/,"")),file:v,fullPath:k.join(r,v),apiPath:"/"+k.relative(i,v).replace(/\.ts$/,"").replace(/\\/g,"/"),clientDtsImportPath:k.join(".soonjs",v==null?void 0:v.replace(/\.ts$/,"")).replace(/\\/g,"/")})),_=(await mt([Fe.convertPathToPattern(k.join(h,"/**/*.ts"))])).map(v=>({id:"__service__"+m()+"_",importPath:f(v==null?void 0:v.replace(/\.ts$/,"")),file:v,fullPath:k.join(r,v),servicePath:"/"+k.relative(h,v).replace(/\.ts$/,"").replace(/\\/g,"/"),clientDtsImportPath:k.join(".soonjs",v==null?void 0:v.replace(/\.ts$/,"")).replace(/\\/g,"/")})),`import { soonApiSymbol, soonServiceSymbol, defineMiddleware } from 'soonjs';
|
|
135
|
+
import { exists, mkdir, writeFile } from 'fs';
|
|
136
|
+
import path from 'path';
|
|
137
|
+
|
|
138
|
+
${a.map(v=>`import * as ${v.id} from "${v.importPath}";`).join(`
|
|
139
|
+
`)}
|
|
140
|
+
|
|
141
|
+
${u.map(v=>`import * as ${v.id} from "${v.importPath}";`).join(`
|
|
142
|
+
`)}
|
|
143
|
+
|
|
144
|
+
${_.map(v=>`import * as ${v.id} from "${v.importPath}";`).join(`
|
|
145
|
+
`)}
|
|
146
|
+
|
|
147
|
+
const exportedApis = [];
|
|
148
|
+
const autoApis = [
|
|
149
|
+
${a.map(v=>`{ module: ${v.id}, path: '${v.apiPath}', importPath: '${v.clientDtsImportPath}', id: '${v.id}' }`).join(",")}
|
|
150
|
+
].reduce((acc, cur) => {
|
|
151
|
+
const module = cur.module;
|
|
152
|
+
const exported = { importPath: cur.importPath, id: cur.id, apis: [] };
|
|
153
|
+
for (const key in module) {
|
|
154
|
+
const api = module[key];
|
|
155
|
+
if (api?._soon_symbol === soonApiSymbol) {
|
|
156
|
+
const apiNew = {
|
|
157
|
+
path: cur.path + (key === 'default' ? '' : '/' + key),
|
|
158
|
+
...api,
|
|
159
|
+
}
|
|
160
|
+
exported.apis.push({ key, importName: cur.id + key, ...apiNew });
|
|
161
|
+
acc.push(apiNew);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exportedApis.push(exported);
|
|
165
|
+
|
|
166
|
+
return acc;
|
|
167
|
+
}, []);
|
|
168
|
+
const autoApisFromClient = [
|
|
169
|
+
${u.map(v=>`{ module: ${v.id} }`).join(",")}
|
|
170
|
+
].reduce((acc, cur) => {
|
|
171
|
+
const module = cur.module;
|
|
172
|
+
for (const key in module) {
|
|
173
|
+
const api = module[key];
|
|
174
|
+
if (api?._soon_symbol === soonApiSymbol) {
|
|
175
|
+
acc.push(api);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return acc;
|
|
180
|
+
}, []);
|
|
181
|
+
|
|
182
|
+
export const apis = [...autoApis, ...autoApisFromClient];
|
|
183
|
+
|
|
184
|
+
const serverDep = {
|
|
185
|
+
useApi({action}) {
|
|
186
|
+
return async function ({ body, context }) {
|
|
187
|
+
return await action(body, context);
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
service: {},
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const autoInjectServices = [];
|
|
194
|
+
const exportedServices = [];
|
|
195
|
+
const serviceFiltered = [${_.map(v=>`{ module: ${v.id}, importPath: '${v.clientDtsImportPath}', id: '${v.id}' }`).join(",")}].reduce((acc, cur) => {
|
|
196
|
+
const module = cur.module;
|
|
197
|
+
const exported = { importPath: cur.importPath, id: cur.id, services: [] };
|
|
198
|
+
const autoInjected = { importPath: cur.importPath, id: cur.id, services: [] };
|
|
199
|
+
for (const key in module) {
|
|
200
|
+
const useService = module[key];
|
|
201
|
+
if (useService?._soon_symbol === soonServiceSymbol && useService?.serviceName && useService?.autoInject) {
|
|
202
|
+
acc.push(async () => {
|
|
203
|
+
serverDep.service[useService.serviceName] = await useService();
|
|
204
|
+
});
|
|
205
|
+
autoInjected.services.push({ key, importName: cur.id + key, serviceName: useService.serviceName });
|
|
206
|
+
|
|
207
|
+
if (useService?.enableClient) {
|
|
208
|
+
exported.services.push({ key, importName: cur.id + key, serviceName: useService.serviceName });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
autoInjectServices.push(autoInjected);
|
|
213
|
+
exportedServices.push(exported);
|
|
214
|
+
|
|
215
|
+
return acc;
|
|
216
|
+
}, []);
|
|
217
|
+
|
|
218
|
+
export const middleware = defineMiddleware(async (context, next) => {
|
|
219
|
+
context.service = serverDep.service;
|
|
220
|
+
if (context.currentAPI?.tags?.includes('soon auto')) {
|
|
221
|
+
context.req.body['serverDep'] = serverDep;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
await next();
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
export const init = async () => {
|
|
228
|
+
await Promise.all(serviceFiltered.map(v => v()));
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export const baseUrl = '${(t==null?void 0:t.baseUrl)||""}';
|
|
232
|
+
|
|
233
|
+
// 生成types
|
|
234
|
+
function generate() {
|
|
235
|
+
/** client **/
|
|
236
|
+
const apisImport = exportedApis.filter(v => v.apis.length).map(v => \`import { \${v.apis.map(vv => \`\${vv.key} as \${vv.importName}\`).join(', ')} } from '\${v.importPath}';\`).join('\\n');
|
|
237
|
+
const apisType = \`
|
|
238
|
+
type apis = {
|
|
239
|
+
\` +
|
|
240
|
+
exportedApis.filter(v => v.apis.length).map(v => v.apis.map(vv => \` '\${vv.path}' : { body: z.infer<NonUndefined<typeof \${vv.importName}.bodySchema>>; action: ReturnRealType<typeof \${vv.importName}.action> };\`).join('\\n')).join('\\n')
|
|
241
|
+
+ '\\n };';
|
|
242
|
+
|
|
243
|
+
const serviecsImport = exportedServices.filter(v => v.services.length).map(v => \`import { \${v.services.map(vv => \`\${vv.key} as \${vv.importName}\`).join(', ')} } from '\${v.importPath}';\`).join('\\n');
|
|
244
|
+
const servicesContent = exportedServices.filter(v => v.services.length).map(v => v.services.map(vv => \` '\${vv.serviceName}' : ReturnRealType<typeof \${vv.importName}>;\`).join('\\n')).join('\\n');
|
|
245
|
+
const servicesType = \`
|
|
246
|
+
type services = {
|
|
247
|
+
\` + servicesContent + '\\n };';
|
|
248
|
+
|
|
249
|
+
const content = \`${xu}\`.replace('$$$apis$$$', apisImport + apisType).replace('$$$services$$$', serviecsImport + servicesType);
|
|
250
|
+
|
|
251
|
+
/** server **/
|
|
252
|
+
const autoInjectServiecsImport = autoInjectServices.filter(v => v.services.length).map(v => \`import { \${v.services.map(vv => \`\${vv.key} as \${vv.importName}\`).join(', ')} } from '\${v.importPath}';\`).join('\\n');
|
|
253
|
+
const autoInjectServicesContent = autoInjectServices.filter(v => v.services.length).map(v => v.services.map(vv => \` '\${vv.serviceName}' : ReturnRealType<typeof \${vv.importName}>;\`).join('\\n')).join('\\n');
|
|
254
|
+
const contentServerDts = \`${Tu}\`;
|
|
255
|
+
const contentServerTypes = \`${wu}\`.replace('$$$services-imports$$$', autoInjectServiecsImport).replace('$$$services-content$$$', autoInjectServicesContent);
|
|
256
|
+
|
|
257
|
+
writeFile(path.join(generatedAutoPath, 'auto-client.d.ts'), content, err => { if (err) throw err; });
|
|
258
|
+
writeFile(path.join(generatedAutoPath, 'auto-server.d.ts'), contentServerDts, err => { if (err) throw err; });
|
|
259
|
+
writeFile(path.join(generatedAutoPath, 'auto-server.types.ts'), contentServerTypes, err => { if (err) throw err; });
|
|
260
|
+
}
|
|
261
|
+
const generatedAutoPath = path.join('${r.replace(/\\/g,"/")}', 'generated/auto');
|
|
262
|
+
exists(generatedAutoPath, (exists) => {
|
|
263
|
+
if (!exists) {
|
|
264
|
+
mkdir(generatedAutoPath, { recursive: true }, (err) => {
|
|
265
|
+
if (err) throw err;
|
|
266
|
+
generate();
|
|
267
|
+
})
|
|
268
|
+
} else {
|
|
269
|
+
generate();
|
|
270
|
+
}
|
|
271
|
+
})
|
|
272
|
+
`)}}}export{Gu as vitePluginSoonServer};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonjs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "vite-node examples/index.ts",
|
|
10
|
-
"build": "vite build --ssr
|
|
10
|
+
"build": "vite build --ssr",
|
|
11
11
|
"dev-one": "vite-node --watch src/one.ts",
|
|
12
12
|
"publish": "npm run build && npm publish --registry=https://registry.npmjs.com",
|
|
13
13
|
"npm:adduser": "npm adduser --registry=https://registry.npmjs.com"
|