create-tezx-app 4.0.1 → 4.0.7

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 (2) hide show
  1. package/bin +103 -68
  2. package/package.json +1 -1
package/bin CHANGED
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import{execSync as B}from"node:child_process";import{mkdirSync as S,writeFileSync as q}from"node:fs";import k,{join as V,resolve as J}from"node:path";import W from"node:readline";var p=(n,s)=>({version:s,npm:["npm install",n],bun:["bun add",n],yarn:["yarn add",n],pnpm:["pnpm add",n]});var $={readme:`
2
+ import { execSync as B } from "node:child_process"; import { mkdirSync as S, writeFileSync as q } from "node:fs"; import k, { join as V, resolve as J } from "node:path"; import W from "node:readline"; var p = (n, s) => ({ version: s, npm: ["npm install", n], bun: ["bun add", n], yarn: ["yarn add", n], pnpm: ["pnpm add", n] }); var $ = {
3
+ readme: `
3
4
  # \u{1F510} GitHub OAuth2 Example for TezX
4
5
 
5
6
  This example demonstrates how to implement GitHub OAuth2 login using \`@tezx/github-oauth2\`.
@@ -20,7 +21,7 @@ This example demonstrates how to implement GitHub OAuth2 login using \`@tezx/git
20
21
  ### 1. Install the required package
21
22
 
22
23
  \`\`\`bash
23
- ${Object.values(p("@tezx/github-oauth2","^1.0.9"))?.filter(n=>typeof n!="string")?.join(`
24
+ ${Object.values(p("@tezx/github-oauth2", "^1.0.9"))?.filter(n => typeof n != "string")?.join(`
24
25
  #or
25
26
  `)}
26
27
  \`\`\`
@@ -91,7 +92,7 @@ app.get('/github/callback', verifyGithubToken({
91
92
  ---
92
93
 
93
94
  Login securely and build smarter auth with TezX! \u{1F680}
94
- `.trim(),content:`
95
+ `.trim(), content: `
95
96
  // 1. Initialize OAuth2 client
96
97
  const client = GitHubOauthClient({
97
98
  clientId: process.env.GITHUB_CLIENT_ID,
@@ -121,8 +122,12 @@ app.get('/github/callback', verifyGithubToken({
121
122
  }), async (ctx) => {
122
123
  return ctx.json({ success: true });
123
124
  });
124
- `.trim(),files:[{content:`GITHUB_CLIENT_ID=12323
125
- GITHUB_CLIENT_SECRET=234234`,path:".env"}],import:["import { GitHubOauthClient, getGithubOAuthURL, verifyGithubToken } from '@tezx/github-oauth2';"],package:[p("@tezx/github-oauth2","^1.0.9")]};var C={readme:`
125
+ `.trim(), files: [{
126
+ content: `GITHUB_CLIENT_ID=12323
127
+ GITHUB_CLIENT_SECRET=234234`, path: ".env"
128
+ }], import: ["import { GitHubOauthClient, getGithubOAuthURL, verifyGithubToken } from '@tezx/github-oauth2';"], package: [p("@tezx/github-oauth2", "^1.0.9")]
129
+ }; var C = {
130
+ readme: `
126
131
  # \u{1F510} Google OAuth2 Example for TezX
127
132
 
128
133
  This example demonstrates how to use \`@tezx/google-oauth2\` to implement Google OAuth2 login in your TezX app.
@@ -145,12 +150,12 @@ This example demonstrates how to use \`@tezx/google-oauth2\` to implement Google
145
150
  Choose your package manager and install:
146
151
 
147
152
  \`\`\`bash
148
- ${Object.values(p("@tezx/google-oauth2","^1.0.13")).filter(n=>typeof n!="string").join(`
153
+ ${Object.values(p("@tezx/google-oauth2", "^1.0.13")).filter(n => typeof n != "string").join(`
149
154
  # or
150
155
  `)}
151
156
 
152
157
  # Plus Google OAuth SDK
153
- ${Object.values(p("@googleapis/oauth2","^2.0.1")).filter(n=>typeof n!="string").join(`
158
+ ${Object.values(p("@googleapis/oauth2", "^2.0.1")).filter(n => typeof n != "string").join(`
154
159
  # or
155
160
  `)}
156
161
  \`\`\`
@@ -231,7 +236,7 @@ app.get('/auth/callback', verifyGoogleToken({
231
236
  > \u{1F4A1} Note: TezX OAuth2 uses stateful sessions or JWTs depending on your setup. It supports advanced callback hooks for full control.
232
237
 
233
238
  Secure your apps with Google the easy way \u{1F512}
234
- `.trim(),content:`
239
+ `.trim(), content: `
235
240
  // 1. Initialize OAuth2 client
236
241
  const client = GoogleOauthClient({
237
242
  clientId: process.env.GOOGLE_CLIENT_ID,
@@ -279,9 +284,13 @@ app.get('/auth/callback', verifyGoogleToken({
279
284
  }), async (ctx) => {
280
285
  return ctx.json({ success: true });
281
286
  });
282
- `.trim(),files:[{content:`GOOGLE_CLIENT_ID=12323
287
+ `.trim(), files: [{
288
+ content: `GOOGLE_CLIENT_ID=12323
283
289
  GOOGLE_CLIENT_SECRET=234234
284
- `,path:".env"}],import:['import { GoogleOauthClient, getGoogleOAuthURL, verifyGoogleToken } from "@tezx/google-oauth2";'],package:[p("@tezx/google-oauth2","^1.0.13"),p("@googleapis/oauth2","^2.0.1")]};var O={readme:`
290
+ `, path: ".env"
291
+ }], import: ['import { GoogleOauthClient, getGoogleOAuthURL, verifyGoogleToken } from "@tezx/google-oauth2";'], package: [p("@tezx/google-oauth2", "^1.0.13"), p("@googleapis/oauth2", "^2.0.1")]
292
+ }; var O = {
293
+ readme: `
285
294
  # TezX View Engine Example
286
295
 
287
296
  This example demonstrates how to use the \`@tezx/view-engine\` package to render server-side views using template engines such as **EJS**, **Pug**, **Handlebars**, **Mustache**, or **Nunjucks**.
@@ -336,7 +345,7 @@ app.get("engine", async (ctx) => {
336
345
  ---
337
346
 
338
347
  Happy TezX templating! \u{1F389}
339
- `.trim(),content:`
348
+ `.trim(), content: `
340
349
  const views = new ViewEngine("ejs", "./views");
341
350
 
342
351
  app.get("engine", async (ctx) => {
@@ -346,7 +355,8 @@ app.get("engine", async (ctx) => {
346
355
  });
347
356
  return ctx.html(html);
348
357
  });
349
- `.trim(),files:[{content:`
358
+ `.trim(), files: [{
359
+ content: `
350
360
  <html lang="en">
351
361
  <head>
352
362
  <meta charset="UTF-8">
@@ -357,7 +367,9 @@ app.get("engine", async (ctx) => {
357
367
  <p>Hello, <%= user.name %> \u{1F44B}</p>
358
368
  </body>
359
369
  </html>
360
- `.trim(),path:"views/home.ejs"}],import:['import { ViewEngine } from "@tezx/view-engine";'],package:[p("@tezx/view-engine","^1.0.3"),p("ejs","^3.1.10")]};var L=`
370
+ `.trim(), path: "views/home.ejs"
371
+ }], import: ['import { ViewEngine } from "@tezx/view-engine";'], package: [p("@tezx/view-engine", "^1.0.3"), p("ejs", "^3.1.10")]
372
+ }; var L = `
361
373
  <!DOCTYPE html>
362
374
  <html lang="en">
363
375
  <head>
@@ -525,7 +537,8 @@ app.get("engine", async (ctx) => {
525
537
  </script>
526
538
  </body>
527
539
  </html>
528
- `,j={readme:`
540
+ `, j = {
541
+ readme: `
529
542
  # \u{1F50C} TezX WebSocket Example
530
543
 
531
544
  This example demonstrates how to set up a WebSocket server using \`upgradeWebSocket\` from \`tezx/ws\`.
@@ -603,7 +616,7 @@ A simple HTML file is included in \`public/ws.html\`:
603
616
  ---
604
617
 
605
618
  Enjoy real-time power with TezX! \u26A1\uFE0F
606
- `.trim(),content:`
619
+ `.trim(), content: `
607
620
  const socket = [];
608
621
 
609
622
  app.get(
@@ -640,8 +653,15 @@ app.get(
640
653
  return ctx.sendFile("public/ws.html");
641
654
  },
642
655
  );
643
- `.trim(),files:[{content:L,path:"public/ws.html"}],import:['import { upgradeWebSocket } from "tezx/ws";']};var T={minimal:{readme:"",content:"",files:[],import:[],package:[]},ws:j,"github-oauth2":$,"google-oauth2":C,"view-engine":O};import M from"node:readline";async function R(n,s,t){return new Promise(a=>{let o=0;M.emitKeypressEvents(process.stdin,n),process.stdin.isTTY&&process.stdin.setRawMode(!0);let l=()=>{process.stdout.write("\x1B[2J\x1B[0f"),console.log(s+` (Use \u2191 \u2193 arrows, Enter to confirm)
644
- `),t.forEach((c,r)=>{console.log(`${r===o?"\u{1F449}":" "} ${r===o?"\x1B[36m":"\x1B[0m"}${c}\x1B[0m`)})},i=(c,r)=>{if(r.name==="up")o=(o-1+t.length)%t.length,l();else if(r.name==="down")o=(o+1)%t.length,l();else if(r.name==="return")return a(t[o])};l(),process.stdin.on("keypress",i)})}var I={reset:"\x1B[0m",bold:"\x1B[1m",underline:"\x1B[4m",gray:"\x1B[90m",white:"\x1B[97m",black:"\x1B[30m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m",bgWhite:"\x1B[47m",orange:"\x1B[38;2;255;88;30m",bgOrange:"\x1B[48;2;255;88;30m"};function e(n,s){return`${I[s]}${n}${I.reset}`}import{mkdirSync as D,writeFileSync as y}from"node:fs";import{join as d}from"node:path";var g="4.0.1";var U=`
656
+ `.trim(), files: [{ content: L, path: "public/ws.html" }], import: ['import { upgradeWebSocket } from "tezx/ws";']
657
+ }; var T = { minimal: { readme: "", content: "", files: [], import: [], package: [] }, ws: j, "github-oauth2": $, "google-oauth2": C, "view-engine": O }; import M from "node:readline"; async function R(n, s, t) {
658
+ return new Promise(a => {
659
+ let o = 0; M.emitKeypressEvents(process.stdin, n), process.stdin.isTTY && process.stdin.setRawMode(!0); let l = () => {
660
+ process.stdout.write("\x1B[2J\x1B[0f"), console.log(s + ` (Use \u2191 \u2193 arrows, Enter to confirm)
661
+ `), t.forEach((c, r) => { console.log(`${r === o ? "\u{1F449}" : " "} ${r === o ? "\x1B[36m" : "\x1B[0m"}${c}\x1B[0m`) })
662
+ }, i = (c, r) => { if (r.name === "up") o = (o - 1 + t.length) % t.length, l(); else if (r.name === "down") o = (o + 1) % t.length, l(); else if (r.name === "return") return a(t[o]) }; l(), process.stdin.on("keypress", i)
663
+ })
664
+ } var I = { reset: "\x1B[0m", bold: "\x1B[1m", underline: "\x1B[4m", gray: "\x1B[90m", white: "\x1B[97m", black: "\x1B[30m", red: "\x1B[31m", green: "\x1B[32m", yellow: "\x1B[33m", blue: "\x1B[34m", magenta: "\x1B[35m", cyan: "\x1B[36m", bgRed: "\x1B[41m", bgGreen: "\x1B[42m", bgYellow: "\x1B[43m", bgBlue: "\x1B[44m", bgMagenta: "\x1B[45m", bgCyan: "\x1B[46m", bgWhite: "\x1B[47m", orange: "\x1B[38;2;255;88;30m", bgOrange: "\x1B[48;2;255;88;30m" }; function e(n, s) { return `${I[s]}${n}${I.reset}` } import { mkdirSync as D, writeFileSync as x } from "node:fs"; import { join as d } from "node:path"; var g = "4.0.7"; var U = `
645
665
  # \u26A1 TezX \u2013 High-Performance JavaScript Framework for **Bun**
646
666
 
647
667
  **TezX** is a modern, ultra-fast, and lightweight JavaScript framework built specifically for **Bun**.
@@ -832,7 +852,8 @@ Your support helps improve the framework.
832
852
 
833
853
  ---
834
854
 
835
- `,G=({ts:n,template:s,root:t,useStatic:a=!1,staticFolder:o})=>{let l=d(t,n?"src/index.ts":"src/index.js");D(d(t,"src"),{recursive:!0});let i="";s?.import?.push('import { wsHandlers } from "tezx/ws";'),i=`
855
+ `, G = ({ ts: n, template: s, root: t, useStatic: a = !1, staticFolder: o }) => {
856
+ let l = d(t, n ? "src/index.ts" : "src/index.js"); D(d(t, "src"), { recursive: !0 }); let i = ""; s?.import?.push('import { wsHandlers } from "tezx/ws";'), i = `
836
857
  let PORT = Number(process.env.PORT) || 3000;
837
858
  Bun.serve({
838
859
  port: PORT,
@@ -845,26 +866,26 @@ Bun.serve({
845
866
  })
846
867
  });
847
868
  console.log(\`\u{1F680} TezX is running at http://localhost:\${PORT}\`);
848
- `;let c=`
869
+ `; let c = `
849
870
  import { TezX } from "tezx";
850
871
  import { serveStatic } from "tezx/static";
851
872
  import { logger } from "tezx/middleware";
852
873
  ${s?.import?.join(`
853
874
  `)}
854
875
  const app = new TezX({
855
- debugMode: true,
856
876
  // Additional options
857
877
  });
858
878
  app.use([logger()]);
859
879
 
860
880
  app.get("/", (ctx) => ctx.text("Hello from TezX"));
861
881
 
862
- ${a?`app.static(serveStatic("${o||"public"}"));`:""}
863
- ${s?.content?`
882
+ ${a ? `app.static(serveStatic("${o || "public"}"));` : ""}
883
+ ${s?.content ? `
864
884
  ${s?.content?.trim()}
865
- `:""}
885
+ `: ""}
866
886
  ${i}
867
- `;if(n){let r=`
887
+ `; if (n) {
888
+ let r = `
868
889
  {
869
890
  "compilerOptions": {
870
891
  "module": "esnext",
@@ -878,16 +899,19 @@ ${i}
878
899
  "include": ["src"],
879
900
  "exclude": ["node_modules", "dist"]
880
901
  }
881
- `.trim();y(d(t,"tsconfig.json"),r)}y(l,c.trim())},A=({template:n,root:s,projectName:t,ts:a,useWS:o,choiceStep:l})=>{let i=[];Array.isArray(n?.package)&&n?.package?.forEach(h=>{let{version:b,npm:m}=h||{};i.push(`"${m?.[1]}": "${b}"`)});let c=['"@types/bun": "^1.3.1"'];a&&(c.push('"typescript": "^5.8.2"'),c.push('"@types/node": "^22.13.14"'));let r=`
902
+ `.trim(); x(d(t, "tsconfig.json"), r)
903
+ } x(l, c.trim())
904
+ }, A = ({ template: n, root: s, projectName: t, ts: a, useWS: o, choiceStep: l }) => {
905
+ let i = []; Array.isArray(n?.package) && n?.package?.forEach(h => { let { version: b, npm: m } = h || {}; i.push(`"${m?.[1]}": "${b}"`) }); let c = ['"@types/bun": "^1.3.1"']; a && (c.push('"typescript": "^5.8.2"'), c.push('"@types/node": "^22.13.14"')); let r = `
882
906
  {
883
- "name": "${t||"tezx-app-example"}",
907
+ "name": "${t || "tezx-app-example"}",
884
908
  "version": "1.0.0",
885
909
  "type": "module",
886
910
  "description": "TezX is a high-performance, lightweight JavaScript framework designed for speed, scalability, and flexibility. It enables efficient routing, middleware management, and static file serving with minimal configuration.",
887
911
  "scripts": {
888
- "start": "bun src/index${a?".ts":".js"}",
889
- "dev": "bun --hot --watch src/index${a?".ts":".js"}",
890
- "type-check": ${a?'"tsc --noEmit"':`"echo 'No TypeScript configured'"`}
912
+ "start": "bun src/index${a ? ".ts" : ".js"}",
913
+ "dev": "bun --hot --watch src/index${a ? ".ts" : ".js"}",
914
+ "type-check": ${a ? '"tsc --noEmit"' : `"echo 'No TypeScript configured'"`}
891
915
  },
892
916
  "repository": {
893
917
  "type": "git",
@@ -901,16 +925,18 @@ ${i}
901
925
  },
902
926
  "homepage": "https://github.com/tezxjs/tezx-app-example",
903
927
  "dependencies": {
904
- "tezx": "^${g}"${i.length?`,
928
+ "tezx": "^${g}"${i.length ? `,
905
929
  ${i.join(`,
906
- `)}`:""}
930
+ `)}` : ""}
907
931
  },
908
932
  "devDependencies": {
909
933
  ${c.join(`,
910
934
  `)}
911
935
  }
912
936
  }
913
- `.trim();y(d(s,"package.json"),r)},H=({root:n})=>{let s=`
937
+ `.trim(); x(d(s, "package.json"), r)
938
+ }, H = ({ root: n }) => {
939
+ let s = `
914
940
  # Node dependencies
915
941
  node_modules/
916
942
  .env
@@ -980,49 +1006,58 @@ Thumbs.db
980
1006
  .vscode/
981
1007
  .idea/
982
1008
  *.swp
983
- `.trim();y(d(n,".gitignore"),s,{encoding:"utf8"})},P=({root:n,readme:s})=>{let t=typeof s=="string"&&s?s?.trim():U.trim();y(d(n,"README.md"),t,{encoding:"utf8"})};var w=["npm","bun","yarn","pnpm"];function Y(n){let s=0,t=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],a=setInterval(()=>{process.stdout.write(`\r${t[s=++s%t.length]} ${n}`)},80);return()=>{clearInterval(a),process.stdout.write(`\r\u2705 Done!
984
- `)}}var z=W.createInterface({input:process.stdin,output:process.stdout});W.emitKeypressEvents(process.stdin);process.stdin.isTTY&&process.stdin.setRawMode(!0);var x=(n,s="")=>new Promise(t=>{z.question(s?`${n} (${s}): `:n,a=>{t(a.trim()||s)})});async function _(n){let s=n?.directory,t=n?.options;console.log(e(`
985
- \u26A1 TezX App Creator(v${g})`,"orange")),s||(s=await x(e("\u{1F4E6} Project name: ","magenta")),s||(console.log(e("\u274C Project name required.","red")),process.exit(0)));let a=k.basename(s),o=J(process.cwd(),s),l=!!t?.ts,i=t?.staticFolder||"public",c=!0,r={content:"",import:[],readme:"",files:[]};if(t?.t||t?.template){let u=t.t||t.template,v=T?.[u];v||(console.error(`\u274C Unknown template: "${u}"`),console.error(`\u2139\uFE0F Available templates: ${Object.keys(T).join(", ")}`),process.exit(0)),r=v}else l=!!(t?.ts||(await x("\u{1F7E6} Use TypeScript? (y/N): ")).toLowerCase()==="y"),c=!!t?.useStatic||(await x("\u{1F4C1} Use static folder? (y/N): ")).toLowerCase()==="y",i=c?t?.staticFolder||await x("\u{1F4C2} Static folder name? (default: public): "):"";let h=t?.pm||t?.p,b=w?.includes(h)?h:await R(z,"\u{1F4E6} Choose your package manager",w),m=t?.i==="true"||t?.install==="true"||(await x("\u{1F4E5} Install dependencies now? (y/N): ")).toLowerCase()==="y";console.log(`
1009
+ `.trim(); x(d(n, ".gitignore"), s, { encoding: "utf8" })
1010
+ }, P = ({ root: n, readme: s }) => { let t = typeof s == "string" && s ? s?.trim() : U.trim(); x(d(n, "README.md"), t, { encoding: "utf8" }) }; var w = ["npm", "bun", "yarn", "pnpm"]; function Y(n) {
1011
+ let s = 0, t = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"], a = setInterval(() => { process.stdout.write(`\r${t[s = ++s % t.length]} ${n}`) }, 80); return () => {
1012
+ clearInterval(a), process.stdout.write(`\r\u2705 Done!
1013
+ `)
1014
+ }
1015
+ } var z = W.createInterface({ input: process.stdin, output: process.stdout }); W.emitKeypressEvents(process.stdin); process.stdin.isTTY && process.stdin.setRawMode(!0); var y = (n, s = "") => new Promise(t => { z.question(s ? `${n} (${s}): ` : n, a => { t(a.trim() || s) }) }); async function _(n) {
1016
+ let s = n?.directory, t = n?.options; console.log(e(`
1017
+ \u26A1 TezX App Creator(v${g})`, "orange")), s || (s = await y(e("\u{1F4E6} Project name: ", "magenta")), s || (console.log(e("\u274C Project name required.", "red")), process.exit(0))); let a = k.basename(s), o = J(process.cwd(), s), l = !!t?.ts, i = t?.staticFolder || "public", c = !0, r = { content: "", import: [], readme: "", files: [] }; if (t?.t || t?.template) { let u = t.t || t.template, v = T?.[u]; v || (console.error(`\u274C Unknown template: "${u}"`), console.error(`\u2139\uFE0F Available templates: ${Object.keys(T).join(", ")}`), process.exit(0)), r = v } else l = !!(t?.ts || (await y("\u{1F7E6} Use TypeScript? (y/N): ")).toLowerCase() === "y"), c = !!t?.useStatic || (await y("\u{1F4C1} Use static folder? (y/N): ")).toLowerCase() === "y", i = c ? t?.staticFolder || await y("\u{1F4C2} Static folder name? (default: public): ") : ""; let h = t?.pm || t?.p, b = w?.includes(h) ? h : await R(z, "\u{1F4E6} Choose your package manager", w), m = t?.i === "true" || t?.install === "true" || (await y("\u{1F4E5} Install dependencies now? (y/N): ")).toLowerCase() === "y"; console.log(`
986
1018
  \u{1F4C1} Creating project: ${a}...
987
- `);let X=Y("Creating Project");if(S(o,{recursive:!0}),c){let u=V(o,i||"public");S(u,{recursive:!0})}let f={bun:{cd:"cd "+s,install:"bun install",dev:"bun dev",build:"bun build:esm && bun build:dts"},npm:{cd:"cd "+s,install:"npm install",dev:"npm run dev",build:"npm run build:esm && npm run build:dts"},yarn:{cd:"cd "+s,install:"yarn",dev:"yarn dev",build:"yarn build:esm && yarn build:dts"},pnpm:{cd:"cd "+s,install:"pnpm install",dev:"pnpm run dev",build:"pnpm run build:esm && pnpm run build:dts"}}[b];G({template:r,root:o,ts:!!l,staticFolder:i,useStatic:c}),A({projectName:a,root:o,ts:!!l,template:r,choiceStep:f}),H({root:o}),P({root:o,readme:r?.readme}),z.close(),r?.files?.forEach(u=>{let v=k.join(o,k.dirname(u?.path));S(v,{recursive:!0}),q(k.join(o,u?.path),u?.content)}),m&&B(f?.install,{cwd:o,stdio:"inherit"}),console.log(e(`
1019
+ `); let X = Y("Creating Project"); if (S(o, { recursive: !0 }), c) { let u = V(o, i || "public"); S(u, { recursive: !0 }) } let f = { bun: { cd: "cd " + s, install: "bun install", tezx: "bun add tezx@latest", dev: "bun dev", build: "bun build:esm && bun build:dts" }, npm: { cd: "cd " + s, install: "npm install", tezx: "npm install tezx@latest", dev: "npm run dev", build: "npm run build:esm && npm run build:dts" }, yarn: { cd: "cd " + s, install: "yarn", tezx: "yarn add tezx@latest", dev: "yarn dev", build: "yarn build:esm && yarn build:dts" }, pnpm: { cd: "cd " + s, install: "pnpm install", tezx: "pnpm add tezx@latest", dev: "pnpm run dev", build: "pnpm run build:esm && pnpm run build:dts" } }[b]; G({ template: r, root: o, ts: !!l, staticFolder: i, useStatic: c }), A({ projectName: a, root: o, ts: !!l, template: r, choiceStep: f }), H({ root: o }), P({ root: o, readme: r?.readme }), z.close(), r?.files?.forEach(u => { let v = k.join(o, k.dirname(u?.path)); S(v, { recursive: !0 }), q(k.join(o, u?.path), u?.content) }), m && B(f?.install, { cwd: o, stdio: "inherit" }), console.log(e(`
988
1020
  \u2705 TezX project "${a}" is ready!
989
- `,"green")),console.log(e("\u{1F9F0} Summary of your configuration:","cyan")),console.log(`\u{1F4C1} Project Name: ${e(a,"yellow")}`);let E=t?.t||t?.template;E&&console.log(`\u{1F4C1} Template Name: ${e(E,"orange")}`),console.log(`\u{1F7E6} TypeScript: ${e(l?"Yes":"No",l?"green":"gray")}`),console.log(`\u{1F4C1} Static Folder: ${e(c?i||"public":"Not Used",c?"green":"gray")}`),console.log(`\u{1F4E6} Package Manager: ${e(b,"magenta")}`),console.log(`\u{1F4E5} Dependencies Installed: ${e(m?"Yes":"No",m?"green":"red")}
990
- `),console.log(e("\u{1F449} Next Steps:","cyan")),console.log(e(` ${f?.cd}`,"white")),m||console.log(e(` ${f?.install}`,"white")),console.log(e(` ${f?.dev}`,"white")),console.log(""),X(),process.exit(0)}function F(){console.log(`
991
- ${e("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E","gray")}
992
- ${e("\u2502","gray")}${e(" \u26A1 Create TezX","yellow")} - Scaffold your next backend app ${e("\u2502","gray")}
993
- ${e("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F","gray")}
1021
+ `, "green")), console.log(e("\u{1F9F0} Summary of your configuration:", "cyan")), console.log(`\u{1F4C1} Project Name: ${e(a, "yellow")}`); let E = t?.t || t?.template; E && console.log(`\u{1F4C1} Template Name: ${e(E, "orange")}`), console.log(`\u{1F7E6} TypeScript: ${e(l ? "Yes" : "No", l ? "green" : "gray")}`), console.log(`\u{1F4C1} Static Folder: ${e(c ? i || "public" : "Not Used", c ? "green" : "gray")}`), console.log(`\u{1F4E6} Package Manager: ${e(b, "magenta")}`), console.log(`\u{1F4E5} Dependencies Installed: ${e(m ? "Yes" : "No", m ? "green" : "red")}
1022
+ `), console.log(e("\u{1F449} Next Steps:", "cyan")), console.log(e(` ${f?.cd}`, "white")), m || console.log(e(` ${f?.install}`, "white")), console.log(e(` ${f?.dev}`, "white")), console.log(""), X(), process.exit(0)
1023
+ } function F() {
1024
+ console.log(`
1025
+ ${e("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E", "gray")}
1026
+ ${e("\u2502", "gray")}${e(" \u26A1 Create TezX", "yellow")} - Scaffold your next backend app ${e("\u2502", "gray")}
1027
+ ${e("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F", "gray")}
994
1028
 
995
- ${e("\u{1F4E6} Usage:","cyan")}
996
- ${e("create-tezx","green")} ${e("[directory] [...options]","gray")}
1029
+ ${e("\u{1F4E6} Usage:", "cyan")}
1030
+ ${e("create-tezx", "green")} ${e("[directory] [...options]", "gray")}
997
1031
 
998
- ${e("\u{1F680} Quick Start:","cyan")}
999
- ${e("npm","magenta")} create tezx@latest
1000
- ${e("yarn","magenta")} create tezx
1001
- ${e("pnpm","magenta")} create tezx@latest
1002
- ${e("bun","magenta")} create tezx@latest
1032
+ ${e("\u{1F680} Quick Start:", "cyan")}
1033
+ ${e("npm", "magenta")} create tezx@latest
1034
+ ${e("yarn", "magenta")} create tezx
1035
+ ${e("pnpm", "magenta")} create tezx@latest
1036
+ ${e("bun", "magenta")} create tezx@latest
1003
1037
 
1004
- ${e("\u{1F39B}\uFE0F Options:","cyan")}
1038
+ ${e("\u{1F39B}\uFE0F Options:", "cyan")}
1005
1039
 
1006
- ${e("-t, --template <name>","green")} Use a specific starter template
1007
- ${e("--ts, -ts","green")} Enable TypeScript setup
1008
- ${e("-p, --pm <manager>","green")} Package manager: npm | bun | yarn | pnpm
1009
- ${e("-i, --install","green")} Automatically install dependencies
1010
- ${e("-y, --yes","green")} Skip prompts using default options
1011
- ${e("-v, --version","green")} Show CLI version
1012
- ${e("-h, --help","green")} Display this help message
1040
+ ${e("-t, --template <name>", "green")} Use a specific starter template
1041
+ ${e("--ts, -ts", "green")} Enable TypeScript setup
1042
+ ${e("-p, --pm <manager>", "green")} Package manager: npm | bun | yarn | pnpm
1043
+ ${e("-i, --install", "green")} Automatically install dependencies
1044
+ ${e("-y, --yes", "green")} Skip prompts using default options
1045
+ ${e("-v, --version", "green")} Show CLI version
1046
+ ${e("-h, --help", "green")} Display this help message
1013
1047
 
1014
- ${e("\u{1F9F0} Examples:","cyan")}
1015
- ${e("npm create tezx@latest my-app --template ws --ts","gray")}
1016
- ${e("bun create tezx@latest -- --install --pm bun","gray")}
1048
+ ${e("\u{1F9F0} Examples:", "cyan")}
1049
+ ${e("npm create tezx@latest my-app --template ws --ts", "gray")}
1050
+ ${e("bun create tezx@latest -- --install --pm bun", "gray")}
1017
1051
 
1018
- ${e("\u{1F4C1} Available Templates:","cyan")}
1019
- ${e("minimal","yellow")} Minimal TypeScript setup
1020
- ${e("ws","yellow")} Built-in WebSocket server
1021
- ${e("google-oauth2","yellow")} Google OAuth2 Authentication
1022
- ${e("github-oauth2","yellow")} GitHub OAuth2 Authentication
1052
+ ${e("\u{1F4C1} Available Templates:", "cyan")}
1053
+ ${e("minimal", "yellow")} Minimal TypeScript setup
1054
+ ${e("ws", "yellow")} Built-in WebSocket server
1055
+ ${e("google-oauth2", "yellow")} Google OAuth2 Authentication
1056
+ ${e("github-oauth2", "yellow")} GitHub OAuth2 Authentication
1023
1057
 
1024
- ${e("\u{1F517} Repository:","cyan")}
1025
- ${e("https://github.com/tezxjs/tezx","underline")}
1058
+ ${e("\u{1F517} Repository:", "cyan")}
1059
+ ${e("https://github.com/tezxjs/tezx", "underline")}
1026
1060
 
1027
- ${e("\u{1F9D1}\u200D\u{1F4BB} Author:","cyan")}
1028
- Rakibul Islam ${e("<https://github.com/srakib17>","blue")}`),process.exit(0)}function N(){console.log(`TezX CLI v${g}`),process.exit(0)}(async()=>{let n=(l,i)=>{i.name==="c"&&i.ctrl&&(process.stdin.off("keypress",n),process.stdin.isTTY&&process.stdin.setRawMode(!1),process.exit(0))};process.stdin.on("keypress",n);let s=process.argv.slice(2),t={},a;for(let l=0;l<s.length;l++){let i=s[l];if(i.startsWith("--")){let c=i.slice(2),r=s[l+1];r&&!r.startsWith("-")?(t[c]=r,l++):t[c]="true"}else if(i.startsWith("-")){let c=i.slice(1),r=s[l+1];r&&!r.startsWith("-")?(t[c]=r,l++):t[c]="true"}else a||(a=i)}let o={directory:a,options:t};if((t.y==="true"||t.yes==="true")&&(o.options.ts="true",o.options.useStatic="true",o.options.staticFolder="public",o.options.pm=w?.includes(o.options?.p||o?.options?.pm)?o.options?.p||o?.options?.pm:"npm",o.options.p=w?.includes(o.options?.p||o?.options?.pm)?o.options?.p||o?.options?.pm:"npm",o.options.install="true"),t.help||t.h){F();return}if(t.v||t.version){N();return}_(o)})();
1061
+ ${e("\u{1F9D1}\u200D\u{1F4BB} Author:", "cyan")}
1062
+ Rakibul Islam ${e("<https://github.com/srakib17>", "blue")}`), process.exit(0)
1063
+ } function N() { console.log(`TezX CLI v${g}`), process.exit(0) } (async () => { let n = (l, i) => { i.name === "c" && i.ctrl && (process.stdin.off("keypress", n), process.stdin.isTTY && process.stdin.setRawMode(!1), process.exit(0)) }; process.stdin.on("keypress", n); let s = process.argv.slice(2), t = {}, a; for (let l = 0; l < s.length; l++) { let i = s[l]; if (i.startsWith("--")) { let c = i.slice(2), r = s[l + 1]; r && !r.startsWith("-") ? (t[c] = r, l++) : t[c] = "true" } else if (i.startsWith("-")) { let c = i.slice(1), r = s[l + 1]; r && !r.startsWith("-") ? (t[c] = r, l++) : t[c] = "true" } else a || (a = i) } let o = { directory: a, options: t }; if ((t.y === "true" || t.yes === "true") && (o.options.ts = "true", o.options.useStatic = "true", o.options.staticFolder = "public", o.options.pm = w?.includes(o.options?.p || o?.options?.pm) ? o.options?.p || o?.options?.pm : "npm", o.options.p = w?.includes(o.options?.p || o?.options?.pm) ? o.options?.p || o?.options?.pm : "npm", o.options.install = "true"), t.help || t.h) { F(); return } if (t.v || t.version) { N(); return } _(o) })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tezx-app",
3
- "version": "4.0.1",
3
+ "version": "4.0.7",
4
4
  "type": "module",
5
5
  "description": "TezX is a high-performance, lightweight JavaScript framework designed for speed, scalability, and flexibility. It enables efficient routing, middleware management, and static file serving with minimal configuration. Fully compatible with Node.js, Deno, and Bun.",
6
6
  "bin": "./bin",