@forinda/kickjs-cli 6.9.1 → 6.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/{agent-docs-B91ALPZR.mjs → agent-docs-BnGa_odb.mjs} +2 -2
  2. package/dist/{agent-docs-DvLtd3g5.mjs → agent-docs-CLs1wTpl.mjs} +3 -3
  3. package/dist/{agent-docs-DvLtd3g5.mjs.map → agent-docs-CLs1wTpl.mjs.map} +1 -1
  4. package/dist/{build-Dghtk24W.mjs → build-BQUDhMVD.mjs} +3 -3
  5. package/dist/{build-Dghtk24W.mjs.map → build-BQUDhMVD.mjs.map} +1 -1
  6. package/dist/{build-D-7xvnpW.mjs → build-BX7-8d5h.mjs} +2 -2
  7. package/dist/{builtins-CPF14ODX.mjs → builtins-DWngUnQ8.mjs} +2 -2
  8. package/dist/{builtins-BjcrVIsO.mjs → builtins-DfzsCxQu.mjs} +202 -131
  9. package/dist/cli.mjs +2 -2
  10. package/dist/{config-DzcY7KDb.mjs → config-DHHqXYVF.mjs} +2 -2
  11. package/dist/{config-CFAZrUmi.mjs → config-DYS_-oZ_.mjs} +3 -3
  12. package/dist/{config-CFAZrUmi.mjs.map → config-DYS_-oZ_.mjs.map} +1 -1
  13. package/dist/{doctor-BRs6lrbi.mjs → doctor-CC8eWifc.mjs} +88 -17
  14. package/dist/doctor-CC8eWifc.mjs.map +1 -0
  15. package/dist/{fullstack-BlETTj51.mjs → fullstack-1y-ENahw.mjs} +12 -12
  16. package/dist/{fullstack-3TAOhXfk.mjs → fullstack-BWopEQFU.mjs} +13 -13
  17. package/dist/fullstack-BWopEQFU.mjs.map +1 -0
  18. package/dist/index.d.mts.map +1 -1
  19. package/dist/index.mjs +2 -2
  20. package/dist/{plugin-DSCSpumh.mjs → plugin-CrbgblqR.mjs} +2 -2
  21. package/dist/{plugin-qwSg0kwT.mjs → plugin-Dgdp1o7e.mjs} +3 -3
  22. package/dist/{plugin-qwSg0kwT.mjs.map → plugin-Dgdp1o7e.mjs.map} +1 -1
  23. package/dist/{project-BD_l6pkS.mjs → project-BFhosVpo.mjs} +20 -20
  24. package/dist/{project-BSSB5kBG.mjs → project-DPQJNbUr.mjs} +21 -21
  25. package/dist/project-DPQJNbUr.mjs.map +1 -0
  26. package/dist/{project-docs-Dlq_ipnh.mjs → project-docs-BEnHASsn.mjs} +3 -3
  27. package/dist/{project-docs-Dlq_ipnh.mjs.map → project-docs-BEnHASsn.mjs.map} +1 -1
  28. package/dist/{project-docs-DG-aI5f_.mjs → project-docs-BlYdtsfz.mjs} +2 -2
  29. package/dist/{project-root-BNYhLr1o.mjs → project-root-74p4iEbS.mjs} +3 -3
  30. package/dist/{project-root-BNYhLr1o.mjs.map → project-root-74p4iEbS.mjs.map} +1 -1
  31. package/dist/{project-root-Dv1HfN0o.mjs → project-root-CSfkrbTB.mjs} +2 -2
  32. package/dist/{prompts-D82t3FiY.mjs → prompts-kKPsD4J5.mjs} +2 -2
  33. package/dist/{prompts-D82t3FiY.mjs.map → prompts-kKPsD4J5.mjs.map} +1 -1
  34. package/dist/{rolldown-runtime-DnEcvn06.mjs → rolldown-runtime-Wu10E8Jp.mjs} +1 -1
  35. package/dist/{run-plugins-B49z_ywO.mjs → run-plugins-BPLz855M.mjs} +46 -46
  36. package/dist/run-plugins-BPLz855M.mjs.map +1 -0
  37. package/dist/{typegen-BZKiGXjW.mjs → typegen-ByZnBYdj.mjs} +4 -4
  38. package/dist/{typegen-CdS37QWi.mjs → typegen-ngGYyfaY.mjs} +5 -5
  39. package/dist/{typegen-CdS37QWi.mjs.map → typegen-ngGYyfaY.mjs.map} +1 -1
  40. package/dist/{types-Dfg3zods.mjs → types-BYbOAJ_d.mjs} +1 -1
  41. package/package.json +3 -3
  42. package/dist/doctor-BRs6lrbi.mjs.map +0 -1
  43. package/dist/fullstack-3TAOhXfk.mjs.map +0 -1
  44. package/dist/project-BSSB5kBG.mjs.map +0 -1
  45. package/dist/run-plugins-B49z_ywO.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v6.9.1
2
+ * @forinda/kickjs-cli v6.10.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,11 +8,11 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{l as e}from"./project-docs-Dlq_ipnh.mjs";import{n as t,t as n}from"./project-BSSB5kBG.mjs";import{join as r}from"node:path";import{execFileSync as i}from"node:child_process";async function a(a){let{name:_,directory:v,schemaLib:y=`zod`,runtime:b=`express`}=a,x=[`pnpm`,`npm`,`yarn`,`bun`].includes(a.packageManager),S=x?a.packageManager:`pnpm`,C=v,w=e=>console.log(` ${e}`);a.packageManager!==void 0&&!x&&w(`Warning: unknown package manager '${String(a.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${_}\n`),await n({name:`${_}-server`,directory:r(C,`server`),packageManager:S,template:`minimal`,schemaLib:y,runtime:b,initGit:!1,installDeps:!1});let T=(await t())[`@forinda/kickjs-client`]??`^0.1.0`;await e(r(C,`web/package.json`),o(_,T)),await e(r(C,`web/vite.config.ts`),s()),await e(r(C,`web/tsconfig.json`),c()),await e(r(C,`web/index.html`),l(_)),await e(r(C,`web/src/main.tsx`),u()),await e(r(C,`web/src/App.tsx`),d()),await e(r(C,`web/src/api.ts`),f()),await e(r(C,`web/src/types/kick-routes.d.ts`),p()),await e(r(C,`package.json`),m(_,S)),await e(r(C,`pnpm-workspace.yaml`),`packages:
11
+ import{l as e}from"./project-docs-BEnHASsn.mjs";import{l as t,n,t as r}from"./project-DPQJNbUr.mjs";import{join as i}from"node:path";import{execFileSync as a}from"node:child_process";async function o(o){let{name:v,directory:y,schemaLib:b=`zod`,runtime:x=`express`}=o,S=[`pnpm`,`npm`,`yarn`,`bun`].includes(o.packageManager),C=S?o.packageManager:`pnpm`,w=y,T=e=>console.log(` ${e}`);o.packageManager!==void 0&&!S&&T(`Warning: unknown package manager '${String(o.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${v}\n`),await r({name:`${v}-server`,directory:i(w,`server`),packageManager:C,template:`minimal`,schemaLib:b,runtime:x,initGit:!1,installDeps:!1});let E=(await n())[`@forinda/kickjs-client`]??`^0.1.0`;await e(i(w,`web/package.json`),s(v,E)),await e(i(w,`web/vite.config.ts`),c()),await e(i(w,`web/tsconfig.json`),l()),await e(i(w,`web/index.html`),u(v)),await e(i(w,`web/src/main.tsx`),d()),await e(i(w,`web/src/App.tsx`),f()),await e(i(w,`web/src/api.ts`),p()),await e(i(w,`web/src/types/kick-routes.d.ts`),m()),await e(i(w,`package.json`),h(v,C)),await e(i(w,`pnpm-workspace.yaml`),`packages:
12
12
  - server
13
13
  - web
14
- `),await e(r(C,`.gitignore`),h()),await e(r(C,`README.md`),g(_,S));let{generateAgentDocs:E}=await import(`./agent-docs-DvLtd3g5.mjs`).then(e=>e.t);if(await E({outDir:C,name:_,pm:S,template:`fullstack`,only:`all`,force:!0}),a.installDeps){console.log(`\n Installing workspace dependencies with ${S}...\n`);try{i(S,[`install`],{cwd:C,stdio:`inherit`})}catch{console.log(`\n Warning: ${S} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-CdS37QWi.mjs`).then(e=>e.n);await e({cwd:r(C,`server`),allowDuplicates:!0,silent:!0})}catch{}if(a.initGit)try{i(`git`,[`init`],{cwd:C,stdio:`pipe`}),i(`git`,[`branch`,`-M`,`main`],{cwd:C,stdio:`pipe`}),i(`git`,[`add`,`-A`],{cwd:C,stdio:`pipe`}),i(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:C,stdio:`pipe`}),w(`Git repository initialized`)}catch{w(`Warning: git init failed (git may not be installed)`)}console.log(`
15
- Fullstack workspace scaffolded!`),console.log(),w(`Next steps:`),w(` cd ${_}`),a.installDeps||w(` ${S} install`),S===`pnpm`?w(` pnpm dev # runs server (kick dev) + web (vite) together`):(w(` ${S} run dev:server # terminal 1`),w(` ${S} run dev:web # terminal 2`)),w(``),w(`The web app calls the API through @forinda/kickjs-client —`),w(`edit server/src/modules/hello and watch web/src/App.tsx's types follow.`),w(``)}function o(e,t){return`${JSON.stringify({name:`${e}-web`,private:!0,version:`0.0.0`,type:`module`,scripts:{dev:`vite`,build:`tsc --noEmit && vite build`,preview:`vite preview`,typecheck:`tsc --noEmit`},dependencies:{"@forinda/kickjs-client":t,react:`^19.0.0`,"react-dom":`^19.0.0`},devDependencies:{"@types/react":`^19.0.0`,"@types/react-dom":`^19.0.0`,"@vitejs/plugin-react":`^5.0.0`,typescript:`^5.9.0`,vite:`^7.0.0`}},null,2)}\n`}function s(){return`import { defineConfig } from 'vite'
14
+ `),await e(i(w,`.gitignore`),g()),await e(i(w,`README.md`),_(v,C));let{generateAgentDocs:D}=await import(`./agent-docs-CLs1wTpl.mjs`).then(e=>e.t);if(await D({outDir:w,name:v,pm:C,template:`fullstack`,only:`all`,force:!0}),o.installDeps){console.log(`\n Installing workspace dependencies with ${C}...\n`);try{t(C,[`install`],{cwd:w})}catch{console.log(`\n Warning: ${C} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-ngGYyfaY.mjs`).then(e=>e.n);await e({cwd:i(w,`server`),allowDuplicates:!0,silent:!0})}catch{}if(o.initGit)try{a(`git`,[`init`],{cwd:w,stdio:`pipe`}),a(`git`,[`branch`,`-M`,`main`],{cwd:w,stdio:`pipe`}),a(`git`,[`add`,`-A`],{cwd:w,stdio:`pipe`}),a(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:w,stdio:`pipe`}),T(`Git repository initialized`)}catch{T(`Warning: git init failed (git may not be installed)`)}console.log(`
15
+ Fullstack workspace scaffolded!`),console.log(),T(`Next steps:`),T(` cd ${v}`),o.installDeps||T(` ${C} install`),C===`pnpm`?T(` pnpm dev # runs server (kick dev) + web (vite) together`):(T(` ${C} run dev:server # terminal 1`),T(` ${C} run dev:web # terminal 2`)),T(``),T(`The web app calls the API through @forinda/kickjs-client —`),T(`edit server/src/modules/hello and watch web/src/App.tsx's types follow.`),T(``)}function s(e,t){return`${JSON.stringify({name:`${e}-web`,private:!0,version:`0.0.0`,type:`module`,scripts:{dev:`vite`,build:`tsc --noEmit && vite build`,preview:`vite preview`,typecheck:`tsc --noEmit`},dependencies:{"@forinda/kickjs-client":t,react:`^19.0.0`,"react-dom":`^19.0.0`},devDependencies:{"@types/react":`^19.0.0`,"@types/react-dom":`^19.0.0`,"@vitejs/plugin-react":`^5.0.0`,typescript:`^5.9.0`,vite:`^7.0.0`}},null,2)}\n`}function c(){return`import { defineConfig } from 'vite'
16
16
  import react from '@vitejs/plugin-react'
17
17
 
18
18
  export default defineConfig({
@@ -25,7 +25,7 @@ export default defineConfig({
25
25
  },
26
26
  },
27
27
  })
28
- `}function c(){return`${JSON.stringify({compilerOptions:{target:`ES2022`,lib:[`ES2022`,`DOM`,`DOM.Iterable`],module:`ESNext`,moduleResolution:`bundler`,jsx:`react-jsx`,strict:!0,skipLibCheck:!0,noEmit:!0,isolatedModules:!0,experimentalDecorators:!0,types:[]},include:[`src`]},null,2)}\n`}function l(e){return`<!doctype html>
28
+ `}function l(){return`${JSON.stringify({compilerOptions:{target:`ES2022`,lib:[`ES2022`,`DOM`,`DOM.Iterable`],module:`ESNext`,moduleResolution:`bundler`,jsx:`react-jsx`,strict:!0,skipLibCheck:!0,noEmit:!0,isolatedModules:!0,experimentalDecorators:!0,types:[]},include:[`src`]},null,2)}\n`}function u(e){return`<!doctype html>
29
29
  <html lang="en">
30
30
  <head>
31
31
  <meta charset="UTF-8" />
@@ -37,7 +37,7 @@ export default defineConfig({
37
37
  <script type="module" src="/src/main.tsx"><\/script>
38
38
  </body>
39
39
  </html>
40
- `}function u(){return`import { StrictMode } from 'react'
40
+ `}function d(){return`import { StrictMode } from 'react'
41
41
  import { createRoot } from 'react-dom/client'
42
42
  import { App } from './App'
43
43
 
@@ -46,7 +46,7 @@ createRoot(document.getElementById('root')!).render(
46
46
  <App />
47
47
  </StrictMode>,
48
48
  )
49
- `}function d(){return`import { useEffect, useState } from 'react'
49
+ `}function f(){return`import { useEffect, useState } from 'react'
50
50
  import { api } from './api'
51
51
 
52
52
  // The response types below are INFERRED from the server's handlers —
@@ -88,23 +88,23 @@ export function App() {
88
88
  </main>
89
89
  )
90
90
  }
91
- `}function f(){return`import { createClient } from '@forinda/kickjs-client'
91
+ `}function p(){return`import { createClient } from '@forinda/kickjs-client'
92
92
 
93
93
  // KickApi (alias of KickRoutes.Api) is ambient — populated by server/.kickjs/types (see
94
94
  // src/types/kick-routes.d.ts). Keys are module-mount-relative paths;
95
95
  // the bootstrap-level '/api/v1' prefix lives here in baseUrl, and the
96
96
  // Vite dev proxy forwards it to the KickJS server.
97
97
  export const api = createClient<KickApi>({ baseUrl: '/api/v1' })
98
- `}function p(){return`// Type-only bridge to the server's generated route types. The import is
98
+ `}function m(){return`// Type-only bridge to the server's generated route types. The import is
99
99
  // erased at build time — no server code ever enters the web bundle.
100
100
  // Regenerate with \`kick typegen\` in server/ (automatic under \`kick dev\`).
101
101
  import '../../../server/.kickjs/types/kick__routes'
102
- `}function m(e,t){let n=t===`pnpm`?{dev:`pnpm --parallel -r run dev`,"dev:server":`pnpm --filter ./server dev`,"dev:web":`pnpm --filter ./web dev`,build:`pnpm -r run build`,typecheck:`pnpm -r run typecheck`}:{"dev:server":`cd server && ${t} run dev`,"dev:web":`cd web && ${t} run dev`,build:`${t} run build:server && ${t} run build:web`,"build:server":`cd server && ${t} run build`,"build:web":`cd web && ${t} run build`,typecheck:`cd web && ${t} run typecheck`};return`${JSON.stringify({name:e,private:!0,version:`0.0.0`,type:`module`,scripts:n,workspaces:[`server`,`web`]},null,2)}\n`}function h(){return`node_modules/
102
+ `}function h(e,t){let n=t===`pnpm`?{dev:`pnpm --parallel -r run dev`,"dev:server":`pnpm --filter ./server dev`,"dev:web":`pnpm --filter ./web dev`,build:`pnpm -r run build`,typecheck:`pnpm -r run typecheck`}:{"dev:server":`cd server && ${t} run dev`,"dev:web":`cd web && ${t} run dev`,build:`${t} run build:server && ${t} run build:web`,"build:server":`cd server && ${t} run build`,"build:web":`cd web && ${t} run build`,typecheck:`cd web && ${t} run typecheck`};return`${JSON.stringify({name:e,private:!0,version:`0.0.0`,type:`module`,scripts:n,workspaces:[`server`,`web`]},null,2)}\n`}function g(){return`node_modules/
103
103
  dist/
104
104
  .env
105
105
  *.log
106
106
  .DS_Store
107
- `}function g(e,t){return`# ${e}
107
+ `}function _(e,t){return`# ${e}
108
108
 
109
109
  Fullstack KickJS workspace — typed end to end.
110
110
 
@@ -134,5 +134,5 @@ Rename a field in \`server/src/modules/hello/hello.service.ts\` → \`web/src/Ap
134
134
  stops compiling. That's the point.
135
135
 
136
136
  Docs: https://kickjs.app/guide/typed-client.html
137
- `}export{a as initFullstackProject};
138
- //# sourceMappingURL=fullstack-3TAOhXfk.mjs.map
137
+ `}export{o as initFullstackProject};
138
+ //# sourceMappingURL=fullstack-BWopEQFU.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullstack-BWopEQFU.mjs","names":[],"sources":["../src/generators/fullstack.ts"],"sourcesContent":["// `kick new --template fullstack` — a pnpm-workspace monorepo:\n//\n// my-app/\n// server/ KickJS API (the standard scaffold, minus its own git/install)\n// web/ Vite + React frontend typed end-to-end via\n// @forinda/kickjs-client + the server's generated KickRoutes.Api\n//\n// The type loop: server controllers use return-value handlers → `kick\n// typegen` (run here once, re-run by `kick dev`) emits\n// server/.kickjs/types/kick__routes.ts → web/src/types/kick-routes.d.ts\n// side-effect-imports that file (type-only, erased at runtime) → the web\n// client calls `api.get('/hello')` with the handler's actual response type.\n\nimport { join } from 'node:path'\nimport { execFileSync } from 'node:child_process'\n\nimport { writeFileSafe } from '../utils/fs'\nimport { runCommand } from '../utils/shell'\nimport { initProject, resolveSiblingVersions } from './project'\n\nexport interface InitFullstackOptions {\n name: string\n directory: string\n packageManager?: 'pnpm' | 'npm' | 'yarn' | 'bun'\n initGit?: boolean\n installDeps?: boolean\n schemaLib?: 'zod' | 'valibot' | 'yup'\n runtime?: 'express' | 'fastify' | 'h3'\n}\n\nexport async function initFullstackProject(options: InitFullstackOptions): Promise<void> {\n const { name, directory, schemaLib = 'zod', runtime = 'express' } = options\n // `--pm` arrives as a free CLI string — allowlist before it reaches a\n // process invocation (execFileSync takes an argv array, no shell, but a\n // bogus binary name is still a confusing failure).\n const pmValid = (['pnpm', 'npm', 'yarn', 'bun'] as const).includes(\n options.packageManager as never,\n )\n const packageManager = pmValid\n ? (options.packageManager as 'pnpm' | 'npm' | 'yarn' | 'bun')\n : 'pnpm'\n const dir = directory\n const log = (msg: string) => console.log(` ${msg}`)\n if (options.packageManager !== undefined && !pmValid) {\n log(\n `Warning: unknown package manager '${String(options.packageManager)}' — falling back to pnpm.`,\n )\n }\n\n console.log(`\\n Creating fullstack KickJS workspace: ${name}\\n`)\n\n // ── server/ — the standard scaffold, deferred install/git ──────────\n await initProject({\n name: `${name}-server`,\n directory: join(dir, 'server'),\n packageManager,\n template: 'minimal',\n schemaLib,\n runtime,\n // Root owns install + git so the lockfile/commit cover the workspace.\n initGit: false,\n installDeps: false,\n })\n\n // ── web/ — Vite + React, typed client ──────────────────────────────\n const versions = await resolveSiblingVersions()\n const clientVersion = versions['@forinda/kickjs-client'] ?? '^0.1.0'\n\n await writeFileSafe(join(dir, 'web/package.json'), webPackageJson(name, clientVersion))\n await writeFileSafe(join(dir, 'web/vite.config.ts'), webViteConfig())\n await writeFileSafe(join(dir, 'web/tsconfig.json'), webTsConfig())\n await writeFileSafe(join(dir, 'web/index.html'), webIndexHtml(name))\n await writeFileSafe(join(dir, 'web/src/main.tsx'), webMain())\n await writeFileSafe(join(dir, 'web/src/App.tsx'), webApp())\n await writeFileSafe(join(dir, 'web/src/api.ts'), webApi())\n await writeFileSafe(join(dir, 'web/src/types/kick-routes.d.ts'), webRouteTypes())\n\n // ── workspace root ──────────────────────────────────────────────────\n await writeFileSafe(join(dir, 'package.json'), rootPackageJson(name, packageManager))\n await writeFileSafe(join(dir, 'pnpm-workspace.yaml'), `packages:\\n - server\\n - web\\n`)\n await writeFileSafe(join(dir, '.gitignore'), rootGitignore())\n await writeFileSafe(join(dir, 'README.md'), rootReadme(name, packageManager))\n\n // Workspace-root agent docs (CLAUDE.md + .agents/) flavored for the\n // fullstack layout — the server/ subdir keeps its own generated set.\n const { generateAgentDocs } = await import('./agent-docs')\n await generateAgentDocs({\n outDir: dir,\n name,\n pm: packageManager,\n template: 'fullstack',\n only: 'all',\n force: true,\n })\n\n // ── install (root — covers both workspace packages) ────────────────\n if (options.installDeps) {\n console.log(`\\n Installing workspace dependencies with ${packageManager}...\\n`)\n try {\n // `runCommand`, not bare execFileSync — on Windows every package\n // manager is a `.cmd` shim that execFileSync cannot spawn.\n runCommand(packageManager, ['install'], { cwd: dir })\n } catch {\n console.log(`\\n Warning: ${packageManager} install failed. Run it manually.`)\n }\n }\n\n // ── typegen (server) so web's KickRoutes.Api resolves immediately ──\n try {\n const { runTypegen } = await import('../typegen')\n await runTypegen({ cwd: join(dir, 'server'), allowDuplicates: true, silent: true })\n } catch {\n // Non-fatal — `kick dev` in server/ retries on boot.\n }\n\n // ── git (root) ──────────────────────────────────────────────────────\n if (options.initGit) {\n try {\n execFileSync('git', ['init'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['branch', '-M', 'main'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['add', '-A'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['commit', '-m', 'chore: initial commit from kick new (fullstack)'], {\n cwd: dir,\n stdio: 'pipe',\n })\n log('Git repository initialized')\n } catch {\n log('Warning: git init failed (git may not be installed)')\n }\n }\n\n console.log('\\n Fullstack workspace scaffolded!')\n console.log()\n log('Next steps:')\n log(` cd ${name}`)\n if (!options.installDeps) log(` ${packageManager} install`)\n if (packageManager === 'pnpm') {\n log(' pnpm dev # runs server (kick dev) + web (vite) together')\n } else {\n log(` ${packageManager} run dev:server # terminal 1`)\n log(` ${packageManager} run dev:web # terminal 2`)\n }\n log('')\n log('The web app calls the API through @forinda/kickjs-client —')\n log(\"edit server/src/modules/hello and watch web/src/App.tsx's types follow.\")\n log('')\n}\n\n// ── web templates ─────────────────────────────────────────────────────\n\nfunction webPackageJson(name: string, clientVersion: string): string {\n return `${JSON.stringify(\n {\n name: `${name}-web`,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts: {\n dev: 'vite',\n build: 'tsc --noEmit && vite build',\n preview: 'vite preview',\n typecheck: 'tsc --noEmit',\n },\n dependencies: {\n '@forinda/kickjs-client': clientVersion,\n react: '^19.0.0',\n 'react-dom': '^19.0.0',\n },\n devDependencies: {\n '@types/react': '^19.0.0',\n '@types/react-dom': '^19.0.0',\n '@vitejs/plugin-react': '^5.0.0',\n typescript: '^5.9.0',\n vite: '^7.0.0',\n },\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction webViteConfig(): string {\n return `import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\nexport default defineConfig({\n plugins: [react()],\n server: {\n // The KickJS server (kick dev) listens on 3000; the client's baseUrl is\n // the relative '/api/v1', so the browser hits Vite and Vite forwards.\n proxy: {\n '/api': 'http://localhost:3000',\n },\n },\n})\n`\n}\n\nfunction webTsConfig(): string {\n return `${JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n lib: ['ES2022', 'DOM', 'DOM.Iterable'],\n module: 'ESNext',\n moduleResolution: 'bundler',\n jsx: 'react-jsx',\n strict: true,\n skipLibCheck: true,\n noEmit: true,\n isolatedModules: true,\n // The type bridge pulls server controller sources into this\n // program — they use legacy TS decorators.\n experimentalDecorators: true,\n // The KickRoutes ambient types come from the server's generated\n // typegen output via src/types/kick-routes.d.ts.\n types: [],\n },\n include: ['src'],\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction webIndexHtml(name: string): string {\n return `<!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>${name}</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n`\n}\n\nfunction webMain(): string {\n return `import { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { App } from './App'\n\ncreateRoot(document.getElementById('root')!).render(\n <StrictMode>\n <App />\n </StrictMode>,\n)\n`\n}\n\nfunction webApp(): string {\n return `import { useEffect, useState } from 'react'\nimport { api } from './api'\n\n// The response types below are INFERRED from the server's handlers —\n// change server/src/modules/hello/hello.service.ts and these types follow\n// on the next \\`kick typegen\\` (automatic under \\`kick dev\\`).\ntype Greeting = Awaited<ReturnType<typeof fetchGreeting>>\n\nfunction fetchGreeting() {\n return api.get('/hello')\n}\n\nexport function App() {\n const [greeting, setGreeting] = useState<Greeting | null>(null)\n const [health, setHealth] = useState<string>('checking…')\n\n useEffect(() => {\n fetchGreeting().then(setGreeting).catch(console.error)\n api\n .get('/hello/health')\n .then((h) => setHealth(h.status))\n .catch(() => setHealth('down'))\n }, [])\n\n return (\n <main style={{ fontFamily: 'system-ui', maxWidth: 640, margin: '4rem auto', padding: '0 1rem' }}>\n <h1>KickJS fullstack</h1>\n <p>\n <strong>{greeting?.message ?? 'loading…'}</strong>\n </p>\n <p>\n Server said hello at <code>{greeting?.timestamp ?? '…'}</code> — health:{' '}\n <code>{health}</code>\n </p>\n <p style={{ color: '#666' }}>\n This call is typed end to end: <code>api.get('/hello')</code> returns the exact shape\n <code> HelloService.greet()</code> produces. Rename a field on the server and this file\n stops compiling.\n </p>\n </main>\n )\n}\n`\n}\n\nfunction webApi(): string {\n return `import { createClient } from '@forinda/kickjs-client'\n\n// KickApi (alias of KickRoutes.Api) is ambient — populated by server/.kickjs/types (see\n// src/types/kick-routes.d.ts). Keys are module-mount-relative paths;\n// the bootstrap-level '/api/v1' prefix lives here in baseUrl, and the\n// Vite dev proxy forwards it to the KickJS server.\nexport const api = createClient<KickApi>({ baseUrl: '/api/v1' })\n`\n}\n\nfunction webRouteTypes(): string {\n return `// Type-only bridge to the server's generated route types. The import is\n// erased at build time — no server code ever enters the web bundle.\n// Regenerate with \\`kick typegen\\` in server/ (automatic under \\`kick dev\\`).\nimport '../../../server/.kickjs/types/kick__routes'\n`\n}\n\n// ── root templates ────────────────────────────────────────────────────\n\nfunction rootPackageJson(name: string, pm: string): string {\n const scripts: Record<string, string> =\n pm === 'pnpm'\n ? {\n dev: 'pnpm --parallel -r run dev',\n 'dev:server': 'pnpm --filter ./server dev',\n 'dev:web': 'pnpm --filter ./web dev',\n build: 'pnpm -r run build',\n typecheck: 'pnpm -r run typecheck',\n }\n : {\n // cd-based scripts — the one form npm, yarn (classic AND berry),\n // and bun all run identically; workspace-filter flags differ per\n // manager (--workspace vs `yarn workspace <name>` vs --filter).\n 'dev:server': `cd server && ${pm} run dev`,\n 'dev:web': `cd web && ${pm} run dev`,\n build: `${pm} run build:server && ${pm} run build:web`,\n 'build:server': `cd server && ${pm} run build`,\n 'build:web': `cd web && ${pm} run build`,\n typecheck: `cd web && ${pm} run typecheck`,\n }\n return `${JSON.stringify(\n {\n name,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts,\n workspaces: ['server', 'web'],\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction rootGitignore(): string {\n return `node_modules/\ndist/\n.env\n*.log\n.DS_Store\n`\n}\n\nfunction rootReadme(name: string, pm: string): string {\n return `# ${name}\n\nFullstack KickJS workspace — typed end to end.\n\n| Package | What |\n| --------- | ----------------------------------------------------------------- |\n| \\`server/\\` | KickJS API (decorators, DI, \\`kick dev\\` with typegen watch) |\n| \\`web/\\` | Vite + React, typed against the API via \\`@forinda/kickjs-client\\` |\n\n## Develop\n\n\\`\\`\\`bash\n${pm} install\n${pm === 'pnpm' ? 'pnpm dev # server (kick dev) + web (vite), in parallel' : `${pm} run dev:server # terminal 1\\n${pm} run dev:web # terminal 2`}\n\\`\\`\\`\n\nServer: http://localhost:3000 · Web: http://localhost:5173 (Vite proxies \\`/api\\`).\n\n## The type loop\n\n1. Server handlers **return** their payloads (\\`return this.service.greet(...)\\`).\n2. \\`kick typegen\\` (auto under \\`kick dev\\`) emits \\`server/.kickjs/types/kick__routes.ts\\` —\n including the flat \\`KickRoutes.Api\\` map with inferred response types.\n3. \\`web/src/types/kick-routes.d.ts\\` imports that file type-only.\n4. \\`web/src/api.ts\\`'s \\`createClient<KickRoutes.Api>\\` types every call site.\n\nRename a field in \\`server/src/modules/hello/hello.service.ts\\` → \\`web/src/App.tsx\\`\nstops compiling. That's the point.\n\nDocs: https://kickjs.app/guide/typed-client.html\n`\n}\n"],"mappings":";;;;;;;;;;uLA8BA,eAAsB,EAAqB,EAA8C,CACvF,GAAM,CAAE,OAAM,YAAW,YAAY,MAAO,UAAU,WAAc,EAI9D,EAAW,CAAC,OAAQ,MAAO,OAAQ,KAAK,CAAC,CAAW,SACxD,EAAQ,cACV,EACM,EAAiB,EAClB,EAAQ,eACT,OACE,EAAM,EACN,EAAO,GAAgB,QAAQ,IAAI,KAAK,GAAK,EAC/C,EAAQ,iBAAmB,IAAA,IAAa,CAAC,GAC3C,EACE,qCAAqC,OAAO,EAAQ,cAAc,EAAE,0BACtE,EAGF,QAAQ,IAAI,4CAA4C,EAAK,GAAG,EAGhE,MAAM,EAAY,CAChB,KAAM,GAAG,EAAK,SACd,UAAW,EAAK,EAAK,QAAQ,EAC7B,iBACA,SAAU,UACV,YACA,UAEA,QAAS,GACT,YAAa,EACf,CAAC,EAID,IAAM,GAAgB,MADC,EAAuB,EAAA,CACf,2BAA6B,SAE5D,MAAM,EAAc,EAAK,EAAK,kBAAkB,EAAG,EAAe,EAAM,CAAa,CAAC,EACtF,MAAM,EAAc,EAAK,EAAK,oBAAoB,EAAG,EAAc,CAAC,EACpE,MAAM,EAAc,EAAK,EAAK,mBAAmB,EAAG,EAAY,CAAC,EACjE,MAAM,EAAc,EAAK,EAAK,gBAAgB,EAAG,EAAa,CAAI,CAA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AS,EAAa,EAAsB,CAC1C,MAAO;;;;;aAKI,EAAK;;;;;;;CAQlB,CAEA,SAAS,GAAkB,CACzB,MAAO;;;;;;;;;CAUT,CAEA,SAAS,GAAiB,CACxB,MAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2CT,CAEA,SAAS,GAAiB,CACxB,MAAO;;;;;;;CAQT,CAEA,SAAS,GAAwB,CAC/B,MAAO;;;;CAKT,CAIA,SAAS,EAAgB,EAAc,EAAoB,CACzD,IAAM,EACJ,IAAO,OACH,CACE,IAAK,6BACL,aAAc,6BACd,UAAW,0BACX,MAAO,oBACP,UAAW,uBACb,EACA,CAIE,aAAc,gBAAgB,EAAG,UACjC,UAAW,aAAa,EAAG,UAC3B,MAAO,GAAG,EAAG,uBAAuB,EAAG,gBACvC,eAAgB,gBAAgB,EAAG,YACnC,YAAa,aAAa,EAAG,YAC7B,UAAW,aAAa,EAAG,eAC7B,EACN,MAAO,GAAG,KAAK,UACb,CACE,OACA,QAAS,GACT,QAAS,QACT,KAAM,SACN,UACA,WAAY,CAAC,SAAU,KAAK,CAC9B,EACA,KACA,CACF,EAAE,GACJ,CAEA,SAAS,GAAwB,CAC/B,MAAO;;;;;CAMT,CAEA,SAAS,EAAW,EAAc,EAAoB,CACpD,MAAO,KAAK,EAAK;;;;;;;;;;;;EAYjB,EAAG;EACH,IAAO,OAAS,oEAAsE,GAAG,EAAG,kCAAkC,EAAG,gCAAgC;;;;;;;;;;;;;;;;;CAkBnK"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/commands/add.ts","../src/commands/doctor.ts","../src/plugin/types.ts","../src/config.ts","../src/generators/templates/types.ts","../src/generators/module.ts","../src/generators/adapter.ts","../src/generators/middleware.ts","../src/generators/guard.ts","../src/generators/service.ts","../src/generators/controller.ts","../src/generators/dto.ts","../src/generators/project.ts","../src/utils/project-root.ts","../src/typegen/scanner.ts","../src/typegen/plugin.ts","../src/typegen/token-conventions.ts","../src/typegen/index.ts","../src/typegen/run-plugins.ts","../src/asset-manager/build.ts","../src/typegen/dev-watcher.ts","../src/generator-extension/discover.ts","../src/generator-extension/context.ts","../src/utils/naming.ts"],"mappings":";;;;KA4OY;;;;;;;;;;;;;;;;;;;UCjNK;EACf;EACA;;;;;;;EAOA;;;;;;EAMA,SAAS;;UAGM;;EAEf;EACA;;EAEA;;EAEA;;KAGU,eACV,KAAK,kBACF,eAAe,wBAAwB,QAAQ,eAAe;;;;;;UAOlD;;EAEf,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCK,sBAAsB,KAAK,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,kBAAkB,OAAO,cAAc;;;;KChG3C,uBAAuB,uBAAoB;;KAG3C,gBAAgB,gBAAa;;;;UC7BxB;;EAEf;;EAEA;;;;;;;;;EASA;;EAEA;;;KAIU;;KAGA;;;;;;;;;;KAaA;;UA2BK;EACf;;;KAIU,iBAAiB,oBAAkB;;;;;;;;;;;KAYnC;;;;;;UAOK;;;;;;;EAOf;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;;EAsBA;;;;;;;;;;;;;;;;;;;;;;;;UAyBe;;;;;EAKf;;;;;EAKA;;EAEA;;;;;;;EAOA;;;;;;;EAOA,0BAA0B;;;UAIX;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;EAaA,kBAAkB;;;;;;;;;;EAUlB;;;;;;;;;;;;;;;;;;EAkBA;;;UAIe;;EAEf;;;;;;;;;;;;;;EAcA,OAAO;;EAEP;;;;;;EAMA;;;;;;;;;;EAUA;;;;;;;;;;;;;;;;;;;;EAoBA;;;UAIe;;;;;;;;EAQf,UAAU;;;;;;;;;;;;EAYV,UAAU;;;;;;;;;;;;;;;;EAgBV,iBAAiB;;;;;;;;;;;;;;;;;EAkBjB;;;;;;;;;;;;;;;;;;;EAoBA;;;;;;;;;;;;;;EAeA,WAAW;IAAiB;IAAa;;;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;;;;;iBAYZ,UAAU"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/commands/add.ts","../src/commands/doctor.ts","../src/plugin/types.ts","../src/config.ts","../src/generators/templates/types.ts","../src/generators/module.ts","../src/generators/adapter.ts","../src/generators/middleware.ts","../src/generators/guard.ts","../src/generators/service.ts","../src/generators/controller.ts","../src/generators/dto.ts","../src/generators/project.ts","../src/utils/project-root.ts","../src/typegen/scanner.ts","../src/typegen/plugin.ts","../src/typegen/token-conventions.ts","../src/typegen/index.ts","../src/typegen/run-plugins.ts","../src/asset-manager/build.ts","../src/typegen/dev-watcher.ts","../src/generator-extension/discover.ts","../src/generator-extension/context.ts","../src/utils/naming.ts"],"mappings":";;;;KA4OY;;;;;;;;;;;;;;;;;;;UCjNK;EACf;EACA;;;;;;;EAOA;;;;;;EAMA,SAAS;;UAGM;;EAEf;EACA;;EAEA;;EAEA;;KAGU,eACV,KAAK,kBACF,eAAe,wBAAwB,QAAQ,eAAe;;;;;;UAOlD;;EAEf,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCK,sBAAsB,KAAK,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;iBA0B7C,kBAAkB,OAAO,cAAc;;;;KChG3C,uBAAuB,uBAAoB;;KAG3C,gBAAgB,gBAAa;;;;UC7BxB;;EAEf;;EAEA;;;;;;;;;EASA;;EAEA;;;KAIU;;KAGA;;;;;;;;;;KAaA;;UA2BK;EACf;;;KAIU,iBAAiB,oBAAkB;;;;;;;;;;;KAYnC;;;;;;UAOK;;;;;;;EAOf;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;;EAsBA;;;;;;;;;;;;;;;;;;;;;;;;UAyBe;;;;;EAKf;;;;;EAKA;;EAEA;;;;;;;EAOA;;;;;;;EAOA,0BAA0B;;;UAIX;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;EAaA,kBAAkB;;;;;;;;;;EAUlB;;;;;;;;;;;;;;;;;;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AO,mBAAmB;;;;;EAK3C;;;;;;EAMA;;EAEA;;iBAGc,wBAAwB,MAAM,2BAA2B;;;;;;;;UC3ExD;EACf;EACA,MAAM;;;;;;;UAQS;EACf,YAAY;;EAEZ;;;;;EAKA,QAAQ;IAAQ;IAAgB;;;;;;;;;;;iBCblB,sBAAsB;EACpC;EACA;EACA,QAAQ;EACR;EACA;;;;;;;EAOA;EACA;IACE;;;;iBC5BY,aAAa;;iBAOb,YAAY;;iBAMZ,YAAY;;;;;;iBAYZ,UAAU"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v6.9.1
2
+ * @forinda/kickjs-cli v6.10.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,4 +8,4 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{F as e,N as t,P as n,c as r,d as i,f as a,g as o,h as s,j as c,l,m as u,n as d,o as f,p,s as m,t as h,v as g,x as _}from"./doctor-BRs6lrbi.mjs";import{t as v}from"./project-BSSB5kBG.mjs";import{i as y,r as b}from"./config-CFAZrUmi.mjs";import{t as x}from"./project-root-BNYhLr1o.mjs";import{n as S,t as C}from"./types-Dfg3zods.mjs";export{C as KickPluginConflictError,r as TYPEGEN_OWNER_KEY,f as buildGeneratorContext,l as createTypegenDevWatcher,S as defineCliPlugin,b as defineConfig,h as defineDoctorCheck,d as defineDoctorExtension,m as defineGenerator,i as defineTypegen,x as findProjectRoot,g as generateAdapter,p as generateController,a as generateDto,s as generateGuard,o as generateMiddleware,_ as generateModule,u as generateService,v as initProject,y as loadKickConfig,c as pluralize,t as toCamelCase,n as toKebabCase,e as toPascalCase};
11
+ import{F as e,N as t,P as n,c as r,d as i,f as a,g as o,h as s,j as c,l,m as u,n as d,o as f,p,s as m,t as h,v as g,x as _}from"./doctor-CC8eWifc.mjs";import{t as v}from"./project-DPQJNbUr.mjs";import{i as y,r as b}from"./config-DYS_-oZ_.mjs";import{t as x}from"./project-root-74p4iEbS.mjs";import{n as S,t as C}from"./types-BYbOAJ_d.mjs";export{C as KickPluginConflictError,r as TYPEGEN_OWNER_KEY,f as buildGeneratorContext,l as createTypegenDevWatcher,S as defineCliPlugin,b as defineConfig,h as defineDoctorCheck,d as defineDoctorExtension,m as defineGenerator,i as defineTypegen,x as findProjectRoot,g as generateAdapter,p as generateController,a as generateDto,s as generateGuard,o as generateMiddleware,_ as generateModule,u as generateService,v as initProject,y as loadKickConfig,c as pluralize,t as toCamelCase,n as toKebabCase,e as toPascalCase};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v6.9.1
2
+ * @forinda/kickjs-cli v6.10.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,4 +8,4 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{t as e}from"./rolldown-runtime-DnEcvn06.mjs";import{KickPluginConflictError as t,defineCliPlugin as n}from"@forinda/kickjs-cli-kit";function r(e,n=[]){let r=new Map;for(let n of e){let e=(r.get(n.name)??0)+1;if(r.set(n.name,e),e===2)throw new t(`plugin`,n.name,[n.name,n.name])}let i=new Map,a=[];for(let n of e)for(let e of n.commands??[]){let r=i.get(e.name);if(r)throw new t(`command`,e.name,[r,n.name]);i.set(e.name,n.name),a.push(e)}let o=new Set(n.map(e=>e.name)),s=[...a.filter(e=>!o.has(e.name)),...n],c=new Map,l=[];for(let n of e)for(let e of n.typegens??[]){let r=c.get(e.id);if(r)throw new t(`typegen`,e.id,[r,n.name]);c.set(e.id,n.name),l.push(e)}let u=new Map,d=[];for(let n of e)for(let e of n.generators??[]){let r=u.get(e.name);if(r)throw new t(`generator`,e.name,[r,n.name]);u.set(e.name,n.name),d.push({source:n.name,spec:e})}return{commands:s,typegens:l,generators:d,register:async(t,n)=>{let r;if(n)r={generators:d,...n};else{let{findProjectRoot:e}=await import(`./project-root-Dv1HfN0o.mjs`).then(e=>e.n),t=process.cwd();r={cwd:t,projectRoot:e(t),config:null,log:()=>{},generators:d}}for(let n of e)n.register&&await n.register(t,r)}}}var i=e({mergeCliPlugins:()=>r});export{r as n,n as r,i as t};
11
+ import{t as e}from"./rolldown-runtime-Wu10E8Jp.mjs";import{KickPluginConflictError as t,defineCliPlugin as n}from"@forinda/kickjs-cli-kit";function r(e,n=[]){let r=new Map;for(let n of e){let e=(r.get(n.name)??0)+1;if(r.set(n.name,e),e===2)throw new t(`plugin`,n.name,[n.name,n.name])}let i=new Map,a=[];for(let n of e)for(let e of n.commands??[]){let r=i.get(e.name);if(r)throw new t(`command`,e.name,[r,n.name]);i.set(e.name,n.name),a.push(e)}let o=new Set(n.map(e=>e.name)),s=[...a.filter(e=>!o.has(e.name)),...n],c=new Map,l=[];for(let n of e)for(let e of n.typegens??[]){let r=c.get(e.id);if(r)throw new t(`typegen`,e.id,[r,n.name]);c.set(e.id,n.name),l.push(e)}let u=new Map,d=[];for(let n of e)for(let e of n.generators??[]){let r=u.get(e.name);if(r)throw new t(`generator`,e.name,[r,n.name]);u.set(e.name,n.name),d.push({source:n.name,spec:e})}return{commands:s,typegens:l,generators:d,register:async(t,n)=>{let r;if(n)r={generators:d,...n};else{let{findProjectRoot:e}=await import(`./project-root-CSfkrbTB.mjs`).then(e=>e.n),t=process.cwd();r={cwd:t,projectRoot:e(t),config:null,log:()=>{},generators:d}}for(let n of e)n.register&&await n.register(t,r)}}}var i=e({mergeCliPlugins:()=>r});export{r as n,n as r,i as t};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v6.9.1
2
+ * @forinda/kickjs-cli v6.10.0
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,5 +8,5 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{t as e}from"./rolldown-runtime-DnEcvn06.mjs";import{t}from"./types-Dfg3zods.mjs";function n(e,n=[]){let r=new Map;for(let n of e){let e=(r.get(n.name)??0)+1;if(r.set(n.name,e),e===2)throw new t(`plugin`,n.name,[n.name,n.name])}let i=new Map,a=[];for(let n of e)for(let e of n.commands??[]){let r=i.get(e.name);if(r)throw new t(`command`,e.name,[r,n.name]);i.set(e.name,n.name),a.push(e)}let o=new Set(n.map(e=>e.name)),s=[...a.filter(e=>!o.has(e.name)),...n],c=new Map,l=[];for(let n of e)for(let e of n.typegens??[]){let r=c.get(e.id);if(r)throw new t(`typegen`,e.id,[r,n.name]);c.set(e.id,n.name),l.push(e)}let u=new Map,d=[];for(let n of e)for(let e of n.generators??[]){let r=u.get(e.name);if(r)throw new t(`generator`,e.name,[r,n.name]);u.set(e.name,n.name),d.push({source:n.name,spec:e})}return{commands:s,typegens:l,generators:d,register:async(t,n)=>{let r;if(n)r={generators:d,...n};else{let{findProjectRoot:e}=await import(`./project-root-BNYhLr1o.mjs`).then(e=>e.n),t=process.cwd();r={cwd:t,projectRoot:e(t),config:null,log:()=>{},generators:d}}for(let n of e)n.register&&await n.register(t,r)}}}var r=e({mergeCliPlugins:()=>n});export{n,r as t};
12
- //# sourceMappingURL=plugin-qwSg0kwT.mjs.map
11
+ import{t as e}from"./rolldown-runtime-Wu10E8Jp.mjs";import{t}from"./types-BYbOAJ_d.mjs";function n(e,n=[]){let r=new Map;for(let n of e){let e=(r.get(n.name)??0)+1;if(r.set(n.name,e),e===2)throw new t(`plugin`,n.name,[n.name,n.name])}let i=new Map,a=[];for(let n of e)for(let e of n.commands??[]){let r=i.get(e.name);if(r)throw new t(`command`,e.name,[r,n.name]);i.set(e.name,n.name),a.push(e)}let o=new Set(n.map(e=>e.name)),s=[...a.filter(e=>!o.has(e.name)),...n],c=new Map,l=[];for(let n of e)for(let e of n.typegens??[]){let r=c.get(e.id);if(r)throw new t(`typegen`,e.id,[r,n.name]);c.set(e.id,n.name),l.push(e)}let u=new Map,d=[];for(let n of e)for(let e of n.generators??[]){let r=u.get(e.name);if(r)throw new t(`generator`,e.name,[r,n.name]);u.set(e.name,n.name),d.push({source:n.name,spec:e})}return{commands:s,typegens:l,generators:d,register:async(t,n)=>{let r;if(n)r={generators:d,...n};else{let{findProjectRoot:e}=await import(`./project-root-74p4iEbS.mjs`).then(e=>e.n),t=process.cwd();r={cwd:t,projectRoot:e(t),config:null,log:()=>{},generators:d}}for(let n of e)n.register&&await n.register(t,r)}}}var r=e({mergeCliPlugins:()=>n});export{n,r as t};
12
+ //# sourceMappingURL=plugin-Dgdp1o7e.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-qwSg0kwT.mjs","names":[],"sources":["../src/plugin/merge.ts","../src/plugin/index.ts"],"sourcesContent":["// Plugin → unified registry merge.\n//\n// Resolution rules (per the v1 spec + dogfood pivot):\n// - duplicate plugin `name` across the input array → conflict error.\n// Catches the double-install case (built-in shipped twice, or\n// adopter requiring the same plugin twice).\n// - plugin commands appear first in the merged list, then adopter\n// commands; adopter `commands` of the same name override the\n// plugin entry (filter pass).\n// - duplicate command name across two plugins → conflict error\n// listing both plugin names. Adopter overriding a plugin is\n// allowed and not an error.\n// - duplicate typegen id across two plugins → same error. Typegens\n// have no adopter override path; only plugins contribute them.\n// - register() functions are collected in input order; the caller\n// invokes each one against the same Command program. They have no\n// id-level conflict surface — owners are responsible for picking\n// non-colliding command names inside their own register().\n// - plugin order = array order. No implicit precedence rules.\n\nimport type { Command } from 'commander'\n\nimport type { KickCommandDefinition } from '../config'\nimport type { TypegenPlugin } from '../typegen/plugin'\nimport type { GeneratorSpec } from '../generator-extension/define'\nimport type { DiscoveredGenerator } from '../generator-extension/discover'\nimport { KickPluginConflictError, type KickCliPlugin, type KickCliPluginContext } from './types'\n\nexport interface MergedPlugins {\n commands: KickCommandDefinition[]\n typegens: TypegenPlugin[]\n /** DiscoveredGenerator shape so this list slots into the existing\n * dispatch path next to package.json-discovered entries. `source`\n * carries the plugin name for error attribution. */\n generators: DiscoveredGenerator[]\n /**\n * Apply every plugin's register() in input order. ctx is optional so\n * tests + lightweight callers can invoke `register(program)` without\n * constructing a full context; it falls back to cwd=process.cwd(),\n * config=null, log=no-op.\n */\n register: (program: Command, ctx?: KickCliPluginContext) => Promise<void>\n}\n\nexport function mergeCliPlugins(\n plugins: readonly KickCliPlugin[],\n adopterCommands: readonly KickCommandDefinition[] = [],\n): MergedPlugins {\n // Plugin-name dedup — catches double-install.\n const seenPluginNames = new Map<string, number>()\n for (const p of plugins) {\n const count = (seenPluginNames.get(p.name) ?? 0) + 1\n seenPluginNames.set(p.name, count)\n if (count === 2) {\n throw new KickPluginConflictError('plugin', p.name, [p.name, p.name])\n }\n }\n\n const commandOwners = new Map<string, string>()\n const pluginCommands: KickCommandDefinition[] = []\n for (const p of plugins) {\n for (const cmd of p.commands ?? []) {\n const prior = commandOwners.get(cmd.name)\n if (prior) {\n throw new KickPluginConflictError('command', cmd.name, [prior, p.name])\n }\n commandOwners.set(cmd.name, p.name)\n pluginCommands.push(cmd)\n }\n }\n\n const adopterNames = new Set(adopterCommands.map((c) => c.name))\n const filteredPlugin = pluginCommands.filter((c) => !adopterNames.has(c.name))\n const commands = [...filteredPlugin, ...adopterCommands]\n\n const typegenOwners = new Map<string, string>()\n const typegens: TypegenPlugin[] = []\n for (const p of plugins) {\n for (const tg of p.typegens ?? []) {\n const prior = typegenOwners.get(tg.id)\n if (prior) {\n throw new KickPluginConflictError('typegen', tg.id, [prior, p.name])\n }\n typegenOwners.set(tg.id, p.name)\n typegens.push(tg)\n }\n }\n\n const generatorOwners = new Map<string, string>()\n const generators: DiscoveredGenerator[] = []\n for (const p of plugins) {\n for (const spec of p.generators ?? []) {\n const prior = generatorOwners.get(spec.name)\n if (prior) {\n throw new KickPluginConflictError('generator', spec.name, [prior, p.name])\n }\n generatorOwners.set(spec.name, p.name)\n generators.push({ source: p.name, spec: spec satisfies GeneratorSpec })\n }\n }\n\n /**\n * Apply every plugin's `register()` callback in input order against the\n * given Commander program. Each callback receives a {@link KickCliPluginContext}:\n * caller-supplied ctx wins (test fixtures can inject a different\n * workspace boundary); otherwise a default ctx is built with\n * `findProjectRoot(process.cwd())` as the project root, `cwd` matching\n * `process.cwd()`, null config, no-op log, and the merged generator set\n * threaded through so the `kick/generate` built-in can surface each as\n * a Commander subcommand. The dynamic import of `findProjectRoot` keeps\n * the caller-supplied fast path zero-cost.\n */\n const register = async (program: Command, ctx?: KickCliPluginContext): Promise<void> => {\n let resolved: KickCliPluginContext\n if (ctx) {\n resolved = { generators, ...ctx }\n } else {\n const { findProjectRoot } = await import('../utils/project-root')\n const cwd = process.cwd()\n resolved = {\n cwd,\n projectRoot: findProjectRoot(cwd),\n config: null,\n log: () => {},\n generators,\n }\n }\n for (const p of plugins) {\n if (p.register) await p.register(program, resolved)\n }\n }\n\n return { commands, typegens, generators, register }\n}\n","// Barrel intentionally omits `./builtins` — that module top-level-imports\n// every register*Command, which pulls heavy modules (project scaffolders,\n// fs reads at import time) into the graph. Importers that need the\n// builtin list go through `./plugin/builtins` directly; tests + adopter\n// plugins consuming only the contract types import from here.\n\nexport type { KickCliPlugin } from './types'\nexport { defineCliPlugin, KickPluginConflictError } from './types'\nexport { mergeCliPlugins, type MergedPlugins } from './merge'\n"],"mappings":";;;;;;;;;;wFA4CA,SAAgB,EACd,EACA,EAAoD,CAAC,EACtC,CAEf,IAAM,EAAkB,IAAI,IAC5B,IAAK,IAAM,KAAK,EAAS,CACvB,IAAM,GAAS,EAAgB,IAAI,EAAE,IAAI,GAAK,GAAK,EAEnD,GADA,EAAgB,IAAI,EAAE,KAAM,CAAK,EAC7B,IAAU,EACZ,MAAM,IAAI,EAAwB,SAAU,EAAE,KAAM,CAAC,EAAE,KAAM,EAAE,IAAI,CAAC,CAExE,CAEA,IAAM,EAAgB,IAAI,IACpB,EAA0C,CAAC,EACjD,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAO,EAAE,UAAY,CAAC,EAAG,CAClC,IAAM,EAAQ,EAAc,IAAI,EAAI,IAAI,EACxC,GAAI,EACF,MAAM,IAAI,EAAwB,UAAW,EAAI,KAAM,CAAC,EAAO,EAAE,IAAI,CAAC,EAExE,EAAc,IAAI,EAAI,KAA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AAM,EAAE,SAAS,EAAS,CAAQ,CAEtD,CAEkD,CACpD"}
1
+ {"version":3,"file":"plugin-Dgdp1o7e.mjs","names":[],"sources":["../src/plugin/merge.ts","../src/plugin/index.ts"],"sourcesContent":["// Plugin → unified registry merge.\n//\n// Resolution rules (per the v1 spec + dogfood pivot):\n// - duplicate plugin `name` across the input array → conflict error.\n// Catches the double-install case (built-in shipped twice, or\n// adopter requiring the same plugin twice).\n// - plugin commands appear first in the merged list, then adopter\n// commands; adopter `commands` of the same name override the\n// plugin entry (filter pass).\n// - duplicate command name across two plugins → conflict error\n// listing both plugin names. Adopter overriding a plugin is\n// allowed and not an error.\n// - duplicate typegen id across two plugins → same error. Typegens\n// have no adopter override path; only plugins contribute them.\n// - register() functions are collected in input order; the caller\n// invokes each one against the same Command program. They have no\n// id-level conflict surface — owners are responsible for picking\n// non-colliding command names inside their own register().\n// - plugin order = array order. No implicit precedence rules.\n\nimport type { Command } from 'commander'\n\nimport type { KickCommandDefinition } from '../config'\nimport type { TypegenPlugin } from '../typegen/plugin'\nimport type { GeneratorSpec } from '../generator-extension/define'\nimport type { DiscoveredGenerator } from '../generator-extension/discover'\nimport { KickPluginConflictError, type KickCliPlugin, type KickCliPluginContext } from './types'\n\nexport interface MergedPlugins {\n commands: KickCommandDefinition[]\n typegens: TypegenPlugin[]\n /** DiscoveredGenerator shape so this list slots into the existing\n * dispatch path next to package.json-discovered entries. `source`\n * carries the plugin name for error attribution. */\n generators: DiscoveredGenerator[]\n /**\n * Apply every plugin's register() in input order. ctx is optional so\n * tests + lightweight callers can invoke `register(program)` without\n * constructing a full context; it falls back to cwd=process.cwd(),\n * config=null, log=no-op.\n */\n register: (program: Command, ctx?: KickCliPluginContext) => Promise<void>\n}\n\nexport function mergeCliPlugins(\n plugins: readonly KickCliPlugin[],\n adopterCommands: readonly KickCommandDefinition[] = [],\n): MergedPlugins {\n // Plugin-name dedup — catches double-install.\n const seenPluginNames = new Map<string, number>()\n for (const p of plugins) {\n const count = (seenPluginNames.get(p.name) ?? 0) + 1\n seenPluginNames.set(p.name, count)\n if (count === 2) {\n throw new KickPluginConflictError('plugin', p.name, [p.name, p.name])\n }\n }\n\n const commandOwners = new Map<string, string>()\n const pluginCommands: KickCommandDefinition[] = []\n for (const p of plugins) {\n for (const cmd of p.commands ?? []) {\n const prior = commandOwners.get(cmd.name)\n if (prior) {\n throw new KickPluginConflictError('command', cmd.name, [prior, p.name])\n }\n commandOwners.set(cmd.name, p.name)\n pluginCommands.push(cmd)\n }\n }\n\n const adopterNames = new Set(adopterCommands.map((c) => c.name))\n const filteredPlugin = pluginCommands.filter((c) => !adopterNames.has(c.name))\n const commands = [...filteredPlugin, ...adopterCommands]\n\n const typegenOwners = new Map<string, string>()\n const typegens: TypegenPlugin[] = []\n for (const p of plugins) {\n for (const tg of p.typegens ?? []) {\n const prior = typegenOwners.get(tg.id)\n if (prior) {\n throw new KickPluginConflictError('typegen', tg.id, [prior, p.name])\n }\n typegenOwners.set(tg.id, p.name)\n typegens.push(tg)\n }\n }\n\n const generatorOwners = new Map<string, string>()\n const generators: DiscoveredGenerator[] = []\n for (const p of plugins) {\n for (const spec of p.generators ?? []) {\n const prior = generatorOwners.get(spec.name)\n if (prior) {\n throw new KickPluginConflictError('generator', spec.name, [prior, p.name])\n }\n generatorOwners.set(spec.name, p.name)\n generators.push({ source: p.name, spec: spec satisfies GeneratorSpec })\n }\n }\n\n /**\n * Apply every plugin's `register()` callback in input order against the\n * given Commander program. Each callback receives a {@link KickCliPluginContext}:\n * caller-supplied ctx wins (test fixtures can inject a different\n * workspace boundary); otherwise a default ctx is built with\n * `findProjectRoot(process.cwd())` as the project root, `cwd` matching\n * `process.cwd()`, null config, no-op log, and the merged generator set\n * threaded through so the `kick/generate` built-in can surface each as\n * a Commander subcommand. The dynamic import of `findProjectRoot` keeps\n * the caller-supplied fast path zero-cost.\n */\n const register = async (program: Command, ctx?: KickCliPluginContext): Promise<void> => {\n let resolved: KickCliPluginContext\n if (ctx) {\n resolved = { generators, ...ctx }\n } else {\n const { findProjectRoot } = await import('../utils/project-root')\n const cwd = process.cwd()\n resolved = {\n cwd,\n projectRoot: findProjectRoot(cwd),\n config: null,\n log: () => {},\n generators,\n }\n }\n for (const p of plugins) {\n if (p.register) await p.register(program, resolved)\n }\n }\n\n return { commands, typegens, generators, register }\n}\n","// Barrel intentionally omits `./builtins` — that module top-level-imports\n// every register*Command, which pulls heavy modules (project scaffolders,\n// fs reads at import time) into the graph. Importers that need the\n// builtin list go through `./plugin/builtins` directly; tests + adopter\n// plugins consuming only the contract types import from here.\n\nexport type { KickCliPlugin } from './types'\nexport { defineCliPlugin, KickPluginConflictError } from './types'\nexport { mergeCliPlugins, type MergedPlugins } from './merge'\n"],"mappings":";;;;;;;;;;wFA4CA,SAAgB,EACd,EACA,EAAoD,CAAC,EACtC,CAEf,IAAM,EAAkB,IAAI,IAC5B,IAAK,IAAM,KAAK,EAAS,CACvB,IAAM,GAAS,EAAgB,IAAI,EAAE,IAAI,GAAK,GAAK,EAEnD,GADA,EAAgB,IAAI,EAAE,KAAM,CAAK,EAC7B,IAAU,EACZ,MAAM,IAAI,EAAwB,SAAU,EAAE,KAAM,CAAC,EAAE,KAAM,EAAE,IAAI,CAAC,CAExE,CAEA,IAAM,EAAgB,IAAI,IACpB,EAA0C,CAAC,EACjD,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAO,EAAE,UAAY,CAAC,EAAG,CAClC,IAAM,EAAQ,EAAc,IAAI,EAAI,IAAI,EACxC,GAAI,EACF,MAAM,IAAI,EAAwB,UAAW,EAAI,KAAM,CAAC,EAAO,EAAE,IAAI,CAAC,EAExE,EAAc,IAAI,EAAI,KAAM,EAAE,IAAI,EAClC,EAAe,KAAK,CAAG,CACzB,CAGF,IAAM,EAAe,IAAI,IAAI,EAAgB,IAAK,GAAM,EAAE,IAAI,CAAC,EAEzD,EAAW,CAAC,GADK,EAAe,OAAQ,GAAM,CAAC,EAAa,IAAI,EAAE,IAAI,CAC1C,E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7 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{r as e,t}from"./config-DzcY7KDb.mjs";import{l as n,o as r}from"./project-docs-DG-aI5f_.mjs";import{existsSync as i,readFileSync as a}from"node:fs";import{dirname as o,join as s,resolve as c}from"node:path";import{fileURLToPath as l}from"node:url";import{execFileSync as u,execSync as d}from"node:child_process";const f={swagger:`@forinda/kickjs-swagger`,ws:`@forinda/kickjs-ws`,queue:`@forinda/kickjs-queue`,devtools:`@forinda/kickjs-devtools`},p={zod:{name:`zod`,range:`^4.3.6`},valibot:{name:`valibot`,range:`^1.4.1`},yup:{name:`yup`,range:`^1.7.1`}};function m(e,t){let n=e[t];if(!n)throw Error(`generatePackageJson: missing resolved version for ${t}. Add it to SIBLING_PACKAGES in generators/project.ts.`);return n}function h(e,t,n,r=[],i=`zod`,a=`express`){let o=p[i],s={"@forinda/kickjs":m(n,`@forinda/kickjs`),"@forinda/kickjs-schema":m(n,`@forinda/kickjs-schema`),dotenv:`^17.3.1`,"reflect-metadata":`^0.2.2`,[o.name]:o.range};a===`express`?s.express=`^5.1.0`:a===`fastify`?(s.fastify=`^5.0.0`,s[`@fastify/middie`]=`^9.0.0`,s[`serve-static`]=`^2.2.0`):a===`h3`&&(s.h3=`^1.0.0`,s[`serve-static`]=`^2.2.0`);for(let e of r){let t=f[e];t&&!s[t]&&(s[t]=m(n,t))}return JSON.stringify({name:e,version:`0.0.0`,type:`module`,scripts:{dev:`kick dev`,"dev:debug":`kick dev:debug`,build:`kick build`,start:`kick start`,test:`vitest run`,"test:watch":`vitest`,typecheck:`tsc --noEmit`,typegen:`kick typegen`,lint:`eslint src/`,format:`prettier --write src/`},dependencies:s,devDependencies:{"@forinda/kickjs-cli":m(n,`@forinda/kickjs-cli`),"@forinda/kickjs-vite":m(n,`@forinda/kickjs-vite`),"@swc/core":`^1.15.21`,...a===`express`?{"@types/express":`^5.0.6`}:{},"@types/node":`^25.0.0`,"unplugin-swc":`^1.5.9`,vite:`^8.0.3`,vitest:`^4.1.2`,typescript:`^7.0.2`,prettier:`^3.8.1`}},null,2)}function g(){return`import { defineConfig } from 'vite'
11
+ import{r as e,t}from"./config-DHHqXYVF.mjs";import{l as n,o as r}from"./project-docs-BlYdtsfz.mjs";import{existsSync as i,readFileSync as a}from"node:fs";import{dirname as o,join as s,resolve as c}from"node:path";import{fileURLToPath as l}from"node:url";import{execFileSync as u,execSync as d,spawnSync as f}from"node:child_process";const p=/[&|<>^"'`(){}[\];!%\r\n\\]/;function m(e,t,n=process.platform){if(n!==`win32`)return[e,t];if(p.test(e)||t.some(e=>p.test(e)))return null;let r=[e,...t].map(e=>e.includes(` `)?`"${e}"`:e).join(` `);return[process.env.ComSpec||`cmd.exe`,[`/d`,`/s`,`/c`,r]]}function h(e,t,n={}){let r=m(e,t);if(!r)return null;try{return u(r[0],r[1],{encoding:`utf-8`,timeout:n.timeout??5e3,cwd:n.cwd,stdio:[`ignore`,`pipe`,`ignore`],windowsHide:!0}).toString().trim()||null}catch{return null}}function g(e,t,n={}){let r=m(e,t);if(!r)throw Error(`Refusing to run '${e}': unsafe arguments`);u(r[0],r[1],{cwd:n.cwd,stdio:`inherit`,windowsHide:!0})}function _(e,t,n){d(e,{cwd:t,stdio:`inherit`,env:n?{...process.env,...n}:process.env})}function v(e,t,n){let r=f(process.execPath,[e],{cwd:n,stdio:`inherit`,env:{...process.env,...t}});r.status!==0&&process.exit(r.status??1)}const y={swagger:`@forinda/kickjs-swagger`,ws:`@forinda/kickjs-ws`,queue:`@forinda/kickjs-queue`,devtools:`@forinda/kickjs-devtools`},b={zod:{name:`zod`,range:`^4.3.6`},valibot:{name:`valibot`,range:`^1.4.1`},yup:{name:`yup`,range:`^1.7.1`}};function x(e,t){let n=e[t];if(!n)throw Error(`generatePackageJson: missing resolved version for ${t}. Add it to SIBLING_PACKAGES in generators/project.ts.`);return n}function S(e,t,n,r=[],i=`zod`,a=`express`){let o=b[i],s={"@forinda/kickjs":x(n,`@forinda/kickjs`),"@forinda/kickjs-schema":x(n,`@forinda/kickjs-schema`),dotenv:`^17.3.1`,"reflect-metadata":`^0.2.2`,[o.name]:o.range};a===`express`?s.express=`^5.1.0`:a===`fastify`?(s.fastify=`^5.0.0`,s[`@fastify/middie`]=`^9.0.0`,s[`serve-static`]=`^2.2.0`):a===`h3`&&(s.h3=`^1.0.0`,s[`serve-static`]=`^2.2.0`);for(let e of r){let t=y[e];t&&!s[t]&&(s[t]=x(n,t))}return JSON.stringify({name:e,version:`0.0.0`,type:`module`,scripts:{dev:`kick dev`,"dev:debug":`kick dev:debug`,build:`kick build`,start:`kick start`,test:`vitest run`,"test:watch":`vitest`,typecheck:`tsc --noEmit`,typegen:`kick typegen`,lint:`eslint src/`,format:`prettier --write src/`},dependencies:s,devDependencies:{"@forinda/kickjs-cli":x(n,`@forinda/kickjs-cli`),"@forinda/kickjs-vite":x(n,`@forinda/kickjs-vite`),"@swc/core":`^1.15.21`,...a===`express`?{"@types/express":`^5.0.6`}:{},"@types/node":`^25.0.0`,"unplugin-swc":`^1.5.9`,vite:`^8.0.3`,vitest:`^4.1.2`,typescript:`^7.0.2`,prettier:`^3.8.1`}},null,2)}function C(){return`import { defineConfig } from 'vite'
12
12
  import { resolve } from 'node:path'
13
13
  import swc from 'unplugin-swc'
14
14
  import { kickjsVitePlugin, envWatchPlugin } from '@forinda/kickjs-vite'
@@ -38,7 +38,7 @@ export default defineConfig({
38
38
  },
39
39
  },
40
40
  })
41
- `}function _(){return JSON.stringify({compilerOptions:{target:`ES2022`,module:`ESNext`,moduleResolution:`bundler`,lib:[`ES2022`],types:[`node`,`vite/client`],strict:!0,esModuleInterop:!0,skipLibCheck:!0,sourceMap:!0,declaration:!0,experimentalDecorators:!0,emitDecoratorMetadata:!0,outDir:`dist`,paths:{"@/*":[`./src/*`]}},include:[`src`,`.kickjs/types/**/*.d.ts`,`.kickjs/types/**/*.ts`]},null,2)}function v(){return JSON.stringify({semi:!1,singleQuote:!0,trailingComma:`all`,printWidth:100,tabWidth:2},null,2)}function y(){return`# https://editorconfig.org
41
+ `}function w(){return JSON.stringify({compilerOptions:{target:`ES2022`,module:`ESNext`,moduleResolution:`bundler`,lib:[`ES2022`],types:[`node`,`vite/client`],strict:!0,esModuleInterop:!0,skipLibCheck:!0,sourceMap:!0,declaration:!0,experimentalDecorators:!0,emitDecoratorMetadata:!0,outDir:`dist`,paths:{"@/*":[`./src/*`]}},include:[`src`,`.kickjs/types/**/*.d.ts`,`.kickjs/types/**/*.ts`]},null,2)}function T(){return JSON.stringify({semi:!1,singleQuote:!0,trailingComma:`all`,printWidth:100,tabWidth:2},null,2)}function ee(){return`# https://editorconfig.org
42
42
  root = true
43
43
 
44
44
  [*]
@@ -51,14 +51,14 @@ insert_final_newline = true
51
51
 
52
52
  [*.md]
53
53
  trim_trailing_whitespace = false
54
- `}function b(){return`node_modules/
54
+ `}function te(){return`node_modules/
55
55
  dist/
56
56
  .env
57
57
  coverage/
58
58
  .DS_Store
59
59
  *.tsbuildinfo
60
60
  .kickjs/
61
- `}function x(){return`# Auto-detect text files and normalise line endings to LF
61
+ `}function ne(){return`# Auto-detect text files and normalise line endings to LF
62
62
  * text=auto eol=lf
63
63
 
64
64
  # Explicitly mark generated / binary files
@@ -76,11 +76,11 @@ coverage/
76
76
  pnpm-lock.yaml -diff linguist-generated
77
77
  yarn.lock -diff linguist-generated
78
78
  package-lock.json -diff linguist-generated
79
- `}function S(){return`PORT=3000
79
+ `}function re(){return`PORT=3000
80
80
  NODE_ENV=development
81
- `}function C(){return`PORT=3000
81
+ `}function E(){return`PORT=3000
82
82
  NODE_ENV=development
83
- `}function w(){return`import { defineConfig } from 'vitest/config'
83
+ `}function D(){return`import { defineConfig } from 'vitest/config'
84
84
  import swc from 'unplugin-swc'
85
85
 
86
86
  export default defineConfig({
@@ -91,7 +91,7 @@ export default defineConfig({
91
91
  include: ['src/**/*.test.ts'],
92
92
  },
93
93
  })
94
- `}const T={express:{from:`@forinda/kickjs`,name:`expressRuntime`},fastify:{from:`@forinda/kickjs/fastify`,name:`fastifyRuntime`},h3:{from:`@forinda/kickjs/h3`,name:`h3Runtime`}};function E(e,t,n,r=[],i=`express`){let a=T[i],o=i===`express`;switch(t){case`minimal`:{let t=[],i=[],s=o?`import { bootstrap, ${a.name} } from '@forinda/kickjs'`:`import { bootstrap } from '@forinda/kickjs'\nimport { ${a.name} } from '${a.from}'`;r.includes(`swagger`)&&(t.push(`import { SwaggerAdapter } from '@forinda/kickjs-swagger'`),i.push(` SwaggerAdapter({ info: { title: '${e}', version: '${n}' } }),`)),r.includes(`devtools`)&&(t.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`),i.push(` DevToolsAdapter(),`));let c=t.length?t.join(`
94
+ `}const O={express:{from:`@forinda/kickjs`,name:`expressRuntime`},fastify:{from:`@forinda/kickjs/fastify`,name:`fastifyRuntime`},h3:{from:`@forinda/kickjs/h3`,name:`h3Runtime`}};function k(e,t,n,r=[],i=`express`){let a=O[i],o=i===`express`;switch(t){case`minimal`:{let t=[],i=[],s=o?`import { bootstrap, ${a.name} } from '@forinda/kickjs'`:`import { bootstrap } from '@forinda/kickjs'\nimport { ${a.name} } from '${a.from}'`;r.includes(`swagger`)&&(t.push(`import { SwaggerAdapter } from '@forinda/kickjs-swagger'`),i.push(` SwaggerAdapter({ info: { title: '${e}', version: '${n}' } }),`)),r.includes(`devtools`)&&(t.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`),i.push(` DevToolsAdapter(),`));let c=t.length?t.join(`
95
95
  `)+`
96
96
  `:``,l=i.length?`,\n adapters: [\n${i.join(`
97
97
  `)}\n ]`:``;return`import 'reflect-metadata'
@@ -131,14 +131,14 @@ export const app = await bootstrap({
131
131
  requestLogger(),${d}
132
132
  ],
133
133
  })
134
- `}}}function D(){return`import { defineModules } from '@forinda/kickjs'
134
+ `}}}function A(){return`import { defineModules } from '@forinda/kickjs'
135
135
  import { HelloModule } from './hello/hello.module'
136
136
 
137
137
  // Remove HelloModule and run: kick g module <name>
138
138
  // \`defineModules()\` returns a chainable list — \`kick g module\` appends
139
139
  // \`.mount(NewModule())\` to the chain on every generation.
140
140
  export const modules = defineModules().mount(HelloModule())
141
- `}function O(e=`zod`){return e===`valibot`?`import { loadEnvFromSchema } from '@forinda/kickjs/config'
141
+ `}function j(e=`zod`){return e===`valibot`?`import { loadEnvFromSchema } from '@forinda/kickjs/config'
142
142
  import { fromValibot } from '@forinda/kickjs-schema/valibot'
143
143
  import * as v from 'valibot'
144
144
 
@@ -266,7 +266,7 @@ const envSchema = fromZod(
266
266
  export const env = loadEnvFromSchema(envSchema)
267
267
 
268
268
  export default envSchema
269
- `}function k(){return`import { Service } from '@forinda/kickjs'
269
+ `}function M(){return`import { Service } from '@forinda/kickjs'
270
270
 
271
271
  @Service()
272
272
  export class HelloService {
@@ -278,7 +278,7 @@ export class HelloService {
278
278
  return { status: 'ok', uptime: process.uptime() }
279
279
  }
280
280
  }
281
- `}function A(){return`import { Controller, Get, Autowired, type Ctx } from '@forinda/kickjs'
281
+ `}function N(){return`import { Controller, Get, Autowired, type Ctx } from '@forinda/kickjs'
282
282
  import { HelloService } from './hello.service'
283
283
 
284
284
  // \`Ctx<KickRoutes.HelloController['<method>']>\` is generated by
@@ -304,7 +304,7 @@ export class HelloController {
304
304
  return this.helloService.healthCheck()
305
305
  }
306
306
  }
307
- `}function j(){return`import { defineModule } from '@forinda/kickjs'
307
+ `}function P(){return`import { defineModule } from '@forinda/kickjs'
308
308
  import { HelloController } from './hello.controller'
309
309
 
310
310
  export const HelloModule = defineModule({
@@ -325,7 +325,7 @@ export const HelloModule = defineModule({
325
325
  },
326
326
  }),
327
327
  })
328
- `}function M(e,t=`inmemory`,n=`pnpm`,r=`express`){return`import { defineConfig } from '@forinda/kickjs-cli'
328
+ `}function F(e,t=`inmemory`,n=`pnpm`,r=`express`){return`import { defineConfig } from '@forinda/kickjs-cli'
329
329
 
330
330
  export default defineConfig({
331
331
  pattern: '${e}',
@@ -377,13 +377,13 @@ export default defineConfig({
377
377
  },
378
378
  ],
379
379
  })
380
- `}const N={kickjs:{pkg:`@forinda/kickjs`,peers:[`express`],description:`Unified framework: DI, decorators, routing, middleware`,core:!0},vite:{pkg:`@forinda/kickjs-vite`,peers:[`vite`],description:`Vite plugin: dev server, HMR, module discovery`,dev:!0,core:!0},cli:{pkg:`@forinda/kickjs-cli`,peers:[],description:`CLI tool and code generators`,dev:!0,core:!0},zod:{pkg:`zod`,peers:[],description:`Zod schema validation (env, DTOs, OpenAPI) — wrap with fromZod()`},valibot:{pkg:`valibot`,peers:[],description:`Valibot schema validation — wrap with fromValibot()`},yup:{pkg:`yup`,peers:[],description:`Yup schema validation — wrap with fromYup()`},auth:{pkg:`@forinda/kickjs-auth`,peers:[`jsonwebtoken`],description:`JWT, API key, OAuth strategies, @Public, @Roles (+ optional argon2/bcryptjs)`,deprecated:`auth is moving to BYO — compose @LoadAuthUser/@RequireRole/@Public from defineContextDecorator (see the BYO Auth recipe in the docs)`},ai:{pkg:`@forinda/kickjs-ai`,peers:[`zod`],description:`AI toolkit — LLM providers, tool definitions from controllers`},swagger:{pkg:`@forinda/kickjs-swagger`,peers:[],description:`OpenAPI spec + Swagger UI + ReDoc`},db:{pkg:`@forinda/kickjs-db`,peers:[],description:`kick/db core — schema DSL, migrations, KickDbClient, customType`},pg:{pkg:`@forinda/kickjs-db`,peers:[`pg`],description:`kick/db + PostgreSQL driver (use @forinda/kickjs-db/pg)`},sqlite:{pkg:`@forinda/kickjs-db`,peers:[`better-sqlite3`],description:`kick/db + SQLite driver (use @forinda/kickjs-db/sqlite)`},mysql:{pkg:`@forinda/kickjs-db`,peers:[`mysql2`],description:`kick/db + MySQL driver (use @forinda/kickjs-db/mysql)`},drizzle:{pkg:`@forinda/kickjs-drizzle`,peers:[`drizzle-orm`],description:`Drizzle ORM adapter + query builder`,deprecated:"early-adoption adapter, no longer maintained — wire Drizzle directly (BYO), or use @forinda/kickjs-db, the built-in Kick ORM (`kick add db` / pg / sqlite / mysql)"},prisma:{pkg:`@forinda/kickjs-prisma`,peers:[`@prisma/client`],description:`Prisma adapter + query builder`,deprecated:"early-adoption adapter, no longer maintained — wire Prisma directly (BYO), or use @forinda/kickjs-db, the built-in Kick ORM (`kick add db` / pg / sqlite / mysql)"},ws:{pkg:`@forinda/kickjs-ws`,peers:[`ws`],description:`WebSocket with @WsController decorators`},devtools:{pkg:`@forinda/kickjs-devtools`,peers:[],description:`Development dashboard — routes, DI, metrics, health`,dev:!0},queue:{pkg:`@forinda/kickjs-queue`,peers:[],description:`Queue adapter (BullMQ/RabbitMQ/Kafka)`},"queue:bullmq":{pkg:`@forinda/kickjs-queue`,peers:[`bullmq`,`ioredis`],description:`Queue with BullMQ + Redis`},"queue:rabbitmq":{pkg:`@forinda/kickjs-queue`,peers:[`amqplib`],description:`Queue with RabbitMQ`},"queue:kafka":{pkg:`@forinda/kickjs-queue`,peers:[`kafkajs`],description:`Queue with Kafka`},"queue:redis-pubsub":{pkg:`@forinda/kickjs-queue`,peers:[`ioredis`],description:`Lightweight pub/sub via Redis (no persistence)`},mcp:{pkg:`@forinda/kickjs-mcp`,peers:[`@modelcontextprotocol/sdk`],description:`Model Context Protocol server — expose @Controller endpoints as AI tools`},testing:{pkg:`@forinda/kickjs-testing`,peers:[],description:`Test utilities and TestModule builder`,dev:!0}},P=Object.entries(N).filter(([e,t])=>!t.core&&!t.deprecated&&!e.includes(`:`)&&![`pg`,`sqlite`,`mysql`,`zod`,`valibot`,`yup`].includes(e)).map(([e])=>e).join(`, `),F={express:{prod:`multer`,dev:`@types/multer`,note:`Express uploads use multer (memory/disk storage, ctx.file / ctx.files).`},fastify:{prod:`@fastify/multipart`,note:`Fastify uploads use @fastify/multipart (buffered into ctx.file / ctx.files).`},h3:{note:`h3 parses multipart natively (readMultipartFormData) — no driver to install.`}};async function I(t=process.cwd()){let n=(await e(t))?.runtime;return n===`express`||n===`fastify`||n===`h3`?n:L(t)}function L(e=process.cwd()){let t=R(`package.json`,e);if(t)try{let e=JSON.parse(a(c(t,`package.json`),`utf-8`)),n={...e.dependencies,...e.devDependencies};if(`fastify`in n)return`fastify`;if(`h3`in n)return`h3`}catch{}return`express`}function R(e,t=process.cwd()){let n=t;for(;;){if(i(c(n,e)))return n;let t=o(n);if(t===n)return null;n=t}}function z(){return R(`pnpm-lock.yaml`)?`pnpm`:R(`yarn.lock`)?`yarn`:R(`bun.lockb`)||R(`bun.lock`)?`bun`:R(`package-lock.json`)?`npm`:null}function B(){let e=process.cwd();for(;e;){let n=c(e,`package.json`);if(i(n))try{let e=JSON.parse(a(n,`utf-8`)).packageManager;if(typeof e==`string`){let n=e.split(`@`)[0];if(t.includes(n))return n}}catch{}let r=o(e);if(r===e)return null;e=r}return null}async function V(n){if(n&&t.includes(n))return{pm:n,source:`flag`};let r=await e(process.cwd());if(r?.packageManager&&t.includes(r.packageManager))return{pm:r.packageManager,source:`config`};let i=B();if(i)return{pm:i,source:`package.json`};let a=z();return a?{pm:a,source:`lockfile`}:{pm:`npm`,source:`default`}}async function H(e){let{pm:t}=await V(e);return t}function U(e=!1){let t=Object.entries(N),n=Math.max(...t.map(([e])=>e.length)),r=t.filter(([,e])=>e.core),i=t.filter(([,e])=>!e.core),a=([e,t])=>{let r=e.padEnd(n+2),i=t.peers.length?` (+ ${t.peers.join(`, `)})`:``,a=t.deprecated?` [DEPRECATED — ${t.deprecated}]`:``;return` ${r} ${t.description}${i}${a}`};console.log(`
380
+ `}const I={kickjs:{pkg:`@forinda/kickjs`,peers:[`express`],description:`Unified framework: DI, decorators, routing, middleware`,core:!0},vite:{pkg:`@forinda/kickjs-vite`,peers:[`vite`],description:`Vite plugin: dev server, HMR, module discovery`,dev:!0,core:!0},cli:{pkg:`@forinda/kickjs-cli`,peers:[],description:`CLI tool and code generators`,dev:!0,core:!0},zod:{pkg:`zod`,peers:[],description:`Zod schema validation (env, DTOs, OpenAPI) — wrap with fromZod()`},valibot:{pkg:`valibot`,peers:[],description:`Valibot schema validation — wrap with fromValibot()`},yup:{pkg:`yup`,peers:[],description:`Yup schema validation — wrap with fromYup()`},auth:{pkg:`@forinda/kickjs-auth`,peers:[`jsonwebtoken`],description:`JWT, API key, OAuth strategies, @Public, @Roles (+ optional argon2/bcryptjs)`,deprecated:`auth is moving to BYO — compose @LoadAuthUser/@RequireRole/@Public from defineContextDecorator (see the BYO Auth recipe in the docs)`},ai:{pkg:`@forinda/kickjs-ai`,peers:[`zod`],description:`AI toolkit — LLM providers, tool definitions from controllers`},swagger:{pkg:`@forinda/kickjs-swagger`,peers:[],description:`OpenAPI spec + Swagger UI + ReDoc`},db:{pkg:`@forinda/kickjs-db`,peers:[],description:`kick/db core — schema DSL, migrations, KickDbClient, customType`},pg:{pkg:`@forinda/kickjs-db`,peers:[`pg`],description:`kick/db + PostgreSQL driver (use @forinda/kickjs-db/pg)`},sqlite:{pkg:`@forinda/kickjs-db`,peers:[`better-sqlite3`],description:`kick/db + SQLite driver (use @forinda/kickjs-db/sqlite)`},mysql:{pkg:`@forinda/kickjs-db`,peers:[`mysql2`],description:`kick/db + MySQL driver (use @forinda/kickjs-db/mysql)`},drizzle:{pkg:`@forinda/kickjs-drizzle`,peers:[`drizzle-orm`],description:`Drizzle ORM adapter + query builder`,deprecated:"early-adoption adapter, no longer maintained — wire Drizzle directly (BYO), or use @forinda/kickjs-db, the built-in Kick ORM (`kick add db` / pg / sqlite / mysql)"},prisma:{pkg:`@forinda/kickjs-prisma`,peers:[`@prisma/client`],description:`Prisma adapter + query builder`,deprecated:"early-adoption adapter, no longer maintained — wire Prisma directly (BYO), or use @forinda/kickjs-db, the built-in Kick ORM (`kick add db` / pg / sqlite / mysql)"},ws:{pkg:`@forinda/kickjs-ws`,peers:[`ws`],description:`WebSocket with @WsController decorators`},devtools:{pkg:`@forinda/kickjs-devtools`,peers:[],description:`Development dashboard — routes, DI, metrics, health`,dev:!0},queue:{pkg:`@forinda/kickjs-queue`,peers:[],description:`Queue adapter (BullMQ/RabbitMQ/Kafka)`},"queue:bullmq":{pkg:`@forinda/kickjs-queue`,peers:[`bullmq`,`ioredis`],description:`Queue with BullMQ + Redis`},"queue:rabbitmq":{pkg:`@forinda/kickjs-queue`,peers:[`amqplib`],description:`Queue with RabbitMQ`},"queue:kafka":{pkg:`@forinda/kickjs-queue`,peers:[`kafkajs`],description:`Queue with Kafka`},"queue:redis-pubsub":{pkg:`@forinda/kickjs-queue`,peers:[`ioredis`],description:`Lightweight pub/sub via Redis (no persistence)`},mcp:{pkg:`@forinda/kickjs-mcp`,peers:[`@modelcontextprotocol/sdk`],description:`Model Context Protocol server — expose @Controller endpoints as AI tools`},testing:{pkg:`@forinda/kickjs-testing`,peers:[],description:`Test utilities and TestModule builder`,dev:!0}},L=Object.entries(I).filter(([e,t])=>!t.core&&!t.deprecated&&!e.includes(`:`)&&![`pg`,`sqlite`,`mysql`,`zod`,`valibot`,`yup`].includes(e)).map(([e])=>e).join(`, `),R={express:{prod:`multer`,dev:`@types/multer`,note:`Express uploads use multer (memory/disk storage, ctx.file / ctx.files).`},fastify:{prod:`@fastify/multipart`,note:`Fastify uploads use @fastify/multipart (buffered into ctx.file / ctx.files).`},h3:{note:`h3 parses multipart natively (readMultipartFormData) — no driver to install.`}};async function z(t=process.cwd()){let n=(await e(t))?.runtime;return n===`express`||n===`fastify`||n===`h3`?n:B(t)}function B(e=process.cwd()){let t=V(`package.json`,e);if(t)try{let e=JSON.parse(a(c(t,`package.json`),`utf-8`)),n={...e.dependencies,...e.devDependencies};if(`fastify`in n)return`fastify`;if(`h3`in n)return`h3`}catch{}return`express`}function V(e,t=process.cwd()){let n=t;for(;;){if(i(c(n,e)))return n;let t=o(n);if(t===n)return null;n=t}}function ie(){return V(`pnpm-lock.yaml`)?`pnpm`:V(`yarn.lock`)?`yarn`:V(`bun.lockb`)||V(`bun.lock`)?`bun`:V(`package-lock.json`)?`npm`:null}function H(){let e=process.cwd();for(;e;){let n=c(e,`package.json`);if(i(n))try{let e=JSON.parse(a(n,`utf-8`)).packageManager;if(typeof e==`string`){let n=e.split(`@`)[0];if(t.includes(n))return n}}catch{}let r=o(e);if(r===e)return null;e=r}return null}async function U(n){if(n&&t.includes(n))return{pm:n,source:`flag`};let r=await e(process.cwd());if(r?.packageManager&&t.includes(r.packageManager))return{pm:r.packageManager,source:`config`};let i=H();if(i)return{pm:i,source:`package.json`};let a=ie();return a?{pm:a,source:`lockfile`}:{pm:`npm`,source:`default`}}async function W(e){let{pm:t}=await U(e);return t}function G(e=!1){let t=Object.entries(I),n=Math.max(...t.map(([e])=>e.length)),r=t.filter(([,e])=>e.core),i=t.filter(([,e])=>!e.core),a=([e,t])=>{let r=e.padEnd(n+2),i=t.peers.length?` (+ ${t.peers.join(`, `)})`:``,a=t.deprecated?` [DEPRECATED — ${t.deprecated}]`:``;return` ${r} ${t.description}${i}${a}`};console.log(`
381
381
  Core packages (always installed by \`kick new\`):
382
382
  `);for(let e of r)console.log(a(e));if(e){console.log(`
383
383
  Optional packages (add as needed):
384
384
  `);for(let e of i)console.log(a(e))}else console.log(`\n Plus ${i.length} optional packages (auth, swagger, db, queue, …).`),console.log(" Run `kick add --list --all` for the full catalog.");console.log(`
385
- Usage: kick add ai db swagger`),console.log(` kick add queue:bullmq`),console.log(` kick add upload # installs the multipart driver for your runtime`),console.log()}function W(e,t,n=`express`){let r=new Set,i=new Set,a=[],o=[],s=[];for(let c of e){if(c===`upload`){let e=F[n];s.push(`upload (${n}): ${e.note}`),e.prod&&(t?i:r).add(e.prod),e.dev&&i.add(e.dev);continue}let e=N[c];if(!e){a.push(c);continue}e.deprecated&&o.push(`'${c}' (${e.pkg}) is deprecated — ${e.deprecated}`);let l=t||e.dev?i:r;l.add(e.pkg);for(let t of e.peers)l.add(t)}return{prodDeps:[...r],devDeps:[...i],unknown:a,warnings:o,notices:s}}function G(e){e.command(`list`).alias(`ls`).description(`List KickJS packages (core only; pair with --all for the full catalog)`).option(`--all`,`Include the full optional catalog`).action(e=>{U(!!e.all)})}function K(e){e.command(`add [packages...]`).description(`Add KickJS packages with their required dependencies`).option(`--pm <manager>`,`Package manager override`).option(`-D, --dev`,`Install as dev dependency`).option(`--list`,`List packages (core only by default; pair with --all)`).option(`--all`,`When listing, include the full optional catalog`).action(async(e,t)=>{if(t.list||e.length===0){U(!!t.all);return}let{pm:n,source:r}=await V(t.pm);console.log(`\n Using ${n} (resolved from ${r})`);let i=await I(process.cwd()),{prodDeps:a,devDeps:o,unknown:s,warnings:c,notices:l}=W(e,!!t.dev,i);for(let e of c)console.warn(`\n WARNING: ${e}`);for(let e of l)console.log(`\n ${e}`);if(!(s.length>0&&(console.log(`\n Unknown packages: ${s.join(`, `)}`),console.log(` Run "kick add --list" to see available packages.
385
+ Usage: kick add ai db swagger`),console.log(` kick add queue:bullmq`),console.log(` kick add upload # installs the multipart driver for your runtime`),console.log()}function K(e,t,n=`express`){let r=new Set,i=new Set,a=[],o=[],s=[];for(let c of e){if(c===`upload`){let e=R[n];s.push(`upload (${n}): ${e.note}`),e.prod&&(t?i:r).add(e.prod),e.dev&&i.add(e.dev);continue}let e=I[c];if(!e){a.push(c);continue}e.deprecated&&o.push(`'${c}' (${e.pkg}) is deprecated — ${e.deprecated}`);let l=t||e.dev?i:r;l.add(e.pkg);for(let t of e.peers)l.add(t)}return{prodDeps:[...r],devDeps:[...i],unknown:a,warnings:o,notices:s}}function q(e){e.command(`list`).alias(`ls`).description(`List KickJS packages (core only; pair with --all for the full catalog)`).option(`--all`,`Include the full optional catalog`).action(e=>{G(!!e.all)})}function J(e){e.command(`add [packages...]`).description(`Add KickJS packages with their required dependencies`).option(`--pm <manager>`,`Package manager override`).option(`-D, --dev`,`Install as dev dependency`).option(`--list`,`List packages (core only by default; pair with --all)`).option(`--all`,`When listing, include the full optional catalog`).action(async(e,t)=>{if(t.list||e.length===0){G(!!t.all);return}let{pm:n,source:r}=await U(t.pm);console.log(`\n Using ${n} (resolved from ${r})`);let i=await z(process.cwd()),{prodDeps:a,devDeps:o,unknown:s,warnings:c,notices:l}=K(e,!!t.dev,i);for(let e of c)console.warn(`\n WARNING: ${e}`);for(let e of l)console.log(`\n ${e}`);if(!(s.length>0&&(console.log(`\n Unknown packages: ${s.join(`, `)}`),console.log(` Run "kick add --list" to see available packages.
386
386
  `),a.length===0&&o.length===0))){if(a.length>0){let e=a,t=`${n} add ${e.join(` `)}`;console.log(`\n Installing ${e.length} dependency(ies):`);for(let t of e)console.log(` + ${t}`);console.log();try{d(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}if(o.length>0){let e=o,t=`${n} add -D ${e.join(` `)}`;console.log(`\n Installing ${e.length} dev dependency(ies):`);for(let t of e)console.log(` + ${t} (dev)`);console.log();try{d(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}console.log(` Done!
387
- `)}})}const q=o(l(import.meta.url)),J=JSON.parse(a(s(q,`..`,`package.json`),`utf-8`)),Y=`^${J.version}`,X=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-schema`,`@forinda/kickjs-vite`,`@forinda/kickjs-swagger`,`@forinda/kickjs-ws`,`@forinda/kickjs-queue`,`@forinda/kickjs-devtools`,`@forinda/kickjs-testing`,`@forinda/kickjs-client`];async function Z(){let e=await Promise.all(X.map(async e=>{try{let t=u(`npm`,[`view`,e,`version`],{encoding:`utf-8`,timeout:5e3,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim();if(t&&/^\d+\.\d+\.\d+/.test(t))return[e,`^${t}`]}catch{}return[e,Y]}));return Object.fromEntries(e)}function Q(e,t){try{let n=u(`npm`,[`view`,`${e}@${t}`,`version`],{encoding:`utf-8`,timeout:5e3,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim();return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}catch{return null}}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function ee(e,t){let n=e=>$(e).split(`-`)[0].split(`.`).map(e=>Number.parseInt(e,10)||0),[r=0,i=0,a=0]=n(e),[o=0,s=0,c=0]=n(t);return r===o?i===s?a>=c:i>s:r>o}function te(e,t,n){try{let r=u(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`],{encoding:`utf-8`,timeout:5e3,stdio:[`ignore`,`pipe`,`ignore`]}).toString().trim();if(!r)return!1;let i=JSON.parse(r);return Object.prototype.hasOwnProperty.call(i,n)}catch{return!1}}async function ne(e){let{name:t,directory:i,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:u=`zod`,runtime:f=`express`}=e,p=i,m=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${t}\n`),m(`Resolving package versions...`);let T=await Z();if(f!==`express`)if(te(`@forinda/kickjs`,`latest`,`./${f}`))m(`Using @forinda/kickjs@latest (stable ships the ${f} runtime)`);else{let e=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-vite`],t=[],n=!1;for(let r of e){let e=Q(r,`alpha`);e&&ee(e,$(T[r]))&&(T[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}m(n?`Using the alpha channel for the ${f} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${f} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}await n(s(p,`package.json`),h(t,o,T,l,u,f)),await n(s(p,`vite.config.ts`),g()),await n(s(p,`tsconfig.json`),_()),await n(s(p,`.prettierrc`),v()),await n(s(p,`.editorconfig`),y()),await n(s(p,`.gitignore`),b()),await n(s(p,`.gitattributes`),x()),await n(s(p,`.env`),S()),await n(s(p,`.env.example`),C()),await n(s(p,`src/config/index.ts`),O(u)),await n(s(p,`src/index.ts`),E(t,o,J.version,l,f)),await n(s(p,`src/modules/index.ts`),D()),await n(s(p,`src/modules/hello/hello.service.ts`),k()),await n(s(p,`src/modules/hello/hello.controller.ts`),A()),await n(s(p,`src/modules/hello/hello.module.ts`),j()),await n(s(p,`kick.config.ts`),M(o,c,a,f)),await n(s(p,`vitest.config.ts`),w()),await n(s(p,`README.md`),r(t,o,a));let{generateAgentDocs:N}=await import(`./agent-docs-B91ALPZR.mjs`).then(e=>e.t);if(await N({outDir:p,name:t,pm:a,template:o,only:`all`,force:!0}),e.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{d(`${a} install`,{cwd:p,stdio:`inherit`}),console.log(`
388
- Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-BZKiGXjW.mjs`).then(e=>e.n);await e({cwd:p,allowDuplicates:!0,silent:!0})}catch{}if(e.initGit)try{d(`git init`,{cwd:p,stdio:`pipe`}),d(`git branch -M main`,{cwd:p,stdio:`pipe`}),d(`git add -A`,{cwd:p,stdio:`pipe`}),d(`git commit -m "chore: initial commit from kick new"`,{cwd:p,stdio:`pipe`}),m(`Git repository initialized`)}catch{m(`Warning: git init failed (git may not be installed)`)}console.log(`
389
- Project scaffolded successfully!`),console.log();let F=p!==process.cwd();m(`Next steps:`),F&&m(` cd ${t}`),e.installDeps||m(` ${a} install`);let I={rest:`kick g module user`,ddd:`kick g module user --repo drizzle`,cqrs:`kick g module user --pattern cqrs`,minimal:`# add your routes to src/index.ts`};m(` ${I[o]??I.rest}`),m(` kick dev`),m(``),m(`Commands:`),m(` kick dev Start dev server with Vite HMR`),m(` kick build Production build via Vite`),m(` kick start Run production build`),m(``),m(`Generators:`),m(` kick g module <name> Full DDD module (controller, DTOs, use-cases, repo)`),m(` kick g scaffold <n> <f..> CRUD module from field definitions`),m(` kick g controller <name> Standalone controller`),m(` kick g service <name> @Service() class`),m(` kick g middleware <name> Express middleware`),m(` kick g guard <name> Route guard (auth, roles, etc.)`),m(` kick g adapter <name> AppAdapter with lifecycle hooks`),m(` kick g dto <name> Zod DTO schema`),m(` kick g config Generate kick.config.ts`),m(``),m(`Add packages:`),m(` kick add <pkg> Install a KickJS package + peers`),m(` kick add --list Show all available packages`),m(``),m(`Available: ${P}`),m(``)}export{K as a,H as c,F as i,Z as n,G as o,N as r,I as s,ne as t};
387
+ `)}})}const Y=o(l(import.meta.url)),X=JSON.parse(a(s(Y,`..`,`package.json`),`utf-8`)),ae=`^${X.version}`,oe=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-schema`,`@forinda/kickjs-vite`,`@forinda/kickjs-swagger`,`@forinda/kickjs-ws`,`@forinda/kickjs-queue`,`@forinda/kickjs-devtools`,`@forinda/kickjs-testing`,`@forinda/kickjs-client`];async function Z(){let e=await Promise.all(oe.map(async e=>{let t=h(`npm`,[`view`,e,`version`]);return t&&/^\d+\.\d+\.\d+/.test(t)?[e,`^${t}`]:[e,ae]}));return Object.fromEntries(e)}function se(e,t){let n=h(`npm`,[`view`,`${e}@${t}`,`version`]);return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function Q(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function ce(e,t){let n=e=>Q(e).split(`-`)[0].split(`.`).map(e=>Number.parseInt(e,10)||0),[r=0,i=0,a=0]=n(e),[o=0,s=0,c=0]=n(t);return r===o?i===s?a>=c:i>s:r>o}function le(e,t,n){let r=h(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`]);if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function $(e){let{name:t,directory:i,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:u=`zod`,runtime:f=`express`}=e,p=i,m=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${t}\n`),m(`Resolving package versions...`);let h=await Z();if(f!==`express`)if(le(`@forinda/kickjs`,`latest`,`./${f}`))m(`Using @forinda/kickjs@latest (stable ships the ${f} runtime)`);else{let e=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-vite`],t=[],n=!1;for(let r of e){let e=se(r,`alpha`);e&&ce(e,Q(h[r]))&&(h[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}m(n?`Using the alpha channel for the ${f} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${f} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}await n(s(p,`package.json`),S(t,o,h,l,u,f)),await n(s(p,`vite.config.ts`),C()),await n(s(p,`tsconfig.json`),w()),await n(s(p,`.prettierrc`),T()),await n(s(p,`.editorconfig`),ee()),await n(s(p,`.gitignore`),te()),await n(s(p,`.gitattributes`),ne()),await n(s(p,`.env`),re()),await n(s(p,`.env.example`),E()),await n(s(p,`src/config/index.ts`),j(u)),await n(s(p,`src/index.ts`),k(t,o,X.version,l,f)),await n(s(p,`src/modules/index.ts`),A()),await n(s(p,`src/modules/hello/hello.service.ts`),M()),await n(s(p,`src/modules/hello/hello.controller.ts`),N()),await n(s(p,`src/modules/hello/hello.module.ts`),P()),await n(s(p,`kick.config.ts`),F(o,c,a,f)),await n(s(p,`vitest.config.ts`),D()),await n(s(p,`README.md`),r(t,o,a));let{generateAgentDocs:g}=await import(`./agent-docs-BnGa_odb.mjs`).then(e=>e.t);if(await g({outDir:p,name:t,pm:a,template:o,only:`all`,force:!0}),e.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{d(`${a} install`,{cwd:p,stdio:`inherit`}),console.log(`
388
+ Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-ByZnBYdj.mjs`).then(e=>e.n);await e({cwd:p,allowDuplicates:!0,silent:!0})}catch{}if(e.initGit)try{d(`git init`,{cwd:p,stdio:`pipe`}),d(`git branch -M main`,{cwd:p,stdio:`pipe`}),d(`git add -A`,{cwd:p,stdio:`pipe`}),d(`git commit -m "chore: initial commit from kick new"`,{cwd:p,stdio:`pipe`}),m(`Git repository initialized`)}catch{m(`Warning: git init failed (git may not be installed)`)}console.log(`
389
+ Project scaffolded successfully!`),console.log();let _=p!==process.cwd();m(`Next steps:`),_&&m(` cd ${t}`),e.installDeps||m(` ${a} install`);let v={rest:`kick g module user`,ddd:`kick g module user --repo drizzle`,cqrs:`kick g module user --pattern cqrs`,minimal:`# add your routes to src/index.ts`};m(` ${v[o]??v.rest}`),m(` kick dev`),m(``),m(`Commands:`),m(` kick dev Start dev server with Vite HMR`),m(` kick build Production build via Vite`),m(` kick start Run production build`),m(``),m(`Generators:`),m(` kick g module <name> Full DDD module (controller, DTOs, use-cases, repo)`),m(` kick g scaffold <n> <f..> CRUD module from field definitions`),m(` kick g controller <name> Standalone controller`),m(` kick g service <name> @Service() class`),m(` kick g middleware <name> Express middleware`),m(` kick g guard <name> Route guard (auth, roles, etc.)`),m(` kick g adapter <name> AppAdapter with lifecycle hooks`),m(` kick g dto <name> Zod DTO schema`),m(` kick g config Generate kick.config.ts`),m(``),m(`Add packages:`),m(` kick add <pkg> Install a KickJS package + peers`),m(` kick add --list Show all available packages`),m(``),m(`Available: ${L}`),m(``)}export{J as a,W as c,_ as d,R as i,g as l,Z as n,q as o,I as r,z as s,$ as t,v as u};