@forinda/kickjs-cli 5.10.0-alpha.0 → 5.10.1

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 (23) hide show
  1. package/dist/{agent-docs-D28p084u.mjs → agent-docs-D1k73ywL.mjs} +3 -3
  2. package/dist/{agent-docs-D28p084u.mjs.map → agent-docs-D1k73ywL.mjs.map} +1 -1
  3. package/dist/{builtins-DQYGadNr.mjs → builtins-DsO7X7g9.mjs} +2 -2
  4. package/dist/cli.mjs +1 -1
  5. package/dist/{config-D88F6N-F.mjs → config-BnCPYsQu.mjs} +3 -3
  6. package/dist/{config-D88F6N-F.mjs.map → config-BnCPYsQu.mjs.map} +1 -1
  7. package/dist/{doctor-CrcAgy78.mjs → doctor-Brw2ruus.mjs} +5 -5
  8. package/dist/{doctor-CrcAgy78.mjs.map → doctor-Brw2ruus.mjs.map} +1 -1
  9. package/dist/index.mjs +2 -2
  10. package/dist/{plugin-CVLGiqTz.mjs → plugin-0_cDz8hu.mjs} +3 -3
  11. package/dist/{plugin-CVLGiqTz.mjs.map → plugin-0_cDz8hu.mjs.map} +1 -1
  12. package/dist/{project-docs-Crf8Isi0.mjs → project-docs-Bh20nvAP.mjs} +2 -2
  13. package/dist/{project-docs-Crf8Isi0.mjs.map → project-docs-Bh20nvAP.mjs.map} +1 -1
  14. package/dist/{project-root-CoRj39UG.mjs → project-root-B7_vpWeX.mjs} +3 -3
  15. package/dist/{project-root-CoRj39UG.mjs.map → project-root-B7_vpWeX.mjs.map} +1 -1
  16. package/dist/{rolldown-runtime-D75pbbHH.mjs → rolldown-runtime-C3T7GIRR.mjs} +1 -1
  17. package/dist/{run-plugins-gGJZ3-LN.mjs → run-plugins-w_kqfVLL.mjs} +4 -4
  18. package/dist/{run-plugins-gGJZ3-LN.mjs.map → run-plugins-w_kqfVLL.mjs.map} +1 -1
  19. package/dist/{typegen-CKkEXPeQ.mjs → typegen-CFtS0A1P.mjs} +4 -4
  20. package/dist/{typegen-CKkEXPeQ.mjs.map → typegen-CFtS0A1P.mjs.map} +1 -1
  21. package/dist/{types-vUgXYtWR.mjs → types-CkZ7XoFJ.mjs} +2 -2
  22. package/dist/{types-vUgXYtWR.mjs.map → types-CkZ7XoFJ.mjs.map} +1 -1
  23. package/package.json +5 -5
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v5.10.0-alpha.0
2
+ * @forinda/kickjs-cli v5.10.1
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-D75pbbHH.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-CoRj39UG.mjs.map
11
+ import{t as e}from"./rolldown-runtime-C3T7GIRR.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-B7_vpWeX.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-root-CoRj39UG.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-B7_vpWeX.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 v5.10.0-alpha.0
2
+ * @forinda/kickjs-cli v5.10.1
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @forinda/kickjs-cli v5.10.0-alpha.0
2
+ * @forinda/kickjs-cli v5.10.1
3
3
  *
4
4
  * Copyright (c) Felix Orinda
5
5
  *
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * @license MIT
10
10
  */
11
- import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,p as l,s as u,u as d,v as f,y as p}from"./project-docs-Crf8Isi0.mjs";import{C as m,S as h,_ as g,a as _,b as v,c as y,d as b,f as ee,g as te,h as ne,i as re,l as ie,m as ae,p as oe,r as se,u as ce,v as le,w as x,x as ue,y as S}from"./doctor-CrcAgy78.mjs";import{a as C,i as w,o as de,t as fe}from"./config-D88F6N-F.mjs";import{t as pe}from"./project-root-CoRj39UG.mjs";import{n as T}from"./types-vUgXYtWR.mjs";import{n as me}from"./agent-docs-D28p084u.mjs";import{n as he}from"./plugin-CVLGiqTz.mjs";import{a as ge,c as _e,i as ve,n as ye,o as be,s as xe,t as E}from"./typegen-CKkEXPeQ.mjs";import D,{basename as Se,dirname as O,isAbsolute as Ce,join as k,relative as A,resolve as j,sep as we}from"node:path";import{cpSync as Te,existsSync as M,mkdirSync as N,readFileSync as P,readdirSync as Ee,rmSync as De,statSync as Oe,writeFileSync as ke}from"node:fs";import{copyFile as Ae,mkdir as je,readFile as F,readdir as Me,rm as Ne,stat as Pe,writeFile as I}from"node:fs/promises";import{execSync as Fe,fork as Ie,spawn as Le,spawnSync as Re}from"node:child_process";import{pathToFileURL as L}from"node:url";import{glob as ze}from"glob";import{groupAssetKeys as Be}from"@forinda/kickjs";import{arch as Ve,platform as He,release as Ue}from"node:os";import{detectCompositeReferences as We,generate as Ge,migrateDown as Ke,migrateLatest as qe,migrateRollback as Je,migrateStatus as Ye,migrateUp as Xe,renderSchemaSource as Ze,resolveDbConfig as Qe}from"@forinda/kickjs-db";const $e={kickjs:{pkg:`@forinda/kickjs`,peers:[`express`],description:`Unified framework: DI, decorators, routing, middleware`,core:!0},vite:{pkg:`@forinda/kickjs-vite`,peers:[`vite`],description:`Vite plugin: dev server, HMR, module discovery`,dev:!0,core:!0},cli:{pkg:`@forinda/kickjs-cli`,peers:[],description:`CLI tool and code generators`,dev:!0,core:!0},swagger:{pkg:`@forinda/kickjs-swagger`,peers:[],description:`OpenAPI spec + Swagger UI + ReDoc`},db:{pkg:`@forinda/kickjs-db`,peers:[],description:`kick/db core — schema DSL, migrations, KickDbClient, customType`},"db-pg":{pkg:`@forinda/kickjs-db-pg`,peers:[`pg`],description:`kick/db PostgreSQL dialect + adapter (pgDialect, pgAdapter)`},drizzle:{pkg:`@forinda/kickjs-drizzle`,peers:[`drizzle-orm`],description:`Drizzle ORM adapter + query builder`},prisma:{pkg:`@forinda/kickjs-prisma`,peers:[`@prisma/client`],description:`Prisma adapter + query builder`},ws:{pkg:`@forinda/kickjs-ws`,peers:[`socket.io`],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}};function R(e,t=process.cwd()){let n=t;for(;;){if(M(j(n,e)))return n;let t=O(n);if(t===n)return null;n=t}}function et(){return R(`pnpm-lock.yaml`)?`pnpm`:R(`yarn.lock`)?`yarn`:R(`bun.lockb`)||R(`bun.lock`)?`bun`:R(`package-lock.json`)?`npm`:null}function tt(){let e=process.cwd();for(;e;){let t=j(e,`package.json`);if(M(t))try{let e=JSON.parse(P(t,`utf-8`)).packageManager;if(typeof e==`string`){let t=e.split(`@`)[0];if(fe.includes(t))return t}}catch{}let n=O(e);if(n===e)return null;e=n}return null}async function nt(e){if(e&&fe.includes(e))return{pm:e,source:`flag`};let t=await w(process.cwd());if(t?.packageManager&&fe.includes(t.packageManager))return{pm:t.packageManager,source:`config`};let n=tt();if(n)return{pm:n,source:`package.json`};let r=et();return r?{pm:r,source:`lockfile`}:{pm:`npm`,source:`default`}}async function rt(e){let{pm:t}=await nt(e);return t}function it(e=!1){let t=Object.entries($e),n=Math.max(...t.map(([e])=>e.length)),r=t.filter(([,e])=>e.core),i=t.filter(([,e])=>!e.core),a=([e,t])=>{let r=e.padEnd(n+2),i=t.peers.length?` (+ ${t.peers.join(`, `)})`:``;return` ${r} ${t.description}${i}`};console.log(`
11
+ import{_ as e,b as t,c as n,d as r,f as i,g as a,h as o,l as s,m as c,p as l,s as u,u as d,v as f,y as p}from"./project-docs-Bh20nvAP.mjs";import{C as m,S as h,_ as g,a as _,b as v,c as y,d as b,f as ee,g as te,h as ne,i as re,l as ie,m as ae,p as oe,r as se,u as ce,v as le,w as x,x as ue,y as S}from"./doctor-Brw2ruus.mjs";import{a as C,i as w,o as de,t as fe}from"./config-BnCPYsQu.mjs";import{t as pe}from"./project-root-B7_vpWeX.mjs";import{n as T}from"./types-CkZ7XoFJ.mjs";import{n as me}from"./agent-docs-D1k73ywL.mjs";import{n as he}from"./plugin-0_cDz8hu.mjs";import{a as ge,c as _e,i as ve,n as ye,o as be,s as xe,t as E}from"./typegen-CFtS0A1P.mjs";import D,{basename as Se,dirname as O,isAbsolute as Ce,join as k,relative as A,resolve as j,sep as we}from"node:path";import{cpSync as Te,existsSync as M,mkdirSync as N,readFileSync as P,readdirSync as Ee,rmSync as De,statSync as Oe,writeFileSync as ke}from"node:fs";import{copyFile as Ae,mkdir as je,readFile as F,readdir as Me,rm as Ne,stat as Pe,writeFile as I}from"node:fs/promises";import{execSync as Fe,fork as Ie,spawn as Le,spawnSync as Re}from"node:child_process";import{pathToFileURL as L}from"node:url";import{glob as ze}from"glob";import{groupAssetKeys as Be}from"@forinda/kickjs";import{arch as Ve,platform as He,release as Ue}from"node:os";import{detectCompositeReferences as We,generate as Ge,migrateDown as Ke,migrateLatest as qe,migrateRollback as Je,migrateStatus as Ye,migrateUp as Xe,renderSchemaSource as Ze,resolveDbConfig as Qe}from"@forinda/kickjs-db";const $e={kickjs:{pkg:`@forinda/kickjs`,peers:[`express`],description:`Unified framework: DI, decorators, routing, middleware`,core:!0},vite:{pkg:`@forinda/kickjs-vite`,peers:[`vite`],description:`Vite plugin: dev server, HMR, module discovery`,dev:!0,core:!0},cli:{pkg:`@forinda/kickjs-cli`,peers:[],description:`CLI tool and code generators`,dev:!0,core:!0},swagger:{pkg:`@forinda/kickjs-swagger`,peers:[],description:`OpenAPI spec + Swagger UI + ReDoc`},db:{pkg:`@forinda/kickjs-db`,peers:[],description:`kick/db core — schema DSL, migrations, KickDbClient, customType`},"db-pg":{pkg:`@forinda/kickjs-db-pg`,peers:[`pg`],description:`kick/db PostgreSQL dialect + adapter (pgDialect, pgAdapter)`},drizzle:{pkg:`@forinda/kickjs-drizzle`,peers:[`drizzle-orm`],description:`Drizzle ORM adapter + query builder`},prisma:{pkg:`@forinda/kickjs-prisma`,peers:[`@prisma/client`],description:`Prisma adapter + query builder`},ws:{pkg:`@forinda/kickjs-ws`,peers:[`socket.io`],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}};function R(e,t=process.cwd()){let n=t;for(;;){if(M(j(n,e)))return n;let t=O(n);if(t===n)return null;n=t}}function et(){return R(`pnpm-lock.yaml`)?`pnpm`:R(`yarn.lock`)?`yarn`:R(`bun.lockb`)||R(`bun.lock`)?`bun`:R(`package-lock.json`)?`npm`:null}function tt(){let e=process.cwd();for(;e;){let t=j(e,`package.json`);if(M(t))try{let e=JSON.parse(P(t,`utf-8`)).packageManager;if(typeof e==`string`){let t=e.split(`@`)[0];if(fe.includes(t))return t}}catch{}let n=O(e);if(n===e)return null;e=n}return null}async function nt(e){if(e&&fe.includes(e))return{pm:e,source:`flag`};let t=await w(process.cwd());if(t?.packageManager&&fe.includes(t.packageManager))return{pm:t.packageManager,source:`config`};let n=tt();if(n)return{pm:n,source:`package.json`};let r=et();return r?{pm:r,source:`lockfile`}:{pm:`npm`,source:`default`}}async function rt(e){let{pm:t}=await nt(e);return t}function it(e=!1){let t=Object.entries($e),n=Math.max(...t.map(([e])=>e.length)),r=t.filter(([,e])=>e.core),i=t.filter(([,e])=>!e.core),a=([e,t])=>{let r=e.padEnd(n+2),i=t.peers.length?` (+ ${t.peers.join(`, `)})`:``;return` ${r} ${t.description}${i}`};console.log(`
12
12
  Core packages (always installed by \`kick new\`):
13
13
  `);for(let e of r)console.log(a(e));if(e){console.log(`
14
14
  Optional packages (add as needed):
@@ -850,7 +850,7 @@ server.on('exit', () => {
850
850
  Cancelled.
851
851
  `);return}await Ne(l,{recursive:!0,force:!0}),console.log(` Deleted: ${l}`);let d=k(n,`index.ts`);if(await f(d)){let e=await F(d,`utf-8`),t=e,n=RegExp(`^import\\s*\\{\\s*${S(s)}Module\\s*\\}\\s*from\\s*['"][^'"]*${S(c)}(?:/[^'"]*)?['"].*\\n?`,`gm`);e=e.replace(n,``),e=Bn(e,s),e=e.replace(/\n{3,}/g,`
852
852
 
853
- `),e!==t&&(await I(d,e,`utf-8`),console.log(` Unregistered: ${s}Module from ${d}`))}console.log(`\n Module '${c}' removed.\n`)}function Hn(e){e.command(`remove`).alias(`rm`).description(`Remove generated code`).command(`module <names...>`).description(`Remove one or more modules (e.g. kick rm module user task)`).option(`--modules-dir <dir>`,`Modules directory`).option(`--no-pluralize`,`Use singular module name`).option(`-f, --force`,`Skip confirmation prompt`).action(async(e,t)=>{let n=C(await w(process.cwd())),r=t.modulesDir??n.dir??`src/modules`,i=t.pluralize===!1?!1:n.pluralize??!0;for(let n of e)await Vn({name:n,modulesDir:j(r),force:t.force,pluralize:i})})}function Un(e){if(e!==void 0){if(e===`false`||e===`off`||e===`none`)return!1;if(e===`zod`)return`zod`;if(e===`kickjs-schema`||e===`schema`)return`kickjs-schema`;console.warn(` kick typegen: unknown --schema-validator '${e}' (supported: 'zod', 'kickjs-schema', 'false'). Falling back to project config.`)}}function Wn(e){if(e!==void 0)return e===`false`||e===`off`||e===`none`?!1:e}function Gn(e){e.command(`typegen`).description(`Generate type-safe DI registry and module types into .kickjs/types/`).option(`-w, --watch`,`Watch source files and regenerate on change`).option(`-s, --src <dir>`,`Source directory to scan`,`src`).option(`-o, --out <dir>`,`Output directory`,`.kickjs/types`).option(`--silent`,`Suppress output`).option(`--allow-duplicates`,`Auto-namespace duplicate class names instead of failing (use with caution)`).option(`--schema-validator <name>`,`Schema validator for body/query/params typing (currently 'zod' or 'false')`).option(`--env-file <path>`,`Path to env schema file for KickEnv typing (default 'src/env.ts'; pass 'false' to disable)`).option(`--check`,`CI gate: fail on plugin-typegen drift instead of writing`).option(`--list`,"List every registered typegen plugin id (use to populate `typegen.disable`)").action(async e=>{let t=pe(process.cwd()),n=await w(t);if(e.list){let{mergeCliPlugins:e}=await import(`./plugin-CVLGiqTz.mjs`).then(e=>e.t),{builtinCliPlugins:t}=await import(`./builtins-DQYGadNr.mjs`),r=e([...t,...n?.plugins??[]],n?.commands??[]),i=new Set(n?.typegen?.disable??[]);if(r.typegens.length===0){console.log(` No typegen plugins registered.`);return}let a=Math.max(...r.typegens.map(e=>e.id.length));console.log(`
853
+ `),e!==t&&(await I(d,e,`utf-8`),console.log(` Unregistered: ${s}Module from ${d}`))}console.log(`\n Module '${c}' removed.\n`)}function Hn(e){e.command(`remove`).alias(`rm`).description(`Remove generated code`).command(`module <names...>`).description(`Remove one or more modules (e.g. kick rm module user task)`).option(`--modules-dir <dir>`,`Modules directory`).option(`--no-pluralize`,`Use singular module name`).option(`-f, --force`,`Skip confirmation prompt`).action(async(e,t)=>{let n=C(await w(process.cwd())),r=t.modulesDir??n.dir??`src/modules`,i=t.pluralize===!1?!1:n.pluralize??!0;for(let n of e)await Vn({name:n,modulesDir:j(r),force:t.force,pluralize:i})})}function Un(e){if(e!==void 0){if(e===`false`||e===`off`||e===`none`)return!1;if(e===`zod`)return`zod`;if(e===`kickjs-schema`||e===`schema`)return`kickjs-schema`;console.warn(` kick typegen: unknown --schema-validator '${e}' (supported: 'zod', 'kickjs-schema', 'false'). Falling back to project config.`)}}function Wn(e){if(e!==void 0)return e===`false`||e===`off`||e===`none`?!1:e}function Gn(e){e.command(`typegen`).description(`Generate type-safe DI registry and module types into .kickjs/types/`).option(`-w, --watch`,`Watch source files and regenerate on change`).option(`-s, --src <dir>`,`Source directory to scan`,`src`).option(`-o, --out <dir>`,`Output directory`,`.kickjs/types`).option(`--silent`,`Suppress output`).option(`--allow-duplicates`,`Auto-namespace duplicate class names instead of failing (use with caution)`).option(`--schema-validator <name>`,`Schema validator for body/query/params typing (currently 'zod' or 'false')`).option(`--env-file <path>`,`Path to env schema file for KickEnv typing (default 'src/env.ts'; pass 'false' to disable)`).option(`--check`,`CI gate: fail on plugin-typegen drift instead of writing`).option(`--list`,"List every registered typegen plugin id (use to populate `typegen.disable`)").action(async e=>{let t=pe(process.cwd()),n=await w(t);if(e.list){let{mergeCliPlugins:e}=await import(`./plugin-0_cDz8hu.mjs`).then(e=>e.t),{builtinCliPlugins:t}=await import(`./builtins-DsO7X7g9.mjs`),r=e([...t,...n?.plugins??[]],n?.commands??[]),i=new Set(n?.typegen?.disable??[]);if(r.typegens.length===0){console.log(` No typegen plugins registered.`);return}let a=Math.max(...r.typegens.map(e=>e.id.length));console.log(`
854
854
  Registered typegen plugins:
855
855
  `);for(let e of r.typegens){let t=i.has(e.id)?` (disabled)`:``;console.log(` ${e.id.padEnd(a+2)}inputs: ${e.inputs.join(`, `)||`(none)`}${t}`)}console.log();return}let r=Un(e.schemaValidator)??n?.typegen?.schemaValidator??`zod`,i=Wn(e.envFile)??n?.typegen?.envFile,a={cwd:t,srcDir:e.src??n?.typegen?.srcDir,outDir:e.out??n?.typegen?.outDir,silent:e.silent,allowDuplicates:e.allowDuplicates,schemaValidator:r,envFile:i,assetMap:n?.assetMap,runPlugins:!1};try{if(e.watch){let t=await ve(a);e.silent||console.log(` kick typegen: watching for changes (Ctrl-C to exit)`);let n=()=>{t(),process.exit(0)};process.on(`SIGINT`,n),process.on(`SIGTERM`,n),await new Promise(()=>{})}else{let{result:r}=await E(a),i=await W({cwd:t,config:n??null,silent:e.silent,check:e.check});e.check&&i.some(e=>e.status===`written`)&&process.exit(1),e.check||await ye(j(t,e.out??n?.typegen?.outDir??`.kickjs/types`),r.written,i,e.silent??!1)}}catch(e){e instanceof xe?console.error(`
856
856
  `+e.message+`
@@ -930,4 +930,4 @@ declare global {
930
930
 
931
931
  export {}
932
932
  `}const Tr=()=>({id:`kick/env`,outExtension:`.ts`,inputs:[`src/env.ts`,`src/**/env.ts`,`src/**/*.env.ts`],async generate(e){let t=Dr(e);if(t===!1)return null;let n=await e.getScanResult({root:Er(e),cwd:e.cwd,envFile:t});if(!n.env)return null;let r=e.config?.typegen?.schemaValidator??`zod`,i=D.resolve(e.cwd,`.kickjs/types/kick__env.ts`);return wr(n.env,i,r)}});function Er(e){return D.resolve(e.cwd,e.config?.typegen?.srcDir??`src`)}function Dr(e){return e.config?.typegen?.envFile}const Or=[T({name:`kick/init`,register:ct}),T({name:`kick/generate`,register:Wt}),T({name:`kick/run`,register:rn}),T({name:`kick/info`,register:an}),T({name:`kick/inspect`,register:pn}),T({name:`kick/add`,register:ot}),T({name:`kick/list`,register:at}),T({name:`kick/explain`,register:Cn}),T({name:`kick/mcp`,register:Mn}),T({name:`kick/tinker`,register:In}),T({name:`kick/remove`,register:Hn}),T({name:`kick/typegen`,register:Gn}),T({name:`kick/check`,register:rr}),T({name:`kick/doctor`,register:se}),T({name:`kick/db`,register:or,typegens:[ur()]}),T({name:`kick/codemod`,register:cr}),T({name:`kick/assets`,typegens:[pr()]}),T({name:`kick/routes`,typegens:[xr()]}),T({name:`kick/env`,typegens:[Tr()]})];export{Yt as applyDisableFilter,W as runAllPluginTypegens,Or as t};
933
- //# sourceMappingURL=run-plugins-gGJZ3-LN.mjs.map
933
+ //# sourceMappingURL=run-plugins-w_kqfVLL.mjs.map