create-tezx-app 4.0.3 → 4.0.9
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/bin +106 -70
- package/package.json +1 -1
package/bin
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{execSync as
|
|
2
|
+
var O = Object.defineProperty; var c = (o, s) => O(o, "name", { value: s, configurable: !0 }); import { execSync as j } from "node:child_process"; import { mkdirSync as v, writeFileSync as h } from "node:fs"; import k, { join as g, resolve as A } from "node:path"; import T from "node:readline"; const d = c((o, s) => ({ version: s, npm: ["npm install", o], bun: ["bun add", o], yarn: ["yarn add", o], pnpm: ["pnpm add", o] }), "packageManagerCommands"), I = {
|
|
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(
|
|
24
|
+
${Object.values(d("@tezx/github-oauth2", "^1.0.9"))?.filter(o => typeof o != "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:[{
|
|
125
|
-
|
|
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: [d("@tezx/github-oauth2", "^1.0.9")]
|
|
129
|
+
}, G = {
|
|
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(
|
|
153
|
+
${Object.values(d("@tezx/google-oauth2", "^1.0.13")).filter(o => typeof o != "string").join(`
|
|
149
154
|
# or
|
|
150
155
|
`)}
|
|
151
156
|
|
|
152
157
|
# Plus Google OAuth SDK
|
|
153
|
-
${Object.values(
|
|
158
|
+
${Object.values(d("@googleapis/oauth2", "^2.0.1")).filter(o => typeof o != "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:[{
|
|
287
|
+
`.trim(), files: [{
|
|
288
|
+
content: `GOOGLE_CLIENT_ID=12323
|
|
283
289
|
GOOGLE_CLIENT_SECRET=234234
|
|
284
|
-
`,path:".env"
|
|
290
|
+
`, path: ".env"
|
|
291
|
+
}], import: ['import { GoogleOauthClient, getGoogleOAuthURL, verifyGoogleToken } from "@tezx/google-oauth2";'], package: [d("@tezx/google-oauth2", "^1.0.13"), d("@googleapis/oauth2", "^2.0.1")]
|
|
292
|
+
}, R = {
|
|
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:[{
|
|
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"
|
|
370
|
+
`.trim(), path: "views/home.ejs"
|
|
371
|
+
}], import: ['import { ViewEngine } from "@tezx/view-engine";'], package: [d("@tezx/view-engine", "^1.0.3"), d("ejs", "^3.1.10")]
|
|
372
|
+
}; let H = `
|
|
361
373
|
<!DOCTYPE html>
|
|
362
374
|
<html lang="en">
|
|
363
375
|
<head>
|
|
@@ -522,10 +534,11 @@ app.get("engine", async (ctx) => {
|
|
|
522
534
|
appendMessage("Client: ping", "client");
|
|
523
535
|
}
|
|
524
536
|
}
|
|
525
|
-
|
|
537
|
+
<\/script>
|
|
526
538
|
</body>
|
|
527
539
|
</html>
|
|
528
|
-
|
|
540
|
+
`; const W = {
|
|
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\`.
|
|
@@ -585,7 +598,7 @@ A simple HTML file is included in \`public/ws.html\`:
|
|
|
585
598
|
ws.onclose = () => {
|
|
586
599
|
console.log("Disconnected.");
|
|
587
600
|
};
|
|
588
|
-
|
|
601
|
+
<\/script>
|
|
589
602
|
\`\`\`
|
|
590
603
|
|
|
591
604
|
---
|
|
@@ -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:
|
|
644
|
-
|
|
656
|
+
`.trim(), files: [{ content: H, path: "public/ws.html" }], import: ['import { upgradeWebSocket } from "tezx/ws";']
|
|
657
|
+
}; let C = { minimal: { readme: "", content: "", files: [], import: [], package: [] }, ws: W, "github-oauth2": I, "google-oauth2": G, "view-engine": R }; async function _(o, s, t) {
|
|
658
|
+
return new Promise(a => {
|
|
659
|
+
let n = 0; T.emitKeypressEvents(process.stdin, o), process.stdin.isTTY && process.stdin.setRawMode(!0); const u = c(() => {
|
|
660
|
+
process.stdout.write("\x1B[2J\x1B[0f"), console.log(s + ` (Use \u2191 \u2193 arrows, Enter to confirm)
|
|
661
|
+
`), t.forEach((l, r) => { console.log(`${r === n ? "\u{1F449}" : " "} ${r === n ? "\x1B[36m" : "\x1B[0m"}${l}\x1B[0m`) })
|
|
662
|
+
}, "render"), i = c((l, r) => { if (r.name === "up") n = (n - 1 + t.length) % t.length, u(); else if (r.name === "down") n = (n + 1) % t.length, u(); else if (r.name === "return") return a(t[n]) }, "onKeyPress"); u(), process.stdin.on("keypress", i)
|
|
663
|
+
})
|
|
664
|
+
} c(_, "arrowSelect"); const $ = { 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(o, s) { return `${$[s]}${o}${$.reset}` } c(e, "colorText"); const F = "4.0.1"; let D = `
|
|
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
|
-
`,
|
|
855
|
+
`, P = c(({ ts: o, template: s, root: t, useStatic: a = !1, staticFolder: n }) => {
|
|
856
|
+
const u = g(t, o ? "src/index.ts" : "src/index.js"); v(g(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,7 +866,7 @@ Bun.serve({
|
|
|
845
866
|
})
|
|
846
867
|
});
|
|
847
868
|
console.log(\`\u{1F680} TezX is running at http://localhost:\${PORT}\`);
|
|
848
|
-
`;let
|
|
869
|
+
`; let l = `
|
|
849
870
|
import { TezX } from "tezx";
|
|
850
871
|
import { serveStatic } from "tezx/static";
|
|
851
872
|
import { logger } from "tezx/middleware";
|
|
@@ -859,12 +880,13 @@ app.use([logger()]);
|
|
|
859
880
|
|
|
860
881
|
app.get("/", (ctx) => ctx.text("Hello from TezX"));
|
|
861
882
|
|
|
862
|
-
${a
|
|
863
|
-
${s?.content
|
|
883
|
+
${a ? `app.static(serveStatic("${n || "public"}"));` : ""}
|
|
884
|
+
${s?.content ? `
|
|
864
885
|
${s?.content?.trim()}
|
|
865
|
-
`:""}
|
|
886
|
+
`: ""}
|
|
866
887
|
${i}
|
|
867
|
-
`;if(
|
|
888
|
+
`; if (o) {
|
|
889
|
+
const r = `
|
|
868
890
|
{
|
|
869
891
|
"compilerOptions": {
|
|
870
892
|
"module": "esnext",
|
|
@@ -878,16 +900,19 @@ ${i}
|
|
|
878
900
|
"include": ["src"],
|
|
879
901
|
"exclude": ["node_modules", "dist"]
|
|
880
902
|
}
|
|
881
|
-
`.trim();
|
|
903
|
+
`.trim(); h(g(t, "tsconfig.json"), r)
|
|
904
|
+
} h(u, l.trim())
|
|
905
|
+
}, "index"), X = c(({ template: o, root: s, projectName: t, ts: a, useWS: n, choiceStep: u }) => {
|
|
906
|
+
let i = []; Array.isArray(o?.package) && o?.package?.forEach(b => { let { version: x, npm: m } = b || {}; i.push(`"${m?.[1]}": "${x}"`) }); let l = ['"@types/bun": "^1.3.1"']; a && (l.push('"typescript": "^5.8.2"'), l.push('"@types/node": "^22.13.14"')); let r = `
|
|
882
907
|
{
|
|
883
|
-
"name": "${t||"tezx-app-example"}",
|
|
908
|
+
"name": "${t || "tezx-app-example"}",
|
|
884
909
|
"version": "1.0.0",
|
|
885
910
|
"type": "module",
|
|
886
911
|
"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
912
|
"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"'
|
|
913
|
+
"start": "bun src/index${a ? ".ts" : ".js"}",
|
|
914
|
+
"dev": "bun --hot --watch src/index${a ? ".ts" : ".js"}",
|
|
915
|
+
"type-check": ${a ? '"tsc --noEmit"' : `"echo 'No TypeScript configured'"`}
|
|
891
916
|
},
|
|
892
917
|
"repository": {
|
|
893
918
|
"type": "git",
|
|
@@ -901,16 +926,18 @@ ${i}
|
|
|
901
926
|
},
|
|
902
927
|
"homepage": "https://github.com/tezxjs/tezx-app-example",
|
|
903
928
|
"dependencies": {
|
|
904
|
-
"tezx": "^${
|
|
929
|
+
"tezx": "^${F}"${i.length ? `,
|
|
905
930
|
${i.join(`,
|
|
906
|
-
`)}
|
|
931
|
+
`)}` : ""}
|
|
907
932
|
},
|
|
908
933
|
"devDependencies": {
|
|
909
|
-
${
|
|
934
|
+
${l.join(`,
|
|
910
935
|
`)}
|
|
911
936
|
}
|
|
912
937
|
}
|
|
913
|
-
`.trim();
|
|
938
|
+
`.trim(); h(g(s, "package.json"), r)
|
|
939
|
+
}, "packageJson"); const N = c(({ root: o }) => {
|
|
940
|
+
const s = `
|
|
914
941
|
# Node dependencies
|
|
915
942
|
node_modules/
|
|
916
943
|
.env
|
|
@@ -980,49 +1007,58 @@ Thumbs.db
|
|
|
980
1007
|
.vscode/
|
|
981
1008
|
.idea/
|
|
982
1009
|
*.swp
|
|
983
|
-
`.trim();
|
|
984
|
-
|
|
985
|
-
|
|
1010
|
+
`.trim(); h(g(o, ".gitignore"), s, { encoding: "utf8" })
|
|
1011
|
+
}, "gitignore"), L = c(({ root: o, readme: s }) => { const t = typeof s == "string" && s ? s?.trim() : D.trim(); h(g(o, "README.md"), t, { encoding: "utf8" }) }, "README"); let S = ["npm", "bun", "yarn", "pnpm"]; function M(o) {
|
|
1012
|
+
let s = 0; const t = ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"], a = setInterval(() => { process.stdout.write(`\r${t[s = ++s % t.length]} ${o}`) }, 80); return () => {
|
|
1013
|
+
clearInterval(a), process.stdout.write(`\r\u2705 Done!
|
|
1014
|
+
`)
|
|
1015
|
+
}
|
|
1016
|
+
} c(M, "startLoader"); const E = T.createInterface({ input: process.stdin, output: process.stdout }); T.emitKeypressEvents(process.stdin), process.stdin.isTTY && process.stdin.setRawMode(!0); const y = c((o, s = "") => new Promise(t => { E.question(s ? `${o} (${s}): ` : o, a => { t(a.trim() || s) }) }), "ask"); async function U(o) {
|
|
1017
|
+
let s = o?.directory, t = o?.options; console.log(e(`
|
|
1018
|
+
\u26A1 TezX App Creator(v${F})`, "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); const n = A(process.cwd(), s); let u = !!t?.ts, i = t?.staticFolder || "public", l = !0, r = { content: "", import: [], readme: "", files: [] }; if (t?.t || t?.template) { const p = t.t || t.template, w = C?.[p]; w || (console.error(`\u274C Unknown template: "${p}"`), console.error(`\u2139\uFE0F Available templates: ${Object.keys(C).join(", ")}`), process.exit(0)), r = w } else u = !!(t?.ts || (await y("\u{1F7E6} Use TypeScript? (y/N): ")).toLowerCase() === "y"), l = !!t?.useStatic || (await y("\u{1F4C1} Use static folder? (y/N): ")).toLowerCase() === "y", i = l ? t?.staticFolder || await y("\u{1F4C2} Static folder name? (default: public): ") : ""; let b = t?.pm || t?.p; const x = S?.includes(b) ? b : await _(E, "\u{1F4E6} Choose your package manager", S), m = t?.i === "true" || t?.install === "true" || (await y("\u{1F4E5} Install dependencies now? (y/N): ")).toLowerCase() === "y"; console.log(`
|
|
986
1019
|
\u{1F4C1} Creating project: ${a}...
|
|
987
|
-
`);let
|
|
1020
|
+
`); let B = M("Creating Project"); if (v(n, { recursive: !0 }), l) { const p = g(n, i || "public"); v(p, { 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" } }[x]; P({ template: r, root: n, ts: !!u, staticFolder: i, useStatic: l }), X({ projectName: a, root: n, ts: !!u, template: r, choiceStep: f }), N({ root: n }), L({ root: n, readme: r?.readme }), E.close(), r?.files?.forEach(p => { let w = k.join(n, k.dirname(p?.path)); v(w, { recursive: !0 }), h(k.join(n, p?.path), p?.content) }), m && j(f?.install, { cwd: n, stdio: "inherit" }), console.log(e(`
|
|
988
1021
|
\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
|
|
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(""),
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
${e("\
|
|
1022
|
+
`, "green")), console.log(e("\u{1F9F0} Summary of your configuration:", "cyan")), console.log(`\u{1F4C1} Project Name: ${e(a, "yellow")}`); let z = t?.t || t?.template; z && console.log(`\u{1F4C1} Template Name: ${e(z, "orange")}`), console.log(`\u{1F7E6} TypeScript: ${e(u ? "Yes" : "No", u ? "green" : "gray")}`), console.log(`\u{1F4C1} Static Folder: ${e(l ? i || "public" : "Not Used", l ? "green" : "gray")}`), console.log(`\u{1F4E6} Package Manager: ${e(x, "magenta")}`), console.log(`\u{1F4E5} Dependencies Installed: ${e(m ? "Yes" : "No", m ? "green" : "red")}
|
|
1023
|
+
`), 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(""), B(), process.exit(0)
|
|
1024
|
+
} c(U, "create"); function q() {
|
|
1025
|
+
console.log(`
|
|
1026
|
+
${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")}
|
|
1027
|
+
${e("\u2502", "gray")}${e(" \u26A1 Create TezX", "yellow")} - Scaffold your next backend app ${e("\u2502", "gray")}
|
|
1028
|
+
${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
1029
|
|
|
995
|
-
${e("\u{1F4E6} Usage:","cyan")}
|
|
996
|
-
${e("create-tezx","green")} ${e("[directory] [...options]","gray")}
|
|
1030
|
+
${e("\u{1F4E6} Usage:", "cyan")}
|
|
1031
|
+
${e("create-tezx", "green")} ${e("[directory] [...options]", "gray")}
|
|
997
1032
|
|
|
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
|
|
1033
|
+
${e("\u{1F680} Quick Start:", "cyan")}
|
|
1034
|
+
${e("npm", "magenta")} create tezx@latest
|
|
1035
|
+
${e("yarn", "magenta")} create tezx
|
|
1036
|
+
${e("pnpm", "magenta")} create tezx@latest
|
|
1037
|
+
${e("bun", "magenta")} create tezx@latest
|
|
1003
1038
|
|
|
1004
|
-
${e("\u{1F39B}\uFE0F Options:","cyan")}
|
|
1039
|
+
${e("\u{1F39B}\uFE0F Options:", "cyan")}
|
|
1005
1040
|
|
|
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
|
|
1041
|
+
${e("-t, --template <name>", "green")} Use a specific starter template
|
|
1042
|
+
${e("--ts, -ts", "green")} Enable TypeScript setup
|
|
1043
|
+
${e("-p, --pm <manager>", "green")} Package manager: npm | bun | yarn | pnpm
|
|
1044
|
+
${e("-i, --install", "green")} Automatically install dependencies
|
|
1045
|
+
${e("-y, --yes", "green")} Skip prompts using default options
|
|
1046
|
+
${e("-v, --version", "green")} Show CLI version
|
|
1047
|
+
${e("-h, --help", "green")} Display this help message
|
|
1013
1048
|
|
|
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")}
|
|
1049
|
+
${e("\u{1F9F0} Examples:", "cyan")}
|
|
1050
|
+
${e("npm create tezx@latest my-app --template ws --ts", "gray")}
|
|
1051
|
+
${e("bun create tezx@latest -- --install --pm bun", "gray")}
|
|
1017
1052
|
|
|
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
|
|
1053
|
+
${e("\u{1F4C1} Available Templates:", "cyan")}
|
|
1054
|
+
${e("minimal", "yellow")} Minimal TypeScript setup
|
|
1055
|
+
${e("ws", "yellow")} Built-in WebSocket server
|
|
1056
|
+
${e("google-oauth2", "yellow")} Google OAuth2 Authentication
|
|
1057
|
+
${e("github-oauth2", "yellow")} GitHub OAuth2 Authentication
|
|
1023
1058
|
|
|
1024
|
-
${e("\u{1F517} Repository:","cyan")}
|
|
1025
|
-
${e("https://github.com/tezxjs/tezx","underline")}
|
|
1059
|
+
${e("\u{1F517} Repository:", "cyan")}
|
|
1060
|
+
${e("https://github.com/tezxjs/tezx", "underline")}
|
|
1026
1061
|
|
|
1027
|
-
${e("\u{1F9D1}\u200D\u{1F4BB} Author:","cyan")}
|
|
1028
|
-
Rakibul Islam ${e("<https://github.com/srakib17>","blue")}`),
|
|
1062
|
+
${e("\u{1F9D1}\u200D\u{1F4BB} Author:", "cyan")}
|
|
1063
|
+
Rakibul Islam ${e("<https://github.com/srakib17>", "blue")}`), process.exit(0)
|
|
1064
|
+
} c(q, "showHelp"); function V() { console.log(`TezX CLI v${F}`), process.exit(0) } c(V, "showVersion"), (async () => { const o = c((u, i) => { i.name === "c" && i.ctrl && (process.stdin.off("keypress", o), process.stdin.isTTY && process.stdin.setRawMode(!1), process.exit(0)) }, "onKeyPress"); process.stdin.on("keypress", o); const s = process.argv.slice(2); let t = {}, a; for (let u = 0; u < s.length; u++) { const i = s[u]; if (i.startsWith("--")) { const l = i.slice(2), r = s[u + 1]; r && !r.startsWith("-") ? (t[l] = r, u++) : t[l] = "true" } else if (i.startsWith("-")) { const l = i.slice(1), r = s[u + 1]; r && !r.startsWith("-") ? (t[l] = r, u++) : t[l] = "true" } else a || (a = i) } let n = { directory: a, options: t }; if ((t.y === "true" || t.yes === "true") && (n.options.ts = "true", n.options.useStatic = "true", n.options.staticFolder = "public", n.options.pm = S?.includes(n.options?.p || n?.options?.pm) ? n.options?.p || n?.options?.pm : "npm", n.options.p = S?.includes(n.options?.p || n?.options?.pm) ? n.options?.p || n?.options?.pm : "npm", n.options.install = "true"), t.help || t.h) { q(); return } if (t.v || t.version) { V(); return } U(n) })();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-tezx-app",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
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",
|