@forinda/kickjs-cli 8.7.6 → 8.7.8

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-DXcSYjqf.mjs → agent-docs-JuchqDDh.mjs} +13 -13
  2. package/dist/{agent-docs-4sLAr8Vt.mjs → agent-docs-z03QAZuD.mjs} +14 -14
  3. package/dist/agent-docs-z03QAZuD.mjs.map +1 -0
  4. package/dist/{build-DbEwAA0D.mjs → build-BGkoUXcD.mjs} +2 -2
  5. package/dist/{build-BLMzeOBK.mjs → build-CLWPSTR5.mjs} +3 -3
  6. package/dist/{build-BLMzeOBK.mjs.map → build-CLWPSTR5.mjs.map} +1 -1
  7. package/dist/{builtins-BIUmRmL7.mjs → builtins-D36W_Nic.mjs} +7 -6
  8. package/dist/{builtins-DeVmgeVX.mjs → builtins-qf1biU2Q.mjs} +2 -2
  9. package/dist/cli.mjs +2 -2
  10. package/dist/{config-BC2UQsHr.mjs → config-2x1N_mV1.mjs} +2 -2
  11. package/dist/{config-QVJU9X2C.mjs → config-wzsPHJ1r.mjs} +3 -3
  12. package/dist/{config-QVJU9X2C.mjs.map → config-wzsPHJ1r.mjs.map} +1 -1
  13. package/dist/{doctor-DsdqPNpN.mjs → doctor-Cv8P4-Af.mjs} +5 -5
  14. package/dist/doctor-Cv8P4-Af.mjs.map +1 -0
  15. package/dist/{fs-XytuMx9n.mjs → fs-Cng50pl3.mjs} +2 -2
  16. package/dist/{fs-XytuMx9n.mjs.map → fs-Cng50pl3.mjs.map} +1 -1
  17. package/dist/{fs-w_fl0CbJ.mjs → fs-fU5dBnRJ.mjs} +1 -1
  18. package/dist/{fullstack-Cp2M--pD.mjs → fullstack-C88SUSlQ.mjs} +3 -3
  19. package/dist/{fullstack-Q2dr0cCq.mjs → fullstack-JqamVcE-.mjs} +4 -4
  20. package/dist/{fullstack-Q2dr0cCq.mjs.map → fullstack-JqamVcE-.mjs.map} +1 -1
  21. package/dist/index.d.mts.map +1 -1
  22. package/dist/index.mjs +2 -2
  23. package/dist/{plugin-DYsXt9h4.mjs → plugin-Bn3_FodU.mjs} +2 -2
  24. package/dist/{plugin-C5AOXfmq.mjs → plugin-gT0vvcCm.mjs} +2 -2
  25. package/dist/{project-DWffCRyL.mjs → project-B74aWTOZ.mjs} +5 -5
  26. package/dist/{project-root-CUjIsFNJ.mjs → project-root-B7nAxOl7.mjs} +2 -2
  27. package/dist/{project-root-fGCAvMQS.mjs → project-root-uvQJBEg3.mjs} +3 -3
  28. package/dist/{project-root-fGCAvMQS.mjs.map → project-root-uvQJBEg3.mjs.map} +1 -1
  29. package/dist/{project-BX52bTLz.mjs → project-ty_X8Qx9.mjs} +6 -6
  30. package/dist/{project-BX52bTLz.mjs.map → project-ty_X8Qx9.mjs.map} +1 -1
  31. package/dist/{prompts-C58zpKSp.mjs → prompts-CV5JHDs4.mjs} +2 -2
  32. package/dist/{prompts-C58zpKSp.mjs.map → prompts-CV5JHDs4.mjs.map} +1 -1
  33. package/dist/{rolldown-runtime-B7gmkk-L.mjs → rolldown-runtime-DBz5c2Bd.mjs} +1 -1
  34. package/dist/{run-plugins-C7273pNl.mjs → run-plugins-C3w0I62s.mjs} +6 -5
  35. package/dist/run-plugins-C3w0I62s.mjs.map +1 -0
  36. package/dist/{typegen-DJHxPQeq.mjs → typegen-OdQgDQBP.mjs} +5 -5
  37. package/dist/{typegen-DJHxPQeq.mjs.map → typegen-OdQgDQBP.mjs.map} +1 -1
  38. package/dist/{typegen-C40SHVWi.mjs → typegen-vKaJDE2e.mjs} +4 -4
  39. package/dist/{types-DZDRt1eU.mjs → types-BDzIj0W_.mjs} +1 -1
  40. package/package.json +3 -3
  41. package/templates/base/files/README.md +40 -4
  42. package/templates/schema-valibot/feature.json +1 -1
  43. package/dist/agent-docs-4sLAr8Vt.mjs.map +0 -1
  44. package/dist/doctor-DsdqPNpN.mjs.map +0 -1
  45. package/dist/run-plugins-C7273pNl.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,10 +8,10 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{a as e,d as t,f as n,n as r,t as i,u as a}from"./project-DWffCRyL.mjs";import{r as o}from"./fs-w_fl0CbJ.mjs";import{join as s}from"node:path";import{execFileSync as c}from"node:child_process";const l=`https://kickjs.app/guide/fullstack-frontend.html`,u=[{value:`react-ts`,label:`React`},{value:`react-compiler-ts`,label:`React + Compiler`},{value:`vue-ts`,label:`Vue`},{value:`svelte-ts`,label:`Svelte`},{value:`solid-ts`,label:`Solid`},{value:`preact-ts`,label:`Preact`},{value:`lit-ts`,label:`Lit`},{value:`qwik-ts`,label:`Qwik`},{value:`vanilla-ts`,label:`Vanilla`}],d=`react-ts`;function f(e,t,n=d){let r=[`--template`,n,`--no-interactive`,`--no-immediate`];return e===`yarn`||e===`bun`?[e,`create`,`vite`,t,...r]:e===`npm`?[e,`create`,`vite@latest`,t,`--`,...r]:[e,`create`,`vite@latest`,t,...r]}async function p(u){let{name:p,directory:_,schemaLib:v=`zod`,runtime:y=`express`,packages:b=[],frontend:x=`kick`,viteTemplate:S=d}=u,C=[`pnpm`,`npm`,`yarn`,`bun`].includes(u.packageManager),w=C?u.packageManager:`pnpm`,T=_,E=e=>console.log(` ${e}`);u.packageManager!==void 0&&!C&&E(`Warning: unknown package manager '${String(u.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${p}\n`),console.log(` Resolving package versions...`);let D=await r(),O=await i({name:`${p}-server`,directory:s(T,`server`),packageManager:w,template:`minimal`,schemaLib:v,runtime:y,packages:b,extraLayers:[`server-fullstack`],approveInstallScripts:!1,platformConfig:!1,initGit:!1,installDeps:!1,spaClientDir:`../web/dist`,versions:D});if(x===`vite`){console.log(`\n Handing web/ to create-vite (${S})...\n`);let[e,...t]=f(w,`web`,S);n(e,t,{cwd:T})}else await o(s(T,`web/package.json`),m(p,D));await o(s(T,`package.json`),h(p,w,D[`@forinda/kickjs-cli`])),w===`pnpm`&&await o(s(T,`pnpm-workspace.yaml`),`packages:
11
+ import{a as e,d as t,f as n,n as r,t as i,u as a}from"./project-B74aWTOZ.mjs";import{r as o}from"./fs-fU5dBnRJ.mjs";import{join as s}from"node:path";import{execFileSync as c}from"node:child_process";const l=`https://kickjs.app/guide/fullstack-frontend.html`,u=[{value:`react-ts`,label:`React`},{value:`react-compiler-ts`,label:`React + Compiler`},{value:`vue-ts`,label:`Vue`},{value:`svelte-ts`,label:`Svelte`},{value:`solid-ts`,label:`Solid`},{value:`preact-ts`,label:`Preact`},{value:`lit-ts`,label:`Lit`},{value:`qwik-ts`,label:`Qwik`},{value:`vanilla-ts`,label:`Vanilla`}],d=`react-ts`;function f(e,t,n=d){let r=[`--template`,n,`--no-interactive`,`--no-immediate`];return e===`yarn`||e===`bun`?[e,`create`,`vite`,t,...r]:e===`npm`?[e,`create`,`vite@latest`,t,`--`,...r]:[e,`create`,`vite@latest`,t,...r]}async function p(u){let{name:p,directory:_,schemaLib:v=`zod`,runtime:y=`express`,packages:b=[],frontend:x=`kick`,viteTemplate:S=d}=u,C=[`pnpm`,`npm`,`yarn`,`bun`].includes(u.packageManager),w=C?u.packageManager:`pnpm`,T=_,E=e=>console.log(` ${e}`);u.packageManager!==void 0&&!C&&E(`Warning: unknown package manager '${String(u.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${p}\n`),console.log(` Resolving package versions...`);let D=await r(),O=await i({name:`${p}-server`,directory:s(T,`server`),packageManager:w,template:`minimal`,schemaLib:v,runtime:y,packages:b,extraLayers:[`server-fullstack`],approveInstallScripts:!1,platformConfig:!1,initGit:!1,installDeps:!1,spaClientDir:`../web/dist`,versions:D});if(x===`vite`){console.log(`\n Handing web/ to create-vite (${S})...\n`);let[e,...t]=f(w,`web`,S);n(e,t,{cwd:T})}else await o(s(T,`web/package.json`),m(p,D));await o(s(T,`package.json`),h(p,w,D[`@forinda/kickjs-cli`])),w===`pnpm`&&await o(s(T,`pnpm-workspace.yaml`),`packages:
12
12
  - server
13
13
  - web
14
- `),e(w,T,O.builds);let k=[`fullstack-root`,...x===`vite`?[]:[`web-kick`]],A=a(t(k).files,{name:p,packageManager:w});for(let[e,t]of A)await o(s(T,e),t);await o(s(T,`README.md`),g(p,w,x));let{generateAgentDocs:j}=await import(`./agent-docs-DXcSYjqf.mjs`).then(e=>e.t);if(await j({outDir:T,name:p,pm:w,template:`fullstack`,only:`all`,force:!0}),u.installDeps){console.log(`\n Installing workspace dependencies with ${w}...\n`);try{n(w,[`install`],{cwd:T})}catch{console.log(`\n Warning: ${w} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-C40SHVWi.mjs`).then(e=>e.n);await e({cwd:s(T,`server`),allowDuplicates:!0,silent:!0})}catch{}if(u.initGit)try{c(`git`,[`init`],{cwd:T,stdio:`pipe`}),c(`git`,[`branch`,`-M`,`main`],{cwd:T,stdio:`pipe`}),c(`git`,[`add`,`-A`],{cwd:T,stdio:`pipe`}),c(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:T,stdio:`pipe`}),E(`Git repository initialized`)}catch{E(`Warning: git init failed (git may not be installed)`)}console.log(`
14
+ `),e(w,T,O.builds);let k=[`fullstack-root`,...x===`vite`?[]:[`web-kick`]],A=a(t(k).files,{name:p,packageManager:w});for(let[e,t]of A)await o(s(T,e),t);await o(s(T,`README.md`),g(p,w,x));let{generateAgentDocs:j}=await import(`./agent-docs-JuchqDDh.mjs`).then(e=>e.t);if(await j({outDir:T,name:p,pm:w,template:`fullstack`,only:`all`,force:!0}),u.installDeps){console.log(`\n Installing workspace dependencies with ${w}...\n`);try{n(w,[`install`],{cwd:T})}catch{console.log(`\n Warning: ${w} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-vKaJDE2e.mjs`).then(e=>e.n);await e({cwd:s(T,`server`),allowDuplicates:!0,silent:!0})}catch{}if(u.initGit)try{c(`git`,[`init`],{cwd:T,stdio:`pipe`}),c(`git`,[`branch`,`-M`,`main`],{cwd:T,stdio:`pipe`}),c(`git`,[`add`,`-A`],{cwd:T,stdio:`pipe`}),c(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:T,stdio:`pipe`}),E(`Git repository initialized`)}catch{E(`Warning: git init failed (git may not be installed)`)}console.log(`
15
15
  Fullstack workspace scaffolded!`),console.log(),E(`Next steps:`),E(` cd ${p}`),u.installDeps||E(` ${w} install`),w===`pnpm`?E(` pnpm dev # runs server (kick dev) + web (vite) together`):(E(` ${w} run dev:server # terminal 1`),E(` ${w} run dev:web # terminal 2`)),E(``),x===`vite`?(E(`web/ is create-vite output, unwired. To type it against the API:`),E(` ${l}`)):(E(`The web app calls the API through @forinda/kickjs-client —`),E(`edit server/src/modules/hello and watch web/src/App.tsx's types follow.`)),E(``)}function m(e,t){let n=e=>t[e]??`latest`;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":n(`@forinda/kickjs-client`),react:n(`react`),"react-dom":n(`react-dom`)},devDependencies:{"@types/react":n(`@types/react`),"@types/react-dom":n(`@types/react-dom`),"@vitejs/plugin-react":n(`@vitejs/plugin-react`),typescript:n(`typescript`),vite:n(`vite`)}},null,2)}\n`}function h(e,t,n){let r=t===`pnpm`?{dev:`pnpm --parallel -r run dev`,start:`pnpm --filter ./server run start`,"dev:server":`pnpm --filter ./server dev`,"dev:web":`pnpm --filter ./web dev`,build:`pnpm --filter ./server exec kick typegen && pnpm -r run build`,"build:netlify":`pnpm build && pnpm --filter ./server exec kick build:netlify`,"build:vercel":`pnpm build && pnpm --filter ./server exec kick build:vercel`,typecheck:`kick typecheck --cwd server && kick typecheck --cwd web`}:{start:`cd server && ${t} run start`,"dev:server":`cd server && ${t} run dev`,"dev:web":`cd web && ${t} run dev`,build:`cd server && ${t} exec kick typegen && cd .. && ${t} run build:server && ${t} run build:web`,"build:netlify":`${t} run build && cd server && ${t} exec kick build:netlify`,"build:vercel":`${t} run build && cd server && ${t} exec kick build:vercel`,"build:server":`cd server && ${t} run build`,"build:web":`cd web && ${t} run build`,typecheck:`kick typecheck --cwd server && kick typecheck --cwd web`};return`${JSON.stringify({name:e,private:!0,version:`0.0.0`,type:`module`,scripts:r,devDependencies:{"@forinda/kickjs-cli":n},workspaces:[`server`,`web`]},null,2)}\n`}function g(e,t,n=`kick`){let r=`# ${e}
16
16
 
17
17
  Fullstack KickJS workspace — typed end to end.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,10 +8,10 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{r as e}from"./fs-XytuMx9n.mjs";import{a as t,f as n,n as r,p as i,t as a,u as o}from"./project-BX52bTLz.mjs";import{join as s}from"node:path";import{execFileSync as c}from"node:child_process";const l=`https://kickjs.app/guide/fullstack-frontend.html`,u=[{value:`react-ts`,label:`React`},{value:`react-compiler-ts`,label:`React + Compiler`},{value:`vue-ts`,label:`Vue`},{value:`svelte-ts`,label:`Svelte`},{value:`solid-ts`,label:`Solid`},{value:`preact-ts`,label:`Preact`},{value:`lit-ts`,label:`Lit`},{value:`qwik-ts`,label:`Qwik`},{value:`vanilla-ts`,label:`Vanilla`}],d=`react-ts`;function f(e,t,n=d){let r=[`--template`,n,`--no-interactive`,`--no-immediate`];return e===`yarn`||e===`bun`?[e,`create`,`vite`,t,...r]:e===`npm`?[e,`create`,`vite@latest`,t,`--`,...r]:[e,`create`,`vite@latest`,t,...r]}async function p(u){let{name:p,directory:_,schemaLib:v=`zod`,runtime:y=`express`,packages:b=[],frontend:x=`kick`,viteTemplate:S=d}=u,C=[`pnpm`,`npm`,`yarn`,`bun`].includes(u.packageManager),w=C?u.packageManager:`pnpm`,T=_,E=e=>console.log(` ${e}`);u.packageManager!==void 0&&!C&&E(`Warning: unknown package manager '${String(u.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${p}\n`),console.log(` Resolving package versions...`);let D=await r(),O=await a({name:`${p}-server`,directory:s(T,`server`),packageManager:w,template:`minimal`,schemaLib:v,runtime:y,packages:b,extraLayers:[`server-fullstack`],approveInstallScripts:!1,platformConfig:!1,initGit:!1,installDeps:!1,spaClientDir:`../web/dist`,versions:D});if(x===`vite`){console.log(`\n Handing web/ to create-vite (${S})...\n`);let[e,...t]=f(w,`web`,S);o(e,t,{cwd:T})}else await e(s(T,`web/package.json`),m(p,D));await e(s(T,`package.json`),h(p,w,D[`@forinda/kickjs-cli`])),w===`pnpm`&&await e(s(T,`pnpm-workspace.yaml`),`packages:
11
+ import{r as e}from"./fs-Cng50pl3.mjs";import{a as t,f as n,n as r,p as i,t as a,u as o}from"./project-ty_X8Qx9.mjs";import{join as s}from"node:path";import{execFileSync as c}from"node:child_process";const l=`https://kickjs.app/guide/fullstack-frontend.html`,u=[{value:`react-ts`,label:`React`},{value:`react-compiler-ts`,label:`React + Compiler`},{value:`vue-ts`,label:`Vue`},{value:`svelte-ts`,label:`Svelte`},{value:`solid-ts`,label:`Solid`},{value:`preact-ts`,label:`Preact`},{value:`lit-ts`,label:`Lit`},{value:`qwik-ts`,label:`Qwik`},{value:`vanilla-ts`,label:`Vanilla`}],d=`react-ts`;function f(e,t,n=d){let r=[`--template`,n,`--no-interactive`,`--no-immediate`];return e===`yarn`||e===`bun`?[e,`create`,`vite`,t,...r]:e===`npm`?[e,`create`,`vite@latest`,t,`--`,...r]:[e,`create`,`vite@latest`,t,...r]}async function p(u){let{name:p,directory:_,schemaLib:v=`zod`,runtime:y=`express`,packages:b=[],frontend:x=`kick`,viteTemplate:S=d}=u,C=[`pnpm`,`npm`,`yarn`,`bun`].includes(u.packageManager),w=C?u.packageManager:`pnpm`,T=_,E=e=>console.log(` ${e}`);u.packageManager!==void 0&&!C&&E(`Warning: unknown package manager '${String(u.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${p}\n`),console.log(` Resolving package versions...`);let D=await r(),O=await a({name:`${p}-server`,directory:s(T,`server`),packageManager:w,template:`minimal`,schemaLib:v,runtime:y,packages:b,extraLayers:[`server-fullstack`],approveInstallScripts:!1,platformConfig:!1,initGit:!1,installDeps:!1,spaClientDir:`../web/dist`,versions:D});if(x===`vite`){console.log(`\n Handing web/ to create-vite (${S})...\n`);let[e,...t]=f(w,`web`,S);o(e,t,{cwd:T})}else await e(s(T,`web/package.json`),m(p,D));await e(s(T,`package.json`),h(p,w,D[`@forinda/kickjs-cli`])),w===`pnpm`&&await e(s(T,`pnpm-workspace.yaml`),`packages:
12
12
  - server
13
13
  - web
14
- `),t(w,T,O.builds);let k=[`fullstack-root`,...x===`vite`?[]:[`web-kick`]],A=n(i(k).files,{name:p,packageManager:w});for(let[t,n]of A)await e(s(T,t),n);await e(s(T,`README.md`),g(p,w,x));let{generateAgentDocs:j}=await import(`./agent-docs-4sLAr8Vt.mjs`).then(e=>e.t);if(await j({outDir:T,name:p,pm:w,template:`fullstack`,only:`all`,force:!0}),u.installDeps){console.log(`\n Installing workspace dependencies with ${w}...\n`);try{o(w,[`install`],{cwd:T})}catch{console.log(`\n Warning: ${w} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-DJHxPQeq.mjs`).then(e=>e.n);await e({cwd:s(T,`server`),allowDuplicates:!0,silent:!0})}catch{}if(u.initGit)try{c(`git`,[`init`],{cwd:T,stdio:`pipe`}),c(`git`,[`branch`,`-M`,`main`],{cwd:T,stdio:`pipe`}),c(`git`,[`add`,`-A`],{cwd:T,stdio:`pipe`}),c(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:T,stdio:`pipe`}),E(`Git repository initialized`)}catch{E(`Warning: git init failed (git may not be installed)`)}console.log(`
14
+ `),t(w,T,O.builds);let k=[`fullstack-root`,...x===`vite`?[]:[`web-kick`]],A=n(i(k).files,{name:p,packageManager:w});for(let[t,n]of A)await e(s(T,t),n);await e(s(T,`README.md`),g(p,w,x));let{generateAgentDocs:j}=await import(`./agent-docs-z03QAZuD.mjs`).then(e=>e.t);if(await j({outDir:T,name:p,pm:w,template:`fullstack`,only:`all`,force:!0}),u.installDeps){console.log(`\n Installing workspace dependencies with ${w}...\n`);try{o(w,[`install`],{cwd:T})}catch{console.log(`\n Warning: ${w} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-OdQgDQBP.mjs`).then(e=>e.n);await e({cwd:s(T,`server`),allowDuplicates:!0,silent:!0})}catch{}if(u.initGit)try{c(`git`,[`init`],{cwd:T,stdio:`pipe`}),c(`git`,[`branch`,`-M`,`main`],{cwd:T,stdio:`pipe`}),c(`git`,[`add`,`-A`],{cwd:T,stdio:`pipe`}),c(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:T,stdio:`pipe`}),E(`Git repository initialized`)}catch{E(`Warning: git init failed (git may not be installed)`)}console.log(`
15
15
  Fullstack workspace scaffolded!`),console.log(),E(`Next steps:`),E(` cd ${p}`),u.installDeps||E(` ${w} install`),w===`pnpm`?E(` pnpm dev # runs server (kick dev) + web (vite) together`):(E(` ${w} run dev:server # terminal 1`),E(` ${w} run dev:web # terminal 2`)),E(``),x===`vite`?(E(`web/ is create-vite output, unwired. To type it against the API:`),E(` ${l}`)):(E(`The web app calls the API through @forinda/kickjs-client —`),E(`edit server/src/modules/hello and watch web/src/App.tsx's types follow.`)),E(``)}function m(e,t){let n=e=>t[e]??`latest`;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":n(`@forinda/kickjs-client`),react:n(`react`),"react-dom":n(`react-dom`)},devDependencies:{"@types/react":n(`@types/react`),"@types/react-dom":n(`@types/react-dom`),"@vitejs/plugin-react":n(`@vitejs/plugin-react`),typescript:n(`typescript`),vite:n(`vite`)}},null,2)}\n`}function h(e,t,n){let r=t===`pnpm`?{dev:`pnpm --parallel -r run dev`,start:`pnpm --filter ./server run start`,"dev:server":`pnpm --filter ./server dev`,"dev:web":`pnpm --filter ./web dev`,build:`pnpm --filter ./server exec kick typegen && pnpm -r run build`,"build:netlify":`pnpm build && pnpm --filter ./server exec kick build:netlify`,"build:vercel":`pnpm build && pnpm --filter ./server exec kick build:vercel`,typecheck:`kick typecheck --cwd server && kick typecheck --cwd web`}:{start:`cd server && ${t} run start`,"dev:server":`cd server && ${t} run dev`,"dev:web":`cd web && ${t} run dev`,build:`cd server && ${t} exec kick typegen && cd .. && ${t} run build:server && ${t} run build:web`,"build:netlify":`${t} run build && cd server && ${t} exec kick build:netlify`,"build:vercel":`${t} run build && cd server && ${t} exec kick build:vercel`,"build:server":`cd server && ${t} run build`,"build:web":`cd web && ${t} run build`,typecheck:`kick typecheck --cwd server && kick typecheck --cwd web`};return`${JSON.stringify({name:e,private:!0,version:`0.0.0`,type:`module`,scripts:r,devDependencies:{"@forinda/kickjs-cli":n},workspaces:[`server`,`web`]},null,2)}\n`}function g(e,t,n=`kick`){let r=`# ${e}
16
16
 
17
17
  Fullstack KickJS workspace — typed end to end.
@@ -93,4 +93,4 @@ Four steps — typed client, \`/api\` dev proxy, route-map types, \`src/api.ts\`
93
93
 
94
94
  ${l}
95
95
  `}export{d as DEFAULT_VITE_TEMPLATE,u as VITE_TEMPLATES,p as initFullstackProject};
96
- //# sourceMappingURL=fullstack-Q2dr0cCq.mjs.map
96
+ //# sourceMappingURL=fullstack-JqamVcE-.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fullstack-Q2dr0cCq.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__client.d.ts → web tsconfig `types` (ambient)\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'\nimport { approveInstallScripts } from '../commands/add'\nimport { fillVars, renderLayers } from '../scaffold/overlay'\n\n/** Wiring a frontend we did not scaffold: typed client, proxy, route types. */\nexport const FRONTEND_WIRING_URL = 'https://kickjs.app/guide/fullstack-frontend.html'\n\n/**\n * create-vite's TypeScript templates, in the order it lists them. Only the\n * `-ts` half: the wiring is typed — the route map is a `.d.ts` and the client\n * is `createClient<KickClientApi.Api>` — so a JavaScript template would leave\n * the reader following a guide that cannot apply.\n */\nexport const VITE_TEMPLATES = [\n { value: 'react-ts', label: 'React' },\n { value: 'react-compiler-ts', label: 'React + Compiler' },\n { value: 'vue-ts', label: 'Vue' },\n { value: 'svelte-ts', label: 'Svelte' },\n { value: 'solid-ts', label: 'Solid' },\n { value: 'preact-ts', label: 'Preact' },\n { value: 'lit-ts', label: 'Lit' },\n { value: 'qwik-ts', label: 'Qwik' },\n { value: 'vanilla-ts', label: 'Vanilla' },\n] as const\n\nexport const DEFAULT_VITE_TEMPLATE = 'react-ts'\n\n/**\n * How each package manager runs create-vite, with the framework decided here\n * rather than by its prompts:\n *\n * - `--template` picks a TypeScript template, so the wiring guide applies;\n * - `--no-interactive` means it never waits for input (CI, `--yes`);\n * - `--no-immediate` stops it installing and launching a dev server — the\n * workspace install happens once, at the root, after this returns.\n */\nexport function createViteCommand(\n pm: 'pnpm' | 'npm' | 'yarn' | 'bun',\n dir: string,\n template: string = DEFAULT_VITE_TEMPLATE,\n): string[] {\n const flags = ['--template', template, '--no-interactive', '--no-immediate']\n // yarn and bun resolve `create vite` to create-vite themselves; npm and pnpm\n // take the versioned package name, and npm needs `--` before the flags or it\n // eats them itself.\n if (pm === 'yarn' || pm === 'bun') return [pm, 'create', 'vite', dir, ...flags]\n if (pm === 'npm') return [pm, 'create', 'vite@latest', dir, '--', ...flags]\n return [pm, 'create', 'vite@latest', dir, ...flags]\n}\n\nexport interface InitFullstackOptions {\n name: string\n directory: string\n packageManager?: 'pnpm' | 'npm' | 'yarn' | 'bun'\n /**\n * Who scaffolds `web/`. `'kick'` writes the wired React app (typed client,\n * dev proxy, route-map types). `'vite'` hands the directory to\n * `create-vite` and wires nothing — you pick the framework, and the guide\n * at {@link FRONTEND_WIRING_URL} covers connecting it.\n */\n frontend?: 'kick' | 'vite'\n /** create-vite template for `frontend: 'vite'`. Default `react-ts`. */\n viteTemplate?: string\n initGit?: boolean\n installDeps?: boolean\n schemaLib?: 'zod' | 'valibot' | 'yup'\n runtime?: 'express' | 'fastify' | 'h3'\n /** Optional packages (`--packages`), wired into the server like a plain scaffold. */\n packages?: string[]\n}\n\nexport async function initFullstackProject(options: InitFullstackOptions): Promise<void> {\n const {\n name,\n directory,\n schemaLib = 'zod',\n runtime = 'express',\n packages = [],\n frontend = 'kick',\n viteTemplate = DEFAULT_VITE_TEMPLATE,\n } = 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 // One map for both packages: the workspace shares a toolchain, so server/\n // and web/ must not end up on different vite or TypeScript majors.\n console.log(' Resolving package versions...')\n const versions = await resolveSiblingVersions()\n\n // ── server/ — the standard scaffold, deferred install/git ──────────\n const server = await initProject({\n name: `${name}-server`,\n directory: join(dir, 'server'),\n packageManager,\n template: 'minimal',\n schemaLib,\n runtime,\n packages,\n // The client route map web/ reads (with the compiler API it needs), and a\n // strict port — web/vite.config.ts proxies /api to it, so moving to\n // another port would silently reach the wrong process.\n extraLayers: ['server-fullstack'],\n // server/ is a workspace member; the root records the approvals.\n approveInstallScripts: false,\n // netlify.toml / vercel.json live at the workspace root, written below.\n platformConfig: false,\n // Root owns install + git so the lockfile/commit cover the workspace.\n initGit: false,\n installDeps: false,\n // Production single-origin serving. `web/` builds to `web/dist`, and\n // nothing served it before — `pnpm build` produced a frontend the API had\n // no way to hand out, so every deploy needed a hand-wired static host or\n // a second process. The adapter is inert until `../web/dist` exists, so\n // `dev` (Vite serves the client and proxies /api here) is untouched.\n spaClientDir: '../web/dist',\n versions,\n })\n\n // ── web/ — either our wired React app, or whatever create-vite makes ──\n if (frontend === 'vite') {\n // create-vite scaffolds it with the chosen TypeScript template. Nothing\n // is patched afterwards: a scaffold we didn't write is not ours to\n // rewrite, and the wiring is four steps in the guide.\n console.log(`\\n Handing web/ to create-vite (${viteTemplate})...\\n`)\n const [file, ...args] = createViteCommand(packageManager, 'web', viteTemplate)\n runCommand(file!, args, { cwd: dir })\n } else {\n // The wired React app (typed client, dev proxy, route-map types): its\n // package.json here, its files from the web-kick layer below.\n await writeFileSafe(join(dir, 'web/package.json'), webPackageJson(name, versions))\n }\n\n // ── workspace root ──────────────────────────────────────────────────\n await writeFileSafe(\n join(dir, 'package.json'),\n rootPackageJson(name, packageManager, versions['@forinda/kickjs-cli']),\n )\n // Only pnpm reads this file. npm / yarn / bun declare workspaces via the\n // `workspaces` field in the root package.json instead — see rootPackageJson.\n if (packageManager === 'pnpm') {\n await writeFileSafe(join(dir, 'pnpm-workspace.yaml'), 'packages:\\n - server\\n - web\\n')\n }\n // Before install, at the root every package manager reads them from.\n approveInstallScripts(packageManager, dir, server.builds)\n // .gitignore, and netlify.toml / vercel.json at the root both platforms\n // build from; plus the kick web app's files under web/.\n const layers = ['fullstack-root', ...(frontend === 'vite' ? [] : ['web-kick'])]\n const files = fillVars(renderLayers(layers).files, { name, packageManager })\n for (const [path, contents] of files) {\n await writeFileSafe(join(dir, path), contents)\n }\n await writeFileSafe(join(dir, 'README.md'), rootReadme(name, packageManager, frontend))\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 if (frontend === 'vite') {\n // Nothing in web/ knows about the API yet — say so, and say where the\n // four wiring steps live rather than half-wiring someone else's scaffold.\n log('web/ is create-vite output, unwired. To type it against the API:')\n log(` ${FRONTEND_WIRING_URL}`)\n } else {\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 }\n log('')\n}\n\n// ── web templates ─────────────────────────────────────────────────────\n\nfunction webPackageJson(name: string, versions: Record<string, string>): string {\n // Every range here is resolved at scaffold time — see THIRD_PARTY_PACKAGES.\n const dep = (pkg: string) => versions[pkg] ?? 'latest'\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': dep('@forinda/kickjs-client'),\n react: dep('react'),\n 'react-dom': dep('react-dom'),\n },\n devDependencies: {\n '@types/react': dep('@types/react'),\n '@types/react-dom': dep('@types/react-dom'),\n '@vitejs/plugin-react': dep('@vitejs/plugin-react'),\n // Same majors as the server package: one workspace, one toolchain.\n typescript: dep('typescript'),\n vite: dep('vite'),\n },\n },\n null,\n 2,\n )}\\n`\n}\n\n// ── root templates ────────────────────────────────────────────────────\n\nfunction rootPackageJson(name: string, pm: string, cliVersion: string): string {\n const scripts: Record<string, string> =\n pm === 'pnpm'\n ? {\n dev: 'pnpm --parallel -r run dev',\n // One origin: the server serves `web/dist` through SpaAdapter.\n start: 'pnpm --filter ./server run start',\n 'dev:server': 'pnpm --filter ./server dev',\n 'dev:web': 'pnpm --filter ./web dev',\n // Typegen first: web's `tsc` reads server/.kickjs/types, which is\n // git-ignored, so a fresh clone (CI, Netlify, Vercel) has none and\n // `pnpm -r run build` races the two packages anyway.\n build: 'pnpm --filter ./server exec kick typegen && pnpm -r run build',\n 'build:netlify': 'pnpm build && pnpm --filter ./server exec kick build:netlify',\n 'build:vercel': 'pnpm build && pnpm --filter ./server exec kick build:vercel',\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\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 start: `cd server && ${pm} run start`,\n 'dev:server': `cd server && ${pm} run dev`,\n 'dev:web': `cd web && ${pm} run dev`,\n // Typegen first — see the pnpm branch above.\n build: `cd server && ${pm} exec kick typegen && cd .. && ${pm} run build:server && ${pm} run build:web`,\n 'build:netlify': `${pm} run build && cd server && ${pm} exec kick build:netlify`,\n 'build:vercel': `${pm} run build && cd server && ${pm} exec kick build:vercel`,\n 'build:server': `cd server && ${pm} run build`,\n 'build:web': `cd web && ${pm} run build`,\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\n }\n return `${JSON.stringify(\n {\n name,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts,\n // The CLI is a ROOT dependency so the bare `kick` in the scripts above\n // resolves: package managers put `node_modules/.bin` on PATH for\n // scripts, and the CLI otherwise lives only in `server/node_modules`.\n devDependencies: { '@forinda/kickjs-cli': cliVersion },\n workspaces: ['server', 'web'],\n },\n null,\n 2,\n )}\\n`\n}\n\nexport function rootReadme(name: string, pm: string, frontend: 'kick' | 'vite' = 'kick'): string {\n const readme = `# ${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\\` emits \\`server/.kickjs/types/kick__client.d.ts\\` — the flat\n route map with every response type resolved to a literal shape.\n3. \\`web/tsconfig.json\\` lists that file in \\`types\\`, so \\`KickClientApi\\` is\n ambient — no import, no bridge file.\n4. \\`web/src/api.ts\\`'s \\`createClient<KickClientApi.Api>\\` types every call site.\n\nBecause the map holds resolved types rather than references to controllers,\n\\`web\\` never compiles server source: no \\`experimentalDecorators\\`, no path\naliases into \\`server/src\\`.\n\nRename a field in \\`server/src/modules/hello/hello.service.ts\\` → \\`web/src/App.tsx\\`\nstops compiling. That's the point.\n\n### Keeping the map fresh\n\n\\`server/.kickjs/types/kick__client.d.ts\\` is generated, and \\`web\\` reads it as\nan ambient type package. Two things follow.\n\n**It is not refreshed by \\`kick dev\\`.** Resolving it builds a whole TypeScript\nprogram over the server, which is a build-step cost rather than a per-save one,\nso a renamed response field surfaces on the next \\`kick typegen\\` rather than on\nsave. Everything else in \\`.kickjs/types\\` still updates on save. Add\n\\`kick typegen --check\\` to CI and a stale map fails the build.\n\n**It needs a compiler API.** TypeScript 7 ships none, so \\`server\\` depends on\n\\`@typescript/typescript6\\`. Remove it and typegen skips this one file, saying\nso; \\`web\\` then reports \\`TS2688\\` because the file it lists in \\`types\\` is gone.\n\n### The other way to wire it\n\nA \\`types\\` entry says \"this is a global type package\", which is what the map is,\nand it fails loudly when the file is missing. If you would rather it be quiet\nwhen absent — say, a repo where the map is not always generated — use\n\\`include\\` instead:\n\n\\`\\`\\`json\n{ \"include\": [\"src\", \"../server/.kickjs/types/kick__client.d.ts\"] }\n\\`\\`\\`\n\nThat tolerates the file not existing, at the cost of \\`KickClientApi\\` silently\nnot resolving. Note \\`types\\` replaces TypeScript's automatic \\`@types\\`\ninclusion, so if you add entries there, list the ones you rely on too\n(\\`\"types\": [\"node\", \"../server/.kickjs/types/kick__client\"]\\`).\n\nOr skip the global entirely — the same file exports the type:\n\n\\`\\`\\`ts\nimport type { Api } from '../../server/.kickjs/types/kick__client'\n\nexport const api = createClient<Api>({ baseUrl: '/api/v1' })\n\\`\\`\\`\n\nDocs: https://kickjs.app/guide/typed-client.html\n`\n\n if (frontend !== 'vite') return readme\n\n // create-vite's output is not ours to describe: it has no typed client, no\n // proxy and no route-map types until the reader wires them. Everything from\n // \"The type loop\" on is about files that do not exist in that scaffold.\n const typeLoop = readme.indexOf('## The type loop')\n return `${readme\n .slice(0, typeLoop)\n .replace(\n 'Vite + React, typed against the API via `@forinda/kickjs-client`',\n 'create-vite scaffold — unwired (see below) ',\n )\n .replace(' (Vite proxies `/api`)', '')}## Wiring web/ to the API\n\n\\`web/\\` is whatever create-vite scaffolded; nothing conn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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+DjK,GAAI,IAAa,OAAQ,OAAO,EAKhC,IAAM,EAAW,EAAO,QAAQ,kBAAkB,EAClD,MAAO,GAAG,EACP,MAAM,EAAG,CAAQ,CAAC,CAClB,QACC,mEACA,mEACF,CAAC,CACA,QAAQ,yBAA0B,EAAE,EAAE;;;;;EAKzC,EAAoB;CAEtB"}
1
+ {"version":3,"file":"fullstack-JqamVcE-.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__client.d.ts → web tsconfig `types` (ambient)\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'\nimport { approveInstallScripts } from '../commands/add'\nimport { fillVars, renderLayers } from '../scaffold/overlay'\n\n/** Wiring a frontend we did not scaffold: typed client, proxy, route types. */\nexport const FRONTEND_WIRING_URL = 'https://kickjs.app/guide/fullstack-frontend.html'\n\n/**\n * create-vite's TypeScript templates, in the order it lists them. Only the\n * `-ts` half: the wiring is typed — the route map is a `.d.ts` and the client\n * is `createClient<KickClientApi.Api>` — so a JavaScript template would leave\n * the reader following a guide that cannot apply.\n */\nexport const VITE_TEMPLATES = [\n { value: 'react-ts', label: 'React' },\n { value: 'react-compiler-ts', label: 'React + Compiler' },\n { value: 'vue-ts', label: 'Vue' },\n { value: 'svelte-ts', label: 'Svelte' },\n { value: 'solid-ts', label: 'Solid' },\n { value: 'preact-ts', label: 'Preact' },\n { value: 'lit-ts', label: 'Lit' },\n { value: 'qwik-ts', label: 'Qwik' },\n { value: 'vanilla-ts', label: 'Vanilla' },\n] as const\n\nexport const DEFAULT_VITE_TEMPLATE = 'react-ts'\n\n/**\n * How each package manager runs create-vite, with the framework decided here\n * rather than by its prompts:\n *\n * - `--template` picks a TypeScript template, so the wiring guide applies;\n * - `--no-interactive` means it never waits for input (CI, `--yes`);\n * - `--no-immediate` stops it installing and launching a dev server — the\n * workspace install happens once, at the root, after this returns.\n */\nexport function createViteCommand(\n pm: 'pnpm' | 'npm' | 'yarn' | 'bun',\n dir: string,\n template: string = DEFAULT_VITE_TEMPLATE,\n): string[] {\n const flags = ['--template', template, '--no-interactive', '--no-immediate']\n // yarn and bun resolve `create vite` to create-vite themselves; npm and pnpm\n // take the versioned package name, and npm needs `--` before the flags or it\n // eats them itself.\n if (pm === 'yarn' || pm === 'bun') return [pm, 'create', 'vite', dir, ...flags]\n if (pm === 'npm') return [pm, 'create', 'vite@latest', dir, '--', ...flags]\n return [pm, 'create', 'vite@latest', dir, ...flags]\n}\n\nexport interface InitFullstackOptions {\n name: string\n directory: string\n packageManager?: 'pnpm' | 'npm' | 'yarn' | 'bun'\n /**\n * Who scaffolds `web/`. `'kick'` writes the wired React app (typed client,\n * dev proxy, route-map types). `'vite'` hands the directory to\n * `create-vite` and wires nothing — you pick the framework, and the guide\n * at {@link FRONTEND_WIRING_URL} covers connecting it.\n */\n frontend?: 'kick' | 'vite'\n /** create-vite template for `frontend: 'vite'`. Default `react-ts`. */\n viteTemplate?: string\n initGit?: boolean\n installDeps?: boolean\n schemaLib?: 'zod' | 'valibot' | 'yup'\n runtime?: 'express' | 'fastify' | 'h3'\n /** Optional packages (`--packages`), wired into the server like a plain scaffold. */\n packages?: string[]\n}\n\nexport async function initFullstackProject(options: InitFullstackOptions): Promise<void> {\n const {\n name,\n directory,\n schemaLib = 'zod',\n runtime = 'express',\n packages = [],\n frontend = 'kick',\n viteTemplate = DEFAULT_VITE_TEMPLATE,\n } = 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 // One map for both packages: the workspace shares a toolchain, so server/\n // and web/ must not end up on different vite or TypeScript majors.\n console.log(' Resolving package versions...')\n const versions = await resolveSiblingVersions()\n\n // ── server/ — the standard scaffold, deferred install/git ──────────\n const server = await initProject({\n name: `${name}-server`,\n directory: join(dir, 'server'),\n packageManager,\n template: 'minimal',\n schemaLib,\n runtime,\n packages,\n // The client route map web/ reads (with the compiler API it needs), and a\n // strict port — web/vite.config.ts proxies /api to it, so moving to\n // another port would silently reach the wrong process.\n extraLayers: ['server-fullstack'],\n // server/ is a workspace member; the root records the approvals.\n approveInstallScripts: false,\n // netlify.toml / vercel.json live at the workspace root, written below.\n platformConfig: false,\n // Root owns install + git so the lockfile/commit cover the workspace.\n initGit: false,\n installDeps: false,\n // Production single-origin serving. `web/` builds to `web/dist`, and\n // nothing served it before — `pnpm build` produced a frontend the API had\n // no way to hand out, so every deploy needed a hand-wired static host or\n // a second process. The adapter is inert until `../web/dist` exists, so\n // `dev` (Vite serves the client and proxies /api here) is untouched.\n spaClientDir: '../web/dist',\n versions,\n })\n\n // ── web/ — either our wired React app, or whatever create-vite makes ──\n if (frontend === 'vite') {\n // create-vite scaffolds it with the chosen TypeScript template. Nothing\n // is patched afterwards: a scaffold we didn't write is not ours to\n // rewrite, and the wiring is four steps in the guide.\n console.log(`\\n Handing web/ to create-vite (${viteTemplate})...\\n`)\n const [file, ...args] = createViteCommand(packageManager, 'web', viteTemplate)\n runCommand(file!, args, { cwd: dir })\n } else {\n // The wired React app (typed client, dev proxy, route-map types): its\n // package.json here, its files from the web-kick layer below.\n await writeFileSafe(join(dir, 'web/package.json'), webPackageJson(name, versions))\n }\n\n // ── workspace root ──────────────────────────────────────────────────\n await writeFileSafe(\n join(dir, 'package.json'),\n rootPackageJson(name, packageManager, versions['@forinda/kickjs-cli']),\n )\n // Only pnpm reads this file. npm / yarn / bun declare workspaces via the\n // `workspaces` field in the root package.json instead — see rootPackageJson.\n if (packageManager === 'pnpm') {\n await writeFileSafe(join(dir, 'pnpm-workspace.yaml'), 'packages:\\n - server\\n - web\\n')\n }\n // Before install, at the root every package manager reads them from.\n approveInstallScripts(packageManager, dir, server.builds)\n // .gitignore, and netlify.toml / vercel.json at the root both platforms\n // build from; plus the kick web app's files under web/.\n const layers = ['fullstack-root', ...(frontend === 'vite' ? [] : ['web-kick'])]\n const files = fillVars(renderLayers(layers).files, { name, packageManager })\n for (const [path, contents] of files) {\n await writeFileSafe(join(dir, path), contents)\n }\n await writeFileSafe(join(dir, 'README.md'), rootReadme(name, packageManager, frontend))\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 if (frontend === 'vite') {\n // Nothing in web/ knows about the API yet — say so, and say where the\n // four wiring steps live rather than half-wiring someone else's scaffold.\n log('web/ is create-vite output, unwired. To type it against the API:')\n log(` ${FRONTEND_WIRING_URL}`)\n } else {\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 }\n log('')\n}\n\n// ── web templates ─────────────────────────────────────────────────────\n\nfunction webPackageJson(name: string, versions: Record<string, string>): string {\n // Every range here is resolved at scaffold time — see THIRD_PARTY_PACKAGES.\n const dep = (pkg: string) => versions[pkg] ?? 'latest'\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': dep('@forinda/kickjs-client'),\n react: dep('react'),\n 'react-dom': dep('react-dom'),\n },\n devDependencies: {\n '@types/react': dep('@types/react'),\n '@types/react-dom': dep('@types/react-dom'),\n '@vitejs/plugin-react': dep('@vitejs/plugin-react'),\n // Same majors as the server package: one workspace, one toolchain.\n typescript: dep('typescript'),\n vite: dep('vite'),\n },\n },\n null,\n 2,\n )}\\n`\n}\n\n// ── root templates ────────────────────────────────────────────────────\n\nfunction rootPackageJson(name: string, pm: string, cliVersion: string): string {\n const scripts: Record<string, string> =\n pm === 'pnpm'\n ? {\n dev: 'pnpm --parallel -r run dev',\n // One origin: the server serves `web/dist` through SpaAdapter.\n start: 'pnpm --filter ./server run start',\n 'dev:server': 'pnpm --filter ./server dev',\n 'dev:web': 'pnpm --filter ./web dev',\n // Typegen first: web's `tsc` reads server/.kickjs/types, which is\n // git-ignored, so a fresh clone (CI, Netlify, Vercel) has none and\n // `pnpm -r run build` races the two packages anyway.\n build: 'pnpm --filter ./server exec kick typegen && pnpm -r run build',\n 'build:netlify': 'pnpm build && pnpm --filter ./server exec kick build:netlify',\n 'build:vercel': 'pnpm build && pnpm --filter ./server exec kick build:vercel',\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\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 start: `cd server && ${pm} run start`,\n 'dev:server': `cd server && ${pm} run dev`,\n 'dev:web': `cd web && ${pm} run dev`,\n // Typegen first — see the pnpm branch above.\n build: `cd server && ${pm} exec kick typegen && cd .. && ${pm} run build:server && ${pm} run build:web`,\n 'build:netlify': `${pm} run build && cd server && ${pm} exec kick build:netlify`,\n 'build:vercel': `${pm} run build && cd server && ${pm} exec kick build:vercel`,\n 'build:server': `cd server && ${pm} run build`,\n 'build:web': `cd web && ${pm} run build`,\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\n }\n return `${JSON.stringify(\n {\n name,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts,\n // The CLI is a ROOT dependency so the bare `kick` in the scripts above\n // resolves: package managers put `node_modules/.bin` on PATH for\n // scripts, and the CLI otherwise lives only in `server/node_modules`.\n devDependencies: { '@forinda/kickjs-cli': cliVersion },\n workspaces: ['server', 'web'],\n },\n null,\n 2,\n )}\\n`\n}\n\nexport function rootReadme(name: string, pm: string, frontend: 'kick' | 'vite' = 'kick'): string {\n const readme = `# ${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\\` emits \\`server/.kickjs/types/kick__client.d.ts\\` — the flat\n route map with every response type resolved to a literal shape.\n3. \\`web/tsconfig.json\\` lists that file in \\`types\\`, so \\`KickClientApi\\` is\n ambient — no import, no bridge file.\n4. \\`web/src/api.ts\\`'s \\`createClient<KickClientApi.Api>\\` types every call site.\n\nBecause the map holds resolved types rather than references to controllers,\n\\`web\\` never compiles server source: no \\`experimentalDecorators\\`, no path\naliases into \\`server/src\\`.\n\nRename a field in \\`server/src/modules/hello/hello.service.ts\\` → \\`web/src/App.tsx\\`\nstops compiling. That's the point.\n\n### Keeping the map fresh\n\n\\`server/.kickjs/types/kick__client.d.ts\\` is generated, and \\`web\\` reads it as\nan ambient type package. Two things follow.\n\n**It is not refreshed by \\`kick dev\\`.** Resolving it builds a whole TypeScript\nprogram over the server, which is a build-step cost rather than a per-save one,\nso a renamed response field surfaces on the next \\`kick typegen\\` rather than on\nsave. Everything else in \\`.kickjs/types\\` still updates on save. Add\n\\`kick typegen --check\\` to CI and a stale map fails the build.\n\n**It needs a compiler API.** TypeScript 7 ships none, so \\`server\\` depends on\n\\`@typescript/typescript6\\`. Remove it and typegen skips this one file, saying\nso; \\`web\\` then reports \\`TS2688\\` because the file it lists in \\`types\\` is gone.\n\n### The other way to wire it\n\nA \\`types\\` entry says \"this is a global type package\", which is what the map is,\nand it fails loudly when the file is missing. If you would rather it be quiet\nwhen absent — say, a repo where the map is not always generated — use\n\\`include\\` instead:\n\n\\`\\`\\`json\n{ \"include\": [\"src\", \"../server/.kickjs/types/kick__client.d.ts\"] }\n\\`\\`\\`\n\nThat tolerates the file not existing, at the cost of \\`KickClientApi\\` silently\nnot resolving. Note \\`types\\` replaces TypeScript's automatic \\`@types\\`\ninclusion, so if you add entries there, list the ones you rely on too\n(\\`\"types\": [\"node\", \"../server/.kickjs/types/kick__client\"]\\`).\n\nOr skip the global entirely — the same file exports the type:\n\n\\`\\`\\`ts\nimport type { Api } from '../../server/.kickjs/types/kick__client'\n\nexport const api = createClient<Api>({ baseUrl: '/api/v1' })\n\\`\\`\\`\n\nDocs: https://kickjs.app/guide/typed-client.html\n`\n\n if (frontend !== 'vite') return readme\n\n // create-vite's output is not ours to describe: it has no typed client, no\n // proxy and no route-map types until the reader wires them. Everything from\n // \"The type loop\" on is about files that do not exist in that scaffold.\n const typeLoop = readme.indexOf('## The type loop')\n return `${readme\n .slice(0, typeLoop)\n .replace(\n 'Vite + React, typed against the API via `@forinda/kickjs-client`',\n 'create-vite scaffold — unwired (see below) ',\n )\n .replace(' (Vite proxies `/api`)', '')}## Wiring web/ to the API\n\n\\`web/\\` is whatever create-vite scaffolded; nothing connects it to the API yet.\nFour steps — typed client, \\`/api\\` dev proxy, route-map types, \\`src/api.ts\\`:\n\n${FRONTEND_WIRING_URL}\n`\n}\n"],"mappings":";;;;;;;;;;uMAuBA,MAAa,EAAsB,mDAQtB,EAAiB,CAC5B,CAAE,MAAO,WAAY,MAAO,OAAQ,EACpC,CAAE,MAAO,oBAAqB,MAAO,kBAAmB,EACxD,CAAE,MAAO,SAAU,MAAO,KAAM,EAChC,CAAE,MAAO,YAAa,MAAO,QAAS,EACtC,CAAE,MAAO,WAAY,MAAO,OAAQ,EACpC,CAAE,MAAO,YAAa,MAAO,QAAS,EACtC,CAAE,MAAO,SAAU,MAAO,KAAM,EAChC,CAAE,MAAO,UAAW,MAAO,MAAO,EAClC,CAAE,MAAO,aAAc,MAAO,SAAU,CAC1C,EAEa,EAAwB,WAWrC,SAAgB,EACd,EACA,EACA,EAAmB,EACT,CACV,IAAM,EAAQ,CAAC,aAAc,EAAU,mBAAoB,gBAAgB,EAM3E,OAFI,IAAO,QAAU,IAAO,MAAc,CAAC,EAAI,SAAU,OAAQ,EAAK,GAAG,CAAK,EAC1E,IAAO,MAAc,CAAC,EAAI,SAAU,cAAe,EAAK,KAAM,GAAG,CAAK,EACnE,CAAC,EAAI,SAAU,cAAe,EAAK,GAAG,CAAK,CACpD,CAuBA,eAAsB,EAAqB,EAA8C,CACvF,GAAM,CACJ,OACA,YACA,YAAY,MACZ,UAAU,UACV,WAAW,CAAC,EACZ,WA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AAK,UACb,CACE,OACA,QAAS,GACT,QAAS,QACT,KAAM,SACN,UAIA,gBAAiB,CAAE,sBAAuB,CAAW,EACrD,WAAY,CAAC,SAAU,KAAK,CAC9B,EACA,KACA,CACF,EAAE,GACJ,CAEA,SAAgB,EAAW,EAAc,EAAY,EAA4B,OAAgB,CAC/F,IAAM,EAAS,KAAK,EAAK;;;;;;;;;;;;EAYzB,EAAG;EACH,IAAO,OAAS,oEAAsE,GAAG,EAAG,kCAAkC,EAAG,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+DjK,GAAI,IAAa,OAAQ,OAAO,EAKhC,IAAM,EAAW,EAAO,QAAQ,kBAAkB,EAClD,MAAO,GAAG,EACP,MAAM,EAAG,CAAQ,CAAC,CAClB,QACC,mEACA,mEACF,CAAC,CACA,QAAQ,yBAA0B,EAAE,EAAE;;;;;EAKzC,EAAoB;CAEtB"}
@@ -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":";;;;KAwQY;;;;;;;;;;;;;;;;;;;UC7OK;EACf;EACA;;;;;;;EAOA;;;;;;EAMA,SAAS;;UAGM;;EAEf;EACA;;EAEA;;EAEA;;KAGU,eACV,KAAK,kBACF,eAAe,wBAAwB,QAAQ,eAAe;;;;;;UAOlD;;EAEf,SAAS;;;;;;;;;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YAAY;;wBAMZ,YAAY;;;;;;wBAYZ,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":";;;;KAwQY;;;;;;;;;;;;;;;;;;;UC7OK;EACf;EACA;;;;;;;EAOA;;;;;;EAMA,SAAS;;UAGM;;EAEf;EACA;;EAEA;;EAEA;;KAGU,eACV,KAAK,kBACF,eAAe,wBAAwB,QAAQ,eAAe;;;;;;UAOlD;;EAEf,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqCK,sBAAsB,KAAK,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;wBA0B7C,kBAAkB,OAAO,cAAc;;;;KChG3C,uBAAuB,uBAAoB;;KAG3C,gBAAgB,gBAAa;;;;UC5BxB;;EAEf;;EAEA;;;;;;;;;EASA;;EAEA;;;KAIU;;KAGA;;;;;;;;;;;;;KAgBA;;UA0BK;EACf;;;KAIU,iBAAiB,oBAAkB;;;;;;;;;;;KAYnC;;;;;;UAOK;;;;;;;EAOf;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;;EAsBA;;;;;;;;;;;;;;;;;;;;;;;;UAyBe;;;;;EAKf;;;;;EAKA;;EAEA;;EAEA;;;;;;;EAOA;;;;;;;EAOA,0BAA0B;;;UAIX;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;EAaA,kBAAkB;;;;;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gB;;;;;;;;;;EAUhB,SAAS;;UAGM;;EAEf;;;;;;;EAOA;;EAEA;;;UAIe;EACf;EACA;EACA;;;;;;EAMA;;;UAIe;EACf;EACA,SAAS;;EAET,UAAU;;;;;;;;;;;;;iBAcU,YACpB,QAAQ,mBACR,MAAM,qBACL,QAAQ;;;;;;;;qBCrDE;KAED;;UAGK;EACf,mBAAmB;EACnB,6BAA6B;EAC7B,8BAA8B;EAC9B,oBAAoB;;UAGL;EACf;;EAEA,QAAQ;;;;;EAKR,cAAc;;;;;;EAMd;;EAEA;;EAEA,WAAW;;UAGI;;EAEf,iBAAiB,OAAO,mBAAmB;;;;;EAK3C;;;;;;EAMA;;EAEA;;wBAGc,wBAAwB,MAAM,2BAA2B;;;;;;;;UC3ExD;EACf;EACA,MAAM;;;;;;;UAQS;EACf,YAAY;;EAEZ;;;;;EAKA,QAAQ;IAAQ;IAAgB;;;;;;;;;;;wBCblB,sBAAsB;EACpC;EACA;EACA,QAAQ;EACR;EACA;;;;;;;EAOA;EACA;IACE;;;;wBC5BY,aAAa;;wBAOb,YAAY;;wBAMZ,YAAY;;;;;;wBAYZ,UAAU"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,4 +8,4 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{C as e,F as t,N as n,P as r,_ as i,c as a,d as o,g as s,h as c,j as l,l as u,m as d,n as f,o as p,p as m,s as h,t as g,y as _}from"./doctor-DsdqPNpN.mjs";import{t as v}from"./project-BX52bTLz.mjs";import{o as y,r as b}from"./config-QVJU9X2C.mjs";import{t as x}from"./project-root-fGCAvMQS.mjs";import{n as S,t as C}from"./types-DZDRt1eU.mjs";export{C as KickPluginConflictError,a as TYPEGEN_OWNER_KEY,p as buildGeneratorContext,u as createTypegenDevWatcher,S as defineCliPlugin,b as defineConfig,g as defineDoctorCheck,f as defineDoctorExtension,h as defineGenerator,o as defineTypegen,x as findProjectRoot,_ as generateAdapter,d as generateController,m as generateDto,s as generateGuard,i as generateMiddleware,e as generateModule,c as generateService,v as initProject,y as loadKickConfig,l as pluralize,n as toCamelCase,r as toKebabCase,t as toPascalCase};
11
+ import{C as e,F as t,N as n,P as r,_ as i,c as a,d as o,g as s,h as c,j as l,l as u,m as d,n as f,o as p,p as m,s as h,t as g,y as _}from"./doctor-Cv8P4-Af.mjs";import{t as v}from"./project-ty_X8Qx9.mjs";import{o as y,r as b}from"./config-wzsPHJ1r.mjs";import{t as x}from"./project-root-uvQJBEg3.mjs";import{n as S,t as C}from"./types-BDzIj0W_.mjs";export{C as KickPluginConflictError,a as TYPEGEN_OWNER_KEY,p as buildGeneratorContext,u as createTypegenDevWatcher,S as defineCliPlugin,b as defineConfig,g as defineDoctorCheck,f as defineDoctorExtension,h as defineGenerator,o as defineTypegen,x as findProjectRoot,_ as generateAdapter,d as generateController,m as generateDto,s as generateGuard,i as generateMiddleware,e as generateModule,c as generateService,v as initProject,y as loadKickConfig,l as pluralize,n as toCamelCase,r as toKebabCase,t as toPascalCase};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
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-B7gmkk-L.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-CUjIsFNJ.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-DBz5c2Bd.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-B7nAxOl7.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 v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,4 +8,4 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import"./types-DZDRt1eU.mjs";import{r as e}from"./run-plugins-C7273pNl.mjs";export{e as mergeCliPlugins};
11
+ import"./types-BDzIj0W_.mjs";import{r as e}from"./run-plugins-C3w0I62s.mjs";export{e as mergeCliPlugins};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{a as e,t}from"./config-BC2UQsHr.mjs";import{r as n}from"./fs-w_fl0CbJ.mjs";import{existsSync as r,readFileSync as i,readdirSync as a,statSync as o,writeFileSync as s}from"node:fs";import{dirname as c,join as l,resolve as u,sep as d}from"node:path";import{fileURLToPath as f}from"node:url";import{execFile as p,execFileSync as m,execSync as h,spawnSync as g}from"node:child_process";import{promisify as _}from"node:util";import{parseSync as v}from"oxc-parser";const y=_(p),b=/[&|<>^"'`(){}[\];!%\r\n\\]/;function x(e,t,n=process.platform){if(n!==`win32`)return[e,t];if(b.test(e)||t.some(e=>b.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 S(e,t,n={}){let r=x(e,t);if(!r)return null;try{return m(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 C(e,t,n={}){let r=x(e,t);if(!r)throw Error(`Refusing to run '${e}': unsafe arguments`);m(r[0],r[1],{cwd:n.cwd,stdio:`inherit`,windowsHide:!0})}function ee(e,t,n){h(e,{cwd:t,stdio:`inherit`,env:n?{...process.env,...n}:process.env})}function te(e,t,n){let r=g(process.execPath,[e],{cwd:n,stdio:`inherit`,env:{...process.env,...t}});r.status!==0&&process.exit(r.status??1)}async function ne(e,t,n={}){let r=x(e,t);if(!r)return null;try{let{stdout:e}=await y(r[0],r[1],{encoding:`utf-8`,timeout:n.timeout??5e3,cwd:n.cwd,windowsHide:!0});return e.toString().trim()||null}catch{return null}}const w=c(f(import.meta.url)),T=[l(w,`..`,`templates`),l(w,`..`,`..`,`templates`)].find(e=>r(l(e,`base`)));function re(e){return e.split(`/`).map(e=>e.startsWith(`_dot_`)?`.${e.slice(5)}`:e).join(`/`)}function E(e,t={}){let n=t.templatesDir??T,s=new Map,c=[],u=[],f={},p=[];for(let t of e){let e=l(n,t);if(!r(e))throw Error(`Unknown scaffold layer "${t}" (${e})`);let m=l(e,`feature.json`);if(r(m)){let e=JSON.parse(i(m,`utf-8`));c.push(...e.dependencies??[]),u.push(...e.devDependencies??[]),Object.assign(f,e.builds),p.push(...e.integrations??[])}let h=l(e,`files`);if(r(h))for(let e of a(h,{recursive:!0,encoding:`utf-8`}).toSorted()){let t=l(h,e);if(!o(t).isFile())continue;let n=i(t,`utf-8`),r=re(e.split(d).join(`/`));if(r.endsWith(`.append`)){let e=r.slice(0,-7);s.set(e,(s.get(e)??``)+n)}else s.set(r,n)}}p.push(...t.extra??[]);let m=t.vars??{},h=e=>e.replace(/\{\{(\w+)\}\}/g,(e,t)=>m[t]??e);for(let[e,t]of s)t.includes(`// @kick:`)&&s.set(e,ie(t,p,h));return{files:s,dependencies:[...new Set(c)],devDependencies:[...new Set(u)],builds:f,integrations:p}}function D(e,t){let n=e=>e.replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?t[n]:e);return new Map([...e].map(([e,t])=>[e,n(t)]))}const O=/^([ \t]*)\/\/ @kick:([\w-]+)[ \t]*$/;function ie(e,t,n=e=>e){let r=e.split(`
11
+ import{a as e,t}from"./config-2x1N_mV1.mjs";import{r as n}from"./fs-fU5dBnRJ.mjs";import{existsSync as r,readFileSync as i,readdirSync as a,statSync as o,writeFileSync as s}from"node:fs";import{dirname as c,join as l,resolve as u,sep as d}from"node:path";import{fileURLToPath as f}from"node:url";import{execFile as p,execFileSync as m,execSync as h,spawnSync as g}from"node:child_process";import{promisify as _}from"node:util";import{parseSync as v}from"oxc-parser";const y=_(p),b=/[&|<>^"'`(){}[\];!%\r\n\\]/;function x(e,t,n=process.platform){if(n!==`win32`)return[e,t];if(b.test(e)||t.some(e=>b.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 S(e,t,n={}){let r=x(e,t);if(!r)return null;try{return m(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 C(e,t,n={}){let r=x(e,t);if(!r)throw Error(`Refusing to run '${e}': unsafe arguments`);m(r[0],r[1],{cwd:n.cwd,stdio:`inherit`,windowsHide:!0})}function ee(e,t,n){h(e,{cwd:t,stdio:`inherit`,env:n?{...process.env,...n}:process.env})}function te(e,t,n){let r=g(process.execPath,[e],{cwd:n,stdio:`inherit`,env:{...process.env,...t}});r.status!==0&&process.exit(r.status??1)}async function ne(e,t,n={}){let r=x(e,t);if(!r)return null;try{let{stdout:e}=await y(r[0],r[1],{encoding:`utf-8`,timeout:n.timeout??5e3,cwd:n.cwd,windowsHide:!0});return e.toString().trim()||null}catch{return null}}const w=c(f(import.meta.url)),T=[l(w,`..`,`templates`),l(w,`..`,`..`,`templates`)].find(e=>r(l(e,`base`)));function re(e){return e.split(`/`).map(e=>e.startsWith(`_dot_`)?`.${e.slice(5)}`:e).join(`/`)}function E(e,t={}){let n=t.templatesDir??T,s=new Map,c=[],u=[],f={},p=[];for(let t of e){let e=l(n,t);if(!r(e))throw Error(`Unknown scaffold layer "${t}" (${e})`);let m=l(e,`feature.json`);if(r(m)){let e=JSON.parse(i(m,`utf-8`));c.push(...e.dependencies??[]),u.push(...e.devDependencies??[]),Object.assign(f,e.builds),p.push(...e.integrations??[])}let h=l(e,`files`);if(r(h))for(let e of a(h,{recursive:!0,encoding:`utf-8`}).toSorted()){let t=l(h,e);if(!o(t).isFile())continue;let n=i(t,`utf-8`),r=re(e.split(d).join(`/`));if(r.endsWith(`.append`)){let e=r.slice(0,-7);s.set(e,(s.get(e)??``)+n)}else s.set(r,n)}}p.push(...t.extra??[]);let m=t.vars??{},h=e=>e.replace(/\{\{(\w+)\}\}/g,(e,t)=>m[t]??e);for(let[e,t]of s)t.includes(`// @kick:`)&&s.set(e,ie(t,p,h));return{files:s,dependencies:[...new Set(c)],devDependencies:[...new Set(u)],builds:f,integrations:p}}function D(e,t){let n=e=>e.replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?t[n]:e);return new Map([...e].map(([e,t])=>[e,n(t)]))}const O=/^([ \t]*)\/\/ @kick:([\w-]+)[ \t]*$/;function ie(e,t,n=e=>e){let r=e.split(`
12
12
  `),i=new Set(r.map(e=>O.exec(e)?.[2]).filter(Boolean)),a=t.filter(e=>!e.slot||i.has(e.slot)),o=[];for(let e=0;e<r.length;e++){let t=O.exec(r[e]);if(!t){o.push(r[e]);continue}let[,i,s]=t,c=s===`imports`?oe(a.flatMap(e=>e.import?[e.import]:[])):a.filter(e=>e.slot===s&&e.code).map(e=>ae(`${n(e.code)},`,i));if(c.length>0){o.push(...c);continue}o.at(-1)?.trimEnd().endsWith(`[`)&&r[e+1]?.trim().startsWith(`]`)&&(o.pop(),e++)}return o.join(`
13
13
  `)}function ae(e,t){return e.split(`
14
14
  `).map(e=>e&&t+e).join(`
@@ -37,9 +37,9 @@ import{a as e,t}from"./config-BC2UQsHr.mjs";import{r as n}from"./fs-w_fl0CbJ.mjs
37
37
  `);else{for(let e of await be(g,_.files))console.log(` Updated ${e}`);let e=v?await xe(g,v,_.integrations):void 0;for(let t of e?.added??[])console.log(` Added ${t} to ${v}`);for(let t of e?.present??[])console.log(` ${t} is already in ${v}`);let t=I(g),n=e?e.manual:_.integrations.filter(e=>e.slot&&e.code).map(e=>({...e,code:t(e.code)}));n.length>0&&(console.log(`\n ${v?`Could not find bootstrap({ adapters: [...] }) in ${v}`:`No entry file found`} — add this yourself:
38
38
  `),console.log(Ce(n).replace(/^/gm,` `)),console.log())}}b?console.log(` Done!
39
39
  `):(console.log(` Finished with errors — the install above did not complete.
40
- `),process.exitCode=1)})}const Y=c(f(import.meta.url)),X=JSON.parse(i([l(Y,`..`,`package.json`),l(Y,`..`,`..`,`package.json`)].find(r),`utf-8`)),Pe=[`@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`],Fe={react:{fallback:`^19.0.0`},"react-dom":{fallback:`^19.0.0`},"@types/react":{fallback:`^19.0.0`},"@types/react-dom":{fallback:`^19.0.0`},"@vitejs/plugin-react":{fallback:`^5.0.0`},"@types/node":{fallback:`^25.0.0`},"@types/supertest":{fallback:`^7.2.1`},supertest:{fallback:`^7.2.2`},vitest:{fallback:`^4.1.2`},"@swc/core":{fallback:`^1.15.21`},"unplugin-swc":{fallback:`^1.5.9`},oxfmt:{fallback:`^0.65.0`},oxlint:{fallback:`^1.80.0`},dotenv:{fallback:`^17.3.1`,cap:`^17`},"reflect-metadata":{fallback:`^0.2.2`},vite:{fallback:`^8.0.3`,cap:`^8`},typescript:{fallback:`^7.0.2`,cap:`^7`},"@typescript/typescript6":{fallback:`^6.0.2`,cap:`^6`},express:{fallback:`^5.1.0`,cap:`^5`},"@types/express":{fallback:`^5.0.6`,cap:`^5`},fastify:{fallback:`^5.0.0`,cap:`^5`},"@fastify/middie":{fallback:`^9.0.0`,cap:`^9`},h3:{fallback:`^1.0.0`,cap:`^1`},"serve-static":{fallback:`^2.2.0`,cap:`^2`},zod:{fallback:`^4.3.6`,cap:`^4`},valibot:{fallback:`^1.4.1`,cap:`^1`},yup:{fallback:`^1.7.1`,cap:`^1`},ws:{fallback:`^8.18.0`,cap:`^8`},bullmq:{fallback:`^5.0.0`,cap:`^5`},ioredis:{fallback:`^5.0.0`,cap:`^5`}};function Ie(e){if(!e)return null;let t=e.trim();if(/^\d+\.\d+\.\d+/.test(t))return t.split(/\s/)[0];try{let e=JSON.parse(t),n=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`);return n.length>0?n[n.length-1]:null}catch{return null}}function Le(e){return e===`@forinda/kickjs-cli`?`^${X.version}`:`latest`}async function Re(e,t,n){let r=Array.from({length:e.length}),i=0,a=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let t=i++;r[t]=await n(e[t])}});return await Promise.all(a),r}async function Z(){let e=[...Pe.map(e=>({name:e,fallback:Le(e),cap:void 0})),...Object.entries(Fe).map(([e,t])=>({name:e,...t}))],t=Date.now()+2e4,n=await Re(e,8,async({name:e,fallback:n,cap:r})=>{let i=t-Date.now();if(i<=0)return[e,n];let a=r?`${e}@${r}`:e,o=Ie(await ne(`npm`,r?[`view`,a,`version`,`--json`]:[`view`,a,`version`],{timeout:i}));return[e,o?`^${o}`:n]});return Object.fromEntries(n)}function Q(e,t){let n=S(`npm`,[`view`,`${e}@${t}`,`version`],{timeout:2e4});return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function ze(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 Be(e,t,n){let r=S(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`],{timeout:2e4});if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function Ve(e){let{name:t,directory:i,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:s=`inmemory`,packages:c=[],schemaLib:u=`zod`,runtime:d=`express`}=e,f=i,p=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${t}\n`),e.versions||p(`Resolving package versions...`);let m=e.versions??await Z(),g=Object.keys(m).filter(e=>m[e]===`latest`);if(g.length>0&&p(`WARNING: could not reach npm for ${g.join(`, `)} — pinned to 'latest'`),d!==`express`){if(Be(`@forinda/kickjs`,`latest`,`./${d}`))p(`Using @forinda/kickjs@latest (stable ships the ${d} 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&&ze(e,$(m[r]))&&(m[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}p(n?`Using the alpha channel for the ${d} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${d} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}}let _=c.filter(e=>!r(l(T,`feature-${e}`)));_.length>0&&p(`WARNING: skipping unknown package(s): ${_.join(`, `)} — add them later with kick add`);let v=E([...Ue({template:o,runtime:d,schemaLib:u,packages:c}),...e.platformConfig===!1?[]:[`host-config`],...e.extraLayers??[]],{vars:{name:t,version:X.version},extra:[{slot:`repo`,code:s===`inmemory`?`repo: 'inmemory'`:`repo: { name: '${s.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)}' }`},...e.spaClientDir?[He(e.spaClientDir)]:[]]});await n(l(f,`package.json`),ce(t,m,v));let y=D(v.files,{name:t,template:o,runtime:d,packageManager:a,templateLabel:o===`rest`?`REST API`:`Minimal`,packages:[...v.dependencies,...v.devDependencies].filter(e=>e.startsWith(`@forinda/`)).map(e=>`- \`${e}\``).join(`
41
- `)});for(let[e,t]of y)await n(l(f,e),t);let{generateAgentDocs:b}=await import(`./agent-docs-DXcSYjqf.mjs`).then(e=>e.t);await b({outDir:f,name:t,pm:a,template:o,only:`all`,force:!0});let x={...ke,...J(c),...v.builds};if(e.approveInstallScripts!==!1&&q(a,f,x),e.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{h(`${a} install`,{cwd:f,stdio:`inherit`}),console.log(`
42
- Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-C40SHVWi.mjs`).then(e=>e.n);await e({cwd:f,allowDuplicates:!0,silent:!0})}catch{}if(e.initGit)try{h(`git init`,{cwd:f,stdio:`pipe`}),h(`git branch -M main`,{cwd:f,stdio:`pipe`}),h(`git add -A`,{cwd:f,stdio:`pipe`}),h(`git commit -m "chore: initial commit from kick new"`,{cwd:f,stdio:`pipe`}),p(`Git repository initialized`)}catch{p(`Warning: git init failed (git may not be installed)`)}console.log(`
40
+ `),process.exitCode=1)})}const Y=c(f(import.meta.url)),X=JSON.parse(i([l(Y,`..`,`package.json`),l(Y,`..`,`..`,`package.json`)].find(r),`utf-8`)),Pe=[`@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`],Fe={react:{fallback:`^19.0.0`},"react-dom":{fallback:`^19.0.0`},"@types/react":{fallback:`^19.0.0`},"@types/react-dom":{fallback:`^19.0.0`},"@vitejs/plugin-react":{fallback:`^5.0.0`},"@types/node":{fallback:`^25.0.0`},"@types/supertest":{fallback:`^7.2.1`},supertest:{fallback:`^7.2.2`},vitest:{fallback:`^4.1.2`},"@swc/core":{fallback:`^1.15.21`},"unplugin-swc":{fallback:`^1.5.9`},oxfmt:{fallback:`^0.65.0`},oxlint:{fallback:`^1.80.0`},dotenv:{fallback:`^17.3.1`,cap:`^17`},"reflect-metadata":{fallback:`^0.2.2`},vite:{fallback:`^8.0.3`,cap:`^8`},typescript:{fallback:`^7.0.2`,cap:`^7`},"@typescript/typescript6":{fallback:`^6.0.2`,cap:`^6`},express:{fallback:`^5.1.0`,cap:`^5`},"@types/express":{fallback:`^5.0.6`,cap:`^5`},fastify:{fallback:`^5.0.0`,cap:`^5`},"@fastify/middie":{fallback:`^9.0.0`,cap:`^9`},h3:{fallback:`^1.0.0`,cap:`^1`},"serve-static":{fallback:`^2.2.0`,cap:`^2`},zod:{fallback:`^4.3.6`,cap:`^4`},valibot:{fallback:`^1.4.1`,cap:`^1`},"@valibot/to-json-schema":{fallback:`^1.8.0`,cap:`^1`},yup:{fallback:`^1.7.1`,cap:`^1`},ws:{fallback:`^8.18.0`,cap:`^8`},bullmq:{fallback:`^5.0.0`,cap:`^5`},ioredis:{fallback:`^5.0.0`,cap:`^5`}};function Ie(e){if(!e)return null;let t=e.trim();if(/^\d+\.\d+\.\d+/.test(t))return t.split(/\s/)[0];try{let e=JSON.parse(t),n=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`);return n.length>0?n[n.length-1]:null}catch{return null}}function Le(e){return e===`@forinda/kickjs-cli`?`^${X.version}`:`latest`}async function Re(e,t,n){let r=Array.from({length:e.length}),i=0,a=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let t=i++;r[t]=await n(e[t])}});return await Promise.all(a),r}async function Z(){let e=[...Pe.map(e=>({name:e,fallback:Le(e),cap:void 0})),...Object.entries(Fe).map(([e,t])=>({name:e,...t}))],t=Date.now()+2e4,n=await Re(e,8,async({name:e,fallback:n,cap:r})=>{let i=t-Date.now();if(i<=0)return[e,n];let a=r?`${e}@${r}`:e,o=Ie(await ne(`npm`,r?[`view`,a,`version`,`--json`]:[`view`,a,`version`],{timeout:i}));return[e,o?`^${o}`:n]});return Object.fromEntries(n)}function Q(e,t){let n=S(`npm`,[`view`,`${e}@${t}`,`version`],{timeout:2e4});return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function ze(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 Be(e,t,n){let r=S(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`],{timeout:2e4});if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function Ve(e){let{name:t,directory:i,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:s=`inmemory`,packages:c=[],schemaLib:u=`zod`,runtime:d=`express`}=e,f=i,p=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${t}\n`),e.versions||p(`Resolving package versions...`);let m=e.versions??await Z(),g=Object.keys(m).filter(e=>m[e]===`latest`);if(g.length>0&&p(`WARNING: could not reach npm for ${g.join(`, `)} — pinned to 'latest'`),d!==`express`){if(Be(`@forinda/kickjs`,`latest`,`./${d}`))p(`Using @forinda/kickjs@latest (stable ships the ${d} 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&&ze(e,$(m[r]))&&(m[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}p(n?`Using the alpha channel for the ${d} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${d} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}}let _=c.filter(e=>!r(l(T,`feature-${e}`)));_.length>0&&p(`WARNING: skipping unknown package(s): ${_.join(`, `)} — add them later with kick add`);let v=E([...Ue({template:o,runtime:d,schemaLib:u,packages:c}),...e.platformConfig===!1?[]:[`host-config`],...e.extraLayers??[]],{vars:{name:t,version:X.version},extra:[{slot:`repo`,code:s===`inmemory`?`repo: 'inmemory'`:`repo: { name: '${s.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)}' }`},...e.spaClientDir?[He(e.spaClientDir)]:[]]});await n(l(f,`package.json`),ce(t,m,v));let y=D(v.files,{name:t,template:o,runtime:d,packageManager:a,templateLabel:o===`rest`?`REST API`:`Minimal`,packages:[...v.dependencies,...v.devDependencies].filter(e=>e.startsWith(`@forinda/`)).map(e=>`- \`${e}\``).join(`
41
+ `)});for(let[e,t]of y)await n(l(f,e),t);let{generateAgentDocs:b}=await import(`./agent-docs-JuchqDDh.mjs`).then(e=>e.t);await b({outDir:f,name:t,pm:a,template:o,only:`all`,force:!0});let x={...ke,...J(c),...v.builds};if(e.approveInstallScripts!==!1&&q(a,f,x),e.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{h(`${a} install`,{cwd:f,stdio:`inherit`}),console.log(`
42
+ Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-vKaJDE2e.mjs`).then(e=>e.n);await e({cwd:f,allowDuplicates:!0,silent:!0})}catch{}if(e.initGit)try{h(`git init`,{cwd:f,stdio:`pipe`}),h(`git branch -M main`,{cwd:f,stdio:`pipe`}),h(`git add -A`,{cwd:f,stdio:`pipe`}),h(`git commit -m "chore: initial commit from kick new"`,{cwd:f,stdio:`pipe`}),p(`Git repository initialized`)}catch{p(`Warning: git init failed (git may not be installed)`)}console.log(`
43
43
  Project scaffolded successfully!`),console.log();let S=f!==process.cwd();p(`Next steps:`),S&&p(` cd ${t}`),e.installDeps||p(` ${a} install`);let C={rest:`kick g module user`,minimal:`# add your routes to src/index.ts`};return p(` ${C[o]??C.rest}`),p(` kick dev`),p(``),p(`Commands:`),p(` kick dev Start dev server with Vite HMR`),p(` kick build Production build via Vite`),p(` kick start Run production build`),p(``),p(`Generators:`),p(` kick g module <name> REST module (controller, service, DTOs, repository)`),p(` kick g scaffold <n> <f..> CRUD module from field definitions`),p(` kick g controller <name> Standalone controller`),p(` kick g service <name> @Service() class`),p(` kick g middleware <name> Global connect-style middleware`),p(` kick g guard <name> Route guard (auth, roles, etc.)`),p(` kick g adapter <name> AppAdapter with lifecycle hooks`),p(` kick g dto <name> DTO schema (Zod / Valibot / Yup)`),p(` kick g config Generate kick.config.ts`),p(``),p(`Add packages:`),p(` kick add <pkg> Install a KickJS package + peers`),p(` kick add --list Show all available packages`),p(``),p(`Available: ${we}`),p(``),{builds:x}}function He(e){return{import:{from:`@forinda/kickjs/spa`,names:[`SpaAdapter`]},slot:`adapter`,code:`// Serves the built frontend from this origin in production.
44
44
  // Inert until the client build exists, so \`kick dev\` (where Vite
45
45
  // serves the client and proxies /api here) is unaffected.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
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-B7gmkk-L.mjs";import{existsSync as t}from"node:fs";import{dirname as n,parse as r,resolve as i}from"node:path";var a=e({findProjectRoot:()=>s});const o=[`kick.config.ts`,`kick.config.js`,`kick.config.mjs`,`kick.config.json`];function s(e=process.cwd()){let a=i(e),{root:s}=r(a),c=null,l=a;for(;;){for(let e of o)if(t(i(l,e)))return l;if(c===null&&t(i(l,`package.json`))&&(c=l),l===s)break;let e=n(l);if(e===l)break;l=e}return c??a}export{a as n,s as t};
11
+ import{t as e}from"./rolldown-runtime-DBz5c2Bd.mjs";import{existsSync as t}from"node:fs";import{dirname as n,parse as r,resolve as i}from"node:path";var a=e({findProjectRoot:()=>s});const o=[`kick.config.ts`,`kick.config.js`,`kick.config.mjs`,`kick.config.json`];function s(e=process.cwd()){let a=i(e),{root:s}=r(a),c=null,l=a;for(;;){for(let e of o)if(t(i(l,e)))return l;if(c===null&&t(i(l,`package.json`))&&(c=l),l===s)break;let e=n(l);if(e===l)break;l=e}return c??a}export{a as n,s as t};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
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-B7gmkk-L.mjs";import{dirname as t,parse as n,resolve as r}from"node:path";import{existsSync as i}from"node:fs";var a=e({findProjectRoot:()=>s});const o=[`kick.config.ts`,`kick.config.js`,`kick.config.mjs`,`kick.config.json`];function s(e=process.cwd()){let a=r(e),{root:s}=n(a),c=null,l=a;for(;;){for(let e of o)if(i(r(l,e)))return l;if(c===null&&i(r(l,`package.json`))&&(c=l),l===s)break;let e=t(l);if(e===l)break;l=e}return c??a}export{a as n,s as t};
12
- //# sourceMappingURL=project-root-fGCAvMQS.mjs.map
11
+ import{t as e}from"./rolldown-runtime-DBz5c2Bd.mjs";import{dirname as t,parse as n,resolve as r}from"node:path";import{existsSync as i}from"node:fs";var a=e({findProjectRoot:()=>s});const o=[`kick.config.ts`,`kick.config.js`,`kick.config.mjs`,`kick.config.json`];function s(e=process.cwd()){let a=r(e),{root:s}=n(a),c=null,l=a;for(;;){for(let e of o)if(i(r(l,e)))return l;if(c===null&&i(r(l,`package.json`))&&(c=l),l===s)break;let e=t(l);if(e===l)break;l=e}return c??a}export{a as n,s as t};
12
+ //# sourceMappingURL=project-root-uvQJBEg3.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-root-fGCAvMQS.mjs","names":[],"sources":["../src/utils/project-root.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { dirname, parse, resolve } from 'node:path'\n\nconst CONFIG_FILENAMES = ['kick.config.ts', 'kick.config.js', 'kick.config.mjs', 'kick.config.json']\n\n/**\n * Walk up from `startDir` looking for the project root. A directory\n * counts as the root when it contains any of:\n * - `kick.config.{ts,js,mjs,json}` (strongest signal)\n * - `package.json` (fallback when no config file exists yet)\n *\n * Returns the absolute path of the first matching directory, or\n * `startDir` itself when nothing was found (no surprises — callers\n * that didn't find a config still get a reasonable cwd).\n *\n * `kick.config.*` wins over `package.json` when both appear at\n * different levels, so adopters running `kick typegen` from `src/`\n * land on the project root that owns the config, not on the nearest\n * workspace package boundary in a monorepo.\n */\nexport function findProjectRoot(startDir: string = process.cwd()): string {\n const start = resolve(startDir)\n const { root: fsRoot } = parse(start)\n\n let firstPackageJson: string | null = null\n let cursor = start\n while (true) {\n for (const name of CONFIG_FILENAMES) {\n if (existsSync(resolve(cursor, name))) return cursor\n }\n if (firstPackageJson === null && existsSync(resolve(cursor, 'package.json'))) {\n firstPackageJson = cursor\n }\n if (cursor === fsRoot) break\n const parent = dirname(cursor)\n if (parent === cursor) break\n cursor = parent\n }\n\n return firstPackageJson ?? start\n}\n"],"mappings":";;;;;;;;;;sLAGA,MAAM,EAAmB,CAAC,iBAAkB,iBAAkB,kBAAmB,kBAAkB,EAiBnG,SAAgB,EAAgB,EAAmB,QAAQ,IAAI,EAAW,CACxE,IAAM,EAAQ,EAAQ,CAAQ,EACxB,CAAE,KAAM,GAAW,EAAM,CAAK,EAEhC,EAAkC,KAClC,EAAS,EACb,OAAa,CACX,IAAK,IAAM,KAAQ,EACjB,GAAI,EAAW,EAAQ,EAAQ,CAAI,CAAC,EAAG,OAAO,EAKhD,GAHI,IAAqB,MAAQ,EAAW,EAAQ,EAAQ,cAAc,CAAC,IACzE,EAAmB,GAEjB,IAAW,EAAQ,MACvB,IAAM,EAAS,EAAQ,CAAM,EAC7B,GAAI,IAAW,EAAQ,MACvB,EAAS,CACX,CAEA,OAAO,GAAoB,CAC7B"}
1
+ {"version":3,"file":"project-root-uvQJBEg3.mjs","names":[],"sources":["../src/utils/project-root.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { dirname, parse, resolve } from 'node:path'\n\nconst CONFIG_FILENAMES = ['kick.config.ts', 'kick.config.js', 'kick.config.mjs', 'kick.config.json']\n\n/**\n * Walk up from `startDir` looking for the project root. A directory\n * counts as the root when it contains any of:\n * - `kick.config.{ts,js,mjs,json}` (strongest signal)\n * - `package.json` (fallback when no config file exists yet)\n *\n * Returns the absolute path of the first matching directory, or\n * `startDir` itself when nothing was found (no surprises — callers\n * that didn't find a config still get a reasonable cwd).\n *\n * `kick.config.*` wins over `package.json` when both appear at\n * different levels, so adopters running `kick typegen` from `src/`\n * land on the project root that owns the config, not on the nearest\n * workspace package boundary in a monorepo.\n */\nexport function findProjectRoot(startDir: string = process.cwd()): string {\n const start = resolve(startDir)\n const { root: fsRoot } = parse(start)\n\n let firstPackageJson: string | null = null\n let cursor = start\n while (true) {\n for (const name of CONFIG_FILENAMES) {\n if (existsSync(resolve(cursor, name))) return cursor\n }\n if (firstPackageJson === null && existsSync(resolve(cursor, 'package.json'))) {\n firstPackageJson = cursor\n }\n if (cursor === fsRoot) break\n const parent = dirname(cursor)\n if (parent === cursor) break\n cursor = parent\n }\n\n return firstPackageJson ?? start\n}\n"],"mappings":";;;;;;;;;;sLAGA,MAAM,EAAmB,CAAC,iBAAkB,iBAAkB,kBAAmB,kBAAkB,EAiBnG,SAAgB,EAAgB,EAAmB,QAAQ,IAAI,EAAW,CACxE,IAAM,EAAQ,EAAQ,CAAQ,EACxB,CAAE,KAAM,GAAW,EAAM,CAAK,EAEhC,EAAkC,KAClC,EAAS,EACb,OAAa,CACX,IAAK,IAAM,KAAQ,EACjB,GAAI,EAAW,EAAQ,EAAQ,CAAI,CAAC,EAAG,OAAO,EAKhD,GAHI,IAAqB,MAAQ,EAAW,EAAQ,EAAQ,cAAc,CAAC,IACzE,EAAmB,GAEjB,IAAW,EAAQ,MACvB,IAAM,EAAS,EAAQ,CAAM,EAC7B,GAAI,IAAW,EAAQ,MACvB,EAAS,CACX,CAEA,OAAO,GAAoB,CAC7B"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v8.7.6
2
+ * @forinda/kickjs-cli v8.7.8
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{r as e}from"./fs-XytuMx9n.mjs";import{o as t,t as n}from"./config-QVJU9X2C.mjs";import{dirname as r,join as i,resolve as a,sep as o}from"node:path";import{existsSync as s,readFileSync as c,readdirSync as l,statSync as u,writeFileSync as d}from"node:fs";import{execFile as f,execFileSync as p,execSync as m,spawnSync as h}from"node:child_process";import{fileURLToPath as g}from"node:url";import{promisify as _}from"node:util";import{parseSync as v}from"oxc-parser";const y=r(g(import.meta.url)),b=[i(y,`..`,`templates`),i(y,`..`,`..`,`templates`)].find(e=>s(i(e,`base`)));function x(e){return e.split(`/`).map(e=>e.startsWith(`_dot_`)?`.${e.slice(5)}`:e).join(`/`)}function S(e,t={}){let n=t.templatesDir??b,r=new Map,a=[],d=[],f={},p=[];for(let t of e){let e=i(n,t);if(!s(e))throw Error(`Unknown scaffold layer "${t}" (${e})`);let m=i(e,`feature.json`);if(s(m)){let e=JSON.parse(c(m,`utf-8`));a.push(...e.dependencies??[]),d.push(...e.devDependencies??[]),Object.assign(f,e.builds),p.push(...e.integrations??[])}let h=i(e,`files`);if(s(h))for(let e of l(h,{recursive:!0,encoding:`utf-8`}).toSorted()){let t=i(h,e);if(!u(t).isFile())continue;let n=c(t,`utf-8`),a=x(e.split(o).join(`/`));if(a.endsWith(`.append`)){let e=a.slice(0,-7);r.set(e,(r.get(e)??``)+n)}else r.set(a,n)}}p.push(...t.extra??[]);let m=t.vars??{},h=e=>e.replace(/\{\{(\w+)\}\}/g,(e,t)=>m[t]??e);for(let[e,t]of r)t.includes(`// @kick:`)&&r.set(e,T(t,p,h));return{files:r,dependencies:[...new Set(a)],devDependencies:[...new Set(d)],builds:f,integrations:p}}function C(e,t){let n=e=>e.replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?t[n]:e);return new Map([...e].map(([e,t])=>[e,n(t)]))}const w=/^([ \t]*)\/\/ @kick:([\w-]+)[ \t]*$/;function T(e,t,n=e=>e){let r=e.split(`
11
+ import{r as e}from"./fs-Cng50pl3.mjs";import{o as t,t as n}from"./config-wzsPHJ1r.mjs";import{dirname as r,join as i,resolve as a,sep as o}from"node:path";import{existsSync as s,readFileSync as c,readdirSync as l,statSync as u,writeFileSync as d}from"node:fs";import{execFile as f,execFileSync as p,execSync as m,spawnSync as h}from"node:child_process";import{fileURLToPath as g}from"node:url";import{promisify as _}from"node:util";import{parseSync as v}from"oxc-parser";const y=r(g(import.meta.url)),b=[i(y,`..`,`templates`),i(y,`..`,`..`,`templates`)].find(e=>s(i(e,`base`)));function x(e){return e.split(`/`).map(e=>e.startsWith(`_dot_`)?`.${e.slice(5)}`:e).join(`/`)}function S(e,t={}){let n=t.templatesDir??b,r=new Map,a=[],d=[],f={},p=[];for(let t of e){let e=i(n,t);if(!s(e))throw Error(`Unknown scaffold layer "${t}" (${e})`);let m=i(e,`feature.json`);if(s(m)){let e=JSON.parse(c(m,`utf-8`));a.push(...e.dependencies??[]),d.push(...e.devDependencies??[]),Object.assign(f,e.builds),p.push(...e.integrations??[])}let h=i(e,`files`);if(s(h))for(let e of l(h,{recursive:!0,encoding:`utf-8`}).toSorted()){let t=i(h,e);if(!u(t).isFile())continue;let n=c(t,`utf-8`),a=x(e.split(o).join(`/`));if(a.endsWith(`.append`)){let e=a.slice(0,-7);r.set(e,(r.get(e)??``)+n)}else r.set(a,n)}}p.push(...t.extra??[]);let m=t.vars??{},h=e=>e.replace(/\{\{(\w+)\}\}/g,(e,t)=>m[t]??e);for(let[e,t]of r)t.includes(`// @kick:`)&&r.set(e,T(t,p,h));return{files:r,dependencies:[...new Set(a)],devDependencies:[...new Set(d)],builds:f,integrations:p}}function C(e,t){let n=e=>e.replace(/\{\{(\w+)\}\}/g,(e,n)=>n in t?t[n]:e);return new Map([...e].map(([e,t])=>[e,n(t)]))}const w=/^([ \t]*)\/\/ @kick:([\w-]+)[ \t]*$/;function T(e,t,n=e=>e){let r=e.split(`
12
12
  `),i=new Set(r.map(e=>w.exec(e)?.[2]).filter(Boolean)),a=t.filter(e=>!e.slot||i.has(e.slot)),o=[];for(let e=0;e<r.length;e++){let t=w.exec(r[e]);if(!t){o.push(r[e]);continue}let[,i,s]=t,c=s===`imports`?ee(a.flatMap(e=>e.import?[e.import]:[])):a.filter(e=>e.slot===s&&e.code).map(e=>E(`${n(e.code)},`,i));if(c.length>0){o.push(...c);continue}o.at(-1)?.trimEnd().endsWith(`[`)&&r[e+1]?.trim().startsWith(`]`)&&(o.pop(),e++)}return o.join(`
13
13
  `)}function E(e,t){return e.split(`
14
14
  `).map(e=>e&&t+e).join(`
@@ -37,11 +37,11 @@ import{r as e}from"./fs-XytuMx9n.mjs";import{o as t,t as n}from"./config-QVJU9X2
37
37
  `);else{for(let e of await P(g,_.files))console.log(` Updated ${e}`);let e=v?await be(g,v,_.integrations):void 0;for(let t of e?.added??[])console.log(` Added ${t} to ${v}`);for(let t of e?.present??[])console.log(` ${t} is already in ${v}`);let t=I(g),n=e?e.manual:_.integrations.filter(e=>e.slot&&e.code).map(e=>({...e,code:t(e.code)}));n.length>0&&(console.log(`\n ${v?`Could not find bootstrap({ adapters: [...] }) in ${v}`:`No entry file found`} — add this yourself:
38
38
  `),console.log(Se(n).replace(/^/gm,` `)),console.log())}}b?console.log(` Done!
39
39
  `):(console.log(` Finished with errors — the install above did not complete.
40
- `),process.exitCode=1)})}const Y=r(g(import.meta.url)),X=JSON.parse(c([i(Y,`..`,`package.json`),i(Y,`..`,`..`,`package.json`)].find(s),`utf-8`)),Ne=[`@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`],Pe={react:{fallback:`^19.0.0`},"react-dom":{fallback:`^19.0.0`},"@types/react":{fallback:`^19.0.0`},"@types/react-dom":{fallback:`^19.0.0`},"@vitejs/plugin-react":{fallback:`^5.0.0`},"@types/node":{fallback:`^25.0.0`},"@types/supertest":{fallback:`^7.2.1`},supertest:{fallback:`^7.2.2`},vitest:{fallback:`^4.1.2`},"@swc/core":{fallback:`^1.15.21`},"unplugin-swc":{fallback:`^1.5.9`},oxfmt:{fallback:`^0.65.0`},oxlint:{fallback:`^1.80.0`},dotenv:{fallback:`^17.3.1`,cap:`^17`},"reflect-metadata":{fallback:`^0.2.2`},vite:{fallback:`^8.0.3`,cap:`^8`},typescript:{fallback:`^7.0.2`,cap:`^7`},"@typescript/typescript6":{fallback:`^6.0.2`,cap:`^6`},express:{fallback:`^5.1.0`,cap:`^5`},"@types/express":{fallback:`^5.0.6`,cap:`^5`},fastify:{fallback:`^5.0.0`,cap:`^5`},"@fastify/middie":{fallback:`^9.0.0`,cap:`^9`},h3:{fallback:`^1.0.0`,cap:`^1`},"serve-static":{fallback:`^2.2.0`,cap:`^2`},zod:{fallback:`^4.3.6`,cap:`^4`},valibot:{fallback:`^1.4.1`,cap:`^1`},yup:{fallback:`^1.7.1`,cap:`^1`},ws:{fallback:`^8.18.0`,cap:`^8`},bullmq:{fallback:`^5.0.0`,cap:`^5`},ioredis:{fallback:`^5.0.0`,cap:`^5`}};function Fe(e){if(!e)return null;let t=e.trim();if(/^\d+\.\d+\.\d+/.test(t))return t.split(/\s/)[0];try{let e=JSON.parse(t),n=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`);return n.length>0?n[n.length-1]:null}catch{return null}}function Ie(e){return e===`@forinda/kickjs-cli`?`^${X.version}`:`latest`}async function Z(e,t,n){let r=Array.from({length:e.length}),i=0,a=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let t=i++;r[t]=await n(e[t])}});return await Promise.all(a),r}async function Q(){let e=[...Ne.map(e=>({name:e,fallback:Ie(e),cap:void 0})),...Object.entries(Pe).map(([e,t])=>({name:e,...t}))],t=Date.now()+2e4,n=await Z(e,8,async({name:e,fallback:n,cap:r})=>{let i=t-Date.now();if(i<=0)return[e,n];let a=r?`${e}@${r}`:e,o=Fe(await ie(`npm`,r?[`view`,a,`version`,`--json`]:[`view`,a,`version`],{timeout:i}));return[e,o?`^${o}`:n]});return Object.fromEntries(n)}function Le(e,t){let n=k(`npm`,[`view`,`${e}@${t}`,`version`],{timeout:2e4});return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function Re(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 ze(e,t,n){let r=k(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`],{timeout:2e4});if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function Be(t){let{name:n,directory:r,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:u=`zod`,runtime:d=`express`}=t,f=r,p=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${n}\n`),t.versions||p(`Resolving package versions...`);let h=t.versions??await Q(),g=Object.keys(h).filter(e=>h[e]===`latest`);if(g.length>0&&p(`WARNING: could not reach npm for ${g.join(`, `)} — pinned to 'latest'`),d!==`express`){if(ze(`@forinda/kickjs`,`latest`,`./${d}`))p(`Using @forinda/kickjs@latest (stable ships the ${d} runtime)`);else{let e=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-vite`],t=[],n=!1;for(let r of e){let e=Le(r,`alpha`);e&&Re(e,$(h[r]))&&(h[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}p(n?`Using the alpha channel for the ${d} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${d} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}}let _=l.filter(e=>!s(i(b,`feature-${e}`)));_.length>0&&p(`WARNING: skipping unknown package(s): ${_.join(`, `)} — add them later with kick add`);let v=S([...He({template:o,runtime:d,schemaLib:u,packages:l}),...t.platformConfig===!1?[]:[`host-config`],...t.extraLayers??[]],{vars:{name:n,version:X.version},extra:[{slot:`repo`,code:c===`inmemory`?`repo: 'inmemory'`:`repo: { name: '${c.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)}' }`},...t.spaClientDir?[Ve(t.spaClientDir)]:[]]});await e(i(f,`package.json`),oe(n,h,v));let y=C(v.files,{name:n,template:o,runtime:d,packageManager:a,templateLabel:o===`rest`?`REST API`:`Minimal`,packages:[...v.dependencies,...v.devDependencies].filter(e=>e.startsWith(`@forinda/`)).map(e=>`- \`${e}\``).join(`
41
- `)});for(let[t,n]of y)await e(i(f,t),n);let{generateAgentDocs:x}=await import(`./agent-docs-4sLAr8Vt.mjs`).then(e=>e.t);await x({outDir:f,name:n,pm:a,template:o,only:`all`,force:!0});let w={...Oe,...J(l),...v.builds};if(t.approveInstallScripts!==!1&&q(a,f,w),t.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{m(`${a} install`,{cwd:f,stdio:`inherit`}),console.log(`
42
- Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-DJHxPQeq.mjs`).then(e=>e.n);await e({cwd:f,allowDuplicates:!0,silent:!0})}catch{}if(t.initGit)try{m(`git init`,{cwd:f,stdio:`pipe`}),m(`git branch -M main`,{cwd:f,stdio:`pipe`}),m(`git add -A`,{cwd:f,stdio:`pipe`}),m(`git commit -m "chore: initial commit from kick new"`,{cwd:f,stdio:`pipe`}),p(`Git repository initialized`)}catch{p(`Warning: git init failed (git may not be installed)`)}console.log(`
40
+ `),process.exitCode=1)})}const Y=r(g(import.meta.url)),X=JSON.parse(c([i(Y,`..`,`package.json`),i(Y,`..`,`..`,`package.json`)].find(s),`utf-8`)),Ne=[`@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`],Pe={react:{fallback:`^19.0.0`},"react-dom":{fallback:`^19.0.0`},"@types/react":{fallback:`^19.0.0`},"@types/react-dom":{fallback:`^19.0.0`},"@vitejs/plugin-react":{fallback:`^5.0.0`},"@types/node":{fallback:`^25.0.0`},"@types/supertest":{fallback:`^7.2.1`},supertest:{fallback:`^7.2.2`},vitest:{fallback:`^4.1.2`},"@swc/core":{fallback:`^1.15.21`},"unplugin-swc":{fallback:`^1.5.9`},oxfmt:{fallback:`^0.65.0`},oxlint:{fallback:`^1.80.0`},dotenv:{fallback:`^17.3.1`,cap:`^17`},"reflect-metadata":{fallback:`^0.2.2`},vite:{fallback:`^8.0.3`,cap:`^8`},typescript:{fallback:`^7.0.2`,cap:`^7`},"@typescript/typescript6":{fallback:`^6.0.2`,cap:`^6`},express:{fallback:`^5.1.0`,cap:`^5`},"@types/express":{fallback:`^5.0.6`,cap:`^5`},fastify:{fallback:`^5.0.0`,cap:`^5`},"@fastify/middie":{fallback:`^9.0.0`,cap:`^9`},h3:{fallback:`^1.0.0`,cap:`^1`},"serve-static":{fallback:`^2.2.0`,cap:`^2`},zod:{fallback:`^4.3.6`,cap:`^4`},valibot:{fallback:`^1.4.1`,cap:`^1`},"@valibot/to-json-schema":{fallback:`^1.8.0`,cap:`^1`},yup:{fallback:`^1.7.1`,cap:`^1`},ws:{fallback:`^8.18.0`,cap:`^8`},bullmq:{fallback:`^5.0.0`,cap:`^5`},ioredis:{fallback:`^5.0.0`,cap:`^5`}};function Fe(e){if(!e)return null;let t=e.trim();if(/^\d+\.\d+\.\d+/.test(t))return t.split(/\s/)[0];try{let e=JSON.parse(t),n=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`);return n.length>0?n[n.length-1]:null}catch{return null}}function Ie(e){return e===`@forinda/kickjs-cli`?`^${X.version}`:`latest`}async function Z(e,t,n){let r=Array.from({length:e.length}),i=0,a=Array.from({length:Math.min(t,e.length)},async()=>{for(;i<e.length;){let t=i++;r[t]=await n(e[t])}});return await Promise.all(a),r}async function Q(){let e=[...Ne.map(e=>({name:e,fallback:Ie(e),cap:void 0})),...Object.entries(Pe).map(([e,t])=>({name:e,...t}))],t=Date.now()+2e4,n=await Z(e,8,async({name:e,fallback:n,cap:r})=>{let i=t-Date.now();if(i<=0)return[e,n];let a=r?`${e}@${r}`:e,o=Fe(await ie(`npm`,r?[`view`,a,`version`,`--json`]:[`view`,a,`version`],{timeout:i}));return[e,o?`^${o}`:n]});return Object.fromEntries(n)}function Le(e,t){let n=k(`npm`,[`view`,`${e}@${t}`,`version`],{timeout:2e4});return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function Re(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 ze(e,t,n){let r=k(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`],{timeout:2e4});if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function Be(t){let{name:n,directory:r,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:u=`zod`,runtime:d=`express`}=t,f=r,p=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${n}\n`),t.versions||p(`Resolving package versions...`);let h=t.versions??await Q(),g=Object.keys(h).filter(e=>h[e]===`latest`);if(g.length>0&&p(`WARNING: could not reach npm for ${g.join(`, `)} — pinned to 'latest'`),d!==`express`){if(ze(`@forinda/kickjs`,`latest`,`./${d}`))p(`Using @forinda/kickjs@latest (stable ships the ${d} runtime)`);else{let e=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-vite`],t=[],n=!1;for(let r of e){let e=Le(r,`alpha`);e&&Re(e,$(h[r]))&&(h[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}p(n?`Using the alpha channel for the ${d} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${d} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}}let _=l.filter(e=>!s(i(b,`feature-${e}`)));_.length>0&&p(`WARNING: skipping unknown package(s): ${_.join(`, `)} — add them later with kick add`);let v=S([...He({template:o,runtime:d,schemaLib:u,packages:l}),...t.platformConfig===!1?[]:[`host-config`],...t.extraLayers??[]],{vars:{name:n,version:X.version},extra:[{slot:`repo`,code:c===`inmemory`?`repo: 'inmemory'`:`repo: { name: '${c.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`)}' }`},...t.spaClientDir?[Ve(t.spaClientDir)]:[]]});await e(i(f,`package.json`),oe(n,h,v));let y=C(v.files,{name:n,template:o,runtime:d,packageManager:a,templateLabel:o===`rest`?`REST API`:`Minimal`,packages:[...v.dependencies,...v.devDependencies].filter(e=>e.startsWith(`@forinda/`)).map(e=>`- \`${e}\``).join(`
41
+ `)});for(let[t,n]of y)await e(i(f,t),n);let{generateAgentDocs:x}=await import(`./agent-docs-z03QAZuD.mjs`).then(e=>e.t);await x({outDir:f,name:n,pm:a,template:o,only:`all`,force:!0});let w={...Oe,...J(l),...v.builds};if(t.approveInstallScripts!==!1&&q(a,f,w),t.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{m(`${a} install`,{cwd:f,stdio:`inherit`}),console.log(`
42
+ Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-OdQgDQBP.mjs`).then(e=>e.n);await e({cwd:f,allowDuplicates:!0,silent:!0})}catch{}if(t.initGit)try{m(`git init`,{cwd:f,stdio:`pipe`}),m(`git branch -M main`,{cwd:f,stdio:`pipe`}),m(`git add -A`,{cwd:f,stdio:`pipe`}),m(`git commit -m "chore: initial commit from kick new"`,{cwd:f,stdio:`pipe`}),p(`Git repository initialized`)}catch{p(`Warning: git init failed (git may not be installed)`)}console.log(`
43
43
  Project scaffolded successfully!`),console.log();let T=f!==process.cwd();p(`Next steps:`),T&&p(` cd ${n}`),t.installDeps||p(` ${a} install`);let E={rest:`kick g module user`,minimal:`# add your routes to src/index.ts`};return p(` ${E[o]??E.rest}`),p(` kick dev`),p(``),p(`Commands:`),p(` kick dev Start dev server with Vite HMR`),p(` kick build Production build via Vite`),p(` kick start Run production build`),p(``),p(`Generators:`),p(` kick g module <name> REST module (controller, service, DTOs, repository)`),p(` kick g scaffold <n> <f..> CRUD module from field definitions`),p(` kick g controller <name> Standalone controller`),p(` kick g service <name> @Service() class`),p(` kick g middleware <name> Global connect-style middleware`),p(` kick g guard <name> Route guard (auth, roles, etc.)`),p(` kick g adapter <name> AppAdapter with lifecycle hooks`),p(` kick g dto <name> DTO schema (Zod / Valibot / Yup)`),p(` kick g config Generate kick.config.ts`),p(``),p(`Add packages:`),p(` kick add <pkg> Install a KickJS package + peers`),p(` kick add --list Show all available packages`),p(``),p(`Available: ${Ce}`),p(``),{builds:w}}function Ve(e){return{import:{from:`@forinda/kickjs/spa`,names:[`SpaAdapter`]},slot:`adapter`,code:`// Serves the built frontend from this origin in production.
44
44
  // Inert until the client build exists, so \`kick dev\` (where Vite
45
45
  // serves the client and proxies /api here) is unaffected.
46
46
  SpaAdapter({ clientDir: ${JSON.stringify(e)} })`}}function He(e){return[`base`,`template-${e.template}`,`runtime-${e.runtime}`,`schema-${e.schemaLib}`,...e.packages.filter(e=>s(i(b,`feature-${e}`))).map(e=>`feature-${e}`)]}export{q as a,V as c,re as d,C as f,z as i,De as l,Q as n,Me as o,S as p,L as r,je as s,Be as t,ne as u};
47
- //# sourceMappingURL=project-BX52bTLz.mjs.map
47
+ //# sourceMappingURL=project-ty_X8Qx9.mjs.map