@tsmodule/tsmodule 41.22.0 → 41.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");globalThis.__filename=i(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}
|
|
5
5
|
/** __ESM_SHIM_END */
|
|
6
6
|
|
|
7
|
-
import{a as d,b as L,c as R,e as B,g as U,i as J,j as G,k as K,l as z,m as Y}from"./chunk-
|
|
7
|
+
import{a as d,b as L,c as R,e as B,g as U,i as J,j as G,k as K,l as z,m as Y}from"./chunk-ED7CJY42.js";import{a as w,b,c as fe}from"./chunk-SXU4PYPZ.js";var E=b(H=>{var y=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},V=class extends y{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};H.CommanderError=y;H.InvalidArgumentError=V});var S=b(F=>{var{InvalidArgumentError:ge}=E(),k=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new ge(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function _e(h){let e=h.name()+(h.variadic===!0?"...":"");return h.required?"<"+e+">":"["+e+"]"}F.Argument=k;F.humanReadableArgName=_e});var N=b(Q=>{var{humanReadableArgName:Oe}=S(),D=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){let t=e.commands.filter(i=>!i._hidden);if(e._hasImplicitHelpCommand()){let[,i,n]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),s=e.createCommand(i).helpOption(!1);s.description(e._helpCommandDescription),n&&s.arguments(n),t.push(s)}return this.sortSubcommands&&t.sort((i,n)=>i.name().localeCompare(n.name())),t}visibleOptions(e){let t=e.options.filter(s=>!s.hidden),i=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),n=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(i||n){let s;i?n?s=e.createOption(e._helpFlags,e._helpDescription):s=e.createOption(e._helpShortFlag,e._helpDescription):s=e.createOption(e._helpLongFlag,e._helpDescription),t.push(s)}if(this.sortOptions){let s=r=>r.short?r.short.replace(/^-/,""):r.long.replace(/^--/,"");t.sort((r,a)=>s(r).localeCompare(s(a)))}return t}visibleArguments(e){return e._argsDescription&&e._args.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e._args.find(t=>t.description)?e._args:[]}subcommandTerm(e){let t=e._args.map(i=>Oe(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((i,n)=>Math.max(i,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((i,n)=>Math.max(i,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatHelp(e,t){let i=t.padWidth(e,t),n=t.helpWidth||80,s=2,r=2;function a(m,W){if(W){let de=`${m.padEnd(i+r)}${W}`;return t.wrap(de,n-s,i+r)}return m}function o(m){return m.join(`
|
|
8
8
|
`).replace(/^/gm," ".repeat(s))}let l=[`Usage: ${t.commandUsage(e)}`,""],u=t.commandDescription(e);u.length>0&&(l=l.concat([u,""]));let c=t.visibleArguments(e).map(m=>a(t.argumentTerm(m),t.argumentDescription(m)));c.length>0&&(l=l.concat(["Arguments:",o(c),""]));let f=t.visibleOptions(e).map(m=>a(t.optionTerm(m),t.optionDescription(m)));f.length>0&&(l=l.concat(["Options:",o(f),""]));let A=t.visibleCommands(e).map(m=>a(t.subcommandTerm(m),t.subcommandDescription(m)));return A.length>0&&(l=l.concat(["Commands:",o(A),""])),l.join(`
|
|
9
9
|
`)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,i,n=40){if(e.match(/[\n]\s+/))return e;let s=t-i;if(s<n)return e;let r=e.slice(0,i),a=e.slice(i),o=" ".repeat(i),l=new RegExp(".{1,"+(s-1)+"}([\\s]|$)|[^\\s]+?([\\s]|$)","g"),u=a.match(l)||[];return r+u.map((c,f)=>(c.slice(-1)===`
|
|
10
10
|
`&&(c=c.slice(0,c.length-1)),(f>0?o:"")+c.trimRight())).join(`
|
|
@@ -14,7 +14,7 @@ import{a as x,b as g,c as Le,d as fe,e as ge,f as dt,h as et,i as Lo}from"./chun
|
|
|
14
14
|
`))this.#i+=Math.max(1,Math.ceil((0,Cf.default)(n)/t))}get isEnabled(){return this.#a&&!this.#l}set isEnabled(t){if(typeof t!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#a=t}get isSilent(){return this.#l}set isSilent(t){if(typeof t!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#l=t}frame(){let{frames:t}=this.#o,r=t[this.#n];this.color&&(r=O[this.color](r)),this.#n=++this.#n%t.length;let n=typeof this.#s=="string"&&this.#s!==""?this.#s+" ":"",i=typeof this.text=="string"?" "+this.text:"";return n+r+i}clear(){if(!this.#a||!this.#t.isTTY)return this;this.#t.cursorTo(0);for(let t=0;t<this.#r;t++)t>0&&this.#t.moveCursor(0,-1),this.#t.clearLine(1);return(this.#u||this.lastIndent!==this.#u)&&this.#t.cursorTo(this.#u),this.lastIndent=this.#u,this.#r=0,this}render(){return this.#l?this:(this.clear(),this.#t.write(this.frame()),this.#r=this.#i,this)}start(t){return t&&(this.text=t),this.#l?this:this.#a?this.isSpinning?this:(this.#e.hideCursor&&Rs.hide(this.#t),this.#e.discardStdin&&wn.stdin.isTTY&&(this.#c=!0,xn.start()),this.render(),this.#f=setInterval(this.render.bind(this),this.interval),this):(this.text&&this.#t.write(`- ${this.text}
|
|
15
15
|
`),this)}stop(){return this.#a?(clearInterval(this.#f),this.#f=void 0,this.#n=0,this.clear(),this.#e.hideCursor&&Rs.show(this.#t),this.#e.discardStdin&&wn.stdin.isTTY&&this.#c&&(xn.stop(),this.#c=!1),this):this}succeed(t){return this.stopAndPersist({symbol:Vt.success,text:t})}fail(t){return this.stopAndPersist({symbol:Vt.error,text:t})}warn(t){return this.stopAndPersist({symbol:Vt.warning,text:t})}info(t){return this.stopAndPersist({symbol:Vt.info,text:t})}stopAndPersist(t={}){if(this.#l)return this;let r=t.prefixText||this.#s,n=t.text||this.text,i=typeof n=="string"?" "+n:"";return this.stop(),this.#t.write(`${this.getFullPrefixText(r," ")}${t.symbol||" "}${i}
|
|
16
16
|
`),this}};function qe(e){return new fo(e)}import{spawn as cE,execSync as fE}from"child_process";import{env as Sn}from"process";if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:t}=await import("url");globalThis.__filename=t(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:r}=await import("module");globalThis.require=r.createRequire(import.meta.url)}var lE={win32:e=>({cmd:"cmd.exe",args:["/d","/s","/c",e]})},uE={"cp -rf":{win32:e=>{let t="xcopy /E /S /G /Q /Y",r=e.map(n=>n.endsWith("\\")?n:`${n}\\`).map(n=>n.replace(/\*\\$/,""));return`${t} ${r.join(" ")}`}},ln:{win32:e=>`mklink /D ${e.join(" ")}`},pkill:{win32:e=>`taskkill /T /F /pid ${e.join(" ")}`}},bf=(e,t,r)=>{let n={...lE,...t},i={...uE,...r},s=a=>{let l=process.platform,c=n[l];if(c)return c(a);let[u,...A]=a.split(" ");return{cmd:u,args:A}},o=(a=>{let l=Object.entries(i);for(let[c,u]of l)if(a.startsWith(c)){let A=process.platform,f=u[A];if(!f)break;let y=a.slice(c.length).trim().split(" ");return f(y)}return a})(e);return s(o)};if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:t}=await import("url");globalThis.__filename=t(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:r}=await import("module");globalThis.require=r.createRequire(import.meta.url)}if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:t}=await import("url");globalThis.__filename=t(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:r}=await import("module");globalThis.require=r.createRequire(import.meta.url)}if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:t}=await import("url");globalThis.__filename=t(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:r}=await import("module");globalThis.require=r.createRequire(import.meta.url)}var Sf=Boolean(process.stdout.isTTY),vf=(e=0)=>t=>`\x1B[${t+e}m`,Bf=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,wf=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,W={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},fb=Object.keys(W.modifier),AE=Object.keys(W.color),pE=Object.keys(W.bgColor),Ab=[...AE,...pE];function hE(){let e=new Map;for(let[t,r]of Object.entries(W)){for(let[n,i]of Object.entries(r))W[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=W[n],e.set(i[0],i[1]);Object.defineProperty(W,t,{value:r,enumerable:!1})}return Object.defineProperty(W,"codes",{value:e,enumerable:!1}),W.color.close="\x1B[39m",W.bgColor.close="\x1B[49m",W.color.ansi=vf(),W.color.ansi256=Bf(),W.color.ansi16m=wf(),W.bgColor.ansi=vf(10),W.bgColor.ansi256=Bf(10),W.bgColor.ansi16m=wf(10),Object.defineProperties(W,{rgbToAnsi256:{value:(t,r,n)=>t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>W.rgbToAnsi256(...W.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>W.ansi256ToAnsi(W.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>W.ansi256ToAnsi(W.hexToAnsi256(t)),enumerable:!1}}),W}var dE=hE(),gE=dE,Qf=(e,t=[],r=!1)=>{if(!(typeof e>"u")){if(t&&(r||Sf)){let n="",i="";for(let s of t){let o=gE[s];n+=o.open,i+=o.close}e=n+e+i}return e}},xf,Ao=null,_E=(e,t,{level:r=0,preLines:n=t?1:0,postLines:i=0,nonTtyDedupe:s=!0}={},o=!1)=>{let a=console[e];if(typeof t>"u"){a();return}if(s&&!Sf){if(t===xf||t===Ao?.raw)return;o||(xf=t)}let l=t.split(`
|
|
17
|
-
`).length,c=n+l+i;Ao||(Ao={raw:t,lines:c});for(let u=0;u<r;u++)console.group();for(let u=0;u<n;u++)console.log();a(t);for(let u=0;u<i;u++)console.log();for(let u=0;u<r;u++)console.groupEnd()},ho=(e,t,{force:r=!1,...n}={})=>{_E("log",Qf(e,t,r),n)},EE=(e,t=[],{force:r=!1}={})=>{if(!e)return console.group();console.log(),console.log(),console.group(Qf(e,["bold",...t],r))},mE=()=>{console.groupEnd()},Rf={start:EE,end:mE},If="__ADDED_INITIAL_PADDING__",Tf="__SET_FiNAL_PADDING_LISTENER__",yE=()=>Sn[If]||null,CE=()=>Sn[Tf]||null,bE=()=>{ho(),Rf.start(),Sn[If]="true"},kf=()=>{ho(),Rf.end(),process.removeListener("exit",kf)};yE()||bE();CE()||(process.on("exit",kf),Sn[Tf]="true");process.addListener("SIGINT",()=>{process.exit(1)});var vE=process.platform==="linux"||process.platform==="darwin",po=process.platform==="win32",BE={stdio:"pipe",shell:!0,detached:!po,env:process.env},wE={log:!0,commandTranslations:{},shellTranslations:{},...BE},he=({log:e=!0,commandTranslations:t={},shellTranslations:r={},...n}=wE)=>{let i=null;return{childProcess:i,async run(s){if(i)throw new Error("Only one command per shell.");if(typeof s=="object"){let l=process.platform;s.posix&&vE&&(l="posix");let c=s[l];if(!c)throw new Error("No command found for platform: "+JSON.stringify({platform:process.platform,command:s}));s=c}let{cmd:o,args:a}=bf(s,r,t);return e&&ho(`$ ${o} ${a.join(" ")}`,["dim"]),await new Promise((l,c)=>{i=cE(o,a,n);let u="",A="";if(!i)throw new Error("Child process was not set.");let f=y=>{i=null;let _={code:y,stdout:u,stderr:A};y===0||y===1&&!po?l(_):c(_)};i.stdout?.on("data",y=>{u+=y.toString()}),i.stderr?.on("data",y=>{A+=y.toString()}),i.on("close",f),i.on("exit",f),i.on("error",f),i.stdout?.pipe(process.stdout),i.stderr?.pipe(process.stderr)})},kill(s="SIGKILL"){if(i?.pid)if(po)fE(`taskkill /t /f /pid ${i.pid}`);else return process.kill(-i.pid,s);return!0}}};import{extname as Eb,resolve as go}from"path";var _o=()=>{let e=process.cwd(),t=go(e,"src"),r=go(e,"dist");return{cwd:e,srcDir:t,outDir:r}},Eo=e=>{e=go(e);let{srcDir:t,outDir:r}=_o();return e.replace(t,r).replace(dt,".js").replace(et,".js")};var xE={moduleResolution:"Node",module:"ESNext",target:"ESNext",esModuleInterop:!0,incremental:!1,rootDir:"src",outDir:"dist",declaration:!0,noEmit:!1,emitDeclarationOnly:!0},mo=async()=>{let e=fe(mo),t=he({log:!1}),n=`yarn tsc -p tsconfig.json ${Object.entries(xE).map(([i,s])=>`--${i} ${s}`).join(" ")}`;e.log(`Calling: ${n}`),await t.run(n)};import{readFile as SE,writeFile as QE}from"fs/promises";import{resolve as Df}from"path";var yo=async(e=process.cwd())=>{let t=Df(e,"package.json");return await SE(t,"utf-8")},RE=async(e=process.cwd())=>{let t=await yo(e);return JSON.parse(t)},Qn=async(e=process.cwd(),t)=>{let r=Df(e,"package.json"),n=await RE(e);return Object.assign(n,t),await QE(r,JSON.stringify(n,null,2),"utf-8"),n};import{readFileSync as IE}from"fs";function TE(e){return new Promise((t,r)=>{let n=[];function i(l){n.push(l)}function s(){a(),t(Buffer.concat(n))}function o(l){a(),r(l)}function a(){e.removeListener("data",i),e.removeListener("end",s),e.removeListener("error",o)}e.on("data",i),e.on("end",s),e.on("error",o)})}var Co=async()=>{let e=fe(Co);e.log("Reading stdin");try{let r=IE(0).toString();if(r)return e.log("Found stdin",{stdin:r}),r}catch(r){e.log("Could not read stdin",{e:r})}return ge(O.gray("Type your source code. Press Ctrl+D to finish.")),(await TE(process.stdin)).toString()};var je=async(e,t)=>{let r=qe(t.start);try{await e(),r.succeed(t.success)}catch(n){throw r.fail(t.error),n}};var Of={name:"relative-externs",setup(e){e.onResolve({filter:/^\.\.?\//},({path:t,importer:r})=>r.includes("node_modules")?null:{path:t,external:!0})}};import{readFile as kE}from"fs/promises";var Rn=`
|
|
17
|
+
`).length,c=n+l+i;Ao||(Ao={raw:t,lines:c});for(let u=0;u<r;u++)console.group();for(let u=0;u<n;u++)console.log();a(t);for(let u=0;u<i;u++)console.log();for(let u=0;u<r;u++)console.groupEnd()},ho=(e,t,{force:r=!1,...n}={})=>{_E("log",Qf(e,t,r),n)},EE=(e,t=[],{force:r=!1}={})=>{if(!e)return console.group();console.log(),console.log(),console.group(Qf(e,["bold",...t],r))},mE=()=>{console.groupEnd()},Rf={start:EE,end:mE},If="__ADDED_INITIAL_PADDING__",Tf="__SET_FiNAL_PADDING_LISTENER__",yE=()=>Sn[If]||null,CE=()=>Sn[Tf]||null,bE=()=>{ho(),Rf.start(),Sn[If]="true"},kf=()=>{ho(),Rf.end(),process.removeListener("exit",kf)};yE()||bE();CE()||(process.on("exit",kf),Sn[Tf]="true");process.addListener("SIGINT",()=>{process.exit(1)});var vE=process.platform==="linux"||process.platform==="darwin",po=process.platform==="win32",BE={stdio:"pipe",shell:!0,detached:!po,env:process.env},wE={log:!0,commandTranslations:{},shellTranslations:{},...BE},he=({log:e=!0,commandTranslations:t={},shellTranslations:r={},...n}=wE)=>{let i=null;return{childProcess:i,async run(s){if(i)throw new Error("Only one command per shell.");if(typeof s=="object"){let l=process.platform;s.posix&&vE&&(l="posix");let c=s[l];if(!c)throw new Error("No command found for platform: "+JSON.stringify({platform:process.platform,command:s}));s=c}let{cmd:o,args:a}=bf(s,r,t);return e&&ho(`$ ${o} ${a.join(" ")}`,["dim"],{postLines:1}),await new Promise((l,c)=>{i=cE(o,a,n);let u="",A="";if(!i)throw new Error("Child process was not set.");let f=y=>{i=null;let _={code:y,stdout:u,stderr:A};y===0||y===1&&!po?l(_):c(_)};i.stdout?.on("data",y=>{u+=y.toString()}),i.stderr?.on("data",y=>{A+=y.toString()}),i.on("close",f),i.on("exit",f),i.on("error",f),i.stdout?.pipe(process.stdout),i.stderr?.pipe(process.stderr)})},kill(s="SIGKILL"){if(i?.pid)if(po)fE(`taskkill /t /f /pid ${i.pid}`);else return process.kill(-i.pid,s);return!0}}};import{extname as Eb,resolve as go}from"path";var _o=()=>{let e=process.cwd(),t=go(e,"src"),r=go(e,"dist");return{cwd:e,srcDir:t,outDir:r}},Eo=e=>{e=go(e);let{srcDir:t,outDir:r}=_o();return e.replace(t,r).replace(dt,".js").replace(et,".js")};var xE={moduleResolution:"Node",module:"ESNext",target:"ESNext",esModuleInterop:!0,incremental:!1,rootDir:"src",outDir:"dist",declaration:!0,noEmit:!1,emitDeclarationOnly:!0},mo=async()=>{let e=fe(mo),t=he({log:!1}),n=`yarn tsc -p tsconfig.json ${Object.entries(xE).map(([i,s])=>`--${i} ${s}`).join(" ")}`;e.log(`Calling: ${n}`),await t.run(n)};import{readFile as SE,writeFile as QE}from"fs/promises";import{resolve as Df}from"path";var yo=async(e=process.cwd())=>{let t=Df(e,"package.json");return await SE(t,"utf-8")},RE=async(e=process.cwd())=>{let t=await yo(e);return JSON.parse(t)},Qn=async(e=process.cwd(),t)=>{let r=Df(e,"package.json"),n=await RE(e);return Object.assign(n,t),await QE(r,JSON.stringify(n,null,2),"utf-8"),n};import{readFileSync as IE}from"fs";function TE(e){return new Promise((t,r)=>{let n=[];function i(l){n.push(l)}function s(){a(),t(Buffer.concat(n))}function o(l){a(),r(l)}function a(){e.removeListener("data",i),e.removeListener("end",s),e.removeListener("error",o)}e.on("data",i),e.on("end",s),e.on("error",o)})}var Co=async()=>{let e=fe(Co);e.log("Reading stdin");try{let r=IE(0).toString();if(r)return e.log("Found stdin",{stdin:r}),r}catch(r){e.log("Could not read stdin",{e:r})}return ge(O.gray("Type your source code. Press Ctrl+D to finish.")),(await TE(process.stdin)).toString()};var je=async(e,t)=>{let r=qe(t.start);try{await e(),r.succeed(t.success)}catch(n){throw r.fail(t.error),n}};var Of={name:"relative-externs",setup(e){e.onResolve({filter:/^\.\.?\//},({path:t,importer:r})=>r.includes("node_modules")?null:{path:t,external:!0})}};import{readFile as kE}from"fs/promises";var Rn=`
|
|
18
18
|
/** __ESM_SHIM_START */
|
|
19
19
|
if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");globalThis.__filename=i(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}
|
|
20
20
|
/** __ESM_SHIM_END */
|
package/dist/index.js
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");globalThis.__filename=i(import.meta.url),globalThis.__dirname=e(globalThis.__filename);let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}
|
|
4
4
|
/** __ESM_SHIM_END */
|
|
5
5
|
|
|
6
|
-
import{c as o,d as r,e,f,g as m,h as p,k as t,l as x,m as a}from"./chunk-
|
|
6
|
+
import{c as o,d as r,e,f,g as m,h as p,k as t,l as x,m as a}from"./chunk-ED7CJY42.js";import"./chunk-SXU4PYPZ.js";export{e as bannerError,r as bannerLog,f as build,m as buildCommand,t as create,x as dev,a as execute,o as normalizeImportSpecifiers,p as specification};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsmodule/tsmodule",
|
|
3
3
|
"platform": "node",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "41.
|
|
5
|
+
"version": "41.23.0",
|
|
6
6
|
"repository": "tsmodule/tsmodule",
|
|
7
7
|
"description": "TypeScript Module loader and compiler",
|
|
8
8
|
"license": "MIT",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"ora": "^6.1.2",
|
|
61
61
|
"path": "^0.12.7",
|
|
62
62
|
"release-it": "^15.5.0",
|
|
63
|
-
"universal-shell": "^35.0.
|
|
63
|
+
"universal-shell": "^35.0.5"
|
|
64
64
|
},
|
|
65
65
|
"release-it": {
|
|
66
66
|
"git": {
|