@tsmodule/tsmodule 40.18.0 → 41.0.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 +21 -79
- package/dist/commands/build/index.js +18 -20
- package/dist/commands/build/lib/emitTsDeclarations.js +1 -1
- package/dist/commands/convert/index.js +2 -49
- package/dist/commands/create/index.js +13 -46
- package/dist/commands/create/lib/templates.js +10 -10
- package/dist/commands/dev/index.js +13 -59
- package/dist/commands/execute/index.js +5 -5
- package/dist/commands/index.js +2 -64
- package/dist/commands/normalize/index.js +8 -10
- package/dist/commands/normalize/lib/typescriptApi.js +1 -1
- package/dist/constants.js +1 -1
- package/dist/index.js +2 -64
- package/dist/loader/index.js +7 -7
- package/dist/loader/types.js +1 -1
- package/dist/specification/externs.d.ts +2 -0
- package/dist/specification/externs.js +4 -0
- package/dist/specification/index.js +2 -2
- package/dist/specification/shim.d.ts +0 -22
- package/dist/specification/shim.js +2 -24
- package/dist/specification/types.js +1 -1
- package/dist/types/index.js +2 -64
- package/dist/utils/cwd.js +5 -5
- package/dist/utils/packageJson.js +1 -1
- package/dist/utils/programCatch.js +5 -43
- package/dist/utils/require.js +1 -1
- package/dist/utils/resolve.js +1 -1
- package/dist/utils/showProgress.js +1 -1
- package/dist/utils/stdin.js +1 -1
- package/package.json +2 -2
package/dist/loader/index.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
|
2
|
-
typeof
|
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{extname as
|
4
|
+
import{extname as O,isAbsolute as Q,join as he,normalize as be,resolve as Ee}from"path";import{posix as Oe}from"path";import{win32 as Re}from"path";import{fileURLToPath as Ce,pathToFileURL as X,URL as U}from"url";import{readFile as Te}from"fs/promises";import{transform as ee}from"esbuild";var k={NODE_ENV:"production"};try{let{env:e}=await import("process");e.NODE_ENV&&(k.NODE_ENV=e.NODE_ENV)}catch{}var C=typeof window>"u"&&k.NODE_ENV==="development";import{Console as de}from"console";var D=(e=0)=>o=>`\x1B[${o+e}m`,P=(e=0)=>o=>`\x1B[${38+e};5;${o}m`,G=(e=0)=>(o,r,t)=>`\x1B[${38+e};2;${o};${r};${t}m`,i={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]}},j=Object.keys(i.modifier),A=Object.keys(i.color),M=Object.keys(i.bgColor),$=[...A,...M];function re(){let e=new Map;for(let[o,r]of Object.entries(i)){for(let[t,n]of Object.entries(r))i[t]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},r[t]=i[t],e.set(n[0],n[1]);Object.defineProperty(i,o,{value:r,enumerable:!1})}return Object.defineProperty(i,"codes",{value:e,enumerable:!1}),i.color.close="\x1B[39m",i.bgColor.close="\x1B[49m",i.color.ansi=D(),i.color.ansi256=P(),i.color.ansi16m=G(),i.bgColor.ansi=D(10),i.bgColor.ansi256=P(10),i.bgColor.ansi16m=G(10),Object.defineProperties(i,{rgbToAnsi256:{value(o,r,t){return o===r&&r===t?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(r/255*5)+Math.round(t/255*5)},enumerable:!1},hexToRgb:{value(o){let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));if(!r)return[0,0,0];let[t]=r;t.length===3&&(t=[...t].map(s=>s+s).join(""));let n=Number.parseInt(t,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:o=>i.rgbToAnsi256(...i.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value(o){if(o<8)return 30+o;if(o<16)return 90+(o-8);let r,t,n;if(o>=232)r=((o-232)*10+8)/255,t=r,n=r;else{o-=16;let c=o%36;r=Math.floor(o/36)/5,t=Math.floor(c/6)/5,n=c%6/5}let s=Math.max(r,t,n)*2;if(s===0)return 30;let l=30+(Math.round(n)<<2|Math.round(t)<<1|Math.round(r));return s===2&&(l+=60),l},enumerable:!1},rgbToAnsi:{value:(o,r,t)=>i.ansi256ToAnsi(i.rgbToAnsi256(o,r,t)),enumerable:!1},hexToAnsi:{value:o=>i.ansi256ToAnsi(i.hexToAnsi256(o)),enumerable:!1}}),i}var te=re(),f=te;import B from"node:process";import ne from"node:os";import V from"node:tty";function a(e,o=B.argv){let r=e.startsWith("-")?"":e.length===1?"-":"--",t=o.indexOf(r+e),n=o.indexOf("--");return t!==-1&&(n===-1||t<n)}var{env:u}=B,T;a("no-color")||a("no-colors")||a("color=false")||a("color=never")?T=0:(a("color")||a("colors")||a("color=true")||a("color=always"))&&(T=1);function se(){if("FORCE_COLOR"in u)return u.FORCE_COLOR==="true"?1:u.FORCE_COLOR==="false"?0:u.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(u.FORCE_COLOR,10),3)}function le(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ie(e,{streamIsTTY:o,sniffFlags:r=!0}={}){let t=se();t!==void 0&&(T=t);let n=r?T:t;if(n===0)return 0;if(r){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(u.TERM==="dumb")return s;if(B.platform==="win32"){let l=ne.release().split(".");return Number(l[0])>=10&&Number(l[2])>=10586?Number(l[2])>=14931?3:2:1}if("CI"in u)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(l=>l in u)||u.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in u)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(u.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in u&&"AGENT_NAME"in u)return 1;if(u.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in u){let l=Number.parseInt((u.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(u.TERM_PROGRAM){case"iTerm.app":return l>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(u.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(u.TERM)||"COLORTERM"in u?1:s}function H(e,o={}){let r=ie(e,{streamIsTTY:e&&e.isTTY,...o});return le(r)}var ue={stdout:H({isTTY:V.isatty(1)}),stderr:H({isTTY:V.isatty(2)})},Y=ue;function W(e,o,r){let t=e.indexOf(o);if(t===-1)return e;let n=o.length,s=0,l="";do l+=e.slice(s,t)+o+r,s=t+n,t=e.indexOf(o,s);while(t!==-1);return l+=e.slice(s),l}function K(e,o,r,t){let n=0,s="";do{let l=e[t-1]==="\r";s+=e.slice(n,l?t-1:t)+o+(l?`\r
|
5
5
|
`:`
|
6
|
-
`)+
|
7
|
-
`,n)}while(
|
8
|
-
`);return s!==-1&&(o=
|
6
|
+
`)+r,n=t+1,t=e.indexOf(`
|
7
|
+
`,n)}while(t!==-1);return s+=e.slice(n),s}var{stdout:J,stderr:z}=Y,F=Symbol("GENERATOR"),p=Symbol("STYLER"),b=Symbol("IS_EMPTY"),q=["ansi","ansi","ansi256","ansi16m"],d=Object.create(null),ce=(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 r=J?J.level:0;e.level=o.level===void 0?r:o.level};var ae=e=>{let o=(...r)=>r.join(" ");return ce(o,e),Object.setPrototypeOf(o,E.prototype),o};function E(e){return ae(e)}Object.setPrototypeOf(E.prototype,Function.prototype);for(let[e,o]of Object.entries(f))d[e]={get(){let r=N(this,w(o.open,o.close,this[p]),this[b]);return Object.defineProperty(this,e,{value:r}),r}};d.visible={get(){let e=N(this,this[p],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var S=(e,o,r,...t)=>e==="rgb"?o==="ansi16m"?f[r].ansi16m(...t):o==="ansi256"?f[r].ansi256(f.rgbToAnsi256(...t)):f[r].ansi(f.rgbToAnsi(...t)):e==="hex"?S("rgb",o,r,...f.hexToRgb(...t)):f[r][e](...t),fe=["rgb","hex","ansi256"];for(let e of fe){d[e]={get(){let{level:r}=this;return function(...t){let n=w(S(e,q[r],"color",...t),f.color.close,this[p]);return N(this,n,this[b])}}};let o="bg"+e[0].toUpperCase()+e.slice(1);d[o]={get(){let{level:r}=this;return function(...t){let n=w(S(e,q[r],"bgColor",...t),f.bgColor.close,this[p]);return N(this,n,this[b])}}}}var me=Object.defineProperties(()=>{},{...d,level:{enumerable:!0,get(){return this[F].level},set(e){this[F].level=e}}}),w=(e,o,r)=>{let t,n;return r===void 0?(t=e,n=o):(t=r.openAll+e,n=o+r.closeAll),{open:e,close:o,openAll:t,closeAll:n,parent:r}},N=(e,o,r)=>{let t=(...n)=>ge(t,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(t,me),t[F]=e,t[p]=o,t[b]=r,t},ge=(e,o)=>{if(e.level<=0||!o)return e[b]?"":o;let r=e[p];if(r===void 0)return o;let{openAll:t,closeAll:n}=r;if(o.includes("\x1B"))for(;r!==void 0;)o=W(o,r.close,r.open),r=r.parent;let s=o.indexOf(`
|
8
|
+
`);return s!==-1&&(o=K(o,n,t,s)),t+o+n};Object.defineProperties(E.prototype,d);var pe=E(),je=E({level:z?z.level:0});var I=pe;var m=new de({stdout:process.stdout,stderr:process.stderr,groupIndentation:4}),h=e=>{if(C){let{name:o}=e;return{log(...r){let t=I.bgBlue.white(` [${o}] `);m.log(`${t}`,`
|
9
9
|
|
10
|
-
`,...
|
10
|
+
`,...r),m.log()},group(){m.log();let r=I.bgBlue.white(` [${o}] `);m.group(r),m.log()},groupEnd(){m.log(`
|
11
11
|
`,"-".repeat(20),`
|
12
|
-
`),m.groupEnd()}}}else return{log(){},group(){},groupEnd(){}}};import{
|
12
|
+
`),m.groupEnd()}}}else return{log(){},group(){},groupEnd(){}}};import{checkExtensions as Z,checkTsExtensions as Ne,fileExists as xe,isJs as ve,isTs as ye,MODULE_LOADERS as _}from"../utils/resolve.js";var Le=async(e,o,r)=>{let{parentURL:t}=o,n=h(Le);if(n.log("Resolving specifier:",{importedFromURL:t,specifier:e}),!e.startsWith(".")&&!Q(e))return n.log("Using defaultResolve for named module:",{specifier:e}),r(e,o,r);let{href:s}=X(process.cwd()),{href:l}=new U(t||s);n.log("Finding import URL for",{specifier:e,baseURL:l});let c=e;e.startsWith("file://")||(Q(e)?(n.log("Setting import URL to absolute specifier."),c=X(Ee(be(e))).href):(n.log("Setting import URL relative to baseURL."),c=new U(e,l).href),n.log("Resolved import URL:",{importedFileURL:c,importedFromURL:t}));let x=O(t??"").toLowerCase(),R=O(c).toLowerCase();if(n.log("Rewriting file extension:",{parentExtension:x,specifierExtension:R}),R){let g=c.substring(0,c.lastIndexOf(R));if(n.log("Re-resolving specifier:",{unresolvedSpecifier:g}),ve.test(R)&&ye.test(x)){let L=Ne(g);if(L)return n.log("Found JS import in TS:",{unresolvedSpecifier:g,resolvedTsSourceFile:L}),{url:L,shortCircuit:!0}}return xe(g)?(n.log("Found file at unresolved specifier:",{unresolvedSpecifier:g}),{url:g,shortCircuit:!0}):r(e,o,r)}n.log("Resolving incomplete URL import to file:",{specifier:e});let v=Z(c);if(v)return n.log("Resolved import URL to file:",{resolvedFile:v}),{url:v,shortCircuit:!0};let oe=new U(he(c,"index")).href,y=Z(oe);return y?(n.log("Resolved import URL to index file:",{resolvedIndexFile:y}),{url:y,shortCircuit:!0}):r(e,o,r)},Ae=async(e,o,r)=>{let t=h(Ae);if(t.log("Loading source file:",{url:e}),!e.includes(Re.sep)&&!e.includes(Oe.sep))return t.log("Using defaultLoad for named module:",{url:e}),r(e,o,r);let n=O(e),s=_[n];if(!s)return t.log("No loader found, using defaultLoad:",{url:e}),r(e,o,r);let l=Ce(e),c=await Te(l,"utf8");return{format:"module",source:(await ee(c.toString(),{...s,sourcefile:l,format:"esm"})).code,shortCircuit:!0}},Me=async(e,o,r)=>{let t=h(Me);t.log("Getting format for source file:",{url:e});let n=O(e);return _[n]?{format:"module"}:(t.log("No loader found, using default format:",{url:e}),r(e,o,r))},Be=async(e,o,r)=>{let t=h(Be);t.log("Transforming source from context:",{context:o});let{url:n}=o,s=O(n),l=_[s];return l?{source:(await ee(e.toString(),{...l,logLevel:"info",charset:"utf8",target:"esnext",sourcefile:o.url,format:o.format==="module"?"esm":"cjs"})).code}:(t.log("No loader found, using default transformer:",{url:n}),r(e,o,r))};export{Me as getFormat,Ae as load,Le as resolve,Be as transformSource};
|
package/dist/loader/types.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
|
2
|
-
typeof
|
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
|
|
@@ -0,0 +1,4 @@
|
|
1
|
+
|
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
|
+
|
4
|
+
var t={name:"relative-externs",setup(e){e.onResolve({filter:/^\.\.?\//},({path:n,importer:r})=>r.includes("node_modules")?null:{path:n,external:!0})}};export{t as relativeExternsPlugin};
|
@@ -1,4 +1,4 @@
|
|
1
1
|
|
2
|
-
typeof
|
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
|
-
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",".gitignore","tsconfig.export.json","LICENSE","ava.config.mjs"],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:["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};
|
4
|
+
export*from"./types.js";var t={"./package.json":"./package.json",".":"./dist/index.js","./*":"./dist/*/index.js"},e={packageJson:{type:"module",platform:"node",engines:{node:">=14"},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",".gitignore","tsconfig.export.json","LICENSE","ava.config.mjs"],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:["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};
|
@@ -6,26 +6,4 @@
|
|
6
6
|
* references and it is necessary to ensure they point to the current runtime
|
7
7
|
* location.
|
8
8
|
*/
|
9
|
-
/**
|
10
|
-
* @license *
|
11
|
-
* Copyright 2022 C. Lewis
|
12
|
-
|
13
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
14
|
-
of this software and associated documentation files (the "Software"), to deal
|
15
|
-
in the Software without restriction, including without limitation the rights
|
16
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
17
|
-
copies of the Software, and to permit persons to whom the Software is
|
18
|
-
furnished to do so, subject to the following conditions:
|
19
|
-
|
20
|
-
The above copyright notice and this permission notice shall be included in all
|
21
|
-
copies or substantial portions of the Software.
|
22
|
-
|
23
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
24
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
25
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
26
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
27
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
28
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
29
|
-
SOFTWARE.
|
30
|
-
*/
|
31
9
|
export {};
|
@@ -1,26 +1,4 @@
|
|
1
1
|
|
2
|
-
typeof
|
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
|
-
typeof
|
5
|
-
/**
|
6
|
-
* @license *
|
7
|
-
* Copyright 2022 C. Lewis
|
8
|
-
|
9
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
10
|
-
of this software and associated documentation files (the "Software"), to deal
|
11
|
-
in the Software without restriction, including without limitation the rights
|
12
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
13
|
-
copies of the Software, and to permit persons to whom the Software is
|
14
|
-
furnished to do so, subject to the following conditions:
|
15
|
-
|
16
|
-
The above copyright notice and this permission notice shall be included in all
|
17
|
-
copies or substantial portions of the Software.
|
18
|
-
|
19
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25
|
-
SOFTWARE.
|
26
|
-
*/
|
4
|
+
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)}}
|
@@ -1,3 +1,3 @@
|
|
1
1
|
|
2
|
-
typeof
|
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
|
|