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.3 to 2.0.4

10

dist/bin/index.js
#!/usr/bin/env node
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"?`
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,Br=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Fr(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=Fr(e),n=!$r.test(t);if(e.options.forceShell||n){let r=Br.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"),F=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,F.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={},F.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 F},N=!1,ve=function(){N||!I(global.process)||(N=!0,w.count+=1,F=F.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,F,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=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}
`.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),B=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=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 Bt({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,Ft=(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};Ft.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=Ft;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`
`);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(" "),Be=(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(" "))},Fe=(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?Bt({env:i,cwd:r,execPath:o}):i},Bn=(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 Fn(e,t,n){let r=Bn(e,t,n),o=$e(e,t),i=Be(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=Bn(e,t,n),o=$e(e,t),i=Be(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]=Fe(n,r);return Fn(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]=Fe(n,r);return Io(o,i,In(e))},t}var zi=Nn();function Gn(e,t){let[n,...r]=Pn(e);return Fn(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"],Bo=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Fo=["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?Fo:Bo: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",n){let{config:r,cwd:o}=this.options;if(typeof r=="object")return r;let i;try{let s=this.configPath;if(s){let u=(0,Kn.default)(s,{cwd:o},n);i=(t?u[t]:void 0)||u.default||u,this.logConfigFound(s)}else this.logConfigNotFound(r)}catch(s){ue.default.error(s)}return i}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

@@ -10,0 +10,0 @@ --outDir ${t.outdir}

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

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

@@ -7,5 +8,5 @@ options: Options;

logConfigNotFound: (configPath: string) => void;
readConfig(key?: string): Config | any;
readConfig(key?: string, buildOptions?: BuildOptions): Config | any;
get configPath(): string;
get resolvedConfigPath(): string;
}

@@ -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/extend":"^2.0.3","@techor/fs":"^2.0.3","@techor/log":"^2.0.3","@techor/one-liner":"^2.0.3","commander":"^10.0.0","cross-import":"^2.0.3","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.3"}
{"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.4","@techor/fs":"^2.0.4","@techor/log":"^2.0.4","@techor/one-liner":"^2.0.4","commander":"^10.0.0","cross-import":"^2.0.4","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.4"}

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