@forinda/kickjs-cli 6.9.2 → 6.10.0
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-B249TRF6.mjs → agent-docs-BnGa_odb.mjs} +2 -2
- package/dist/{agent-docs-C5wwicRH.mjs → agent-docs-CLs1wTpl.mjs} +3 -3
- package/dist/{agent-docs-C5wwicRH.mjs.map → agent-docs-CLs1wTpl.mjs.map} +1 -1
- package/dist/{build-CWHh0hVP.mjs → build-BQUDhMVD.mjs} +3 -3
- package/dist/{build-CWHh0hVP.mjs.map → build-BQUDhMVD.mjs.map} +1 -1
- package/dist/{build-HlXY_TeD.mjs → build-BX7-8d5h.mjs} +2 -2
- package/dist/{builtins-DNYHt9aW.mjs → builtins-DWngUnQ8.mjs} +2 -2
- package/dist/{builtins-DCjV6a7i.mjs → builtins-DfzsCxQu.mjs} +89 -18
- package/dist/cli.mjs +2 -2
- package/dist/{config-mzx_v7G3.mjs → config-DHHqXYVF.mjs} +2 -2
- package/dist/{config-BkoZPh4q.mjs → config-DYS_-oZ_.mjs} +3 -3
- package/dist/{config-BkoZPh4q.mjs.map → config-DYS_-oZ_.mjs.map} +1 -1
- package/dist/{doctor-b7agdFBr.mjs → doctor-CC8eWifc.mjs} +88 -17
- package/dist/doctor-CC8eWifc.mjs.map +1 -0
- package/dist/{fullstack-BLUIrHET.mjs → fullstack-1y-ENahw.mjs} +3 -3
- package/dist/{fullstack-sXqerW2t.mjs → fullstack-BWopEQFU.mjs} +4 -4
- package/dist/{fullstack-sXqerW2t.mjs.map → fullstack-BWopEQFU.mjs.map} +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{plugin-CSpzl41q.mjs → plugin-CrbgblqR.mjs} +2 -2
- package/dist/{plugin-DKCkz86s.mjs → plugin-Dgdp1o7e.mjs} +3 -3
- package/dist/{plugin-DKCkz86s.mjs.map → plugin-Dgdp1o7e.mjs.map} +1 -1
- package/dist/{project-DDhIi-9v.mjs → project-BFhosVpo.mjs} +4 -4
- package/dist/{project-BN_7MhLe.mjs → project-DPQJNbUr.mjs} +5 -5
- package/dist/{project-BN_7MhLe.mjs.map → project-DPQJNbUr.mjs.map} +1 -1
- package/dist/{project-docs-nlJ0u0U1.mjs → project-docs-BEnHASsn.mjs} +3 -3
- package/dist/{project-docs-nlJ0u0U1.mjs.map → project-docs-BEnHASsn.mjs.map} +1 -1
- package/dist/{project-docs-B3pdPjqd.mjs → project-docs-BlYdtsfz.mjs} +2 -2
- package/dist/{project-root-DrwinO6A.mjs → project-root-74p4iEbS.mjs} +3 -3
- package/dist/{project-root-DrwinO6A.mjs.map → project-root-74p4iEbS.mjs.map} +1 -1
- package/dist/{project-root-DSNzsiYI.mjs → project-root-CSfkrbTB.mjs} +2 -2
- package/dist/{prompts-CmCfbzYN.mjs → prompts-kKPsD4J5.mjs} +2 -2
- package/dist/{prompts-CmCfbzYN.mjs.map → prompts-kKPsD4J5.mjs.map} +1 -1
- package/dist/{rolldown-runtime-DJeMLCTO.mjs → rolldown-runtime-Wu10E8Jp.mjs} +1 -1
- package/dist/{run-plugins-De8oWOq0.mjs → run-plugins-BPLz855M.mjs} +5 -5
- package/dist/run-plugins-BPLz855M.mjs.map +1 -0
- package/dist/{typegen-CbMLPc5z.mjs → typegen-ByZnBYdj.mjs} +4 -4
- package/dist/{typegen-DJlB47Fw.mjs → typegen-ngGYyfaY.mjs} +5 -5
- package/dist/{typegen-DJlB47Fw.mjs.map → typegen-ngGYyfaY.mjs.map} +1 -1
- package/dist/{types-BpdxjqT6.mjs → types-BYbOAJ_d.mjs} +1 -1
- package/package.json +2 -2
- package/dist/doctor-b7agdFBr.mjs.map +0 -1
- package/dist/run-plugins-De8oWOq0.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v6.
|
|
2
|
+
* @forinda/kickjs-cli v6.10.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{F as e,N as t,P as n,c as r,d as i,f as a,g as o,h as s,j as c,l,m as u,n as d,o as f,p,s as m,t as h,v as g,x as _}from"./doctor-
|
|
11
|
+
import{F as e,N as t,P as n,c as r,d as i,f as a,g as o,h as s,j as c,l,m as u,n as d,o as f,p,s as m,t as h,v as g,x as _}from"./doctor-CC8eWifc.mjs";import{t as v}from"./project-DPQJNbUr.mjs";import{i as y,r as b}from"./config-DYS_-oZ_.mjs";import{t as x}from"./project-root-74p4iEbS.mjs";import{n as S,t as C}from"./types-BYbOAJ_d.mjs";export{C as KickPluginConflictError,r as TYPEGEN_OWNER_KEY,f as buildGeneratorContext,l as createTypegenDevWatcher,S as defineCliPlugin,b as defineConfig,h as defineDoctorCheck,d as defineDoctorExtension,m as defineGenerator,i as defineTypegen,x as findProjectRoot,g as generateAdapter,p as generateController,a as generateDto,s as generateGuard,o as generateMiddleware,_ as generateModule,u as generateService,v as initProject,y as loadKickConfig,c as pluralize,t as toCamelCase,n as toKebabCase,e as toPascalCase};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v6.
|
|
2
|
+
* @forinda/kickjs-cli v6.10.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{t as e}from"./rolldown-runtime-
|
|
11
|
+
import{t as e}from"./rolldown-runtime-Wu10E8Jp.mjs";import{KickPluginConflictError as t,defineCliPlugin as n}from"@forinda/kickjs-cli-kit";function r(e,n=[]){let r=new Map;for(let n of e){let e=(r.get(n.name)??0)+1;if(r.set(n.name,e),e===2)throw new t(`plugin`,n.name,[n.name,n.name])}let i=new Map,a=[];for(let n of e)for(let e of n.commands??[]){let r=i.get(e.name);if(r)throw new t(`command`,e.name,[r,n.name]);i.set(e.name,n.name),a.push(e)}let o=new Set(n.map(e=>e.name)),s=[...a.filter(e=>!o.has(e.name)),...n],c=new Map,l=[];for(let n of e)for(let e of n.typegens??[]){let r=c.get(e.id);if(r)throw new t(`typegen`,e.id,[r,n.name]);c.set(e.id,n.name),l.push(e)}let u=new Map,d=[];for(let n of e)for(let e of n.generators??[]){let r=u.get(e.name);if(r)throw new t(`generator`,e.name,[r,n.name]);u.set(e.name,n.name),d.push({source:n.name,spec:e})}return{commands:s,typegens:l,generators:d,register:async(t,n)=>{let r;if(n)r={generators:d,...n};else{let{findProjectRoot:e}=await import(`./project-root-CSfkrbTB.mjs`).then(e=>e.n),t=process.cwd();r={cwd:t,projectRoot:e(t),config:null,log:()=>{},generators:d}}for(let n of e)n.register&&await n.register(t,r)}}}var i=e({mergeCliPlugins:()=>r});export{r as n,n as r,i as t};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v6.
|
|
2
|
+
* @forinda/kickjs-cli v6.10.0
|
|
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-Wu10E8Jp.mjs";import{t}from"./types-BYbOAJ_d.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-74p4iEbS.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-Dgdp1o7e.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-Dgdp1o7e.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,8BAAwB,CAAA,KAAA,GAAA,EAAA,CAAA,EAC3D,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 v6.
|
|
2
|
+
* @forinda/kickjs-cli v6.10.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{r as e,t}from"./config-
|
|
11
|
+
import{r as e,t}from"./config-DHHqXYVF.mjs";import{l as n,o as r}from"./project-docs-BlYdtsfz.mjs";import{existsSync as i,readFileSync as a}from"node:fs";import{dirname as o,join as s,resolve as c}from"node:path";import{fileURLToPath as l}from"node:url";import{execFileSync as u,execSync as d,spawnSync as f}from"node:child_process";const p=/[&|<>^"'`(){}[\];!%\r\n\\]/;function m(e,t,n=process.platform){if(n!==`win32`)return[e,t];if(p.test(e)||t.some(e=>p.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 h(e,t,n={}){let r=m(e,t);if(!r)return null;try{return u(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 g(e,t,n={}){let r=m(e,t);if(!r)throw Error(`Refusing to run '${e}': unsafe arguments`);u(r[0],r[1],{cwd:n.cwd,stdio:`inherit`,windowsHide:!0})}function _(e,t,n){d(e,{cwd:t,stdio:`inherit`,env:n?{...process.env,...n}:process.env})}function v(e,t,n){let r=f(process.execPath,[e],{cwd:n,stdio:`inherit`,env:{...process.env,...t}});r.status!==0&&process.exit(r.status??1)}const y={swagger:`@forinda/kickjs-swagger`,ws:`@forinda/kickjs-ws`,queue:`@forinda/kickjs-queue`,devtools:`@forinda/kickjs-devtools`},b={zod:{name:`zod`,range:`^4.3.6`},valibot:{name:`valibot`,range:`^1.4.1`},yup:{name:`yup`,range:`^1.7.1`}};function x(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 S(e,t,n,r=[],i=`zod`,a=`express`){let o=b[i],s={"@forinda/kickjs":x(n,`@forinda/kickjs`),"@forinda/kickjs-schema":x(n,`@forinda/kickjs-schema`),dotenv:`^17.3.1`,"reflect-metadata":`^0.2.2`,[o.name]:o.range};a===`express`?s.express=`^5.1.0`:a===`fastify`?(s.fastify=`^5.0.0`,s[`@fastify/middie`]=`^9.0.0`,s[`serve-static`]=`^2.2.0`):a===`h3`&&(s.h3=`^1.0.0`,s[`serve-static`]=`^2.2.0`);for(let e of r){let t=y[e];t&&!s[t]&&(s[t]=x(n,t))}return JSON.stringify({name:e,version:`0.0.0`,type:`module`,scripts:{dev:`kick dev`,"dev:debug":`kick dev:debug`,build:`kick build`,start:`kick start`,test:`vitest run`,"test:watch":`vitest`,typecheck:`tsc --noEmit`,typegen:`kick typegen`,lint:`eslint src/`,format:`prettier --write src/`},dependencies:s,devDependencies:{"@forinda/kickjs-cli":x(n,`@forinda/kickjs-cli`),"@forinda/kickjs-vite":x(n,`@forinda/kickjs-vite`),"@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`,vitest:`^4.1.2`,typescript:`^7.0.2`,prettier:`^3.8.1`}},null,2)}function C(){return`import { defineConfig } from 'vite'
|
|
12
12
|
import { resolve } from 'node:path'
|
|
13
13
|
import swc from 'unplugin-swc'
|
|
14
14
|
import { kickjsVitePlugin, envWatchPlugin } from '@forinda/kickjs-vite'
|
|
@@ -384,6 +384,6 @@ export default defineConfig({
|
|
|
384
384
|
`);for(let e of i)console.log(a(e))}else console.log(`\n Plus ${i.length} optional packages (auth, swagger, db, queue, …).`),console.log(" Run `kick add --list --all` for the full catalog.");console.log(`
|
|
385
385
|
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()}function K(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=I[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)}return{prodDeps:[...r],devDeps:[...i],unknown:a,warnings:o,notices:s}}function q(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`).action(e=>{G(!!e.all)})}function J(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(`--all`,`When listing, include the full optional catalog`).action(async(e,t)=>{if(t.list||e.length===0){G(!!t.all);return}let{pm:n,source:r}=await U(t.pm);console.log(`\n Using ${n} (resolved from ${r})`);let i=await z(process.cwd()),{prodDeps:a,devDeps:o,unknown:s,warnings:c,notices:l}=K(e,!!t.dev,i);for(let e of c)console.warn(`\n WARNING: ${e}`);for(let e of l)console.log(`\n ${e}`);if(!(s.length>0&&(console.log(`\n Unknown packages: ${s.join(`, `)}`),console.log(` Run "kick add --list" to see available packages.
|
|
386
386
|
`),a.length===0&&o.length===0))){if(a.length>0){let e=a,t=`${n} add ${e.join(` `)}`;console.log(`\n Installing ${e.length} dependency(ies):`);for(let t of e)console.log(` + ${t}`);console.log();try{d(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}if(o.length>0){let e=o,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{d(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}console.log(` Done!
|
|
387
|
-
`)}})}const Y=o(l(import.meta.url)),X=JSON.parse(a(s(Y,`..`,`package.json`),`utf-8`)),ae=`^${X.version}`,oe=[`@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`];async function Z(){let e=await Promise.all(oe.map(async e=>{let t=h(`npm`,[`view`,e,`version`]);return t&&/^\d+\.\d+\.\d+/.test(t)?[e,`^${t}`]:[e,ae]}));return Object.fromEntries(e)}function se(e,t){let n=h(`npm`,[`view`,`${e}@${t}`,`version`]);return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function Q(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function ce(e,t){let n=e=>Q(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 le(e,t,n){let r=h(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`]);if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function $(e){let{name:t,directory:i,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:u=`zod`,runtime:f=`express`}=e,p=i,m=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${t}\n`),m(`Resolving package versions...`);let h=await Z();if(f!==`express`)if(le(`@forinda/kickjs`,`latest`,`./${f}`))m(`Using @forinda/kickjs@latest (stable ships the ${f} 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,Q(h[r]))&&(h[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}m(n?`Using the alpha channel for the ${f} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${f} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}await n(s(p,`package.json`),S(t,o,h,l,u,f)),await n(s(p,`vite.config.ts`),C()),await n(s(p,`tsconfig.json`),w()),await n(s(p,`.prettierrc`),T()),await n(s(p,`.editorconfig`),ee()),await n(s(p,`.gitignore`),te()),await n(s(p,`.gitattributes`),ne()),await n(s(p,`.env`),re()),await n(s(p,`.env.example`),E()),await n(s(p,`src/config/index.ts`),j(u)),await n(s(p,`src/index.ts`),k(t,o,X.version,l,f)),await n(s(p,`src/modules/index.ts`),A()),await n(s(p,`src/modules/hello/hello.service.ts`),M()),await n(s(p,`src/modules/hello/hello.controller.ts`),N()),await n(s(p,`src/modules/hello/hello.module.ts`),P()),await n(s(p,`kick.config.ts`),F(o,c,a,f)),await n(s(p,`vitest.config.ts`),D()),await n(s(p,`README.md`),r(t,o,a));let{generateAgentDocs:g}=await import(`./agent-docs-
|
|
388
|
-
Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-
|
|
387
|
+
`)}})}const Y=o(l(import.meta.url)),X=JSON.parse(a(s(Y,`..`,`package.json`),`utf-8`)),ae=`^${X.version}`,oe=[`@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`];async function Z(){let e=await Promise.all(oe.map(async e=>{let t=h(`npm`,[`view`,e,`version`]);return t&&/^\d+\.\d+\.\d+/.test(t)?[e,`^${t}`]:[e,ae]}));return Object.fromEntries(e)}function se(e,t){let n=h(`npm`,[`view`,`${e}@${t}`,`version`]);return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function Q(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function ce(e,t){let n=e=>Q(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 le(e,t,n){let r=h(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`]);if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function $(e){let{name:t,directory:i,packageManager:a=`pnpm`,template:o=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:u=`zod`,runtime:f=`express`}=e,p=i,m=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${t}\n`),m(`Resolving package versions...`);let h=await Z();if(f!==`express`)if(le(`@forinda/kickjs`,`latest`,`./${f}`))m(`Using @forinda/kickjs@latest (stable ships the ${f} 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,Q(h[r]))&&(h[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}m(n?`Using the alpha channel for the ${f} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${f} runtime subpath may be missing. After install, run: ${a} add @forinda/kickjs@alpha`)}await n(s(p,`package.json`),S(t,o,h,l,u,f)),await n(s(p,`vite.config.ts`),C()),await n(s(p,`tsconfig.json`),w()),await n(s(p,`.prettierrc`),T()),await n(s(p,`.editorconfig`),ee()),await n(s(p,`.gitignore`),te()),await n(s(p,`.gitattributes`),ne()),await n(s(p,`.env`),re()),await n(s(p,`.env.example`),E()),await n(s(p,`src/config/index.ts`),j(u)),await n(s(p,`src/index.ts`),k(t,o,X.version,l,f)),await n(s(p,`src/modules/index.ts`),A()),await n(s(p,`src/modules/hello/hello.service.ts`),M()),await n(s(p,`src/modules/hello/hello.controller.ts`),N()),await n(s(p,`src/modules/hello/hello.module.ts`),P()),await n(s(p,`kick.config.ts`),F(o,c,a,f)),await n(s(p,`vitest.config.ts`),D()),await n(s(p,`README.md`),r(t,o,a));let{generateAgentDocs:g}=await import(`./agent-docs-BnGa_odb.mjs`).then(e=>e.t);if(await g({outDir:p,name:t,pm:a,template:o,only:`all`,force:!0}),e.installDeps){console.log(`\n Installing dependencies with ${a}...\n`);try{d(`${a} install`,{cwd:p,stdio:`inherit`}),console.log(`
|
|
388
|
+
Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${a} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-ByZnBYdj.mjs`).then(e=>e.n);await e({cwd:p,allowDuplicates:!0,silent:!0})}catch{}if(e.initGit)try{d(`git init`,{cwd:p,stdio:`pipe`}),d(`git branch -M main`,{cwd:p,stdio:`pipe`}),d(`git add -A`,{cwd:p,stdio:`pipe`}),d(`git commit -m "chore: initial commit from kick new"`,{cwd:p,stdio:`pipe`}),m(`Git repository initialized`)}catch{m(`Warning: git init failed (git may not be installed)`)}console.log(`
|
|
389
389
|
Project scaffolded successfully!`),console.log();let _=p!==process.cwd();m(`Next steps:`),_&&m(` cd ${t}`),e.installDeps||m(` ${a} install`);let v={rest:`kick g module user`,ddd:`kick g module user --repo drizzle`,cqrs:`kick g module user --pattern cqrs`,minimal:`# add your routes to src/index.ts`};m(` ${v[o]??v.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> Full DDD module (controller, DTOs, use-cases, repo)`),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> Express 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> Zod DTO schema`),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: ${L}`),m(``)}export{J as a,W as c,_ as d,R as i,g as l,Z as n,q as o,I as r,z as s,$ as t,v as u};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v6.
|
|
2
|
+
* @forinda/kickjs-cli v6.10.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{l as e,o as t}from"./project-docs-
|
|
11
|
+
import{l as e,o as t}from"./project-docs-BEnHASsn.mjs";import{i as n,t as r}from"./config-DYS_-oZ_.mjs";import{dirname as i,join as a,resolve as o}from"node:path";import{existsSync as s,readFileSync as c}from"node:fs";import{execFileSync as l,execSync as u,spawnSync as d}from"node:child_process";import{fileURLToPath as f}from"node:url";const p={express:{from:`@forinda/kickjs`,name:`expressRuntime`},fastify:{from:`@forinda/kickjs/fastify`,name:`fastifyRuntime`},h3:{from:`@forinda/kickjs/h3`,name:`h3Runtime`}};function m(e,t,n,r=[],i=`express`){let a=p[i],o=i===`express`;switch(t){case`minimal`:{let t=[],i=[],s=o?`import { bootstrap, ${a.name} } from '@forinda/kickjs'`:`import { bootstrap } from '@forinda/kickjs'\nimport { ${a.name} } from '${a.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(),`));let c=t.length?t.join(`
|
|
12
12
|
`)+`
|
|
13
13
|
`:``,l=i.length?`,\n adapters: [\n${i.join(`
|
|
14
14
|
`)}\n ]`:``;return`import 'reflect-metadata'
|
|
@@ -384,7 +384,7 @@ export default defineConfig({
|
|
|
384
384
|
`);for(let e of i)console.log(a(e))}else console.log(`\n Plus ${i.length} optional packages (auth, swagger, db, queue, …).`),console.log(" Run `kick add --list --all` for the full catalog.");console.log(`
|
|
385
385
|
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()}function q(e,t,n=`express`){let r=new Set,i=new Set,a=[],o=[],s=[];for(let c of e){if(c===`upload`){let e=z[n];s.push(`upload (${n}): ${e.note}`),e.prod&&(t?i:r).add(e.prod),e.dev&&i.add(e.dev);continue}let e=L[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)}return{prodDeps:[...r],devDeps:[...i],unknown:a,warnings:o,notices:s}}function J(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`).action(e=>{K(!!e.all)})}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(`--all`,`When listing, include the full optional catalog`).action(async(e,t)=>{if(t.list||e.length===0){K(!!t.all);return}let{pm:n,source:r}=await W(t.pm);console.log(`\n Using ${n} (resolved from ${r})`);let i=await B(process.cwd()),{prodDeps:a,devDeps:o,unknown:s,warnings:c,notices:l}=q(e,!!t.dev,i);for(let e of c)console.warn(`\n WARNING: ${e}`);for(let e of l)console.log(`\n ${e}`);if(!(s.length>0&&(console.log(`\n Unknown packages: ${s.join(`, `)}`),console.log(` Run "kick add --list" to see available packages.
|
|
386
386
|
`),a.length===0&&o.length===0))){if(a.length>0){let e=a,t=`${n} add ${e.join(` `)}`;console.log(`\n Installing ${e.length} dependency(ies):`);for(let t of e)console.log(` + ${t}`);console.log();try{u(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}if(o.length>0){let e=o,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{u(t,{stdio:`inherit`})}catch{console.log(`\n Installation failed. Run manually:\n ${t}\n`)}}console.log(` Done!
|
|
387
|
-
`)}})}const X=i(f(import.meta.url)),Z=JSON.parse(c(a(X,`..`,`package.json`),`utf-8`)),re=`^${Z.version}`,ie=[`@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`];async function Q(){let e=await Promise.all(ie.map(async e=>{let t=C(`npm`,[`view`,e,`version`]);return t&&/^\d+\.\d+\.\d+/.test(t)?[e,`^${t}`]:[e,re]}));return Object.fromEntries(e)}function ae(e,t){let n=C(`npm`,[`view`,`${e}@${t}`,`version`]);return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function oe(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 se(e,t,n){let r=C(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`]);if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function ce(n){let{name:r,directory:i,packageManager:o=`pnpm`,template:s=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:d=`zod`,runtime:f=`express`}=n,p=i,x=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${r}\n`),x(`Resolving package versions...`);let S=await Q();if(f!==`express`)if(se(`@forinda/kickjs`,`latest`,`./${f}`))x(`Using @forinda/kickjs@latest (stable ships the ${f} runtime)`);else{let e=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-vite`],t=[],n=!1;for(let r of e){let e=ae(r,`alpha`);e&&oe(e,$(S[r]))&&(S[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}x(n?`Using the alpha channel for the ${f} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${f} runtime subpath may be missing. After install, run: ${o} add @forinda/kickjs@alpha`)}await e(a(p,`package.json`),ee(r,s,S,l,d,f)),await e(a(p,`vite.config.ts`),te()),await e(a(p,`tsconfig.json`),k()),await e(a(p,`.prettierrc`),A()),await e(a(p,`.editorconfig`),j()),await e(a(p,`.gitignore`),M()),await e(a(p,`.gitattributes`),N()),await e(a(p,`.env`),P()),await e(a(p,`.env.example`),F()),await e(a(p,`src/config/index.ts`),g(d)),await e(a(p,`src/index.ts`),m(r,s,Z.version,l,f)),await e(a(p,`src/modules/index.ts`),h()),await e(a(p,`src/modules/hello/hello.service.ts`),_()),await e(a(p,`src/modules/hello/hello.controller.ts`),v()),await e(a(p,`src/modules/hello/hello.module.ts`),y()),await e(a(p,`kick.config.ts`),b(s,c,o,f)),await e(a(p,`vitest.config.ts`),I()),await e(a(p,`README.md`),t(r,s,o));let{generateAgentDocs:C}=await import(`./agent-docs-
|
|
388
|
-
Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${o} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-
|
|
387
|
+
`)}})}const X=i(f(import.meta.url)),Z=JSON.parse(c(a(X,`..`,`package.json`),`utf-8`)),re=`^${Z.version}`,ie=[`@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`];async function Q(){let e=await Promise.all(ie.map(async e=>{let t=C(`npm`,[`view`,e,`version`]);return t&&/^\d+\.\d+\.\d+/.test(t)?[e,`^${t}`]:[e,re]}));return Object.fromEntries(e)}function ae(e,t){let n=C(`npm`,[`view`,`${e}@${t}`,`version`]);return n&&/^\d+\.\d+\.\d+/.test(n)?n:null}function $(e){return(e??``).replace(/^[\^~>=<\s]+/,``)}function oe(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 se(e,t,n){let r=C(`npm`,[`view`,`${e}@${t}`,`exports`,`--json`]);if(!r)return!1;try{let e=JSON.parse(r);return Object.prototype.hasOwnProperty.call(e,n)}catch{return!1}}async function ce(n){let{name:r,directory:i,packageManager:o=`pnpm`,template:s=`rest`,defaultRepo:c=`inmemory`,packages:l=[],schemaLib:d=`zod`,runtime:f=`express`}=n,p=i,x=e=>console.log(` ${e}`);console.log(`\n Creating KickJS project: ${r}\n`),x(`Resolving package versions...`);let S=await Q();if(f!==`express`)if(se(`@forinda/kickjs`,`latest`,`./${f}`))x(`Using @forinda/kickjs@latest (stable ships the ${f} runtime)`);else{let e=[`@forinda/kickjs`,`@forinda/kickjs-cli`,`@forinda/kickjs-vite`],t=[],n=!1;for(let r of e){let e=ae(r,`alpha`);e&&oe(e,$(S[r]))&&(S[r]=`^${e}`,t.push(`${r}@^${e}`),r===`@forinda/kickjs`&&(n=!0))}x(n?`Using the alpha channel for the ${f} runtime: ${t.join(`, `)}`:`WARNING: could not resolve @forinda/kickjs@alpha — the ${f} runtime subpath may be missing. After install, run: ${o} add @forinda/kickjs@alpha`)}await e(a(p,`package.json`),ee(r,s,S,l,d,f)),await e(a(p,`vite.config.ts`),te()),await e(a(p,`tsconfig.json`),k()),await e(a(p,`.prettierrc`),A()),await e(a(p,`.editorconfig`),j()),await e(a(p,`.gitignore`),M()),await e(a(p,`.gitattributes`),N()),await e(a(p,`.env`),P()),await e(a(p,`.env.example`),F()),await e(a(p,`src/config/index.ts`),g(d)),await e(a(p,`src/index.ts`),m(r,s,Z.version,l,f)),await e(a(p,`src/modules/index.ts`),h()),await e(a(p,`src/modules/hello/hello.service.ts`),_()),await e(a(p,`src/modules/hello/hello.controller.ts`),v()),await e(a(p,`src/modules/hello/hello.module.ts`),y()),await e(a(p,`kick.config.ts`),b(s,c,o,f)),await e(a(p,`vitest.config.ts`),I()),await e(a(p,`README.md`),t(r,s,o));let{generateAgentDocs:C}=await import(`./agent-docs-CLs1wTpl.mjs`).then(e=>e.t);if(await C({outDir:p,name:r,pm:o,template:s,only:`all`,force:!0}),n.installDeps){console.log(`\n Installing dependencies with ${o}...\n`);try{u(`${o} install`,{cwd:p,stdio:`inherit`}),console.log(`
|
|
388
|
+
Dependencies installed successfully!`)}catch{console.log(`\n Warning: ${o} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-ngGYyfaY.mjs`).then(e=>e.n);await e({cwd:p,allowDuplicates:!0,silent:!0})}catch{}if(n.initGit)try{u(`git init`,{cwd:p,stdio:`pipe`}),u(`git branch -M main`,{cwd:p,stdio:`pipe`}),u(`git add -A`,{cwd:p,stdio:`pipe`}),u(`git commit -m "chore: initial commit from kick new"`,{cwd:p,stdio:`pipe`}),x(`Git repository initialized`)}catch{x(`Warning: git init failed (git may not be installed)`)}console.log(`
|
|
389
389
|
Project scaffolded successfully!`),console.log();let w=p!==process.cwd();x(`Next steps:`),w&&x(` cd ${r}`),n.installDeps||x(` ${o} install`);let T={rest:`kick g module user`,ddd:`kick g module user --repo drizzle`,cqrs:`kick g module user --pattern cqrs`,minimal:`# add your routes to src/index.ts`};x(` ${T[s]??T.rest}`),x(` kick dev`),x(``),x(`Commands:`),x(` kick dev Start dev server with Vite HMR`),x(` kick build Production build via Vite`),x(` kick start Run production build`),x(``),x(`Generators:`),x(` kick g module <name> Full DDD module (controller, DTOs, use-cases, repo)`),x(` kick g scaffold <n> <f..> CRUD module from field definitions`),x(` kick g controller <name> Standalone controller`),x(` kick g service <name> @Service() class`),x(` kick g middleware <name> Express middleware`),x(` kick g guard <name> Route guard (auth, roles, etc.)`),x(` kick g adapter <name> AppAdapter with lifecycle hooks`),x(` kick g dto <name> Zod DTO schema`),x(` kick g config Generate kick.config.ts`),x(``),x(`Add packages:`),x(` kick add <pkg> Install a KickJS package + peers`),x(` kick add --list Show all available packages`),x(``),x(`Available: ${R}`),x(``)}export{Y as a,G as c,z as i,w as l,Q as n,J as o,L as r,B as s,ce as t,T as u};
|
|
390
|
-
//# sourceMappingURL=project-
|
|
390
|
+
//# sourceMappingURL=project-DPQJNbUr.mjs.map
|