@forinda/kickjs-cli 5.8.0 → 5.8.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.
- package/README.md +1 -1
- package/dist/{builtins-CYSzLo7U.mjs → builtins-CF4q3JIg.mjs} +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/{config-ierHW69f.mjs → config-v6vsVMtc.mjs} +3 -3
- package/dist/{config-ierHW69f.mjs.map → config-v6vsVMtc.mjs.map} +1 -1
- package/dist/{generator-extension-BXLt3Tp_.mjs → generator-extension-ChoCJW23.mjs} +4 -4
- package/dist/{generator-extension-BXLt3Tp_.mjs.map → generator-extension-ChoCJW23.mjs.map} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{plugin-D_nBy6VP.mjs → plugin-1Oiz9_TD.mjs} +3 -3
- package/dist/{plugin-D_nBy6VP.mjs.map → plugin-1Oiz9_TD.mjs.map} +1 -1
- package/dist/{project-root-CqGZOrRR.mjs → project-root-BaUzB3D7.mjs} +3 -3
- package/dist/{project-root-CqGZOrRR.mjs.map → project-root-BaUzB3D7.mjs.map} +1 -1
- package/dist/{rolldown-runtime-B8-Ifyj3.mjs → rolldown-runtime-vNCSDkuE.mjs} +1 -1
- package/dist/{run-plugins-Cvgyo_th.mjs → run-plugins-Bg8kTYfa.mjs} +4 -4
- package/dist/run-plugins-Bg8kTYfa.mjs.map +1 -0
- package/dist/{typegen-C3G375CR.mjs → typegen-B8lAhWXz.mjs} +4 -4
- package/dist/{typegen-C3G375CR.mjs.map → typegen-B8lAhWXz.mjs.map} +1 -1
- package/dist/{types-Kj2ldTnQ.mjs → types-BG2NeDgK.mjs} +2 -2
- package/dist/{types-Kj2ldTnQ.mjs.map → types-BG2NeDgK.mjs.map} +1 -1
- package/package.json +2 -2
- package/dist/run-plugins-Cvgyo_th.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v5.8.
|
|
2
|
+
* @forinda/kickjs-cli v5.8.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{E as e,S as t,T as n,a as r,d as i,f as a,g as o,h as s,i as c,m as l,p as u,r as d,w as f,y as p}from"./generator-extension-
|
|
11
|
+
import{E as e,S as t,T as n,a as r,d as i,f as a,g as o,h as s,i as c,m as l,p as u,r as d,w as f,y as p}from"./generator-extension-ChoCJW23.mjs";import{i as m,r as h}from"./config-v6vsVMtc.mjs";import{t as g}from"./project-root-BaUzB3D7.mjs";import{n as _,t as v}from"./types-BG2NeDgK.mjs";function y(e){return e}export{v as KickPluginConflictError,d as buildGeneratorContext,_ as defineCliPlugin,h as defineConfig,c as defineGenerator,y as defineTypegen,g as findProjectRoot,o as generateAdapter,a as generateController,i as generateDto,l as generateGuard,s as generateMiddleware,p as generateModule,u as generateService,r as initProject,m as loadKickConfig,t as pluralize,f as toCamelCase,n as toKebabCase,e as toPascalCase};
|
|
12
12
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v5.8.
|
|
2
|
+
* @forinda/kickjs-cli v5.8.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-
|
|
12
|
-
//# sourceMappingURL=plugin-
|
|
11
|
+
import{t as e}from"./rolldown-runtime-vNCSDkuE.mjs";import{t}from"./types-BG2NeDgK.mjs";function n(e,n=[]){let r=new Map;for(let n of e){let e=(r.get(n.name)??0)+1;if(r.set(n.name,e),e===2)throw new t(`plugin`,n.name,[n.name,n.name])}let i=new Map,a=[];for(let n of e)for(let e of n.commands??[]){let r=i.get(e.name);if(r)throw new t(`command`,e.name,[r,n.name]);i.set(e.name,n.name),a.push(e)}let o=new Set(n.map(e=>e.name)),s=[...a.filter(e=>!o.has(e.name)),...n],c=new Map,l=[];for(let n of e)for(let e of n.typegens??[]){let r=c.get(e.id);if(r)throw new t(`typegen`,e.id,[r,n.name]);c.set(e.id,n.name),l.push(e)}let u=new Map,d=[];for(let n of e)for(let e of n.generators??[]){let r=u.get(e.name);if(r)throw new t(`generator`,e.name,[r,n.name]);u.set(e.name,n.name),d.push({source:n.name,spec:e})}return{commands:s,typegens:l,generators:d,register:async(t,n)=>{let r;if(n)r={generators:d,...n};else{let{findProjectRoot:e}=await import(`./project-root-BaUzB3D7.mjs`).then(e=>e.n),t=process.cwd();r={cwd:t,projectRoot:e(t),config:null,log:()=>{},generators:d}}for(let n of e)n.register&&await n.register(t,r)}}}var r=e({mergeCliPlugins:()=>n});export{n,r as t};
|
|
12
|
+
//# sourceMappingURL=plugin-1Oiz9_TD.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-1Oiz9_TD.mjs","names":[],"sources":["../src/plugin/merge.ts","../src/plugin/index.ts"],"sourcesContent":["// Plugin → unified registry merge.\n//\n// Resolution rules (per the v1 spec + dogfood pivot):\n// - duplicate plugin `name` across the input array → conflict error.\n// Catches the double-install case (built-in shipped twice, or\n// adopter requiring the same plugin twice).\n// - plugin commands appear first in the merged list, then adopter\n// commands; adopter `commands` of the same name override the\n// plugin entry (filter pass).\n// - duplicate command name across two plugins → conflict error\n// listing both plugin names. Adopter overriding a plugin is\n// allowed and not an error.\n// - duplicate typegen id across two plugins → same error. Typegens\n// have no adopter override path; only plugins contribute them.\n// - register() functions are collected in input order; the caller\n// invokes each one against the same Command program. They have no\n// id-level conflict surface — owners are responsible for picking\n// non-colliding command names inside their own register().\n// - plugin order = array order. No implicit precedence rules.\n\nimport type { Command } from 'commander'\n\nimport type { KickCommandDefinition } from '../config'\nimport type { TypegenPlugin } from '../typegen/plugin'\nimport type { GeneratorSpec } from '../generator-extension/define'\nimport type { DiscoveredGenerator } from '../generator-extension/discover'\nimport { KickPluginConflictError, type KickCliPlugin, type KickCliPluginContext } from './types'\n\nexport interface MergedPlugins {\n commands: KickCommandDefinition[]\n typegens: TypegenPlugin[]\n /** DiscoveredGenerator shape so this list slots into the existing\n * dispatch path next to package.json-discovered entries. `source`\n * carries the plugin name for error attribution. */\n generators: DiscoveredGenerator[]\n /**\n * Apply every plugin's register() in input order. ctx is optional so\n * tests + lightweight callers can invoke `register(program)` without\n * constructing a full context; it falls back to cwd=process.cwd(),\n * config=null, log=no-op.\n */\n register: (program: Command, ctx?: KickCliPluginContext) => Promise<void>\n}\n\nexport function mergeCliPlugins(\n plugins: readonly KickCliPlugin[],\n adopterCommands: readonly KickCommandDefinition[] = [],\n): MergedPlugins {\n // Plugin-name dedup — catches double-install.\n const seenPluginNames = new Map<string, number>()\n for (const p of plugins) {\n const count = (seenPluginNames.get(p.name) ?? 0) + 1\n seenPluginNames.set(p.name, count)\n if (count === 2) {\n throw new KickPluginConflictError('plugin', p.name, [p.name, p.name])\n }\n }\n\n const commandOwners = new Map<string, string>()\n const pluginCommands: KickCommandDefinition[] = []\n for (const p of plugins) {\n for (const cmd of p.commands ?? []) {\n const prior = commandOwners.get(cmd.name)\n if (prior) {\n throw new KickPluginConflictError('command', cmd.name, [prior, p.name])\n }\n commandOwners.set(cmd.name, p.name)\n pluginCommands.push(cmd)\n }\n }\n\n const adopterNames = new Set(adopterCommands.map((c) => c.name))\n const filteredPlugin = pluginCommands.filter((c) => !adopterNames.has(c.name))\n const commands = [...filteredPlugin, ...adopterCommands]\n\n const typegenOwners = new Map<string, string>()\n const typegens: TypegenPlugin[] = []\n for (const p of plugins) {\n for (const tg of p.typegens ?? []) {\n const prior = typegenOwners.get(tg.id)\n if (prior) {\n throw new KickPluginConflictError('typegen', tg.id, [prior, p.name])\n }\n typegenOwners.set(tg.id, p.name)\n typegens.push(tg)\n }\n }\n\n const generatorOwners = new Map<string, string>()\n const generators: DiscoveredGenerator[] = []\n for (const p of plugins) {\n for (const spec of p.generators ?? []) {\n const prior = generatorOwners.get(spec.name)\n if (prior) {\n throw new KickPluginConflictError('generator', spec.name, [prior, p.name])\n }\n generatorOwners.set(spec.name, p.name)\n generators.push({ source: p.name, spec: spec satisfies GeneratorSpec })\n }\n }\n\n /**\n * Apply every plugin's `register()` callback in input order against the\n * given Commander program. Each callback receives a {@link KickCliPluginContext}:\n * caller-supplied ctx wins (test fixtures can inject a different\n * workspace boundary); otherwise a default ctx is built with\n * `findProjectRoot(process.cwd())` as the project root, `cwd` matching\n * `process.cwd()`, null config, no-op log, and the merged generator set\n * threaded through so the `kick/generate` built-in can surface each as\n * a Commander subcommand. The dynamic import of `findProjectRoot` keeps\n * the caller-supplied fast path zero-cost.\n */\n const register = async (program: Command, ctx?: KickCliPluginContext): Promise<void> => {\n let resolved: KickCliPluginContext\n if (ctx) {\n resolved = { generators, ...ctx }\n } else {\n const { findProjectRoot } = await import('../utils/project-root')\n const cwd = process.cwd()\n resolved = {\n cwd,\n projectRoot: findProjectRoot(cwd),\n config: null,\n log: () => {},\n generators,\n }\n }\n for (const p of plugins) {\n if (p.register) await p.register(program, resolved)\n }\n }\n\n return { commands, typegens, generators, register }\n}\n","// Barrel intentionally omits `./builtins` — that module top-level-imports\n// every register*Command, which pulls heavy modules (project scaffolders,\n// fs reads at import time) into the graph. Importers that need the\n// builtin list go through `./plugin/builtins` directly; tests + adopter\n// plugins consuming only the contract types import from here.\n\nexport type { KickCliPlugin } from './types'\nexport { defineCliPlugin, KickPluginConflictError } from './types'\nexport { mergeCliPlugins, type MergedPlugins } from './merge'\n"],"mappings":";;;;;;;;;;wFA4CA,SAAgB,EACd,EACA,EAAoD,CAAC,EACtC,CAEf,IAAM,EAAkB,IAAI,IAC5B,IAAK,IAAM,KAAK,EAAS,CACvB,IAAM,GAAS,EAAgB,IAAI,EAAE,IAAI,GAAK,GAAK,EAEnD,GADA,EAAgB,IAAI,EAAE,KAAM,CAAK,EAC7B,IAAU,EACZ,MAAM,IAAI,EAAwB,SAAU,EAAE,KAAM,CAAC,EAAE,KAAM,EAAE,IAAI,CAAC,CAExE,CAEA,IAAM,EAAgB,IAAI,IACpB,EAA0C,CAAC,EACjD,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAO,EAAE,UAAY,CAAC,EAAG,CAClC,IAAM,EAAQ,EAAc,IAAI,EAAI,IAAI,EACxC,GAAI,EACF,MAAM,IAAI,EAAwB,UAAW,EAAI,KAAM,CAAC,EAAO,EAAE,IAAI,CAAC,EAExE,EAAc,IAAI,EAAI,KAAM,EAAE,IAAI,EAClC,EAAe,KAAK,CAAG,CACzB,CAGF,IAAM,EAAe,IAAI,IAAI,EAAgB,IAAK,GAAM,EAAE,IAAI,CAAC,EAEzD,EAAW,CAAC,GADK,EAAe,OAAQ,GAAM,CAAC,EAAa,IAAI,EAAE,IAAI,CAC1C,EAAG,GAAG,CAAe,EAEjD,EAAgB,IAAI,IACpB,EAA4B,CAAC,EACnC,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAM,EAAE,UAAY,CAAC,EAAG,CACjC,IAAM,EAAQ,EAAc,IAAI,EAAG,EAAE,EACrC,GAAI,EACF,MAAM,IAAI,EAAwB,UAAW,EAAG,GAAI,CAAC,EAAO,EAAE,IAAI,CAAC,EAErE,EAAc,IAAI,EAAG,GAAI,EAAE,IAAI,EAC/B,EAAS,KAAK,CAAE,CAClB,CAGF,IAAM,EAAkB,IAAI,IACtB,EAAoC,CAAC,EAC3C,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAQ,EAAE,YAAc,CAAC,EAAG,CACrC,IAAM,EAAQ,EAAgB,IAAI,EAAK,IAAI,EAC3C,GAAI,EACF,MAAM,IAAI,EAAwB,YAAa,EAAK,KAAM,CAAC,EAAO,EAAE,IAAI,CAAC,EAE3E,EAAgB,IAAI,EAAK,KAAM,EAAE,IAAI,EACrC,EAAW,KAAK,CAAE,OAAQ,EAAE,KAAY,MAA6B,CAAC,CACxE,CAkCF,MAAO,CAAE,WAAU,WAAU,aAAY,eApBjB,EAAkB,IAA8C,CACtF,IAAI,EACJ,GAAI,EACF,EAAW,CAAE,aAAY,GAAG,CAAI,MAC3B,CACL,GAAM,CAAE,mBAAoB,MAAM,OAAO,+BAAA,KAAA,GAAA,EAAA,CAAA,EACnC,EAAM,QAAQ,IAAI,EACxB,EAAW,CACT,MACA,YAAa,EAAgB,CAAG,EAChC,OAAQ,KACR,QAAW,CAAC,EACZ,YACF,CACF,CACA,IAAK,IAAM,KAAK,EACV,EAAE,UAAU,MAAM,EAAE,SAAS,EAAS,CAAQ,CAEtD,CAEkD,CACpD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v5.8.
|
|
2
|
+
* @forinda/kickjs-cli v5.8.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-
|
|
12
|
-
//# sourceMappingURL=project-root-
|
|
11
|
+
import{t as e}from"./rolldown-runtime-vNCSDkuE.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-BaUzB3D7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root-
|
|
1
|
+
{"version":3,"file":"project-root-BaUzB3D7.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.8.
|
|
2
|
+
* @forinda/kickjs-cli v5.8.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{A as e,B as t,C as n,D as r,E as i,F as a,I as o,L as s,M as c,N as l,O as u,P as d,R as f,S as p,T as m,_ as h,a as g,b as _,c as v,d as y,f as ee,g as te,h as b,j as x,k as S,l as ne,m as re,n as ie,o as ae,p as oe,s as se,t as ce,u as le,v as ue,w as de,x as C,y as fe,z as w}from"./generator-extension-
|
|
11
|
+
import{A as e,B as t,C as n,D as r,E as i,F as a,I as o,L as s,M as c,N as l,O as u,P as d,R as f,S as p,T as m,_ as h,a as g,b as _,c as v,d as y,f as ee,g as te,h as b,j as x,k as S,l as ne,m as re,n as ie,o as ae,p as oe,s as se,t as ce,u as le,v as ue,w as de,x as C,y as fe,z as w}from"./generator-extension-ChoCJW23.mjs";import{a as T,i as E,o as pe,t as me}from"./config-v6vsVMtc.mjs";import{t as he}from"./project-root-BaUzB3D7.mjs";import{n as D}from"./types-BG2NeDgK.mjs";import{n as ge}from"./plugin-1Oiz9_TD.mjs";import{a as _e,c as ve,i as ye,n as be,o as xe,s as Se,t as O}from"./typegen-B8lAhWXz.mjs";import k,{basename as Ce,dirname as A,isAbsolute as we,join as j,relative as M,resolve as N,sep as Te}from"node:path";import{cpSync as Ee,existsSync as P,mkdirSync as De,readFileSync as F,readdirSync as Oe,rmSync as ke,statSync as Ae,writeFileSync as je}from"node:fs";import{copyFile as Me,mkdir as Ne,readFile as I,readdir as Pe,rm as Fe,stat as Ie,writeFile as L}from"node:fs/promises";import{execSync as Le,fork as Re,spawn as ze,spawnSync as Be}from"node:child_process";import{pathToFileURL as R}from"node:url";import{glob as Ve}from"glob";import{groupAssetKeys as He}from"@forinda/kickjs";import{arch as Ue,platform as We,release as Ge}from"node:os";import{detectCompositeReferences as Ke,generate as qe,migrateDown as Je,migrateLatest as Ye,migrateRollback as Xe,migrateStatus as Ze,migrateUp as Qe,renderSchemaSource as $e,resolveDbConfig as et}from"@forinda/kickjs-db";const tt={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 z(e,t=process.cwd()){let n=t;for(;;){if(P(N(n,e)))return n;let t=A(n);if(t===n)return null;n=t}}function nt(){return z(`pnpm-lock.yaml`)?`pnpm`:z(`yarn.lock`)?`yarn`:z(`bun.lockb`)||z(`bun.lock`)?`bun`:z(`package-lock.json`)?`npm`:null}function rt(){let e=process.cwd();for(;e;){let t=N(e,`package.json`);if(P(t))try{let e=JSON.parse(F(t,`utf-8`)).packageManager;if(typeof e==`string`){let t=e.split(`@`)[0];if(me.includes(t))return t}}catch{}let n=A(e);if(n===e)return null;e=n}return null}async function it(e){if(e&&me.includes(e))return{pm:e,source:`flag`};let t=await E(process.cwd());if(t?.packageManager&&me.includes(t.packageManager))return{pm:t.packageManager,source:`config`};let n=rt();if(n)return{pm:n,source:`package.json`};let r=nt();return r?{pm:r,source:`lockfile`}:{pm:`npm`,source:`default`}}async function at(e){let{pm:t}=await it(e);return t}function ot(e=!1){let t=Object.entries(tt),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 Fe(d,{recursive:!0,force:!0}),console.log(` Deleted: ${d}`);let h=j(n,`index.ts`);if(await f(h)){let e=await I(h,`utf-8`),t=e,n=RegExp(`^import\\s*\\{\\s*${C(l)}Module\\s*\\}\\s*from\\s*['"][^'"]*${C(u)}(?:/[^'"]*)?['"].*\\n?`,`gm`);e=e.replace(n,``),e=Yn(e,l),e=e.replace(/\n{3,}/g,`
|
|
852
852
|
|
|
853
|
-
`),e!==t&&(await L(h,e,`utf-8`),console.log(` Unregistered: ${l}Module from ${h}`))}console.log(`\n Module '${u}' removed.\n`)}function Zn(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=T(await E(process.cwd())),r=t.modulesDir??n.dir??`src/modules`,i=t.pluralize===!1?!1:n.pluralize??!0;for(let n of e)await Xn({name:n,modulesDir:N(r),force:t.force,pluralize:i})})}function Qn(e){if(e!==void 0){if(e===`false`||e===`off`||e===`none`)return!1;if(e===`zod`)return`zod`;console.warn(` kick typegen: unknown --schema-validator '${e}' (only 'zod' and 'false' are supported). Falling back to project config.`)}}function $n(e){if(e!==void 0)return e===`false`||e===`off`||e===`none`?!1:e}function er(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=he(process.cwd()),n=await E(t);if(e.list){let{mergeCliPlugins:e}=await import(`./plugin-
|
|
853
|
+
`),e!==t&&(await L(h,e,`utf-8`),console.log(` Unregistered: ${l}Module from ${h}`))}console.log(`\n Module '${u}' removed.\n`)}function Zn(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=T(await E(process.cwd())),r=t.modulesDir??n.dir??`src/modules`,i=t.pluralize===!1?!1:n.pluralize??!0;for(let n of e)await Xn({name:n,modulesDir:N(r),force:t.force,pluralize:i})})}function Qn(e){if(e!==void 0){if(e===`false`||e===`off`||e===`none`)return!1;if(e===`zod`)return`zod`;console.warn(` kick typegen: unknown --schema-validator '${e}' (only 'zod' and 'false' are supported). Falling back to project config.`)}}function $n(e){if(e!==void 0)return e===`false`||e===`off`||e===`none`?!1:e}function er(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=he(process.cwd()),n=await E(t);if(e.list){let{mergeCliPlugins:e}=await import(`./plugin-1Oiz9_TD.mjs`).then(e=>e.t),{builtinCliPlugins:t}=await import(`./builtins-CF4q3JIg.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=Qn(e.schemaValidator)??n?.typegen?.schemaValidator??`zod`,i=$n(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 ye(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 O(a),i=await rn({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 be(N(t,e.out??n?.typegen?.outDir??`.kickjs/types`),r.written,i,e.silent??!1)}}catch(e){e instanceof Se?console.error(`
|
|
856
856
|
`+e.message+`
|
|
@@ -928,4 +928,4 @@ declare global {
|
|
|
928
928
|
|
|
929
929
|
export {}
|
|
930
930
|
`}const Pr=()=>({id:`kick/env`,outExtension:`.ts`,inputs:[`src/env.ts`,`src/**/env.ts`,`src/**/*.env.ts`],async generate(e){let t=Ir(e);if(t===!1)return null;let n=await e.getScanResult({root:Fr(e),cwd:e.cwd,envFile:t});if(!n.env)return null;let r=k.resolve(e.cwd,`.kickjs/types/kick__env.ts`);return Nr(n.env,r)}});function Fr(e){return k.resolve(e.cwd,e.config?.typegen?.srcDir??`src`)}function Ir(e){return e.config?.typegen?.envFile}const Lr=[D({name:`kick/init`,register:ut}),D({name:`kick/generate`,register:Zt}),D({name:`kick/run`,register:fn}),D({name:`kick/info`,register:pn}),D({name:`kick/inspect`,register:Sn}),D({name:`kick/add`,register:ct}),D({name:`kick/list`,register:st}),D({name:`kick/explain`,register:Mn}),D({name:`kick/mcp`,register:Vn}),D({name:`kick/tinker`,register:Gn}),D({name:`kick/remove`,register:Zn}),D({name:`kick/typegen`,register:er}),D({name:`kick/check`,register:fr}),D({name:`kick/db`,register:hr,typegens:[yr()]}),D({name:`kick/codemod`,register:_r}),D({name:`kick/assets`,typegens:[Sr()]}),D({name:`kick/routes`,typegens:[Ar()]}),D({name:`kick/env`,typegens:[Pr()]})];export{nn as applyDisableFilter,rn as runAllPluginTypegens,Lr as t};
|
|
931
|
-
//# sourceMappingURL=run-plugins-
|
|
931
|
+
//# sourceMappingURL=run-plugins-Bg8kTYfa.mjs.map
|