@forinda/kickjs-cli 5.8.4 → 5.8.6
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/dist/{agent-docs-htxaqEey.mjs → agent-docs-DSy9ZyMH.mjs} +3 -3
- package/dist/{agent-docs-htxaqEey.mjs.map → agent-docs-DSy9ZyMH.mjs.map} +1 -1
- package/dist/{builtins-CiSB4Faa.mjs → builtins-mydlG-i1.mjs} +2 -2
- package/dist/cli.mjs +2 -7
- package/dist/{config-C58Eekb2.mjs → config-0Kk83nQ_.mjs} +3 -3
- package/dist/{config-C58Eekb2.mjs.map → config-0Kk83nQ_.mjs.map} +1 -1
- package/dist/{generator-extension-VtAaa5qD.mjs → generator-extension-DO7Lmj9A.mjs} +6 -11
- package/dist/{generator-extension-VtAaa5qD.mjs.map → generator-extension-DO7Lmj9A.mjs.map} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{plugin-CA8HOAq3.mjs → plugin-DJJTM5xT.mjs} +3 -3
- package/dist/{plugin-CA8HOAq3.mjs.map → plugin-DJJTM5xT.mjs.map} +1 -1
- package/dist/{project-docs-DpdbqsFZ.mjs → project-docs-D-qp0Ey7.mjs} +2 -2
- package/dist/{project-docs-DpdbqsFZ.mjs.map → project-docs-D-qp0Ey7.mjs.map} +1 -1
- package/dist/{project-root-BCdEJUpI.mjs → project-root-BjMD0Jl4.mjs} +3 -3
- package/dist/{project-root-BCdEJUpI.mjs.map → project-root-BjMD0Jl4.mjs.map} +1 -1
- package/dist/{rolldown-runtime-cwPId8hl.mjs → rolldown-runtime-BnqYVYh7.mjs} +1 -1
- package/dist/{run-plugins-qeJ8k2Pi.mjs → run-plugins-D1yEXkCX.mjs} +4 -4
- package/dist/{run-plugins-qeJ8k2Pi.mjs.map → run-plugins-D1yEXkCX.mjs.map} +1 -1
- package/dist/{typegen-DZGjDSOf.mjs → typegen-BY8RdkXt.mjs} +4 -4
- package/dist/{typegen-DZGjDSOf.mjs.map → typegen-BY8RdkXt.mjs.map} +1 -1
- package/dist/{types-BOuvCopr.mjs → types-D3o8e8N0.mjs} +2 -2
- package/dist/{types-BOuvCopr.mjs.map → types-D3o8e8N0.mjs.map} +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v5.8.
|
|
2
|
+
* @forinda/kickjs-cli v5.8.6
|
|
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-BnqYVYh7.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-BjMD0Jl4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root-
|
|
1
|
+
{"version":3,"file":"project-root-BjMD0Jl4.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.6
|
|
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-
|
|
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-D-qp0Ey7.mjs";import{_ as m,a as h,b as g,c as _,d as v,f as y,g as b,h as ee,l as te,m as ne,n as re,o as ie,p as ae,s as oe,t as se,u as ce,v as le,x,y as ue}from"./generator-extension-DO7Lmj9A.mjs";import{a as S,i as C,o as de,t as fe}from"./config-0Kk83nQ_.mjs";import{t as pe}from"./project-root-BjMD0Jl4.mjs";import{n as w}from"./types-D3o8e8N0.mjs";import{n as me}from"./agent-docs-DSy9ZyMH.mjs";import{n as he}from"./plugin-DJJTM5xT.mjs";import{a as ge,c as _e,i as ve,n as ye,o as be,s as xe,t as T}from"./typegen-BY8RdkXt.mjs";import E,{basename as Se,dirname as D,isAbsolute as Ce,join as O,relative as k,resolve as A,sep as j}from"node:path";import{cpSync as we,existsSync as M,mkdirSync as N,readFileSync as P,readdirSync as Te,rmSync as Ee,statSync as De,writeFileSync as Oe}from"node:fs";import{copyFile as ke,mkdir as Ae,readFile as F,readdir as je,rm as Me,stat as Ne,writeFile as I}from"node:fs/promises";import{execSync as Pe,fork as Fe,spawn as Ie,spawnSync as Le}from"node:child_process";import{pathToFileURL as L}from"node:url";import{glob as Re}from"glob";import{groupAssetKeys as ze}from"@forinda/kickjs";import{arch as Be,platform as Ve,release as He}from"node:os";import{detectCompositeReferences as Ue,generate as We,migrateDown as Ge,migrateLatest as Ke,migrateRollback as qe,migrateStatus as Je,migrateUp as Ye,renderSchemaSource as Xe,resolveDbConfig as Ze}from"@forinda/kickjs-db";const Qe={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(A(n,e)))return n;let t=D(n);if(t===n)return null;n=t}}function $e(){return R(`pnpm-lock.yaml`)?`pnpm`:R(`yarn.lock`)?`yarn`:R(`bun.lockb`)||R(`bun.lock`)?`bun`:R(`package-lock.json`)?`npm`:null}function et(){let e=process.cwd();for(;e;){let t=A(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=D(e);if(n===e)return null;e=n}return null}async function tt(e){if(e&&fe.includes(e))return{pm:e,source:`flag`};let t=await C(process.cwd());if(t?.packageManager&&fe.includes(t.packageManager))return{pm:t.packageManager,source:`config`};let n=et();if(n)return{pm:n,source:`package.json`};let r=$e();return r?{pm:r,source:`lockfile`}:{pm:`npm`,source:`default`}}async function nt(e){let{pm:t}=await tt(e);return t}function rt(e=!1){let t=Object.entries(Qe),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 Me(l,{recursive:!0,force:!0}),console.log(` Deleted: ${l}`);let d=O(n,`index.ts`);if(await f(d)){let e=await F(d,`utf-8`),t=e,n=RegExp(`^import\\s*\\{\\s*${b(s)}Module\\s*\\}\\s*from\\s*['"][^'"]*${b(c)}(?:/[^'"]*)?['"].*\\n?`,`gm`);e=e.replace(n,``),e=zn(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 Vn(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=S(await C(process.cwd())),r=t.modulesDir??n.dir??`src/modules`,i=t.pluralize===!1?!1:n.pluralize??!0;for(let n of e)await Bn({name:n,modulesDir:A(r),force:t.force,pluralize:i})})}function Hn(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 Un(e){if(e!==void 0)return e===`false`||e===`off`||e===`none`?!1:e}function Wn(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 C(t);if(e.list){let{mergeCliPlugins:e}=await import(`./plugin-
|
|
853
|
+
`),e!==t&&(await I(d,e,`utf-8`),console.log(` Unregistered: ${s}Module from ${d}`))}console.log(`\n Module '${c}' removed.\n`)}function Vn(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=S(await C(process.cwd())),r=t.modulesDir??n.dir??`src/modules`,i=t.pluralize===!1?!1:n.pluralize??!0;for(let n of e)await Bn({name:n,modulesDir:A(r),force:t.force,pluralize:i})})}function Hn(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 Un(e){if(e!==void 0)return e===`false`||e===`off`||e===`none`?!1:e}function Wn(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 C(t);if(e.list){let{mergeCliPlugins:e}=await import(`./plugin-DJJTM5xT.mjs`).then(e=>e.t),{builtinCliPlugins:t}=await import(`./builtins-mydlG-i1.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=Hn(e.schemaValidator)??n?.typegen?.schemaValidator??`zod`,i=Un(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 T(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(A(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+`
|
|
@@ -928,4 +928,4 @@ declare global {
|
|
|
928
928
|
|
|
929
929
|
export {}
|
|
930
930
|
`}const wr=()=>({id:`kick/env`,outExtension:`.ts`,inputs:[`src/env.ts`,`src/**/env.ts`,`src/**/*.env.ts`],async generate(e){let t=Er(e);if(t===!1)return null;let n=await e.getScanResult({root:Tr(e),cwd:e.cwd,envFile:t});if(!n.env)return null;let r=E.resolve(e.cwd,`.kickjs/types/kick__env.ts`);return Cr(n.env,r)}});function Tr(e){return E.resolve(e.cwd,e.config?.typegen?.srcDir??`src`)}function Er(e){return e.config?.typegen?.envFile}const Dr=[w({name:`kick/init`,register:st}),w({name:`kick/generate`,register:Ut}),w({name:`kick/run`,register:nn}),w({name:`kick/info`,register:rn}),w({name:`kick/inspect`,register:fn}),w({name:`kick/add`,register:at}),w({name:`kick/list`,register:it}),w({name:`kick/explain`,register:Sn}),w({name:`kick/mcp`,register:jn}),w({name:`kick/tinker`,register:Fn}),w({name:`kick/remove`,register:Vn}),w({name:`kick/typegen`,register:Wn}),w({name:`kick/check`,register:nr}),w({name:`kick/db`,register:ar,typegens:[lr()]}),w({name:`kick/codemod`,register:sr}),w({name:`kick/assets`,typegens:[fr()]}),w({name:`kick/routes`,typegens:[br()]}),w({name:`kick/env`,typegens:[wr()]})];export{Jt as applyDisableFilter,W as runAllPluginTypegens,Dr as t};
|
|
931
|
-
//# sourceMappingURL=run-plugins-
|
|
931
|
+
//# sourceMappingURL=run-plugins-D1yEXkCX.mjs.map
|