speexjs 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -133,12 +133,12 @@ var TEMPLATES = {
133
133
  type: "module",
134
134
  private: true,
135
135
  scripts: {
136
- dev: "SpeedX serve",
137
- build: "SpeedX build",
136
+ dev: "speexjs serve",
137
+ build: "speexjs build",
138
138
  start: "node dist/index.js"
139
139
  },
140
140
  dependencies: {
141
- SpeedX: "latest"
141
+ speexjs: "latest"
142
142
  },
143
143
  devDependencies: {
144
144
  "@types/node": "^26.0.1",
@@ -169,24 +169,24 @@ var TEMPLATES = {
169
169
  null,
170
170
  2
171
171
  ),
172
- "src/index.ts": `import { SpeedX } from 'speedx/server'
172
+ "src/index.ts": `import { speexjs } from 'speexjs/server'
173
173
 
174
- const app = SpeedX()
174
+ const app = speexjs()
175
175
 
176
176
  const PORT = Number(process.env.PORT) || 3000
177
177
 
178
178
  app.get('/', async ({ response }) => {
179
- return response.html('<h1>SpeedX \u{1F680}</h1>')
179
+ return response.html('<h1>SpeexJS \u{1F680}</h1>')
180
180
  })
181
181
 
182
182
  app.listen(PORT, () => {
183
- console.log(\`SpeedX running on http://localhost:\${PORT}\`)
183
+ console.log(\`SpeexJS running on http://localhost:\${PORT}\`)
184
184
  })
185
185
  `,
186
- "src/app.ts": `import { SpeedX } from 'speedx/server'
186
+ "src/app.ts": `import { speexjs } from 'speexjs/server'
187
187
 
188
188
  export function createApp() {
189
- const app = SpeedX()
189
+ const app = speexjs()
190
190
  return app
191
191
  }
192
192
  `,
@@ -219,12 +219,12 @@ dist/
219
219
  type: "module",
220
220
  private: true,
221
221
  scripts: {
222
- dev: "SpeedX serve",
222
+ dev: "speexjs serve",
223
223
  build: "tsc",
224
224
  start: "node dist/server/index.js"
225
225
  },
226
226
  dependencies: {
227
- SpeedX: "latest"
227
+ speexjs: "latest"
228
228
  },
229
229
  devDependencies: {
230
230
  "@types/node": "^26.0.1",
@@ -247,7 +247,7 @@ dist/
247
247
  isolatedModules: true,
248
248
  resolveJsonModule: true,
249
249
  jsx: "react-jsx",
250
- jsxImportSource: "@SpeedX/vdom",
250
+ jsxImportSource: "@speexjs/vdom",
251
251
  outDir: "./dist",
252
252
  rootDir: "./src"
253
253
  },
@@ -257,12 +257,12 @@ dist/
257
257
  null,
258
258
  2
259
259
  ),
260
- "src/server/index.ts": `import { SpeedX } from 'speedx/server'
260
+ "src/server/index.ts": `import { speexjs } from 'speexjs/server'
261
261
  import { UserController } from './controllers/user.controller.js'
262
262
 
263
263
  const PORT = Number(process.env.PORT) || 3000
264
264
 
265
- const app = SpeedX()
265
+ const app = speexjs()
266
266
 
267
267
  app.controller(UserController)
268
268
 
@@ -273,7 +273,7 @@ app.get('/', async ({ response }) => {
273
273
  <head>
274
274
  <meta charset="UTF-8" />
275
275
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
276
- <title>SpeedX Fullstack</title>
276
+ <title>SpeexJS Fullstack</title>
277
277
  </head>
278
278
  <body>
279
279
  <div id="root"></div>
@@ -284,10 +284,10 @@ app.get('/', async ({ response }) => {
284
284
  })
285
285
 
286
286
  app.listen(PORT, () => {
287
- console.log(\`SpeedX running on http://localhost:\${PORT}\`)
287
+ console.log(\`SpeexJS running on http://localhost:\${PORT}\`)
288
288
  })
289
289
  `,
290
- "src/server/controllers/user.controller.ts": `import { Controller, get, post } from 'speedx/server'
290
+ "src/server/controllers/user.controller.ts": `import { Controller, get, post } from 'speexjs/server'
291
291
 
292
292
  export class UserController extends Controller {
293
293
  @get('/users')
@@ -317,8 +317,8 @@ document.addEventListener('DOMContentLoaded', () => {
317
317
  }
318
318
  root.innerHTML = \`
319
319
  <div style="text-align:center;padding:2rem">
320
- <h1>SpeedX Fullstack</h1>
321
- <p>Welcome to SpeedX!</p>
320
+ <h1>SpeexJS Fullstack</h1>
321
+ <p>Welcome to SpeexJS!</p>
322
322
  </div>
323
323
  \`
324
324
  }
@@ -372,12 +372,12 @@ dist/
372
372
  type: "module",
373
373
  private: true,
374
374
  scripts: {
375
- dev: "SpeedX serve",
375
+ dev: "speexjs serve",
376
376
  build: "tsc",
377
377
  start: "node dist/index.js"
378
378
  },
379
379
  dependencies: {
380
- SpeedX: "latest"
380
+ speexjs: "latest"
381
381
  },
382
382
  devDependencies: {
383
383
  "@types/node": "^26.0.1",
@@ -408,21 +408,21 @@ dist/
408
408
  null,
409
409
  2
410
410
  ),
411
- "src/index.ts": `import { SpeedX } from 'speedx/server'
411
+ "src/index.ts": `import { speexjs } from 'speexjs/server'
412
412
 
413
413
  const PORT = Number(process.env.PORT) || 3000
414
414
 
415
- const app = SpeedX()
415
+ const app = speexjs()
416
416
 
417
417
  app.get('/api/health', async ({ response }) => {
418
418
  return response.json({ status: 'ok', timestamp: new Date().toISOString() })
419
419
  })
420
420
 
421
421
  app.listen(PORT, () => {
422
- console.log(\`SpeedX API running on http://localhost:\${PORT}\`)
422
+ console.log(\`SpeexJS API running on http://localhost:\${PORT}\`)
423
423
  })
424
424
  `,
425
- "src/controllers/health.controller.ts": `import { Controller, get } from 'speedx/server'
425
+ "src/controllers/health.controller.ts": `import { Controller, get } from 'speexjs/server'
426
426
 
427
427
  export class HealthController extends Controller {
428
428
  @get('/health')
@@ -434,7 +434,7 @@ export class HealthController extends Controller {
434
434
  }
435
435
  }
436
436
  `,
437
- "src/middleware/auth.ts": `import type { RouteContext } from 'speedx/server/router'
437
+ "src/middleware/auth.ts": `import type { RouteContext } from 'speexjs/server/router'
438
438
 
439
439
  export function auth() {
440
440
  return async (ctx: RouteContext, next: () => Promise<void>) => {
@@ -521,7 +521,7 @@ async function initProject(name, options) {
521
521
  const packageManager = String(options["package-manager"] || options.packageManager || "npm");
522
522
  console.log();
523
523
  console.log(`${colors.bold("\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557")}`);
524
- console.log(`${colors.bold("\u2551")} ${colors.green("SpeedX \u{1F680} Project Created")}${colors.bold(" \u2551")}`);
524
+ console.log(`${colors.bold("\u2551")} ${colors.green("speexjs \u{1F680} Project Created")}${colors.bold(" \u2551")}`);
525
525
  console.log(`${colors.bold("\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D")}`);
526
526
  console.log();
527
527
  console.log(` ${colors.bold("Name:")} ${toPascalCase(name)}`);
@@ -556,8 +556,8 @@ function makeController(name) {
556
556
  process.exit(1);
557
557
  }
558
558
  mkdirSync2(targetDir, { recursive: true });
559
- const content = `import { Controller, get, post, put, del } from 'speedx/server'
560
- import type { RouteContext } from 'speedx/server/router'
559
+ const content = `import { Controller, get, post, put, del } from 'speexjs/server'
560
+ import type { RouteContext } from 'speexjs/server/router'
561
561
 
562
562
  export class ${className} extends Controller {
563
563
  @get('/')
@@ -619,7 +619,7 @@ function makeMiddleware(name) {
619
619
  process.exit(1);
620
620
  }
621
621
  mkdirSync3(targetDir, { recursive: true });
622
- const content = `import type { RouteContext } from 'speedx/server/router'
622
+ const content = `import type { RouteContext } from 'speexjs/server/router'
623
623
 
624
624
  export function ${functionName}(options?: Record<string, unknown>) {
625
625
  return async (ctx: RouteContext, next: () => Promise<void>) => {
@@ -658,7 +658,7 @@ function makeSchema(name) {
658
658
  process.exit(1);
659
659
  }
660
660
  mkdirSync4(targetDir, { recursive: true });
661
- const content = `import { s, type Infer } from 'speedx/schema'
661
+ const content = `import { s, type Infer } from 'speexjs/schema'
662
662
 
663
663
  export const ${schemaName} = s.object({
664
664
  id: s.string().uuid(),
@@ -702,7 +702,7 @@ function listRoutes() {
702
702
  console.log(
703
703
  ` ${colors.yellow("!")} Tidak ada route terdaftar. Buat controller dulu:`
704
704
  );
705
- console.log(` ${colors.cyan("speedx make:controller <name>")}`);
705
+ console.log(` ${colors.cyan("speexjs make:controller <name>")}`);
706
706
  return;
707
707
  }
708
708
  const files = readdirSync(routesDir).filter((f) => f.endsWith(".ts"));
@@ -710,7 +710,7 @@ function listRoutes() {
710
710
  console.log(
711
711
  ` ${colors.yellow("!")} Tidak ada route terdaftar. Buat controller dulu:`
712
712
  );
713
- console.log(` ${colors.cyan("speedx make:controller <name>")}`);
713
+ console.log(` ${colors.cyan("speexjs make:controller <name>")}`);
714
714
  return;
715
715
  }
716
716
  let total = 0;
@@ -887,7 +887,7 @@ async function serve(options) {
887
887
  }
888
888
  app.listen(port, host, () => {
889
889
  console.log();
890
- console.log(` ${colors.bold("SpeedX")} ${colors.green("running")}`);
890
+ console.log(` ${colors.bold("SpeexJS")} ${colors.green("running")}`);
891
891
  console.log(` ${colors.dim("\u2192")} ${colors.cyan(`http://${host}:${port}`)}`);
892
892
  console.log();
893
893
  });
@@ -908,7 +908,7 @@ async function serve(options) {
908
908
  }
909
909
  app.listen(port, host, () => {
910
910
  console.log();
911
- console.log(` ${colors.bold("SpeedX")} ${colors.green("running")}`);
911
+ console.log(` ${colors.bold("SpeexJS")} ${colors.green("running")}`);
912
912
  console.log(` ${colors.dim("\u2192")} ${colors.cyan(`http://${host}:${port}`)}`);
913
913
  console.log();
914
914
  });
@@ -921,20 +921,20 @@ async function serve(options) {
921
921
 
922
922
  // src/cli/index.ts
923
923
  function showHelp() {
924
- console.log(`${colors.bold("SpeedX")} ${colors.cyan("v0.2.0")}`);
924
+ console.log(`${colors.bold("SpeexJS")} ${colors.cyan("v0.2.0")}`);
925
925
  console.log("Fullstack JavaScript/TypeScript Framework");
926
926
  console.log();
927
927
  console.log(`${colors.bold("Usage:")}`);
928
- console.log(" SpeedX init [name] [options] Buat project baru");
929
- console.log(" SpeedX make:controller <name> Generate controller");
930
- console.log(" SpeedX make:middleware <name> Generate middleware");
931
- console.log(" SpeedX make:schema <name> Generate schema");
932
- console.log(" SpeedX list-routes Lihat semua route");
933
- console.log(" SpeedX serve [options] Jalankan server");
934
- console.log(" SpeedX --help Bantuan ini");
928
+ console.log(" SpeexJS init [name] [options] Buat project baru");
929
+ console.log(" SpeexJS make:controller <name> Generate controller");
930
+ console.log(" SpeexJS make:middleware <name> Generate middleware");
931
+ console.log(" SpeexJS make:schema <name> Generate schema");
932
+ console.log(" SpeexJS list-routes Lihat semua route");
933
+ console.log(" SpeexJS serve [options] Jalankan server");
934
+ console.log(" SpeexJS --help Bantuan ini");
935
935
  console.log();
936
936
  console.log(`${colors.bold("Aliases:")}`);
937
- console.log(" SpeedX -v, --version Lihat versi");
937
+ console.log(" SpeexJS -v, --version Lihat versi");
938
938
  console.log();
939
939
  console.log(`${colors.bold("Options:")}`);
940
940
  console.log(" --template <type> blank, fullstack, api-only");
@@ -953,7 +953,7 @@ async function main() {
953
953
  case "make:controller": {
954
954
  if (!parsed.args[0]) {
955
955
  console.error(colors.red("Nama controller diperlukan"));
956
- console.log(` ${colors.cyan("SpeedX make:controller <name>")}`);
956
+ console.log(` ${colors.cyan("SpeexJS make:controller <name>")}`);
957
957
  process.exit(1);
958
958
  }
959
959
  await makeController(parsed.args[0]);
@@ -962,7 +962,7 @@ async function main() {
962
962
  case "make:middleware": {
963
963
  if (!parsed.args[0]) {
964
964
  console.error(colors.red("Nama middleware diperlukan"));
965
- console.log(` ${colors.cyan("SpeedX make:middleware <name>")}`);
965
+ console.log(` ${colors.cyan("SpeexJS make:middleware <name>")}`);
966
966
  process.exit(1);
967
967
  }
968
968
  await makeMiddleware(parsed.args[0]);
@@ -971,7 +971,7 @@ async function main() {
971
971
  case "make:schema": {
972
972
  if (!parsed.args[0]) {
973
973
  console.error(colors.red("Nama schema diperlukan"));
974
- console.log(` ${colors.cyan("SpeedX make:schema <name>")}`);
974
+ console.log(` ${colors.cyan("SpeexJS make:schema <name>")}`);
975
975
  process.exit(1);
976
976
  }
977
977
  await makeSchema(parsed.args[0]);
@@ -997,7 +997,7 @@ async function main() {
997
997
  case "version":
998
998
  case "--version":
999
999
  case "-v": {
1000
- console.log("SpeedX v0.2.0");
1000
+ console.log("SpeexJS v0.2.0");
1001
1001
  break;
1002
1002
  }
1003
1003
  default: {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/native/args.ts","../../src/native/colors.ts","../../src/cli/commands/init.ts","../../src/cli/commands/make-controller.ts","../../src/cli/commands/make-middleware.ts","../../src/cli/commands/make-schema.ts","../../src/cli/commands/list-routes.ts","../../src/cli/commands/serve.ts","../../src/native/logger.ts","../../src/cli/index.ts"],"sourcesContent":["export interface ParsedArgs {\n command: string\n subcommand?: string\n args: string[]\n options: Record<string, string | boolean | string[]>\n}\n\nexport function parseArgs(argv: string[]): ParsedArgs {\n const args = argv.slice(2)\n const result: ParsedArgs = {\n command: '',\n args: [],\n options: {},\n }\n\n if (args.length === 0) return result\n\n const first = args[0]!\n\n if (first.includes(':')) {\n result.command = first\n parseOptions(args.slice(1), result)\n return result\n }\n\n result.command = first\n\n if (args.length > 1) {\n const second = args[1]!\n if (!second.startsWith('-')) {\n result.subcommand = second\n result.args.push(second)\n parseOptions(args.slice(2), result)\n return result\n }\n }\n\n parseOptions(args.slice(1), result)\n return result\n}\n\nfunction parseOptions(argv: string[], result: ParsedArgs): void {\n let i = 0\n while (i < argv.length) {\n const arg = argv[i]!\n\n if (arg === '--') {\n for (let j = i + 1; j < argv.length; j++) {\n result.args.push(argv[j]!)\n }\n break\n }\n\n if (arg.startsWith('--no-')) {\n const key = arg.slice(5)\n if (key) {\n result.options[key] = false\n }\n i++\n continue\n }\n\n if (arg.startsWith('--')) {\n const key = arg.slice(2)\n if (i + 1 < argv.length && !argv[i + 1]!.startsWith('-')) {\n const val = argv[i + 1]!\n const existing = result.options[key]\n if (existing !== undefined) {\n result.options[key] = Array.isArray(existing)\n ? ([...existing, val] as string[])\n : [existing as string, val]\n } else {\n result.options[key] = val\n }\n i += 2\n } else {\n result.options[key] = true\n i++\n }\n continue\n }\n\n if (arg.startsWith('-') && arg.length === 2) {\n const key = arg.slice(1)\n if (i + 1 < argv.length && !argv[i + 1]!.startsWith('-')) {\n const val = argv[i + 1]!\n result.options[key] = val\n i += 2\n } else {\n result.options[key] = true\n i++\n }\n continue\n }\n\n result.args.push(arg)\n i++\n }\n}\n\nexport function toCommandName(argv: string[]): string {\n const args = argv.slice(2)\n if (args.length === 0) return ''\n\n const first = args[0]!\n\n if (first.includes(':')) return first\n\n if (args.length > 1 && !args[1]!.startsWith('-')) {\n return `${first}:${args[1]}`\n }\n\n return first\n}\n","const RESET = '\\x1b[0m'\n\nconst codes: Record<string, string> = {\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m',\n gray: '\\x1b[90m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n italic: '\\x1b[3m',\n underline: '\\x1b[4m',\n}\n\nexport const colors = {\n red: (s: string): string => `${codes.red}${s}${RESET}`,\n green: (s: string): string => `${codes.green}${s}${RESET}`,\n yellow: (s: string): string => `${codes.yellow}${s}${RESET}`,\n blue: (s: string): string => `${codes.blue}${s}${RESET}`,\n magenta: (s: string): string => `${codes.magenta}${s}${RESET}`,\n cyan: (s: string): string => `${codes.cyan}${s}${RESET}`,\n gray: (s: string): string => `${codes.gray}${s}${RESET}`,\n white: (s: string): string => `${codes.white}${s}${RESET}`,\n bold: (s: string): string => `${codes.bold}${s}${RESET}`,\n dim: (s: string): string => `${codes.dim}${s}${RESET}`,\n italic: (s: string): string => `${codes.italic}${s}${RESET}`,\n underline: (s: string): string => `${codes.underline}${s}${RESET}`,\n}\n\nexport function stripColors(s: string): string {\n const ansi = String.fromCharCode(27)\n const re = new RegExp(`${ansi}\\\\[\\\\d+m`, 'g')\n return s.replace(re, '')\n}\n\nexport function isColorSupported(): boolean {\n if (typeof process === 'undefined') return false\n if (process.env.NO_COLOR) return false\n if (process.env.FORCE_COLOR) return true\n if (!process.stdout) return false\n if (!process.stdout.isTTY) return false\n return true\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\ninterface TemplateContent {\n dirs: string[]\n files: Record<string, string | ((name: string) => string)>\n}\n\nconst TEMPLATES: Record<string, TemplateContent> = {\n blank: {\n dirs: ['src'],\n files: {\n 'package.json': (name: string) =>\n JSON.stringify(\n {\n name,\n version: '0.1.0',\n type: 'module',\n private: true,\n scripts: {\n dev: 'SpeedX serve',\n build: 'SpeedX build',\n start: 'node dist/index.js',\n },\n dependencies: {\n SpeedX: 'latest',\n },\n devDependencies: {\n '@types/node': '^26.0.1',\n typescript: '^5.7.0',\n },\n },\n null,\n 2,\n ),\n 'tsconfig.json': JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n strict: true,\n declaration: true,\n sourceMap: true,\n esModuleInterop: true,\n isolatedModules: true,\n resolveJsonModule: true,\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*.ts'],\n exclude: ['node_modules', 'dist'],\n },\n null,\n 2,\n ),\n 'src/index.ts': `import { SpeedX } from 'speedx/server'\n\nconst app = SpeedX()\n\nconst PORT = Number(process.env.PORT) || 3000\n\napp.get('/', async ({ response }) => {\n return response.html('<h1>SpeedX 🚀</h1>')\n})\n\napp.listen(PORT, () => {\n console.log(\\`SpeedX running on http://localhost:\\${PORT}\\`)\n})\n`,\n 'src/app.ts': `import { SpeedX } from 'speedx/server'\n\nexport function createApp() {\n const app = SpeedX()\n return app\n}\n`,\n '.env.example': `PORT=3000\nNODE_ENV=development\n`,\n '.gitignore': `node_modules/\ndist/\n.env\n*.log\n`,\n },\n },\n\n fullstack: {\n dirs: [\n 'src/server',\n 'src/server/controllers',\n 'src/server/middleware',\n 'src/client',\n 'src/client/components',\n 'src/client/pages',\n 'src/shared',\n 'public',\n ],\n files: {\n 'package.json': (name: string) =>\n JSON.stringify(\n {\n name,\n version: '0.1.0',\n type: 'module',\n private: true,\n scripts: {\n dev: 'SpeedX serve',\n build: 'tsc',\n start: 'node dist/server/index.js',\n },\n dependencies: {\n SpeedX: 'latest',\n },\n devDependencies: {\n '@types/node': '^26.0.1',\n typescript: '^5.7.0',\n },\n },\n null,\n 2,\n ),\n 'tsconfig.json': JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n strict: true,\n declaration: true,\n sourceMap: true,\n esModuleInterop: true,\n isolatedModules: true,\n resolveJsonModule: true,\n jsx: 'react-jsx',\n jsxImportSource: '@SpeedX/vdom',\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*.ts', 'src/**/*.tsx'],\n exclude: ['node_modules', 'dist'],\n },\n null,\n 2,\n ),\n 'src/server/index.ts': `import { SpeedX } from 'speedx/server'\nimport { UserController } from './controllers/user.controller.js'\n\nconst PORT = Number(process.env.PORT) || 3000\n\nconst app = SpeedX()\n\napp.controller(UserController)\n\napp.get('/', async ({ response }) => {\n return response.html(\\`\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>SpeedX Fullstack</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/client/index.js\"></script>\n </body>\n </html>\n \\`)\n})\n\napp.listen(PORT, () => {\n console.log(\\`SpeedX running on http://localhost:\\${PORT}\\`)\n})\n`,\n 'src/server/controllers/user.controller.ts': `import { Controller, get, post } from 'speedx/server'\n\nexport class UserController extends Controller {\n @get('/users')\n async index({ response }) {\n return response.json({ data: [] })\n }\n\n @post('/users')\n async store({ request, response }) {\n const body = await request.body()\n return response.json({ data: body }, 201)\n }\n}\n`,\n 'src/client/index.ts': `import { createApp } from './app.js'\n\ndocument.addEventListener('DOMContentLoaded', () => {\n createApp().mount('#root')\n})\n`,\n 'src/client/app.ts': `export function createApp() {\n function mount(selector: string) {\n const root = document.querySelector(selector)\n if (!root) {\n console.error('Root element not found:', selector)\n return\n }\n root.innerHTML = \\`\n <div style=\"text-align:center;padding:2rem\">\n <h1>SpeedX Fullstack</h1>\n <p>Welcome to SpeedX!</p>\n </div>\n \\`\n }\n\n return { mount }\n}\n`,\n 'public/style.css': `* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n background: #0f172a;\n color: #e2e8f0;\n min-height: 100vh;\n}\n\n#root {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n}\n`,\n 'src/shared/types.ts': `export interface ApiResponse<T = unknown> {\n success: boolean\n data: T\n message?: string\n}\n`,\n '.env.example': `PORT=3000\nNODE_ENV=development\n`,\n '.gitignore': `node_modules/\ndist/\n.env\n*.log\n`,\n },\n },\n\n 'api-only': {\n dirs: ['src', 'src/controllers', 'src/middleware'],\n files: {\n 'package.json': (name: string) =>\n JSON.stringify(\n {\n name,\n version: '0.1.0',\n type: 'module',\n private: true,\n scripts: {\n dev: 'SpeedX serve',\n build: 'tsc',\n start: 'node dist/index.js',\n },\n dependencies: {\n SpeedX: 'latest',\n },\n devDependencies: {\n '@types/node': '^26.0.1',\n typescript: '^5.7.0',\n },\n },\n null,\n 2,\n ),\n 'tsconfig.json': JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n strict: true,\n declaration: true,\n sourceMap: true,\n esModuleInterop: true,\n isolatedModules: true,\n resolveJsonModule: true,\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*.ts'],\n exclude: ['node_modules', 'dist'],\n },\n null,\n 2,\n ),\n 'src/index.ts': `import { SpeedX } from 'speedx/server'\n\nconst PORT = Number(process.env.PORT) || 3000\n\nconst app = SpeedX()\n\napp.get('/api/health', async ({ response }) => {\n return response.json({ status: 'ok', timestamp: new Date().toISOString() })\n})\n\napp.listen(PORT, () => {\n console.log(\\`SpeedX API running on http://localhost:\\${PORT}\\`)\n})\n`,\n 'src/controllers/health.controller.ts': `import { Controller, get } from 'speedx/server'\n\nexport class HealthController extends Controller {\n @get('/health')\n async check({ response }) {\n return response.json({\n status: 'ok',\n uptime: process.uptime(),\n })\n }\n}\n`,\n 'src/middleware/auth.ts': `import type { RouteContext } from 'speedx/server/router'\n\nexport function auth() {\n return async (ctx: RouteContext, next: () => Promise<void>) => {\n const token = ctx.request.headers.get('authorization')\n\n if (!token) {\n ctx.response.status(401).json({\n error: 'Unauthorized',\n message: 'Missing authorization header',\n })\n return\n }\n\n await next()\n }\n}\n`,\n '.env.example': `PORT=3000\nNODE_ENV=development\n`,\n '.gitignore': `node_modules/\ndist/\n.env\n*.log\n`,\n },\n },\n}\n\nconst TEMPLATE_ALIASES: Record<string, string> = {\n api: 'api-only',\n full: 'fullstack',\n}\n\nfunction getTemplate(name: string): string {\n return TEMPLATE_ALIASES[name] ?? name\n}\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nexport async function initProject(\n name: string,\n options: Record<string, any>,\n): Promise<void> {\n const targetDir = resolve(process.cwd(), name)\n\n if (existsSync(targetDir)) {\n console.error(colors.red(`Directory '${name}' sudah ada!`))\n process.exit(1)\n }\n\n const templateName = getTemplate(String(options.template || 'blank'))\n const template = TEMPLATES[templateName]\n\n if (!template) {\n console.error(\n colors.red(\n `Template '${options.template}' tidak dikenal. Gunakan: blank, fullstack, api-only`,\n ),\n )\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n for (const dir of template.dirs) {\n mkdirSync(resolve(targetDir, dir), { recursive: true })\n }\n\n for (const [filePath, content] of Object.entries(template.files)) {\n const fullPath = resolve(targetDir, filePath)\n mkdirSync(dirname(fullPath), { recursive: true })\n\n const resolvedContent =\n typeof content === 'function' ? content(name) : content\n\n writeFileSync(fullPath, resolvedContent, 'utf-8')\n }\n\n if (options.git !== false) {\n try {\n const { execSync } = await import('child_process')\n execSync('git init', { cwd: targetDir, stdio: 'ignore' })\n } catch {\n // git not available\n }\n }\n\n if (options.install !== false) {\n const pm = String(options['package-manager'] || options.packageManager || 'npm')\n try {\n const { execSync } = await import('child_process')\n console.log(` ${colors.cyan('→')} Installing dependencies with ${pm}...`)\n execSync(`${pm} install`, { cwd: targetDir, stdio: 'inherit' })\n } catch {\n console.log(\n ` ${colors.yellow('!')} Dependency install skipped. Run '${pm} install' manually.`,\n )\n }\n }\n\n const packageManager = String(options['package-manager'] || options.packageManager || 'npm')\n\n console.log()\n console.log(`${colors.bold('╔════════════════════════════════════╗')}`)\n console.log(`${colors.bold('║')} ${colors.green('SpeedX 🚀 Project Created')}${colors.bold(' ║')}`)\n console.log(`${colors.bold('╚════════════════════════════════════╝')}`)\n console.log()\n console.log(` ${colors.bold('Name:')} ${toPascalCase(name)}`)\n console.log(` ${colors.bold('Template:')} ${templateName}`)\n console.log(` ${colors.bold('Dir:')} ${targetDir}`)\n console.log()\n console.log(` ${colors.cyan('$')} cd ${name}`)\n console.log(` ${colors.cyan('$')} ${packageManager} run dev`)\n console.log()\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nfunction toKebabCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase()\n}\n\nfunction toCamelCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toLowerCase())\n}\n\nexport function makeController(name: string): void {\n const className = `${toPascalCase(name)}Controller`\n const fileName = `${toKebabCase(name)}.controller.ts`\n const targetDir = resolve(process.cwd(), 'src/server/controllers')\n const fullPath = resolve(targetDir, fileName)\n const varName = toCamelCase(name)\n\n if (existsSync(fullPath)) {\n console.error(colors.red(`File ${fileName} sudah ada!`))\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n const content = `import { Controller, get, post, put, del } from 'speedx/server'\nimport type { RouteContext } from 'speedx/server/router'\n\nexport class ${className} extends Controller {\n @get('/')\n async index({ response }: RouteContext) {\n return response.json({ data: [] })\n }\n\n @get('/:id')\n async show({ response, params }: RouteContext) {\n return response.json({ data: { id: params.id } })\n }\n\n @post('/')\n async store({ request, response }: RouteContext) {\n const body = await request.body()\n return response.json({ data: body }, 201)\n }\n\n @put('/:id')\n async update({ request, response, params }: RouteContext) {\n const body = await request.body()\n return response.json({ data: { id: params.id, ...body } })\n }\n\n @del('/:id')\n async destroy({ response, params }: RouteContext) {\n return response.json({ message: \\`${className} deleted \\${params.id}\\` })\n }\n}\n\nexport const ${varName}Controller = ${className}\n`\n\n writeFileSync(fullPath, content, 'utf-8')\n console.log(\n `${colors.green('✅')} Controller ${colors.bold(className)} dibuat di ${colors.cyan(fileName)}`,\n )\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nfunction toKebabCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase()\n}\n\nfunction toCamelCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toLowerCase())\n}\n\nexport function makeMiddleware(name: string): void {\n const functionName = toCamelCase(name)\n const className = toPascalCase(name)\n const fileName = `${toKebabCase(name)}.middleware.ts`\n const targetDir = resolve(process.cwd(), 'src/server/middleware')\n const fullPath = resolve(targetDir, fileName)\n\n if (existsSync(fullPath)) {\n console.error(colors.red(`File ${fileName} sudah ada!`))\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n const content = `import type { RouteContext } from 'speedx/server/router'\n\nexport function ${functionName}(options?: Record<string, unknown>) {\n return async (ctx: RouteContext, next: () => Promise<void>) => {\n const start = Date.now()\n\n await next()\n\n const duration = Date.now() - start\n console.log(\\`[${className}Middleware] \\${ctx.request.method} \\${ctx.request.url} \\${duration}ms\\`)\n }\n}\n`\n\n writeFileSync(fullPath, content, 'utf-8')\n console.log(\n `${colors.green('✅')} Middleware ${colors.bold(functionName)} dibuat di ${colors.cyan(fileName)}`,\n )\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nfunction toKebabCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase()\n}\n\nexport function makeSchema(name: string): void {\n const schemaName = `${toPascalCase(name)}Schema`\n const typeName = toPascalCase(name)\n const fileName = `${toKebabCase(name)}.schema.ts`\n const targetDir = resolve(process.cwd(), 'src/schemas')\n const fullPath = resolve(targetDir, fileName)\n\n if (existsSync(fullPath)) {\n console.error(colors.red(`File ${fileName} sudah ada!`))\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n const content = `import { s, type Infer } from 'speedx/schema'\n\nexport const ${schemaName} = s.object({\n id: s.string().uuid(),\n name: s.string().min(1).max(255),\n createdAt: s.string().datetime(),\n updatedAt: s.string().datetime().optional(),\n})\n\nexport type ${typeName} = Infer<typeof ${schemaName}>\n\nexport const create${typeName}Schema = s.object({\n name: s.string().min(1).max(255),\n})\n\nexport type Create${typeName} = Infer<typeof create${typeName}Schema>\n`\n\n writeFileSync(fullPath, content, 'utf-8')\n console.log(\n `${colors.green('✅')} Schema ${colors.bold(schemaName)} dibuat di ${colors.cyan(fileName)}`,\n )\n}\n","import { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\ninterface RouteInfo {\n method: string\n path: string\n}\n\nfunction extractDecorators(content: string): RouteInfo[] {\n const pattern = /@(get|post|put|patch|del|delete)\\s*\\(\\s*'([^']+)'\\s*\\)/g\n const results: RouteInfo[] = []\n\n let match: RegExpExecArray | null = pattern.exec(content)\n while (match !== null) {\n const method =\n match[1] === 'del' ? 'DELETE' : (match[1] as string).toUpperCase()\n const path = match[2] as string\n results.push({ method, path })\n match = pattern.exec(content)\n }\n\n return results\n}\n\nexport function listRoutes(): void {\n const routesDir = resolve(process.cwd(), 'src/server/controllers')\n\n if (!existsSync(routesDir)) {\n console.log(\n ` ${colors.yellow('!')} Tidak ada route terdaftar. Buat controller dulu:`,\n )\n console.log(` ${colors.cyan('speedx make:controller <name>')}`)\n return\n }\n\n const files = readdirSync(routesDir).filter(f => f.endsWith('.ts'))\n\n if (files.length === 0) {\n console.log(\n ` ${colors.yellow('!')} Tidak ada route terdaftar. Buat controller dulu:`,\n )\n console.log(` ${colors.cyan('speedx make:controller <name>')}`)\n return\n }\n\n let total = 0\n\n console.log()\n console.log(` ${colors.bold('📋 Daftar Route:')}`)\n console.log()\n\n for (const file of files) {\n const content = readFileSync(resolve(routesDir, file), 'utf-8')\n const routes = extractDecorators(content)\n\n if (routes.length > 0) {\n console.log(` ${colors.cyan('──')} ${colors.bold(file.replace('.controller.ts', ''))} ${colors.cyan('──')}`)\n\n for (const { method, path } of routes) {\n const coloredMethod = method === 'GET'\n ? colors.green(method.padEnd(8))\n : method === 'POST'\n ? colors.blue(method.padEnd(8))\n : method === 'PUT' || method === 'PATCH'\n ? colors.yellow(method.padEnd(8))\n : colors.red(method.padEnd(8))\n\n console.log(` ${coloredMethod} ${path}`)\n total++\n }\n\n console.log()\n }\n }\n\n console.log(` ${colors.dim(`${total} route${total !== 1 ? 's' : ''} ditemukan`)}`)\n console.log()\n}\n","import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\nimport { logger } from '../../native/logger.js'\n\ninterface ServeOptions {\n port?: string | number\n host?: string\n dev?: string | boolean\n}\n\nexport async function serve(options: Record<string, any>): Promise<void> {\n const opts: ServeOptions = {\n port: options.port || options.p || 3000,\n host: options.host || options.H || 'localhost',\n dev: options.dev !== false,\n }\n\n const port = parseInt(String(opts.port), 10)\n const host = String(opts.host)\n\n const serverEntry = resolve(process.cwd(), 'src/app.ts')\n const serverEntryAlt = resolve(process.cwd(), 'src/server/index.ts')\n const serverEntryIndex = resolve(process.cwd(), 'src/index.ts')\n\n let entryPath: string | null = null\n if (existsSync(serverEntry)) entryPath = serverEntry\n else if (existsSync(serverEntryAlt)) entryPath = serverEntryAlt\n else if (existsSync(serverEntryIndex)) entryPath = serverEntryIndex\n\n if (!entryPath) {\n console.error(\n colors.red(\n 'Tidak ditemukan file entry point. Buat src/app.ts atau src/index.ts',\n ),\n )\n process.exit(1)\n }\n\n if (opts.dev) {\n logger.info(\n `Development server starting at ${colors.cyan(`http://${host}:${port}`)}`,\n )\n\n try {\n const { app } = await import(entryPath)\n\n if (!app || typeof app.listen !== 'function') {\n console.error(\n colors.red(\n 'Entry point harus export { app } dengan method .listen()',\n ),\n )\n process.exit(1)\n }\n\n app.listen(port, host, () => {\n console.log()\n console.log(` ${colors.bold('SpeedX')} ${colors.green('running')}`)\n console.log(` ${colors.dim('→')} ${colors.cyan(`http://${host}:${port}`)}`)\n console.log()\n })\n } catch (err: any) {\n console.error(colors.red(`Gagal menjalankan server: ${err.message}`))\n process.exit(1)\n }\n } else {\n try {\n const { app } = await import(entryPath)\n\n if (!app || typeof app.listen !== 'function') {\n console.error(\n colors.red(\n 'Entry point harus export { app } dengan method .listen()',\n ),\n )\n process.exit(1)\n }\n\n app.listen(port, host, () => {\n console.log()\n console.log(` ${colors.bold('SpeedX')} ${colors.green('running')}`)\n console.log(` ${colors.dim('→')} ${colors.cyan(`http://${host}:${port}`)}`)\n console.log()\n })\n } catch (err: any) {\n console.error(colors.red(`Gagal menjalankan server: ${err.message}`))\n process.exit(1)\n }\n }\n}\n","import { colors, isColorSupported } from './colors.js'\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error'\n\nexport interface LoggerOptions {\n level?: LogLevel\n name?: string\n colors?: boolean\n timestamps?: boolean\n timezone?: 'WIB' | 'WITA' | 'WIT' | 'UTC'\n}\n\nconst LOG_LEVELS: Record<LogLevel, number> = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n}\n\nconst TIMEZONE_OFFSETS: Record<string, number> = {\n WIB: 7,\n WITA: 8,\n WIT: 9,\n UTC: 0,\n}\n\nfunction pad(n: number): string {\n return n.toString().padStart(2, '0')\n}\n\nexport function formatTimestamp(tz?: string): string {\n const offset = TIMEZONE_OFFSETS[tz ?? ''] ?? 7\n const now = new Date()\n const utc = now.getTime() + now.getTimezoneOffset() * 60000\n const local = new Date(utc + offset * 3600000)\n\n const y = local.getFullYear()\n const M = pad(local.getMonth() + 1)\n const d = pad(local.getDate())\n const h = pad(local.getHours())\n const m = pad(local.getMinutes())\n const s = pad(local.getSeconds())\n\n return `${y}-${M}-${d} ${h}:${m}:${s} ${tz ?? 'WIB'}`\n}\n\nconst LEVEL_PREFIX: Record<LogLevel, string> = {\n debug: 'DEBUG',\n info: 'INFO',\n warn: 'WARN',\n error: 'ERROR',\n}\n\nconst LEVEL_COLOR: Record<LogLevel, (s: string) => string> = {\n debug: colors.gray,\n info: colors.cyan,\n warn: colors.yellow,\n error: colors.red,\n}\n\nexport class Logger {\n private _level: LogLevel\n private _name: string\n private _useColors: boolean\n private _useTimestamps: boolean\n private _timezone: string\n\n constructor(options?: LoggerOptions) {\n this._level = options?.level ?? 'info'\n this._name = options?.name ?? ''\n this._useColors = options?.colors ?? isColorSupported()\n this._useTimestamps = options?.timestamps ?? true\n this._timezone = options?.timezone ?? 'WIB'\n }\n\n private _format(level: LogLevel, msg: string, meta?: Record<string, unknown>): string {\n const parts: string[] = []\n\n if (this._useTimestamps) {\n parts.push(formatTimestamp(this._timezone))\n }\n\n if (this._useColors) {\n parts.push(LEVEL_COLOR[level](LEVEL_PREFIX[level]))\n } else {\n parts.push(LEVEL_PREFIX[level])\n }\n\n if (this._name) {\n parts.push(this._useColors ? colors.dim(`[${this._name}]`) : `[${this._name}]`)\n }\n\n if (this._useColors) {\n parts.push(LEVEL_COLOR[level](msg))\n } else {\n parts.push(msg)\n }\n\n if (meta && Object.keys(meta).length > 0) {\n parts.push(JSON.stringify(meta))\n }\n\n return parts.join(' ')\n }\n\n debug(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.debug) return\n console.debug(this._format('debug', msg, meta))\n }\n\n info(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.info) return\n console.info(this._format('info', msg, meta))\n }\n\n warn(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.warn) return\n console.warn(this._format('warn', msg, meta))\n }\n\n error(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.error) return\n console.error(this._format('error', msg, meta))\n }\n\n child(name: string): Logger {\n const childName = this._name ? `${this._name}:${name}` : name\n return new Logger({\n level: this._level,\n name: childName,\n colors: this._useColors,\n timestamps: this._useTimestamps,\n timezone: this._timezone as LoggerOptions['timezone'],\n })\n }\n\n setLevel(level: LogLevel): void {\n this._level = level\n }\n}\n\nexport const logger = new Logger()\n","#!/usr/bin/env node\nimport { parseArgs } from '../native/args.js'\nimport { colors } from '../native/colors.js'\nimport { initProject } from './commands/init.js'\nimport { makeController } from './commands/make-controller.js'\nimport { makeMiddleware } from './commands/make-middleware.js'\nimport { makeSchema } from './commands/make-schema.js'\nimport { listRoutes } from './commands/list-routes.js'\nimport { serve } from './commands/serve.js'\n\nfunction showHelp(): void {\n console.log(`${colors.bold('SpeedX')} ${colors.cyan('v0.2.0')}`)\n console.log('Fullstack JavaScript/TypeScript Framework')\n console.log()\n console.log(`${colors.bold('Usage:')}`)\n console.log(' SpeedX init [name] [options] Buat project baru')\n console.log(' SpeedX make:controller <name> Generate controller')\n console.log(' SpeedX make:middleware <name> Generate middleware')\n console.log(' SpeedX make:schema <name> Generate schema')\n console.log(' SpeedX list-routes Lihat semua route')\n console.log(' SpeedX serve [options] Jalankan server')\n console.log(' SpeedX --help Bantuan ini')\n console.log()\n console.log(`${colors.bold('Aliases:')}`)\n console.log(' SpeedX -v, --version Lihat versi')\n console.log()\n console.log(`${colors.bold('Options:')}`)\n console.log(' --template <type> blank, fullstack, api-only')\n console.log(' --frontend <fe> super, react, vue')\n console.log(' --port <number> Port server (default: 3000)')\n console.log(' --host <string> Host address (default: localhost)')\n}\n\nasync function main(): Promise<void> {\n const parsed = parseArgs(process.argv)\n const command = parsed.command\n\n switch (command) {\n case 'init': {\n await initProject(parsed.args[0] || 'my-app', parsed.options)\n break\n }\n case 'make:controller': {\n if (!parsed.args[0]) {\n console.error(colors.red('Nama controller diperlukan'))\n console.log(` ${colors.cyan('SpeedX make:controller <name>')}`)\n process.exit(1)\n }\n await makeController(parsed.args[0])\n break\n }\n case 'make:middleware': {\n if (!parsed.args[0]) {\n console.error(colors.red('Nama middleware diperlukan'))\n console.log(` ${colors.cyan('SpeedX make:middleware <name>')}`)\n process.exit(1)\n }\n await makeMiddleware(parsed.args[0])\n break\n }\n case 'make:schema': {\n if (!parsed.args[0]) {\n console.error(colors.red('Nama schema diperlukan'))\n console.log(` ${colors.cyan('SpeedX make:schema <name>')}`)\n process.exit(1)\n }\n await makeSchema(parsed.args[0])\n break\n }\n case 'list-routes':\n case 'routes':\n case 'lr': {\n await listRoutes()\n break\n }\n case 'serve':\n case 'dev': {\n await serve(parsed.options)\n break\n }\n case 'help':\n case '--help':\n case '-h': {\n showHelp()\n break\n }\n case 'version':\n case '--version':\n case '-v': {\n console.log('SpeedX v0.2.0')\n break\n }\n default: {\n if (command) {\n console.error(`${colors.red(`Command '${command}' tidak dikenal`)}`)\n console.log()\n }\n showHelp()\n if (command) process.exit(1)\n }\n }\n}\n\nmain().catch(err => {\n console.error(colors.red(`Error: ${err.message}`))\n process.exit(1)\n})\n"],"mappings":";;;AAOO,SAAS,UAAU,MAA4B;AACpD,QAAM,OAAO,KAAK,MAAM,CAAC;AACzB,QAAM,SAAqB;AAAA,IACzB,SAAS;AAAA,IACT,MAAM,CAAC;AAAA,IACP,SAAS,CAAC;AAAA,EACZ;AAEA,MAAI,KAAK,WAAW,EAAG,QAAO;AAE9B,QAAM,QAAQ,KAAK,CAAC;AAEpB,MAAI,MAAM,SAAS,GAAG,GAAG;AACvB,WAAO,UAAU;AACjB,iBAAa,KAAK,MAAM,CAAC,GAAG,MAAM;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,UAAU;AAEjB,MAAI,KAAK,SAAS,GAAG;AACnB,UAAM,SAAS,KAAK,CAAC;AACrB,QAAI,CAAC,OAAO,WAAW,GAAG,GAAG;AAC3B,aAAO,aAAa;AACpB,aAAO,KAAK,KAAK,MAAM;AACvB,mBAAa,KAAK,MAAM,CAAC,GAAG,MAAM;AAClC,aAAO;AAAA,IACT;AAAA,EACF;AAEA,eAAa,KAAK,MAAM,CAAC,GAAG,MAAM;AAClC,SAAO;AACT;AAEA,SAAS,aAAa,MAAgB,QAA0B;AAC9D,MAAI,IAA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AE,MAAM,SAAO;AAClB,UAAQ,MAAM,OAAO,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;AACjD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["existsSync","mkdirSync","writeFileSync","resolve","toPascalCase","resolve","existsSync","mkdirSync","writeFileSync","existsSync","mkdirSync","writeFileSync","resolve","toPascalCase","toKebabCase","toCamelCase","resolve","existsSync","mkdirSync","writeFileSync","existsSync","mkdirSync","writeFileSync","resolve","toPascalCase","toKebabCase","resolve","existsSync","mkdirSync","writeFileSync","existsSync","resolve","resolve","existsSync","existsSync","resolve","resolve","existsSync"]}
1
+ {"version":3,"sources":["../../src/native/args.ts","../../src/native/colors.ts","../../src/cli/commands/init.ts","../../src/cli/commands/make-controller.ts","../../src/cli/commands/make-middleware.ts","../../src/cli/commands/make-schema.ts","../../src/cli/commands/list-routes.ts","../../src/cli/commands/serve.ts","../../src/native/logger.ts","../../src/cli/index.ts"],"sourcesContent":["export interface ParsedArgs {\n command: string\n subcommand?: string\n args: string[]\n options: Record<string, string | boolean | string[]>\n}\n\nexport function parseArgs(argv: string[]): ParsedArgs {\n const args = argv.slice(2)\n const result: ParsedArgs = {\n command: '',\n args: [],\n options: {},\n }\n\n if (args.length === 0) return result\n\n const first = args[0]!\n\n if (first.includes(':')) {\n result.command = first\n parseOptions(args.slice(1), result)\n return result\n }\n\n result.command = first\n\n if (args.length > 1) {\n const second = args[1]!\n if (!second.startsWith('-')) {\n result.subcommand = second\n result.args.push(second)\n parseOptions(args.slice(2), result)\n return result\n }\n }\n\n parseOptions(args.slice(1), result)\n return result\n}\n\nfunction parseOptions(argv: string[], result: ParsedArgs): void {\n let i = 0\n while (i < argv.length) {\n const arg = argv[i]!\n\n if (arg === '--') {\n for (let j = i + 1; j < argv.length; j++) {\n result.args.push(argv[j]!)\n }\n break\n }\n\n if (arg.startsWith('--no-')) {\n const key = arg.slice(5)\n if (key) {\n result.options[key] = false\n }\n i++\n continue\n }\n\n if (arg.startsWith('--')) {\n const key = arg.slice(2)\n if (i + 1 < argv.length && !argv[i + 1]!.startsWith('-')) {\n const val = argv[i + 1]!\n const existing = result.options[key]\n if (existing !== undefined) {\n result.options[key] = Array.isArray(existing)\n ? ([...existing, val] as string[])\n : [existing as string, val]\n } else {\n result.options[key] = val\n }\n i += 2\n } else {\n result.options[key] = true\n i++\n }\n continue\n }\n\n if (arg.startsWith('-') && arg.length === 2) {\n const key = arg.slice(1)\n if (i + 1 < argv.length && !argv[i + 1]!.startsWith('-')) {\n const val = argv[i + 1]!\n result.options[key] = val\n i += 2\n } else {\n result.options[key] = true\n i++\n }\n continue\n }\n\n result.args.push(arg)\n i++\n }\n}\n\nexport function toCommandName(argv: string[]): string {\n const args = argv.slice(2)\n if (args.length === 0) return ''\n\n const first = args[0]!\n\n if (first.includes(':')) return first\n\n if (args.length > 1 && !args[1]!.startsWith('-')) {\n return `${first}:${args[1]}`\n }\n\n return first\n}\n","const RESET = '\\x1b[0m'\n\nconst codes: Record<string, string> = {\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m',\n gray: '\\x1b[90m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n italic: '\\x1b[3m',\n underline: '\\x1b[4m',\n}\n\nexport const colors = {\n red: (s: string): string => `${codes.red}${s}${RESET}`,\n green: (s: string): string => `${codes.green}${s}${RESET}`,\n yellow: (s: string): string => `${codes.yellow}${s}${RESET}`,\n blue: (s: string): string => `${codes.blue}${s}${RESET}`,\n magenta: (s: string): string => `${codes.magenta}${s}${RESET}`,\n cyan: (s: string): string => `${codes.cyan}${s}${RESET}`,\n gray: (s: string): string => `${codes.gray}${s}${RESET}`,\n white: (s: string): string => `${codes.white}${s}${RESET}`,\n bold: (s: string): string => `${codes.bold}${s}${RESET}`,\n dim: (s: string): string => `${codes.dim}${s}${RESET}`,\n italic: (s: string): string => `${codes.italic}${s}${RESET}`,\n underline: (s: string): string => `${codes.underline}${s}${RESET}`,\n}\n\nexport function stripColors(s: string): string {\n const ansi = String.fromCharCode(27)\n const re = new RegExp(`${ansi}\\\\[\\\\d+m`, 'g')\n return s.replace(re, '')\n}\n\nexport function isColorSupported(): boolean {\n if (typeof process === 'undefined') return false\n if (process.env.NO_COLOR) return false\n if (process.env.FORCE_COLOR) return true\n if (!process.stdout) return false\n if (!process.stdout.isTTY) return false\n return true\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\ninterface TemplateContent {\n dirs: string[]\n files: Record<string, string | ((name: string) => string)>\n}\n\nconst TEMPLATES: Record<string, TemplateContent> = {\n blank: {\n dirs: ['src'],\n files: {\n 'package.json': (name: string) =>\n JSON.stringify(\n {\n name,\n version: '0.1.0',\n type: 'module',\n private: true,\n scripts: {\n dev: 'speexjs serve',\n build: 'speexjs build',\n start: 'node dist/index.js',\n },\n dependencies: {\n speexjs: 'latest',\n },\n devDependencies: {\n '@types/node': '^26.0.1',\n typescript: '^5.7.0',\n },\n },\n null,\n 2,\n ),\n 'tsconfig.json': JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n strict: true,\n declaration: true,\n sourceMap: true,\n esModuleInterop: true,\n isolatedModules: true,\n resolveJsonModule: true,\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*.ts'],\n exclude: ['node_modules', 'dist'],\n },\n null,\n 2,\n ),\n 'src/index.ts': `import { speexjs } from 'speexjs/server'\n\nconst app = speexjs()\n\nconst PORT = Number(process.env.PORT) || 3000\n\napp.get('/', async ({ response }) => {\n return response.html('<h1>SpeexJS 🚀</h1>')\n})\n\napp.listen(PORT, () => {\n console.log(\\`SpeexJS running on http://localhost:\\${PORT}\\`)\n})\n`,\n 'src/app.ts': `import { speexjs } from 'speexjs/server'\n\nexport function createApp() {\n const app = speexjs()\n return app\n}\n`,\n '.env.example': `PORT=3000\nNODE_ENV=development\n`,\n '.gitignore': `node_modules/\ndist/\n.env\n*.log\n`,\n },\n },\n\n fullstack: {\n dirs: [\n 'src/server',\n 'src/server/controllers',\n 'src/server/middleware',\n 'src/client',\n 'src/client/components',\n 'src/client/pages',\n 'src/shared',\n 'public',\n ],\n files: {\n 'package.json': (name: string) =>\n JSON.stringify(\n {\n name,\n version: '0.1.0',\n type: 'module',\n private: true,\n scripts: {\n dev: 'speexjs serve',\n build: 'tsc',\n start: 'node dist/server/index.js',\n },\n dependencies: {\n speexjs: 'latest',\n },\n devDependencies: {\n '@types/node': '^26.0.1',\n typescript: '^5.7.0',\n },\n },\n null,\n 2,\n ),\n 'tsconfig.json': JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n strict: true,\n declaration: true,\n sourceMap: true,\n esModuleInterop: true,\n isolatedModules: true,\n resolveJsonModule: true,\n jsx: 'react-jsx',\n jsxImportSource: '@speexjs/vdom',\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*.ts', 'src/**/*.tsx'],\n exclude: ['node_modules', 'dist'],\n },\n null,\n 2,\n ),\n 'src/server/index.ts': `import { speexjs } from 'speexjs/server'\nimport { UserController } from './controllers/user.controller.js'\n\nconst PORT = Number(process.env.PORT) || 3000\n\nconst app = speexjs()\n\napp.controller(UserController)\n\napp.get('/', async ({ response }) => {\n return response.html(\\`\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>SpeexJS Fullstack</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/client/index.js\"></script>\n </body>\n </html>\n \\`)\n})\n\napp.listen(PORT, () => {\n console.log(\\`SpeexJS running on http://localhost:\\${PORT}\\`)\n})\n`,\n 'src/server/controllers/user.controller.ts': `import { Controller, get, post } from 'speexjs/server'\n\nexport class UserController extends Controller {\n @get('/users')\n async index({ response }) {\n return response.json({ data: [] })\n }\n\n @post('/users')\n async store({ request, response }) {\n const body = await request.body()\n return response.json({ data: body }, 201)\n }\n}\n`,\n 'src/client/index.ts': `import { createApp } from './app.js'\n\ndocument.addEventListener('DOMContentLoaded', () => {\n createApp().mount('#root')\n})\n`,\n 'src/client/app.ts': `export function createApp() {\n function mount(selector: string) {\n const root = document.querySelector(selector)\n if (!root) {\n console.error('Root element not found:', selector)\n return\n }\n root.innerHTML = \\`\n <div style=\"text-align:center;padding:2rem\">\n <h1>SpeexJS Fullstack</h1>\n <p>Welcome to SpeexJS!</p>\n </div>\n \\`\n }\n\n return { mount }\n}\n`,\n 'public/style.css': `* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n background: #0f172a;\n color: #e2e8f0;\n min-height: 100vh;\n}\n\n#root {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n}\n`,\n 'src/shared/types.ts': `export interface ApiResponse<T = unknown> {\n success: boolean\n data: T\n message?: string\n}\n`,\n '.env.example': `PORT=3000\nNODE_ENV=development\n`,\n '.gitignore': `node_modules/\ndist/\n.env\n*.log\n`,\n },\n },\n\n 'api-only': {\n dirs: ['src', 'src/controllers', 'src/middleware'],\n files: {\n 'package.json': (name: string) =>\n JSON.stringify(\n {\n name,\n version: '0.1.0',\n type: 'module',\n private: true,\n scripts: {\n dev: 'speexjs serve',\n build: 'tsc',\n start: 'node dist/index.js',\n },\n dependencies: {\n speexjs: 'latest',\n },\n devDependencies: {\n '@types/node': '^26.0.1',\n typescript: '^5.7.0',\n },\n },\n null,\n 2,\n ),\n 'tsconfig.json': JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n module: 'ESNext',\n moduleResolution: 'bundler',\n strict: true,\n declaration: true,\n sourceMap: true,\n esModuleInterop: true,\n isolatedModules: true,\n resolveJsonModule: true,\n outDir: './dist',\n rootDir: './src',\n },\n include: ['src/**/*.ts'],\n exclude: ['node_modules', 'dist'],\n },\n null,\n 2,\n ),\n 'src/index.ts': `import { speexjs } from 'speexjs/server'\n\nconst PORT = Number(process.env.PORT) || 3000\n\nconst app = speexjs()\n\napp.get('/api/health', async ({ response }) => {\n return response.json({ status: 'ok', timestamp: new Date().toISOString() })\n})\n\napp.listen(PORT, () => {\n console.log(\\`SpeexJS API running on http://localhost:\\${PORT}\\`)\n})\n`,\n 'src/controllers/health.controller.ts': `import { Controller, get } from 'speexjs/server'\n\nexport class HealthController extends Controller {\n @get('/health')\n async check({ response }) {\n return response.json({\n status: 'ok',\n uptime: process.uptime(),\n })\n }\n}\n`,\n 'src/middleware/auth.ts': `import type { RouteContext } from 'speexjs/server/router'\n\nexport function auth() {\n return async (ctx: RouteContext, next: () => Promise<void>) => {\n const token = ctx.request.headers.get('authorization')\n\n if (!token) {\n ctx.response.status(401).json({\n error: 'Unauthorized',\n message: 'Missing authorization header',\n })\n return\n }\n\n await next()\n }\n}\n`,\n '.env.example': `PORT=3000\nNODE_ENV=development\n`,\n '.gitignore': `node_modules/\ndist/\n.env\n*.log\n`,\n },\n },\n}\n\nconst TEMPLATE_ALIASES: Record<string, string> = {\n api: 'api-only',\n full: 'fullstack',\n}\n\nfunction getTemplate(name: string): string {\n return TEMPLATE_ALIASES[name] ?? name\n}\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nexport async function initProject(\n name: string,\n options: Record<string, any>,\n): Promise<void> {\n const targetDir = resolve(process.cwd(), name)\n\n if (existsSync(targetDir)) {\n console.error(colors.red(`Directory '${name}' sudah ada!`))\n process.exit(1)\n }\n\n const templateName = getTemplate(String(options.template || 'blank'))\n const template = TEMPLATES[templateName]\n\n if (!template) {\n console.error(\n colors.red(\n `Template '${options.template}' tidak dikenal. Gunakan: blank, fullstack, api-only`,\n ),\n )\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n for (const dir of template.dirs) {\n mkdirSync(resolve(targetDir, dir), { recursive: true })\n }\n\n for (const [filePath, content] of Object.entries(template.files)) {\n const fullPath = resolve(targetDir, filePath)\n mkdirSync(dirname(fullPath), { recursive: true })\n\n const resolvedContent =\n typeof content === 'function' ? content(name) : content\n\n writeFileSync(fullPath, resolvedContent, 'utf-8')\n }\n\n if (options.git !== false) {\n try {\n const { execSync } = await import('child_process')\n execSync('git init', { cwd: targetDir, stdio: 'ignore' })\n } catch {\n // git not available\n }\n }\n\n if (options.install !== false) {\n const pm = String(options['package-manager'] || options.packageManager || 'npm')\n try {\n const { execSync } = await import('child_process')\n console.log(` ${colors.cyan('→')} Installing dependencies with ${pm}...`)\n execSync(`${pm} install`, { cwd: targetDir, stdio: 'inherit' })\n } catch {\n console.log(\n ` ${colors.yellow('!')} Dependency install skipped. Run '${pm} install' manually.`,\n )\n }\n }\n\n const packageManager = String(options['package-manager'] || options.packageManager || 'npm')\n\n console.log()\n console.log(`${colors.bold('╔════════════════════════════════════╗')}`)\n console.log(`${colors.bold('║')} ${colors.green('speexjs 🚀 Project Created')}${colors.bold(' ║')}`)\n console.log(`${colors.bold('╚════════════════════════════════════╝')}`)\n console.log()\n console.log(` ${colors.bold('Name:')} ${toPascalCase(name)}`)\n console.log(` ${colors.bold('Template:')} ${templateName}`)\n console.log(` ${colors.bold('Dir:')} ${targetDir}`)\n console.log()\n console.log(` ${colors.cyan('$')} cd ${name}`)\n console.log(` ${colors.cyan('$')} ${packageManager} run dev`)\n console.log()\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nfunction toKebabCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase()\n}\n\nfunction toCamelCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toLowerCase())\n}\n\nexport function makeController(name: string): void {\n const className = `${toPascalCase(name)}Controller`\n const fileName = `${toKebabCase(name)}.controller.ts`\n const targetDir = resolve(process.cwd(), 'src/server/controllers')\n const fullPath = resolve(targetDir, fileName)\n const varName = toCamelCase(name)\n\n if (existsSync(fullPath)) {\n console.error(colors.red(`File ${fileName} sudah ada!`))\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n const content = `import { Controller, get, post, put, del } from 'speexjs/server'\nimport type { RouteContext } from 'speexjs/server/router'\n\nexport class ${className} extends Controller {\n @get('/')\n async index({ response }: RouteContext) {\n return response.json({ data: [] })\n }\n\n @get('/:id')\n async show({ response, params }: RouteContext) {\n return response.json({ data: { id: params.id } })\n }\n\n @post('/')\n async store({ request, response }: RouteContext) {\n const body = await request.body()\n return response.json({ data: body }, 201)\n }\n\n @put('/:id')\n async update({ request, response, params }: RouteContext) {\n const body = await request.body()\n return response.json({ data: { id: params.id, ...body } })\n }\n\n @del('/:id')\n async destroy({ response, params }: RouteContext) {\n return response.json({ message: \\`${className} deleted \\${params.id}\\` })\n }\n}\n\nexport const ${varName}Controller = ${className}\n`\n\n writeFileSync(fullPath, content, 'utf-8')\n console.log(\n `${colors.green('✅')} Controller ${colors.bold(className)} dibuat di ${colors.cyan(fileName)}`,\n )\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nfunction toKebabCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase()\n}\n\nfunction toCamelCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toLowerCase())\n}\n\nexport function makeMiddleware(name: string): void {\n const functionName = toCamelCase(name)\n const className = toPascalCase(name)\n const fileName = `${toKebabCase(name)}.middleware.ts`\n const targetDir = resolve(process.cwd(), 'src/server/middleware')\n const fullPath = resolve(targetDir, fileName)\n\n if (existsSync(fullPath)) {\n console.error(colors.red(`File ${fileName} sudah ada!`))\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n const content = `import type { RouteContext } from 'speexjs/server/router'\n\nexport function ${functionName}(options?: Record<string, unknown>) {\n return async (ctx: RouteContext, next: () => Promise<void>) => {\n const start = Date.now()\n\n await next()\n\n const duration = Date.now() - start\n console.log(\\`[${className}Middleware] \\${ctx.request.method} \\${ctx.request.url} \\${duration}ms\\`)\n }\n}\n`\n\n writeFileSync(fullPath, content, 'utf-8')\n console.log(\n `${colors.green('✅')} Middleware ${colors.bold(functionName)} dibuat di ${colors.cyan(fileName)}`,\n )\n}\n","import { existsSync, mkdirSync, writeFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\nfunction toPascalCase(str: string): string {\n return str\n .replace(/[-_\\s]+(.)?/g, (_, c: string) => (c ?? '').toUpperCase())\n .replace(/^(.)/, (c: string) => c.toUpperCase())\n}\n\nfunction toKebabCase(str: string): string {\n return str\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .toLowerCase()\n}\n\nexport function makeSchema(name: string): void {\n const schemaName = `${toPascalCase(name)}Schema`\n const typeName = toPascalCase(name)\n const fileName = `${toKebabCase(name)}.schema.ts`\n const targetDir = resolve(process.cwd(), 'src/schemas')\n const fullPath = resolve(targetDir, fileName)\n\n if (existsSync(fullPath)) {\n console.error(colors.red(`File ${fileName} sudah ada!`))\n process.exit(1)\n }\n\n mkdirSync(targetDir, { recursive: true })\n\n const content = `import { s, type Infer } from 'speexjs/schema'\n\nexport const ${schemaName} = s.object({\n id: s.string().uuid(),\n name: s.string().min(1).max(255),\n createdAt: s.string().datetime(),\n updatedAt: s.string().datetime().optional(),\n})\n\nexport type ${typeName} = Infer<typeof ${schemaName}>\n\nexport const create${typeName}Schema = s.object({\n name: s.string().min(1).max(255),\n})\n\nexport type Create${typeName} = Infer<typeof create${typeName}Schema>\n`\n\n writeFileSync(fullPath, content, 'utf-8')\n console.log(\n `${colors.green('✅')} Schema ${colors.bold(schemaName)} dibuat di ${colors.cyan(fileName)}`,\n )\n}\n","import { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\n\ninterface RouteInfo {\n method: string\n path: string\n}\n\nfunction extractDecorators(content: string): RouteInfo[] {\n const pattern = /@(get|post|put|patch|del|delete)\\s*\\(\\s*'([^']+)'\\s*\\)/g\n const results: RouteInfo[] = []\n\n let match: RegExpExecArray | null = pattern.exec(content)\n while (match !== null) {\n const method =\n match[1] === 'del' ? 'DELETE' : (match[1] as string).toUpperCase()\n const path = match[2] as string\n results.push({ method, path })\n match = pattern.exec(content)\n }\n\n return results\n}\n\nexport function listRoutes(): void {\n const routesDir = resolve(process.cwd(), 'src/server/controllers')\n\n if (!existsSync(routesDir)) {\n console.log(\n ` ${colors.yellow('!')} Tidak ada route terdaftar. Buat controller dulu:`,\n )\n console.log(` ${colors.cyan('speexjs make:controller <name>')}`)\n return\n }\n\n const files = readdirSync(routesDir).filter(f => f.endsWith('.ts'))\n\n if (files.length === 0) {\n console.log(\n ` ${colors.yellow('!')} Tidak ada route terdaftar. Buat controller dulu:`,\n )\n console.log(` ${colors.cyan('speexjs make:controller <name>')}`)\n return\n }\n\n let total = 0\n\n console.log()\n console.log(` ${colors.bold('📋 Daftar Route:')}`)\n console.log()\n\n for (const file of files) {\n const content = readFileSync(resolve(routesDir, file), 'utf-8')\n const routes = extractDecorators(content)\n\n if (routes.length > 0) {\n console.log(` ${colors.cyan('──')} ${colors.bold(file.replace('.controller.ts', ''))} ${colors.cyan('──')}`)\n\n for (const { method, path } of routes) {\n const coloredMethod = method === 'GET'\n ? colors.green(method.padEnd(8))\n : method === 'POST'\n ? colors.blue(method.padEnd(8))\n : method === 'PUT' || method === 'PATCH'\n ? colors.yellow(method.padEnd(8))\n : colors.red(method.padEnd(8))\n\n console.log(` ${coloredMethod} ${path}`)\n total++\n }\n\n console.log()\n }\n }\n\n console.log(` ${colors.dim(`${total} route${total !== 1 ? 's' : ''} ditemukan`)}`)\n console.log()\n}\n","import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\nimport { colors } from '../../native/colors.js'\nimport { logger } from '../../native/logger.js'\n\ninterface ServeOptions {\n port?: string | number\n host?: string\n dev?: string | boolean\n}\n\nexport async function serve(options: Record<string, any>): Promise<void> {\n const opts: ServeOptions = {\n port: options.port || options.p || 3000,\n host: options.host || options.H || 'localhost',\n dev: options.dev !== false,\n }\n\n const port = parseInt(String(opts.port), 10)\n const host = String(opts.host)\n\n const serverEntry = resolve(process.cwd(), 'src/app.ts')\n const serverEntryAlt = resolve(process.cwd(), 'src/server/index.ts')\n const serverEntryIndex = resolve(process.cwd(), 'src/index.ts')\n\n let entryPath: string | null = null\n if (existsSync(serverEntry)) entryPath = serverEntry\n else if (existsSync(serverEntryAlt)) entryPath = serverEntryAlt\n else if (existsSync(serverEntryIndex)) entryPath = serverEntryIndex\n\n if (!entryPath) {\n console.error(\n colors.red(\n 'Tidak ditemukan file entry point. Buat src/app.ts atau src/index.ts',\n ),\n )\n process.exit(1)\n }\n\n if (opts.dev) {\n logger.info(\n `Development server starting at ${colors.cyan(`http://${host}:${port}`)}`,\n )\n\n try {\n const { app } = await import(entryPath)\n\n if (!app || typeof app.listen !== 'function') {\n console.error(\n colors.red(\n 'Entry point harus export { app } dengan method .listen()',\n ),\n )\n process.exit(1)\n }\n\n app.listen(port, host, () => {\n console.log()\n console.log(` ${colors.bold('SpeexJS')} ${colors.green('running')}`)\n console.log(` ${colors.dim('→')} ${colors.cyan(`http://${host}:${port}`)}`)\n console.log()\n })\n } catch (err: any) {\n console.error(colors.red(`Gagal menjalankan server: ${err.message}`))\n process.exit(1)\n }\n } else {\n try {\n const { app } = await import(entryPath)\n\n if (!app || typeof app.listen !== 'function') {\n console.error(\n colors.red(\n 'Entry point harus export { app } dengan method .listen()',\n ),\n )\n process.exit(1)\n }\n\n app.listen(port, host, () => {\n console.log()\n console.log(` ${colors.bold('SpeexJS')} ${colors.green('running')}`)\n console.log(` ${colors.dim('→')} ${colors.cyan(`http://${host}:${port}`)}`)\n console.log()\n })\n } catch (err: any) {\n console.error(colors.red(`Gagal menjalankan server: ${err.message}`))\n process.exit(1)\n }\n }\n}\n","import { colors, isColorSupported } from './colors.js'\n\nexport type LogLevel = 'debug' | 'info' | 'warn' | 'error'\n\nexport interface LoggerOptions {\n level?: LogLevel\n name?: string\n colors?: boolean\n timestamps?: boolean\n timezone?: 'WIB' | 'WITA' | 'WIT' | 'UTC'\n}\n\nconst LOG_LEVELS: Record<LogLevel, number> = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n}\n\nconst TIMEZONE_OFFSETS: Record<string, number> = {\n WIB: 7,\n WITA: 8,\n WIT: 9,\n UTC: 0,\n}\n\nfunction pad(n: number): string {\n return n.toString().padStart(2, '0')\n}\n\nexport function formatTimestamp(tz?: string): string {\n const offset = TIMEZONE_OFFSETS[tz ?? ''] ?? 7\n const now = new Date()\n const utc = now.getTime() + now.getTimezoneOffset() * 60000\n const local = new Date(utc + offset * 3600000)\n\n const y = local.getFullYear()\n const M = pad(local.getMonth() + 1)\n const d = pad(local.getDate())\n const h = pad(local.getHours())\n const m = pad(local.getMinutes())\n const s = pad(local.getSeconds())\n\n return `${y}-${M}-${d} ${h}:${m}:${s} ${tz ?? 'WIB'}`\n}\n\nconst LEVEL_PREFIX: Record<LogLevel, string> = {\n debug: 'DEBUG',\n info: 'INFO',\n warn: 'WARN',\n error: 'ERROR',\n}\n\nconst LEVEL_COLOR: Record<LogLevel, (s: string) => string> = {\n debug: colors.gray,\n info: colors.cyan,\n warn: colors.yellow,\n error: colors.red,\n}\n\nexport class Logger {\n private _level: LogLevel\n private _name: string\n private _useColors: boolean\n private _useTimestamps: boolean\n private _timezone: string\n\n constructor(options?: LoggerOptions) {\n this._level = options?.level ?? 'info'\n this._name = options?.name ?? ''\n this._useColors = options?.colors ?? isColorSupported()\n this._useTimestamps = options?.timestamps ?? true\n this._timezone = options?.timezone ?? 'WIB'\n }\n\n private _format(level: LogLevel, msg: string, meta?: Record<string, unknown>): string {\n const parts: string[] = []\n\n if (this._useTimestamps) {\n parts.push(formatTimestamp(this._timezone))\n }\n\n if (this._useColors) {\n parts.push(LEVEL_COLOR[level](LEVEL_PREFIX[level]))\n } else {\n parts.push(LEVEL_PREFIX[level])\n }\n\n if (this._name) {\n parts.push(this._useColors ? colors.dim(`[${this._name}]`) : `[${this._name}]`)\n }\n\n if (this._useColors) {\n parts.push(LEVEL_COLOR[level](msg))\n } else {\n parts.push(msg)\n }\n\n if (meta && Object.keys(meta).length > 0) {\n parts.push(JSON.stringify(meta))\n }\n\n return parts.join(' ')\n }\n\n debug(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.debug) return\n console.debug(this._format('debug', msg, meta))\n }\n\n info(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.info) return\n console.info(this._format('info', msg, meta))\n }\n\n warn(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.warn) return\n console.warn(this._format('warn', msg, meta))\n }\n\n error(msg: string, meta?: Record<string, unknown>): void {\n if (LOG_LEVELS[this._level] > LOG_LEVELS.error) return\n console.error(this._format('error', msg, meta))\n }\n\n child(name: string): Logger {\n const childName = this._name ? `${this._name}:${name}` : name\n return new Logger({\n level: this._level,\n name: childName,\n colors: this._useColors,\n timestamps: this._useTimestamps,\n timezone: this._timezone as LoggerOptions['timezone'],\n })\n }\n\n setLevel(level: LogLevel): void {\n this._level = level\n }\n}\n\nexport const logger = new Logger()\n","#!/usr/bin/env node\nimport { parseArgs } from '../native/args.js'\nimport { colors } from '../native/colors.js'\nimport { initProject } from './commands/init.js'\nimport { makeController } from './commands/make-controller.js'\nimport { makeMiddleware } from './commands/make-middleware.js'\nimport { makeSchema } from './commands/make-schema.js'\nimport { listRoutes } from './commands/list-routes.js'\nimport { serve } from './commands/serve.js'\n\nfunction showHelp(): void {\n console.log(`${colors.bold('SpeexJS')} ${colors.cyan('v0.2.0')}`)\n console.log('Fullstack JavaScript/TypeScript Framework')\n console.log()\n console.log(`${colors.bold('Usage:')}`)\n console.log(' SpeexJS init [name] [options] Buat project baru')\n console.log(' SpeexJS make:controller <name> Generate controller')\n console.log(' SpeexJS make:middleware <name> Generate middleware')\n console.log(' SpeexJS make:schema <name> Generate schema')\n console.log(' SpeexJS list-routes Lihat semua route')\n console.log(' SpeexJS serve [options] Jalankan server')\n console.log(' SpeexJS --help Bantuan ini')\n console.log()\n console.log(`${colors.bold('Aliases:')}`)\n console.log(' SpeexJS -v, --version Lihat versi')\n console.log()\n console.log(`${colors.bold('Options:')}`)\n console.log(' --template <type> blank, fullstack, api-only')\n console.log(' --frontend <fe> super, react, vue')\n console.log(' --port <number> Port server (default: 3000)')\n console.log(' --host <string> Host address (default: localhost)')\n}\n\nasync function main(): Promise<void> {\n const parsed = parseArgs(process.argv)\n const command = parsed.command\n\n switch (command) {\n case 'init': {\n await initProject(parsed.args[0] || 'my-app', parsed.options)\n break\n }\n case 'make:controller': {\n if (!parsed.args[0]) {\n console.error(colors.red('Nama controller diperlukan'))\n console.log(` ${colors.cyan('SpeexJS make:controller <name>')}`)\n process.exit(1)\n }\n await makeController(parsed.args[0])\n break\n }\n case 'make:middleware': {\n if (!parsed.args[0]) {\n console.error(colors.red('Nama middleware diperlukan'))\n console.log(` ${colors.cyan('SpeexJS make:middleware <name>')}`)\n process.exit(1)\n }\n await makeMiddleware(parsed.args[0])\n break\n }\n case 'make:schema': {\n if (!parsed.args[0]) {\n console.error(colors.red('Nama schema diperlukan'))\n console.log(` ${colors.cyan('SpeexJS make:schema <name>')}`)\n process.exit(1)\n }\n await makeSchema(parsed.args[0])\n break\n }\n case 'list-routes':\n case 'routes':\n case 'lr': {\n await listRoutes()\n break\n }\n case 'serve':\n case 'dev': {\n await serve(parsed.options)\n break\n }\n case 'help':\n case '--help':\n case '-h': {\n showHelp()\n break\n }\n case 'version':\n case '--version':\n case '-v': {\n console.log('SpeexJS v0.2.0')\n break\n }\n default: {\n if (command) {\n console.error(`${colors.red(`Command '${command}' tidak dikenal`)}`)\n console.log()\n }\n showHelp()\n if (command) process.exit(1)\n }\n }\n}\n\nmain().catch(err => {\n console.error(colors.red(`Error: ${err.message}`))\n process.exit(1)\n})\n"],"mappings":";;;AAOO,SAAS,UAAU,MAA4B;AACpD,QAAM,OAAO,KAAK,MAAM,CAAC;AACzB,QAAM,SAAqB;AAAA,IACzB,SAAS;AAAA,IACT,MAAM,CAAC;AAAA,IACP,SAAS,CAAC;AAAA,EACZ;AAEA,MAAI,KAAK,WAAW,EAAG,QAAO;AAE9B,QAAM,QAAQ,KAAK,CAAC;AAEpB,MAAI,MAAM,SAAS,GAAG,GAAG;AACvB,WAAO,UAAU;AACjB,iBAAa,KAAK,MAAM,CAAC,GAAG,MAAM;AAClC,WAAO;AAAA,EACT;AAEA,SAAO,UAAU;AAEjB,MAAI,KAAK,SAAS,GAAG;AACnB,UAAM,SAAS,KAAK,CAAC;AACrB,QAAI,CAAC,OAAO,WAAW,GAAG,GAAG;AAC3B,aAAO,aAAa;AACpB,aAAO,KAAK,KAAK,MAAM;AACvB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AAG,OAAO,IAAI,YAAY,OAAO,iBAAiB,CAAC,EAAE;AACnE,gBAAQ,IAAI;AAAA,MACd;AACA,eAAS;AACT,UAAI,QAAS,SAAQ,KAAK,CAAC;AAAA,IAC7B;AAAA,EACF;AACF;AAEA,KAAK,EAAE,MAAM,SAAO;AAClB,UAAQ,MAAM,OAAO,IAAI,UAAU,IAAI,OAAO,EAAE,CAAC;AACjD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["existsSync","mkdirSync","writeFileSync","resolve","toPascalCase","resolve","existsSync","mkdirSync","writeFileSync","existsSync","mkdirSync","writeFileSync","resolve","toPascalCase","toKebabCase","toCamelCase","resolve","existsSync","mkdirSync","writeFileSync","existsSync","mkdirSync","writeFileSync","resolve","toPascalCase","toKebabCase","resolve","existsSync","mkdirSync","writeFileSync","existsSync","resolve","resolve","existsSync","existsSync","resolve","resolve","existsSync"]}
@@ -713,7 +713,7 @@ var ServerRenderer = class {
713
713
  }
714
714
  };
715
715
  function generateHydrationScript() {
716
- return '<script>(function(){var d=document.createElement("div");d.setAttribute("data-speedx-hydrated","");document.body.appendChild(d)})();</script>';
716
+ return '<script>(function(){var d=document.createElement("div");d.setAttribute("data-speexjs-hydrated","");document.body.appendChild(d)})();</script>';
717
717
  }
718
718
 
719
719
  // src/client/adapters/index.ts