@tsmodule/tsmodule 40.8.0 → 40.9.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.
@@ -1,12 +1,12 @@
1
1
 
2
2
  typeof document>"u"&&await(async()=>{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{extname as R,isAbsolute as ee,join as Re,normalize as Te,resolve as Ce}from"path";import{posix as ve}from"path";import{win32 as ye}from"path";import{fileURLToPath as Le,pathToFileURL as oe,URL as j}from"url";import{readFile as Me}from"fs/promises";import{transform as te}from"esbuild";var D={NODE_ENV:"production"};try{let{env:e}=await import("process");e.NODE_ENV&&(D.NODE_ENV=e.NODE_ENV)}catch{}var C=typeof window>"u"&&D.NODE_ENV==="development";import{Console as be}from"console";var k=(e=0)=>o=>`\x1B[${o+e}m`,P=(e=0)=>o=>`\x1B[${38+e};5;${o}m`,G=(e=0)=>(o,t,r)=>`\x1B[${38+e};2;${o};${t};${r}m`;function ne(){let e=new Map,o={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]}};o.color.gray=o.color.blackBright,o.bgColor.bgGray=o.bgColor.bgBlackBright,o.color.grey=o.color.blackBright,o.bgColor.bgGrey=o.bgColor.bgBlackBright;for(let[t,r]of Object.entries(o)){for(let[n,s]of Object.entries(r))o[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},r[n]=o[n],e.set(s[0],s[1]);Object.defineProperty(o,t,{value:r,enumerable:!1})}return Object.defineProperty(o,"codes",{value:e,enumerable:!1}),o.color.close="\x1B[39m",o.bgColor.close="\x1B[49m",o.color.ansi=k(),o.color.ansi256=P(),o.color.ansi16m=G(),o.bgColor.ansi=k(10),o.bgColor.ansi256=P(10),o.bgColor.ansi16m=G(10),Object.defineProperties(o,{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=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!r)return[0,0,0];let{colorString:n}=r.groups;n.length===3&&(n=[...n].map(i=>i+i).join(""));let s=Number.parseInt(n,16);return[s>>16&255,s>>8&255,s&255]},enumerable:!1},hexToAnsi256:{value:t=>o.rgbToAnsi256(...o.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,s;if(t>=232)r=((t-232)*10+8)/255,n=r,s=r;else{t-=16;let f=t%36;r=Math.floor(t/36)/5,n=Math.floor(f/6)/5,s=f%6/5}let i=Math.max(r,n,s)*2;if(i===0)return 30;let c=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(r));return i===2&&(c+=60),c},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>o.ansi256ToAnsi(o.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>o.ansi256ToAnsi(o.hexToAnsi256(t)),enumerable:!1}}),o}var se=ne(),a=se;import B from"node:process";import ie from"node:os";import $ from"node:tty";function u(e,o=B.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",r=o.indexOf(t+e),n=o.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:l}=B,v;u("no-color")||u("no-colors")||u("color=false")||u("color=never")?v=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(v=1);function le(){if("FORCE_COLOR"in l)return l.FORCE_COLOR==="true"?1:l.FORCE_COLOR==="false"?0:l.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(l.FORCE_COLOR,10),3)}function ce(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ue(e,{streamIsTTY:o,sniffFlags:t=!0}={}){let r=le();r!==void 0&&(v=r);let n=t?v:r;if(n===0)return 0;if(t){if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2}if(e&&!o&&n===void 0)return 0;let s=n||0;if(l.TERM==="dumb")return s;if(B.platform==="win32"){let i=ie.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in l)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in l)||l.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in l)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(l.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in l&&"AGENT_NAME"in l)return 1;if(l.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in l){let i=Number.parseInt((l.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(l.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(l.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(l.TERM)||"COLORTERM"in l?1:s}function V(e,o={}){let t=ue(e,{streamIsTTY:e&&e.isTTY,...o});return ce(t)}var ae={stdout:V({isTTY:$.isatty(1)}),stderr:V({isTTY:$.isatty(2)})},H=ae;function Y(e,o,t){let r=e.indexOf(o);if(r===-1)return e;let n=o.length,s=0,i="";do i+=e.substr(s,r-s)+o+t,s=r+n,r=e.indexOf(o,s);while(r!==-1);return i+=e.slice(s),i}function J(e,o,t,r){let n=0,s="";do{let i=e[r-1]==="\r";s+=e.substr(n,(i?r-1:r)-n)+o+(i?`\r
4
+ import{extname as R,isAbsolute as se,join as ye,normalize as Le,resolve as Me}from"path";import{posix as Ae}from"path";import{win32 as Se}from"path";import{fileURLToPath as Be,pathToFileURL as ie,URL as P}from"url";import{readFile as Fe}from"fs/promises";import{transform as le}from"esbuild";var G={NODE_ENV:"production"};try{let{env:e}=await import("process");e.NODE_ENV&&(G.NODE_ENV=e.NODE_ENV)}catch{}var C=typeof window>"u"&&G.NODE_ENV==="development";import{Console as Te}from"console";var $=(e=0)=>o=>`\x1B[${o+e}m`,V=(e=0)=>o=>`\x1B[${38+e};5;${o}m`,H=(e=0)=>(o,t,r)=>`\x1B[${38+e};2;${o};${t};${r}m`,l={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]}},Y=Object.keys(l.modifier),S=Object.keys(l.color),B=Object.keys(l.bgColor),J=[...S,...B];function ue(){let e=new Map;for(let[o,t]of Object.entries(l)){for(let[r,n]of Object.entries(t))l[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=l[r],e.set(n[0],n[1]);Object.defineProperty(l,o,{value:t,enumerable:!1})}return Object.defineProperty(l,"codes",{value:e,enumerable:!1}),l.color.close="\x1B[39m",l.bgColor.close="\x1B[49m",l.color.ansi=$(),l.color.ansi256=V(),l.color.ansi16m=H(),l.bgColor.ansi=$(10),l.bgColor.ansi256=V(10),l.bgColor.ansi16m=H(10),Object.defineProperties(l,{rgbToAnsi256:{value(o,t,r){return o===t&&t===r?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(o){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:o=>l.rgbToAnsi256(...l.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value(o){if(o<8)return 30+o;if(o<16)return 90+(o-8);let t,r,n;if(o>=232)t=((o-232)*10+8)/255,r=t,n=t;else{o-=16;let u=o%36;t=Math.floor(o/36)/5,r=Math.floor(u/6)/5,n=u%6/5}let s=Math.max(t,r,n)*2;if(s===0)return 30;let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(o,t,r)=>l.ansi256ToAnsi(l.rgbToAnsi256(o,t,r)),enumerable:!1},hexToAnsi:{value:o=>l.ansi256ToAnsi(l.hexToAnsi256(o)),enumerable:!1}}),l}var ae=ue(),f=ae;import F from"node:process";import fe from"node:os";import W from"node:tty";function a(e,o=F.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",r=o.indexOf(t+e),n=o.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:c}=F,N;a("no-color")||a("no-colors")||a("color=false")||a("color=never")?N=0:(a("color")||a("colors")||a("color=true")||a("color=always"))&&(N=1);function me(){if("FORCE_COLOR"in c)return c.FORCE_COLOR==="true"?1:c.FORCE_COLOR==="false"?0:c.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(c.FORCE_COLOR,10),3)}function pe(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ge(e,{streamIsTTY:o,sniffFlags:t=!0}={}){let r=me();r!==void 0&&(N=r);let n=t?N:r;if(n===0)return 0;if(t){if(a("color=16m")||a("color=full")||a("color=truecolor"))return 3;if(a("color=256"))return 2}if(e&&!o&&n===void 0)return 0;let s=n||0;if(c.TERM==="dumb")return s;if(F.platform==="win32"){let i=fe.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in c)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(i=>i in c)||c.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in c)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(c.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in c&&"AGENT_NAME"in c)return 1;if(c.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in c){let i=Number.parseInt((c.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(c.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(c.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(c.TERM)||"COLORTERM"in c?1:s}function K(e,o={}){let t=ge(e,{streamIsTTY:e&&e.isTTY,...o});return pe(t)}var de={stdout:K({isTTY:W.isatty(1)}),stderr:K({isTTY:W.isatty(2)})},z=de;function X(e,o,t){let r=e.indexOf(o);if(r===-1)return e;let n=o.length,s=0,i="";do i+=e.slice(s,r)+o+t,s=r+n,r=e.indexOf(o,s);while(r!==-1);return i+=e.slice(s),i}function q(e,o,t,r){let n=0,s="";do{let i=e[r-1]==="\r";s+=e.slice(n,i?r-1:r)+o+(i?`\r
5
5
  `:`
6
6
  `)+t,n=r+1,r=e.indexOf(`
7
- `,n)}while(r!==-1);return s+=e.slice(n),s}var{stdout:W,stderr:K}=H,A=Symbol("GENERATOR"),m=Symbol("STYLER"),E=Symbol("IS_EMPTY"),z=["ansi","ansi","ansi256","ansi16m"],d=Object.create(null),fe=(e,o={})=>{if(o.level&&!(Number.isInteger(o.level)&&o.level>=0&&o.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=W?W.level:0;e.level=o.level===void 0?t:o.level};var ge=e=>{let o=(...t)=>t.join(" ");return fe(o,e),Object.setPrototypeOf(o,x.prototype),o};function x(e){return ge(e)}Object.setPrototypeOf(x.prototype,Function.prototype);for(let[e,o]of Object.entries(a))d[e]={get(){let t=y(this,F(o.open,o.close,this[m]),this[E]);return Object.defineProperty(this,e,{value:t}),t}};d.visible={get(){let e=y(this,this[m],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var S=(e,o,t,...r)=>e==="rgb"?o==="ansi16m"?a[t].ansi16m(...r):o==="ansi256"?a[t].ansi256(a.rgbToAnsi256(...r)):a[t].ansi(a.rgbToAnsi(...r)):e==="hex"?S("rgb",o,t,...a.hexToRgb(...r)):a[t][e](...r),pe=["rgb","hex","ansi256"];for(let e of pe){d[e]={get(){let{level:t}=this;return function(...r){let n=F(S(e,z[t],"color",...r),a.color.close,this[m]);return y(this,n,this[E])}}};let o="bg"+e[0].toUpperCase()+e.slice(1);d[o]={get(){let{level:t}=this;return function(...r){let n=F(S(e,z[t],"bgColor",...r),a.bgColor.close,this[m]);return y(this,n,this[E])}}}}var me=Object.defineProperties(()=>{},{...d,level:{enumerable:!0,get(){return this[A].level},set(e){this[A].level=e}}}),F=(e,o,t)=>{let r,n;return t===void 0?(r=e,n=o):(r=t.openAll+e,n=o+t.closeAll),{open:e,close:o,openAll:r,closeAll:n,parent:t}},y=(e,o,t)=>{let r=(...n)=>de(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,me),r[A]=e,r[m]=o,r[E]=t,r},de=(e,o)=>{if(e.level<=0||!o)return e[E]?"":o;let t=e[m];if(t===void 0)return o;let{openAll:r,closeAll:n}=t;if(o.includes("\x1B"))for(;t!==void 0;)o=Y(o,t.close,t.open),t=t.parent;let s=o.indexOf(`
8
- `);return s!==-1&&(o=J(o,n,r,s)),r+o+n};Object.defineProperties(x.prototype,d);var he=x(),$e=x({level:K?K.level:0});var w=he;var g=new be({stdout:process.stdout,stderr:process.stderr,groupIndentation:4}),h=e=>{if(C){let{name:o}=e;return{log(...t){let r=w.bgBlue.white(` [${o}] `);g.log(`${r}`,`
7
+ `,n)}while(r!==-1);return s+=e.slice(n),s}var{stdout:Q,stderr:Z}=z,w=Symbol("GENERATOR"),g=Symbol("STYLER"),E=Symbol("IS_EMPTY"),ee=["ansi","ansi","ansi256","ansi16m"],d=Object.create(null),he=(e,o={})=>{if(o.level&&!(Number.isInteger(o.level)&&o.level>=0&&o.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Q?Q.level:0;e.level=o.level===void 0?t:o.level};var be=e=>{let o=(...t)=>t.join(" ");return he(o,e),Object.setPrototypeOf(o,x.prototype),o};function x(e){return be(e)}Object.setPrototypeOf(x.prototype,Function.prototype);for(let[e,o]of Object.entries(f))d[e]={get(){let t=v(this,U(o.open,o.close,this[g]),this[E]);return Object.defineProperty(this,e,{value:t}),t}};d.visible={get(){let e=v(this,this[g],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var I=(e,o,t,...r)=>e==="rgb"?o==="ansi16m"?f[t].ansi16m(...r):o==="ansi256"?f[t].ansi256(f.rgbToAnsi256(...r)):f[t].ansi(f.rgbToAnsi(...r)):e==="hex"?I("rgb",o,t,...f.hexToRgb(...r)):f[t][e](...r),Ee=["rgb","hex","ansi256"];for(let e of Ee){d[e]={get(){let{level:t}=this;return function(...r){let n=U(I(e,ee[t],"color",...r),f.color.close,this[g]);return v(this,n,this[E])}}};let o="bg"+e[0].toUpperCase()+e.slice(1);d[o]={get(){let{level:t}=this;return function(...r){let n=U(I(e,ee[t],"bgColor",...r),f.bgColor.close,this[g]);return v(this,n,this[E])}}}}var xe=Object.defineProperties(()=>{},{...d,level:{enumerable:!0,get(){return this[w].level},set(e){this[w].level=e}}}),U=(e,o,t)=>{let r,n;return t===void 0?(r=e,n=o):(r=t.openAll+e,n=o+t.closeAll),{open:e,close:o,openAll:r,closeAll:n,parent:t}},v=(e,o,t)=>{let r=(...n)=>Oe(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,xe),r[w]=e,r[g]=o,r[E]=t,r},Oe=(e,o)=>{if(e.level<=0||!o)return e[E]?"":o;let t=e[g];if(t===void 0)return o;let{openAll:r,closeAll:n}=t;if(o.includes("\x1B"))for(;t!==void 0;)o=X(o,t.close,t.open),t=t.parent;let s=o.indexOf(`
8
+ `);return s!==-1&&(o=q(o,n,r,s)),r+o+n};Object.defineProperties(x.prototype,d);var Re=x(),We=x({level:Z?Z.level:0});var j=Re;var m=new Te({stdout:process.stdout,stderr:process.stderr,groupIndentation:4}),h=e=>{if(C){let{name:o}=e;return{log(...t){let r=j.bgBlue.white(` [${o}] `);m.log(`${r}`,`
9
9
 
10
- `,...t),g.log()},group(){g.log();let t=w.bgBlue.white(` [${o}] `);g.group(t),g.log()},groupEnd(){g.log(`
10
+ `,...t),m.log()},group(){m.log();let t=j.bgBlue.white(` [${o}] `);m.group(t),m.log()},groupEnd(){m.log(`
11
11
  `,"-".repeat(20),`
12
- `),g.groupEnd()}}}else return{log(){},group(){},groupEnd(){}}};import{existsSync as Ee}from"fs";import{fileURLToPath as xe}from"url";var X=/\.[mc]?tsx?(?=\?|$)/,q=/\.([mc])?js$/;var b={format:"esm",charset:"utf8",sourcemap:"inline",target:"node16",minify:!1},O={".mts":{...b,loader:"ts"},".jsx":{...b,loader:"jsx"},".tsx":{...b,loader:"tsx"},".cts":{...b,loader:"ts"},".ts":{...b,loader:"ts"},".json":{...b,loader:"json"}},Q=Object.keys(O);var I=e=>{let o=xe(e);if(Ee(o))return e},Z=e=>{for(let o of e)if(I(o))return o},U=e=>{let o=Q.filter(t=>t.includes("ts")).concat([".js"]);return Z(o.map(t=>e+t))},Oe=e=>{let o=Q.filter(t=>t.includes("js")).concat([".js"]);return Z(o.map(t=>e+t))},_=e=>{let o=Oe(e);if(o)return o;let t=U(e);if(t)return t};var Ne=async(e,o,t)=>{let{parentURL:r}=o,n=h(Ne);if(n.log("Resolving specifier:",{importedFromURL:r,specifier:e}),!e.startsWith(".")&&!ee(e))return n.log("Using defaultResolve for named module:",{specifier:e}),t(e,o,t);let{href:s}=oe(process.cwd()),{href:i}=new j(r||s);n.log("Finding import URL for",{specifier:e,baseURL:i});let c=e;e.startsWith("file://")||(ee(e)?(n.log("Setting import URL to absolute specifier."),c=oe(Ce(Te(e))).href):(n.log("Setting import URL relative to baseURL."),c=new j(e,i).href),n.log("Resolved import URL:",{importedFileURL:c,importedFromURL:r}));let f=R(r??"").toLowerCase(),T=R(c).toLowerCase();if(n.log("Rewriting file extension:",{parentExtension:f,specifierExtension:T}),T){let p=c.substring(0,c.lastIndexOf(T));if(n.log("Re-resolving specifier:",{unresolvedSpecifier:p}),q.test(T)&&X.test(f)){let N=U(p);if(N)return n.log("Found JS import in TS:",{unresolvedSpecifier:p,resolvedTsSourceFile:N}),{url:N,shortCircuit:!0}}return I(p)?(n.log("Found file at unresolved specifier:",{unresolvedSpecifier:p}),{url:p,shortCircuit:!0}):t(e,o,t)}n.log("Resolving incomplete URL import to file:",{specifier:e});let L=_(c);if(L)return n.log("Resolved import URL to file:",{resolvedFile:L}),{url:L,shortCircuit:!0};let re=new j(Re(c,"index")).href,M=_(re);return M?(n.log("Resolved import URL to index file:",{resolvedIndexFile:M}),{url:M,shortCircuit:!0}):t(e,o,t)},Be=async(e,o,t)=>{let r=h(Be);if(r.log("Loading source file:",{url:e}),!e.includes(ye.sep)&&!e.includes(ve.sep))return r.log("Using defaultLoad for named module:",{url:e}),t(e,o,t);let n=R(e),s=O[n];if(!s)return r.log("No loader found, using defaultLoad:",{url:e}),t(e,o,t);let i=Le(e),c=await Me(i,"utf8"),f=await te(c.toString(),{...s,sourcefile:i,format:"esm"});return{format:"module",source:f.code,shortCircuit:!0}},Ae=async(e,o,t)=>{let r=h(Ae);r.log("Getting format for source file:",{url:e});let n=R(e);return O[n]?{format:"module"}:(r.log("No loader found, using default format:",{url:e}),t(e,o,t))},Se=async(e,o,t)=>{let r=h(Se);r.log("Transforming source from context:",{context:o});let{url:n}=o,s=R(n),i=O[s];return i?{source:(await te(e.toString(),{...i,logLevel:"info",charset:"utf8",target:"esnext",sourcefile:o.url,format:o.format==="module"?"esm":"cjs"})).code}:(r.log("No loader found, using default transformer:",{url:n}),t(e,o,t))};export{Ae as getFormat,Be as load,Ne as resolve,Se as transformSource};
12
+ `),m.groupEnd()}}}else return{log(){},group(){},groupEnd(){}}};import{existsSync as Ce}from"fs";import{fileURLToPath as Ne}from"url";var oe=/\.[mc]?tsx?(?=\?|$)/,te=/\.([mc])?js$/;var b={format:"esm",charset:"utf8",sourcemap:"inline",target:"node16",minify:!1},O={".mts":{...b,loader:"ts"},".jsx":{...b,loader:"jsx"},".tsx":{...b,loader:"tsx"},".cts":{...b,loader:"ts"},".ts":{...b,loader:"ts"},".json":{...b,loader:"json"}},re=Object.keys(O);var _=e=>{let o=Ne(e);if(Ce(o))return e},ne=e=>{for(let o of e)if(_(o))return o},k=e=>{let o=re.filter(t=>t.includes("ts")).concat([".js"]);return ne(o.map(t=>e+t))},ve=e=>{let o=re.filter(t=>t.includes("js")).concat([".js"]);return ne(o.map(t=>e+t))},D=e=>{let o=ve(e);if(o)return o;let t=k(e);if(t)return t};var we=async(e,o,t)=>{let{parentURL:r}=o,n=h(we);if(n.log("Resolving specifier:",{importedFromURL:r,specifier:e}),!e.startsWith(".")&&!se(e))return n.log("Using defaultResolve for named module:",{specifier:e}),t(e,o,t);let{href:s}=ie(process.cwd()),{href:i}=new P(r||s);n.log("Finding import URL for",{specifier:e,baseURL:i});let u=e;e.startsWith("file://")||(se(e)?(n.log("Setting import URL to absolute specifier."),u=ie(Me(Le(e))).href):(n.log("Setting import URL relative to baseURL."),u=new P(e,i).href),n.log("Resolved import URL:",{importedFileURL:u,importedFromURL:r}));let y=R(r??"").toLowerCase(),T=R(u).toLowerCase();if(n.log("Rewriting file extension:",{parentExtension:y,specifierExtension:T}),T){let p=u.substring(0,u.lastIndexOf(T));if(n.log("Re-resolving specifier:",{unresolvedSpecifier:p}),te.test(T)&&oe.test(y)){let A=k(p);if(A)return n.log("Found JS import in TS:",{unresolvedSpecifier:p,resolvedTsSourceFile:A}),{url:A,shortCircuit:!0}}return _(p)?(n.log("Found file at unresolved specifier:",{unresolvedSpecifier:p}),{url:p,shortCircuit:!0}):t(e,o,t)}n.log("Resolving incomplete URL import to file:",{specifier:e});let L=D(u);if(L)return n.log("Resolved import URL to file:",{resolvedFile:L}),{url:L,shortCircuit:!0};let ce=new P(ye(u,"index")).href,M=D(ce);return M?(n.log("Resolved import URL to index file:",{resolvedIndexFile:M}),{url:M,shortCircuit:!0}):t(e,o,t)},Ie=async(e,o,t)=>{let r=h(Ie);if(r.log("Loading source file:",{url:e}),!e.includes(Se.sep)&&!e.includes(Ae.sep))return r.log("Using defaultLoad for named module:",{url:e}),t(e,o,t);let n=R(e),s=O[n];if(!s)return r.log("No loader found, using defaultLoad:",{url:e}),t(e,o,t);let i=Be(e),u=await Fe(i,"utf8");return{format:"module",source:(await le(u.toString(),{...s,sourcefile:i,format:"esm"})).code,shortCircuit:!0}},Ue=async(e,o,t)=>{let r=h(Ue);r.log("Getting format for source file:",{url:e});let n=R(e);return O[n]?{format:"module"}:(r.log("No loader found, using default format:",{url:e}),t(e,o,t))},je=async(e,o,t)=>{let r=h(je);r.log("Transforming source from context:",{context:o});let{url:n}=o,s=R(n),i=O[s];return i?{source:(await le(e.toString(),{...i,logLevel:"info",charset:"utf8",target:"esnext",sourcefile:o.url,format:o.format==="module"?"esm":"cjs"})).code}:(r.log("No loader found, using default transformer:",{url:n}),t(e,o,t))};export{Ue as getFormat,Ie as load,we as resolve,je as transformSource};
@@ -1,4 +1,4 @@
1
1
 
2
2
  typeof document>"u"&&await(async()=>{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
- var t={"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},e={packageJson:{type:"module",platform:"node",types:"dist/index.d.ts",files:["dist"],exports:t,scripts:{dev:"tsmodule dev",build:"tsmodule build",test:"ava",pretest:"tsmodule build",prepublishOnly:"yarn test",lint:"eslint src --fix"},ava:{timeout:"10m",files:["test/**/*.test.ts"],extensions:{ts:"module"},nodeArguments:["--no-warnings","--loader=@tsmodule/tsmodule/loader"]}},files:["tsconfig.json",".eslintrc"],dependencies:[],devDependencies:["@types/node","@tsmodule/tsmodule","@typescript-eslint/eslint-plugin","@typescript-eslint/parser","ava","eslint","typescript"]},s={default:e,react:{packageJson:{platform:"browser",style:"dist/bundle.css",exports:{...t,"./*":"./dist/components/*/index.js","./styles":"./dist/bundle.css","./styles/*":"./dist/components/*/index.css"},scripts:{export:"tsmodule build",dev:"next dev",build:"next build",start:"next start",lint:"next lint --fix",pretest:"tsmodule build --runtime-only",test:"ava",prepublishOnly:"yarn export && yarn test"},resolutions:{"@types/react":"^17.0.38","@types/react-dom":"^17.0.11"}},files:[".eslintrc","next-env.d.ts","next.config.js","postcss.config.js","tailwind.config.js"],dependencies:["react@^17.0.2","react-dom@^17.0.2"],devDependencies:[...e.devDependencies,"@types/react@^17.0.39","@types/react-dom@^17.0.11","eslint-config-next","@tsmodule/react","next","tailwindcss","autoprefixer","cssnano","postcss","postcss-import"]}};export{s as specification};
4
+ var t={"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},e={packageJson:{type:"module",platform:"node",types:"dist/index.d.ts",files:["dist"],exports:t,scripts:{dev:"tsmodule dev",build:"tsmodule build",test:"ava",pretest:"tsmodule build",prepublishOnly:"yarn test",lint:"eslint src --fix"}},files:["tsconfig.json",".eslintrc"],dependencies:[],devDependencies:["@types/node","@tsmodule/tsmodule","@typescript-eslint/eslint-plugin","@typescript-eslint/parser","ava","eslint","typescript"]},s={default:e,react:{packageJson:{platform:"browser",style:"dist/bundle.css",exports:{...t,"./*":"./dist/components/*/index.js","./styles":"./dist/bundle.css","./styles/*":"./dist/components/*/index.css"},scripts:{export:"tsmodule build",dev:"next dev",build:"next build",start:"next start",lint:"next lint --fix",pretest:"tsmodule build --runtime-only",test:"ava",prepublishOnly:"yarn export && yarn test"}},files:[".eslintrc","next-env.d.ts","next.config.js","postcss.config.js","tailwind.config.js"],dependencies:["react@^18.2.0","react-dom@^18.2.0"],devDependencies:[...e.devDependencies,"@types/react@^18.0.23","@types/react-dom@^18.0.7","eslint-config-next","@tsmodule/react","next","tailwindcss","autoprefixer","cssnano","postcss","postcss-import"]}};export{s as specification};