From 7135ba3ab89f1749eba00581e06ba0f3c1ec3f1c Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Thu, 12 Dec 2024 17:18:20 +0300 Subject: [PATCH] feat(yarn): build --- yarn/cli/dist/yarn.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yarn/cli/dist/yarn.mjs b/yarn/cli/dist/yarn.mjs index 8983715b..3b2db330 100755 --- a/yarn/cli/dist/yarn.mjs +++ b/yarn/cli/dist/yarn.mjs @@ -191,7 +191,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);x(J)}return} `),_e.end()}),_e});break;case"<&":x(()=>O7r(Number(e[ce]),zN.Readable,r));break;case">":case">>":{let _e=aj.ppath.resolve(r.cwd,aj.npath.toPortablePath(e[ce]));J(_e==="/dev/null"?new p5.Writable({autoDestroy:!0,emitClose:!0,write(me,Ee,ge){setImmediate(ge)}}):t.baseFs.createWriteStream(_e,b===">>"?{flags:"a"}:void 0))}break;case">&":J(O7r(Number(e[ce]),zN.Writable,r));break;default:throw new Error(`Assertion failed: Unsupported redirection type: "${b}"`)}}if(f.length>0){let w=new p5.PassThrough;s=w;let b=U=>{if(U===f.length)w.end();else{let x=f[U]();x.pipe(w,{end:!1}),x.on("end",()=>{b(U+1)})}};b(0)}if(A.length>0){let w=new p5.PassThrough;c=w;for(let b of A)w.pipe(b)}if(h.length>0){let w=new p5.PassThrough;o=w;for(let b of h)w.pipe(b)}let T=await(0,rB.start)(VNe(e.slice(y+1),t,r),{stdin:new rB.ProtectedStream(s),stdout:new rB.ProtectedStream(c),stderr:new rB.ProtectedStream(o)}).run();return await Promise.all(A.map(w=>new Promise((b,U)=>{w.on("error",x=>{U(x)}),w.on("close",()=>{b()}),w.end()}))),await Promise.all(h.map(w=>new Promise((b,U)=>{w.on("error",x=>{U(x)}),w.on("close",()=>{b()}),w.end()}))),T}]]);async function Als(e,t,r){let s=[],c=new p5.PassThrough;return c.on("data",o=>s.push(o)),await Lze(e,t,Fze(r,{stdout:c})),Buffer.concat(s).toString().replace(/[\r\n]+$/,"")}async function F7r(e,t,r){let s=e.map(async o=>{let f=await Uae(o.args,t,r);return{name:o.name,value:f.join(" ")}});return(await Promise.all(s)).reduce((o,f)=>(o[f.name]=f.value,o),{})}function Oze(e){return e.match(/[^ \r\n\t]+/g)||[]}async function U7r(e,t,r,s,c=s){switch(e.name){case"$":s(String(process.pid));break;case"#":s(String(t.args.length));break;case"@":if(e.quoted)for(let o of t.args)c(o);else for(let o of t.args){let f=Oze(o);for(let A=0;A=0&&o"u"&&(e.defaultValue?f=(await Uae(e.defaultValue,t,r)).join(" "):e.alternativeValue&&(f="")),typeof f>"u")throw A?new cj.ShellError(`Unbound argument #${o}`):new cj.ShellError(`Unbound variable "${e.name}"`);if(e.quoted)s(f);else{let h=Oze(f);for(let T=0;Te+t,subtraction:(e,t)=>e-t,multiplication:(e,t)=>e*t,division:(e,t)=>Math.trunc(e/t)};async function JNe(e,t,r){if(e.type==="number"){if(Number.isInteger(e.value))return e.value;throw new Error(`Invalid number: "${e.value}", only integers are allowed`)}else if(e.type==="variable"){let s=[];await U7r({...e,quoted:!0},t,r,o=>s.push(o));let c=Number(s.join(" "));return Number.isNaN(c)?JNe({type:"variable",name:s.join(" ")},t,r):JNe({type:"number",value:c},t,r)}else return hls[e.type](await JNe(e.left,t,r),await JNe(e.right,t,r))}async function Uae(e,t,r){let s=new Map,c=[],o=[],f=T=>{o.push(T)},A=()=>{o.length>0&&c.push(o.join("")),o=[]},h=T=>{f(T),A()},y=(T,w,b)=>{let U=JSON.stringify({type:T,fd:w}),x=s.get(U);typeof x>"u"&&s.set(U,x=[]),x.push(b)};for(let T of e){let w=!1;switch(T.type){case"redirection":{let b=await Uae(T.args,t,r);for(let U of b)y(T.subtype,T.fd,U)}break;case"argument":for(let b of T.segments)switch(b.type){case"text":f(b.text);break;case"glob":f(b.pattern),w=!0;break;case"shell":{let U=await Als(b.shell,t,r);if(b.quoted)f(U);else{let x=Oze(U);for(let J=0;J"u")throw new Error("Assertion failed: Expected a glob pattern to have been set");let U=await t.glob.match(b,{cwd:r.cwd,baseFs:t.baseFs});if(U.length===0){let x=Zkt.isBraceExpansion(b)?". Note: Brace expansion of arbitrary strings isn't currently supported. For more details, please read this issue: https://github.com/yarnpkg/berry/issues/22":"";throw new cj.ShellError(`No matches found: "${b}"${x}`)}for(let x of U.sort())h(x)}}if(s.size>0){let T=[];for(let[w,b]of s.entries())T.splice(T.length,0,w,String(b.length),...b);c.splice(0,0,"__ysh_set_redirects",...T,"--")}return c}function VNe(e,t,r){t.builtins.has(e[0])||(e=["command",...e]);let s=aj.npath.fromPortablePath(r.cwd),c=r.environment;typeof c.PWD<"u"&&(c={...c,PWD:s});let[o,...f]=e;if(o==="command")return(0,zkt.makeProcess)(f[0],f.slice(1),t,{cwd:s,env:c});let A=t.builtins.get(o);if(typeof A>"u")throw new Error(`Assertion failed: A builtin should exist for "${o}"`);return(0,zkt.makeBuiltin)(async({stdin:h,stdout:y,stderr:T})=>{let{stdin:w,stdout:b,stderr:U}=r;r.stdin=h,r.stdout=y,r.stderr=T;try{return await A(f,t,r)}finally{r.stdin=w,r.stdout=b,r.stderr=U}})}function mls(e,t,r){return s=>{let c=new p5.PassThrough,o=Lze(e,t,Fze(r,{stdin:c}));return{stdin:c,promise:o}}}function gls(e,t,r){return s=>{let c=new p5.PassThrough,o=Lze(e,t,r);return{stdin:c,promise:o}}}function L7r(e,t,r,s){if(t.length===0)return e;{let c;do c=String(Math.random());while(Object.hasOwn(s.procedures,c));return s.procedures={...s.procedures},s.procedures[c]=e,VNe([...t,"__ysh_run_procedure",c],r,s)}}async function Q7r(e,t,r){let s=e,c=null,o=null;for(;s;){let f=s.then?{...r}:r,A;switch(s.type){case"command":{let h=await Uae(s.args,t,r),y=await F7r(s.envs,t,r);A=s.envs.length?VNe(h,t,Fze(f,{environment:y})):VNe(h,t,f)}break;case"subshell":{let h=await Uae(s.args,t,r),y=mls(s.subshell,t,f);A=L7r(y,h,t,f)}break;case"group":{let h=await Uae(s.args,t,r),y=gls(s.group,t,f);A=L7r(y,h,t,f)}break;case"envs":{let h=await F7r(s.envs,t,r);f.environment={...f.environment,...h},A=VNe(["true"],t,f)}break}if(typeof A>"u")throw new Error("Assertion failed: An action should have been generated");if(c===null)o=(0,rB.start)(A,{stdin:new rB.ProtectedStream(f.stdin),stdout:new rB.ProtectedStream(f.stdout),stderr:new rB.ProtectedStream(f.stderr)});else{if(o===null)throw new Error("Assertion failed: The execution pipeline should have been setup");switch(c){case"|":o=o.pipeTo(A,rB.Pipe.STDOUT);break;case"|&":o=o.pipeTo(A,rB.Pipe.STDOUT|rB.Pipe.STDERR);break}}s.then?(c=s.then.type,s=s.then.chain):s=null}if(o===null)throw new Error("Assertion failed: The execution pipeline should have been setup");return await o.run()}async function Els(e,t,r,{background:s=!1}={}){function c(o){let f=["#2E86AB","#A23B72","#F18F01","#C73E1D","#CCE2A3"],A=f[o%f.length];return uls.default.hex(A)}if(s){let o=r.nextBackgroundJobIndex++,f=c(o),A=`[${o}]`,h=f(A),{stdout:y,stderr:T}=(0,zkt.createOutputStreamsWithPrefix)(r,{prefix:h});return r.backgroundJobs.push(Q7r(e,t,Fze(r,{stdout:y,stderr:T})).catch(w=>T.write(`${w.message} `)).finally(()=>{r.stdout.isTTY&&r.stdout.write(`Job ${h}, '${f((0,M7r.stringifyCommandChain)(e))}' has ended `)})),0}return await Q7r(e,t,r)}async function yls(e,t,r,{background:s=!1}={}){let c,o=A=>{c=A,r.variables["?"]=String(A)},f=async A=>{try{return await Els(A.chain,t,r,{background:s&&typeof A.then>"u"})}catch(h){if(!(h instanceof cj.ShellError))throw h;return r.stderr.write(`${h.message} -`),1}};for(o(await f(e));e.then;){if(r.exitCode!==null)return r.exitCode;switch(e.then.type){case"&&":c===0&&o(await f(e.then.line));break;case"||":c!==0&&o(await f(e.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${e.then.type}"`)}e=e.then.line}return c}async function Lze(e,t,r){let s=r.backgroundJobs;r.backgroundJobs=[];let c=0;for(let{command:o,type:f}of e){if(c=await yls(o,t,r,{background:f==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(c)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=s,c}function G7r(e){switch(e.type){case"variable":return e.name==="@"||e.name==="#"||e.name==="*"||Number.isFinite(parseInt(e.name,10))||"defaultValue"in e&&!!e.defaultValue&&e.defaultValue.some(t=>WNe(t))||"alternativeValue"in e&&!!e.alternativeValue&&e.alternativeValue.some(t=>WNe(t));case"arithmetic":return Kkt(e.arithmetic);case"shell":return $kt(e.shell);default:return!1}}function WNe(e){switch(e.type){case"redirection":return e.args.some(t=>WNe(t));case"argument":return e.segments.some(t=>G7r(t));default:throw new Error(`Assertion failed: Unsupported argument type: "${e.type}"`)}}function Kkt(e){switch(e.type){case"variable":return G7r(e);case"number":return!1;default:return Kkt(e.left)||Kkt(e.right)}}function $kt(e){return e.some(({command:t})=>{for(;t;){let r=t.chain;for(;r;){let s;switch(r.type){case"subshell":s=$kt(r.subshell);break;case"command":s=r.envs.some(c=>c.args.some(o=>WNe(o)))||r.args.some(c=>WNe(c));break}if(s)return!0;if(!r.then)break;r=r.then.chain}if(!t.then)break;t=t.then.line}return!1})}async function Cls(e,t=[],{baseFs:r=new aj.NodeFS,builtins:s={},cwd:c=aj.npath.toPortablePath(process.cwd()),env:o=process.env,stdin:f=process.stdin,stdout:A=process.stdout,stderr:h=process.stderr,variables:y={},glob:T=Zkt}={}){let w={};for(let[x,J]of Object.entries(o))typeof J<"u"&&(w[x]=J);let b=new Map(_ls);for(let[x,J]of Object.entries(s))b.set(x,J);f===null&&(f=new p5.PassThrough,f.end());let U=(0,M7r.parseShell)(e,T);if(!$kt(U)&&U.length>0&&t.length>0){let{command:x}=U[U.length-1];for(;x.then;)x=x.then.line;let J=x.chain;for(;J.then;)J=J.then.chain;J.type==="command"&&(J.args=J.args.concat(t.map(Z=>({type:"argument",segments:[{type:"text",text:Z}]}))))}return await Lze(U,{args:t,baseFs:r,builtins:b,initialStdin:f,initialStdout:A,initialStderr:h,glob:T},{cwd:c,environment:w,exitCode:null,procedures:{},stdin:f,stdout:A,stderr:h,variables:Object.assign({},y,{"?":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}});var ePt=fe((iDa,j7r)=>{function Ils(e,t){for(var r=-1,s=e==null?0:e.length,c=Array(s);++r{var H7r=Cae(),Tls=ePt(),Sls=i5(),vls=TNe(),Dls=1/0,q7r=H7r?H7r.prototype:void 0,J7r=q7r?q7r.toString:void 0;function V7r(e){if(typeof e=="string")return e;if(Sls(e))return Tls(e,V7r)+"";if(vls(e))return J7r?J7r.call(e):"";var t=e+"";return t=="0"&&1/e==-Dls?"-0":t}W7r.exports=V7r});var Qze=fe((oDa,z7r)=>{var bls=Y7r();function wls(e){return e==null?"":bls(e)}z7r.exports=wls});var tPt=fe((aDa,K7r)=>{function Bls(e,t,r){var s=-1,c=e.length;t<0&&(t=-t>c?0:c+t),r=r>c?c:r,r<0&&(r+=c),c=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(c);++s{var xls=tPt();function Nls(e,t,r){var s=e.length;return r=r===void 0?s:r,!t&&r>=s?e:xls(e,t,r)}X7r.exports=Nls});var rPt=fe((lDa,$7r)=>{var Rls="\\ud800-\\udfff",kls="\\u0300-\\u036f",Pls="\\ufe20-\\ufe2f",Ols="\\u20d0-\\u20ff",Fls=kls+Pls+Ols,Lls="\\ufe0e\\ufe0f",Qls="\\u200d",Mls=RegExp("["+Qls+Rls+Fls+Lls+"]");function Uls(e){return Mls.test(e)}$7r.exports=Uls});var t9r=fe((uDa,e9r)=>{function Gls(e){return e.split("")}e9r.exports=Gls});var l9r=fe((fDa,c9r)=>{var r9r="\\ud800-\\udfff",jls="\\u0300-\\u036f",Hls="\\ufe20-\\ufe2f",qls="\\u20d0-\\u20ff",Jls=jls+Hls+qls,Vls="\\ufe0e\\ufe0f",Wls="["+r9r+"]",nPt="["+Jls+"]",iPt="\\ud83c[\\udffb-\\udfff]",Yls="(?:"+nPt+"|"+iPt+")",n9r="[^"+r9r+"]",i9r="(?:\\ud83c[\\udde6-\\uddff]){2}",s9r="[\\ud800-\\udbff][\\udc00-\\udfff]",zls="\\u200d",o9r=Yls+"?",a9r="["+Vls+"]?",Kls="(?:"+zls+"(?:"+[n9r,i9r,s9r].join("|")+")"+a9r+o9r+")*",Xls=a9r+o9r+Kls,Zls="(?:"+[n9r+nPt+"?",nPt,i9r,s9r,Wls].join("|")+")",$ls=RegExp(iPt+"(?="+iPt+")|"+Zls+Xls,"g");function eus(e){return e.match($ls)||[]}c9r.exports=eus});var f9r=fe((pDa,u9r)=>{var tus=t9r(),rus=rPt(),nus=l9r();function ius(e){return rus(e)?nus(e):tus(e)}u9r.exports=ius});var d9r=fe((dDa,p9r)=>{var sus=Z7r(),ous=rPt(),aus=f9r(),cus=Qze();function lus(e){return function(t){t=cus(t);var r=ous(t)?aus(t):void 0,s=r?r[0]:t.charAt(0),c=r?sus(r,1).join(""):t.slice(1);return s[e]()+c}}p9r.exports=lus});var A9r=fe((_Da,_9r)=>{var uus=d9r(),fus=uus("toUpperCase");_9r.exports=fus});var sPt=fe((ADa,h9r)=>{var pus=Qze(),dus=A9r();function _us(e){return dus(pus(e).toLowerCase())}h9r.exports=_us});var m9r=fe((hDa,Mze)=>{function Aus(){var e=0,t=1,r=2,s=3,c=4,o=5,f=6,A=7,h=8,y=9,T=10,w=11,b=12,U=13,x=14,J=15,Z=16,le=17,ce=0,_e=1,me=2,Ee=3,ge=4;function Ie(k,dt){return 55296<=k.charCodeAt(dt)&&k.charCodeAt(dt)<=56319&&56320<=k.charCodeAt(dt+1)&&k.charCodeAt(dt+1)<=57343}function De(k,dt){dt===void 0&&(dt=0);var _t=k.charCodeAt(dt);if(55296<=_t&&_t<=56319&&dt=1){var It=k.charCodeAt(dt-1),lt=_t;return 55296<=It&&It<=56319?(It-55296)*1024+(lt-56320)+65536:lt}return _t}function He(k,dt,_t){var It=[k].concat(dt).concat([_t]),lt=It[It.length-2],wt=_t,Vt=It.lastIndexOf(x);if(Vt>1&&It.slice(1,Vt).every(function(tr){return tr==s})&&[s,U,le].indexOf(k)==-1)return me;var Br=It.lastIndexOf(c);if(Br>0&&It.slice(1,Br).every(function(tr){return tr==c})&&[b,c].indexOf(lt)==-1)return It.filter(function(tr){return tr==c}).length%2==1?Ee:ge;if(lt==e&&wt==t)return ce;if(lt==r||lt==e||lt==t)return wt==x&&dt.every(function(tr){return tr==s})?me:_e;if(wt==r||wt==e||wt==t)return _e;if(lt==f&&(wt==f||wt==A||wt==y||wt==T))return ce;if((lt==y||lt==A)&&(wt==A||wt==h))return ce;if((lt==T||lt==h)&&wt==h)return ce;if(wt==s||wt==J)return ce;if(wt==o)return ce;if(lt==b)return ce;var En=It.indexOf(s)!=-1?It.lastIndexOf(s)-1:It.length-2;return[U,le].indexOf(It[En])!=-1&&It.slice(En+1,-1).every(function(tr){return tr==s})&&wt==x||lt==J&&[Z,le].indexOf(wt)!=-1?ce:dt.indexOf(c)!=-1?me:lt==c&&wt==c?ce:_e}this.nextBreak=function(k,dt){if(dt===void 0&&(dt=0),dt<0)return 0;if(dt>=k.length-1)return k.length;for(var _t=Xe(De(k,dt)),It=[],lt=dt+1;lt{var hus=/^(.*?)(\x1b\[[^m]+m|\x1b\]8;;.*?(\x1b\\|\u0007))/,Uze;function mus(){if(Uze)return Uze;if(typeof Intl.Segmenter<"u"){let e=new Intl.Segmenter("en",{granularity:"grapheme"});return Uze=t=>Array.from(e.segment(t),({segment:r})=>r)}else{let e=m9r(),t=new e;return Uze=r=>t.splitGraphemes(r)}}g9r.exports=(e,t=0,r=e.length)=>{if(t<0||r<0)throw new RangeError("Negative indices aren't supported by this implementation");let s=r-t,c="",o=0,f=0;for(;e.length>0;){let A=e.match(hus)||[e,e,void 0],h=mus()(A[1]),y=Math.min(t-o,h.length);h=h.slice(y);let T=Math.min(s-f,h.length);c+=h.slice(0,T).join(""),o+=y,f+=T,typeof A[2]<"u"&&(c+=A[2]),e=e.slice(A[0].length)}return c}});var YNe=fe(Gze=>{"use strict";Object.defineProperty(Gze,"__esModule",{value:!0});Gze.YarnVersion=void 0;Gze.YarnVersion=process.env.YARN_IS_TEST_ENV?"0.0.0":"1.0.0-git.20241212.hash-a72a982a"});var zNe=fe(x4=>{"use strict";Object.defineProperty(x4,"__esModule",{value:!0});x4.StreamReport=x4.SUPPORTS_GROUPS=x4.SINGLE_LINE_CHAR=void 0;x4.formatName=cPt;x4.formatNameWithHyperlink=T9r;x4.reportOptionDeprecations=Sus;var aPt=(Qa(),pi(La)),gus=aPt.__importDefault(E9r()),oPt=aPt.__importDefault(Aae()),lj=KO(),Eus=I4(),yus=YNe(),d5=aPt.__importStar(E4());x4.SINGLE_LINE_CHAR="\xB7";var y9r=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],C9r=80,Z$=oPt.default.GITHUB_ACTIONS?{start:e=>`::group::${e} +`),1}};for(o(await f(e));e.then;){if(r.exitCode!==null)return r.exitCode;switch(e.then.type){case"&&":c===0&&o(await f(e.then.line));break;case"||":c!==0&&o(await f(e.then.line));break;default:throw new Error(`Assertion failed: Unsupported command type: "${e.then.type}"`)}e=e.then.line}return c}async function Lze(e,t,r){let s=r.backgroundJobs;r.backgroundJobs=[];let c=0;for(let{command:o,type:f}of e){if(c=await yls(o,t,r,{background:f==="&"}),r.exitCode!==null)return r.exitCode;r.variables["?"]=String(c)}return await Promise.all(r.backgroundJobs),r.backgroundJobs=s,c}function G7r(e){switch(e.type){case"variable":return e.name==="@"||e.name==="#"||e.name==="*"||Number.isFinite(parseInt(e.name,10))||"defaultValue"in e&&!!e.defaultValue&&e.defaultValue.some(t=>WNe(t))||"alternativeValue"in e&&!!e.alternativeValue&&e.alternativeValue.some(t=>WNe(t));case"arithmetic":return Kkt(e.arithmetic);case"shell":return $kt(e.shell);default:return!1}}function WNe(e){switch(e.type){case"redirection":return e.args.some(t=>WNe(t));case"argument":return e.segments.some(t=>G7r(t));default:throw new Error(`Assertion failed: Unsupported argument type: "${e.type}"`)}}function Kkt(e){switch(e.type){case"variable":return G7r(e);case"number":return!1;default:return Kkt(e.left)||Kkt(e.right)}}function $kt(e){return e.some(({command:t})=>{for(;t;){let r=t.chain;for(;r;){let s;switch(r.type){case"subshell":s=$kt(r.subshell);break;case"command":s=r.envs.some(c=>c.args.some(o=>WNe(o)))||r.args.some(c=>WNe(c));break}if(s)return!0;if(!r.then)break;r=r.then.chain}if(!t.then)break;t=t.then.line}return!1})}async function Cls(e,t=[],{baseFs:r=new aj.NodeFS,builtins:s={},cwd:c=aj.npath.toPortablePath(process.cwd()),env:o=process.env,stdin:f=process.stdin,stdout:A=process.stdout,stderr:h=process.stderr,variables:y={},glob:T=Zkt}={}){let w={};for(let[x,J]of Object.entries(o))typeof J<"u"&&(w[x]=J);let b=new Map(_ls);for(let[x,J]of Object.entries(s))b.set(x,J);f===null&&(f=new p5.PassThrough,f.end());let U=(0,M7r.parseShell)(e,T);if(!$kt(U)&&U.length>0&&t.length>0){let{command:x}=U[U.length-1];for(;x.then;)x=x.then.line;let J=x.chain;for(;J.then;)J=J.then.chain;J.type==="command"&&(J.args=J.args.concat(t.map(Z=>({type:"argument",segments:[{type:"text",text:Z}]}))))}return await Lze(U,{args:t,baseFs:r,builtins:b,initialStdin:f,initialStdout:A,initialStderr:h,glob:T},{cwd:c,environment:w,exitCode:null,procedures:{},stdin:f,stdout:A,stderr:h,variables:Object.assign({},y,{"?":0}),nextBackgroundJobIndex:1,backgroundJobs:[]})}});var ePt=fe((iDa,j7r)=>{function Ils(e,t){for(var r=-1,s=e==null?0:e.length,c=Array(s);++r{var H7r=Cae(),Tls=ePt(),Sls=i5(),vls=TNe(),Dls=1/0,q7r=H7r?H7r.prototype:void 0,J7r=q7r?q7r.toString:void 0;function V7r(e){if(typeof e=="string")return e;if(Sls(e))return Tls(e,V7r)+"";if(vls(e))return J7r?J7r.call(e):"";var t=e+"";return t=="0"&&1/e==-Dls?"-0":t}W7r.exports=V7r});var Qze=fe((oDa,z7r)=>{var bls=Y7r();function wls(e){return e==null?"":bls(e)}z7r.exports=wls});var tPt=fe((aDa,K7r)=>{function Bls(e,t,r){var s=-1,c=e.length;t<0&&(t=-t>c?0:c+t),r=r>c?c:r,r<0&&(r+=c),c=t>r?0:r-t>>>0,t>>>=0;for(var o=Array(c);++s{var xls=tPt();function Nls(e,t,r){var s=e.length;return r=r===void 0?s:r,!t&&r>=s?e:xls(e,t,r)}X7r.exports=Nls});var rPt=fe((lDa,$7r)=>{var Rls="\\ud800-\\udfff",kls="\\u0300-\\u036f",Pls="\\ufe20-\\ufe2f",Ols="\\u20d0-\\u20ff",Fls=kls+Pls+Ols,Lls="\\ufe0e\\ufe0f",Qls="\\u200d",Mls=RegExp("["+Qls+Rls+Fls+Lls+"]");function Uls(e){return Mls.test(e)}$7r.exports=Uls});var t9r=fe((uDa,e9r)=>{function Gls(e){return e.split("")}e9r.exports=Gls});var l9r=fe((fDa,c9r)=>{var r9r="\\ud800-\\udfff",jls="\\u0300-\\u036f",Hls="\\ufe20-\\ufe2f",qls="\\u20d0-\\u20ff",Jls=jls+Hls+qls,Vls="\\ufe0e\\ufe0f",Wls="["+r9r+"]",nPt="["+Jls+"]",iPt="\\ud83c[\\udffb-\\udfff]",Yls="(?:"+nPt+"|"+iPt+")",n9r="[^"+r9r+"]",i9r="(?:\\ud83c[\\udde6-\\uddff]){2}",s9r="[\\ud800-\\udbff][\\udc00-\\udfff]",zls="\\u200d",o9r=Yls+"?",a9r="["+Vls+"]?",Kls="(?:"+zls+"(?:"+[n9r,i9r,s9r].join("|")+")"+a9r+o9r+")*",Xls=a9r+o9r+Kls,Zls="(?:"+[n9r+nPt+"?",nPt,i9r,s9r,Wls].join("|")+")",$ls=RegExp(iPt+"(?="+iPt+")|"+Zls+Xls,"g");function eus(e){return e.match($ls)||[]}c9r.exports=eus});var f9r=fe((pDa,u9r)=>{var tus=t9r(),rus=rPt(),nus=l9r();function ius(e){return rus(e)?nus(e):tus(e)}u9r.exports=ius});var d9r=fe((dDa,p9r)=>{var sus=Z7r(),ous=rPt(),aus=f9r(),cus=Qze();function lus(e){return function(t){t=cus(t);var r=ous(t)?aus(t):void 0,s=r?r[0]:t.charAt(0),c=r?sus(r,1).join(""):t.slice(1);return s[e]()+c}}p9r.exports=lus});var A9r=fe((_Da,_9r)=>{var uus=d9r(),fus=uus("toUpperCase");_9r.exports=fus});var sPt=fe((ADa,h9r)=>{var pus=Qze(),dus=A9r();function _us(e){return dus(pus(e).toLowerCase())}h9r.exports=_us});var m9r=fe((hDa,Mze)=>{function Aus(){var e=0,t=1,r=2,s=3,c=4,o=5,f=6,A=7,h=8,y=9,T=10,w=11,b=12,U=13,x=14,J=15,Z=16,le=17,ce=0,_e=1,me=2,Ee=3,ge=4;function Ie(k,dt){return 55296<=k.charCodeAt(dt)&&k.charCodeAt(dt)<=56319&&56320<=k.charCodeAt(dt+1)&&k.charCodeAt(dt+1)<=57343}function De(k,dt){dt===void 0&&(dt=0);var _t=k.charCodeAt(dt);if(55296<=_t&&_t<=56319&&dt=1){var It=k.charCodeAt(dt-1),lt=_t;return 55296<=It&&It<=56319?(It-55296)*1024+(lt-56320)+65536:lt}return _t}function He(k,dt,_t){var It=[k].concat(dt).concat([_t]),lt=It[It.length-2],wt=_t,Vt=It.lastIndexOf(x);if(Vt>1&&It.slice(1,Vt).every(function(tr){return tr==s})&&[s,U,le].indexOf(k)==-1)return me;var Br=It.lastIndexOf(c);if(Br>0&&It.slice(1,Br).every(function(tr){return tr==c})&&[b,c].indexOf(lt)==-1)return It.filter(function(tr){return tr==c}).length%2==1?Ee:ge;if(lt==e&&wt==t)return ce;if(lt==r||lt==e||lt==t)return wt==x&&dt.every(function(tr){return tr==s})?me:_e;if(wt==r||wt==e||wt==t)return _e;if(lt==f&&(wt==f||wt==A||wt==y||wt==T))return ce;if((lt==y||lt==A)&&(wt==A||wt==h))return ce;if((lt==T||lt==h)&&wt==h)return ce;if(wt==s||wt==J)return ce;if(wt==o)return ce;if(lt==b)return ce;var En=It.indexOf(s)!=-1?It.lastIndexOf(s)-1:It.length-2;return[U,le].indexOf(It[En])!=-1&&It.slice(En+1,-1).every(function(tr){return tr==s})&&wt==x||lt==J&&[Z,le].indexOf(wt)!=-1?ce:dt.indexOf(c)!=-1?me:lt==c&&wt==c?ce:_e}this.nextBreak=function(k,dt){if(dt===void 0&&(dt=0),dt<0)return 0;if(dt>=k.length-1)return k.length;for(var _t=Xe(De(k,dt)),It=[],lt=dt+1;lt{var hus=/^(.*?)(\x1b\[[^m]+m|\x1b\]8;;.*?(\x1b\\|\u0007))/,Uze;function mus(){if(Uze)return Uze;if(typeof Intl.Segmenter<"u"){let e=new Intl.Segmenter("en",{granularity:"grapheme"});return Uze=t=>Array.from(e.segment(t),({segment:r})=>r)}else{let e=m9r(),t=new e;return Uze=r=>t.splitGraphemes(r)}}g9r.exports=(e,t=0,r=e.length)=>{if(t<0||r<0)throw new RangeError("Negative indices aren't supported by this implementation");let s=r-t,c="",o=0,f=0;for(;e.length>0;){let A=e.match(hus)||[e,e,void 0],h=mus()(A[1]),y=Math.min(t-o,h.length);h=h.slice(y);let T=Math.min(s-f,h.length);c+=h.slice(0,T).join(""),o+=y,f+=T,typeof A[2]<"u"&&(c+=A[2]),e=e.slice(A[0].length)}return c}});var YNe=fe(Gze=>{"use strict";Object.defineProperty(Gze,"__esModule",{value:!0});Gze.YarnVersion=void 0;Gze.YarnVersion=process.env.YARN_IS_TEST_ENV?"0.0.0":"1.0.0-git.20241212.hash-dc759874"});var zNe=fe(x4=>{"use strict";Object.defineProperty(x4,"__esModule",{value:!0});x4.StreamReport=x4.SUPPORTS_GROUPS=x4.SINGLE_LINE_CHAR=void 0;x4.formatName=cPt;x4.formatNameWithHyperlink=T9r;x4.reportOptionDeprecations=Sus;var aPt=(Qa(),pi(La)),gus=aPt.__importDefault(E9r()),oPt=aPt.__importDefault(Aae()),lj=KO(),Eus=I4(),yus=YNe(),d5=aPt.__importStar(E4());x4.SINGLE_LINE_CHAR="\xB7";var y9r=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],C9r=80,Z$=oPt.default.GITHUB_ACTIONS?{start:e=>`::group::${e} `,end:e=>`::endgroup:: `}:oPt.default.TRAVIS?{start:e=>`travis_fold:start:${e} `,end:e=>`travis_fold:end:${e} @@ -1514,7 +1514,7 @@ ${x[1]} `,Oms(b,x.join("[//]: # (VERSIONS)")),f.end()})})).exitCode()}};var lVr={commands:[FRe]};var mLt={};Tm(mLt,{CheckCommand:()=>LRe,default:()=>fVr});var uVr=Yt(Pl(),1),LRe=class extends uVr.BaseCommand{static paths=[["check"]];async execute(){await this.cli.run(["format"]),await this.cli.run(["typecheck"]),await this.cli.run(["lint"])}};var fVr={commands:[LRe]};var S7t={};Tm(S7t,{ChecksLintCommand:()=>BOe,ChecksTestIntegrationCommand:()=>ROe,ChecksTestUnitCommand:()=>kOe,ChecksTypeCheckCommand:()=>FOe,default:()=>i_n});var qpn=Yt(Pl(),1),Jpn=Yt(On(),1),e7t=Yt(On(),1),Vpn=Yt(On(),1),t7t=Yt(On(),1),r7t=Yt(oa(),1),Wpn=Yt(qXe(),1),Ypn=Yt(On(),1),zpn=Yt(On(),1),Kpn=Yt(oa(),1),Xpn=Yt(Ls(),1);import{readFileSync as r9s}from"node:fs";var i3t=Yt(Rc(),1),Cee=Yt(Rc(),1),rR=Yt(Ls(),1);var t3t=Yt(Rc(),1),r3t=Yt(Ls(),1),G4=({children:e,line:t=0,column:r=0})=>r3t.default.createElement(t3t.Text,{color:"cyan"},e,r3t.default.createElement(t3t.Text,{color:"yellow"},":",t,":",r));var sKr=Yt(Rc(),1),oKr=Yt(Ls(),1),yx=({offset:e=0})=>oKr.default.createElement(sKr.Text,{color:"gray"},Array.from({length:process.stdout.columns-e},()=>"\u2500").join(""));var lKr=Yt(qXe(),1),uKr=Yt(Rc(),1);import n3t from"node:process";import _1s from"node:os";import aKr from"node:tty";function j4(e,t=globalThis.Deno?globalThis.Deno.args:n3t.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",s=t.indexOf(r+e),c=t.indexOf("--");return s!==-1&&(c===-1||s=2,has16m:e>=3}}function m1s(e,{streamIsTTY:t,sniffFlags:r=!0}={}){let s=A1s();s!==void 0&&(bZe=s);let c=r?bZe:s;if(c===0)return 0;if(r){if(j4("color=16m")||j4("color=full")||j4("color=truecolor"))return 3;if(j4("color=256"))return 2}if("TF_BUILD"in lS&&"AGENT_NAME"in lS)return 1;if(e&&!t&&c===void 0)return 0;let o=c||0;if(lS.TERM==="dumb")return o;if(n3t.platform==="win32"){let f=_1s.release().split(".");return Number(f[0])>=10&&Number(f[2])>=10586?Number(f[2])>=14931?3:2:1}if("CI"in lS)return"GITHUB_ACTIONS"in lS||"GITEA_ACTIONS"in lS?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(f=>f in lS)||lS.CI_NAME==="codeship"?1:o;if("TEAMCITY_VERSION"in lS)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(lS.TEAMCITY_VERSION)?1:0;if(lS.COLORTERM==="truecolor"||lS.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in lS){let f=Number.parseInt((lS.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(lS.TERM_PROGRAM){case"iTerm.app":return f>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(lS.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(lS.TERM)||"COLORTERM"in lS?1:o}function wZe(e,t={}){let r=m1s(e,{streamIsTTY:e&&e.isTTY,...t});return h1s(r)}var Vxa={stdout:wZe({isTTY:aKr.isatty(1)}),stderr:wZe({isTTY:aKr.isatty(2)})};var fKr=Yt(Ls(),1),{level:g1s}=wZe({isTTY:!0})||{level:0},cKr=g1s>=1,E1s=(e,t,r,s)=>(0,lKr.codeFrameColumns)(e,{start:{column:r,line:t}},{highlightCode:cKr,forceColor:cKr,message:s}),H4=({children:e,line:t,column:r,message:s})=>fKr.default.createElement(uKr.Text,null,E1s(e,t,r,s));var pKr=({filePath:e,message:t,source:r})=>rR.default.createElement(Cee.Box,{flexDirection:"column",borderStyle:"round",borderColor:"gray",width:"100%"},rR.default.createElement(Cee.Box,{marginBottom:1,marginTop:1,marginX:2},rR.default.createElement(Cee.Box,{flexDirection:"row",flexGrow:1},rR.default.createElement(G4,{line:t.line,column:t.column},e)),rR.default.createElement(Cee.Box,null,rR.default.createElement(i3t.Text,{color:"gray"}," ",t.ruleId))),rR.default.createElement(Cee.Box,null,rR.default.createElement(yx,{offset:2})),!!r&&rR.default.createElement(rR.default.Fragment,null,rR.default.createElement(Cee.Box,{marginBottom:1},rR.default.createElement(H4,{line:t.line,column:t.column},r)),rR.default.createElement(yx,{offset:2})),rR.default.createElement(Cee.Box,{marginBottom:1,marginTop:1,marginX:2},rR.default.createElement(i3t.Text,{color:"white"}," ",t.message)));var AKr=Yt(Rc(),1);import{isAbsolute as I1s}from"node:path";import{relative as T1s}from"node:path";import{webcrypto as _Kr}from"node:crypto";var dKr="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var y1s=128,Ace,B0e;function C1s(e){!Ace||Ace.lengthAce.length&&(_Kr.getRandomValues(Ace),B0e=0),B0e+=e}function LQ(e=21){C1s(e-=0);let t="";for(let r=B0e-e;r{let c=(0,hKr.useMemo)(()=>I1s(e)?T1s(s,e):e,[e]);return r.length===0?null:s3t.default.createElement(AKr.Box,{flexDirection:"column",width:"100%"},r.map(o=>s3t.default.createElement(pKr,{key:LQ(),filePath:c,message:o,source:t})))};import iCs from"node:events";import{readFileSync as sCs}from"node:fs";import{readFile as oCs}from"node:fs/promises";import{writeFile as aCs}from"node:fs/promises";import{relative as cCs}from"node:path";import{join as lCs}from"node:path";var GKr=Yt(gxt(),1),Pke=Yt(fge(),1),kke=Yt(SKr(),1);import z1s from"node:fs";import K1s from"node:path";var A3t=Yt(fge(),1),PKr=Yt(xZe(),1);import J1s from"node:process";import kKr from"node:fs";import N0e from"node:path";function x0e(e){let t=/^\\\\\?\\/.test(e),r=/[^\u0000-\u0080]+/.test(e);return t||r?e:e.replace(/\\/g,"/")}import{fileURLToPath as H1s}from"node:url";import{Transform as q1s}from"node:stream";var Rke=e=>e instanceof URL?H1s(e):e,NZe=class extends q1s{constructor(t){super({objectMode:!0,transform(r,s,c){c(void 0,t(r)?r:void 0)}})}},RZe=e=>e[0]==="!";var OKr={ignore:["**/node_modules","**/flow-typed","**/coverage","**/.git"],absolute:!0,dot:!0},FKr="**/.gitignore",V1s=(e,t)=>RZe(e)?"!"+N0e.posix.join(t,e.slice(1)):N0e.posix.join(t,e),W1s=(e,t)=>{let r=x0e(N0e.relative(t,N0e.dirname(e.filePath)));return e.content.split(/\r?\n/).filter(s=>s&&!s.startsWith("#")).map(s=>V1s(s,r))},Y1s=(e,t)=>{if(t=x0e(t),N0e.isAbsolute(e)){if(x0e(e).startsWith(t))return N0e.relative(t,e);throw new Error(`Path ${e} is not in cwd ${t}`)}return e},LKr=(e,t)=>{let r=e.flatMap(c=>W1s(c,t)),s=(0,PKr.default)().add(r);return c=>(c=Rke(c),c=Y1s(c,t),c?s.ignores(x0e(c)):!1)},QKr=(e={})=>({cwd:Rke(e.cwd)||J1s.cwd(),suppressErrors:!!e.suppressErrors,deep:typeof e.deep=="number"?e.deep:Number.POSITIVE_INFINITY}),MKr=async(e,t)=>{let{cwd:r,suppressErrors:s,deep:c}=QKr(t),o=await(0,A3t.default)(e,{cwd:r,suppressErrors:s,deep:c,...OKr}),f=await Promise.all(o.map(async A=>({filePath:A,content:await kKr.promises.readFile(A,"utf8")})));return LKr(f,r)},UKr=(e,t)=>{let{cwd:r,suppressErrors:s,deep:c}=QKr(t),f=A3t.default.sync(e,{cwd:r,suppressErrors:s,deep:c,...OKr}).map(A=>({filePath:A,content:kKr.readFileSync(A,"utf8")}));return LKr(f,r)};var X1s=e=>{if(e.some(t=>typeof t!="string"))throw new TypeError("Patterns must be a string or an array of strings")},h3t=e=>(e=[...new Set([e].flat())],X1s(e),e),Z1s=e=>{if(!e.cwd)return;let t;try{t=z1s.statSync(e.cwd)}catch{return}if(!t.isDirectory())throw new Error("The `cwd` option must be a path to a directory")},jKr=(e={})=>(e={...e,ignore:e.ignore||[],expandDirectories:e.expandDirectories===void 0?!0:e.expandDirectories,cwd:Rke(e.cwd)},Z1s(e),e),HKr=e=>async(t,r)=>e(h3t(t),jKr(r)),kZe=e=>(t,r)=>e(h3t(t),jKr(r)),qKr=e=>{let{ignoreFiles:t,gitignore:r}=e,s=t?h3t(t):[];return r&&s.push(FKr),s},$1s=async e=>{let t=qKr(e);return VKr(t.length>0&&await MKr(t,e))},JKr=e=>{let t=qKr(e);return VKr(t.length>0&&UKr(t,e))},VKr=e=>{let t=new Set;return r=>{let s=r.path||r,c=K1s.normalize(s),o=t.has(c)||e&&e(s);return t.add(c),!o}},WKr=(e,t)=>e.flat().filter(r=>t(r)),eCs=(e,t)=>(0,GKr.default)(e).pipe(new NZe(r=>t(r))),YKr=(e,t)=>{let r=[];for(;e.length>0;){let s=e.findIndex(o=>RZe(o));if(s===-1){r.push({patterns:e,options:t});break}let c=e[s].slice(1);for(let o of r)o.options.ignore.push(c);s!==0&&r.push({patterns:e.slice(0,s),options:{...t,ignore:[...t.ignore,c]}}),e=e.slice(s+1)}return r},zKr=(e,t)=>({...t?{cwd:t}:{},...Array.isArray(e)?{files:e}:e}),KKr=async(e,t)=>{let r=YKr(e,t),{cwd:s,expandDirectories:c}=t;if(!c)return r;let o=zKr(c,s),f=s?{cwd:s}:void 0;return Promise.all(r.map(async A=>{let{patterns:h,options:y}=A;return[h,y.ignore]=await Promise.all([(0,kke.default)(h,o),(0,kke.default)(y.ignore,f)]),{patterns:h,options:y}}))},m3t=(e,t)=>{let r=YKr(e,t),{cwd:s,expandDirectories:c}=t;if(!c)return r;let o=zKr(c,s),f=s?{cwd:s}:void 0;return r.map(A=>{let{patterns:h,options:y}=A;return h=kke.default.sync(h,o),y.ignore=kke.default.sync(y.ignore,f),{patterns:h,options:y}})},kW=HKr(async(e,t)=>{let[r,s]=await Promise.all([KKr(e,t),$1s(t)]),c=await Promise.all(r.map(o=>(0,Pke.default)(o.patterns,o.options)));return WKr(c,s)}),XKr=kZe((e,t)=>{let r=m3t(e,t),s=JKr(t),c=r.map(o=>Pke.default.sync(o.patterns,o.options));return WKr(c,s)}),kNa=kZe((e,t)=>{let r=m3t(e,t),s=JKr(t),c=r.map(o=>Pke.default.stream(o.patterns,o.options));return eCs(c,s)}),PNa=kZe((e,t)=>e.some(r=>Pke.default.isDynamicPattern(r,t))),ONa=HKr(KKr),FNa=kZe(m3t);var eXr=Yt(xZe(),1);import{join as tCs}from"node:path";var ZKr=[".c9",".pnp.js",".pnp.cjs",".pnp.loader.mjs",".pnp-ts.loader.mjs",".git","node_modules","coverage","bundles","dist","gen","lib",".yarn",".vscode",".next","**/**/dist/*","**/**/lib/*","**/**/build/*","**/**/.cache/*","**/**/bundles/*","**/**/templates/*.yaml","**/templates/*.yaml","**/types/**",".terraform",".idea","yarn.mjs"],rCs=["./**/*.{js,mjs,cjs,jsx,ts,tsx}"],nCs=["!**/node_modules/**","!./node_modules/**","!**/.{git,svn,hg}/**","!./.{git,svn,hg}/**","!**/.yarn/**","!./.yarn/**","!**/gen/**","!**/.idea/**"],$Kr=e=>[...rCs.map(t=>tCs(e,t)),...nCs];var g3t=(e,t,r)=>({filePath:e,source:t,messages:r,fixableErrorCount:0,fixableWarningCount:0,usedDeprecatedRules:[],suppressedMessages:[],errorCount:r.filter(s=>s.severity===1).length,fatalErrorCount:r.filter(s=>s.fatal).length,warningCount:r.filter(s=>s.severity===2).length});var R0e=class e extends iCs{constructor(r,s,c){super();this.linter=r;this.config=s;this.cwd=c;this.ignore=eXr.default.default().add(ZKr).add(this.getProjectIgnorePatterns())}ignore;static async initialize(r,s){let{Linter:c}=await import("@atls/code-runtime/eslint"),{eslintconfig:o}=await import("@atls/code-runtime/eslint"),f=new c({configType:"flat"}),A=o.map(h=>({...h,languageOptions:{...h.languageOptions||{},parserOptions:{...h.languageOptions?.parserOptions||{},tsconfigRootDir:r}}}));return new e(f,A,s)}async lintFile(r,s){let c=await oCs(r,"utf8");if(s?.fix){let{messages:o,fixed:f,output:A}=this.linter.verifyAndFix(c,this.config,{filename:r});return f&&await aCs(r,A,"utf8"),g3t(r,A,o)}return g3t(r,c,this.linter.verify(c,this.config,{filename:r}))}async lintFiles(r=[],s){let c=[];this.emit("start",{files:r});for await(let o of r){this.emit("lint:start",{file:o});let f=await this.lintFile(o,s);c.push(f),this.emit("lint:end",{result:f})}return this.emit("end",{results:c}),c}async lint(r,s){let c=r&&r.length>0?r:await kW($Kr(this.cwd),{dot:!0});return this.lintFiles(c.filter(o=>this.ignore.filter([cCs(this.cwd,o)]).length!==0),s)}getProjectIgnorePatterns(){let r=sCs(lCs(this.cwd,"package.json"),"utf-8"),{linterIgnorePatterns:s=[]}=JSON.parse(r);return s}};var tXr=Yt(Rc(),1);import{EventEmitter as uCs}from"node:events";var PZe=class extends uCs{frames=[];get columns(){return process.stdout.columns||160}write=t=>{this.frames.push(t)}},u1=e=>{let t=new PZe,r=new PZe,{cleanup:s}=(0,tXr.render)(e,{stdout:t,stderr:r,debug:!0,exitOnCtrlC:!1,patchConsole:!1});return s(),[...t.frames,...r.frames].join(` `)};var Hpn=Yt(mye(),1),cle=Yt(mye(),1);var a6=class{constructor(t){this.name=t;if(process.env.GITHUB_TOKEN==null)throw new Error("GITHUB_TOKEN is not defined");this.octokit=(0,Hpn.getOctokit)(process.env.GITHUB_TOKEN)}octokit;async create(t){return(await this.octokit.rest.checks.create(t)).data}async start(){let{payload:t}=cle.context;return this.create({...cle.context.repo,name:this.name,head_sha:t.after||t.pull_request?.head.sha||process.env.GITHUB_SHA,started_at:new Date().toISOString(),status:"in_progress"})}async complete(t,r){let{payload:s}=cle.context;return this.create({...cle.context.repo,check_run_id:t,name:this.name,head_sha:s.after||s.pull_request?.head.sha||process.env.GITHUB_SHA,completed_at:new Date().toISOString(),status:"completed",conclusion:r.annotations.length>0?"failure":"success",output:r.annotations?.length>50?{...r,annotations:r.annotations.slice(0,50)}:r})}async failure(t){let{payload:r}=cle.context;return this.create({...cle.context.repo,name:this.name,head_sha:r.after||r.pull_request?.head.sha||process.env.GITHUB_SHA,completed_at:new Date().toISOString(),status:"completed",conclusion:"failure",output:t.annotations&&t.annotations.length>50?{...t,annotations:t.annotations.slice(0,50)}:t})}};var BOe=class extends qpn.BaseCommand{static paths=[["checks","lint"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(r7t.Filename.pnpCjs)&&t.includes(r7t.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await e7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await t7t.Project.find(t,this.context.cwd),s=await Kpn.xfs.mktempPromise(),{code:c}=await Ypn.execUtils.pipevp("yarn",["checks","lint"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await zpn.scriptUtils.makeScriptEnv({binFolder:s,project:r})});return c}async executeRegular(){let t=await e7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await t7t.Project.find(t,this.context.cwd);return(await Jpn.StreamReport.start({stdout:this.context.stdout,configuration:t},async c=>{let o=new a6("Lint"),{id:f}=await o.start();await c.startTimerPromise("Lint",async()=>{try{let h=await(await R0e.initialize(r.cwd,this.context.cwd)).lint();h.filter(b=>b.messages.length>0).forEach(b=>{u1(Xpn.default.createElement(mKr,{...b})).split(` -`).forEach(x=>{c.reportInfo(Vpn.MessageName.UNNAMED,x)})});let y=this.formatResults(h,r.cwd),T=y.filter(b=>b.annotation_level==="warning").length,w=y.filter(b=>b.annotation_level==="failure").length;await o.complete(f,{title:y.length>0?`Errors ${w}, Warnings ${T}`:"Successful",summary:y.length>0?`Found ${w} errors and ${T} warnings`:"All checks passed",annotations:y})}catch(A){await o.failure({title:"Lint run failed",summary:A instanceof Error?A.message:A})}})})).exitCode()}getAnnotationLevel(t){return t===1?"warning":"failure"}formatResults(t,r){return t.filter(s=>s.messages?.length>0).map(({filePath:s,messages:c=[]})=>c.map(o=>{let f=(o.line||0)+1;return{path:r?s.substring(r.length+1):s,start_line:f,end_line:f,annotation_level:this.getAnnotationLevel(o.severity),raw_details:(0,Wpn.codeFrameColumns)(r9s(s).toString(),{start:{line:o.line||0,column:o.column||0}},{highlightCode:!1}),title:`(${o.ruleId||"unknown"}): ${o.message}`,message:o.message}})).flat()}};var _dn=Yt(Pl(),1),a7t=Yt(On(),1),c7t=Yt(On(),1),l7t=Yt(oa(),1),Adn=Yt(On(),1),hdn=Yt(On(),1),mdn=Yt(oa(),1),gdn=Yt(oa(),1);xOe();var o7t={};Tm(o7t,{FilesChangedListCommand:()=>NOe,default:()=>ldn,getChangedCommmits:()=>rdn,getChangedFiles:()=>aY,getCommitData:()=>tdn,getEventCommmits:()=>edn,getGithubChangedFiles:()=>ndn});var idn=Yt(Pl(),1),sdn=Yt(Pl(),1),odn=Yt(On(),1),adn=Yt(On(),1),cdn=Yt(On(),1);Fl();var oY=Yt(mye(),1),s7t=Yt(mye(),1),$pn=Yt(On(),1),edn=async()=>{if(oY.context.eventName==="push")return oY.context.payload.commits;if(oY.context.eventName==="pull_request"&&oY.context.payload.pull_request){let e=oY.context.payload.pull_request.commits_url;return(0,s7t.getOctokit)(process.env.GITHUB_TOKEN).paginate(`GET ${e}`,oY.context.repo)}return console.log(`Unknown event "${oY.context.eventName}". Only "push" and "pull_request" supported.`),[]},tdn=async e=>await(0,s7t.getOctokit)(process.env.GITHUB_TOKEN).rest.repos.getCommit({...oY.context.repo,ref:e}),rdn=async()=>{let e=await edn();return Promise.all(e.map(async t=>tdn(t.id||t.sha)))},ndn=async()=>(await rdn()).map(t=>t?.data?.files?t.data.files.map(r=>r.filename).filter(Boolean):[]).flat(),aY=async(e,t)=>{if(process.env.GITHUB_EVENT_PATH&&process.env.GITHUB_TOKEN)return ndn();let{stdout:r}=await $pn.execUtils.execvp("git",["diff","--name-only",...t?[t]:[]],{cwd:e.cwd,strict:!0});return r.split(/\r?\n/).filter(Boolean)};var NOe=class extends idn.BaseCommand{static paths=[["files","changed","list"]];json=Gd.Boolean("--json",!1);async execute(){let t=await odn.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:s}=await adn.Project.find(t,this.context.cwd);if(!s)throw new sdn.WorkspaceRequiredError(r.cwd,this.context.cwd);return(await cdn.StreamReport.start({configuration:t,json:this.json,stdout:this.context.stdout},async o=>{let f=await aY(r);for(let A of f)o.reportInfo(null,A),o.reportJson({location:A})})).exitCode()}};var ldn={commands:[NOe]};var udn=Yt(On(),1),fdn=e=>{let{project:t}=e,r=new Set,s=({manifest:c})=>{for(let o of udn.Manifest.hardDependencies)for(let f of c.getForScope(o).values()){let A=t.tryWorkspaceByDescriptor(f);A&&!r.has(A)&&(r.add(A),s(A))}};return s(e),[...r]};var pdn=Yt(On(),1);var ddn=e=>{let t=new Set;for(let r of e.project.workspaces)fdn(r).some(c=>pdn.structUtils.areLocatorsEqual(c.anchoredLocator,e.anchoredLocator))&&t.add(r);return[...t]};var gye=(e,t)=>{let r=new Set;for(let s of e.workspaces)if(t.some(o=>o.startsWith(s.relativeCwd))&&!r.has(s)){r.add(s);for(let o of ddn(s))r.add(o)}return[...r]};var brt=class extends _dn.BaseCommand{static paths=[["checks","release"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(l7t.Filename.pnpCjs)&&t.includes(l7t.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await a7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await c7t.Project.find(t,this.context.cwd),s=await gdn.xfs.mktempPromise(),{code:c}=await Adn.execUtils.pipevp("yarn",["checks","release"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await hdn.scriptUtils.makeScriptEnv({binFolder:s,project:r})});return c}async executeRegular(){let{project:t}=await c7t.Project.find(await a7t.Configuration.find(this.context.cwd,this.context.plugins),this.context.cwd),r=gye(t,await aY(t)),s=new a6("Release"),{id:c}=await s.start();try{let o=[];for await(let f of r)if(f.manifest.scripts.get("build")){let A=new RXe,h=T=>this.context.stdout.write(T);A.stdout.on("data",h),A.stderr.on("data",h);let y=await this.cli.run(["workspace",f.manifest.raw.name,"build"],A);y>0&&o.push({annotation_level:"failure",title:`Error release workspace ${f.manifest.raw.name??f.relativeCwd}`,message:`Exit code ${y}`,raw_details:sY(A.output),path:mdn.ppath.join(f.relativeCwd,"package.json"),start_line:1,end_line:1}),A.stdout.off("data",h),A.stderr.off("data",h)}await s.complete(c,{title:o.length>0?`Errors ${o.length}`:"Successful",summary:o.length>0?`Found ${o.length} errors`:"All checks passed",annotations:o})}catch(o){await s.failure({title:"Release run failed",summary:o instanceof Error?o.message:o})}return 0}};var Edn=Yt(Pl(),1),ydn=Yt(On(),1),Cdn=Yt(On(),1),Idn=Yt(On(),1),Tdn=Yt(On(),1),Sdn=Yt(On(),1),wrt=class extends Edn.BaseCommand{static paths=[["checks","run"]];async execute(){let t=await Cdn.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await Tdn.Project.find(t,this.context.cwd);return(await ydn.StreamReport.start({stdout:this.context.stdout,configuration:t},async c=>{await Promise.all([this.runCheck(r.cwd,["lint"],c),this.runCheck(r.cwd,["typecheck"],c),this.runCheck(r.cwd,["test","unit"],c),this.runCheck(r.cwd,["test","integration"],c)]),await this.runCheck(r.cwd,["release"],c)})).exitCode()}async runCheck(t,r,s){try{let{stdout:c,stderr:o}=await Sdn.execUtils.execvp("yarn",["checks",...r],{cwd:t});this.context.stdout.write(c||o)}catch(c){s.reportError(Idn.MessageName.UNNAMED,`Run check ${r.join(" ")} error: ${c instanceof Error?c.message:c}`)}}};var Ddn=Yt(On(),1),u7t=Yt(On(),1),f7t=Yt(On(),1),xrt=Yt(oa(),1),bdn=Yt(On(),1),wdn=Yt(On(),1),Bdn=Yt(oa(),1),xdn=Yt(oa(),1),Ndn=Yt(oa(),1);import{pathToFileURL as c9s}from"node:url";import s9s from"node:events";import{run as o9s}from"node:test";import{readFile as i9s}from"node:fs/promises";var Brt=class{static async load(t){return Promise.all(t.map(async r=>{let s=await i9s(r,"utf8");return{file:r,source:s,tests:s.match(/test\(/gm)?.length||0}}))}};var Zee=class e extends s9s{constructor(){super()}static async initialize(){return new e}async collectTestFiles(t,r,s){let c=r==="unit"?"!(integration)":"integration";return!s||s.length<1?await kW([`**/${c}/*.test.{ts,tsx,js,jsx}`],{cwd:t,dot:!0,absolute:!0,ignore:["**/node_modules/**","**/dist/**","**/.yarn/**"]}):await kW(s.map(o=>this.isFilename(o)?`**/${c}/*${o}*.test.{ts,tsx,js,jsx}`:this.isRootPath(o)?o:`**/${o}`),{cwd:t,dot:!0,absolute:!0,ignore:["**/node_modules/**","**/dist/**","**/.yarn/**"]})}isFilename(t){let r=t.includes("/")||t.includes("\\"),s=/\.(js|jsx|ts|tsx)$/.test(t);return!r&&!s}isRootPath(t){return t.startsWith("/")||t.startsWith("\\")}async unit(t,r){let s=await this.collectTestFiles(t,"unit",r?.files);return this.run(s,25e3,!0,r?.watch??!1)}async integration(t,r){let s=await this.collectTestFiles(t,"integration",r?.files);return this.run(s,24e4,!1,r?.watch??!1)}async run(t,r,s,c){let o=await Brt.load(t);this.emit("start",{tests:o});let f=o9s({files:t,timeout:r,concurrency:s,watch:c}),A=w=>{this.emit("test:pass",w)},h=w=>{this.emit("test:fail",w)},y=w=>{this.emit("test:stdout",w)},T=w=>{this.emit("test:stderr",w)};f.on("test:pass",A),f.on("test:fail",h),f.on("test:stdout",y),f.on("test:stderr",T);try{return await f.toArray()}finally{this.emit("end"),f.off("test:pass",A),f.off("test:fail",h),f.off("test:stdout",y),f.off("test:stderr",T)}}};var vdn=Yt(Pl(),1);import{relative as a9s}from"node:path";var Eye=class extends vdn.BaseCommand{formatResults(t,r){return t.map(s=>({path:s.file?a9s(r,s.file):r,start_line:s.column??1,end_line:s.column??1,annotation_level:"failure",raw_details:s.details.error.stack||s.details.error.message,title:s.details.error.message,message:s.details.error.message}))}};var ROe=class extends Eye{static paths=[["checks","test","integration"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(xrt.Filename.pnpCjs)&&t.includes(xrt.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await u7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await f7t.Project.find(t,this.context.cwd),s=await Bdn.xfs.mktempPromise(),c=await wdn.scriptUtils.makeScriptEnv({binFolder:s,project:r});c.NODE_OPTIONS?.includes("@atls/code-runtime/ts-node-register")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-node-register`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader ${c9s(Ndn.npath.fromPortablePath(xdn.ppath.join(r.cwd,xrt.Filename.pnpEsmLoader))).href}`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-ext-register`),c.NODE_OPTIONS?.includes("--enable-source-maps")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --enable-source-maps`);let{code:o}=await bdn.execUtils.pipevp("yarn",["checks","test","integration"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:c});return o}async executeRegular(){let t=await u7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await f7t.Project.find(t,this.context.cwd);return(await Ddn.StreamReport.start({stdout:this.context.stdout,configuration:t},async()=>{let c=new a6("Test:Integration"),{id:o}=await c.start();try{let A=await(await Zee.initialize()).integration(r.cwd),h=this.formatResults(A.filter(y=>y.type==="test:fail").map(y=>y.data),r.cwd);await c.complete(o,{title:h.length>0?`Errors ${h.length}`:"Successful",summary:h.length>0?`Found ${h.length} errors`:"All checks passed",annotations:h})}catch(f){await c.failure({title:"Test:Integration run failed",summary:f instanceof Error?f.message:f})}})).exitCode()}};var Rdn=Yt(On(),1),p7t=Yt(On(),1),d7t=Yt(On(),1),Nrt=Yt(oa(),1),kdn=Yt(On(),1),Pdn=Yt(On(),1),Odn=Yt(oa(),1),Fdn=Yt(oa(),1),Ldn=Yt(oa(),1);import{pathToFileURL as l9s}from"node:url";var kOe=class extends Eye{static paths=[["checks","test","unit"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(Nrt.Filename.pnpCjs)&&t.includes(Nrt.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await p7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await d7t.Project.find(t,this.context.cwd),s=await Odn.xfs.mktempPromise(),c=await Pdn.scriptUtils.makeScriptEnv({binFolder:s,project:r});c.NODE_OPTIONS?.includes("@atls/code-runtime/ts-node-register")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-node-register`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader ${l9s(Ldn.npath.fromPortablePath(Fdn.ppath.join(r.cwd,Nrt.Filename.pnpEsmLoader))).href}`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-ext-register`),c.NODE_OPTIONS?.includes("--enable-source-maps")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --enable-source-maps`);let{code:o}=await kdn.execUtils.pipevp("yarn",["checks","test","unit"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:c});return o}async executeRegular(){let t=await p7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await d7t.Project.find(t,this.context.cwd);return(await Rdn.StreamReport.start({stdout:this.context.stdout,configuration:t},async()=>{let c=new a6("Test:Unit"),{id:o}=await c.start();try{let A=await(await Zee.initialize()).unit(r.cwd),h=this.formatResults(A.filter(y=>y.type==="test:fail").map(y=>y.data),r.cwd);await c.complete(o,{title:h.length>0?`Errors ${h.length}`:"Successful",summary:h.length>0?`Found ${h.length} errors`:"All checks passed",annotations:h})}catch(f){await c.failure({title:"Test:Unit run failed",summary:f instanceof Error?f.message:f})}})).exitCode()}};var Xdn=Yt(Pl(),1),C7t=Yt(On(),1),I7t=Yt(On(),1),Zdn=Yt(On(),1),$dn=Yt(On(),1),T7t=Yt(oa(),1),e_n=Yt(qXe(),1),t_n=Yt(On(),1),r_n=Yt(On(),1),POe=Yt(oa(),1),OOe=Yt(oa(),1),Frt=Yt(Prt(),1),n_n=Yt(Ls(),1);import{EOL as Ort}from"node:os";var E7t=Yt(Rc(),1),lle=Yt(Rc(),1),y7t=Yt(Ls(),1),Vdn=Yt(Prt(),1),pP=Yt(Ls(),1);import{isAbsolute as u9s}from"node:path";import{relative as f9s}from"node:path";var Wdn=({messageText:e,start:t,file:r,code:s,cwd:c=process.cwd()})=>{let o=(0,y7t.useMemo)(()=>r?u9s(r.fileName)?f9s(c,r.fileName):r.fileName:null,[r]),f=(0,y7t.useMemo)(()=>r&&t?r.getLineAndCharacterOfPosition(t):null,[r,t]);return pP.default.createElement(lle.Box,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingY:1,width:"100%"},!!o&&pP.default.createElement(lle.Box,{flexDirection:"row"},pP.default.createElement(lle.Box,{marginBottom:1,paddingX:2,flexGrow:1},pP.default.createElement(G4,{line:f?f.line+1:1,column:f?.character},o)),pP.default.createElement(lle.Box,{paddingX:2},pP.default.createElement(E7t.Text,{bold:!0,color:"red"},"TS",s))),pP.default.createElement(yx,{offset:2}),!!r?.text&&!!f&&pP.default.createElement(pP.default.Fragment,null,pP.default.createElement(lle.Box,null,pP.default.createElement(H4,{line:f.line+1,column:f.character},r.text)),pP.default.createElement(yx,{offset:2})),pP.default.createElement(lle.Box,{marginTop:1,paddingX:2},pP.default.createElement(E7t.Text,{color:"white"},(0,Vdn.flattenDiagnosticMessageText)(e,` +`).forEach(x=>{c.reportInfo(Vpn.MessageName.UNNAMED,x)})});let y=this.formatResults(h,r.cwd),T=y.filter(b=>b.annotation_level==="warning").length,w=y.filter(b=>b.annotation_level==="failure").length;await o.complete(f,{title:y.length>0?`Errors ${w}, Warnings ${T}`:"Successful",summary:y.length>0?`Found ${w} errors and ${T} warnings`:"All checks passed",annotations:y})}catch(A){await o.failure({title:"Lint run failed",summary:A instanceof Error?A.message:A})}})})).exitCode()}getAnnotationLevel(t){return t===1?"warning":"failure"}formatResults(t,r){return t.filter(s=>s.messages?.length>0).map(({filePath:s,messages:c=[]})=>c.map(o=>{let f=(o.line||0)+1;return{path:r?s.substring(r.length+1):s,start_line:f,end_line:f,annotation_level:this.getAnnotationLevel(o.severity),raw_details:(0,Wpn.codeFrameColumns)(r9s(s).toString(),{start:{line:o.line||0,column:o.column||0}},{highlightCode:!1}),title:`(${o.ruleId||"unknown"}): ${o.message}`,message:o.message}})).flat()}};var _dn=Yt(Pl(),1),a7t=Yt(On(),1),c7t=Yt(On(),1),l7t=Yt(oa(),1),Adn=Yt(On(),1),hdn=Yt(On(),1),mdn=Yt(oa(),1),gdn=Yt(oa(),1);xOe();var o7t={};Tm(o7t,{FilesChangedListCommand:()=>NOe,default:()=>ldn,getChangedCommmits:()=>rdn,getChangedFiles:()=>aY,getCommitData:()=>tdn,getEventCommmits:()=>edn,getGithubChangedFiles:()=>ndn});var idn=Yt(Pl(),1),sdn=Yt(Pl(),1),odn=Yt(On(),1),adn=Yt(On(),1),cdn=Yt(On(),1);Fl();var oY=Yt(mye(),1),s7t=Yt(mye(),1),$pn=Yt(On(),1),edn=async()=>{if(oY.context.eventName==="push")return oY.context.payload.commits;if(oY.context.eventName==="pull_request"&&oY.context.payload.pull_request){let e=oY.context.payload.pull_request.commits_url;return(0,s7t.getOctokit)(process.env.GITHUB_TOKEN).paginate(`GET ${e}`,oY.context.repo)}return console.log(`Unknown event "${oY.context.eventName}". Only "push" and "pull_request" supported.`),[]},tdn=async e=>await(0,s7t.getOctokit)(process.env.GITHUB_TOKEN).rest.repos.getCommit({...oY.context.repo,ref:e}),rdn=async()=>{let e=await edn();return Promise.all(e.map(async t=>tdn(t.id||t.sha)))},ndn=async()=>(await rdn()).map(t=>t?.data?.files?t.data.files.map(r=>r.filename).filter(Boolean):[]).flat(),aY=async(e,t)=>{if(process.env.GITHUB_EVENT_PATH&&process.env.GITHUB_TOKEN)return ndn();let{stdout:r}=await $pn.execUtils.execvp("git",["diff","--name-only",...t?[t]:[]],{cwd:e.cwd,strict:!0});return r.split(/\r?\n/).filter(Boolean)};var NOe=class extends idn.BaseCommand{static paths=[["files","changed","list"]];json=Gd.Boolean("--json",!1);async execute(){let t=await odn.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:s}=await adn.Project.find(t,this.context.cwd);if(!s)throw new sdn.WorkspaceRequiredError(r.cwd,this.context.cwd);return(await cdn.StreamReport.start({configuration:t,json:this.json,stdout:this.context.stdout},async o=>{let f=await aY(r);for(let A of f)o.reportInfo(null,A),o.reportJson({location:A})})).exitCode()}};var ldn={commands:[NOe]};var udn=Yt(On(),1),fdn=e=>{let{project:t}=e,r=new Set,s=({manifest:c})=>{for(let o of udn.Manifest.hardDependencies)for(let f of c.getForScope(o).values()){let A=t.tryWorkspaceByDescriptor(f);A&&!r.has(A)&&(r.add(A),s(A))}};return s(e),[...r]};var pdn=Yt(On(),1);var ddn=e=>{let t=new Set;for(let r of e.project.workspaces)fdn(r).some(c=>pdn.structUtils.areLocatorsEqual(c.anchoredLocator,e.anchoredLocator))&&t.add(r);return[...t]};var gye=(e,t)=>{let r=new Set;for(let s of e.workspaces)if(t.some(o=>o.startsWith(s.relativeCwd))&&!r.has(s)){r.add(s);for(let o of ddn(s))r.add(o)}return[...r]};var brt=class extends _dn.BaseCommand{static paths=[["checks","release"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(l7t.Filename.pnpCjs)&&t.includes(l7t.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await a7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await c7t.Project.find(t,this.context.cwd),s=await gdn.xfs.mktempPromise(),{code:c}=await Adn.execUtils.pipevp("yarn",["checks","release"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await hdn.scriptUtils.makeScriptEnv({binFolder:s,project:r})});return c}async executeRegular(){let{project:t}=await c7t.Project.find(await a7t.Configuration.find(this.context.cwd,this.context.plugins),this.context.cwd),r=gye(t,await aY(t)),s=new a6("Release"),{id:c}=await s.start();try{let o=[];for await(let f of r)if(f.manifest.scripts.get("build")){let A=new RXe,h=T=>this.context.stdout.write(T);A.stdout.on("data",h),A.stderr.on("data",h);let y=await this.cli.run(["workspace",f.manifest.raw.name,"build"],A);y>0&&o.push({annotation_level:"failure",title:`Error release workspace ${f.manifest.raw.name??f.relativeCwd}`,message:`Exit code ${y}`,raw_details:sY(A.output),path:mdn.ppath.join(f.relativeCwd,"package.json"),start_line:1,end_line:1}),A.stdout.off("data",h),A.stderr.off("data",h)}await s.complete(c,{title:o.length>0?`Errors ${o.length}`:"Successful",summary:o.length>0?`Found ${o.length} errors`:"All checks passed",annotations:o})}catch(o){await s.failure({title:"Release run failed",summary:o instanceof Error?o.message:o})}return 0}};var Edn=Yt(Pl(),1),ydn=Yt(On(),1),Cdn=Yt(On(),1),Idn=Yt(On(),1),Tdn=Yt(On(),1),Sdn=Yt(On(),1),wrt=class extends Edn.BaseCommand{static paths=[["checks","run"]];async execute(){let t=await Cdn.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await Tdn.Project.find(t,this.context.cwd);return(await ydn.StreamReport.start({stdout:this.context.stdout,configuration:t},async c=>{await Promise.allSettled([this.runCheck(r.cwd,["lint"],c),this.runCheck(r.cwd,["typecheck"],c),this.runCheck(r.cwd,["test","unit"],c),this.runCheck(r.cwd,["test","integration"],c)]),await this.runCheck(r.cwd,["release"],c)})).exitCode()}async runCheck(t,r,s){try{let{stdout:c,stderr:o}=await Sdn.execUtils.execvp("yarn",["checks",...r],{cwd:t});this.context.stdout.write(c||o)}catch(c){s.reportError(Idn.MessageName.UNNAMED,`Run check ${r.join(" ")} error: ${c instanceof Error?c.message:c}`)}}};var Ddn=Yt(On(),1),u7t=Yt(On(),1),f7t=Yt(On(),1),xrt=Yt(oa(),1),bdn=Yt(On(),1),wdn=Yt(On(),1),Bdn=Yt(oa(),1),xdn=Yt(oa(),1),Ndn=Yt(oa(),1);import{pathToFileURL as c9s}from"node:url";import s9s from"node:events";import{run as o9s}from"node:test";import{readFile as i9s}from"node:fs/promises";var Brt=class{static async load(t){return Promise.all(t.map(async r=>{let s=await i9s(r,"utf8");return{file:r,source:s,tests:s.match(/test\(/gm)?.length||0}}))}};var Zee=class e extends s9s{constructor(){super()}static async initialize(){return new e}async collectTestFiles(t,r,s){let c=r==="unit"?"!(integration)":"integration";return!s||s.length<1?await kW([`**/${c}/*.test.{ts,tsx,js,jsx}`],{cwd:t,dot:!0,absolute:!0,ignore:["**/node_modules/**","**/dist/**","**/.yarn/**"]}):await kW(s.map(o=>this.isFilename(o)?`**/${c}/*${o}*.test.{ts,tsx,js,jsx}`:this.isRootPath(o)?o:`**/${o}`),{cwd:t,dot:!0,absolute:!0,ignore:["**/node_modules/**","**/dist/**","**/.yarn/**"]})}isFilename(t){let r=t.includes("/")||t.includes("\\"),s=/\.(js|jsx|ts|tsx)$/.test(t);return!r&&!s}isRootPath(t){return t.startsWith("/")||t.startsWith("\\")}async unit(t,r){let s=await this.collectTestFiles(t,"unit",r?.files);return this.run(s,25e3,!0,r?.watch??!1)}async integration(t,r){let s=await this.collectTestFiles(t,"integration",r?.files);return this.run(s,24e4,!1,r?.watch??!1)}async run(t,r,s,c){let o=await Brt.load(t);this.emit("start",{tests:o});let f=o9s({files:t,timeout:r,concurrency:s,watch:c}),A=w=>{this.emit("test:pass",w)},h=w=>{this.emit("test:fail",w)},y=w=>{this.emit("test:stdout",w)},T=w=>{this.emit("test:stderr",w)};f.on("test:pass",A),f.on("test:fail",h),f.on("test:stdout",y),f.on("test:stderr",T);try{return await f.toArray()}finally{this.emit("end"),f.off("test:pass",A),f.off("test:fail",h),f.off("test:stdout",y),f.off("test:stderr",T)}}};var vdn=Yt(Pl(),1);import{relative as a9s}from"node:path";var Eye=class extends vdn.BaseCommand{formatResults(t,r){return t.map(s=>({path:s.file?a9s(r,s.file):r,start_line:s.column??1,end_line:s.column??1,annotation_level:"failure",raw_details:s.details.error.stack||s.details.error.message,title:s.details.error.message,message:s.details.error.message}))}};var ROe=class extends Eye{static paths=[["checks","test","integration"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(xrt.Filename.pnpCjs)&&t.includes(xrt.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await u7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await f7t.Project.find(t,this.context.cwd),s=await Bdn.xfs.mktempPromise(),c=await wdn.scriptUtils.makeScriptEnv({binFolder:s,project:r});c.NODE_OPTIONS?.includes("@atls/code-runtime/ts-node-register")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-node-register`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader ${c9s(Ndn.npath.fromPortablePath(xdn.ppath.join(r.cwd,xrt.Filename.pnpEsmLoader))).href}`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-ext-register`),c.NODE_OPTIONS?.includes("--enable-source-maps")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --enable-source-maps`);let{code:o}=await bdn.execUtils.pipevp("yarn",["checks","test","integration"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:c});return o}async executeRegular(){let t=await u7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await f7t.Project.find(t,this.context.cwd);return(await Ddn.StreamReport.start({stdout:this.context.stdout,configuration:t},async()=>{let c=new a6("Test:Integration"),{id:o}=await c.start();try{let A=await(await Zee.initialize()).integration(r.cwd),h=this.formatResults(A.filter(y=>y.type==="test:fail").map(y=>y.data),r.cwd);await c.complete(o,{title:h.length>0?`Errors ${h.length}`:"Successful",summary:h.length>0?`Found ${h.length} errors`:"All checks passed",annotations:h})}catch(f){await c.failure({title:"Test:Integration run failed",summary:f instanceof Error?f.message:f})}})).exitCode()}};var Rdn=Yt(On(),1),p7t=Yt(On(),1),d7t=Yt(On(),1),Nrt=Yt(oa(),1),kdn=Yt(On(),1),Pdn=Yt(On(),1),Odn=Yt(oa(),1),Fdn=Yt(oa(),1),Ldn=Yt(oa(),1);import{pathToFileURL as l9s}from"node:url";var kOe=class extends Eye{static paths=[["checks","test","unit"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(Nrt.Filename.pnpCjs)&&t.includes(Nrt.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await p7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await d7t.Project.find(t,this.context.cwd),s=await Odn.xfs.mktempPromise(),c=await Pdn.scriptUtils.makeScriptEnv({binFolder:s,project:r});c.NODE_OPTIONS?.includes("@atls/code-runtime/ts-node-register")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-node-register`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader ${l9s(Ldn.npath.fromPortablePath(Fdn.ppath.join(r.cwd,Nrt.Filename.pnpEsmLoader))).href}`,c.NODE_OPTIONS=`${c.NODE_OPTIONS} --loader @atls/code-runtime/ts-ext-register`),c.NODE_OPTIONS?.includes("--enable-source-maps")||(c.NODE_OPTIONS=`${c.NODE_OPTIONS} --enable-source-maps`);let{code:o}=await kdn.execUtils.pipevp("yarn",["checks","test","unit"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:c});return o}async executeRegular(){let t=await p7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await d7t.Project.find(t,this.context.cwd);return(await Rdn.StreamReport.start({stdout:this.context.stdout,configuration:t},async()=>{let c=new a6("Test:Unit"),{id:o}=await c.start();try{let A=await(await Zee.initialize()).unit(r.cwd),h=this.formatResults(A.filter(y=>y.type==="test:fail").map(y=>y.data),r.cwd);await c.complete(o,{title:h.length>0?`Errors ${h.length}`:"Successful",summary:h.length>0?`Found ${h.length} errors`:"All checks passed",annotations:h})}catch(f){await c.failure({title:"Test:Unit run failed",summary:f instanceof Error?f.message:f})}})).exitCode()}};var Xdn=Yt(Pl(),1),C7t=Yt(On(),1),I7t=Yt(On(),1),Zdn=Yt(On(),1),$dn=Yt(On(),1),T7t=Yt(oa(),1),e_n=Yt(qXe(),1),t_n=Yt(On(),1),r_n=Yt(On(),1),POe=Yt(oa(),1),OOe=Yt(oa(),1),Frt=Yt(Prt(),1),n_n=Yt(Ls(),1);import{EOL as Ort}from"node:os";var E7t=Yt(Rc(),1),lle=Yt(Rc(),1),y7t=Yt(Ls(),1),Vdn=Yt(Prt(),1),pP=Yt(Ls(),1);import{isAbsolute as u9s}from"node:path";import{relative as f9s}from"node:path";var Wdn=({messageText:e,start:t,file:r,code:s,cwd:c=process.cwd()})=>{let o=(0,y7t.useMemo)(()=>r?u9s(r.fileName)?f9s(c,r.fileName):r.fileName:null,[r]),f=(0,y7t.useMemo)(()=>r&&t?r.getLineAndCharacterOfPosition(t):null,[r,t]);return pP.default.createElement(lle.Box,{flexDirection:"column",borderStyle:"round",borderColor:"gray",paddingY:1,width:"100%"},!!o&&pP.default.createElement(lle.Box,{flexDirection:"row"},pP.default.createElement(lle.Box,{marginBottom:1,paddingX:2,flexGrow:1},pP.default.createElement(G4,{line:f?f.line+1:1,column:f?.character},o)),pP.default.createElement(lle.Box,{paddingX:2},pP.default.createElement(E7t.Text,{bold:!0,color:"red"},"TS",s))),pP.default.createElement(yx,{offset:2}),!!r?.text&&!!f&&pP.default.createElement(pP.default.Fragment,null,pP.default.createElement(lle.Box,null,pP.default.createElement(H4,{line:f.line+1,column:f.character},r.text)),pP.default.createElement(yx,{offset:2})),pP.default.createElement(lle.Box,{marginTop:1,paddingX:2},pP.default.createElement(E7t.Text,{color:"white"},(0,Vdn.flattenDiagnosticMessageText)(e,` `))))};import p9s from"node:events";import{readFileSync as zdn}from"node:fs";import{join as Kdn}from"node:path";var ete={compilerOptions:{lib:["dom","dom.iterable","esnext"],declaration:!1,emitDecoratorMetadata:!0,experimentalDecorators:!0,esModuleInterop:!0,forceConsistentCasingInFileNames:!0,importHelpers:!1,isolatedModules:!1,moduleResolution:"NodeNext",noFallthroughCasesInSwitch:!0,noImplicitAny:!0,noImplicitReturns:!0,noImplicitThis:!0,noUnusedLocals:!1,noUnusedParameters:!1,pretty:!0,removeComments:!0,resolveJsonModule:!0,strict:!0,strictPropertyInitialization:!1,sourceMap:!1,module:"NodeNext",target:"es2022",jsx:"react",outDir:"./dist"},exclude:["**/*/next-env.d.ts","integration","node_modules","src/**/*.spec.ts","src/**/*.test.ts","src/**/*.story.ts","src/**/*.stories.ts","**/*/dist/**/*.ts","**/*/dist/**/*.d.ts","integration/**/*.test.ts",".idea"]};var Ydn=e=>t=>{let r=s=>{let{moduleSpecifier:c}=s;if(c&&e.isStringLiteral(c)){if(e.isImportDeclaration(s)&&c.text.endsWith(".jsx"))return t.factory.updateImportDeclaration(s,s.modifiers,s.importClause,t.factory.createStringLiteral(c.text.replace(".jsx",".js")),s.assertClause);if(e.isExportDeclaration(s))return t.factory.updateExportDeclaration(s,s.modifiers,s.isTypeOnly,s.exportClause,t.factory.createStringLiteral(c.text.replace(".jsx",".js")),s.assertClause)}return e.visitEachChild(s,r,t)};return s=>e.visitNode(s,r)};var tte=class e extends p9s{constructor(r,s){super();this.ts=r;this.cwd=s}static async initialize(r){let{ts:s}=await import("@atls/code-runtime/typescript");return new e(s,r)}async check(r=[]){return this.run(r)}async build(r=[],s={}){return this.run(r,s,!1)}async run(r=[],s={},c=!0){let o=this.getProjectIgnorePatterns(),f=this.getLibCheckOption(),A={...ete,compilerOptions:{...ete.compilerOptions,...s,skipLibCheck:f},include:r,exclude:[...ete.exclude,...o]},{fileNames:h,options:y,errors:T}=this.ts.parseJsonConfigFileContent(A,this.ts.sys,this.cwd);if(T.length>0)return this.emit("start",{files:[]}),this.emit("end",{diagnostics:T}),T;this.emit("start",{files:h});let w=this.ts.createProgram(h,{...y,noEmit:c}),b=Z=>le=>(this.emit("build:start",{file:le.fileName}),le),U=Z=>le=>(this.emit("build:end",{file:le.fileName}),le),x=w.emit(void 0,void 0,void 0,void 0,{before:[b],after:[U,Ydn(this.ts)]}),J=this.filterDiagnostics(this.ts.getPreEmitDiagnostics(w).concat(x.diagnostics));return this.emit("end",{diagnostics:J}),J}filterDiagnostics(r){return r.filter(s=>s.code!==2209).filter(s=>!(s.code===1479&&s.file?.fileName.includes("/.yarn/"))).filter(s=>!(s.code===2834&&s.file?.fileName.includes("/.yarn/"))).filter(s=>!(s.code===7016&&s.file?.fileName.includes("/lexical/"))).filter(s=>!(s.code===6133&&s.file?.fileName.includes("/@yarnpkg/libui/"))).filter(s=>!([2315,2411,2304,7006,7016].includes(s.code)&&s.file?.fileName.includes("/@strapi/"))).filter(s=>!([2688,2307,2503].includes(s.code)&&s.file?.fileName.includes("/pkg-tests-core/"))).filter(s=>!([2307].includes(s.code)&&s.file?.fileName.includes("/@nestjs/testing/")))}getProjectIgnorePatterns(){let r=zdn(Kdn(this.cwd,"package.json"),"utf-8"),{typecheckIgnorePatterns:s=[]}=JSON.parse(r);return s}getLibCheckOption(){let r=zdn(Kdn(this.cwd,"package.json"),"utf-8"),{typecheckSkipLibCheck:s=!1}=JSON.parse(r);return s}};var FOe=class extends Xdn.BaseCommand{static paths=[["checks","typecheck"]];async execute(){let t=process.env.NODE_OPTIONS??"";return t.includes(T7t.Filename.pnpCjs)&&t.includes(T7t.Filename.pnpEsmLoader)?this.executeRegular():this.executeProxy()}async executeProxy(){let t=await C7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await I7t.Project.find(t,this.context.cwd),s=await POe.xfs.mktempPromise(),{code:c}=await t_n.execUtils.pipevp("yarn",["checks","typecheck"],{cwd:this.context.cwd,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,env:await r_n.scriptUtils.makeScriptEnv({binFolder:s,project:r})});return c}async executeRegular(){let t=await C7t.Configuration.find(this.context.cwd,this.context.plugins),{project:r}=await I7t.Project.find(t,this.context.cwd);return(await Zdn.StreamReport.start({stdout:this.context.stdout,configuration:t},async c=>{let o=new a6("TypeCheck"),{id:f}=await o.start();await c.startTimerPromise("TypeCheck",async()=>{try{let h=await(await tte.initialize(r.cwd)).check(await this.getIncludes(r));h.forEach(T=>{u1(n_n.default.createElement(Wdn,{...T})).split(` `).forEach(b=>{c.reportInfo($dn.MessageName.UNNAMED,b)})});let y=[];h.forEach(T=>{if(T.file){let w=T.start?T.file.getLineAndCharacterOfPosition(T.start):null;y.push({path:OOe.ppath.normalize(OOe.ppath.relative(r.cwd,T.file.fileName)),title:(0,Frt.flattenDiagnosticMessageText)(T.messageText,Ort).split(Ort).at(0),message:(0,Frt.flattenDiagnosticMessageText)(T.messageText,Ort),start_line:w?w.line+1:0,end_line:w?w.line+1:0,raw_details:w?(0,e_n.codeFrameColumns)(POe.xfs.readFileSync(T.file.fileName).toString(),{start:{line:w.line+1,column:w.character+1}},{highlightCode:!1}):(0,Frt.flattenDiagnosticMessageText)(T.messageText,Ort),annotation_level:"failure"})}}),await o.complete(f,{title:h.length>0?`Errors ${y.length}`:"Successful",summary:h.length>0?`Found ${y.length} errors`:"All checks passed",annotations:y})}catch(A){await o.failure({title:"TypeCheck run failed",summary:A instanceof Error?A.message:A})}})})).exitCode()}async getIncludes(t){if(await POe.xfs.existsPromise(OOe.ppath.join(t.cwd,"tsconfig.json"))){let r=await POe.xfs.readJsonPromise(OOe.ppath.join(t.cwd,"tsconfig.json"));if(r.include&&r.include.length>0)return r.include}return t.topLevelWorkspace.manifest.workspaceDefinitions.map(r=>r.pattern)}};var i_n={commands:[ROe,kOe,FOe,BOe,brt,wrt]};var D7t={};Tm(D7t,{beforeWorkspacePacking:()=>v7t,default:()=>s_n});var v7t=(e,t)=>{t.name==="@atls/yarn-cli"&&(t.dependencies=new Proxy({},{set:()=>!0}))};var s_n={hooks:{beforeWorkspacePacking:v7t}};var nqt={};Tm(nqt,{default:()=>gvn});var v0n=Yt(Pl(),1);var UAn=Yt(l_n(),1);var T_n=Yt(C_n(),1);function I_n(e){let t=[];return new Promise((r,s)=>e.on("data",c=>t.push(c.toString("utf-8"))).on("error",s).on("end",()=>r(t)))}async function S_n(e,t={}){return I_n((0,T_n.default)(e,{cwd:t.cwd}))}import L9s from"path";import QOe from"node:path";import w9s from"node:process";import B9s from"node:path";import o3a,{promises as v_n}from"node:fs";import{fileURLToPath as x9s}from"node:url";var b7t=class{value;next;constructor(t){this.value=t}},LOe=class{#e;#t;#r;constructor(){this.clear()}enqueue(t){let r=new b7t(t);this.#e?(this.#t.next=r,this.#t=r):(this.#e=r,this.#t=r),this.#r++}dequeue(){let t=this.#e;if(t)return this.#e=this.#e.next,this.#r--,t.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#r=0}get size(){return this.#r}*[Symbol.iterator](){let t=this.#e;for(;t;)yield t.value,t=t.next}};function Qrt(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new LOe,r=0,s=()=>{r--,t.size>0&&t.dequeue()()},c=async(A,h,y)=>{r++;let T=(async()=>A(...y))();h(T);try{await T}catch{}s()},o=(A,h,y)=>{t.enqueue(c.bind(void 0,A,h,y)),(async()=>(await Promise.resolve(),r0&&t.dequeue()()))()},f=(A,...h)=>new Promise(y=>{o(A,y,h)});return Object.defineProperties(f,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),f}var Mrt=class extends Error{constructor(t){super(),this.value=t}},D9s=async(e,t)=>t(await e),b9s=async e=>{let t=await Promise.all(e);if(t[1]===!0)throw new Mrt(t[0]);return!1};async function w7t(e,t,{concurrency:r=Number.POSITIVE_INFINITY,preserveOrder:s=!0}={}){let c=Qrt(r),o=[...e].map(A=>[A,c(D9s,A,t)]),f=Qrt(s?1:Number.POSITIVE_INFINITY);try{await Promise.all(o.map(A=>f(b9s,A)))}catch(A){if(A instanceof Mrt)return A.value;throw A}}var D_n={directory:"isDirectory",file:"isFile"};function N9s(e){if(!Object.hasOwnProperty.call(D_n,e))throw new Error(`Invalid type specified: ${e}`)}var R9s=(e,t)=>t[D_n[e]](),k9s=e=>e instanceof URL?x9s(e):e;async function B7t(e,{cwd:t=w9s.cwd(),type:r="file",allowSymlinks:s=!0,concurrency:c,preserveOrder:o}={}){N9s(r),t=k9s(t);let f=s?v_n.stat:v_n.lstat;return w7t(e,async A=>{try{let h=await f(B9s.resolve(t,A));return R9s(r,h)}catch{return!1}},{concurrency:c,preserveOrder:o})}import{fileURLToPath as P9s}from"node:url";function x7t(e){return e instanceof URL?P9s(e):e}var O9s=Symbol("findUpStop");async function F9s(e,t={}){let r=QOe.resolve(x7t(t.cwd)??""),{root:s}=QOe.parse(r),c=QOe.resolve(r,x7t(t.stopAt??s)),o=t.limit??Number.POSITIVE_INFINITY,f=[e].flat(),A=async y=>{if(typeof e!="function")return B7t(f,y);let T=await e(y.cwd);return typeof T=="string"?B7t([T],y):T},h=[];for(;;){let y=await A({...t,cwd:r});if(y===O9s||(y&&h.push(QOe.resolve(r,y)),r===c||h.length>=o))break;r=QOe.dirname(r)}return h}async function N7t(e,t={}){return(await F9s(e,{...t,limit:1}))[0]}var b_n=Q9s;async function Q9s(e){let t=await M9s(e);return typeof t!="string"?t:L9s.join(t,"..")}async function M9s(e){let t=await N7t(".git",{cwd:e,type:"file"}),r=await N7t(".git",{cwd:e,type:"directory"});return t||r}import U9s from"fs/promises";import Urt from"path";import w_n from"fs/promises";async function B_n(e,t){if(typeof t=="string")return Urt.resolve(e,t);let r=Urt.join(e,".git");if((await w_n.lstat(r)).isDirectory())return Urt.join(e,".git/COMMIT_EDITMSG");let o=(await w_n.readFile(r,{encoding:"utf-8"})).replace("gitdir: ","").replace(` `,"");return Urt.resolve(e,o,"COMMIT_EDITMSG")}async function x_n(e,t){let r=await b_n(e);if(typeof r!="string")throw new TypeError(`Could not find git root from ${e}`);let s=await B_n(r,t);return[`${(await U9s.readFile(s)).toString("utf-8")}