@forinda/kickjs-cli 8.2.2 → 8.2.4

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-DZr7FzZj.mjs → agent-docs-C6ZYsFJV.mjs} +3 -3
  2. package/dist/{agent-docs-DZr7FzZj.mjs.map → agent-docs-C6ZYsFJV.mjs.map} +1 -1
  3. package/dist/{agent-docs-BM62y5Ls.mjs → agent-docs-GCMhcDHy.mjs} +2 -2
  4. package/dist/{build-UyYIuF7x.mjs → build-DTs2SHKS.mjs} +2 -2
  5. package/dist/{build-DePaCEwC.mjs → build-hdxD_kEK.mjs} +3 -3
  6. package/dist/{build-DePaCEwC.mjs.map → build-hdxD_kEK.mjs.map} +1 -1
  7. package/dist/{builtins-BMFWC4BT.mjs → builtins-BZGJgOyW.mjs} +2 -2
  8. package/dist/{builtins-B-PqsutG.mjs → builtins-Ci7vBC42.mjs} +10 -15
  9. package/dist/cli.mjs +2 -2
  10. package/dist/{config-CKj2JDsP.mjs → config-Bsokk8bV.mjs} +2 -2
  11. package/dist/{config-BD0-dCTW.mjs → config-Dgap2WmJ.mjs} +3 -3
  12. package/dist/{config-BD0-dCTW.mjs.map → config-Dgap2WmJ.mjs.map} +1 -1
  13. package/dist/{doctor-GDaIVDho.mjs → doctor-Crq8eZsF.mjs} +4 -4
  14. package/dist/{doctor-GDaIVDho.mjs.map → doctor-Crq8eZsF.mjs.map} +1 -1
  15. package/dist/{fullstack-CqtrWxWC.mjs → fullstack-C7Q-BJcj.mjs} +11 -15
  16. package/dist/{fullstack-D_8yP2IS.mjs → fullstack-onQslndx.mjs} +12 -16
  17. package/dist/fullstack-onQslndx.mjs.map +1 -0
  18. package/dist/index.d.mts +8 -0
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs +2 -2
  21. package/dist/{plugin-CsZ1uy9o.mjs → plugin-BYqbu6uO.mjs} +2 -2
  22. package/dist/{plugin-TPTLqV5n.mjs → plugin-BuSzbyf2.mjs} +2 -2
  23. package/dist/project-4kpuS1ud.mjs +434 -0
  24. package/dist/{project-CXfIXH0R.mjs → project-BnXVCMd6.mjs} +32 -25
  25. package/dist/project-BnXVCMd6.mjs.map +1 -0
  26. package/dist/{project-docs-B25hGwDz.mjs → project-docs-CDr1HNPD.mjs} +2 -2
  27. package/dist/{project-docs-B25hGwDz.mjs.map → project-docs-CDr1HNPD.mjs.map} +1 -1
  28. package/dist/{project-docs-QdA-uXKP.mjs → project-docs-Dn60gTjG.mjs} +1 -1
  29. package/dist/{project-root-C2D12O-n.mjs → project-root-B1lyUoe8.mjs} +3 -3
  30. package/dist/{project-root-C2D12O-n.mjs.map → project-root-B1lyUoe8.mjs.map} +1 -1
  31. package/dist/{project-root-aksYdjTp.mjs → project-root-B5MNmlIn.mjs} +2 -2
  32. package/dist/{prompts-CFLyw4_b.mjs → prompts-8ssKQ4Kn.mjs} +2 -2
  33. package/dist/{prompts-CFLyw4_b.mjs.map → prompts-8ssKQ4Kn.mjs.map} +1 -1
  34. package/dist/{rolldown-runtime-BgqrGhnH.mjs → rolldown-runtime-DtbiLYsN.mjs} +1 -1
  35. package/dist/{run-plugins-DSqJuFsH.mjs → run-plugins-CxuPMW4H.mjs} +9 -14
  36. package/dist/run-plugins-CxuPMW4H.mjs.map +1 -0
  37. package/dist/{typegen-C5X7j_d9.mjs → typegen-Ca46MGcE.mjs} +5 -5
  38. package/dist/{typegen-C5X7j_d9.mjs.map → typegen-Ca46MGcE.mjs.map} +1 -1
  39. package/dist/{typegen-D024Elzf.mjs → typegen-ClJqftm9.mjs} +4 -4
  40. package/dist/{types-BB70_2Oi.mjs → types-CJlHwJb4.mjs} +1 -1
  41. package/package.json +10 -10
  42. package/dist/fullstack-D_8yP2IS.mjs.map +0 -1
  43. package/dist/project-BXTRWY8c.mjs +0 -427
  44. package/dist/project-CXfIXH0R.mjs.map +0 -1
  45. package/dist/run-plugins-DSqJuFsH.mjs.map +0 -1
@@ -0,0 +1,434 @@
1
+ /**
2
+ * @forinda/kickjs-cli v8.2.4
3
+ *
4
+ * Copyright (c) Felix Orinda
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ import{a as e,t}from"./config-Bsokk8bV.mjs";import{l as n,o as r}from"./project-docs-Dn60gTjG.mjs";import{existsSync as i,readFileSync as a,writeFileSync as o}from"node:fs";import{dirname as s,join as c,resolve as l}from"node:path";import{fileURLToPath as u}from"node:url";import{execFile as d,execFileSync as f,execSync as p,spawnSync as m}from"node:child_process";import{promisify as h}from"node:util";const g=h(d),_=/[&|<>^"'`(){}[\];!%\r\n\\]/;function v(e,t,n=process.platform){if(n!==`win32`)return[e,t];if(_.test(e)||t.some(e=>_.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 y(e,t,n={}){let r=v(e,t);if(!r)return null;try{return f(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 ee(e,t,n={}){let r=v(e,t);if(!r)throw Error(`Refusing to run '${e}': unsafe arguments`);f(r[0],r[1],{cwd:n.cwd,stdio:`inherit`,windowsHide:!0})}function b(e,t,n){p(e,{cwd:t,stdio:`inherit`,env:n?{...process.env,...n}:process.env})}function x(e,t,n){let r=m(process.execPath,[e],{cwd:n,stdio:`inherit`,env:{...process.env,...t}});r.status!==0&&process.exit(r.status??1)}async function S(e,t,n={}){let r=v(e,t);if(!r)return null;try{let{stdout:e}=await g(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 te={swagger:`@forinda/kickjs-swagger`,ws:`@forinda/kickjs-ws`,queue:`@forinda/kickjs-queue`,devtools:`@forinda/kickjs-devtools`},ne={zod:{name:`zod`,range:`^4.3.6`},valibot:{name:`valibot`,range:`^1.4.1`},yup:{name:`yup`,range:`^1.7.1`}};function C(e,t){let n=e[t];if(!n)throw Error(`generatePackageJson: missing resolved version for ${t}. Add it to SIBLING_PACKAGES in generators/project.ts.`);return n}function re(e,t,n,r=[],i=`zod`,a=`express`,o=!1){let s=ne[i],c={"@forinda/kickjs":C(n,`@forinda/kickjs`),"@forinda/kickjs-schema":C(n,`@forinda/kickjs-schema`),dotenv:`^17.3.1`,"reflect-metadata":`^0.2.2`,[s.name]:s.range};a===`express`?c.express=`^5.1.0`:a===`fastify`?(c.fastify=`^5.0.0`,c[`@fastify/middie`]=`^9.0.0`,c[`serve-static`]=`^2.2.0`):a===`h3`&&(c.h3=`^1.0.0`,c[`serve-static`]=`^2.2.0`);for(let e of r){let t=te[e];t&&!c[t]&&(c[t]=C(n,t))}return JSON.stringify({name:e,version:`0.0.0`,type:`module`,scripts:{dev:`kick dev`,build:`kick build`,start:`kick start`,test:`vitest run`},dependencies:c,devDependencies:{"@forinda/kickjs-cli":C(n,`@forinda/kickjs-cli`),"@forinda/kickjs-testing":C(n,`@forinda/kickjs-testing`),"@forinda/kickjs-vite":C(n,`@forinda/kickjs-vite`),"@types/supertest":`^7.2.1`,"@swc/core":`^1.15.21`,...a===`express`?{"@types/express":`^5.0.6`}:{},"@types/node":`^25.0.0`,"unplugin-swc":`^1.5.9`,vite:`^8.0.3`,supertest:`^7.2.2`,vitest:`^4.1.2`,typescript:`^7.0.2`,...o?{"@typescript/typescript6":`^6.0.2`}:{},oxfmt:`^0.65.0`,oxlint:`^1.80.0`}},null,2)}function ie(e={}){return`import { defineConfig } from 'vite'
12
+ import { fileURLToPath } from 'node:url'
13
+ import swc from 'unplugin-swc'
14
+ import { kickjsVitePlugin, envWatchPlugin } from '@forinda/kickjs-vite'
15
+
16
+ export default defineConfig({
17
+ oxc: false,
18
+ plugins: [
19
+ swc.vite(),
20
+ kickjsVitePlugin({ entry: 'src/index.ts' }),
21
+ // Watches .env files and triggers a full reload on change so the
22
+ // dev server picks up env tweaks without a manual restart.
23
+ envWatchPlugin(),
24
+ ],
25
+ ${e.strictPort?` server: {
26
+ // web/vite.config.ts proxies /api to this port — fail instead of moving
27
+ // to another port when it's taken, or the proxy would reach the wrong process.
28
+ strictPort: true,
29
+ },
30
+ `:``} resolve: {
31
+ alias: {
32
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
33
+ },
34
+ },
35
+ build: {
36
+ target: 'node20',
37
+ ssr: true,
38
+ outDir: 'dist',
39
+ sourcemap: true,
40
+ rollupOptions: {
41
+ input: fileURLToPath(new URL('./src/index.ts', import.meta.url)),
42
+ output: { format: 'esm' },
43
+ },
44
+ },
45
+ })
46
+ `}function ae(e,t){let n=Object.entries(t);if(n.length===0)return e;let r=e===``?[]:e.replace(/\n$/,``).split(`
47
+ `),i=e=>e.trim().replace(/^['"]|['"]$/g,``),a=e=>/^[\w-]+$/.test(e)?e:`'${e}'`,o=(e,t)=>{let n=r.findIndex(t=>t.replace(/\s+$/,``)===`${e}:`);if(n===-1){if(!t)return;r.length>0&&r[r.length-1]!==``&&r.push(``),r.push(`${e}:`),n=r.length-1}let i=n+1;for(let e=n+1;e<r.length&&/^(\s|$)/.test(r[e]);e++)r[e].trim()!==``&&(i=e+1);return{start:n,end:i}},s=[];for(let[e,t]of n){let{start:n,end:c}=o(`allowBuilds`,!0),l=r.slice(n+1,c).findIndex(t=>i(t.split(`:`)[0])===e),u=l===-1?void 0:/:\s*(true|false)\s*$/.exec(r[n+1+l]);if(u){s.push([e,u[1]===`true`]);continue}let d=` ${a(e)}: ${t}`;l===-1?r.splice(c,0,d):r[n+1+l]=d,s.push([e,t])}let c=[`onlyBuiltDependencies`,`ignoredBuiltDependencies`];for(let[e,t]of s){if(c.some(t=>{let n=o(t,!1);return n!==void 0&&r.slice(n.start+1,n.end).some(t=>i(t.replace(/^\s*-/,``))===e)}))continue;let{end:n}=o(t?c[0]:c[1],!0);r.splice(n,0,` - ${a(e)}`)}return`${r.join(`
48
+ `)}\n`}function w(){return JSON.stringify({compilerOptions:{target:`ES2022`,module:`ESNext`,moduleResolution:`bundler`,lib:[`ES2022`],types:[`node`,`vite/client`],strict:!0,esModuleInterop:!0,skipLibCheck:!0,sourceMap:!0,declaration:!0,experimentalDecorators:!0,emitDecoratorMetadata:!0,outDir:`dist`,paths:{"@/*":[`./src/*`]}},include:[`src`,`.kickjs/types/**/*.d.ts`,`.kickjs/types/**/*.ts`]},null,2)}function T(){return JSON.stringify({$schema:`./node_modules/oxfmt/configuration_schema.json`,semi:!1,singleQuote:!0,trailingComma:`all`,printWidth:100,tabWidth:2,ignorePatterns:[`**/dist/`,`**/.kickjs/`,`**/node_modules/`]},null,2)}function E(){return`# https://editorconfig.org
49
+ root = true
50
+
51
+ [*]
52
+ indent_style = space
53
+ indent_size = 2
54
+ end_of_line = lf
55
+ charset = utf-8
56
+ trim_trailing_whitespace = true
57
+ insert_final_newline = true
58
+
59
+ [*.md]
60
+ trim_trailing_whitespace = false
61
+ `}function oe(){return`node_modules/
62
+ dist/
63
+ .env
64
+ # Machine-specific: each developer's test env differs (database names, ports).
65
+ # The shared template is the committed \`.env.test.example\`.
66
+ .env.test
67
+ *.local
68
+ coverage/
69
+ .DS_Store
70
+ *.tsbuildinfo
71
+ .kickjs/
72
+ `}function se(){return`# Auto-detect text files and normalise line endings to LF
73
+ * text=auto eol=lf
74
+
75
+ # Explicitly mark generated / binary files
76
+ *.png binary
77
+ *.jpg binary
78
+ *.jpeg binary
79
+ *.gif binary
80
+ *.ico binary
81
+ *.woff binary
82
+ *.woff2 binary
83
+ *.ttf binary
84
+ *.eot binary
85
+
86
+ # Lock files — treat as generated
87
+ pnpm-lock.yaml -diff linguist-generated
88
+ yarn.lock -diff linguist-generated
89
+ package-lock.json -diff linguist-generated
90
+ `}function ce(){return`PORT=3000
91
+ NODE_ENV=development
92
+ `}function le(){return`PORT=3000
93
+ NODE_ENV=development
94
+ `}function D(){return`# Read INSTEAD of .env when NODE_ENV=test (or under vitest).
95
+ # No fallback to .env — declare here everything the suite needs, so a
96
+ # missing var fails the run instead of silently resolving to your dev value.
97
+ #
98
+ # Not committed. Add new keys to .env.test.example too, with placeholder
99
+ # values — never real endpoints or credentials.
100
+ NODE_ENV=test
101
+ PORT=0
102
+ LOG_LEVEL=silent
103
+ `}function ue(){return`# Template for .env.test. Copy it and fill in your machine's values:
104
+ # cp .env.test.example .env.test
105
+ ${D()}`}function de(){return`import { defineConfig, mergeConfig } from 'vitest/config'
106
+ import viteConfig from './vite.config.ts'
107
+
108
+ // A \`vitest.config.ts\` OVERRIDES \`vite.config.ts\` outright — vitest does not
109
+ // merge the two, and it never reads tsconfig \`paths\`. Restating settings here
110
+ // would mean the \`@\` alias lives in three files and drifts in two of them, so
111
+ // merge the real config instead: the alias, plugins, and ssr externals all come
112
+ // from one place.
113
+ export default mergeConfig(
114
+ viteConfig,
115
+ defineConfig({
116
+ test: {
117
+ globals: true,
118
+ environment: 'node',
119
+ include: ['src/**/*.test.ts'],
120
+ },
121
+ }),
122
+ )
123
+ `}const fe={express:{from:`@forinda/kickjs`,name:`expressRuntime`},fastify:{from:`@forinda/kickjs/fastify`,name:`fastifyRuntime`},h3:{from:`@forinda/kickjs/h3`,name:`h3Runtime`}};function O(e,t,n,r=[],i=`express`,a){let o=fe[i],s=i===`express`;switch(t){case`minimal`:{let t=[],i=[],c=s?`import { bootstrap, ${o.name} } from '@forinda/kickjs'`:`import { bootstrap } from '@forinda/kickjs'\nimport { ${o.name} } from '${o.from}'`;r.includes(`swagger`)&&(t.push(`import { SwaggerAdapter } from '@forinda/kickjs-swagger'`),i.push(` SwaggerAdapter({ info: { title: '${e}', version: '${n}' } }),`)),r.includes(`devtools`)&&(t.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`),i.push(` DevToolsAdapter(),`)),a&&(t.push(`import { SpaAdapter } from '@forinda/kickjs/spa'`),i.push(` // Serves the built frontend from this origin in production.
124
+ // Inert until the client build exists, so \`kick dev\` (where Vite
125
+ // serves the client and proxies /api here) is unaffected.
126
+ SpaAdapter({ clientDir: ${JSON.stringify(a)} }),`));let l=t.length?t.join(`
127
+ `)+`
128
+ `:``,u=i.length?`,\n adapters: [\n${i.join(`
129
+ `)}\n ]`:``;return`import 'reflect-metadata'
130
+ // Side-effect import — registers the extended env schema with kickjs
131
+ // **before** any controller / service / @Value gets resolved. Without
132
+ // this line ConfigService.get('YOUR_KEY') returns undefined because the
133
+ // cached schema would still be the base shape. See guide/configuration.
134
+ import './config'
135
+ ${c}
136
+ ${l}import { modules } from './modules'
137
+
138
+ // Export the app for the Vite plugin (dev mode)
139
+ export const app = await bootstrap({ modules, runtime: ${o.name}()${u} })
140
+ `}default:{let t=[],i=[];r.includes(`devtools`)&&(t.push(`import { DevToolsAdapter } from '@forinda/kickjs-devtools'`),i.push(` DevToolsAdapter(),`)),r.includes(`swagger`)&&(t.push(`import { SwaggerAdapter } from '@forinda/kickjs-swagger'`),i.push(` SwaggerAdapter({\n info: { title: '${e}', version: '${n}' },\n }),`));let a=t.length?t.join(`
141
+ `)+`
142
+ `:``,c=i.length?`\n adapters: [\n${i.join(`
143
+ `)}\n ],`:``,l=[`bootstrap`,`requestId`,`requestLogger`,`helmet`,`cors`];s&&l.push(o.name);let u=s?`import express from 'express'\nimport {\n ${l.join(`,
144
+ `)},\n} from '@forinda/kickjs'`:`import {\n ${l.join(`,
145
+ `)},\n} from '@forinda/kickjs'\nimport { ${o.name} } from '${o.from}'`,d=s?`
146
+ express.json(),`:``;return`import 'reflect-metadata'
147
+ // Side-effect import — registers the extended env schema with kickjs
148
+ // **before** any controller / service / @Value gets resolved. Without
149
+ // this line ConfigService.get('YOUR_KEY') returns undefined because the
150
+ // cached schema would still be the base shape. See guide/configuration.
151
+ import './config'
152
+ ${u}
153
+ ${a}import { modules } from './modules'
154
+
155
+ // Export the app for the Vite plugin (dev mode)
156
+ export const app = await bootstrap({
157
+ modules,
158
+ runtime: ${o.name}(),${c}
159
+ middlewares: [
160
+ // Security headers. The framework injects helmet() with these defaults
161
+ // anyway — declaring it here is what lets you CHANGE them, e.g.
162
+ // helmet({ frameguard: 'SAMEORIGIN' }) or helmet({ hsts: false }).
163
+ // Auto-injection stands down as soon as this line is present.
164
+ helmet(),
165
+ cors({ origin: '*' }),
166
+ requestId(),
167
+ requestLogger(),${d}
168
+ ],
169
+ })
170
+ `}}}function k(){return`import { defineModules } from '@forinda/kickjs'
171
+ import { HelloModule } from './hello/hello.module'
172
+
173
+ // Remove HelloModule and run: kick g module <name>
174
+ // \`defineModules()\` returns a chainable list — \`kick g module\` appends
175
+ // \`.mount(NewModule())\` to the chain on every generation.
176
+ export const modules = defineModules().mount(HelloModule())
177
+ `}function A(e=`zod`){return e===`valibot`?`import { loadEnvFromSchema } from '@forinda/kickjs/config'
178
+ import { fromValibot } from '@forinda/kickjs-schema/valibot'
179
+ import * as v from 'valibot'
180
+
181
+ /**
182
+ * Project environment schema (Valibot).
183
+ *
184
+ * \`fromValibot\` wraps the Valibot schema as a \`KickSchema\` so the
185
+ * env loader, validate middleware, and swagger spec generator all see
186
+ * the same shape. The default export is the contract \`kick typegen\`
187
+ * reads to populate \`KickEnv\` via \`InferSchemaOutput<typeof _envSchema>\`
188
+ * — that's what makes \`@Value('FOO')\` autocomplete and
189
+ * \`process.env.FOO\` typed.
190
+ *
191
+ * @example
192
+ * DATABASE_URL: v.pipe(v.string(), v.url()),
193
+ * JWT_SECRET: v.pipe(v.string(), v.minLength(32)),
194
+ * REDIS_URL: v.optional(v.pipe(v.string(), v.url())),
195
+ */
196
+ const envSchema = fromValibot(
197
+ v.object({
198
+ PORT: v.optional(v.pipe(v.string(), v.transform(Number)), '3000'),
199
+ NODE_ENV: v.optional(v.picklist(['development', 'production', 'test']), 'development'),
200
+ LOG_LEVEL: v.optional(v.string(), 'info'),
201
+ // DATABASE_URL: v.pipe(v.string(), v.url()),
202
+ }),
203
+ )
204
+
205
+ /**
206
+ * IMPORTANT — side effect: register the schema with kickjs's env cache
207
+ * **at module-load time**. \`ConfigService\` and \`@Value()\` both consume
208
+ * this cache, and they will fall back to the base schema (or undefined)
209
+ * if no extended schema has been registered before they're resolved.
210
+ *
211
+ * As long as \`src/index.ts\` imports this file (\`import './config'\`) at
212
+ * the top — before \`bootstrap()\` runs — every controller and service
213
+ * in the app sees the typed extended values.
214
+ */
215
+ export const env = loadEnvFromSchema(envSchema)
216
+
217
+ export default envSchema
218
+ `:e===`yup`?`import { loadEnvFromSchema } from '@forinda/kickjs/config'
219
+ import { fromYup } from '@forinda/kickjs-schema/yup'
220
+ import * as yup from 'yup'
221
+
222
+ /**
223
+ * Project environment schema (Yup).
224
+ *
225
+ * \`fromYup\` wraps the Yup schema as a \`KickSchema\` so the env loader,
226
+ * validate middleware, and swagger spec generator all see the same
227
+ * shape. The default export is the contract \`kick typegen\` reads to
228
+ * populate \`KickEnv\` via \`InferSchemaOutput<typeof _envSchema>\`.
229
+ *
230
+ * Note: Yup's \`.url()\` defaults to http/https; database connection
231
+ * strings like \`postgres://\` use \`.matches(/^[a-z]+:\\/\\/.+/i)\` or
232
+ * a plain \`.string().required()\`.
233
+ *
234
+ * @example
235
+ * DATABASE_URL: yup.string().required(),
236
+ * JWT_SECRET: yup.string().min(32).required(),
237
+ * REDIS_URL: yup.string().url().optional(),
238
+ */
239
+ const envSchema = fromYup(
240
+ yup.object({
241
+ PORT: yup.number().default(3000),
242
+ NODE_ENV: yup
243
+ .string()
244
+ .oneOf(['development', 'production', 'test'])
245
+ .default('development'),
246
+ LOG_LEVEL: yup.string().default('info'),
247
+ // DATABASE_URL: yup.string().required(),
248
+ }),
249
+ )
250
+
251
+ /**
252
+ * IMPORTANT — side effect: register the schema with kickjs's env cache
253
+ * **at module-load time**. \`ConfigService\` and \`@Value()\` both consume
254
+ * this cache, and they will fall back to the base schema (or undefined)
255
+ * if no extended schema has been registered before they're resolved.
256
+ *
257
+ * As long as \`src/index.ts\` imports this file (\`import './config'\`) at
258
+ * the top — before \`bootstrap()\` runs — every controller and service
259
+ * in the app sees the typed extended values.
260
+ */
261
+ export const env = loadEnvFromSchema(envSchema)
262
+
263
+ export default envSchema
264
+ `:`import { loadEnvFromSchema } from '@forinda/kickjs/config'
265
+ import { fromZod } from '@forinda/kickjs-schema/zod'
266
+ import { z } from 'zod'
267
+
268
+ /**
269
+ * Project environment schema (Zod).
270
+ *
271
+ * \`fromZod\` wraps the Zod schema as a \`KickSchema\` so the env loader,
272
+ * validate middleware, and swagger spec generator all see the same
273
+ * shape. The default export is the contract \`kick typegen\` reads to
274
+ * populate \`KickEnv\` via \`InferSchemaOutput<typeof _envSchema>\` —
275
+ * that's what makes \`@Value('FOO')\` autocomplete and
276
+ * \`process.env.FOO\` typed.
277
+ *
278
+ * @example
279
+ * DATABASE_URL: z.string().url(),
280
+ * JWT_SECRET: z.string().min(32),
281
+ * REDIS_URL: z.string().url().optional(),
282
+ */
283
+ const envSchema = fromZod(
284
+ z.object({
285
+ PORT: z.coerce.number().default(3000),
286
+ NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
287
+ LOG_LEVEL: z.string().default('info'),
288
+ // DATABASE_URL: z.string().url(),
289
+ }),
290
+ )
291
+
292
+ /**
293
+ * IMPORTANT — side effect: register the schema with kickjs's env cache
294
+ * **at module-load time**. \`ConfigService\` and \`@Value()\` both consume
295
+ * this cache, and they will fall back to the base schema (or undefined)
296
+ * if no extended schema has been registered before they're resolved.
297
+ *
298
+ * As long as \`src/index.ts\` imports this file (\`import './config'\`) at
299
+ * the top — before \`bootstrap()\` runs — every controller and service
300
+ * in the app sees the typed extended values.
301
+ */
302
+ export const env = loadEnvFromSchema(envSchema)
303
+
304
+ export default envSchema
305
+ `}function j(){return`import { Service } from '@forinda/kickjs'
306
+
307
+ @Service()
308
+ export class HelloService {
309
+ greet(name: string) {
310
+ return { message: \`Hello \${name} from KickJS!\`, timestamp: new Date().toISOString() }
311
+ }
312
+
313
+ healthCheck() {
314
+ return { status: 'ok', uptime: process.uptime() }
315
+ }
316
+ }
317
+ `}function M(){return`import { Controller, Get, Autowired, type Ctx } from '@forinda/kickjs'
318
+ import { HelloService } from './hello.service'
319
+
320
+ // \`Ctx<KickRoutes.HelloController['<method>']>\` is generated by
321
+ // \`kick typegen\` (auto-run on \`kick dev\`). The first run after a fresh
322
+ // scaffold creates \`.kickjs/types/routes.ts\` so this file typechecks.
323
+ // See https://kickjs.app/guide/typegen.
324
+
325
+ @Controller()
326
+ export class HelloController {
327
+ @Autowired() private readonly helloService!: HelloService
328
+
329
+ // Return-value handlers: the runtime sends the returned payload as
330
+ // 200 json, and \`kick typegen\` infers the response type into
331
+ // \`KickRoutes.Api\` — which is what makes the typed client
332
+ // (@forinda/kickjs-client) end-to-end type-safe.
333
+ @Get('/')
334
+ index(_ctx: Ctx<KickRoutes.HelloController['index']>) {
335
+ return this.helloService.greet('World')
336
+ }
337
+
338
+ @Get('/health')
339
+ health(_ctx: Ctx<KickRoutes.HelloController['health']>) {
340
+ return this.helloService.healthCheck()
341
+ }
342
+ }
343
+ `}function N(){return`import { defineModule } from '@forinda/kickjs'
344
+ import { HelloController } from './hello.controller'
345
+
346
+ export const HelloModule = defineModule({
347
+ name: 'HelloModule',
348
+ build: () => ({
349
+ // \`register(container)\` is optional — only implement it when you need
350
+ // to bind a token to a concrete implementation, e.g.
351
+ // register(container) {
352
+ // container.registerFactory(USER_REPOSITORY, () => container.resolve(InMemoryUserRepository))
353
+ // }
354
+ // The HelloService uses @Service() so the decorator handles registration.
355
+
356
+ routes() {
357
+ return {
358
+ path: '/hello',
359
+ controller: HelloController,
360
+ }
361
+ },
362
+ }),
363
+ })
364
+ `}function P(e,t=`inmemory`,n=`pnpm`,r=`express`,i=!1){return`import { defineConfig } from '@forinda/kickjs-cli'
365
+
366
+ export default defineConfig({
367
+ pattern: '${e}',
368
+ // The HTTP engine this app boots on (matches \`bootstrap({ runtime })\` in
369
+ // src/index.ts). Dep-aware commands read it: \`kick add upload\` installs the
370
+ // engine's multipart driver, \`kick doctor\` checks the engine peers, and
371
+ // \`kick typegen\` flips the runtime escape-hatch types to this engine.
372
+ runtime: '${r}',
373
+ // Pinned so \`kick add\` and other dep-installing commands always use the
374
+ // project's intended package manager, regardless of which lockfile exists.
375
+ packageManager: '${n}',
376
+ modules: {
377
+ dir: 'src/modules',
378
+ repo: ${t===`inmemory`?`'inmemory'`:`{ name: '${t}' }`},
379
+ pluralize: true,
380
+ },
381
+
382
+ // \`kick typegen\` populates \`.kickjs/types/\` so \`Ctx<KickRoutes.X['method']>\`
383
+ // resolves to fully-typed params/body/query. Auto-runs on \`kick dev\`.
384
+ // \`'kickjs-schema'\` routes inference through \`InferSchemaOutput\` so the
385
+ // typegen works for any wrapped schema (Zod / Valibot / Yup). Switch
386
+ // to \`'zod'\` if you ship Zod schemas without \`fromZod()\` wrapping, or
387
+ // set \`schemaValidator: false\` to skip schema-driven body typing.
388
+ typegen: {
389
+ schemaValidator: 'kickjs-schema',${i?`
390
+ // web/ reads this map from the ambient KickClientApi namespace. Producing
391
+ // it builds a TypeScript program over the server, so it stays off unless a
392
+ // project actually consumes it.
393
+ client: true,`:``}
394
+ },
395
+
396
+ commands: [
397
+ {
398
+ name: 'test',
399
+ description: 'Run tests with Vitest',
400
+ steps: 'vitest run',
401
+ },
402
+ {
403
+ name: 'lint',
404
+ description: 'Lint with oxlint',
405
+ steps: 'oxlint src/',
406
+ },
407
+ {
408
+ name: 'format',
409
+ description: 'Format code with oxfmt',
410
+ steps: 'oxfmt src/',
411
+ },
412
+ {
413
+ name: 'format:check',
414
+ description: 'Check formatting without writing',
415
+ steps: 'oxfmt --check src/',
416
+ },
417
+ {
418
+ name: 'ci:check',
419
+ description: 'Run typecheck + lint + format check',
420
+ steps: ['kick typecheck', 'oxlint src/', 'oxfmt --check src/'],
421
+ aliases: ['verify'],
422
+ },
423
+ ],
424
+ })
425
+ `}const F={kickjs:{pkg:`@forinda/kickjs`,peers:[],enginePeers:!0,description:`Unified framework: DI, decorators, routing, middleware`,core:!0},vite:{pkg:`@forinda/kickjs-vite`,peers:[`vite`],description:`Vite plugin: dev server, HMR, module discovery`,dev:!0,core:!0},cli:{pkg:`@forinda/kickjs-cli`,peers:[],description:`CLI tool and code generators`,dev:!0,core:!0},zod:{pkg:`zod`,peers:[],description:`Zod schema validation (env, DTOs, OpenAPI) — wrap with fromZod()`},valibot:{pkg:`valibot`,peers:[],description:`Valibot schema validation — wrap with fromValibot()`},yup:{pkg:`yup`,peers:[],description:`Yup schema validation — wrap with fromYup()`},ai:{pkg:`@forinda/kickjs-ai`,peers:[`zod`],description:`AI toolkit — LLM providers, tool definitions from controllers`},swagger:{pkg:`@forinda/kickjs-swagger`,peers:[],description:`OpenAPI spec + Swagger UI + ReDoc`,builds:{"@scarf/scarf":!0}},db:{pkg:`@forinda/kickjs-db`,peers:[],description:`kick/db core — schema DSL, migrations, KickDbClient, customType`},pg:{pkg:`@forinda/kickjs-db`,peers:[`pg`],description:`kick/db + PostgreSQL driver (use @forinda/kickjs-db/pg)`},sqlite:{pkg:`@forinda/kickjs-db`,peers:[`better-sqlite3`],description:`kick/db + SQLite driver (use @forinda/kickjs-db/sqlite)`},mysql:{pkg:`@forinda/kickjs-db`,peers:[`mysql2`],description:`kick/db + MySQL driver (use @forinda/kickjs-db/mysql)`},ws:{pkg:`@forinda/kickjs-ws`,peers:[`ws`],description:`WebSocket with @WsController decorators`},devtools:{pkg:`@forinda/kickjs-devtools`,peers:[],description:`Development dashboard — routes, DI, metrics, health`,dev:!0},queue:{pkg:`@forinda/kickjs-queue`,peers:[],description:`Queue adapter (BullMQ/RabbitMQ/Kafka)`},"queue:bullmq":{pkg:`@forinda/kickjs-queue`,peers:[`bullmq`,`ioredis`],description:`Queue with BullMQ + Redis`},"queue:rabbitmq":{pkg:`@forinda/kickjs-queue`,peers:[`amqplib`],description:`Queue with RabbitMQ`},"queue:kafka":{pkg:`@forinda/kickjs-queue`,peers:[`kafkajs`],description:`Queue with Kafka`},"queue:redis-pubsub":{pkg:`@forinda/kickjs-queue`,peers:[`ioredis`],description:`Lightweight pub/sub via Redis (no persistence)`},mcp:{pkg:`@forinda/kickjs-mcp`,peers:[`@modelcontextprotocol/sdk`],description:`Model Context Protocol server — expose @Controller endpoints as AI tools`},testing:{pkg:`@forinda/kickjs-testing`,peers:[],description:`Test utilities and TestModule builder`,dev:!0}},I=Object.entries(F).filter(([e,t])=>!t.core&&!t.deprecated&&!e.includes(`:`)&&![`pg`,`sqlite`,`mysql`,`zod`,`valibot`,`yup`].includes(e)).map(([e])=>e).join(`, `),L={express:[`express`],fastify:[`fastify`,`@fastify/middie`,`serve-static`],h3:[`h3`,`serve-static`]},R={express:{prod:`multer`,dev:`@types/multer`,note:`Express uploads use multer (memory/disk storage, ctx.file / ctx.files).`},fastify:{prod:`@fastify/multipart`,note:`Fastify uploads use @fastify/multipart (buffered into ctx.file / ctx.files).`},h3:{note:`h3 parses multipart natively (readMultipartFormData) — no driver to install.`}};function z(e){if(e!==void 0){if(e===`express`||e===`fastify`||e===`h3`)return e;throw Error(`Invalid --runtime '${String(e)}'. Expected express, fastify or h3.`)}}async function B(e=process.cwd()){return(await V(e)).runtime}async function V(t=process.cwd()){let n=(await e(t))?.runtime;return n===`express`||n===`fastify`||n===`h3`?{runtime:n,candidates:[n],ambiguous:!1,fromConfig:!0}:{...pe(t),fromConfig:!1}}const H=[[`express`,`express`],[`fastify`,`fastify`],[`h3`,`h3`]];function pe(e=process.cwd()){let t=U(`package.json`,e);if(!t)return{runtime:`express`,candidates:[],ambiguous:!1};let n={},r={};try{let e=JSON.parse(a(l(t,`package.json`),`utf-8`));n=e.dependencies??{},r=e.devDependencies??{}}catch{return{runtime:`express`,candidates:[],ambiguous:!1}}let i=H.filter(([e])=>e in n).map(([,e])=>e),o=H.filter(([e])=>e in r&&!(e in n)).map(([,e])=>e),s=[...i,...o];return i.length===1?{runtime:i[0],candidates:s,ambiguous:!1}:i.length===0&&o.length===1?{runtime:o[0],candidates:s,ambiguous:!1}:s.length===0?{runtime:`express`,candidates:s,ambiguous:!1}:{runtime:`express`,candidates:s,ambiguous:!0}}function U(e,t=process.cwd()){let n=t;for(;;){if(i(l(n,e)))return n;let t=s(n);if(t===n)return null;n=t}}function me(){return U(`pnpm-lock.yaml`)?`pnpm`:U(`yarn.lock`)?`yarn`:U(`bun.lockb`)||U(`bun.lock`)?`bun`:U(`package-lock.json`)?`npm`:null}function he(){let e=process.cwd();for(;e;){let n=l(e,`package.json`);if(i(n))try{let e=JSON.parse(a(n,`utf-8`)).packageManager;if(typeof e==`string`){let n=e.split(`@`)[0];if(t.includes(n))return n}}catch{}let r=s(e);if(r===e)return null;e=r}return null}async function W(n){if(n&&t.includes(n))return{pm:n,source:`flag`};let r=await e(process.cwd());if(r?.packageManager&&t.includes(r.packageManager))return{pm:r.packageManager,source:`config`};let i=he();if(i)return{pm:i,source:`package.json`};let a=me();return a?{pm:a,source:`lockfile`}:{pm:`npm`,source:`default`}}async function ge(e){let{pm:t}=await W(e);return t}function G(e=!1,t){let n=Object.entries(F),r=Math.max(...n.map(([e])=>e.length)),i=n.filter(([,e])=>e.core),a=n.filter(([,e])=>!e.core),o=([e,n])=>{let i=e.padEnd(r+2),a=n.enginePeers?[...n.peers,...L[t??`express`]]:n.peers,o=n.enginePeers?` [${t??`express`} engine]`:``,s=a.length?` (+ ${a.join(`, `)})${o}`:``,c=n.deprecated?` [DEPRECATED — ${n.deprecated}]`:``;return` ${i} ${n.description}${s}${c}`};console.log(`
426
+ Core packages (always installed by \`kick new\`):
427
+ `);for(let e of i)console.log(o(e));if(e){console.log(`
428
+ Optional packages (add as needed):
429
+ `);for(let e of a)console.log(o(e))}else console.log(`\n Plus ${a.length} optional packages (swagger, db, queue, …).`),console.log(" Run `kick add --list --all` for the full catalog.");console.log(`
430
+ Usage: kick add ai db swagger`),console.log(` kick add queue:bullmq`),console.log(` kick add upload # installs the multipart driver for your runtime`),console.log()}const K={"@swc/core":!0,esbuild:!0};function q(e,t,n){if(e===`pnpm`){let e=l(t,`pnpm-workspace.yaml`),r=i(e)?a(e,`utf-8`):``,s=ae(r,n);return s===r?void 0:(o(e,s),e)}if(e!==`npm`&&e!==`bun`)return;let r=l(t,`package.json`);if(!i(r))return;let s=JSON.parse(a(r,`utf-8`)),c=!1;if(e===`npm`){let e=s.allowScripts??{};for(let[t,r]of Object.entries(n))Object.keys(e).some(e=>e===t||e.startsWith(`${t}@`))||(e[t]=r,c=!0);s.allowScripts=e}else{let e=s.trustedDependencies??[];for(let[t,r]of Object.entries(n))r&&!e.includes(t)&&(e.push(t),c=!0);s.trustedDependencies=e}if(c)return o(r,`${JSON.stringify(s,null,2)}\n`),r}function _e(e){if(e===`pnpm`)return U(`pnpm-workspace.yaml`)??process.cwd();for(let e=process.cwd();;e=s(e)){try{if(JSON.parse(a(l(e,`package.json`),`utf-8`)).workspaces)return e}catch{}if(s(e)===e)return process.cwd()}}function J(e){return Object.assign({},...e.map(e=>F[e]?.builds??{}))}function ve(e,t,n=`express`){let r=new Set,i=new Set,a=[],o=[],s=[];for(let c of e){if(c===`upload`){let e=R[n];s.push(`upload (${n}): ${e.note}`),e.prod&&(t?i:r).add(e.prod),e.dev&&i.add(e.dev);continue}let e=F[c];if(!e){a.push(c);continue}e.deprecated&&o.push(`'${c}' (${e.pkg}) is deprecated — ${e.deprecated}`);let l=t||e.dev?i:r;l.add(e.pkg);for(let t of e.peers)l.add(t);if(e.enginePeers){let e=L[n];for(let t of e)l.add(t);s.push(`${c} (${n}): engine peers ${e.join(`, `)}`)}}return{prodDeps:[...r],devDeps:[...i],unknown:a,warnings:o,notices:s}}function ye(e){e.command(`list`).alias(`ls`).description(`List KickJS packages (core only; pair with --all for the full catalog)`).option(`--all`,`Include the full optional catalog`).option(`--runtime <engine>`,`HTTP engine to show peers for: express | fastify | h3`).action(async e=>{G(!!e.all,z(e.runtime)??await B())})}function Y(e){e.command(`add [packages...]`).description(`Add KickJS packages with their required dependencies`).option(`--pm <manager>`,`Package manager override`).option(`-D, --dev`,`Install as dev dependency`).option(`--list`,`List packages (core only by default; pair with --all)`).option(`--runtime <engine>`,`HTTP engine for peer resolution: express | fastify | h3 (overrides kick.config.ts)`).option(`--all`,`When listing, include the full optional catalog`).action(async(e,t)=>{if(t.list||e.length===0){G(!!t.all,z(t.runtime)??await B());return}let{pm:n,source:r}=await W(t.pm);console.log(`\n Using ${n} (resolved from ${r})`);let i=z(t.runtime),a=await V(process.cwd()),o=i??a.runtime;if(!i&&a.ambiguous){console.error(`\n Cannot tell which HTTP engine this app boots on: found ${a.candidates.join(`, `)} in package.json.\n\n Installing engine peers for the wrong one is worse than not installing them, so:\n • set \`runtime: '<engine>'\` in kick.config.ts (permanent, also fixes kick doctor), or\n • pass --runtime <${a.candidates.join(`|`)}> for this command\n`),process.exitCode=1;return}let{prodDeps:s,devDeps:c,unknown:l,warnings:u,notices:d}=ve(e,!!t.dev,o);for(let e of u)console.warn(`\n WARNING: ${e}`);for(let e of d)console.log(`\n ${e}`);if(l.length>0&&(console.log(`\n Unknown packages: ${l.join(`, `)}`),console.log(` Run "kick add --list" to see available packages.
431
+ `),s.length===0&&c.length===0))return;let f=J(e);if(Object.keys(f).length>0){let e=q(n,_e(n),f);e&&console.log(`\n Approved install scripts in ${e}`)}if(s.length>0){let e=s,t=`${n} add ${e.join(` `)}`;console.log(`\n Installing ${e.length} dependency(ies):`);for(let t of e)console.log(` + ${t}`);console.log();try{p(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}if(c.length>0){let e=c,t=`${n} add -D ${e.join(` `)}`;console.log(`\n Installing ${e.length} dev dependency(ies):`);for(let t of e)console.log(` + ${t} (dev)`);console.log();try{p(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}console.log(` Done!
432
+ `)})}const X=s(u(import.meta.url)),Z=JSON.parse(a([c(X,`..`,`package.json`),c(X,`..`,`..`,`package.json`)].find(i),`utf-8`)),be=[`@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`];function xe(e){return e===`@forinda/kickjs-cli`?`^${Z.version}`:`latest`}async function Q(){let e=await Promise.all(be.map(async e=>{let t=await S(`npm`,[`view`,e,`version`],{timeout:2e4});return t&&/^\d+\.\d+\.\d+/.test(t)?[e,`^${t}`]:[e,xe(e)]}));return Object.fromEntries(e)}function Se(e,t){let n=y(`npm`,[`view`,`${e}@${t}`,`version`],{timeout:2e4});return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function Ce(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 we(e,t,n){let r=y(`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 Te(e){let{name:t,directory:i,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:s=`inmemory`,packages:l=[],schemaLib:u=`zod`,runtime:d=`express`}=e,f=i,m=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${t}\n`),m(`Resolving package versions...`);let h=await Q(),g=Object.keys(h).filter(e=>h[e]===`latest`);if(g.length>0&&m(`WARNING: could not reach npm for ${g.join(`, `)} — pinned to 'latest'`),d!==`express`){if(we(`@forinda/kickjs`,`latest`,`./${d}`))m(`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=Se(r,`alpha`);e&&Ce(e,$(h[r]))&&(h[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}m(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`)}}await n(c(f,`package.json`),re(t,o,h,l,u,d,e.withClientMap)),await n(c(f,`vite.config.ts`),ie({strictPort:e.strictPort})),await n(c(f,`tsconfig.json`),w()),await n(c(f,`.oxfmtrc.json`),T()),await n(c(f,`.editorconfig`),E()),await n(c(f,`.gitignore`),oe()),await n(c(f,`.gitattributes`),se()),await n(c(f,`.env`),ce()),await n(c(f,`.env.example`),le()),await n(c(f,`.env.test`),D()),await n(c(f,`.env.test.example`),ue()),await n(c(f,`src/config/index.ts`),A(u)),await n(c(f,`src/index.ts`),O(t,o,Z.version,l,d,e.spaClientDir)),await n(c(f,`src/modules/index.ts`),k()),await n(c(f,`src/modules/hello/hello.service.ts`),j()),await n(c(f,`src/modules/hello/hello.controller.ts`),M()),await n(c(f,`src/modules/hello/hello.module.ts`),N()),await n(c(f,`kick.config.ts`),P(o,s,a,d,e.withClientMap)),await n(c(f,`vitest.config.ts`),de()),await n(c(f,`README.md`),r(t,o,a));let{generateAgentDocs:_}=await import(`./agent-docs-GCMhcDHy.mjs`).then(e=>e.t);if(await _({outDir:f,name:t,pm:a,template:o,only:`all`,force:!0}),e.approveInstallScripts!==!1&&q(a,f,{...K,...J(l)}),e.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{p(`${a} install`,{cwd:f,stdio:`inherit`}),console.log(`
433
+ Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-ClJqftm9.mjs`).then(e=>e.n);await e({cwd:f,allowDuplicates:!0,silent:!0})}catch{}if(e.initGit)try{p(`git init`,{cwd:f,stdio:`pipe`}),p(`git branch -M main`,{cwd:f,stdio:`pipe`}),p(`git add -A`,{cwd:f,stdio:`pipe`}),p(`git commit -m "chore: initial commit from kick new"`,{cwd:f,stdio:`pipe`}),m(`Git repository initialized`)}catch{m(`Warning: git init failed (git may not be installed)`)}console.log(`
434
+ Project scaffolded successfully!`),console.log();let v=f!==process.cwd();m(`Next steps:`),v&&m(` cd ${t}`),e.installDeps||m(` ${a} install`);let y={rest:`kick g module user`,minimal:`# add your routes to src/index.ts`};m(` ${y[o]??y.rest}`),m(` kick dev`),m(``),m(`Commands:`),m(` kick dev Start dev server with Vite HMR`),m(` kick build Production build via Vite`),m(` kick start Run production build`),m(``),m(`Generators:`),m(` kick g module <name> REST module (controller, service, DTOs, repository)`),m(` kick g scaffold <n> <f..> CRUD module from field definitions`),m(` kick g controller <name> Standalone controller`),m(` kick g service <name> @Service() class`),m(` kick g middleware <name> Global connect-style middleware`),m(` kick g guard <name> Route guard (auth, roles, etc.)`),m(` kick g adapter <name> AppAdapter with lifecycle hooks`),m(` kick g dto <name> DTO schema (Zod / Valibot / Yup)`),m(` kick g config Generate kick.config.ts`),m(``),m(`Add packages:`),m(` kick add <pkg> Install a KickJS package + peers`),m(` kick add --list Show all available packages`),m(``),m(`Available: ${I}`),m(``)}export{R as a,ye as c,ee as d,x as f,K as i,B as l,Q as n,q as o,b as p,F as r,Y as s,Te as t,ge as u};