New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More β†’
Socket
Sign inDemoInstall
Socket

techor

Package Overview
Dependencies
Maintainers
1
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

techor - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

14

dist/bin/index.js
#!/usr/bin/env node
var sr=Object.create;var De=Object.defineProperty;var ar=Object.getOwnPropertyDescriptor;var cr=Object.getOwnPropertyNames;var ur=Object.getPrototypeOf,fr=Object.prototype.hasOwnProperty;var w=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of cr(t))!fr.call(e,o)&&o!==n&&De(e,o,{get:()=>t[o],enumerable:!(r=ar(t,o))||r.enumerable});return e};var g=(e,t,n)=>(n=e!=null?sr(ur(e)):{},lr(t||!e||!e.__esModule?De(n,"default",{value:e,enumerable:!0}):n,e));var Xe=w((Ho,Ve)=>{Ve.exports=_e;_e.sync=gr;var ze=require("fs");function pr(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function Ke(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:pr(t,n)}function _e(e,t,n){ze.stat(e,function(r,o){n(r,r?!1:Ke(o,e,t))})}function gr(e,t){return Ke(ze.statSync(e),e,t)}});var et=w((zo,Qe)=>{Qe.exports=Ye;Ye.sync=hr;var Je=require("fs");function Ye(e,t,n){Je.stat(e,function(r,o){n(r,r?!1:Ze(o,t))})}function hr(e,t){return Ze(Je.statSync(e),t)}function Ze(e,t){return e.isFile()&&xr(e,t)}function xr(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),c=parseInt("010",8),a=parseInt("001",8),f=u|c,m=n&a||n&c&&o===s||n&u&&r===i||n&f&&i===0;return m}});var nt=w((_o,tt)=>{var Ko=require("fs"),V;process.platform==="win32"||global.TESTING_WINDOWS?V=Xe():V=et();tt.exports=fe;fe.sync=yr;function fe(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){fe(e,t||{},function(i,s){i?o(i):r(s)})})}V(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function yr(e,t){try{return V.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var ut=w((Vo,ct)=>{var $=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",rt=require("path"),br=$?";":":",ot=nt(),it=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),st=(e,t)=>{let n=t.colon||br,r=e.match(/\//)||$&&e.match(/\\/)?[""]:[...$?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=$?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=$?o.split(n):[""];return $&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},at=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=st(e,t),s=[],u=a=>new Promise((f,m)=>{if(a===r.length)return t.all&&s.length?f(s):m(it(e));let d=r[a],p=/^".*"$/.test(d)?d.slice(1,-1):d,l=rt.join(p,e),h=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;f(c(h,a,0))}),c=(a,f,m)=>new Promise((d,p)=>{if(m===o.length)return d(u(f+1));let l=o[m];ot(a+l,{pathExt:i},(h,b)=>{if(!h&&b)if(t.all)s.push(a+l);else return d(a+l);return d(c(a,f,m+1))})});return n?u(0).then(a=>n(null,a),n):u(0)},Sr=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=st(e,t),i=[];for(let s=0;s<n.length;s++){let u=n[s],c=/^".*"$/.test(u)?u.slice(1,-1):u,a=rt.join(c,e),f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;for(let m=0;m<r.length;m++){let d=f+r[m];try{if(ot.sync(d,{pathExt:o}))if(t.all)i.push(d);else return d}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw it(e)};ct.exports=at;at.sync=Sr});var lt=w((Xo,le)=>{"use strict";var ft=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};le.exports=ft;le.exports.default=ft});var gt=w((Jo,pt)=>{"use strict";var dt=require("path"),wr=ut(),vr=lt();function mt(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=wr.sync(e.command,{path:n[vr({env:n})],pathExt:t?dt.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=dt.resolve(o?e.options.cwd:"",s)),s}function Er(e){return mt(e)||mt(e,!0)}pt.exports=Er});var ht=w((Yo,me)=>{"use strict";var de=/([()\][%!^"`<>&|;, *?])/g;function Pr(e){return e=e.replace(de,"^$1"),e}function Tr(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(de,"^$1"),t&&(e=e.replace(de,"^$1")),e}me.exports.command=Pr;me.exports.argument=Tr});var yt=w((Zo,xt)=>{"use strict";xt.exports=/^#!(.*)/});var St=w((Qo,bt)=>{"use strict";var kr=yt();bt.exports=(e="")=>{let t=e.match(kr);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var vt=w((ei,wt)=>{"use strict";var pe=require("fs"),jr=St();function Ir(e){let n=Buffer.alloc(150),r;try{r=pe.openSync(e,"r"),pe.readSync(r,n,0,150,0),pe.closeSync(r)}catch{}return jr(n.toString())}wt.exports=Ir});var kt=w((ti,Tt)=>{"use strict";var Cr=require("path"),Et=gt(),Pt=ht(),Or=vt(),$r=process.platform==="win32",Nr=/\.(?:com|exe)$/i,Br=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Fr(e){e.file=Et(e);let t=e.file&&Or(e.file);return t?(e.args.unshift(e.file),e.command=t,Et(e)):e.file}function Gr(e){if(!$r)return e;let t=Fr(e),n=!Nr.test(t);if(e.options.forceShell||n){let r=Br.test(t);e.command=Cr.normalize(e.command),e.command=Pt.command(e.command),e.args=e.args.map(i=>Pt.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Ar(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Gr(r)}Tt.exports=Ar});var Ct=w((ni,It)=>{"use strict";var ge=process.platform==="win32";function he(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Rr(e,t){if(!ge)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=jt(o,t,"spawn");if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function jt(e,t){return ge&&e===1&&!t.file?he(t.original,"spawn"):null}function Mr(e,t){return ge&&e===1&&!t.file?he(t.original,"spawnSync"):null}It.exports={hookChildProcess:Rr,verifyENOENT:jt,verifyENOENTSync:Mr,notFoundError:he}});var Nt=w((ri,N)=>{"use strict";var Ot=require("child_process"),xe=kt(),ye=Ct();function $t(e,t,n){let r=xe(e,t,n),o=Ot.spawn(r.command,r.args,r.options);return ye.hookChildProcess(o,r),o}function Lr(e,t,n){let r=xe(e,t,n),o=Ot.spawnSync(r.command,r.args,r.options);return o.error=o.error||ye.verifyENOENTSync(o.status,r),o}N.exports=$t;N.exports.spawn=$t;N.exports.sync=Lr;N.exports.t=xe;N.exports.n=ye});var zt=w((vi,Z)=>{Z.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Z.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Z.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Jt=w((Ei,A)=>{var x=global.process,I=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};I(x)?(Kt=require("assert"),F=zt(),_t=/^win/i.test(x.platform),L=require("events"),typeof L!="function"&&(L=L.EventEmitter),x.e?v=x.e:(v=x.e=new L,v.count=0,v.emitted={}),v.infinite||(v.setMaxListeners(1/0),v.infinite=!0),A.exports=function(e,t){if(!I(global.process))return function(){};Kt.equal(typeof e,"function","a callback must be provided for exit handler"),G===!1&&ve();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){v.removeListener(n,e),v.listeners("exit").length===0&&v.listeners("afterexit").length===0&&Q()};return v.on(n,e),r},Q=function(){!G||!I(global.process)||(G=!1,F.forEach(function(t){try{x.removeListener(t,ee[t])}catch{}}),x.emit=te,x.reallyExit=Ee,v.count-=1)},A.exports.unload=Q,C=function(t,n,r){v.emitted[t]||(v.emitted[t]=!0,v.emit(t,n,r))},ee={},F.forEach(function(e){ee[e]=function(){if(I(global.process)){var n=x.listeners(e);n.length===v.count&&(Q(),C("exit",null,e),C("afterexit",null,e),_t&&e==="SIGHUP"&&(e="SIGINT"),x.kill(x.pid,e))}}}),A.exports.signals=function(){return F},G=!1,ve=function(){G||!I(global.process)||(G=!0,v.count+=1,F=F.filter(function(t){try{return x.on(t,ee[t]),!0}catch{return!1}}),x.emit=Xt,x.reallyExit=Vt)},A.exports.load=ve,Ee=x.reallyExit,Vt=function(t){I(global.process)&&(x.exitCode=t||0,C("exit",x.exitCode,null),C("afterexit",x.exitCode,null),Ee.call(x,x.exitCode))},te=x.emit,Xt=function(t,n){if(t==="exit"&&I(global.process)){n!==void 0&&(x.exitCode=n);var r=te.apply(this,arguments);return C("exit",x.exitCode,null),C("afterexit",x.exitCode,null),r}else return te.apply(this,arguments)}):A.exports=function(){return function(){}};var Kt,F,_t,L,v,Q,C,ee,G,ve,Ee,Vt,te,Xt});var un=w((Ii,cn)=>{"use strict";var{PassThrough:fo}=require("stream");cn.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new fo({objectMode:o});n&&i.setEncoding(n);let s=0,u=[];return i.on("data",c=>{u.push(c),o?s=u.length:s+=c.length}),i.getBufferedValue=()=>t?u:r?Buffer.concat(u,s):u.join(""),i.getBufferedLength=()=>s,i}});var fn=w((Ci,D)=>{"use strict";var{constants:lo}=require("buffer"),mo=require("stream"),{promisify:po}=require("util"),go=un(),ho=po(mo.pipeline),re=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function ke(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=go(t);return await new Promise((o,i)=>{let s=u=>{u&&r.getBufferedLength()<=lo.MAX_LENGTH&&(u.bufferedData=r.getBufferedValue()),i(u)};(async()=>{try{await ho(e,r),o()}catch(u){s(u)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new re)})}),r.getBufferedValue()}D.exports=ke;D.exports.buffer=(e,t)=>ke(e,{...t,encoding:"buffer"});D.exports.array=(e,t)=>ke(e,{...t,array:!0});D.exports.MaxBufferError=re});var dn=w((Oi,ln)=>{"use strict";var{PassThrough:xo}=require("stream");ln.exports=function(){var e=[],t=new xo({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var Re=require("commander"),ir=g(require("path"));var qe=require("commander"),We=g(require("fast-glob")),ue=g(require("fs-extra")),He=g(require("path")),T=g(require("@techor/log"));var Ue=g(require("fs-extra"));function O(e="./package.json"){return Ue.default.readJSONSync(e,{throws:!1})||{}}var dr=O(),mr={workspaces:dr.workspaces};qe.program.command("version <version>").description("Bump to specific version for workspace's packages").option("-p, --prefix <symbol>","Version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ","^").option("-w, --workspaces <paths>","Specific your workspaces",mr.workspaces).option("-ls, --list","List current bumpable dependency tree in workspaces",!1).action((e,{prefix:t,list:n,workspaces:r})=>{let o=t+e,i={},s={},u=r.map(f=>He.default.join(f,"*package.json")),c=(f,m)=>{let d=!1;for(let p in f)p in s&&f[p]===""&&(f[p]=o,d=!0);return d};for(let f of We.default.sync(u)){let m=ue.default.readJSONSync(f);m.private||(i[f]=m,s[m.name]=m,m.version=e)}for(let f in i){let m=i[f],{dependencies:d,peerDependencies:p}=i[f];d&&c(d,"dependencies"),p&&c(p,"peerDependencies"),n||ue.default.writeJSONSync(f,m)}let a={};for(let f in s){let{dependencies:m,peerDependencies:d}=s[f],p=a[(0,T.paint)("**"+f+"**")]={},l=(h,b)=>{if(h){p[b]={};for(let S in h)if(S in s){let E=h[S];p[b][(0,T.paint)("**"+S+"**")]=E===o?null:o}}};l(m,"dependencies"),l(d,"peerDependencies"),Object.keys(a[(0,T.paint)("**"+f+"**")]).length||(a[(0,T.paint)("**"+f+"**")]=null)}T.default`πŸ“¦`,T.default.tree(a),T.default.success`bump version to +${o}+ for ${Object.keys(s).length} packages in all workspace`});var Qn=require("commander"),er=g(require("fast-glob"));var $n=require("node:buffer"),Nn=g(require("node:path"),1),se=g(require("node:child_process"),1),U=g(require("node:process"),1),Bn=g(Nt(),1);function be(e){let t=typeof e=="string"?`
var ir=Object.create;var Le=Object.defineProperty;var sr=Object.getOwnPropertyDescriptor;var ar=Object.getOwnPropertyNames;var cr=Object.getPrototypeOf,ur=Object.prototype.hasOwnProperty;var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var lr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ar(t))!ur.call(e,o)&&o!==n&&Le(e,o,{get:()=>t[o],enumerable:!(r=sr(t,o))||r.enumerable});return e};var p=(e,t,n)=>(n=e!=null?ir(cr(e)):{},lr(t||!e||!e.__esModule?Le(n,"default",{value:e,enumerable:!0}):n,e));var Ve=S((Uo,Ke)=>{Ke.exports=ze;ze.sync=pr;var We=require("fs");function mr(e,t){var n=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!n||(n=n.split(";"),n.indexOf("")!==-1))return!0;for(var r=0;r<n.length;r++){var o=n[r].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function He(e,t,n){return!e.isSymbolicLink()&&!e.isFile()?!1:mr(t,n)}function ze(e,t,n){We.stat(e,function(r,o){n(r,r?!1:He(o,e,t))})}function pr(e,t){return He(We.statSync(e),e,t)}});var Ze=S((qo,Ye)=>{Ye.exports=_e;_e.sync=gr;var Xe=require("fs");function _e(e,t,n){Xe.stat(e,function(r,o){n(r,r?!1:Je(o,t))})}function gr(e,t){return Je(Xe.statSync(e),t)}function Je(e,t){return e.isFile()&&hr(e,t)}function hr(e,t){var n=e.mode,r=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),u=parseInt("100",8),a=parseInt("010",8),c=parseInt("001",8),l=u|a,m=n&c||n&a&&o===s||n&u&&r===i||n&l&&i===0;return m}});var et=S((Ho,Qe)=>{var Wo=require("fs"),_;process.platform==="win32"||global.TESTING_WINDOWS?_=Ve():_=Ze();Qe.exports=le;le.sync=xr;function le(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,o){le(e,t||{},function(i,s){i?o(i):r(s)})})}_(e,t||{},function(r,o){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,o=!1),n(r,o)})}function xr(e,t){try{return _.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}});var at=S((zo,st)=>{var O=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",tt=require("path"),yr=O?";":":",nt=et(),rt=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),ot=(e,t)=>{let n=t.colon||yr,r=e.match(/\//)||O&&e.match(/\\/)?[""]:[...O?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],o=O?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=O?o.split(n):[""];return O&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:r,pathExt:i,pathExtExe:o}},it=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});let{pathEnv:r,pathExt:o,pathExtExe:i}=ot(e,t),s=[],u=c=>new Promise((l,m)=>{if(c===r.length)return t.all&&s.length?l(s):m(rt(e));let d=r[c],g=/^".*"$/.test(d)?d.slice(1,-1):d,f=tt.join(g,e),h=!g&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;l(a(h,c,0))}),a=(c,l,m)=>new Promise((d,g)=>{if(m===o.length)return d(u(l+1));let f=o[m];nt(c+f,{pathExt:i},(h,b)=>{if(!h&&b)if(t.all)s.push(c+f);else return d(c+f);return d(a(c,l,m+1))})});return n?u(0).then(c=>n(null,c),n):u(0)},br=(e,t)=>{t=t||{};let{pathEnv:n,pathExt:r,pathExtExe:o}=ot(e,t),i=[];for(let s=0;s<n.length;s++){let u=n[s],a=/^".*"$/.test(u)?u.slice(1,-1):u,c=tt.join(a,e),l=!a&&/^\.[\\\/]/.test(e)?e.slice(0,2)+c:c;for(let m=0;m<r.length;m++){let d=l+r[m];try{if(nt.sync(d,{pathExt:o}))if(t.all)i.push(d);else return d}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw rt(e)};st.exports=it;it.sync=br});var ut=S((Ko,fe)=>{"use strict";var ct=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};fe.exports=ct;fe.exports.default=ct});var mt=S((Vo,dt)=>{"use strict";var lt=require("path"),Sr=at(),wr=ut();function ft(e,t){let n=e.options.env||process.env,r=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Sr.sync(e.command,{path:n[wr({env:n})],pathExt:t?lt.delimiter:void 0})}catch{}finally{i&&process.chdir(r)}return s&&(s=lt.resolve(o?e.options.cwd:"",s)),s}function vr(e){return ft(e)||ft(e,!0)}dt.exports=vr});var pt=S((Xo,me)=>{"use strict";var de=/([()\][%!^"`<>&|;, *?])/g;function Er(e){return e=e.replace(de,"^$1"),e}function Pr(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(de,"^$1"),t&&(e=e.replace(de,"^$1")),e}me.exports.command=Er;me.exports.argument=Pr});var ht=S((_o,gt)=>{"use strict";gt.exports=/^#!(.*)/});var yt=S((Jo,xt)=>{"use strict";var Tr=ht();xt.exports=(e="")=>{let t=e.match(Tr);if(!t)return null;let[n,r]=t[0].replace(/#! ?/,"").split(" "),o=n.split("/").pop();return o==="env"?r:r?`${o} ${r}`:o}});var St=S((Yo,bt)=>{"use strict";var pe=require("fs"),jr=yt();function kr(e){let n=Buffer.alloc(150),r;try{r=pe.openSync(e,"r"),pe.readSync(r,n,0,150,0),pe.closeSync(r)}catch{}return jr(n.toString())}bt.exports=kr});var Pt=S((Zo,Et)=>{"use strict";var Ir=require("path"),wt=mt(),vt=pt(),Cr=St(),Or=process.platform==="win32",$r=/\.(?:com|exe)$/i,Fr=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Br(e){e.file=wt(e);let t=e.file&&Cr(e.file);return t?(e.args.unshift(e.file),e.command=t,wt(e)):e.file}function Nr(e){if(!Or)return e;let t=Br(e),n=!$r.test(t);if(e.options.forceShell||n){let r=Fr.test(t);e.command=Ir.normalize(e.command),e.command=vt.command(e.command),e.args=e.args.map(i=>vt.argument(i,r));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Gr(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);let r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Nr(r)}Et.exports=Gr});var kt=S((Qo,jt)=>{"use strict";var ge=process.platform==="win32";function he(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Ar(e,t){if(!ge)return;let n=e.emit;e.emit=function(r,o){if(r==="exit"){let i=Tt(o,t,"spawn");if(i)return n.call(e,"error",i)}return n.apply(e,arguments)}}function Tt(e,t){return ge&&e===1&&!t.file?he(t.original,"spawn"):null}function Rr(e,t){return ge&&e===1&&!t.file?he(t.original,"spawnSync"):null}jt.exports={hookChildProcess:Ar,verifyENOENT:Tt,verifyENOENTSync:Rr,notFoundError:he}});var Ot=S((ei,$)=>{"use strict";var It=require("child_process"),xe=Pt(),ye=kt();function Ct(e,t,n){let r=xe(e,t,n),o=It.spawn(r.command,r.args,r.options);return ye.hookChildProcess(o,r),o}function Mr(e,t,n){let r=xe(e,t,n),o=It.spawnSync(r.command,r.args,r.options);return o.error=o.error||ye.verifyENOENTSync(o.status,r),o}$.exports=Ct;$.exports.spawn=Ct;$.exports.sync=Mr;$.exports.t=xe;$.exports.n=ye});var Wt=S((bi,Q)=>{Q.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&Q.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&Q.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Xt=S((Si,G)=>{var x=global.process,I=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};I(x)?(Ht=require("assert"),B=Wt(),zt=/^win/i.test(x.platform),L=require("events"),typeof L!="function"&&(L=L.EventEmitter),x.e?w=x.e:(w=x.e=new L,w.count=0,w.emitted={}),w.infinite||(w.setMaxListeners(1/0),w.infinite=!0),G.exports=function(e,t){if(!I(global.process))return function(){};Ht.equal(typeof e,"function","a callback must be provided for exit handler"),N===!1&&ve();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){w.removeListener(n,e),w.listeners("exit").length===0&&w.listeners("afterexit").length===0&&ee()};return w.on(n,e),r},ee=function(){!N||!I(global.process)||(N=!1,B.forEach(function(t){try{x.removeListener(t,te[t])}catch{}}),x.emit=ne,x.reallyExit=Ee,w.count-=1)},G.exports.unload=ee,C=function(t,n,r){w.emitted[t]||(w.emitted[t]=!0,w.emit(t,n,r))},te={},B.forEach(function(e){te[e]=function(){if(I(global.process)){var n=x.listeners(e);n.length===w.count&&(ee(),C("exit",null,e),C("afterexit",null,e),zt&&e==="SIGHUP"&&(e="SIGINT"),x.kill(x.pid,e))}}}),G.exports.signals=function(){return B},N=!1,ve=function(){N||!I(global.process)||(N=!0,w.count+=1,B=B.filter(function(t){try{return x.on(t,te[t]),!0}catch{return!1}}),x.emit=Vt,x.reallyExit=Kt)},G.exports.load=ve,Ee=x.reallyExit,Kt=function(t){I(global.process)&&(x.exitCode=t||0,C("exit",x.exitCode,null),C("afterexit",x.exitCode,null),Ee.call(x,x.exitCode))},ne=x.emit,Vt=function(t,n){if(t==="exit"&&I(global.process)){n!==void 0&&(x.exitCode=n);var r=ne.apply(this,arguments);return C("exit",x.exitCode,null),C("afterexit",x.exitCode,null),r}else return ne.apply(this,arguments)}):G.exports=function(){return function(){}};var Ht,B,zt,L,w,ee,C,te,N,ve,Ee,Kt,ne,Vt});var an=S((Ti,sn)=>{"use strict";var{PassThrough:uo}=require("stream");sn.exports=e=>{e={...e};let{array:t}=e,{encoding:n}=e,r=n==="buffer",o=!1;t?o=!(n||r):n=n||"utf8",r&&(n=null);let i=new uo({objectMode:o});n&&i.setEncoding(n);let s=0,u=[];return i.on("data",a=>{u.push(a),o?s=u.length:s+=a.length}),i.getBufferedValue=()=>t?u:r?Buffer.concat(u,s):u.join(""),i.getBufferedLength=()=>s,i}});var cn=S((ji,D)=>{"use strict";var{constants:lo}=require("buffer"),fo=require("stream"),{promisify:mo}=require("util"),po=an(),go=mo(fo.pipeline),oe=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function je(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:n}=t,r=po(t);return await new Promise((o,i)=>{let s=u=>{u&&r.getBufferedLength()<=lo.MAX_LENGTH&&(u.bufferedData=r.getBufferedValue()),i(u)};(async()=>{try{await go(e,r),o()}catch(u){s(u)}})(),r.on("data",()=>{r.getBufferedLength()>n&&s(new oe)})}),r.getBufferedValue()}D.exports=je;D.exports.buffer=(e,t)=>je(e,{...t,encoding:"buffer"});D.exports.array=(e,t)=>je(e,{...t,array:!0});D.exports.MaxBufferError=oe});var ln=S((ki,un)=>{"use strict";var{PassThrough:ho}=require("stream");un.exports=function(){var e=[],t=new ho({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(n),t;function n(i){return Array.isArray(i)?(i.forEach(n),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function r(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var z=require("commander");var De=require("commander"),Ue=p(require("fast-glob")),qe=p(require("path")),T=p(require("@techor/log")),A=require("@techor/fs"),fr=(0,A.readFileAsJSON)("./package.json"),dr={workspaces:fr.workspaces};De.program.command("version <version>").description("Bump to specific version for workspace's packages").option("-p, --prefix <symbol>","Version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ","^").option("-w, --workspaces <paths>","Specific your workspaces",dr.workspaces).option("-ls, --list","List current bumpable dependency tree in workspaces",!1).option("--private","Bump private project version",!1).option("--no-public","Off: Bump public project version").action((e,t)=>{let n=t.prefix+e,r={},o={},i=t.workspaces.map(a=>qe.default.join(a,"*package.json")),s=(a,c)=>{let l=!1;for(let m in a)m in o&&a[m]===""&&(a[m]=n,l=!0);return l};for(let a of Ue.default.sync(i)){let c=(0,A.readFileAsJSON)(a);(c.private&&t.private||!c.private&&t.public)&&(r[a]=c,o[c.name]=c,c.version=e)}for(let a in r){let c=r[a],{dependencies:l,peerDependencies:m}=r[a];l&&s(l,"dependencies"),m&&s(m,"peerDependencies"),t.list||(0,A.writeToFile)(a,c)}let u={};for(let a in o){let{dependencies:c,peerDependencies:l}=o[a],m=u[(0,T.paint)("**"+a+"**")]={},d=(g,f)=>{if(g){m[f]={};for(let h in g)if(h in o){let b=g[h];m[f][(0,T.paint)("**"+h+"**")]=b===n?null:n}}};d(c,"dependencies"),d(l,"peerDependencies"),Object.keys(u[(0,T.paint)("**"+a+"**")]).length||(u[(0,T.paint)("**"+a+"**")]=null)}T.default`πŸ“¦`,T.default.tree(u),T.default.success`bump version to +${n}+ for ${Object.keys(o).length} packages in all workspace`});var Yn=require("commander"),Zn=p(require("fast-glob"));var Cn=require("node:buffer"),On=p(require("node:path"),1),ae=p(require("node:child_process"),1),U=p(require("node:process"),1),$n=p(Ot(),1);function be(e){let t=typeof e=="string"?`
`:`
`.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}var R=g(require("node:process"),1),B=g(require("node:path"),1),Bt=g(require("node:url"),1);function X(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}function Dr(e={}){let{cwd:t=R.default.cwd(),path:n=R.default.env[X()],execPath:r=R.default.execPath}=e,o,i=t instanceof URL?Bt.default.fileURLToPath(t):t,s=B.default.resolve(i),u=[];for(;o!==s;)u.push(B.default.join(s,"node_modules/.bin")),o=s,s=B.default.resolve(s,"..");return u.push(B.default.resolve(i,r,"..")),[...u,n].join(B.default.delimiter)}function Ft({env:e=R.default.env,...t}={}){e={...e};let n=X({env:e});return t.path=e[n],e[n]=Dr(t),e}var Ur=(e,t,n,r)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),i=Object.getOwnPropertyDescriptor(t,n);!qr(o,i)&&r||Object.defineProperty(e,n,i)},qr=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Wr=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Hr=(e,t)=>`/* Wrapped ${e}*/
${t}`,zr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Kr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),_r=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=Hr.bind(null,r,t.toString());Object.defineProperty(o,"name",Kr),Object.defineProperty(e,"toString",{...zr,value:o})};function Se(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))Ur(e,t,o,n);return Wr(e,t),_r(e,t,r),e}var J=new WeakMap,Gt=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(J.set(i,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return n};return Se(i,e),J.set(i,r),i};Gt.callCount=e=>{if(!J.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return J.get(e)};var At=Gt;var qt=require("node:os");var Rt=()=>{let e=Lt-Mt+1;return Array.from({length:e},Vr)},Vr=(e,t)=>({name:`SIGRT${t+1}`,number:Mt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Mt=34,Lt=64;var Ut=require("node:os");var Dt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var we=()=>{let e=Rt();return[...Dt,...e].map(Xr)},Xr=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Ut.constants,u=s!==void 0;return{name:e,number:u?s:t,description:n,supported:u,action:r,forced:o,standard:i}};var Jr=()=>{let e=we();return Object.fromEntries(e.map(Yr))},Yr=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],Wt=Jr(),Zr=()=>{let e=we(),t=64+1,n=Array.from({length:t},(r,o)=>Qr(o,e));return Object.assign({},...n)},Qr=(e,t)=>{let n=eo(e,t);if(n===void 0)return{};let{name:r,description:o,supported:i,action:s,forced:u,standard:c}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:u,standard:c}}},eo=(e,t)=>{let n=t.find(({name:r})=>qt.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},xi=Zr();var to=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",M=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:u,timedOut:c,isCanceled:a,killed:f,parsed:{options:{timeout:m}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let d=o===void 0?void 0:Wt[o].description,p=r&&r.code,h=`Command ${to({timedOut:c,timeout:m,errorCode:p,signal:o,signalDescription:d,exitCode:i,isCanceled:a})}: ${s}`,b=Object.prototype.toString.call(r)==="[object Error]",S=b?`${h}
${r.message}`:h,E=[S,t,e].filter(Boolean).join(`
`);return b?(r.originalMessage=r.message,r.message=E):r=new Error(E),r.shortMessage=S,r.command=s,r.escapedCommand=u,r.exitCode=i,r.signal=o,r.signalDescription=d,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!c,r.isCanceled=a,r.killed=f&&!c,r};var Y=["stdin","stdout","stderr"],no=e=>Y.some(t=>e[t]!==void 0),Ht=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Y.map(r=>e[r]);if(no(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Y.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Y.length);return Array.from({length:n},(r,o)=>t[o])};var Yt=g(require("node:os"),1),Zt=g(Jt(),1),ro=1e3*5,Qt=(e,t="SIGTERM",n={})=>{let r=e(t);return oo(e,t,n,r),r},oo=(e,t,n,r)=>{if(!io(t,n,r))return;let o=ao(n),i=setTimeout(()=>{e("SIGKILL")},o);i.unref&&i.unref()},io=(e,{forceKillAfterTimeout:t},n)=>so(e)&&t!==!1&&n,so=e=>e===Yt.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",ao=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return ro;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},en=(e,t)=>{e.kill()&&(t.isCanceled=!0)},co=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},tn=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let o,i=new Promise((u,c)=>{o=setTimeout(()=>{co(e,n,c)},t)}),s=r.finally(()=>{clearTimeout(o)});return Promise.race([i,s])},nn=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},rn=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let o=(0,Zt.default)(()=>{e.kill()});return r.finally(()=>{o()})};var on=require("node:fs"),sn=require("node:child_process");function ne(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Pe(e){return ne(e)&&e.writable!==!1&&typeof e.r=="function"&&typeof e.o=="object"}var uo=e=>e instanceof sn.ChildProcess&&typeof e.then=="function",Te=(e,t,n)=>{if(typeof n=="string")return e[t].pipe((0,on.createWriteStream)(n)),e;if(Pe(n))return e[t].pipe(n),e;if(!uo(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Pe(n.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(n.stdin),n},an=e=>{e.stdout!==null&&(e.pipeStdout=Te.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Te.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Te.bind(void 0,e,"all"))};var oe=require("node:fs");var Ce=g(fn(),1),mn=g(dn(),1),pn=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},yo=({input:e,inputFile:t})=>typeof t!="string"?e:(pn(e),(0,oe.readFileSync)(t)),gn=e=>{let t=yo(e);if(ne(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},bo=({input:e,inputFile:t})=>typeof t!="string"?e:(pn(e),(0,oe.createReadStream)(t)),hn=(e,t)=>{let n=bo(t);n!==void 0&&(ne(n)?n.pipe(e.stdin):e.stdin.end(n))},xn=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=(0,mn.default)();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},je=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(n){return n.bufferedData}}},Ie=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?(0,Ce.default)(e,{encoding:t,maxBuffer:r}):Ce.default.buffer(e,{maxBuffer:r})},yn=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:o,maxBuffer:i},s)=>{let u=Ie(e,{encoding:r,buffer:o,maxBuffer:i}),c=Ie(t,{encoding:r,buffer:o,maxBuffer:i}),a=Ie(n,{encoding:r,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,u,c,a])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},je(e,u),je(t,c),je(n,a)])}};var So=(async()=>{})().constructor.prototype,wo=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(So,e)]),Oe=(e,t)=>{for(let[n,r]of wo){let o=typeof t=="function"?(...i)=>Reflect.apply(r.value,t(),i):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}},bn=e=>new Promise((t,n)=>{e.on("exit",(r,o)=>{t({exitCode:r,signal:o})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var vn=require("node:buffer"),En=require("node:child_process"),Pn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],vo=/^[\w.-]+$/,Eo=/"/g,Po=e=>typeof e!="string"||vo.test(e)?e:`"${e.replace(Eo,'\\"')}"`,$e=(e,t)=>Pn(e,t).join(" "),Ne=(e,t)=>Pn(e,t).map(n=>Po(n)).join(" "),Tn=/ +/g,kn=e=>{let t=[];for(let n of e.trim().split(Tn)){let r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t},Sn=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(t==="object"&&e!==null&&!(e instanceof En.ChildProcess)&&"stdout"in e){let n=typeof e.stdout;if(n==="string")return e.stdout;if(vn.Buffer.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${n}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},wn=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e[e.length-1]}${t[0]}`,...t.slice(1)],To=({templates:e,expressions:t,tokens:n,index:r,template:o})=>{let i=o??e.raw[r],s=i.split(Tn).filter(Boolean),u=wn(n,s,i.startsWith(" "));if(r===t.length)return u;let c=t[r],a=Array.isArray(c)?c.map(f=>Sn(f)):[Sn(c)];return wn(u,a,i.endsWith(" "))},Be=(e,t)=>{let n=[];for(let[r,o]of e.entries())n=To({templates:e,expressions:t,tokens:n,index:r,template:o});return n};var jn=require("node:util"),In=g(require("node:process"),1),Cn=(0,jn.debuglog)("execa").enabled,ie=(e,t)=>String(e).padStart(t,"0"),ko=()=>{let e=new Date;return`${ie(e.getHours(),2)}:${ie(e.getMinutes(),2)}:${ie(e.getSeconds(),2)}.${ie(e.getMilliseconds(),3)}`},Fe=(e,{verbose:t})=>{t&&In.default.stderr.write(`[${ko()}] ${e}
`)};var jo=1e3*1e3*100,Io=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:o})=>{let i=t?{...U.default.env,...e}:e;return n?Ft({env:i,cwd:r,execPath:o}):i},Fn=(e,t,n={})=>{let r=Bn.default.t(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:jo,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||U.default.cwd(),execPath:U.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:Cn,...n},n.env=Io(n),n.stdio=Ht(n),U.default.platform==="win32"&&Nn.default.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},q=(e,t,n)=>typeof t!="string"&&!$n.Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?be(t):t;function Gn(e,t,n){let r=Fn(e,t,n),o=$e(e,t),i=Ne(e,t);Fe(i,r.options),nn(r.options);let s;try{s=se.default.spawn(r.file,r.args,r.options)}catch(p){let l=new se.default.ChildProcess,h=Promise.reject(M({error:p,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return Oe(l,h),l}let u=bn(s),c=tn(s,r.options,u),a=rn(s,r.options,c),f={isCanceled:!1};s.kill=Qt.bind(null,s.kill.bind(s)),s.cancel=en.bind(null,s,f);let d=At(async()=>{let[{error:p,exitCode:l,signal:h,timedOut:b},S,E,z]=await yn(s,r.options,a),K=q(r.options,S),_=q(r.options,E),Me=q(r.options,z);if(p||l!==0||h!==null){let Le=M({error:p,exitCode:l,signal:h,stdout:K,stderr:_,all:Me,command:o,escapedCommand:i,parsed:r,timedOut:b,isCanceled:f.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:s.killed});if(!r.options.reject)return Le;throw Le}return{command:o,escapedCommand:i,exitCode:0,stdout:K,stderr:_,all:Me,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return hn(s,r.options),s.all=xn(s,r.options),an(s),Oe(s,d),s}function Co(e,t,n){let r=Fn(e,t,n),o=$e(e,t),i=Ne(e,t);Fe(i,r.options);let s=gn(r.options),u;try{u=se.default.spawnSync(r.file,r.args,{...r.options,input:s})}catch(f){throw M({error:f,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let c=q(r.options,u.stdout,u.error),a=q(r.options,u.stderr,u.error);if(u.error||u.status!==0||u.signal!==null){let f=M({stdout:c,stderr:a,error:u.error,signal:u.signal,exitCode:u.status,command:o,escapedCommand:i,parsed:r,timedOut:u.error&&u.error.code==="ETIMEDOUT",isCanceled:!1,killed:u.signal!==null});if(!r.options.reject)return f;throw f}return{command:o,escapedCommand:i,exitCode:0,stdout:c,stderr:a,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Oo=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},On=(e={})=>({preferLocal:!0,...Oo(e),...e});function An(e){function t(n,...r){if(!Array.isArray(n))return An({...e,...n});let[o,...i]=Be(n,r);return Gn(o,i,On(e))}return t.sync=(n,...r)=>{if(!Array.isArray(n))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[o,...i]=Be(n,r);return Co(o,i,On(e))},t}var Vi=An();function Rn(e,t){let[n,...r]=kn(e);return Gn(n,r,t)}var tr=require("esbuild"),P=g(require("@techor/log")),j=g(require("upath"));var H=g(require("@techor/one-liner"));var $o=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],No=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Bo=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Fo=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Mn=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function ae(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};let n=t.bits?t.binary?Fo:Bo:t.binary?No:$o,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;let o=e<0,i=o?"-":t.signed?"+":"";o&&(e=-e);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),e<1){let f=Mn(e,t.locale,s);return i+f+r+n[0]}let u=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**u,s||(e=e.toPrecision(3));let c=Mn(Number(e),t.locale,s),a=n[u];return i+c+r+a}var nr=g(require("normalize-path")),Ge=g(require("fs")),rr=g(require("lodash.isequal"));var Ln=["sourcemap","legalComments","sourceRoot","sourcesContent","format","globalName","target","supported","platform","mangleProps","reserveProps","mangleQuoted","mangleCache","drop","minify","minifyWhitespace","minifyIdentifiers","minifySyntax","charset","treeShaking","ignoreAnnotations","jsx","jsxFactory","jsxFragment","jsxImportSource","jsxDev","jsxSideEffects","define","pure","keepNames","color","logLevel","logLimit","logOverride","bundle","splitting","preserveSymlinks","outfile","metafile","outdir","outbase","external","packages","alias","loader","resolveExtensions","mainFields","conditions","write","allowOverwrite","tsconfig","outExtension","publicPath","entryNames","chunkNames","assetNames","inject","banner","footer","incremental","entryPoints","stdin","plugins","absWorkingDir","nodePaths","watch"];var Dn=g(require("fs")),Un=g(require("fast-glob")),k=g(require("upath"));function qn(e=".js",t="src"){let n=k.default.resolve(t);return{name:"fill-module-ext",setup(r){let o={};o.promise=new Promise(i=>{o.resolve=i}),r.onStart(()=>{o.resolve(!0)}),r.onLoad({filter:/\.(?:ts|tsx|js|jsx|mjs|mts)$/},async i=>{if(await o.promise===!0){let s=await Dn.default.promises.readFile(i.path,{encoding:"utf8"}),u=k.default.dirname(i.path);return{contents:s.replace(/((?:(?:import|export)(?:.*from | ))|(?:(?:import))\()'((\.(?:\.)?\/.*)|\.)'/gmi,(...c)=>{let a=c[2],f=k.default.parse(a);if(f.ext)return c[0];let m=k.default.resolve(u,a),d=Un.default.sync([m+".{ts,js,mjs,jsx,tsx,mjs,mts}",k.default.join(m,"index.{ts,js,mjs,jsx,tsx,mjs,mts}")])[0];if(!d)return c[0];let p=k.default.relative(n,k.default.changeExt(d,e)),l=k.default.parse(p);return a==="."||a==="./"?p="./index"+e:l.name===f.name?p=a+e:p=a+"/index"+e,`${c[1]}'${p}'`}),loader:"tsx"}}})}}}var Wn=g(require("fs")),Hn={name:"remove-import-svelte-module-extension",setup(e){let t={};t.promise=new Promise(n=>{t.resolve=n}),e.onStart(()=>{t.resolve(!0)}),e.onLoad({filter:/\.(?:ts|tsx|js|jsx|mjs|mts)$/},async n=>{if(await t.promise===!0)return{contents:(await Wn.default.promises.readFile(n.path,{encoding:"utf8"})).replace(/((?:(?:import|export)(?:.*from | ))|(?:(?:import))\()(')(\.(?:\.)?\/.*)(\.svelte)(')/gmi,(...o)=>o[1]+o[2]+o[3]+o[5]),loader:"ts"}})}};var or=g(require("@techor/extend"));var Kn=g(require("upath")),ce=g(require("@techor/log"));var Go={cwd:process.cwd()},zn=Go;var _n=g(require("fast-glob")),Vn=g(require("x-import")),Xn=g(require("@techor/extend")),W=class{options;constructor(...t){this.options=(0,Xn.default)(zn,...t)}logConfigFound=t=>ce.default.ok`**${t}** config file found`;logConfigNotFound=t=>ce.default.i`No **${t}** config file found`;readConfig(t="config"){let{config:n,cwd:r}=this.options;if(typeof n=="object")return n;let o;try{let i=this.configPath;if(i){let s=(0,Vn.default)(i,{cwd:r});o=(t?s[t]:void 0)||s.default||s,this.logConfigFound(i)}else this.logConfigNotFound(n)}catch(i){ce.default.error(i)}return o}get configPath(){let{cwd:t,config:n}=this.options;if(!(!n||typeof n!="string"))return _n.default.sync(n,{cwd:t})[0]}get resolvedConfigPath(){let t=this.configPath;return t?Kn.default.resolve(this.options.cwd,t):""}};var Ao=new W({config:"techor.{js,ts,cjs,mjs}"}),Jn=Ao;var Ro={js:"cjs",cjs:"cjs",mjs:"esm",css:"css"},y=O(),{dependencies:Yn,peerDependencies:Zn}=y,Ae=[];Yn&&Ae.push(...Object.keys(Yn));Zn&&Ae.push(...Object.keys(Zn));Qn.program.command("pack [entryPaths...]").option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`",["cjs","esm"]).option("-t, --shakable-format [formats...]","Tree-shakable module's formats",["cjs","esm"]).option("--shakable","Enable outputting tree-shakable modules",!1).option("-w, --watch","Rebuild whenever a file changes",!1).option("-s, --sourcemap","Emit a source map",process.env.NODE_ENV==="production").option("-p, --platform <node,browser,neutral>","Platform target","browser").option("-t, --type","Emit typescript declarations",y.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-o, --serve","Serve mode starts a web server that serves your code to your browser on your device",!1).option("-e, --external <packages...>","External packages to exclude from the build",Ae).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-re, --resolve-extensions [extensions...]","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".css",".json"]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).option("--cjs-ext <ext>","Specify CommonJS default file extension",".js").option("--iife-ext <ext>","Specify CommonJS default file extension",".js").option("--esm-ext <ext>","Specify CommonJS default file extension",".mjs").option("--framework <name>","Specify a framework like `svelte` to resolve related issues automatically").option("--srcdir <dir>","The source directory","src").option("--target","This sets the target environment for the generated JavaScript and/or CSS code.","esnext").option("--mangle-props","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression","^_").option("--no-bundle","OFF: Inline any imported dependencies into the file itself",!0).option("--no-minify","OFF: Minify the generated code").option("--no-clean","OFF: Clean up the previous output directory before the build starts").action(async function(e,t,n){t.clean&&Ge.default.existsSync(t.outdir)&&(Ge.default.rmSync(t.outdir,{force:!0,recursive:!0}),console.log(""),P.default.d`Cleaned up the **${t.outdir}** output directory`);let r=Jn.readConfig(null),o=[],i=(c,a)=>{let f=j.default.relative(t.outdir,c),m=j.default.join(t.srcdir,f);return j.default.changeExt(m,a)},s=async(c,a)=>{let f=a.format==="css",m=a.ext||a.outFile&&j.default.extname(a.outFile)||void 0,d=[...t.external,...t.extraExternal],p=a.outdir||t.outdir;t.bundle&&a.softBundle&&d.push(".*");let l=(0,or.default)(t,{outExtension:f?{".css":".css"}:{".js":m||{cjs:t.cjsExt,esm:t.esmExt,iife:t.iifeExt}[a.format]},logLevel:"info",outdir:p,outbase:t.srcdir,platform:a.platform||t.platform,metafile:!0,format:f?void 0:a.format,keepNames:t.keepNames,resolveExtensions:t.resolveExtensions,mangleProps:t.mangleProps?new RegExp(t.mangleProps):void 0,target:t.target,sourcemap:t.sourcemap,external:d,plugins:[]},r?.pack);switch(t.bundle||delete l.external,t.framework){case"svelte":l.plugins.push(Hn);break}a.softBundle&&a.format==="esm"&&l.plugins.push(qn(t.esmExt)),delete l.watch,delete l.serve,delete l.framework;for(let b in l)Ln.includes(b)||delete l[b];if(l.entryPoints=er.default.sync([...new Set(c)].map(b=>(0,nr.default)(b))).filter(b=>!o.find(S=>S.options.entryPoints.includes(b)&&S.options.format===l.format&&(0,rr.default)(S.options.outExtension,l.outExtension)&&S.options.outdir===l.outdir)),!l.entryPoints.length)return;let h={options:l,run:async()=>{let b=await(0,tr.context)(l),{metafile:S}=await b.rebuild();if(S){console.log(""),h.metafile=S;for(let E in S.outputs){let z=S.outputs[E],K=ae(z.bytes).replace(/ /g,""),_=S.outputs[E].format=a.format;P.default`${P.chalk.dim("\u2502")} $t [${_}] **${E}** ${K} (${Object.keys(z.inputs).length} inputs)`}P.default.tree({entries:l.entryPoints,external:l.external,outdir:l.outdir,format:l.format,platform:l.platform,[Object.keys(l).filter(E=>l[E]===!0).map(E=>P.chalk.green("\u2713 ")+E).join(", ")]:null})}t.watch?await b.watch():await b.dispose(),t.serve&&await b.serve()}};o.push(h)};if(t.shakable&&t.shakableFormat.length&&t.shakableFormat.forEach(c=>s([j.default.join(t.srcdir,"**/*.{js,ts,jsx,tsx,mjs,mts}")],{format:c,platform:"node",outdir:j.default.join(t.outdir,c),softBundle:!0})),e.length){let c=e.filter(f=>f.includes(".css")),a=e.filter(f=>!f.includes(".css"));c.length&&s(c,{format:"css"}),a.length&&t.format.forEach(f=>s(a,{format:f}))}else if(y.exports&&function c(a,f,m){if(typeof a=="string"){let d=j.default.extname(a);s([i(a,".{js,ts,jsx,tsx,mjs,mts}")],{format:m.format||Ro[d],outFile:m.outFile||a,platform:m.platform})}else for(let d in a){let p=a[d],l,h;switch(f){case"node":h="node";break;case"browser":h="browser";break;case"require":l="cjs";break;case"import":l="esm";break}if(d.startsWith("."))c(p,d);else switch(d){case"node":c(p,d,{platform:"node",format:l});break;case"browser":c(p,d,{platform:"browser",format:l});break;case"default":c(p,d,{platform:h,format:l});break;case"require":c(p,d,{platform:h,format:"cjs"});break;case"import":c(p,d,{platform:h,format:"esm"});break}}}(y.exports,""),y.style&&s([i(y.main,".css")],{format:"css"}),y.main&&!y.main.endsWith(".css")&&s([i(y.main,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",outFile:y.main}),y.module&&s([i(y.module,".{js,ts,jsx,tsx,mjs,mts}")],{format:"esm",outFile:y.module}),y.browser&&s([i(y.browser,".{js,ts,jsx,tsx,mjs,mts}")],{format:"iife",platform:"browser",outFile:y.browser}),y.bin)if(typeof y.bin=="string")s([i(y.bin,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:y.bin});else for(let c in y.bin){let a=y.bin[c];s([i(a,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:a})}o.length||t.format.map(c=>s([j.default.join(t.srcdir,"index.ts")],{format:c}));let u;t.type&&(u={outFile:"declarations",options:{platform:"type",format:"dts"},run:()=>new Promise(c=>{let a=()=>Rn(H.default`
`.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}var R=p(require("node:process"),1),F=p(require("node:path"),1),$t=p(require("node:url"),1);function J(e={}){let{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}function Lr(e={}){let{cwd:t=R.default.cwd(),path:n=R.default.env[J()],execPath:r=R.default.execPath}=e,o,i=t instanceof URL?$t.default.fileURLToPath(t):t,s=F.default.resolve(i),u=[];for(;o!==s;)u.push(F.default.join(s,"node_modules/.bin")),o=s,s=F.default.resolve(s,"..");return u.push(F.default.resolve(i,r,"..")),[...u,n].join(F.default.delimiter)}function Ft({env:e=R.default.env,...t}={}){e={...e};let n=J({env:e});return t.path=e[n],e[n]=Lr(t),e}var Dr=(e,t,n,r)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;let o=Object.getOwnPropertyDescriptor(e,n),i=Object.getOwnPropertyDescriptor(t,n);!Ur(o,i)&&r||Object.defineProperty(e,n,i)},Ur=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},qr=(e,t)=>{let n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Wr=(e,t)=>`/* Wrapped ${e}*/
${t}`,Hr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),zr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Kr=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=Wr.bind(null,r,t.toString());Object.defineProperty(o,"name",zr),Object.defineProperty(e,"toString",{...Hr,value:o})};function Se(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let o of Reflect.ownKeys(t))Dr(e,t,o,n);return qr(e,t),Kr(e,t,r),e}var Y=new WeakMap,Bt=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(Y.set(i,++r),r===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return n};return Se(i,e),Y.set(i,r),i};Bt.callCount=e=>{if(!Y.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Y.get(e)};var Nt=Bt;var Dt=require("node:os");var Gt=()=>{let e=Rt-At+1;return Array.from({length:e},Vr)},Vr=(e,t)=>({name:`SIGRT${t+1}`,number:At+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),At=34,Rt=64;var Lt=require("node:os");var Mt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var we=()=>{let e=Gt();return[...Mt,...e].map(Xr)},Xr=({name:e,number:t,description:n,action:r,forced:o=!1,standard:i})=>{let{signals:{[e]:s}}=Lt.constants,u=s!==void 0;return{name:e,number:u?s:t,description:n,supported:u,action:r,forced:o,standard:i}};var _r=()=>{let e=we();return Object.fromEntries(e.map(Jr))},Jr=({name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s})=>[e,{name:e,number:t,description:n,supported:r,action:o,forced:i,standard:s}],Ut=_r(),Yr=()=>{let e=we(),t=64+1,n=Array.from({length:t},(r,o)=>Zr(o,e));return Object.assign({},...n)},Zr=(e,t)=>{let n=Qr(e,t);if(n===void 0)return{};let{name:r,description:o,supported:i,action:s,forced:u,standard:a}=n;return{[e]:{name:r,number:e,description:o,supported:i,action:s,forced:u,standard:a}}},Qr=(e,t)=>{let n=t.find(({name:r})=>Dt.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},pi=Yr();var eo=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",M=({stdout:e,stderr:t,all:n,error:r,signal:o,exitCode:i,command:s,escapedCommand:u,timedOut:a,isCanceled:c,killed:l,parsed:{options:{timeout:m}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let d=o===void 0?void 0:Ut[o].description,g=r&&r.code,h=`Command ${eo({timedOut:a,timeout:m,errorCode:g,signal:o,signalDescription:d,exitCode:i,isCanceled:c})}: ${s}`,b=Object.prototype.toString.call(r)==="[object Error]",v=b?`${h}
${r.message}`:h,E=[v,t,e].filter(Boolean).join(`
`);return b?(r.originalMessage=r.message,r.message=E):r=new Error(E),r.shortMessage=v,r.command=s,r.escapedCommand=u,r.exitCode=i,r.signal=o,r.signalDescription=d,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!a,r.isCanceled=c,r.killed=l&&!a,r};var Z=["stdin","stdout","stderr"],to=e=>Z.some(t=>e[t]!==void 0),qt=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return Z.map(r=>e[r]);if(to(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Z.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let n=Math.max(t.length,Z.length);return Array.from({length:n},(r,o)=>t[o])};var _t=p(require("node:os"),1),Jt=p(Xt(),1),no=1e3*5,Yt=(e,t="SIGTERM",n={})=>{let r=e(t);return ro(e,t,n,r),r},ro=(e,t,n,r)=>{if(!oo(t,n,r))return;let o=so(n),i=setTimeout(()=>{e("SIGKILL")},o);i.unref&&i.unref()},oo=(e,{forceKillAfterTimeout:t},n)=>io(e)&&t!==!1&&n,io=e=>e===_t.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",so=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return no;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Zt=(e,t)=>{e.kill()&&(t.isCanceled=!0)},ao=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Qt=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let o,i=new Promise((u,a)=>{o=setTimeout(()=>{ao(e,n,a)},t)}),s=r.finally(()=>{clearTimeout(o)});return Promise.race([i,s])},en=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},tn=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;let o=(0,Jt.default)(()=>{e.kill()});return r.finally(()=>{o()})};var nn=require("node:fs"),rn=require("node:child_process");function re(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Pe(e){return re(e)&&e.writable!==!1&&typeof e.r=="function"&&typeof e.o=="object"}var co=e=>e instanceof rn.ChildProcess&&typeof e.then=="function",Te=(e,t,n)=>{if(typeof n=="string")return e[t].pipe((0,nn.createWriteStream)(n)),e;if(Pe(n))return e[t].pipe(n),e;if(!co(n))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Pe(n.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(n.stdin),n},on=e=>{e.stdout!==null&&(e.pipeStdout=Te.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=Te.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=Te.bind(void 0,e,"all"))};var ie=require("node:fs");var Ce=p(cn(),1),fn=p(ln(),1),dn=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},xo=({input:e,inputFile:t})=>typeof t!="string"?e:(dn(e),(0,ie.readFileSync)(t)),mn=e=>{let t=xo(e);if(re(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},yo=({input:e,inputFile:t})=>typeof t!="string"?e:(dn(e),(0,ie.createReadStream)(t)),pn=(e,t)=>{let n=yo(t);n!==void 0&&(re(n)?n.pipe(e.stdin):e.stdin.end(n))},gn=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let n=(0,fn.default)();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},ke=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(n){return n.bufferedData}}},Ie=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?(0,Ce.default)(e,{encoding:t,maxBuffer:r}):Ce.default.buffer(e,{maxBuffer:r})},hn=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:o,maxBuffer:i},s)=>{let u=Ie(e,{encoding:r,buffer:o,maxBuffer:i}),a=Ie(t,{encoding:r,buffer:o,maxBuffer:i}),c=Ie(n,{encoding:r,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,u,a,c])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},ke(e,u),ke(t,a),ke(n,c)])}};var bo=(async()=>{})().constructor.prototype,So=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(bo,e)]),Oe=(e,t)=>{for(let[n,r]of So){let o=typeof t=="function"?(...i)=>Reflect.apply(r.value,t(),i):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:o})}},xn=e=>new Promise((t,n)=>{e.on("exit",(r,o)=>{t({exitCode:r,signal:o})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var Sn=require("node:buffer"),wn=require("node:child_process"),vn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],wo=/^[\w.-]+$/,vo=/"/g,Eo=e=>typeof e!="string"||wo.test(e)?e:`"${e.replace(vo,'\\"')}"`,$e=(e,t)=>vn(e,t).join(" "),Fe=(e,t)=>vn(e,t).map(n=>Eo(n)).join(" "),En=/ +/g,Pn=e=>{let t=[];for(let n of e.trim().split(En)){let r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t},yn=e=>{let t=typeof e;if(t==="string")return e;if(t==="number")return String(e);if(t==="object"&&e!==null&&!(e instanceof wn.ChildProcess)&&"stdout"in e){let n=typeof e.stdout;if(n==="string")return e.stdout;if(Sn.Buffer.isBuffer(e.stdout))return e.stdout.toString();throw new TypeError(`Unexpected "${n}" stdout in template expression`)}throw new TypeError(`Unexpected "${t}" in template expression`)},bn=(e,t,n)=>n||e.length===0||t.length===0?[...e,...t]:[...e.slice(0,-1),`${e[e.length-1]}${t[0]}`,...t.slice(1)],Po=({templates:e,expressions:t,tokens:n,index:r,template:o})=>{let i=o??e.raw[r],s=i.split(En).filter(Boolean),u=bn(n,s,i.startsWith(" "));if(r===t.length)return u;let a=t[r],c=Array.isArray(a)?a.map(l=>yn(l)):[yn(a)];return bn(u,c,i.endsWith(" "))},Be=(e,t)=>{let n=[];for(let[r,o]of e.entries())n=Po({templates:e,expressions:t,tokens:n,index:r,template:o});return n};var Tn=require("node:util"),jn=p(require("node:process"),1),kn=(0,Tn.debuglog)("execa").enabled,se=(e,t)=>String(e).padStart(t,"0"),To=()=>{let e=new Date;return`${se(e.getHours(),2)}:${se(e.getMinutes(),2)}:${se(e.getSeconds(),2)}.${se(e.getMilliseconds(),3)}`},Ne=(e,{verbose:t})=>{t&&jn.default.stderr.write(`[${To()}] ${e}
`)};var jo=1e3*1e3*100,ko=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:o})=>{let i=t?{...U.default.env,...e}:e;return n?Ft({env:i,cwd:r,execPath:o}):i},Fn=(e,t,n={})=>{let r=$n.default.t(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:jo,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||U.default.cwd(),execPath:U.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:kn,...n},n.env=ko(n),n.stdio=qt(n),U.default.platform==="win32"&&On.default.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},q=(e,t,n)=>typeof t!="string"&&!Cn.Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?be(t):t;function Bn(e,t,n){let r=Fn(e,t,n),o=$e(e,t),i=Fe(e,t);Ne(i,r.options),en(r.options);let s;try{s=ae.default.spawn(r.file,r.args,r.options)}catch(g){let f=new ae.default.ChildProcess,h=Promise.reject(M({error:g,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return Oe(f,h),f}let u=xn(s),a=Qt(s,r.options,u),c=tn(s,r.options,a),l={isCanceled:!1};s.kill=Yt.bind(null,s.kill.bind(s)),s.cancel=Zt.bind(null,s,l);let d=Nt(async()=>{let[{error:g,exitCode:f,signal:h,timedOut:b},v,E,K]=await hn(s,r.options,c),V=q(r.options,v),X=q(r.options,E),Re=q(r.options,K);if(g||f!==0||h!==null){let Me=M({error:g,exitCode:f,signal:h,stdout:V,stderr:X,all:Re,command:o,escapedCommand:i,parsed:r,timedOut:b,isCanceled:l.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:s.killed});if(!r.options.reject)return Me;throw Me}return{command:o,escapedCommand:i,exitCode:0,stdout:V,stderr:X,all:Re,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return pn(s,r.options),s.all=gn(s,r.options),on(s),Oe(s,d),s}function Io(e,t,n){let r=Fn(e,t,n),o=$e(e,t),i=Fe(e,t);Ne(i,r.options);let s=mn(r.options),u;try{u=ae.default.spawnSync(r.file,r.args,{...r.options,input:s})}catch(l){throw M({error:l,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let a=q(r.options,u.stdout,u.error),c=q(r.options,u.stderr,u.error);if(u.error||u.status!==0||u.signal!==null){let l=M({stdout:a,stderr:c,error:u.error,signal:u.signal,exitCode:u.status,command:o,escapedCommand:i,parsed:r,timedOut:u.error&&u.error.code==="ETIMEDOUT",isCanceled:!1,killed:u.signal!==null});if(!r.options.reject)return l;throw l}return{command:o,escapedCommand:i,exitCode:0,stdout:a,stderr:c,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Co=({input:e,inputFile:t,stdio:n})=>e===void 0&&t===void 0&&n===void 0?{stdin:"inherit"}:{},In=(e={})=>({preferLocal:!0,...Co(e),...e});function Nn(e){function t(n,...r){if(!Array.isArray(n))return Nn({...e,...n});let[o,...i]=Be(n,r);return Bn(o,i,In(e))}return t.sync=(n,...r)=>{if(!Array.isArray(n))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[o,...i]=Be(n,r);return Io(o,i,In(e))},t}var zi=Nn();function Gn(e,t){let[n,...r]=Pn(e);return Bn(n,r,t)}var Qn=require("esbuild"),P=p(require("@techor/log")),k=p(require("upath")),H=p(require("@techor/one-liner"));var Oo=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],$o=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Fo=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Bo=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],An=(e,t,n)=>{let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r};function ce(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,...t};let n=t.bits?t.binary?Bo:Fo:t.binary?$o:Oo,r=t.space?" ":"";if(t.signed&&e===0)return` 0${r}${n[0]}`;let o=e<0,i=o?"-":t.signed?"+":"";o&&(e=-e);let s;if(t.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:t.maximumFractionDigits,...s}),e<1){let l=An(e,t.locale,s);return i+l+r+n[0]}let u=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),n.length-1);e/=(t.binary?1024:1e3)**u,s||(e=e.toPrecision(3));let a=An(Number(e),t.locale,s),c=n[u];return i+a+r+c}var er=p(require("normalize-path")),Ge=p(require("fs")),tr=p(require("lodash.isequal"));var Rn=["sourcemap","legalComments","sourceRoot","sourcesContent","format","globalName","target","supported","platform","mangleProps","reserveProps","mangleQuoted","mangleCache","drop","minify","minifyWhitespace","minifyIdentifiers","minifySyntax","charset","treeShaking","ignoreAnnotations","jsx","jsxFactory","jsxFragment","jsxImportSource","jsxDev","jsxSideEffects","define","pure","keepNames","color","logLevel","logLimit","logOverride","bundle","splitting","preserveSymlinks","outfile","metafile","outdir","outbase","external","packages","alias","loader","resolveExtensions","mainFields","conditions","write","allowOverwrite","tsconfig","outExtension","publicPath","entryNames","chunkNames","assetNames","inject","banner","footer","incremental","entryPoints","stdin","plugins","absWorkingDir","nodePaths","watch"];var Mn=p(require("fs")),Ln=p(require("fast-glob")),j=p(require("upath"));function Dn(e=".js",t="src"){let n=j.default.resolve(t);return{name:"fill-module-ext",setup(r){let o={};o.promise=new Promise(i=>{o.resolve=i}),r.onStart(()=>{o.resolve(!0)}),r.onLoad({filter:/\.(?:ts|tsx|js|jsx|mjs|mts)$/},async i=>{if(await o.promise===!0){let s=await Mn.default.promises.readFile(i.path,{encoding:"utf8"}),u=j.default.dirname(i.path);return{contents:s.replace(/((?:(?:import|export)(?:.*from | ))|(?:(?:import))\()'((\.(?:\.)?\/.*)|\.)'/gmi,(...a)=>{let c=a[2],l=j.default.parse(c);if(l.ext)return a[0];let m=j.default.resolve(u,c),d=Ln.default.sync([m+".{ts,js,mjs,jsx,tsx,mjs,mts}",j.default.join(m,"index.{ts,js,mjs,jsx,tsx,mjs,mts}")])[0];if(!d)return a[0];let g=j.default.relative(n,j.default.changeExt(d,e)),f=j.default.parse(g);return c==="."||c==="./"?g="./index"+e:f.name===l.name?g=c+e:g=c+"/index"+e,`${a[1]}'${g}'`}),loader:"tsx"}}})}}}var Un=p(require("fs")),qn={name:"remove-import-svelte-module-extension",setup(e){let t={};t.promise=new Promise(n=>{t.resolve=n}),e.onStart(()=>{t.resolve(!0)}),e.onLoad({filter:/\.(?:ts|tsx|js|jsx|mjs|mts)$/},async n=>{if(await t.promise===!0)return{contents:(await Un.default.promises.readFile(n.path,{encoding:"utf8"})).replace(/((?:(?:import|export)(?:.*from | ))|(?:(?:import))\()(')(\.(?:\.)?\/.*)(\.svelte)(')/gmi,(...o)=>o[1]+o[2]+o[3]+o[5]),loader:"ts"}})}};var nr=p(require("@techor/extend"));var Hn=p(require("upath")),ue=p(require("@techor/log"));var No={cwd:process.cwd()},Wn=No;var zn=p(require("fast-glob")),Kn=p(require("cross-import")),Vn=p(require("@techor/extend")),W=class{options;constructor(...t){this.options=(0,Vn.default)(Wn,...t)}logConfigFound=t=>ue.default.ok`**${t}** config file found`;logConfigNotFound=t=>ue.default.i`No **${t}** config file found`;readConfig(t="config"){let{config:n,cwd:r}=this.options;if(typeof n=="object")return n;let o;try{let i=this.configPath;if(i){let s=(0,Kn.default)(i,{cwd:r});o=(t?s[t]:void 0)||s.default||s,this.logConfigFound(i)}else this.logConfigNotFound(n)}catch(i){ue.default.error(i)}return o}get configPath(){let{cwd:t,config:n}=this.options;if(!(!n||typeof n!="string"))return zn.default.sync(n,{cwd:t})[0]}get resolvedConfigPath(){let t=this.configPath;return t?Hn.default.resolve(this.options.cwd,t):""}};var Go=new W({config:"techor.{js,ts,cjs,mjs}"}),Xn=Go;var rr=require("@techor/fs"),Ao={js:"cjs",cjs:"cjs",mjs:"esm",css:"css"},y=(0,rr.readFileAsJSON)("./package.json"),{dependencies:_n,peerDependencies:Jn}=y,Ae=[];_n&&Ae.push(...Object.keys(_n));Jn&&Ae.push(...Object.keys(Jn));Yn.program.command("pack [entryPaths...]").option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`",["cjs","esm"]).option("-t, --shakable-format [formats...]","Tree-shakable module's formats",["cjs","esm"]).option("--shakable","Enable outputting tree-shakable modules",!1).option("-w, --watch","Rebuild whenever a file changes",!1).option("-s, --sourcemap","Emit a source map",process.env.NODE_ENV==="production").option("-p, --platform <node,browser,neutral>","Platform target","browser").option("-t, --type","Emit typescript declarations",y.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-o, --serve","Serve mode starts a web server that serves your code to your browser on your device",!1).option("-e, --external <packages...>","External packages to exclude from the build",Ae).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-re, --resolve-extensions [extensions...]","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".css",".json"]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).option("--cjs-ext <ext>","Specify CommonJS default file extension",".js").option("--iife-ext <ext>","Specify CommonJS default file extension",".js").option("--esm-ext <ext>","Specify CommonJS default file extension",".mjs").option("--framework <name>","Specify a framework like `svelte` to resolve related issues automatically").option("--srcdir <dir>","The source directory","src").option("--target","This sets the target environment for the generated JavaScript and/or CSS code.","esnext").option("--mangle-props","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression","^_").option("--no-bundle","OFF: Inline any imported dependencies into the file itself",!0).option("--no-minify","OFF: Minify the generated code").option("--no-clean","OFF: Clean up the previous output directory before the build starts").action(async function(e,t,n){t.clean&&Ge.default.existsSync(t.outdir)&&(Ge.default.rmSync(t.outdir,{force:!0,recursive:!0}),console.log(""),P.default.d`Cleaned up the **${t.outdir}** output directory`);let r=Xn.readConfig(null),o=[],i=(a,c)=>{let l=k.default.relative(t.outdir,a),m=k.default.join(t.srcdir,l);return k.default.changeExt(m,c)},s=async(a,c)=>{let l=c.format==="css",m=c.ext||c.outFile&&k.default.extname(c.outFile)||void 0,d=[...t.external,...t.extraExternal],g=c.outdir||t.outdir;t.bundle&&c.softBundle&&d.push(".*");let f=(0,nr.default)(t,{outExtension:l?{".css":".css"}:{".js":m||{cjs:t.cjsExt,esm:t.esmExt,iife:t.iifeExt}[c.format]},logLevel:"info",outdir:g,outbase:t.srcdir,platform:c.platform||t.platform,metafile:!0,format:l?void 0:c.format,keepNames:t.keepNames,resolveExtensions:t.resolveExtensions,mangleProps:t.mangleProps?new RegExp(t.mangleProps):void 0,target:t.target,sourcemap:t.sourcemap,external:d,plugins:[]},r?.pack);switch(t.bundle||delete f.external,t.framework){case"svelte":f.plugins.push(qn);break}c.softBundle&&c.format==="esm"&&f.plugins.push(Dn(t.esmExt)),delete f.watch,delete f.serve,delete f.framework;for(let b in f)Rn.includes(b)||delete f[b];if(f.entryPoints=Zn.default.sync([...new Set(a)].map(b=>(0,er.default)(b))).filter(b=>!o.find(v=>v.options.entryPoints.includes(b)&&v.options.format===f.format&&(0,tr.default)(v.options.outExtension,f.outExtension)&&v.options.outdir===f.outdir)),!f.entryPoints.length)return;let h={options:f,run:async()=>{let b=await(0,Qn.context)(f),{metafile:v}=await b.rebuild();if(v){console.log(""),h.metafile=v;for(let E in v.outputs){let K=v.outputs[E],V=ce(K.bytes).replace(/ /g,""),X=v.outputs[E].format=c.format;P.default`${P.chalk.dim("\u2502")} $t [${X}] **${E}** ${V} (${Object.keys(K.inputs).length} inputs)`}P.default.tree({entries:f.entryPoints,external:f.external,outdir:f.outdir,format:f.format,platform:f.platform,[Object.keys(f).filter(E=>f[E]===!0).map(E=>P.chalk.green("\u2713 ")+E).join(", ")]:null})}t.watch?await b.watch():await b.dispose(),t.serve&&await b.serve()}};o.push(h)};if(t.shakable&&t.shakableFormat.length&&t.shakableFormat.forEach(a=>s([k.default.join(t.srcdir,"**/*.{js,ts,jsx,tsx,mjs,mts}")],{format:a,platform:"node",outdir:k.default.join(t.outdir,a),softBundle:!0})),e.length){let a=e.filter(l=>l.includes(".css")),c=e.filter(l=>!l.includes(".css"));a.length&&s(a,{format:"css"}),c.length&&t.format.forEach(l=>s(c,{format:l}))}else if(y.exports&&function a(c,l,m){if(typeof c=="string"){let d=k.default.extname(c);s([i(c,".{js,ts,jsx,tsx,mjs,mts}")],{format:m.format||Ao[d],outFile:m.outFile||c,platform:m.platform})}else for(let d in c){let g=c[d],f,h;switch(l){case"node":h="node";break;case"browser":h="browser";break;case"require":f="cjs";break;case"import":f="esm";break}if(d.startsWith("."))a(g,d);else switch(d){case"node":a(g,d,{platform:"node",format:f});break;case"browser":a(g,d,{platform:"browser",format:f});break;case"default":a(g,d,{platform:h,format:f});break;case"require":a(g,d,{platform:h,format:"cjs"});break;case"import":a(g,d,{platform:h,format:"esm"});break}}}(y.exports,""),y.style&&s([i(y.main,".css")],{format:"css"}),y.main&&!y.main.endsWith(".css")&&s([i(y.main,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",outFile:y.main}),y.module&&s([i(y.module,".{js,ts,jsx,tsx,mjs,mts}")],{format:"esm",outFile:y.module}),y.browser&&s([i(y.browser,".{js,ts,jsx,tsx,mjs,mts}")],{format:"iife",platform:"browser",outFile:y.browser}),y.bin)if(typeof y.bin=="string")s([i(y.bin,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:y.bin});else for(let a in y.bin){let c=y.bin[a];s([i(c,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:c})}o.length||t.format.map(a=>s([k.default.join(t.srcdir,"index.ts")],{format:a}));let u;t.type&&(u={outFile:"declarations",options:{platform:"type",format:"dts"},run:()=>new Promise(a=>{let c=()=>Gn(H.default`
npx tsc --emitDeclarationOnly --preserveWatchOutput --declaration
--outDir ${t.outdir}
${t.watch&&"--watch"}
`,{stdio:"inherit",stripFinalNewline:!1}).catch(f=>{process.exit()}).finally(c);t.watch?setTimeout(a,100):a()})},t.watch||o.push(u)),await Promise.all(o.map(({run:c})=>c())),console.log(""),t.watch&&u&&o.push(u);for(let c of o)c.metafile?Object.keys(c.metafile.outputs).forEach(a=>{let f=c.metafile.outputs[a],m=ae(f.bytes).replace(/ /g,""),d=f.format;P.default.ok(H.l`[${c.options.platform}] **${a}** ${m} (${d})`)}):P.default.ok(H.l`[${c.options.format}] **${c.outFile}** (${c.options.format})`);console.log(""),t.watch?P.default`Start watching ${o.length} build tasks`:P.default.success`${o.length} build tasks`,console.log(""),t.watch&&u&&await u.run()});var{version:Mo,name:Lo,description:Do}=O(ir.default.join(__dirname,"../../package.json"));Re.program.name(Lo).description(Do).version(Mo);Re.program.parse();
`,{stdio:"inherit",stripFinalNewline:!1}).catch(l=>{process.exit()}).finally(a);t.watch?setTimeout(c,100):c()})},t.watch||o.push(u)),await Promise.all(o.map(({run:a})=>a())),console.log(""),t.watch&&u&&o.push(u);for(let a of o)a.metafile?Object.keys(a.metafile.outputs).forEach(c=>{let l=a.metafile.outputs[c],m=ce(l.bytes).replace(/ /g,""),d=l.format;P.default.ok(H.l`[${a.options.platform}] **${c}** ${m} (${d})`)}):P.default.ok(H.l`[${a.options.format}] **${a.outFile}** (${a.options.format})`);console.log(""),t.watch?P.default`Start watching ${o.length} build tasks`:P.default.success`${o.length} build tasks`,console.log(""),t.watch&&u&&await u.run()});var or=require("@techor/fs"),{version:Ro,name:Mo,description:Lo}=(0,or.readFileAsJSON)("./package.json");z.program.name(Mo);z.program.description(Lo);z.program.version(Ro);z.program.parse();
#!/usr/bin/env node
var t=Object.create;var m=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var v=(r,o,e,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of d(o))!g.call(r,i)&&i!==e&&m(r,i,{get:()=>o[i],enumerable:!(a=c(o,i))||a.enumerable});return r};var j=(r,o,e)=>(e=r!=null?t(f(r)):{},v(o||!r||!r.__esModule?m(e,"default",{value:r,enumerable:!0}):e,r));var n=require("commander"),p=j(require("path")),u=require("../commands"),s=require("../utils/read-package"),{version:k,name:_,description:b}=(0,s.readPackage)(p.default.join(__dirname,"../../package.json"));n.program.name(_).description(b).version(k);n.program.parse();
var r=require("commander"),s=require("../commands"),o=require("@techor/fs"),{version:e,name:i,description:n}=(0,o.readFileAsJSON)("./package.json");r.program.name(i);r.program.description(n);r.program.version(e);r.program.parse();
var Te=Object.create;var V=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Oe=Object.getPrototypeOf,$e=Object.prototype.hasOwnProperty;var Ne=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Ae=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ce(e))!$e.call(t,n)&&n!==o&&V(t,n,{get:()=>e[n],enumerable:!(r=Be(e,n))||r.enumerable});return t};var p=(t,e,o)=>(o=t!=null?Te(Oe(t)):{},Ae(e||!t||!t.__esModule?V(o,"default",{value:t,enumerable:!0}):o,t));var ee=Ne((et,F)=>{"use strict";var X=require("child_process"),q=require("./lib/parse"),z=require("./lib/enoent");function Q(t,e,o){let r=q(t,e,o),n=X.spawn(r.command,r.args,r.options);return z.hookChildProcess(n,r),n}function Me(t,e,o){let r=q(t,e,o),n=X.spawnSync(r.command,r.args,r.options);return n.error=n.error||z.verifyENOENTSync(n.status,r),n}F.exports=Q;F.exports.spawn=Q;F.exports.sync=Me;F.exports.e=q;F.exports.t=z});var ye=require("commander"),xe=p(require("fast-glob"));var ie=require("node:buffer"),ae=p(require("node:path"),1),L=p(require("node:child_process"),1),B=p(require("node:process"),1),le=p(ee(),1);function K(t){let e=typeof t=="string"?`
`:`
`.charCodeAt(),o=typeof t=="string"?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,-1)),t[t.length-1]===o&&(t=t.slice(0,-1)),t}var T=p(require("node:process"),1),v=p(require("node:path"),1),te=p(require("node:url"),1);function R(t={}){let{env:e=process.env,platform:o=process.platform}=t;return o!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}function De(t={}){let{cwd:e=T.default.cwd(),path:o=T.default.env[R()],execPath:r=T.default.execPath}=t,n,l=e instanceof URL?te.default.fileURLToPath(e):e,s=v.default.resolve(l),m=[];for(;n!==s;)m.push(v.default.join(s,"node_modules/.bin")),n=s,s=v.default.resolve(s,"..");return m.push(v.default.resolve(l,r,"..")),[...m,o].join(v.default.delimiter)}function re({env:t=T.default.env,...e}={}){t={...t};let o=R({env:t});return e.path=t[o],t[o]=De(e),t}var Ie=(t,e,o,r)=>{if(o==="length"||o==="prototype"||o==="arguments"||o==="caller")return;let n=Object.getOwnPropertyDescriptor(t,o),l=Object.getOwnPropertyDescriptor(e,o);!Re(n,l)&&r||Object.defineProperty(t,o,l)},Re=function(t,e){return t===void 0||t.configurable||t.writable===e.writable&&t.enumerable===e.enumerable&&t.configurable===e.configurable&&(t.writable||t.value===e.value)},Ue=(t,e)=>{let o=Object.getPrototypeOf(e);o!==Object.getPrototypeOf(t)&&Object.setPrototypeOf(t,o)},Le=(t,e)=>`/* Wrapped ${t}*/
${e}`,Je=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),qe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ze=(t,e,o)=>{let r=o===""?"":`with ${o.trim()}() `,n=Le.bind(null,r,e.toString());Object.defineProperty(n,"name",qe),Object.defineProperty(t,"toString",{...Je,value:n})};function W(t,e,{ignoreNonConfigurable:o=!1}={}){let{name:r}=t;for(let n of Reflect.ownKeys(e))Ie(t,e,n,o);return Ue(t,e),ze(t,e,r),t}var U=new WeakMap,oe=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let o,r=0,n=t.displayName||t.name||"<anonymous>",l=function(...s){if(U.set(l,++r),r===1)o=t.apply(this,s),t=null;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return o};return W(l,t),U.set(l,r),l};oe.callCount=t=>{if(!U.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return U.get(t)};var ne=oe;var O=require("./lib/error.js"),Y=require("./lib/stdio.js"),k=require("./lib/kill.js"),ce=require("./lib/pipe.js"),E=require("./lib/stream.js"),$=require("./lib/promise.js"),w=require("./lib/command.js"),N=require("./lib/verbose.js"),Ke=1e3*1e3*100,We=({env:t,extendEnv:e,preferLocal:o,localDir:r,execPath:n})=>{let l=e?{...B.default.env,...t}:t;return o?re({env:l,cwd:r,execPath:n}):l},me=(t,e,o={})=>{let r=le.default.e(t,e,o);return t=r.command,e=r.args,o=r.options,o={maxBuffer:Ke,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:o.cwd||B.default.cwd(),execPath:B.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:N.verboseDefault,...o},o.env=We(o),o.stdio=(0,Y.normalizeStdio)(o),B.default.platform==="win32"&&ae.default.basename(t,".exe")==="cmd"&&e.unshift("/q"),{file:t,args:e,options:o,parsed:r}},C=(t,e,o)=>typeof e!="string"&&!ie.Buffer.isBuffer(e)?o===void 0?void 0:"":t.stripFinalNewline?K(e):e;function fe(t,e,o){let r=me(t,e,o),n=(0,w.joinCommand)(t,e),l=(0,w.getEscapedCommand)(t,e);(0,N.logCommand)(l,r.options),(0,k.validateTimeout)(r.options);let s;try{s=L.default.spawn(r.file,r.args,r.options)}catch(g){let c=new L.default.ChildProcess,h=Promise.reject((0,O.makeError)({error:g,stdout:"",stderr:"",all:"",command:n,escapedCommand:l,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return(0,$.mergePromise)(c,h),c}let m=(0,$.getSpawnedPromise)(s),a=(0,k.setupTimeout)(s,r.options,m),i=(0,k.setExitHandler)(s,r.options,a),f={isCanceled:!1};s.kill=k.spawnedKill.bind(null,s.kill.bind(s)),s.cancel=k.spawnedCancel.bind(null,s,f);let d=ne(async()=>{let[{error:g,exitCode:c,signal:h,timedOut:y},x,P,M]=await(0,E.getSpawnedResult)(s,r.options,i),D=C(r.options,x),I=C(r.options,P),Z=C(r.options,M);if(g||c!==0||h!==null){let _=(0,O.makeError)({error:g,exitCode:c,signal:h,stdout:D,stderr:I,all:Z,command:n,escapedCommand:l,parsed:r,timedOut:y,isCanceled:f.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:s.killed});if(!r.options.reject)return _;throw _}return{command:n,escapedCommand:l,exitCode:0,stdout:D,stderr:I,all:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return(0,E.handleInput)(s,r.options),s.all=(0,E.makeAllStream)(s,r.options),(0,ce.addPipeMethods)(s),(0,$.mergePromise)(s,d),s}function Ye(t,e,o){let r=me(t,e,o),n=(0,w.joinCommand)(t,e),l=(0,w.getEscapedCommand)(t,e);(0,N.logCommand)(l,r.options);let s=(0,E.handleInputSync)(r.options),m;try{m=L.default.spawnSync(r.file,r.args,{...r.options,input:s})}catch(f){throw(0,O.makeError)({error:f,stdout:"",stderr:"",all:"",command:n,escapedCommand:l,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let a=C(r.options,m.stdout,m.error),i=C(r.options,m.stderr,m.error);if(m.error||m.status!==0||m.signal!==null){let f=(0,O.makeError)({stdout:a,stderr:i,error:m.error,signal:m.signal,exitCode:m.status,command:n,escapedCommand:l,parsed:r,timedOut:m.error&&m.error.code==="ETIMEDOUT",isCanceled:!1,killed:m.signal!==null});if(!r.options.reject)return f;throw f}return{command:n,escapedCommand:l,exitCode:0,stdout:a,stderr:i,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Ge=({input:t,inputFile:e,stdio:o})=>t===void 0&&e===void 0&&o===void 0?{stdin:"inherit"}:{},se=(t={})=>({preferLocal:!0,...Ge(t),...t});function ue(t){function e(o,...r){if(!Array.isArray(o))return ue({...t,...o});let[n,...l]=(0,w.parseTemplates)(o,r);return fe(n,l,se(t))}return e.sync=(o,...r)=>{if(!Array.isArray(o))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...l]=(0,w.parseTemplates)(o,r);return Ye(n,l,se(t))},e}var ft=ue();function de(t,e){let[o,...r]=(0,w.parseCommand)(t);return fe(o,r,e)}var be=require("esbuild"),j=p(require("@techor/log")),S=p(require("upath")),we=require("../utils/read-package"),A=p(require("@techor/one-liner"));var He=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ze=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],_e=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ve=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],pe=(t,e,o)=>{let r=t;return typeof e=="string"||Array.isArray(e)?r=t.toLocaleString(e,o):(e===!0||o!==void 0)&&(r=t.toLocaleString(void 0,o)),r};function J(t,e){if(!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,...e};let o=e.bits?e.binary?Ve:_e:e.binary?Ze:He,r=e.space?" ":"";if(e.signed&&t===0)return` 0${r}${o[0]}`;let n=t<0,l=n?"-":e.signed?"+":"";n&&(t=-t);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),t<1){let f=pe(t,e.locale,s);return l+f+r+o[0]}let m=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),o.length-1);t/=(e.binary?1024:1e3)**m,s||(t=t.toPrecision(3));let a=pe(Number(t),e.locale,s),i=o[m];return l+a+r+i}var je=p(require("normalize-path")),G=p(require("fs")),ke=p(require("lodash.isequal")),Pe=require("../utils/esbuild-option-names"),Se=require("../plugins/esbuild-plugin-fill-module-ext"),Ee=require("../plugins/esbuild-remove-import-svelte-module-extension"),Fe=p(require("@techor/extend")),ve=p(require("../techor")),Xe={js:"cjs",cjs:"cjs",mjs:"esm",css:"css"},u=(0,we.readPackage)(),{dependencies:ge,peerDependencies:he}=u,H=[];ge&&H.push(...Object.keys(ge));he&&H.push(...Object.keys(he));ye.program.command("pack [entryPaths...]").option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`",["cjs","esm"]).option("-t, --shakable-format [formats...]","Tree-shakable module's formats",["cjs","esm"]).option("--shakable","Enable outputting tree-shakable modules",!1).option("-w, --watch","Rebuild whenever a file changes",!1).option("-s, --sourcemap","Emit a source map",process.env.NODE_ENV==="production").option("-p, --platform <node,browser,neutral>","Platform target","browser").option("-t, --type","Emit typescript declarations",u.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-o, --serve","Serve mode starts a web server that serves your code to your browser on your device",!1).option("-e, --external <packages...>","External packages to exclude from the build",H).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-re, --resolve-extensions [extensions...]","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".css",".json"]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).option("--cjs-ext <ext>","Specify CommonJS default file extension",".js").option("--iife-ext <ext>","Specify CommonJS default file extension",".js").option("--esm-ext <ext>","Specify CommonJS default file extension",".mjs").option("--framework <name>","Specify a framework like `svelte` to resolve related issues automatically").option("--srcdir <dir>","The source directory","src").option("--target","This sets the target environment for the generated JavaScript and/or CSS code.","esnext").option("--mangle-props","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression","^_").option("--no-bundle","OFF: Inline any imported dependencies into the file itself",!0).option("--no-minify","OFF: Minify the generated code").option("--no-clean","OFF: Clean up the previous output directory before the build starts").action(async function(t,e,o){e.clean&&G.default.existsSync(e.outdir)&&(G.default.rmSync(e.outdir,{force:!0,recursive:!0}),console.log(""),j.default.d`Cleaned up the **${e.outdir}** output directory`);let r=ve.default.readConfig(null),n=[],l=(a,i)=>{let f=S.default.relative(e.outdir,a),b=S.default.join(e.srcdir,f);return S.default.changeExt(b,i)},s=async(a,i)=>{let f=i.format==="css",b=i.ext||i.outFile&&S.default.extname(i.outFile)||void 0,d=[...e.external,...e.extraExternal],g=i.outdir||e.outdir;e.bundle&&i.softBundle&&d.push(".*");let c=(0,Fe.default)(e,{outExtension:f?{".css":".css"}:{".js":b||{cjs:e.cjsExt,esm:e.esmExt,iife:e.iifeExt}[i.format]},logLevel:"info",outdir:g,outbase:e.srcdir,platform:i.platform||e.platform,metafile:!0,format:f?void 0:i.format,keepNames:e.keepNames,resolveExtensions:e.resolveExtensions,mangleProps:e.mangleProps?new RegExp(e.mangleProps):void 0,target:e.target,sourcemap:e.sourcemap,external:d,plugins:[]},r?.pack);switch(e.bundle||delete c.external,e.framework){case"svelte":c.plugins.push(Ee.removeImportSvelteModuleExtensionPlugin);break}i.softBundle&&i.format==="esm"&&c.plugins.push((0,Se.createFillModuleExtPlugin)(e.esmExt)),delete c.watch,delete c.serve,delete c.framework;for(let y in c)Pe.esbuildOptionNames.includes(y)||delete c[y];if(c.entryPoints=xe.default.sync([...new Set(a)].map(y=>(0,je.default)(y))).filter(y=>!n.find(x=>x.options.entryPoints.includes(y)&&x.options.format===c.format&&(0,ke.default)(x.options.outExtension,c.outExtension)&&x.options.outdir===c.outdir)),!c.entryPoints.length)return;let h={options:c,run:async()=>{let y=await(0,be.context)(c),{metafile:x}=await y.rebuild();if(x){console.log(""),h.metafile=x;for(let P in x.outputs){let M=x.outputs[P],D=J(M.bytes).replace(/ /g,""),I=x.outputs[P].format=i.format;j.default`${j.chalk.dim("\u2502")} $t [${I}] **${P}** ${D} (${Object.keys(M.inputs).length} inputs)`}j.default.tree({entries:c.entryPoints,external:c.external,outdir:c.outdir,format:c.format,platform:c.platform,[Object.keys(c).filter(P=>c[P]===!0).map(P=>j.chalk.green("\u2713 ")+P).join(", ")]:null})}e.watch?await y.watch():await y.dispose(),e.serve&&await y.serve()}};n.push(h)};if(e.shakable&&e.shakableFormat.length&&e.shakableFormat.forEach(a=>s([S.default.join(e.srcdir,"**/*.{js,ts,jsx,tsx,mjs,mts}")],{format:a,platform:"node",outdir:S.default.join(e.outdir,a),softBundle:!0})),t.length){let a=t.filter(f=>f.includes(".css")),i=t.filter(f=>!f.includes(".css"));a.length&&s(a,{format:"css"}),i.length&&e.format.forEach(f=>s(i,{format:f}))}else if(u.exports&&function a(i,f,b){if(typeof i=="string"){let d=S.default.extname(i);s([l(i,".{js,ts,jsx,tsx,mjs,mts}")],{format:b.format||Xe[d],outFile:b.outFile||i,platform:b.platform})}else for(let d in i){let g=i[d],c,h;switch(f){case"node":h="node";break;case"browser":h="browser";break;case"require":c="cjs";break;case"import":c="esm";break}if(d.startsWith("."))a(g,d);else switch(d){case"node":a(g,d,{platform:"node",format:c});break;case"browser":a(g,d,{platform:"browser",format:c});break;case"default":a(g,d,{platform:h,format:c});break;case"require":a(g,d,{platform:h,format:"cjs"});break;case"import":a(g,d,{platform:h,format:"esm"});break}}}(u.exports,""),u.style&&s([l(u.main,".css")],{format:"css"}),u.main&&!u.main.endsWith(".css")&&s([l(u.main,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",outFile:u.main}),u.module&&s([l(u.module,".{js,ts,jsx,tsx,mjs,mts}")],{format:"esm",outFile:u.module}),u.browser&&s([l(u.browser,".{js,ts,jsx,tsx,mjs,mts}")],{format:"iife",platform:"browser",outFile:u.browser}),u.bin)if(typeof u.bin=="string")s([l(u.bin,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:u.bin});else for(let a in u.bin){let i=u.bin[a];s([l(i,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:i})}n.length||e.format.map(a=>s([S.default.join(e.srcdir,"index.ts")],{format:a}));let m;e.type&&(m={outFile:"declarations",options:{platform:"type",format:"dts"},run:()=>new Promise(a=>{let i=()=>de(A.default`
${e}`,Je=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),qe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ze=(t,e,o)=>{let r=o===""?"":`with ${o.trim()}() `,n=Le.bind(null,r,e.toString());Object.defineProperty(n,"name",qe),Object.defineProperty(t,"toString",{...Je,value:n})};function W(t,e,{ignoreNonConfigurable:o=!1}={}){let{name:r}=t;for(let n of Reflect.ownKeys(e))Ie(t,e,n,o);return Ue(t,e),ze(t,e,r),t}var U=new WeakMap,oe=(t,e={})=>{if(typeof t!="function")throw new TypeError("Expected a function");let o,r=0,n=t.displayName||t.name||"<anonymous>",l=function(...s){if(U.set(l,++r),r===1)o=t.apply(this,s),t=null;else if(e.throw===!0)throw new Error(`Function \`${n}\` can only be called once`);return o};return W(l,t),U.set(l,r),l};oe.callCount=t=>{if(!U.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return U.get(t)};var ne=oe;var O=require("./lib/error.js"),Y=require("./lib/stdio.js"),k=require("./lib/kill.js"),ce=require("./lib/pipe.js"),E=require("./lib/stream.js"),$=require("./lib/promise.js"),w=require("./lib/command.js"),N=require("./lib/verbose.js"),Ke=1e3*1e3*100,We=({env:t,extendEnv:e,preferLocal:o,localDir:r,execPath:n})=>{let l=e?{...B.default.env,...t}:t;return o?re({env:l,cwd:r,execPath:n}):l},me=(t,e,o={})=>{let r=le.default.e(t,e,o);return t=r.command,e=r.args,o=r.options,o={maxBuffer:Ke,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:o.cwd||B.default.cwd(),execPath:B.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:N.verboseDefault,...o},o.env=We(o),o.stdio=(0,Y.normalizeStdio)(o),B.default.platform==="win32"&&ae.default.basename(t,".exe")==="cmd"&&e.unshift("/q"),{file:t,args:e,options:o,parsed:r}},C=(t,e,o)=>typeof e!="string"&&!ie.Buffer.isBuffer(e)?o===void 0?void 0:"":t.stripFinalNewline?K(e):e;function fe(t,e,o){let r=me(t,e,o),n=(0,w.joinCommand)(t,e),l=(0,w.getEscapedCommand)(t,e);(0,N.logCommand)(l,r.options),(0,k.validateTimeout)(r.options);let s;try{s=L.default.spawn(r.file,r.args,r.options)}catch(g){let c=new L.default.ChildProcess,h=Promise.reject((0,O.makeError)({error:g,stdout:"",stderr:"",all:"",command:n,escapedCommand:l,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return(0,$.mergePromise)(c,h),c}let m=(0,$.getSpawnedPromise)(s),a=(0,k.setupTimeout)(s,r.options,m),i=(0,k.setExitHandler)(s,r.options,a),f={isCanceled:!1};s.kill=k.spawnedKill.bind(null,s.kill.bind(s)),s.cancel=k.spawnedCancel.bind(null,s,f);let d=ne(async()=>{let[{error:g,exitCode:c,signal:h,timedOut:y},x,P,M]=await(0,E.getSpawnedResult)(s,r.options,i),D=C(r.options,x),I=C(r.options,P),Z=C(r.options,M);if(g||c!==0||h!==null){let _=(0,O.makeError)({error:g,exitCode:c,signal:h,stdout:D,stderr:I,all:Z,command:n,escapedCommand:l,parsed:r,timedOut:y,isCanceled:f.isCanceled||(r.options.signal?r.options.signal.aborted:!1),killed:s.killed});if(!r.options.reject)return _;throw _}return{command:n,escapedCommand:l,exitCode:0,stdout:D,stderr:I,all:Z,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return(0,E.handleInput)(s,r.options),s.all=(0,E.makeAllStream)(s,r.options),(0,ce.addPipeMethods)(s),(0,$.mergePromise)(s,d),s}function Ye(t,e,o){let r=me(t,e,o),n=(0,w.joinCommand)(t,e),l=(0,w.getEscapedCommand)(t,e);(0,N.logCommand)(l,r.options);let s=(0,E.handleInputSync)(r.options),m;try{m=L.default.spawnSync(r.file,r.args,{...r.options,input:s})}catch(f){throw(0,O.makeError)({error:f,stdout:"",stderr:"",all:"",command:n,escapedCommand:l,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}let a=C(r.options,m.stdout,m.error),i=C(r.options,m.stderr,m.error);if(m.error||m.status!==0||m.signal!==null){let f=(0,O.makeError)({stdout:a,stderr:i,error:m.error,signal:m.signal,exitCode:m.status,command:n,escapedCommand:l,parsed:r,timedOut:m.error&&m.error.code==="ETIMEDOUT",isCanceled:!1,killed:m.signal!==null});if(!r.options.reject)return f;throw f}return{command:n,escapedCommand:l,exitCode:0,stdout:a,stderr:i,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var Ge=({input:t,inputFile:e,stdio:o})=>t===void 0&&e===void 0&&o===void 0?{stdin:"inherit"}:{},se=(t={})=>({preferLocal:!0,...Ge(t),...t});function ue(t){function e(o,...r){if(!Array.isArray(o))return ue({...t,...o});let[n,...l]=(0,w.parseTemplates)(o,r);return fe(n,l,se(t))}return e.sync=(o,...r)=>{if(!Array.isArray(o))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[n,...l]=(0,w.parseTemplates)(o,r);return Ye(n,l,se(t))},e}var ft=ue();function de(t,e){let[o,...r]=(0,w.parseCommand)(t);return fe(o,r,e)}var be=require("esbuild"),j=p(require("@techor/log")),S=p(require("upath")),A=p(require("@techor/one-liner"));var He=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ze=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],_e=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Ve=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],pe=(t,e,o)=>{let r=t;return typeof e=="string"||Array.isArray(e)?r=t.toLocaleString(e,o):(e===!0||o!==void 0)&&(r=t.toLocaleString(void 0,o)),r};function J(t,e){if(!Number.isFinite(t))throw new TypeError(`Expected a finite number, got ${typeof t}: ${t}`);e={bits:!1,binary:!1,space:!0,...e};let o=e.bits?e.binary?Ve:_e:e.binary?Ze:He,r=e.space?" ":"";if(e.signed&&t===0)return` 0${r}${o[0]}`;let n=t<0,l=n?"-":e.signed?"+":"";n&&(t=-t);let s;if(e.minimumFractionDigits!==void 0&&(s={minimumFractionDigits:e.minimumFractionDigits}),e.maximumFractionDigits!==void 0&&(s={maximumFractionDigits:e.maximumFractionDigits,...s}),t<1){let f=pe(t,e.locale,s);return l+f+r+o[0]}let m=Math.min(Math.floor(e.binary?Math.log(t)/Math.log(1024):Math.log10(t)/3),o.length-1);t/=(e.binary?1024:1e3)**m,s||(t=t.toPrecision(3));let a=pe(Number(t),e.locale,s),i=o[m];return l+a+r+i}var we=p(require("normalize-path")),G=p(require("fs")),je=p(require("lodash.isequal")),ke=require("../utils/esbuild-option-names"),Pe=require("../plugins/esbuild-plugin-fill-module-ext"),Se=require("../plugins/esbuild-remove-import-svelte-module-extension"),Ee=p(require("@techor/extend")),Fe=p(require("../techor")),ve=require("@techor/fs"),Xe={js:"cjs",cjs:"cjs",mjs:"esm",css:"css"},u=(0,ve.readFileAsJSON)("./package.json"),{dependencies:ge,peerDependencies:he}=u,H=[];ge&&H.push(...Object.keys(ge));he&&H.push(...Object.keys(he));ye.program.command("pack [entryPaths...]").option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`",["cjs","esm"]).option("-t, --shakable-format [formats...]","Tree-shakable module's formats",["cjs","esm"]).option("--shakable","Enable outputting tree-shakable modules",!1).option("-w, --watch","Rebuild whenever a file changes",!1).option("-s, --sourcemap","Emit a source map",process.env.NODE_ENV==="production").option("-p, --platform <node,browser,neutral>","Platform target","browser").option("-t, --type","Emit typescript declarations",u.types).option("-o, --outdir <dir>","The output directory for the build operation","dist").option("-o, --serve","Serve mode starts a web server that serves your code to your browser on your device",!1).option("-e, --external <packages...>","External packages to exclude from the build",H).option("-ee, --extra-external <packages...>","Extra external packages to exclude from the build",[]).option("-re, --resolve-extensions [extensions...]","The resolution algorithm used by node supports implicit file extensions",[".tsx",".ts",".jsx",".js",".css",".json"]).option("-kn, --keep-names","Keep JavaScript function/class names",!1).option("--cjs-ext <ext>","Specify CommonJS default file extension",".js").option("--iife-ext <ext>","Specify CommonJS default file extension",".js").option("--esm-ext <ext>","Specify CommonJS default file extension",".mjs").option("--framework <name>","Specify a framework like `svelte` to resolve related issues automatically").option("--srcdir <dir>","The source directory","src").option("--target","This sets the target environment for the generated JavaScript and/or CSS code.","esnext").option("--mangle-props","Pass a regular expression to esbuild to tell esbuild to automatically rename all properties that match this regular expression","^_").option("--no-bundle","OFF: Inline any imported dependencies into the file itself",!0).option("--no-minify","OFF: Minify the generated code").option("--no-clean","OFF: Clean up the previous output directory before the build starts").action(async function(t,e,o){e.clean&&G.default.existsSync(e.outdir)&&(G.default.rmSync(e.outdir,{force:!0,recursive:!0}),console.log(""),j.default.d`Cleaned up the **${e.outdir}** output directory`);let r=Fe.default.readConfig(null),n=[],l=(a,i)=>{let f=S.default.relative(e.outdir,a),b=S.default.join(e.srcdir,f);return S.default.changeExt(b,i)},s=async(a,i)=>{let f=i.format==="css",b=i.ext||i.outFile&&S.default.extname(i.outFile)||void 0,d=[...e.external,...e.extraExternal],g=i.outdir||e.outdir;e.bundle&&i.softBundle&&d.push(".*");let c=(0,Ee.default)(e,{outExtension:f?{".css":".css"}:{".js":b||{cjs:e.cjsExt,esm:e.esmExt,iife:e.iifeExt}[i.format]},logLevel:"info",outdir:g,outbase:e.srcdir,platform:i.platform||e.platform,metafile:!0,format:f?void 0:i.format,keepNames:e.keepNames,resolveExtensions:e.resolveExtensions,mangleProps:e.mangleProps?new RegExp(e.mangleProps):void 0,target:e.target,sourcemap:e.sourcemap,external:d,plugins:[]},r?.pack);switch(e.bundle||delete c.external,e.framework){case"svelte":c.plugins.push(Se.removeImportSvelteModuleExtensionPlugin);break}i.softBundle&&i.format==="esm"&&c.plugins.push((0,Pe.createFillModuleExtPlugin)(e.esmExt)),delete c.watch,delete c.serve,delete c.framework;for(let y in c)ke.esbuildOptionNames.includes(y)||delete c[y];if(c.entryPoints=xe.default.sync([...new Set(a)].map(y=>(0,we.default)(y))).filter(y=>!n.find(x=>x.options.entryPoints.includes(y)&&x.options.format===c.format&&(0,je.default)(x.options.outExtension,c.outExtension)&&x.options.outdir===c.outdir)),!c.entryPoints.length)return;let h={options:c,run:async()=>{let y=await(0,be.context)(c),{metafile:x}=await y.rebuild();if(x){console.log(""),h.metafile=x;for(let P in x.outputs){let M=x.outputs[P],D=J(M.bytes).replace(/ /g,""),I=x.outputs[P].format=i.format;j.default`${j.chalk.dim("\u2502")} $t [${I}] **${P}** ${D} (${Object.keys(M.inputs).length} inputs)`}j.default.tree({entries:c.entryPoints,external:c.external,outdir:c.outdir,format:c.format,platform:c.platform,[Object.keys(c).filter(P=>c[P]===!0).map(P=>j.chalk.green("\u2713 ")+P).join(", ")]:null})}e.watch?await y.watch():await y.dispose(),e.serve&&await y.serve()}};n.push(h)};if(e.shakable&&e.shakableFormat.length&&e.shakableFormat.forEach(a=>s([S.default.join(e.srcdir,"**/*.{js,ts,jsx,tsx,mjs,mts}")],{format:a,platform:"node",outdir:S.default.join(e.outdir,a),softBundle:!0})),t.length){let a=t.filter(f=>f.includes(".css")),i=t.filter(f=>!f.includes(".css"));a.length&&s(a,{format:"css"}),i.length&&e.format.forEach(f=>s(i,{format:f}))}else if(u.exports&&function a(i,f,b){if(typeof i=="string"){let d=S.default.extname(i);s([l(i,".{js,ts,jsx,tsx,mjs,mts}")],{format:b.format||Xe[d],outFile:b.outFile||i,platform:b.platform})}else for(let d in i){let g=i[d],c,h;switch(f){case"node":h="node";break;case"browser":h="browser";break;case"require":c="cjs";break;case"import":c="esm";break}if(d.startsWith("."))a(g,d);else switch(d){case"node":a(g,d,{platform:"node",format:c});break;case"browser":a(g,d,{platform:"browser",format:c});break;case"default":a(g,d,{platform:h,format:c});break;case"require":a(g,d,{platform:h,format:"cjs"});break;case"import":a(g,d,{platform:h,format:"esm"});break}}}(u.exports,""),u.style&&s([l(u.main,".css")],{format:"css"}),u.main&&!u.main.endsWith(".css")&&s([l(u.main,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",outFile:u.main}),u.module&&s([l(u.module,".{js,ts,jsx,tsx,mjs,mts}")],{format:"esm",outFile:u.module}),u.browser&&s([l(u.browser,".{js,ts,jsx,tsx,mjs,mts}")],{format:"iife",platform:"browser",outFile:u.browser}),u.bin)if(typeof u.bin=="string")s([l(u.bin,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:u.bin});else for(let a in u.bin){let i=u.bin[a];s([l(i,".{js,ts,jsx,tsx,mjs,mts}")],{format:"cjs",platform:"node",outFile:i})}n.length||e.format.map(a=>s([S.default.join(e.srcdir,"index.ts")],{format:a}));let m;e.type&&(m={outFile:"declarations",options:{platform:"type",format:"dts"},run:()=>new Promise(a=>{let i=()=>de(A.default`
npx tsc --emitDeclarationOnly --preserveWatchOutput --declaration

@@ -6,0 +6,0 @@ --outDir ${e.outdir}

@@ -1,1 +0,1 @@

var V=Object.create;var P=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var z=(n,s,t,f)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of x(s))!$.call(n,o)&&o!==t&&P(n,o,{get:()=>s[o],enumerable:!(f=j(s,o))||f.enumerable});return n};var m=(n,s,t)=>(t=n!=null?V(J(n)):{},z(s||!n||!n.__esModule?P(t,"default",{value:n,enumerable:!0}):t,n));var b=require("commander"),D=m(require("fast-glob")),u=m(require("fs-extra")),O=m(require("path")),r=m(require("@techor/log")),v=require("../utils/read-package"),B=(0,v.readPackage)(),L={workspaces:B.workspaces};b.program.command("version <version>").description("Bump to specific version for workspace's packages").option("-p, --prefix <symbol>","Version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ","^").option("-w, --workspaces <paths>","Specific your workspaces",L.workspaces).option("-ls, --list","List current bumpable dependency tree in workspaces",!1).action((n,{prefix:s,list:t,workspaces:f})=>{let o=s+n,d={},i={},N=f.map(e=>O.default.join(e,"*package.json")),w=(e,c)=>{let p=!1;for(let a in e)a in i&&e[a]===""&&(e[a]=o,p=!0);return p};for(let e of D.default.sync(N)){let c=u.default.readJSONSync(e);c.private||(d[e]=c,i[c.name]=c,c.version=n)}for(let e in d){let c=d[e],{dependencies:p,peerDependencies:a}=d[e];p&&w(p,"dependencies"),a&&w(a,"peerDependencies"),t||u.default.writeJSONSync(e,c)}let k={};for(let e in i){let{dependencies:c,peerDependencies:p}=i[e],a=k[(0,r.paint)("**"+e+"**")]={},g=(l,h)=>{if(l){a[h]={};for(let y in l)if(y in i){let S=l[y];a[h][(0,r.paint)("**"+y+"**")]=S===o?null:o}}};g(c,"dependencies"),g(p,"peerDependencies"),Object.keys(k[(0,r.paint)("**"+e+"**")]).length||(k[(0,r.paint)("**"+e+"**")]=null)}r.default`πŸ“¦`,r.default.tree(k),r.default.success`bump version to +${o}+ for ${Object.keys(i).length} packages in all workspace`});
var O=Object.create;var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var B=(s,n,a,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of V(n))!N.call(s,o)&&o!==a&&y(s,o,{get:()=>n[o],enumerable:!(i=D(n,o))||i.enumerable});return s};var g=(s,n,a)=>(a=s!=null?O(x(s)):{},B(n||!s||!s.__esModule?y(a,"default",{value:s,enumerable:!0}):a,s));var h=require("commander"),v=g(require("fast-glob")),P=g(require("path")),r=g(require("@techor/log")),f=require("@techor/fs"),F=(0,f.readFileAsJSON)("./package.json"),S={workspaces:F.workspaces};h.program.command("version <version>").description("Bump to specific version for workspace's packages").option("-p, --prefix <symbol>","Version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ","^").option("-w, --workspaces <paths>","Specific your workspaces",S.workspaces).option("-ls, --list","List current bumpable dependency tree in workspaces",!1).option("--private","Bump private project version",!1).option("--no-public","Off: Bump public project version").action((s,n)=>{let a=n.prefix+s,i={},o={},b=n.workspaces.map(e=>P.default.join(e,"*package.json")),u=(e,c)=>{let t=!1;for(let p in e)p in o&&e[p]===""&&(e[p]=a,t=!0);return t};for(let e of v.default.sync(b)){let c=(0,f.readFileAsJSON)(e);(c.private&&n.private||!c.private&&n.public)&&(i[e]=c,o[c.name]=c,c.version=s)}for(let e in i){let c=i[e],{dependencies:t,peerDependencies:p}=i[e];t&&u(t,"dependencies"),p&&u(p,"peerDependencies"),n.list||(0,f.writeToFile)(e,c)}let d={};for(let e in o){let{dependencies:c,peerDependencies:t}=o[e],p=d[(0,r.paint)("**"+e+"**")]={},k=(l,w)=>{if(l){p[w]={};for(let m in l)if(m in o){let j=l[m];p[w][(0,r.paint)("**"+m+"**")]=j===a?null:a}}};k(c,"dependencies"),k(t,"peerDependencies"),Object.keys(d[(0,r.paint)("**"+e+"**")]).length||(d[(0,r.paint)("**"+e+"**")]=null)}r.default`πŸ“¦`,r.default.tree(d),r.default.success`bump version to +${a}+ for ${Object.keys(o).length} packages in all workspace`});

@@ -1,1 +0,1 @@

var C=Object.create;var g=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var F=(n,o)=>{for(var t in o)g(n,t,{get:o[t],enumerable:!0})},u=(n,o,t,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of P(o))!y.call(n,i)&&i!==t&&g(n,i,{get:()=>o[i],enumerable:!(r=O(o,i))||r.enumerable});return n};var s=(n,o,t)=>(t=n!=null?C(x(n)):{},u(o||!n||!n.__esModule?g(t,"default",{value:n,enumerable:!0}):t,n)),w=n=>u(g({},"__esModule",{value:!0}),n);var N={};F(N,{default:()=>c});module.exports=w(N);var d=s(require("upath")),e=s(require("@techor/log")),a=s(require("./options")),h=s(require("fast-glob")),l=s(require("x-import")),m=s(require("@techor/extend")),c=class{options;constructor(...o){this.options=(0,m.default)(a.default,...o)}logConfigFound=o=>e.default.ok`**${o}** config file found`;logConfigNotFound=o=>e.default.i`No **${o}** config file found`;readConfig(o="config"){let{config:t,cwd:r}=this.options;if(typeof t=="object")return t;let i;try{let f=this.configPath;if(f){let p=(0,l.default)(f,{cwd:r});i=(o?p[o]:void 0)||p.default||p,this.logConfigFound(f)}else this.logConfigNotFound(t)}catch(f){e.default.error(f)}return i}get configPath(){let{cwd:o,config:t}=this.options;if(!(!t||typeof t!="string"))return h.default.sync(t,{cwd:o})[0]}get resolvedConfigPath(){let o=this.configPath;return o?d.default.resolve(this.options.cwd,o):""}};0&&(module.exports={});
var C=Object.create;var g=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var w=(n,o)=>{for(var t in o)g(n,t,{get:o[t],enumerable:!0})},u=(n,o,t,f)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of P(o))!F.call(n,i)&&i!==t&&g(n,i,{get:()=>o[i],enumerable:!(f=O(o,i))||f.enumerable});return n};var s=(n,o,t)=>(t=n!=null?C(y(n)):{},u(o||!n||!n.__esModule?g(t,"default",{value:n,enumerable:!0}):t,n)),x=n=>u(g({},"__esModule",{value:!0}),n);var N={};w(N,{default:()=>c});module.exports=x(N);var d=s(require("upath")),e=s(require("@techor/log")),a=s(require("./options")),h=s(require("fast-glob")),l=s(require("cross-import")),m=s(require("@techor/extend")),c=class{options;constructor(...o){this.options=(0,m.default)(a.default,...o)}logConfigFound=o=>e.default.ok`**${o}** config file found`;logConfigNotFound=o=>e.default.i`No **${o}** config file found`;readConfig(o="config"){let{config:t,cwd:f}=this.options;if(typeof t=="object")return t;let i;try{let r=this.configPath;if(r){let p=(0,l.default)(r,{cwd:f});i=(o?p[o]:void 0)||p.default||p,this.logConfigFound(r)}else this.logConfigNotFound(t)}catch(r){e.default.error(r)}return i}get configPath(){let{cwd:o,config:t}=this.options;if(!(!t||typeof t!="string"))return h.default.sync(t,{cwd:o})[0]}get resolvedConfigPath(){let o=this.configPath;return o?d.default.resolve(this.options.cwd,o):""}};0&&(module.exports={});

@@ -1,1 +0,1 @@

{"name":"techor","scripts":{"build":"tsx ./src/bin pack --shakable","dev":"npm run build -- --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"Author technology like a top leader","author":{"name":"Aron","email":"i@aron.tw","url":"https://aron.tw"},"homepage":"https://github.com/1aron/techor","bugs":{"url":"https://github.com/1aron/techor/issues"},"repository":{"type":"git","url":"https://github.com/1aron/techor.git","directory":"packages/techor"},"keywords":["author","technology","creator","config","opensource","plugin","package","framework","tool","software","pack","esbuild","version","bump","bundle","commonjs","esm","esmodule"],"main":"./dist/cjs/index.js","jsnext:main":"./dist/esm/index.mjs","esnext":"./dist/esm/index.mjs","module":"./dist/esm/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.mjs","types":"./dist/index.d.ts"}},"bin":{"techor":"./dist/bin/index.js"},"files":["dist"],"sideEffects":["./src/commands/*"],"dependencies":{"@techor/log":"^2.0.1","commander":"^9.4.1","x-import":"^2.0.1","esbuild":"^0.17.14","fast-glob":"^3.2.12","fs-extra":"^10.1.0","lodash.camelcase":"^4.3.0","lodash.isequal":"^4.5.0","normalize-path":"^3.0.0","shx":"^0.3.4","@techor/extend":"^2.0.1","@techor/one-liner":"^2.0.1","upath":"^2.0.1"},"devDependencies":{"dedent":"^0.7.0","execa":"^7.1.1","pkg-types":"^1.0.1","pretty-bytes":"^6.1.0"},"version":"2.0.1"}
{"name":"techor","scripts":{"build":"tsx ./src/bin pack --shakable","dev":"npm run build -- --watch","test":"jest","type-check":"tsc --noEmit","lint":"eslint src"},"license":"MIT","description":"Author technology like a top leader","author":{"name":"Aron","email":"i@aron.tw","url":"https://aron.tw"},"homepage":"https://github.com/1aron/techor","bugs":{"url":"https://github.com/1aron/techor/issues"},"repository":{"type":"git","url":"https://github.com/1aron/techor.git","directory":"packages/techor"},"keywords":["author","technology","creator","config","opensource","plugin","package","framework","tool","software","pack","esbuild","version","bump","bundle","commonjs","esm","esmodule"],"main":"./dist/cjs/index.js","jsnext:main":"./dist/esm/index.mjs","esnext":"./dist/esm/index.mjs","module":"./dist/esm/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/cjs/index.js","import":"./dist/esm/index.mjs","types":"./dist/index.d.ts"}},"bin":{"techor":"./dist/bin/index.js"},"files":["dist"],"sideEffects":["./src/commands/*"],"dependencies":{"@techor/extend":"^2.0.2","@techor/fs":"^2.0.2","@techor/log":"^2.0.2","@techor/one-liner":"^2.0.2","commander":"^10.0.0","cross-import":"^2.0.2","esbuild":"^0.17.14","fast-glob":"^3.2.12","lodash.camelcase":"^4.3.0","lodash.isequal":"^4.5.0","normalize-path":"^3.0.0","shx":"^0.3.4","upath":"^2.0.1"},"devDependencies":{"dedent":"^0.7.0","execa":"^7.1.1","pkg-types":"^1.0.1","pretty-bytes":"^6.1.0"},"version":"2.0.2"}

@@ -355,3 +355,3 @@ <br>

"peerDependencies": {
"@master/style-element.react": "^1.1.6"
"@master/style-element.react": "^2.0.0-beta.7"
},

@@ -358,0 +358,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc