@forinda/kickjs-cli 1.2.2 → 1.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/index.js CHANGED
@@ -2189,6 +2189,7 @@ export default defineConfig({
2189
2189
  },
2190
2190
  })
2191
2191
  `);
2192
+ await writeFileSafe(join9(dir, "README.md"), generateReadme(name, template, packageManager));
2192
2193
  if (options.initGit) {
2193
2194
  try {
2194
2195
  execSync("git init", {
@@ -2346,6 +2347,91 @@ bootstrap({
2346
2347
  }
2347
2348
  }
2348
2349
  __name(getEntryFile, "getEntryFile");
2350
+ function generateReadme(name, template, pm) {
2351
+ const templateLabels = {
2352
+ rest: "REST API",
2353
+ graphql: "GraphQL API",
2354
+ ddd: "Domain-Driven Design",
2355
+ cqrs: "CQRS + Event-Driven",
2356
+ minimal: "Minimal"
2357
+ };
2358
+ const packages = [
2359
+ "@forinda/kickjs-core",
2360
+ "@forinda/kickjs-http",
2361
+ "@forinda/kickjs-config"
2362
+ ];
2363
+ if (template !== "minimal") {
2364
+ packages.push("@forinda/kickjs-swagger", "@forinda/kickjs-devtools");
2365
+ }
2366
+ if (template === "graphql") packages.push("@forinda/kickjs-graphql");
2367
+ if (template === "cqrs") {
2368
+ packages.push("@forinda/kickjs-queue", "@forinda/kickjs-ws", "@forinda/kickjs-otel");
2369
+ }
2370
+ return `# ${name}
2371
+
2372
+ A **${templateLabels[template] ?? "REST API"}** built with [KickJS](https://forinda.github.io/kick-js/) \u2014 a decorator-driven Node.js framework on Express 5 and TypeScript.
2373
+
2374
+ ## Getting Started
2375
+
2376
+ \`\`\`bash
2377
+ ${pm} install
2378
+ kick dev
2379
+ \`\`\`
2380
+
2381
+ ## Scripts
2382
+
2383
+ | Command | Description |
2384
+ |---|---|
2385
+ | \`kick dev\` | Start dev server with Vite HMR |
2386
+ | \`kick build\` | Production build |
2387
+ | \`kick start\` | Run production build |
2388
+ | \`${pm} run test\` | Run tests with Vitest |
2389
+ | \`kick g module <name>\` | Generate a DDD module |
2390
+ | \`kick g scaffold <name> <fields...>\` | Generate CRUD from field definitions |
2391
+ | \`kick add <package>\` | Add a KickJS package |
2392
+
2393
+ ## Project Structure
2394
+
2395
+ \`\`\`
2396
+ src/
2397
+ \u251C\u2500\u2500 index.ts # Application entry point
2398
+ \u251C\u2500\u2500 modules/ # Feature modules (controllers, services, repos)
2399
+ \u2502 \u2514\u2500\u2500 index.ts # Module registry
2400
+ \u2514\u2500\u2500 ...
2401
+ \`\`\`
2402
+
2403
+ ## Packages
2404
+
2405
+ ${packages.map((p) => `- \`${p}\``).join("\n")}
2406
+
2407
+ ## Adding Features
2408
+
2409
+ \`\`\`bash
2410
+ kick add auth # Authentication (JWT, API key, OAuth)
2411
+ kick add swagger # OpenAPI documentation
2412
+ kick add ws # WebSocket support
2413
+ kick add queue # Background job processing
2414
+ kick add mailer # Email sending
2415
+ kick add cron # Scheduled tasks
2416
+ kick add --list # Show all available packages
2417
+ \`\`\`
2418
+
2419
+ ## Environment Variables
2420
+
2421
+ Copy \`.env.example\` to \`.env\` and configure:
2422
+
2423
+ | Variable | Default | Description |
2424
+ |---|---|---|
2425
+ | \`PORT\` | \`3000\` | Server port |
2426
+ | \`NODE_ENV\` | \`development\` | Environment |
2427
+
2428
+ ## Learn More
2429
+
2430
+ - [KickJS Documentation](https://forinda.github.io/kick-js/)
2431
+ - [CLI Reference](https://forinda.github.io/kick-js/api/cli.html)
2432
+ `;
2433
+ }
2434
+ __name(generateReadme, "generateReadme");
2349
2435
 
2350
2436
  // src/config.ts
2351
2437
  import { readFile as readFile3, access as access2 } from "fs/promises";