@tsmodule/tsmodule 40.0.11 → 40.0.14

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.
Files changed (63) hide show
  1. package/dist/bin.d.ts +2 -0
  2. package/dist/bin.js +7 -0
  3. package/dist/commands/build/index.d.ts +1 -0
  4. package/dist/commands/build/index.js +6 -62
  5. package/dist/commands/build/lib/emitTsDeclarations.js +1 -18
  6. package/dist/commands/convert/index.js +1 -51
  7. package/dist/commands/create/index.js +1 -51
  8. package/dist/commands/create/lib/templates.js +1 -51
  9. package/dist/commands/dev/index.js +3 -66
  10. package/dist/commands/execute/index.js +1 -10
  11. package/dist/commands/index.js +1 -66
  12. package/dist/commands/normalize/index.js +1 -47
  13. package/dist/commands/normalize/lib/typescriptApi.js +1 -14
  14. package/dist/constants.js +1 -4
  15. package/dist/index.d.ts +0 -1
  16. package/dist/index.js +1 -89
  17. package/dist/loader/index.js +1 -12
  18. package/dist/loader/types.js +0 -3
  19. package/dist/specification/index.js +1 -4
  20. package/dist/specification/types.js +0 -3
  21. package/dist/types/index.js +1 -66
  22. package/dist/utils/cwd.js +1 -8
  23. package/dist/utils/packageJson.js +1 -4
  24. package/dist/utils/programCatch.d.ts +1 -0
  25. package/dist/utils/programCatch.js +1 -0
  26. package/dist/utils/require.js +1 -4
  27. package/dist/utils/resolve.js +1 -4
  28. package/dist/utils/showProgress.d.ts +11 -0
  29. package/dist/utils/showProgress.js +1 -0
  30. package/dist/utils/stdin.js +1 -12
  31. package/package.json +14 -16
  32. package/templates/default/.eslintrc +0 -52
  33. package/templates/default/.github/workflows/ci.yml +0 -30
  34. package/templates/default/.gitignore +0 -10
  35. package/templates/default/LICENSE +0 -16
  36. package/templates/default/README.md +0 -35
  37. package/templates/default/package.json +0 -5
  38. package/templates/default/src/index.ts +0 -4
  39. package/templates/default/test/example.test.ts +0 -7
  40. package/templates/default/tsconfig.json +0 -40
  41. package/templates/react/.eslintrc +0 -54
  42. package/templates/react/.gitignore +0 -11
  43. package/templates/react/LICENSE +0 -16
  44. package/templates/react/README.md +0 -48
  45. package/templates/react/next-env.d.ts +0 -5
  46. package/templates/react/next.config.js +0 -18
  47. package/templates/react/package.json +0 -5
  48. package/templates/react/postcss.config.js +0 -11
  49. package/templates/react/public/vercel.svg +0 -4
  50. package/templates/react/src/components/Card/index.css +0 -18
  51. package/templates/react/src/components/Card/index.tsx +0 -13
  52. package/templates/react/src/components/CardGrid/index.tsx +0 -29
  53. package/templates/react/src/components/Footer/index.tsx +0 -19
  54. package/templates/react/src/components/GetStarted/index.tsx +0 -8
  55. package/templates/react/src/components/Welcome/index.tsx +0 -7
  56. package/templates/react/src/components/index.css +0 -19
  57. package/templates/react/src/components/index.ts +0 -4
  58. package/templates/react/src/index.css +0 -20
  59. package/templates/react/src/index.ts +0 -1
  60. package/templates/react/src/pages/_app.tsx +0 -14
  61. package/templates/react/src/pages/api/hello.ts +0 -13
  62. package/templates/react/src/pages/index.tsx +0 -26
  63. package/templates/react/tailwind.config.js +0 -19
package/dist/utils/cwd.js CHANGED
@@ -1,8 +1 @@
1
- "use strict";
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
-
4
- import{extname as ee,resolve as m}from"path";var A=/\.[mc]?tsx?(?=\?|$)/;var y=/\.([mc])?[tj]sx$/;var a={format:"esm",charset:"utf8",sourcemap:"inline",target:"node16",minify:!1},$={".mts":{...a,loader:"ts"},".jsx":{...a,loader:"jsx"},".tsx":{...a,loader:"tsx"},".cts":{...a,loader:"ts"},".ts":{...a,loader:"ts"},".json":{...a,loader:"json"}},oe=Object.keys($);import{existsSync as D}from"fs";var B=(t=0)=>e=>`\x1B[${e+t}m`,v=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,M=(t=0)=>(e,r,o)=>`\x1B[${38+t};2;${e};${r};${o}m`;function G(){let t=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[r,o]of Object.entries(e)){for(let[n,s]of Object.entries(o))e[n]={open:`\x1B[${s[0]}m`,close:`\x1B[${s[1]}m`},o[n]=e[n],t.set(s[0],s[1]);Object.defineProperty(e,r,{value:o,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=B(),e.color.ansi256=v(),e.color.ansi16m=M(),e.bgColor.ansi=B(10),e.bgColor.ansi256=v(10),e.bgColor.ansi16m=M(10),Object.defineProperties(e,{rgbToAnsi256:{value:(r,o,n)=>r===o&&o===n?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(o/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:r=>{let o=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(r.toString(16));if(!o)return[0,0,0];let{colorString:n}=o.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:r=>e.rgbToAnsi256(...e.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value:r=>{if(r<8)return 30+r;if(r<16)return 90+(r-8);let o,n,s;if(r>=232)o=((r-232)*10+8)/255,n=o,s=o;else{r-=16;let g=r%36;o=Math.floor(r/36)/5,n=Math.floor(g/6)/5,s=g%6/5}let i=Math.max(o,n,s)*2;if(i===0)return 30;let b=30+(Math.round(s)<<2|Math.round(n)<<1|Math.round(o));return i===2&&(b+=60),b},enumerable:!1},rgbToAnsi:{value:(r,o,n)=>e.ansi256ToAnsi(e.rgbToAnsi256(r,o,n)),enumerable:!1},hexToAnsi:{value:r=>e.ansi256ToAnsi(e.hexToAnsi256(r)),enumerable:!1}}),e}var Y=G(),u=Y;import T from"node:process";import U from"node:os";import S from"node:tty";function c(t,e=T.argv){let r=t.startsWith("-")?"":t.length===1?"-":"--",o=e.indexOf(r+t),n=e.indexOf("--");return o!==-1&&(n===-1||o<n)}var{env:l}=T,x;c("no-color")||c("no-colors")||c("color=false")||c("color=never")?x=0:(c("color")||c("colors")||c("color=true")||c("color=always"))&&(x=1);function V(){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 K(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function W(t,{streamIsTTY:e,sniffFlags:r=!0}={}){let o=V();o!==void 0&&(x=o);let n=r?x:o;if(n===0)return 0;if(r){if(c("color=16m")||c("color=full")||c("color=truecolor"))return 3;if(c("color=256"))return 2}if(t&&!e&&n===void 0)return 0;let s=n||0;if(l.TERM==="dumb")return s;if(T.platform==="win32"){let i=U.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 I(t,e={}){let r=W(t,{streamIsTTY:t&&t.isTTY,...e});return K(r)}var J={stdout:I({isTTY:S.isatty(1)}),stderr:I({isTTY:S.isatty(2)})},F=J;function N(t,e,r){let o=t.indexOf(e);if(o===-1)return t;let n=e.length,s=0,i="";do i+=t.substr(s,o-s)+e+r,s=o+n,o=t.indexOf(e,s);while(o!==-1);return i+=t.slice(s),i}function j(t,e,r,o){let n=0,s="";do{let i=t[o-1]==="\r";s+=t.substr(n,(i?o-1:o)-n)+e+(i?`\r
5
- `:`
6
- `)+r,n=o+1,o=t.indexOf(`
7
- `,n)}while(o!==-1);return s+=t.slice(n),s}var{stdout:_,stderr:L}=F,E=Symbol("GENERATOR"),f=Symbol("STYLER"),h=Symbol("IS_EMPTY"),w=["ansi","ansi","ansi256","ansi16m"],p=Object.create(null),z=(t,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 r=_?_.level:0;t.level=e.level===void 0?r:e.level};var H=t=>{let e=(...r)=>r.join(" ");return z(e,t),Object.setPrototypeOf(e,d.prototype),e};function d(t){return H(t)}Object.setPrototypeOf(d.prototype,Function.prototype);for(let[t,e]of Object.entries(u))p[t]={get(){let r=O(this,R(e.open,e.close,this[f]),this[h]);return Object.defineProperty(this,t,{value:r}),r}};p.visible={get(){let t=O(this,this[f],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var C=(t,e,r,...o)=>t==="rgb"?e==="ansi16m"?u[r].ansi16m(...o):e==="ansi256"?u[r].ansi256(u.rgbToAnsi256(...o)):u[r].ansi(u.rgbToAnsi(...o)):t==="hex"?C("rgb",e,r,...u.hexToRgb(...o)):u[r][t](...o),X=["rgb","hex","ansi256"];for(let t of X){p[t]={get(){let{level:r}=this;return function(...o){let n=R(C(t,w[r],"color",...o),u.color.close,this[f]);return O(this,n,this[h])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);p[e]={get(){let{level:r}=this;return function(...o){let n=R(C(t,w[r],"bgColor",...o),u.bgColor.close,this[f]);return O(this,n,this[h])}}}}var q=Object.defineProperties(()=>{},{...p,level:{enumerable:!0,get(){return this[E].level},set(t){this[E].level=t}}}),R=(t,e,r)=>{let o,n;return r===void 0?(o=t,n=e):(o=r.openAll+t,n=e+r.closeAll),{open:t,close:e,openAll:o,closeAll:n,parent:r}},O=(t,e,r)=>{let o=(...n)=>Q(o,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(o,q),o[E]=t,o[f]=e,o[h]=r,o},Q=(t,e)=>{if(t.level<=0||!e)return t[h]?"":e;let r=t[f];if(r===void 0)return e;let{openAll:o,closeAll:n}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=N(e,r.close,r.open),r=r.parent;let s=e.indexOf(`
8
- `);return s!==-1&&(e=j(e,n,o,s)),o+e+n};Object.defineProperties(d.prototype,p);var Z=d(),ge=d({level:L?L.level:0});var P=Z;var te=(t,e)=>{let r=ee(t);return r===e?t:t.substring(0,-r.length||t.length)},k=()=>{let t=process.cwd(),e=m(t,"src"),r=m(t,"dist");return{cwd:t,srcDir:e,outDir:r}},Te=t=>{t=m(t);let{srcDir:e,outDir:r}=k();return t.replace(e,r).replace(A,".js").replace(y,".js")},re=[".mts",".ts",".tsx"],Ee=t=>{t=m(t);let{srcDir:e,outDir:r}=k(),n=te(t,"").replace(r,e),s;for(let i of re){let b=`${n}${i}`;D(b)&&(s=b);let g=m(n,`index${i}`);D(g)&&(s=g)}if(!s)throw new Error(`Could not find source file for: ${P.bold(t)}`);return s};export{Te as getEmittedFile,Ee as getSourceFile,k as getWorkingDirs};
1
+ import{extname as m,resolve as o}from"path";import{isTs as g,isTsxOrJsx as f}from"./resolve.js";import{existsSync as d}from"fs";import p from"chalk";const D=(r,s)=>{const t=m(r);return t===s?r:r.substring(0,-t.length||r.length)},x=()=>{const r=process.cwd(),s=o(r,"src"),t=o(r,"dist");return{cwd:r,srcDir:s,outDir:t}},T=r=>{r=o(r);const{srcDir:s,outDir:t}=x();return r.replace(s,t).replace(g,".js").replace(f,".js")},a=[".mts",".ts",".tsx"],$=r=>{r=o(r);const{srcDir:s,outDir:t}=x(),n=D(r,"").replace(t,s);let e;for(const c of a){const i=`${n}${c}`;d(i)&&(e=i);const u=o(n,`index${c}`);d(u)&&(e=u)}if(!e)throw new Error(`Could not find source file for: ${p.bold(r)}`);return e};export{T as getEmittedFile,$ as getSourceFile,x as getWorkingDirs};
@@ -1,4 +1 @@
1
- "use strict";
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
-
4
- import{readFile as o,writeFile as c}from"fs/promises";import{resolve as a}from"path";var r=async(e=process.cwd())=>{let s=a(e,"package.json");return await o(s,"utf-8")},i=async(e=process.cwd())=>{let s=await r(e);return JSON.parse(s)},k=async(e=process.cwd(),s)=>{let n=a(e,"package.json"),t=await i(e);return Object.assign(t,s),await c(n,JSON.stringify(t,null,2),"utf-8"),t};export{i as getPackageJson,r as getPackageJsonFile,k as setPackageJsonFields};
1
+ import{readFile as o,writeFile as c}from"fs/promises";import{resolve as a}from"path";const r=async(e=process.cwd())=>{const s=a(e,"package.json");return await o(s,"utf-8")},i=async(e=process.cwd())=>{const s=await r(e);return JSON.parse(s)},k=async(e=process.cwd(),s)=>{const n=a(e,"package.json"),t=await i(e);return Object.assign(t,s),await c(n,JSON.stringify(t,null,2),"utf-8"),t};export{i as getPackageJson,r as getPackageJsonFile,k as setPackageJsonFields};
@@ -0,0 +1 @@
1
+ export declare const programCatch: (fn: (...args: any[]) => any | Promise<any>) => (...args: any[]) => Promise<any>;
@@ -0,0 +1 @@
1
+ import{bannerError as s}from"../commands/index.js";import n from"chalk";const a=o=>{const e=o;return!(e.code===void 0||e.stdout==null||e.stderr==null)},c=o=>async(...t)=>{try{return await o(...t)}catch(r){s("Error"),a(r)?(r.stdout&&console.log(n.red(r.stdout)),r.stderr&&console.log(n.redBright(r.stderr))):console.log(n.redBright(JSON.stringify(r,null,2))),console.log()}};export{c as programCatch};
@@ -1,4 +1 @@
1
- "use strict";
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
-
4
- 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)}})();
1
+ typeof document>"u"&&await(async()=>{const{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"){const{default:a}=await import("module");globalThis.require=a.createRequire(import.meta.url)}})();
@@ -1,4 +1 @@
1
- "use strict";
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
-
4
- import{existsSync as i}from"fs";import{fileURLToPath as c}from"url";import{posix as x}from"path";import{sep as p}from"path";var g=!1,O=/\.[mc]?tsx?(?=\?|$)/,h=/\.([mc])?js$/,S=/\.([mc])?[tj]sx$/,L=/\.([mc])?[tj]sx?$/,e={format:"esm",charset:"utf8",sourcemap:"inline",target:"node16",minify:!1},a={".mts":{...e,loader:"ts"},".jsx":{...e,loader:"jsx"},".tsx":{...e,loader:"tsx"},".cts":{...e,loader:"ts"},".ts":{...e,loader:"ts"},".json":{...e,loader:"json"}},n=Object.keys(a),M=s=>s.split(p).join(x.sep),l=s=>{let t=c(s);if(i(t))return s},r=s=>{for(let t of s)if(l(t))return t},m=s=>{let t=n.filter(o=>o.includes("ts")).concat([".js"]);return r(t.map(o=>s+o))},f=s=>{let t=n.filter(o=>o.includes("js")).concat([".js"]);return r(t.map(o=>s+o))},T=s=>{let t=f(s);if(t)return t;let o=m(s);if(o)return o};export{e as BASE_CONFIG,g as DEVELOPMENT_MODE,a as MODULE_LOADERS,n as POSSIBLE_EXTENSIONS,T as checkExtensions,f as checkJsExtension,m as checkTsExtensions,l as fileExists,r as fileExistsAny,h as isJs,L as isJsOrTs,O as isTs,S as isTsxOrJsx,M as normalizeSpecifier};
1
+ import{existsSync as i}from"fs";import{fileURLToPath as c}from"url";import{posix as x}from"path";import{sep as p}from"path";const g=!1,O=/\.[mc]?tsx?(?=\?|$)/,h=/\.([mc])?js$/,S=/\.([mc])?[tj]sx$/,L=/\.([mc])?[tj]sx?$/,e={format:"esm",charset:"utf8",sourcemap:"inline",target:"node16",minify:!1},a={".mts":{...e,loader:"ts"},".jsx":{...e,loader:"jsx"},".tsx":{...e,loader:"tsx"},".cts":{...e,loader:"ts"},".ts":{...e,loader:"ts"},".json":{...e,loader:"json"}},n=Object.keys(a),M=s=>s.split(p).join(x.sep),l=s=>{const t=c(s);if(i(t))return s},r=s=>{for(const t of s)if(l(t))return t},m=s=>{const t=n.filter(o=>o.includes("ts")).concat([".js"]);return r(t.map(o=>s+o))},f=s=>{const t=n.filter(o=>o.includes("js")).concat([".js"]);return r(t.map(o=>s+o))},T=s=>{const t=f(s);if(t)return t;const o=m(s);if(o)return o};export{e as BASE_CONFIG,g as DEVELOPMENT_MODE,a as MODULE_LOADERS,n as POSSIBLE_EXTENSIONS,T as checkExtensions,f as checkJsExtension,m as checkTsExtensions,l as fileExists,r as fileExistsAny,h as isJs,L as isJsOrTs,O as isTs,S as isTsxOrJsx,M as normalizeSpecifier};
@@ -0,0 +1,11 @@
1
+ interface ProgressMessages {
2
+ start: string;
3
+ success: string;
4
+ error: string;
5
+ }
6
+ /**
7
+ * Displays your `info` message to the user, calls a function, then shows the
8
+ * relevant `success` or `error` message when the promise resolves.
9
+ */
10
+ export declare const showProgress: (fn: () => unknown | Promise<unknown>, messages: ProgressMessages) => Promise<void>;
11
+ export {};
@@ -0,0 +1 @@
1
+ import e from"ora";const c=async(o,r)=>{const s=e(r.start);try{await o(),s.succeed(r.success)}catch(t){throw s.fail(r.error),t}};export{c as showProgress};
@@ -1,12 +1 @@
1
- "use strict";
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
-
4
- import{readFileSync as Z}from"fs";var v={NODE_ENV:"production"};try{let{env:r}=await import("process");r.NODE_ENV&&(v.NODE_ENV=r.NODE_ENV)}catch{}var T=v.NODE_ENV==="development";import{Console as X}from"console";var N=(r=0)=>e=>`\x1B[${e+r}m`,x=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,M=(r=0)=>(e,o,t)=>`\x1B[${38+r};2;${e};${o};${t}m`;function G(){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[o,t]of Object.entries(e)){for(let[n,l]of Object.entries(t))e[n]={open:`\x1B[${l[0]}m`,close:`\x1B[${l[1]}m`},t[n]=e[n],r.set(l[0],l[1]);Object.defineProperty(e,o,{value:t,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=N(),e.color.ansi256=x(),e.color.ansi16m=M(),e.bgColor.ansi=N(10),e.bgColor.ansi256=x(10),e.bgColor.ansi16m=M(10),Object.defineProperties(e,{rgbToAnsi256:{value:(o,t,n)=>o===t&&t===n?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(n/255*5),enumerable:!1},hexToRgb:{value:o=>{let t=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(o.toString(16));if(!t)return[0,0,0];let{colorString:n}=t.groups;n.length===3&&(n=[...n].map(s=>s+s).join(""));let l=Number.parseInt(n,16);return[l>>16&255,l>>8&255,l&255]},enumerable:!1},hexToAnsi256:{value:o=>e.rgbToAnsi256(...e.hexToRgb(o)),enumerable:!1},ansi256ToAnsi:{value:o=>{if(o<8)return 30+o;if(o<16)return 90+(o-8);let t,n,l;if(o>=232)t=((o-232)*10+8)/255,n=t,l=t;else{o-=16;let f=o%36;t=Math.floor(o/36)/5,n=Math.floor(f/6)/5,l=f%6/5}let s=Math.max(t,n,l)*2;if(s===0)return 30;let b=30+(Math.round(l)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(b+=60),b},enumerable:!1},rgbToAnsi:{value:(o,t,n)=>e.ansi256ToAnsi(e.rgbToAnsi256(o,t,n)),enumerable:!1},hexToAnsi:{value:o=>e.ansi256ToAnsi(e.hexToAnsi256(o)),enumerable:!1}}),e}var k=G(),c=k;import C from"node:process";import V from"node:os";import S from"node:tty";function u(r,e=C.argv){let o=r.startsWith("-")?"":r.length===1?"-":"--",t=e.indexOf(o+r),n=e.indexOf("--");return t!==-1&&(n===-1||t<n)}var{env:i}=C,O;u("no-color")||u("no-colors")||u("color=false")||u("color=never")?O=0:(u("color")||u("colors")||u("color=true")||u("color=always"))&&(O=1);function Y(){if("FORCE_COLOR"in i)return i.FORCE_COLOR==="true"?1:i.FORCE_COLOR==="false"?0:i.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(i.FORCE_COLOR,10),3)}function $(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function U(r,{streamIsTTY:e,sniffFlags:o=!0}={}){let t=Y();t!==void 0&&(O=t);let n=o?O:t;if(n===0)return 0;if(o){if(u("color=16m")||u("color=full")||u("color=truecolor"))return 3;if(u("color=256"))return 2}if(r&&!e&&n===void 0)return 0;let l=n||0;if(i.TERM==="dumb")return l;if(C.platform==="win32"){let s=V.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in i)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(s=>s in i)||i.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in i)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(i.TEAMCITY_VERSION)?1:0;if("TF_BUILD"in i&&"AGENT_NAME"in i)return 1;if(i.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in i){let s=Number.parseInt((i.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(i.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(i.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(i.TERM)||"COLORTERM"in i?1:l}function I(r,e={}){let o=U(r,{streamIsTTY:r&&r.isTTY,...e});return $(o)}var K={stdout:I({isTTY:S.isatty(1)}),stderr:I({isTTY:S.isatty(2)})},F=K;function _(r,e,o){let t=r.indexOf(e);if(t===-1)return r;let n=e.length,l=0,s="";do s+=r.substr(l,t-l)+e+o,l=t+n,t=r.indexOf(e,l);while(t!==-1);return s+=r.slice(l),s}function L(r,e,o,t){let n=0,l="";do{let s=r[t-1]==="\r";l+=r.substr(n,(s?t-1:t)-n)+e+(s?`\r
5
- `:`
6
- `)+o,n=t+1,t=r.indexOf(`
7
- `,n)}while(t!==-1);return l+=r.slice(n),l}var{stdout:w,stderr:P}=F,R=Symbol("GENERATOR"),g=Symbol("STYLER"),d=Symbol("IS_EMPTY"),D=["ansi","ansi","ansi256","ansi16m"],p=Object.create(null),W=(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 o=w?w.level:0;r.level=e.level===void 0?o:e.level};var H=r=>{let e=(...o)=>o.join(" ");return W(e,r),Object.setPrototypeOf(e,h.prototype),e};function h(r){return H(r)}Object.setPrototypeOf(h.prototype,Function.prototype);for(let[r,e]of Object.entries(c))p[r]={get(){let o=E(this,y(e.open,e.close,this[g]),this[d]);return Object.defineProperty(this,r,{value:o}),o}};p.visible={get(){let r=E(this,this[g],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var B=(r,e,o,...t)=>r==="rgb"?e==="ansi16m"?c[o].ansi16m(...t):e==="ansi256"?c[o].ansi256(c.rgbToAnsi256(...t)):c[o].ansi(c.rgbToAnsi(...t)):r==="hex"?B("rgb",e,o,...c.hexToRgb(...t)):c[o][r](...t),q=["rgb","hex","ansi256"];for(let r of q){p[r]={get(){let{level:o}=this;return function(...t){let n=y(B(r,D[o],"color",...t),c.color.close,this[g]);return E(this,n,this[d])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);p[e]={get(){let{level:o}=this;return function(...t){let n=y(B(r,D[o],"bgColor",...t),c.bgColor.close,this[g]);return E(this,n,this[d])}}}}var z=Object.defineProperties(()=>{},{...p,level:{enumerable:!0,get(){return this[R].level},set(r){this[R].level=r}}}),y=(r,e,o)=>{let t,n;return o===void 0?(t=r,n=e):(t=o.openAll+r,n=e+o.closeAll),{open:r,close:e,openAll:t,closeAll:n,parent:o}},E=(r,e,o)=>{let t=(...n)=>J(t,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(t,z),t[R]=r,t[g]=e,t[d]=o,t},J=(r,e)=>{if(r.level<=0||!e)return r[d]?"":e;let o=r[g];if(o===void 0)return e;let{openAll:t,closeAll:n}=o;if(e.includes("\x1B"))for(;o!==void 0;)e=_(e,o.close,o.open),o=o.parent;let l=e.indexOf(`
8
- `);return l!==-1&&(e=L(e,n,t,l)),t+e+n};Object.defineProperties(h.prototype,p);var Q=h(),ge=h({level:P?P.level:0});var m=Q;var a=new X({stdout:process.stdout,stderr:process.stderr,groupIndentation:4}),A=r=>{if(T){let{name:e}=r;return{log(...o){let t=m.bgBlue.white(` [${e}] `);a.log(`${t}`,`
9
-
10
- `,...o),a.log()},group(){a.log();let o=m.bgBlue.white(` [${e}] `);a.group(o),a.log()},groupEnd(){a.log(`
11
- `,"-".repeat(20),`
12
- `),a.groupEnd()}}}else return{log(){},group(){},groupEnd(){}}};var j=(...r)=>{console.log(),console.log(...r),console.log()};function ee(r){return new Promise((e,o)=>{let t=[];function n(f){t.push(f)}function l(){b(),e(Buffer.concat(t))}function s(f){b(),o(f)}function b(){r.removeListener("data",n),r.removeListener("end",l),r.removeListener("error",s)}r.on("data",n),r.on("end",l),r.on("error",s)})}var re=async()=>{let r=A(re);r.log("Reading stdin");try{let o=Z(0).toString();if(o)return r.log("Found stdin",{stdin:o}),o}catch(o){r.log("Could not read stdin",{e:o})}return j(m.gray("Type your source code. Press Ctrl+D to finish.")),(await ee(process.stdin)).toString()};export{re as readStdin};
1
+ import{readFileSync as c}from"fs";import{createDebugLogger as d,log as a}from"debug-logging";import m from"chalk";function g(n){return new Promise((e,r)=>{const t=[];function i(o){t.push(o)}function s(){u(),e(Buffer.concat(t))}function f(o){u(),r(o)}function u(){n.removeListener("data",i),n.removeListener("end",s),n.removeListener("error",f)}n.on("data",i),n.on("end",s),n.on("error",f)})}const p=async()=>{const n=d(p);n.log("Reading stdin");try{const r=c(0).toString();if(r)return n.log("Found stdin",{stdin:r}),r}catch(r){n.log("Could not read stdin",{e:r})}return a(m.gray("Type your source code. Press Ctrl+D to finish.")),(await g(process.stdin)).toString()};export{p as readStdin};
package/package.json CHANGED
@@ -2,45 +2,43 @@
2
2
  "name": "@tsmodule/tsmodule",
3
3
  "platform": "node",
4
4
  "type": "module",
5
- "version": "40.0.11",
5
+ "version": "40.0.14",
6
6
  "repository": "tsmodule/tsmodule",
7
7
  "description": "TypeScript Module loader and compiler",
8
8
  "license": "MIT",
9
9
  "types": "dist/types/index.d.ts",
10
10
  "bin": {
11
- "tsmodule": "dist/index.js"
11
+ "tsmodule": "dist/bin.js"
12
12
  },
13
13
  "exports": {
14
- ".": "./dist/loader/index.js",
14
+ ".": "./dist/index.js",
15
15
  "./*": "./dist/*/index.js",
16
16
  "./package.json": "./package.json"
17
17
  },
18
18
  "files": [
19
19
  "dist/",
20
- "templates/",
21
- "templates/**/.gitignore"
20
+ "dist/templates/",
21
+ "dist/templates/**/.gitignore"
22
22
  ],
23
23
  "engines": {
24
24
  "node": ">=14"
25
25
  },
26
26
  "scripts": {
27
- "prebootload": "node bootstrap.js",
27
+ "prebootload": "node scripts/bootstrap.js",
28
28
  "bootload": "node --no-warnings --loader ./dist/loader/index.js src/index.ts build -r",
29
29
  "prebuild": "yarn bootload && yarn link",
30
- "build": "node dist/index.js build -b",
31
- "dev": "node dist/index.js dev",
32
- "test-bundle": "yarn build && ava --no-worker-threads",
33
- "test-production-bundle": "node runBundleTests.js",
30
+ "build": "node dist/bin.js build",
31
+ "dev": "node dist/bin.js dev",
32
+ "test-bundle": "yarn build -b && ava --no-worker-threads",
34
33
  "test": "yarn test-bundle",
35
34
  "retest": "SKIP_TEST_SETUP=1 yarn test-bundle",
36
35
  "retest-bundle": "SKIP_TEST_SETUP=1 yarn test-bundle",
37
36
  "lint": "eslint --fix src",
38
37
  "prepare": "yarn build",
39
- "prepublishOnly": "yarn test-production-bundle",
40
- "release": "release-it"
38
+ "prepublishOnly": "node scripts/prepublish.js"
41
39
  },
42
40
  "dependencies": {
43
- "esbuild": "^0.14.47",
41
+ "esbuild": "0.14.50",
44
42
  "typescript": "^4.7.4"
45
43
  },
46
44
  "devDependencies": {
@@ -49,11 +47,11 @@
49
47
  "@typescript-eslint/eslint-plugin": "^5.30.0",
50
48
  "@typescript-eslint/parser": "^5.30.0",
51
49
  "assert": "^2.0.0",
52
- "ava": "^4.3.0",
50
+ "ava": "^4.3.1",
53
51
  "await-shell": "^34.1.1",
54
52
  "chalk": "^5.0.1",
55
53
  "commander": "^9.3.0",
56
- "create-debug-logger": "^3.0.0",
54
+ "debug-logging": "^4.0.4",
57
55
  "es-module-lexer": "^0.10.5",
58
56
  "eslint": "^8.18.0",
59
57
  "eslint-config-next": "^12.2.0",
@@ -84,7 +82,7 @@
84
82
  },
85
83
  "nodeArguments": [
86
84
  "--no-warnings",
87
- "--loader=@tsmodule/tsmodule"
85
+ "--loader=./dist/loader/index.js"
88
86
  ]
89
87
  },
90
88
  "keywords": [
@@ -1,52 +0,0 @@
1
- {
2
- "extends": [
3
- "plugin:@typescript-eslint/recommended"
4
- ],
5
- "parser": "@typescript-eslint/parser",
6
- "plugins": ["@typescript-eslint"],
7
- "rules": {
8
-
9
- "no-console": "error",
10
- "no-trailing-spaces": "error",
11
- "max-len": [1, 80, 2, {
12
- "ignorePattern": "^import\\s.+\\sfrom\\s.+;$",
13
- "ignoreUrls": true,
14
- "ignoreStrings": true,
15
- "ignoreTemplateLiterals": true,
16
- "ignoreRegExpLiterals": true
17
- }],
18
-
19
- "@typescript-eslint/type-annotation-spacing": ["error"],
20
-
21
- "@typescript-eslint/ban-ts-comment": [
22
- "error",
23
- {
24
- "ts-nocheck": "allow-with-description",
25
- "ts-ignore": "allow-with-description"
26
- }
27
- ],
28
-
29
- "indent": "off",
30
- "@typescript-eslint/indent": ["error", 2],
31
-
32
- "semi": "off",
33
- "@typescript-eslint/semi": ["error", "always"],
34
-
35
- "quotes": "off",
36
- "@typescript-eslint/quotes": ["error", "double"],
37
-
38
- "object-curly-spacing": "off",
39
- "@typescript-eslint/object-curly-spacing": ["error", "always"],
40
-
41
- "sort-imports": [
42
- "warn",
43
- {
44
- "ignoreCase": false,
45
- "ignoreDeclarationSort": false,
46
- "ignoreMemberSort": true,
47
- "memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
48
- "allowSeparatedGroups": true
49
- }
50
- ]
51
- }
52
- }
@@ -1,30 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches:
6
- - '**'
7
- pull_request:
8
- branches:
9
- - '**'
10
-
11
- jobs:
12
- test:
13
- name: Node ${{ matrix.nodejs }} on ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- timeout-minutes: 10
16
- strategy:
17
- matrix:
18
- nodejs: [14, 16, "lts/*"]
19
- os: [ubuntu-latest, windows-latest, macos-latest]
20
- steps:
21
- - uses: actions/checkout@v2
22
- - uses: actions/setup-node@v2
23
- with:
24
- node-version: ${{ matrix.nodejs }}
25
-
26
- - name: Install and link
27
- run: yarn install --frozen-lockfile && yarn build
28
-
29
- - name: Test
30
- run: yarn test
@@ -1,10 +0,0 @@
1
- node_modules
2
-
3
- # Potential Firebase / GCP credentials.
4
- service-account.json
5
-
6
- # Emitted output.
7
- dist/
8
-
9
- # Incremental TS build info.
10
- *.tsbuildinfo
@@ -1,16 +0,0 @@
1
- Permission is hereby granted, free of charge, to any person obtaining a copy of
2
- this software and associated documentation files (the "Software"), to deal in
3
- the Software without restriction, including without limitation the rights to
4
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
5
- the Software, and to permit persons to whom the Software is furnished to do so,
6
- subject to the following conditions:
7
-
8
- The above copyright notice and this permission notice shall be included in all
9
- copies or substantial portions of the Software.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,35 +0,0 @@
1
- # `tsmodule` library
2
-
3
- This is a [`tsmodule`](https://github.com/tsmodule/tsmodule) library. By
4
- default, it is assumed to be a Node program, but this can be adjusted via the
5
- `platform` field in package.json.
6
-
7
- ### Develop
8
-
9
- Rebuild on changes with `tsmodule dev` or the `yarn dev` script:
10
-
11
- ```bash
12
- yarn dev
13
- # calls `tsmodule dev`
14
- ```
15
-
16
- ### Export and publish
17
-
18
- To export your component library, use `tsmodule build` or the `yarn build`
19
- script:
20
-
21
- ```bash
22
- yarn build
23
- # calls `tsmodule build`
24
- ```
25
-
26
- You can then publish to NPM:
27
-
28
- ```bash
29
- yarn publish
30
- ```
31
-
32
- #### Importing from your library
33
-
34
- All index exports, e.g. `src/example/index.tsx` will be available downstream
35
- via `import ... from "my-library/example"`.
@@ -1,5 +0,0 @@
1
- {
2
- "name": "template",
3
- "version": "0.0.1",
4
- "license": "MIT"
5
- }
@@ -1,4 +0,0 @@
1
- export const helloWorld = () => {
2
- // eslint-disable-next-line no-console
3
- console.log("Hello World!");
4
- };
@@ -1,7 +0,0 @@
1
- import test from "ava";
2
-
3
- test("two plus two should equal four", (t) => {
4
- if (2 + 2 === 4) {
5
- t.pass();
6
- }
7
- });
@@ -1,40 +0,0 @@
1
- {
2
- "include": [
3
- "*env.d.ts",
4
- "src/**/*"
5
- ],
6
- "exclude": [
7
- "node_modules",
8
- "test/**"
9
- ],
10
- "compilerOptions": {
11
- "moduleResolution": "Node",
12
- "target": "ESNext",
13
- "module": "ESNext",
14
- "lib": [
15
- "ESNext",
16
- "DOM"
17
- ],
18
- "jsx": "preserve",
19
- "rootDir": "src",
20
- "outDir": "dist",
21
- "allowJs": true,
22
- "importHelpers": true,
23
- "esModuleInterop": true,
24
- "allowSyntheticDefaultImports": true,
25
- "strict": true,
26
- "noUnusedLocals": true,
27
- "noUnusedParameters": true,
28
- "noImplicitReturns": true,
29
- "noFallthroughCasesInSwitch": true,
30
- "skipLibCheck": true,
31
- "resolveJsonModule": true,
32
- "declaration": true,
33
- "sourceMap": true,
34
- "checkJs": true,
35
- "noEmit": false,
36
- "forceConsistentCasingInFileNames": true,
37
- "isolatedModules": true,
38
- "incremental": false
39
- }
40
- }
@@ -1,54 +0,0 @@
1
- {
2
- "extends": [
3
- "plugin:@typescript-eslint/recommended",
4
- "next",
5
- "next/core-web-vitals"
6
- ],
7
- "parser": "@typescript-eslint/parser",
8
- "plugins": ["@typescript-eslint"],
9
- "rules": {
10
-
11
- "no-console": "error",
12
- "no-trailing-spaces": "error",
13
- "max-len": [1, 80, 2, {
14
- "ignorePattern": "^import\\s.+\\sfrom\\s.+;$",
15
- "ignoreUrls": true,
16
- "ignoreStrings": true,
17
- "ignoreTemplateLiterals": true,
18
- "ignoreRegExpLiterals": true
19
- }],
20
-
21
- "@typescript-eslint/type-annotation-spacing": ["error"],
22
-
23
- "@typescript-eslint/ban-ts-comment": [
24
- "error",
25
- {
26
- "ts-nocheck": "allow-with-description",
27
- "ts-ignore": "allow-with-description"
28
- }
29
- ],
30
-
31
- "indent": "off",
32
- "@typescript-eslint/indent": ["error", 2],
33
-
34
- "semi": "off",
35
- "@typescript-eslint/semi": ["error", "always"],
36
-
37
- "quotes": "off",
38
- "@typescript-eslint/quotes": ["error", "double"],
39
-
40
- "object-curly-spacing": "off",
41
- "@typescript-eslint/object-curly-spacing": ["error", "always"],
42
-
43
- "sort-imports": [
44
- "warn",
45
- {
46
- "ignoreCase": false,
47
- "ignoreDeclarationSort": false,
48
- "ignoreMemberSort": true,
49
- "memberSyntaxSortOrder": ["none", "all", "multiple", "single"],
50
- "allowSeparatedGroups": true
51
- }
52
- ]
53
- }
54
- }
@@ -1,11 +0,0 @@
1
- node_modules
2
-
3
- # Potential Firebase / GCP credentials.
4
- service-account.json
5
-
6
- # Emitted output.
7
- dist/
8
- .next/
9
-
10
- # Incremental TS build info.
11
- *.tsbuildinfo
@@ -1,16 +0,0 @@
1
- Permission is hereby granted, free of charge, to any person obtaining a copy of
2
- this software and associated documentation files (the "Software"), to deal in
3
- the Software without restriction, including without limitation the rights to
4
- use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
5
- the Software, and to permit persons to whom the Software is furnished to do so,
6
- subject to the following conditions:
7
-
8
- The above copyright notice and this permission notice shall be included in all
9
- copies or substantial portions of the Software.
10
-
11
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
13
- FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14
- COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
15
- IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
16
- CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,48 +0,0 @@
1
- # `tsmodule` component library
2
-
3
- This is a [`tsmodule`](https://github.com/tsmodule/tsmodule) component library
4
- developed and previewed with Next.js.
5
-
6
- ### Develop
7
-
8
- To start the Next server and develop your components, use `next dev` or the
9
- `yarn dev` script:
10
-
11
- ```bash
12
- yarn dev
13
- # calls `next dev`
14
- ```
15
-
16
- ### Export and publish
17
-
18
- To export your component library, use `tsmodule build` or the `yarn export`
19
- script:
20
-
21
- ```bash
22
- yarn export
23
- # calls `tsmodule build`
24
- ```
25
-
26
- You can then publish to NPM:
27
-
28
- ```bash
29
- yarn publish
30
- ```
31
-
32
- #### Importing from your component library
33
-
34
- To reuse your components:
35
-
36
- 1. Import your component styles via `import "my-library/styles"`.
37
- 2. Import your component and render it via `import { MyComponent } from
38
- "my-library/MyComponent`.
39
-
40
- #### Footnotes
41
-
42
- Styles are exported in `dist/`, and are also bundled to `dist/bundle.css` from
43
- the entrypoint given in the `style` package.json.
44
-
45
- The default behavior is to export all component styles, i.e.
46
- `src/styles/components/index.css ➞ dist/bundle.css`. This can be overridden
47
- with tsmodule's `--styles` flag, i.e. `tsmodule build --styles
48
- src/styles/index.css` (which would include all styles in emitted bundle).
@@ -1,5 +0,0 @@
1
- /// <reference types="next" />
2
- /// <reference types="next/image-types/global" />
3
-
4
- // NOTE: This file should not be edited
5
- // see https://nextjs.org/docs/basic-features/typescript for more information.
@@ -1,18 +0,0 @@
1
- module.exports = {
2
- reactStrictMode: true,
3
- webpack: (config) => {
4
- // config.experiments = { topLevelAwait: true };
5
- // config.resolve.fallback = {
6
- // assert: false,
7
- // process: false,
8
- // events: false,
9
- // fs: false,
10
- // util: false,
11
- // path: false,
12
- // stream: false,
13
- // constants: false,
14
- // os: false,
15
- // };
16
- return config;
17
- },
18
- };
@@ -1,5 +0,0 @@
1
- {
2
- "name": "template",
3
- "version": "0.0.1",
4
- "license": "MIT"
5
- }
@@ -1,11 +0,0 @@
1
- module.exports = {
2
- plugins: {
3
- /**
4
- * PostCSS import resolution must come first.
5
- */
6
- "postcss-import": {},
7
- tailwindcss: {},
8
- autoprefixer: {},
9
- ...(process.env.NODE_ENV === "production" ? { cssnano: {} } : {})
10
- },
11
- };
@@ -1,4 +0,0 @@
1
- <svg width="283" height="64" viewBox="0 0 283 64" fill="none"
2
- xmlns="http://www.w3.org/2000/svg">
3
- <path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.46 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM248.72 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.45 14.5c1.25-3.99 4.67-6.5 9.45-6.5 4.79 0 8.21 2.51 9.45 6.5h-18.9zM200.24 34c0 6 3.92 10 10 10 4.12 0 7.21-1.87 8.8-4.92l7.68 4.43c-3.18 5.3-9.14 8.49-16.48 8.49-11.05 0-19-7.2-19-18s7.96-18 19-18c7.34 0 13.29 3.19 16.48 8.49l-7.68 4.43c-1.59-3.05-4.68-4.92-8.8-4.92-6.07 0-10 4-10 10zm82.48-29v46h-9V5h9zM36.95 0L73.9 64H0L36.95 0zm92.38 5l-27.71 48L73.91 5H84.3l17.32 30 17.32-30h10.39zm58.91 12v9.69c-1-.29-2.06-.49-3.2-.49-5.81 0-10 4-10 10V51h-9V17h9v9.2c0-5.08 5.91-9.2 13.2-9.2z" fill="#000"/>
4
- </svg>
@@ -1,18 +0,0 @@
1
- .card {
2
- @apply p-6 text-left rounded-lg;
3
- @apply max-w-[20rem];
4
- text-decoration: none;
5
- border: 1px solid #eaeaea;
6
- transition: color 0.15s ease, border-color 0.15s ease;
7
- }
8
-
9
- .card:hover,
10
- .card:focus,
11
- .card:active {
12
- color: #0070f3;
13
- border-color: #0070f3;
14
- }
15
-
16
- .card > p {
17
- @apply text-gray-700;
18
- }
@@ -1,13 +0,0 @@
1
- import { FC } from "react";
2
-
3
- interface CardProps {
4
- href: string;
5
- }
6
-
7
- export const Card: FC<CardProps> = ({ href, children }) => {
8
- return (
9
- <a href={href} className="card">
10
- {children}
11
- </a>
12
- );
13
- };