@tsmodule/tsmodule 41.0.0 → 41.2.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/README.md +1 -1
- package/dist/commands/build/index.js +12 -12
- package/dist/commands/build/lib/emitTsDeclarations.js +11 -11
- package/dist/commands/create/index.js +10 -10
- package/dist/commands/create/lib/templates.js +8 -8
- package/dist/commands/dev/index.js +12 -12
- package/dist/commands/execute/index.js +5 -5
- package/package.json +2 -3
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
2
|
if(typeof process<"u"){let{dirname:e}=await import("path"),{fileURLToPath:i}=await import("url");if(typeof globalThis.__filename>"u"&&(globalThis.__filename=i(import.meta.url)),typeof globalThis.__dirname>"u"&&(globalThis.__dirname=e(globalThis.__filename)),typeof globalThis.require>"u"){let{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}}
|
3
3
|
|
4
|
-
import{spawn as
|
4
|
+
import{spawn as F,execSync as q}from"child_process";import C from"node:process";import W from"node:os";import P from"node:tty";if(typeof process<"u"){let{dirname:r}=await import("path"),{fileURLToPath:e}=await import("url");if(typeof globalThis.__filename>"u"&&(globalThis.__filename=e(import.meta.url)),typeof globalThis.__dirname>"u"&&(globalThis.__dirname=r(globalThis.__filename)),typeof globalThis.require>"u"){let{default:t}=await import("module");globalThis.require=t.createRequire(import.meta.url)}}var G={win32:r=>({cmd:"cmd.exe",args:["/d","/s","/c",r]})},Y={"cp -rf":{win32:r=>{let e="xcopy /E /S /G /Q /Y",t=r.map(o=>o.endsWith("\\")?o:`${o}\\`).map(o=>o.replace(/\*\\$/,""));return`${e} ${t.join(" ")}`}},ln:{win32:r=>`mklink /D ${r.join(" ")}`},pkill:{win32:r=>`taskkill /T /F /pid ${r.join(" ")}`}},E=(r,e,t)=>{let o={...G,...e},l={...Y,...t},i=s=>{let c=process.platform,m=o[c];if(m)return m(s);let[g,...h]=s.split(" ");return{cmd:g,args:h}},n=(s=>{let c=Object.entries(l);for(let[m,g]of c)if(s.startsWith(m)){let h=process.platform,b=g[h];if(!b)break;let p=s.slice(m.length).trim().split(" ");return b(p)}return s})(r);return i(n)};if(typeof process<"u"){let{dirname:r}=await import("path"),{fileURLToPath:e}=await import("url");if(typeof globalThis.__filename>"u"&&(globalThis.__filename=e(import.meta.url)),typeof globalThis.__dirname>"u"&&(globalThis.__dirname=r(globalThis.__filename)),typeof globalThis.require>"u"){let{default:t}=await import("module");globalThis.require=t.createRequire(import.meta.url)}}if(typeof process<"u"){let{dirname:r}=await import("path"),{fileURLToPath:e}=await import("url");if(typeof globalThis.__filename>"u"&&(globalThis.__filename=e(import.meta.url)),typeof globalThis.__dirname>"u"&&(globalThis.__dirname=r(globalThis.__filename)),typeof globalThis.require>"u"){let{default:t}=await import("module");globalThis.require=t.createRequire(import.meta.url)}}var M=(r=0)=>e=>`\x1B[${e+r}m`,I=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,j=(r=0)=>(e,t,o)=>`\x1B[${38+r};2;${e};${t};${o}m`;function U(){let r=new Map,e={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],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],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,o]of Object.entries(e)){for(let[l,i]of Object.entries(o))e[l]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},o[l]=e[l],r.set(i[0],i[1]);Object.defineProperty(e,t,{value:o,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=M(),e.color.ansi256=I(),e.color.ansi16m=j(),e.bgColor.ansi=M(10),e.bgColor.ansi256=I(10),e.bgColor.ansi16m=j(10),Object.defineProperties(e,{rgbToAnsi256:{value:(t,o,l)=>t===o&&o===l?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(o/255*5)+Math.round(l/255*5),enumerable:!1},hexToRgb:{value:t=>{let o=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!o)return[0,0,0];let{colorString:l}=o.groups;l.length===3&&(l=[...l].map(n=>n+n).join(""));let i=Number.parseInt(l,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let o,l,i;if(t>=232)o=((t-232)*10+8)/255,l=o,i=o;else{t-=16;let c=t%36;o=Math.floor(t/36)/5,l=Math.floor(c/6)/5,i=c%6/5}let n=Math.max(o,l,i)*2;if(n===0)return 30;let s=30+(Math.round(i)<<2|Math.round(l)<<1|Math.round(o));return n===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,o,l)=>e.ansi256ToAnsi(e.rgbToAnsi256(t,o,l)),enumerable:!1},hexToAnsi:{value:t=>e.ansi256ToAnsi(e.hexToAnsi256(t)),enumerable:!1}}),e}var V=U(),f=V;function u(r,e=C.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",o=e.indexOf(t+r),l=e.indexOf("--");return o!==-1&&(l===-1||o<l)}var{env:a}=C,R;u("no-color")||u("no-colors")||u("color=false")||u("color=never")?R=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(R=1);function D(){if("FORCE_COLOR"in a)return a.FORCE_COLOR==="true"?1:a.FORCE_COLOR==="false"?0:a.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(a.FORCE_COLOR,10),3)}function K(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function H(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let o=D();o!==void 0&&(R=o);let l=t?R:o;if(l===0)return 0;if(t){if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2}if(r&&!e&&l===void 0)return 0;let i=l||0;if(a.TERM==="dumb")return i;if(C.platform==="win32"){let n=W.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in a)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(n=>n in a)||a.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in a&&"AGENT_NAME"in a)return 1;if(a.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in a){let n=Number.parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||"COLORTERM"in a?1:i}function S(r,e={}){let t=H(r,{streamIsTTY:r&&r.isTTY,...e});return K(t)}var J={stdout:S({isTTY:P.isatty(1)}),stderr:S({isTTY:P.isatty(2)})},Q=J;function z(r,e,t){let o=r.indexOf(e);if(o===-1)return r;let l=e.length,i=0,n="";do n+=r.substr(i,o-i)+e+t,i=o+l,o=r.indexOf(e,i);while(o!==-1);return n+=r.slice(i),n}function X(r,e,t,o){let l=0,i="";do{let n=r[o-1]==="\r";i+=r.substr(l,(n?o-1:o)-l)+e+(n?`\r
|
5
5
|
`:`
|
6
6
|
`)+t,l=o+1,o=r.indexOf(`
|
7
|
-
`,l)}while(o!==-1);return i+=r.slice(l),i}var{stdout:$,stderr:
|
8
|
-
`);return i!==-1&&(e=
|
9
|
-
$ ${n} ${
|
10
|
-
`)),await new Promise((
|
7
|
+
`,l)}while(o!==-1);return i+=r.slice(l),i}var{stdout:$,stderr:L}=Q,y=Symbol("GENERATOR"),d=Symbol("STYLER"),v=Symbol("IS_EMPTY"),k=["ansi","ansi","ansi256","ansi16m"],T=Object.create(null),Z=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=$?$.level:0;r.level=e.level===void 0?t:e.level},ee=r=>{let e=(...t)=>t.join(" ");return Z(e,r),Object.setPrototypeOf(e,O.prototype),e};function O(r){return ee(r)}Object.setPrototypeOf(O.prototype,Function.prototype);for(let[r,e]of Object.entries(f))T[r]={get(){let t=_(this,x(e.open,e.close,this[d]),this[v]);return Object.defineProperty(this,r,{value:t}),t}};T.visible={get(){let r=_(this,this[d],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var w=(r,e,t,...o)=>r==="rgb"?e==="ansi16m"?f[t].ansi16m(...o):e==="ansi256"?f[t].ansi256(f.rgbToAnsi256(...o)):f[t].ansi(f.rgbToAnsi(...o)):r==="hex"?w("rgb",e,t,...f.hexToRgb(...o)):f[t][r](...o),re=["rgb","hex","ansi256"];for(let r of re){T[r]={get(){let{level:t}=this;return function(...o){let l=x(w(r,k[t],"color",...o),f.color.close,this[d]);return _(this,l,this[v])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);T[e]={get(){let{level:t}=this;return function(...o){let l=x(w(r,k[t],"bgColor",...o),f.bgColor.close,this[d]);return _(this,l,this[v])}}}}var te=Object.defineProperties(()=>{},{...T,level:{enumerable:!0,get(){return this[y].level},set(r){this[y].level=r}}}),x=(r,e,t)=>{let o,l;return t===void 0?(o=r,l=e):(o=t.openAll+r,l=e+t.closeAll),{open:r,close:e,openAll:o,closeAll:l,parent:t}},_=(r,e,t)=>{let o=(...l)=>oe(o,l.length===1?""+l[0]:l.join(" "));return Object.setPrototypeOf(o,te),o[y]=r,o[d]=e,o[v]=t,o},oe=(r,e)=>{if(r.level<=0||!e)return r[v]?"":e;let t=r[d];if(t===void 0)return e;let{openAll:o,closeAll:l}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=z(e,t.close,t.open),t=t.parent;let i=e.indexOf(`
|
8
|
+
`);return i!==-1&&(e=X(e,l,o,i)),o+e+l};Object.defineProperties(O.prototype,T);var le=O(),de=O({level:L?L.level:0}),ie=le,ne=process.platform==="linux"||process.platform==="darwin",B=process.platform==="win32",ae={stdio:"pipe",shell:!0,detached:!B,env:process.env},se={log:!0,commandTranslations:{},shellTranslations:{},...ae},N=({log:r=!0,commandTranslations:e={},shellTranslations:t={},...o}=se)=>{let l=null;return{childProcess:l,async run(i){if(l)throw new Error("Only one command per shell.");if(typeof i=="object"){let c=process.platform;i.posix&&ne&&(c="posix");let m=i[c];if(!m)throw new Error("No command found for platform: "+JSON.stringify({platform:process.platform,command:i}));i=m}let{cmd:n,args:s}=E(i,t,e);return r&&console.log(ie.dim(`
|
9
|
+
$ ${n} ${s.join(" ")}
|
10
|
+
`)),await new Promise((c,m)=>{l=F(n,s,o);let g="",h="";if(!l)throw new Error("Child process was not set.");let b=p=>{l=null;let A={code:p,stdout:g,stderr:h};p===0||p===1&&!B?c(A):m(A)};l.stdout?.on("data",p=>{g+=p.toString()}),l.stderr?.on("data",p=>{h+=p.toString()}),l.on("close",b),l.on("exit",b),l.on("error",b),l.stdout?.pipe(process.stdout),l.stderr?.pipe(process.stderr)})},kill(i="SIGKILL"){if(l?.pid)if(B)q(`taskkill /t /f /pid ${l.pid}`);else return process.kill(-l.pid,i);return!0}}};import{pathToFileURL as ue}from"url";import{resolve as ce}from"path";import{INSTALL_ROOT as me}from"../../constants.js";var Be=async()=>{let r=ce(me,"dist/loader/index.js"),e=["--no-warnings","--loader",ue(r).href,...process.argv.slice(2)],t=N({stdio:"inherit"}),{code:o}=await t.run(`node ${e.join(" ")}`);process.exit(o??0)};export{Be as execute};
|
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.2.0",
|
6
6
|
"repository": "tsmodule/tsmodule",
|
7
7
|
"description": "TypeScript Module loader and compiler",
|
8
8
|
"license": "MIT",
|
@@ -46,7 +46,6 @@
|
|
46
46
|
"@typescript-eslint/parser": "^5.41.0",
|
47
47
|
"assert": "^2.0.0",
|
48
48
|
"ava": "^5.0.1",
|
49
|
-
"await-shell": "^34.1.1",
|
50
49
|
"chalk": "^5.1.2",
|
51
50
|
"commander": "^9.4.1",
|
52
51
|
"debug-logging": "^4.0.4",
|
@@ -58,7 +57,7 @@
|
|
58
57
|
"ora": "^6.1.2",
|
59
58
|
"path": "^0.12.7",
|
60
59
|
"release-it": "^15.5.0",
|
61
|
-
"universal-shell": "^35.0.
|
60
|
+
"universal-shell": "^35.0.1"
|
62
61
|
},
|
63
62
|
"release-it": {
|
64
63
|
"git": {
|