@forinda/kickjs-cli 8.1.5 → 8.1.7
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-DzaWoZc7.mjs → agent-docs-CNKIzlQ5.mjs} +3 -3
- package/dist/{agent-docs-DzaWoZc7.mjs.map → agent-docs-CNKIzlQ5.mjs.map} +1 -1
- package/dist/{agent-docs-BK33p0Pw.mjs → agent-docs-DUtJ6p1e.mjs} +2 -2
- package/dist/{build-clh7HpZV.mjs → build-C1ya_zWp.mjs} +3 -3
- package/dist/{build-DBT23vXN.mjs → build-CYRMk2Z8.mjs} +4 -4
- package/dist/{build-DBT23vXN.mjs.map → build-CYRMk2Z8.mjs.map} +1 -1
- package/dist/{builtins-HdwKAx0s.mjs → builtins-Byjz8UuR.mjs} +2 -2
- package/dist/{builtins-B6Dc2coA.mjs → builtins-CTvWnQQZ.mjs} +121 -24
- package/dist/cli.mjs +2 -2
- package/dist/{config-CzL24fBQ.mjs → config-BZIWs0bx.mjs} +3 -3
- package/dist/{config-D06pHD-Y.mjs → config-BaIkyt4R.mjs} +4 -4
- package/dist/{config-D06pHD-Y.mjs.map → config-BaIkyt4R.mjs.map} +1 -1
- package/dist/{doctor-Bi_jVzha.mjs → doctor-CtPbmFxW.mjs} +8 -7
- package/dist/{doctor-Bi_jVzha.mjs.map → doctor-CtPbmFxW.mjs.map} +1 -1
- package/dist/{fullstack-DAEEITND.mjs → fullstack-KQgV78V3.mjs} +3 -3
- package/dist/{fullstack-CdAbknb3.mjs → fullstack-kj0NzeKU.mjs} +4 -4
- package/dist/{fullstack-CdAbknb3.mjs.map → fullstack-kj0NzeKU.mjs.map} +1 -1
- package/dist/index.d.mts +22 -22
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/plugin-B240AAOf.mjs +11 -0
- package/dist/{plugin-BSNGbECd.mjs → plugin-KiE0QPvK.mjs} +2 -2
- package/dist/{project-DfBzpCeE.mjs → project-C5jzgKo-.mjs} +28 -26
- package/dist/{project-indmSdfC.mjs → project-Dq4SdxF6.mjs} +26 -24
- package/dist/project-Dq4SdxF6.mjs.map +1 -0
- package/dist/{project-docs-DRLN1EDX.mjs → project-docs-CP73I9uv.mjs} +1 -1
- package/dist/{project-docs-BCwWphge.mjs → project-docs-DRVouPvK.mjs} +2 -2
- package/dist/{project-docs-BCwWphge.mjs.map → project-docs-DRVouPvK.mjs.map} +1 -1
- package/dist/{project-root-CQCNCAvv.mjs → project-root-BRMuHEs3.mjs} +3 -3
- package/dist/{project-root-CQCNCAvv.mjs.map → project-root-BRMuHEs3.mjs.map} +1 -1
- package/dist/{project-root-BsyQhlS5.mjs → project-root-D4iNxhPu.mjs} +2 -2
- package/dist/{prompts-Ba0PO3Rn.mjs → prompts-DDlFHtva.mjs} +2 -2
- package/dist/{prompts-Ba0PO3Rn.mjs.map → prompts-DDlFHtva.mjs.map} +1 -1
- package/dist/{rolldown-runtime-DmTqmRjS.mjs → rolldown-runtime-BAJI6YvG.mjs} +1 -1
- package/dist/{run-plugins-BKWupYoJ.mjs → run-plugins-BYPm9bbY.mjs} +186 -90
- package/dist/run-plugins-BYPm9bbY.mjs.map +1 -0
- package/dist/typegen-BZJk-Lmq.mjs +131 -0
- package/dist/typegen-BdNffFKy.mjs +132 -0
- package/dist/{typegen-CnsfSSpH.mjs.map → typegen-BdNffFKy.mjs.map} +1 -1
- package/dist/{types-B6yNws8R.mjs → types-D8Vtq4vL.mjs} +1 -1
- package/package.json +6 -6
- package/dist/plugin-CD9WjquV.mjs +0 -12
- package/dist/plugin-CD9WjquV.mjs.map +0 -1
- package/dist/project-indmSdfC.mjs.map +0 -1
- package/dist/run-plugins-BKWupYoJ.mjs.map +0 -1
- package/dist/typegen-B6vIx4Qd.mjs +0 -131
- package/dist/typegen-CnsfSSpH.mjs +0 -132
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v8.1.
|
|
2
|
+
* @forinda/kickjs-cli v8.1.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{l as e,n as t,t as n}from"./project-
|
|
11
|
+
import{l as e,n as t,t as n}from"./project-C5jzgKo-.mjs";import{l as r}from"./project-docs-CP73I9uv.mjs";import{join as i}from"node:path";import{execFileSync as a}from"node:child_process";async function o(o){let{name:_,directory:v,schemaLib:y=`zod`,runtime:b=`express`}=o,x=[`pnpm`,`npm`,`yarn`,`bun`].includes(o.packageManager),S=x?o.packageManager:`pnpm`,C=v,w=e=>console.log(` ${e}`);o.packageManager!==void 0&&!x&&w(`Warning: unknown package manager '${String(o.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${_}\n`),await n({name:`${_}-server`,directory:i(C,`server`),packageManager:S,template:`minimal`,schemaLib:y,runtime:b,withClientMap:!0,initGit:!1,installDeps:!1,spaClientDir:`../web/dist`});let T=await t(),E=T[`@forinda/kickjs-client`]??`^0.1.0`;await r(i(C,`web/package.json`),s(_,E)),await r(i(C,`web/vite.config.ts`),c()),await r(i(C,`web/tsconfig.json`),l()),await r(i(C,`web/index.html`),u(_)),await r(i(C,`web/src/main.tsx`),d()),await r(i(C,`web/src/App.tsx`),f()),await r(i(C,`web/src/api.ts`),p()),await r(i(C,`package.json`),m(_,S,T[`@forinda/kickjs-cli`])),S===`pnpm`&&await r(i(C,`pnpm-workspace.yaml`),`packages:
|
|
12
12
|
- server
|
|
13
13
|
- web
|
|
14
14
|
|
|
15
15
|
allowBuilds:
|
|
16
16
|
'@swc/core': true
|
|
17
17
|
esbuild: true
|
|
18
|
-
`),await r(i(C,`.gitignore`),h()),await r(i(C,`README.md`),g(_,S));let{generateAgentDocs:D}=await import(`./agent-docs-
|
|
18
|
+
`),await r(i(C,`.gitignore`),h()),await r(i(C,`README.md`),g(_,S));let{generateAgentDocs:D}=await import(`./agent-docs-DUtJ6p1e.mjs`).then(e=>e.t);if(await D({outDir:C,name:_,pm:S,template:`fullstack`,only:`all`,force:!0}),o.installDeps){console.log(`\n Installing workspace dependencies with ${S}...\n`);try{e(S,[`install`],{cwd:C})}catch{console.log(`\n Warning: ${S} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-BZJk-Lmq.mjs`).then(e=>e.n);await e({cwd:i(C,`server`),allowDuplicates:!0,silent:!0})}catch{}if(o.initGit)try{a(`git`,[`init`],{cwd:C,stdio:`pipe`}),a(`git`,[`branch`,`-M`,`main`],{cwd:C,stdio:`pipe`}),a(`git`,[`add`,`-A`],{cwd:C,stdio:`pipe`}),a(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:C,stdio:`pipe`}),w(`Git repository initialized`)}catch{w(`Warning: git init failed (git may not be installed)`)}console.log(`
|
|
19
19
|
Fullstack workspace scaffolded!`),console.log(),w(`Next steps:`),w(` cd ${_}`),o.installDeps||w(` ${S} install`),S===`pnpm`?w(` pnpm dev # runs server (kick dev) + web (vite) together`):(w(` ${S} run dev:server # terminal 1`),w(` ${S} run dev:web # terminal 2`)),w(``),w(`The web app calls the API through @forinda/kickjs-client —`),w(`edit server/src/modules/hello and watch web/src/App.tsx's types follow.`),w(``)}function s(e,t){return`${JSON.stringify({name:`${e}-web`,private:!0,version:`0.0.0`,type:`module`,scripts:{dev:`vite`,build:`tsc --noEmit && vite build`,preview:`vite preview`,typecheck:`tsc --noEmit`},dependencies:{"@forinda/kickjs-client":t,react:`^19.0.0`,"react-dom":`^19.0.0`},devDependencies:{"@types/react":`^19.0.0`,"@types/react-dom":`^19.0.0`,"@vitejs/plugin-react":`^5.0.0`,typescript:`^5.9.0`,vite:`^7.0.0`}},null,2)}\n`}function c(){return`import { defineConfig } from 'vite'
|
|
20
20
|
import react from '@vitejs/plugin-react'
|
|
21
21
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v8.1.
|
|
2
|
+
* @forinda/kickjs-cli v8.1.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{l as e}from"./project-docs-
|
|
11
|
+
import{l as e}from"./project-docs-DRVouPvK.mjs";import{l as t,n,t as r}from"./project-Dq4SdxF6.mjs";import{join as i}from"node:path";import{execFileSync as a}from"node:child_process";async function o(o){let{name:_,directory:v,schemaLib:y=`zod`,runtime:b=`express`}=o,x=[`pnpm`,`npm`,`yarn`,`bun`].includes(o.packageManager),S=x?o.packageManager:`pnpm`,C=v,w=e=>console.log(` ${e}`);o.packageManager!==void 0&&!x&&w(`Warning: unknown package manager '${String(o.packageManager)}' — falling back to pnpm.`),console.log(`\n Creating fullstack KickJS workspace: ${_}\n`),await r({name:`${_}-server`,directory:i(C,`server`),packageManager:S,template:`minimal`,schemaLib:y,runtime:b,withClientMap:!0,initGit:!1,installDeps:!1,spaClientDir:`../web/dist`});let T=await n(),E=T[`@forinda/kickjs-client`]??`^0.1.0`;await e(i(C,`web/package.json`),s(_,E)),await e(i(C,`web/vite.config.ts`),c()),await e(i(C,`web/tsconfig.json`),l()),await e(i(C,`web/index.html`),u(_)),await e(i(C,`web/src/main.tsx`),d()),await e(i(C,`web/src/App.tsx`),f()),await e(i(C,`web/src/api.ts`),p()),await e(i(C,`package.json`),m(_,S,T[`@forinda/kickjs-cli`])),S===`pnpm`&&await e(i(C,`pnpm-workspace.yaml`),`packages:
|
|
12
12
|
- server
|
|
13
13
|
- web
|
|
14
14
|
|
|
15
15
|
allowBuilds:
|
|
16
16
|
'@swc/core': true
|
|
17
17
|
esbuild: true
|
|
18
|
-
`),await e(i(C,`.gitignore`),h()),await e(i(C,`README.md`),g(_,S));let{generateAgentDocs:D}=await import(`./agent-docs-
|
|
18
|
+
`),await e(i(C,`.gitignore`),h()),await e(i(C,`README.md`),g(_,S));let{generateAgentDocs:D}=await import(`./agent-docs-CNKIzlQ5.mjs`).then(e=>e.t);if(await D({outDir:C,name:_,pm:S,template:`fullstack`,only:`all`,force:!0}),o.installDeps){console.log(`\n Installing workspace dependencies with ${S}...\n`);try{t(S,[`install`],{cwd:C})}catch{console.log(`\n Warning: ${S} install failed. Run it manually.`)}}try{let{runTypegen:e}=await import(`./typegen-BdNffFKy.mjs`).then(e=>e.n);await e({cwd:i(C,`server`),allowDuplicates:!0,silent:!0})}catch{}if(o.initGit)try{a(`git`,[`init`],{cwd:C,stdio:`pipe`}),a(`git`,[`branch`,`-M`,`main`],{cwd:C,stdio:`pipe`}),a(`git`,[`add`,`-A`],{cwd:C,stdio:`pipe`}),a(`git`,[`commit`,`-m`,`chore: initial commit from kick new (fullstack)`],{cwd:C,stdio:`pipe`}),w(`Git repository initialized`)}catch{w(`Warning: git init failed (git may not be installed)`)}console.log(`
|
|
19
19
|
Fullstack workspace scaffolded!`),console.log(),w(`Next steps:`),w(` cd ${_}`),o.installDeps||w(` ${S} install`),S===`pnpm`?w(` pnpm dev # runs server (kick dev) + web (vite) together`):(w(` ${S} run dev:server # terminal 1`),w(` ${S} run dev:web # terminal 2`)),w(``),w(`The web app calls the API through @forinda/kickjs-client —`),w(`edit server/src/modules/hello and watch web/src/App.tsx's types follow.`),w(``)}function s(e,t){return`${JSON.stringify({name:`${e}-web`,private:!0,version:`0.0.0`,type:`module`,scripts:{dev:`vite`,build:`tsc --noEmit && vite build`,preview:`vite preview`,typecheck:`tsc --noEmit`},dependencies:{"@forinda/kickjs-client":t,react:`^19.0.0`,"react-dom":`^19.0.0`},devDependencies:{"@types/react":`^19.0.0`,"@types/react-dom":`^19.0.0`,"@vitejs/plugin-react":`^5.0.0`,typescript:`^5.9.0`,vite:`^7.0.0`}},null,2)}\n`}function c(){return`import { defineConfig } from 'vite'
|
|
20
20
|
import react from '@vitejs/plugin-react'
|
|
21
21
|
|
|
@@ -187,4 +187,4 @@ export const api = createClient<Api>({ baseUrl: '/api/v1' })
|
|
|
187
187
|
|
|
188
188
|
Docs: https://kickjs.app/guide/typed-client.html
|
|
189
189
|
`}export{o as initFullstackProject};
|
|
190
|
-
//# sourceMappingURL=fullstack-
|
|
190
|
+
//# sourceMappingURL=fullstack-kj0NzeKU.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fullstack-CdAbknb3.mjs","names":[],"sources":["../src/generators/fullstack.ts"],"sourcesContent":["// `kick new --template fullstack` — a pnpm-workspace monorepo:\n//\n// my-app/\n// server/ KickJS API (the standard scaffold, minus its own git/install)\n// web/ Vite + React frontend typed end-to-end via\n// @forinda/kickjs-client + the server's generated KickRoutes.Api\n//\n// The type loop: server controllers use return-value handlers → `kick\n// typegen` (run here once, re-run by `kick dev`) emits\n// server/.kickjs/types/kick__client.d.ts → web tsconfig `types` (ambient)\n// side-effect-imports that file (type-only, erased at runtime) → the web\n// client calls `api.get('/hello')` with the handler's actual response type.\n\nimport { join } from 'node:path'\nimport { execFileSync } from 'node:child_process'\n\nimport { writeFileSafe } from '../utils/fs'\nimport { runCommand } from '../utils/shell'\nimport { initProject, resolveSiblingVersions } from './project'\n\nexport interface InitFullstackOptions {\n name: string\n directory: string\n packageManager?: 'pnpm' | 'npm' | 'yarn' | 'bun'\n initGit?: boolean\n installDeps?: boolean\n schemaLib?: 'zod' | 'valibot' | 'yup'\n runtime?: 'express' | 'fastify' | 'h3'\n}\n\nexport async function initFullstackProject(options: InitFullstackOptions): Promise<void> {\n const { name, directory, schemaLib = 'zod', runtime = 'express' } = options\n // `--pm` arrives as a free CLI string — allowlist before it reaches a\n // process invocation (execFileSync takes an argv array, no shell, but a\n // bogus binary name is still a confusing failure).\n const pmValid = (['pnpm', 'npm', 'yarn', 'bun'] as const).includes(\n options.packageManager as never,\n )\n const packageManager = pmValid\n ? (options.packageManager as 'pnpm' | 'npm' | 'yarn' | 'bun')\n : 'pnpm'\n const dir = directory\n const log = (msg: string) => console.log(` ${msg}`)\n if (options.packageManager !== undefined && !pmValid) {\n log(\n `Warning: unknown package manager '${String(options.packageManager)}' — falling back to pnpm.`,\n )\n }\n\n console.log(`\\n Creating fullstack KickJS workspace: ${name}\\n`)\n\n // ── server/ — the standard scaffold, deferred install/git ──────────\n await initProject({\n name: `${name}-server`,\n directory: join(dir, 'server'),\n packageManager,\n template: 'minimal',\n schemaLib,\n runtime,\n // web/ reads the resolved route map from the ambient KickClientApi\n // namespace, which needs the TS 7 compiler API to produce.\n withClientMap: true,\n // Root owns install + git so the lockfile/commit cover the workspace.\n initGit: false,\n installDeps: false,\n // Production single-origin serving. `web/` builds to `web/dist`, and\n // nothing served it before — `pnpm build` produced a frontend the API had\n // no way to hand out, so every deploy needed a hand-wired static host or\n // a second process. The adapter is inert until `../web/dist` exists, so\n // `dev` (Vite serves the client and proxies /api here) is untouched.\n spaClientDir: '../web/dist',\n })\n\n // ── web/ — Vite + React, typed client ──────────────────────────────\n const versions = await resolveSiblingVersions()\n const clientVersion = versions['@forinda/kickjs-client'] ?? '^0.1.0'\n\n await writeFileSafe(join(dir, 'web/package.json'), webPackageJson(name, clientVersion))\n await writeFileSafe(join(dir, 'web/vite.config.ts'), webViteConfig())\n await writeFileSafe(join(dir, 'web/tsconfig.json'), webTsConfig())\n await writeFileSafe(join(dir, 'web/index.html'), webIndexHtml(name))\n await writeFileSafe(join(dir, 'web/src/main.tsx'), webMain())\n await writeFileSafe(join(dir, 'web/src/App.tsx'), webApp())\n await writeFileSafe(join(dir, 'web/src/api.ts'), webApi())\n\n // ── workspace root ──────────────────────────────────────────────────\n await writeFileSafe(\n join(dir, 'package.json'),\n rootPackageJson(name, packageManager, versions['@forinda/kickjs-cli']),\n )\n // Only pnpm reads this file. npm / yarn / bun declare workspaces via the\n // `workspaces` field in the root package.json instead — see rootPackageJson.\n if (packageManager === 'pnpm') {\n // `allowBuilds` is answered here, not left to pnpm. This scaffold installs\n // non-interactively, so pnpm cannot prompt — it writes\n // `'@swc/core': set this to true or false` and then refuses to run ANY\n // script with ERR_PNPM_IGNORED_BUILDS, leaving a fresh project unable to\n // run `pnpm typecheck` or `pnpm dev` until someone edits this file.\n //\n // Both are build tools this template chose: swc compiles the decorators,\n // esbuild is Vite's. Approving their install scripts is the same decision\n // as depending on them.\n await writeFileSafe(\n join(dir, 'pnpm-workspace.yaml'),\n `packages:\\n - server\\n - web\\n\\nallowBuilds:\\n '@swc/core': true\\n esbuild: true\\n`,\n )\n }\n await writeFileSafe(join(dir, '.gitignore'), rootGitignore())\n await writeFileSafe(join(dir, 'README.md'), rootReadme(name, packageManager))\n\n // Workspace-root agent docs (CLAUDE.md + .agents/) flavored for the\n // fullstack layout — the server/ subdir keeps its own generated set.\n const { generateAgentDocs } = await import('./agent-docs')\n await generateAgentDocs({\n outDir: dir,\n name,\n pm: packageManager,\n template: 'fullstack',\n only: 'all',\n force: true,\n })\n\n // ── install (root — covers both workspace packages) ────────────────\n if (options.installDeps) {\n console.log(`\\n Installing workspace dependencies with ${packageManager}...\\n`)\n try {\n // `runCommand`, not bare execFileSync — on Windows every package\n // manager is a `.cmd` shim that execFileSync cannot spawn.\n runCommand(packageManager, ['install'], { cwd: dir })\n } catch {\n console.log(`\\n Warning: ${packageManager} install failed. Run it manually.`)\n }\n }\n\n // ── typegen (server) so web's KickRoutes.Api resolves immediately ──\n try {\n const { runTypegen } = await import('../typegen')\n await runTypegen({ cwd: join(dir, 'server'), allowDuplicates: true, silent: true })\n } catch {\n // Non-fatal — `kick dev` in server/ retries on boot.\n }\n\n // ── git (root) ──────────────────────────────────────────────────────\n if (options.initGit) {\n try {\n execFileSync('git', ['init'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['branch', '-M', 'main'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['add', '-A'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['commit', '-m', 'chore: initial commit from kick new (fullstack)'], {\n cwd: dir,\n stdio: 'pipe',\n })\n log('Git repository initialized')\n } catch {\n log('Warning: git init failed (git may not be installed)')\n }\n }\n\n console.log('\\n Fullstack workspace scaffolded!')\n console.log()\n log('Next steps:')\n log(` cd ${name}`)\n if (!options.installDeps) log(` ${packageManager} install`)\n if (packageManager === 'pnpm') {\n log(' pnpm dev # runs server (kick dev) + web (vite) together')\n } else {\n log(` ${packageManager} run dev:server # terminal 1`)\n log(` ${packageManager} run dev:web # terminal 2`)\n }\n log('')\n log('The web app calls the API through @forinda/kickjs-client —')\n log(\"edit server/src/modules/hello and watch web/src/App.tsx's types follow.\")\n log('')\n}\n\n// ── web templates ─────────────────────────────────────────────────────\n\nfunction webPackageJson(name: string, clientVersion: string): string {\n return `${JSON.stringify(\n {\n name: `${name}-web`,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts: {\n dev: 'vite',\n build: 'tsc --noEmit && vite build',\n preview: 'vite preview',\n typecheck: 'tsc --noEmit',\n },\n dependencies: {\n '@forinda/kickjs-client': clientVersion,\n react: '^19.0.0',\n 'react-dom': '^19.0.0',\n },\n devDependencies: {\n '@types/react': '^19.0.0',\n '@types/react-dom': '^19.0.0',\n '@vitejs/plugin-react': '^5.0.0',\n typescript: '^5.9.0',\n vite: '^7.0.0',\n },\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction webViteConfig(): string {\n return `import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\nexport default defineConfig({\n plugins: [react()],\n server: {\n // The KickJS server (kick dev) listens on 3000; the client's baseUrl is\n // the relative '/api/v1', so the browser hits Vite and Vite forwards.\n proxy: {\n '/api': 'http://localhost:3000',\n },\n },\n})\n`\n}\n\nexport function webTsConfig(): string {\n return `${JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n lib: ['ES2022', 'DOM', 'DOM.Iterable'],\n module: 'ESNext',\n moduleResolution: 'bundler',\n jsx: 'react-jsx',\n strict: true,\n skipLibCheck: true,\n noEmit: true,\n isolatedModules: true,\n // The resolved client route map, as an ambient global type package —\n // the same mechanism as \"node\" or \"vitest/globals\". It makes\n // `KickClientApi.Api` available with no import and no bridge file.\n //\n // Note this is a `types` ENTRY, not an `include`: the map is a global\n // type package, not source of this app. It also means the file must\n // exist — `kick new` runs typegen for you, and `kick typegen` in\n // server/ refreshes it. (An `include` entry tolerates the file being\n // absent; a `types` entry reports TS2688, which is the louder and\n // more useful failure for something the app depends on.)\n //\n // No `experimentalDecorators` here: unlike the ambient\n // `KickRoutes.Api` bridge, this map carries no reference to the\n // server's decorated controller sources.\n types: ['../server/.kickjs/types/kick__client'],\n },\n include: ['src'],\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction webIndexHtml(name: string): string {\n return `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>${name}</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n`\n}\n\nfunction webMain(): string {\n return `import { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { App } from './App'\n\ncreateRoot(document.getElementById('root')!).render(\n <StrictMode>\n <App />\n </StrictMode>,\n)\n`\n}\n\nfunction webApp(): string {\n return `import { useEffect, useState } from 'react'\nimport { api } from './api'\n\n// The response types below are INFERRED from the server's handlers —\n// change server/src/modules/hello/hello.service.ts and these types follow on\n// the next \\`kick typegen\\`. Not under \\`kick dev\\`: resolving the client map\n// builds a whole TypeScript program, so it is a build step, not a per-save one.\ntype Greeting = Awaited<ReturnType<typeof fetchGreeting>>\n\nfunction fetchGreeting() {\n return api.get('/hello')\n}\n\nexport function App() {\n const [greeting, setGreeting] = useState<Greeting | null>(null)\n const [health, setHealth] = useState<string>('checking…')\n\n useEffect(() => {\n fetchGreeting().then(setGreeting).catch(console.error)\n api\n .get('/hello/health')\n .then((h) => setHealth(h.status))\n .catch(() => setHealth('down'))\n }, [])\n\n return (\n <main style={{ fontFamily: 'system-ui', maxWidth: 640, margin: '4rem auto', padding: '0 1rem' }}>\n <h1>KickJS fullstack</h1>\n <p>\n <strong>{greeting?.message ?? 'loading…'}</strong>\n </p>\n <p>\n Server said hello at <code>{greeting?.timestamp ?? '…'}</code> — health:{' '}\n <code>{health}</code>\n </p>\n <p style={{ color: '#666' }}>\n This call is typed end to end: <code>api.get('/hello')</code> returns the exact shape\n <code> HelloService.greet()</code> produces. Rename a field on the server and this file\n stops compiling.\n </p>\n </main>\n )\n}\n`\n}\n\nexport function webApi(): string {\n return `import { createClient } from '@forinda/kickjs-client'\n\n// KickClientApi is ambient — the resolved route map from\n// server/.kickjs/types/kick__client.d.ts, wired in tsconfig's \\`types\\`. Every\n// response type is a literal shape, so nothing from the server's source graph\n// enters this program.\n//\n// Keys are module-mount-relative paths; the bootstrap-level '/api/v1' prefix\n// lives here in baseUrl, and the Vite dev proxy forwards it to the KickJS\n// server.\n//\n// Prefer an explicit import? The same file exports the type:\n// import type { Api } from '../../server/.kickjs/types/kick__client'\nexport const api = createClient<KickClientApi.Api>({ baseUrl: '/api/v1' })\n`\n}\n\n// ── root templates ────────────────────────────────────────────────────\n\nfunction rootPackageJson(name: string, pm: string, cliVersion: string): string {\n const scripts: Record<string, string> =\n pm === 'pnpm'\n ? {\n dev: 'pnpm --parallel -r run dev',\n // One origin: the server serves `web/dist` through SpaAdapter.\n start: 'pnpm --filter ./server run start',\n 'dev:server': 'pnpm --filter ./server dev',\n 'dev:web': 'pnpm --filter ./web dev',\n build: 'pnpm -r run build',\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\n }\n : {\n // cd-based scripts — the one form npm, yarn (classic AND berry),\n // and bun all run identically; workspace-filter flags differ per\n // manager (--workspace vs `yarn workspace <name>` vs --filter).\n start: `cd server && ${pm} run start`,\n 'dev:server': `cd server && ${pm} run dev`,\n 'dev:web': `cd web && ${pm} run dev`,\n build: `${pm} run build:server && ${pm} run build:web`,\n 'build:server': `cd server && ${pm} run build`,\n 'build:web': `cd web && ${pm} run build`,\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\n }\n return `${JSON.stringify(\n {\n name,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts,\n // The CLI is a ROOT dependency so the bare `kick` in the scripts above\n // resolves: package managers put `node_modules/.bin` on PATH for\n // scripts, and the CLI otherwise lives only in `server/node_modules`.\n devDependencies: { '@forinda/kickjs-cli': cliVersion },\n workspaces: ['server', 'web'],\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction rootGitignore(): string {\n return `node_modules/\ndist/\n.env\n*.log\n.DS_Store\n`\n}\n\nfunction rootReadme(name: string, pm: string): string {\n return `# ${name}\n\nFullstack KickJS workspace — typed end to end.\n\n| Package | What |\n| --------- | ----------------------------------------------------------------- |\n| \\`server/\\` | KickJS API (decorators, DI, \\`kick dev\\` with typegen watch) |\n| \\`web/\\` | Vite + React, typed against the API via \\`@forinda/kickjs-client\\` |\n\n## Develop\n\n\\`\\`\\`bash\n${pm} install\n${pm === 'pnpm' ? 'pnpm dev # server (kick dev) + web (vite), in parallel' : `${pm} run dev:server # terminal 1\\n${pm} run dev:web # terminal 2`}\n\\`\\`\\`\n\nServer: http://localhost:3000 · Web: http://localhost:5173 (Vite proxies \\`/api\\`).\n\n## The type loop\n\n1. Server handlers **return** their payloads (\\`return this.service.greet(...)\\`).\n2. \\`kick typegen\\` emits \\`server/.kickjs/types/kick__client.d.ts\\` — the flat\n route map with every response type resolved to a literal shape.\n3. \\`web/tsconfig.json\\` lists that file in \\`types\\`, so \\`KickClientApi\\` is\n ambient — no import, no bridge file.\n4. \\`web/src/api.ts\\`'s \\`createClient<KickClientApi.Api>\\` types every call site.\n\nBecause the map holds resolved types rather than references to controllers,\n\\`web\\` never compiles server source: no \\`experimentalDecorators\\`, no path\naliases into \\`server/src\\`.\n\nRename a field in \\`server/src/modules/hello/hello.service.ts\\` → \\`web/src/App.tsx\\`\nstops compiling. That's the point.\n\n### Keeping the map fresh\n\n\\`server/.kickjs/types/kick__client.d.ts\\` is generated, and \\`web\\` reads it as\nan ambient type package. Two things follow.\n\n**It is not refreshed by \\`kick dev\\`.** Resolving it builds a whole TypeScript\nprogram over the server, which is a build-step cost rather than a per-save one,\nso a renamed response field surfaces on the next \\`kick typegen\\` rather than on\nsave. Everything else in \\`.kickjs/types\\` still updates on save. Add\n\\`kick typegen --check\\` to CI and a stale map fails the build.\n\n**It needs a compiler API.** TypeScript 7 ships none, so \\`server\\` depends on\n\\`@typescript/typescript6\\`. Remove it and typegen skips this one file, saying\nso; \\`web\\` then reports \\`TS2688\\` because the file it lists in \\`types\\` is gone.\n\n### The other way to wire it\n\nA \\`types\\` entry says \"this is a global type package\", which is what the map is,\nand it fails loudly when the file is missing. If you would rather it be quiet\nwhen absent — say, a repo where the map is not always generated — use\n\\`include\\` instead:\n\n\\`\\`\\`json\n{ \"include\": [\"src\", \"../server/.kickjs/types/kick__client.d.ts\"] }\n\\`\\`\\`\n\nThat tolerates the file not existing, at the cost of \\`KickClientApi\\` silently\nnot resolving. Note \\`types\\` replaces TypeScript's automatic \\`@types\\`\ninclusion, so if you add entries there, list the ones you rely on too\n(\\`\"types\": [\"node\", \"../server/.kickjs/types/kick__client\"]\\`).\n\nOr skip the global entirely — the same file exports the type:\n\n\\`\\`\\`ts\nimport type { Api } from '../../server/.kickjs/types/kick__client'\n\nexport const api = createClient<Api>({ baseUrl: '/api/v1' })\n\\`\\`\\`\n\nDocs: https://kickjs.app/guide/typed-client.html\n`\n}\n"],"mappings":";;;;;;;;;;uLA8BA,eAAsB,EAAqB,EAA8C,CACvF,GAAM,CAAE,OAAM,YAAW,YAAY,MAAO,UAAU,WAAc,EAI9D,EAAW,CAAC,OAAQ,MAAO,OAAQ,KAAK,CAAC,CAAW,SACxD,EAAQ,cACV,EACM,EAAiB,EAClB,EAAQ,eACT,OACE,EAAM,EACN,EAAO,GAAgB,QAAQ,IAAI,KAAK,GAAK,EAC/C,EAAQ,iBAAmB,IAAA,IAAa,CAAC,GAC3C,EACE,qCAAqC,OAAO,EAAQ,cAAc,EAAE,0BACtE,EAGF,QAAQ,IAAI,4CAA4C,EAAK,GAAG,EAGhE,MAAM,EAAY,CAChB,KAAM,GAAG,EAAK,SACd,UAAW,EAAK,EAAK,QAAQ,EAC7B,iBACA,SAAU,UACV,YACA,UAGA,cAAe,GAEf,QAAS,GACT,YAAa,GAMb,aAAc,aAChB,CAAC,EAGD,IAAM,EAAW,MAAM,EAAuB,EACxC,EAAgB,EAAS,2BAA6B,SAE5D,MAAM,EAAc,EAAK,EAAK,kBAAkB,EAAG,EAAe,EAAM,CAAa,CAAC,EACtF,MAAM,EAAc,EAAK,EAAK,oBAAoB,EAAG,EAAc,CAAC,EACpE,MAAM,EAAc,EAAK,EAAK,mBAAmB,EAAG,EAAY,CAAC,EACjE,MAAM,EAAc,EAAK,EAAK,gBAAgB,EAAG,EAAa,CAAI,CAAC,EACnE,MAAM,EAAc,EAAK,EAAK,kBAAkB,EAAG,EAAQ,CAAC,EAC5D,MAAM,EAAc,EAAK,EAAK,iBAAiB,EAAG,EAAO,CAAC,EAC1D,MAAM,EAAc,EAAK,EAAK,gBAAgB,EAAG,EAAO,CAAC,EAGzD,MAAM,EACJ,EAAK,EA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;;;;;;;;;;;CAeT,CAIA,SAAS,EAAgB,EAAc,EAAY,EAA4B,CAC7E,IAAM,EACJ,IAAO,OACH,CACE,IAAK,6BAEL,MAAO,mCACP,aAAc,6BACd,UAAW,0BACX,MAAO,oBAUP,UAAW,yDACb,EACA,CAIE,MAAO,gBAAgB,EAAG,YAC1B,aAAc,gBAAgB,EAAG,UACjC,UAAW,aAAa,EAAG,UAC3B,MAAO,GAAG,EAAG,uBAAuB,EAAG,gBACvC,eAAgB,gBAAgB,EAAG,YACnC,YAAa,aAAa,EAAG,YAU7B,UAAW,yDACb,EACN,MAAO,GAAG,KAAK,UACb,CACE,OACA,QAAS,GACT,QAAS,QACT,KAAM,SACN,UAIA,gBAAiB,CAAE,sBAAuB,CAAW,EACrD,WAAY,CAAC,SAAU,KAAK,CAC9B,EACA,KACA,CACF,EAAE,GACJ,CAEA,SAAS,GAAwB,CAC/B,MAAO;;;;;CAMT,CAEA,SAAS,EAAW,EAAc,EAAoB,CACpD,MAAO,KAAK,EAAK;;;;;;;;;;;;EAYjB,EAAG;EACH,IAAO,OAAS,oEAAsE,GAAG,EAAG,kCAAkC,EAAG,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DnK"}
|
|
1
|
+
{"version":3,"file":"fullstack-kj0NzeKU.mjs","names":[],"sources":["../src/generators/fullstack.ts"],"sourcesContent":["// `kick new --template fullstack` — a pnpm-workspace monorepo:\n//\n// my-app/\n// server/ KickJS API (the standard scaffold, minus its own git/install)\n// web/ Vite + React frontend typed end-to-end via\n// @forinda/kickjs-client + the server's generated KickRoutes.Api\n//\n// The type loop: server controllers use return-value handlers → `kick\n// typegen` (run here once, re-run by `kick dev`) emits\n// server/.kickjs/types/kick__client.d.ts → web tsconfig `types` (ambient)\n// side-effect-imports that file (type-only, erased at runtime) → the web\n// client calls `api.get('/hello')` with the handler's actual response type.\n\nimport { join } from 'node:path'\nimport { execFileSync } from 'node:child_process'\n\nimport { writeFileSafe } from '../utils/fs'\nimport { runCommand } from '../utils/shell'\nimport { initProject, resolveSiblingVersions } from './project'\n\nexport interface InitFullstackOptions {\n name: string\n directory: string\n packageManager?: 'pnpm' | 'npm' | 'yarn' | 'bun'\n initGit?: boolean\n installDeps?: boolean\n schemaLib?: 'zod' | 'valibot' | 'yup'\n runtime?: 'express' | 'fastify' | 'h3'\n}\n\nexport async function initFullstackProject(options: InitFullstackOptions): Promise<void> {\n const { name, directory, schemaLib = 'zod', runtime = 'express' } = options\n // `--pm` arrives as a free CLI string — allowlist before it reaches a\n // process invocation (execFileSync takes an argv array, no shell, but a\n // bogus binary name is still a confusing failure).\n const pmValid = (['pnpm', 'npm', 'yarn', 'bun'] as const).includes(\n options.packageManager as never,\n )\n const packageManager = pmValid\n ? (options.packageManager as 'pnpm' | 'npm' | 'yarn' | 'bun')\n : 'pnpm'\n const dir = directory\n const log = (msg: string) => console.log(` ${msg}`)\n if (options.packageManager !== undefined && !pmValid) {\n log(\n `Warning: unknown package manager '${String(options.packageManager)}' — falling back to pnpm.`,\n )\n }\n\n console.log(`\\n Creating fullstack KickJS workspace: ${name}\\n`)\n\n // ── server/ — the standard scaffold, deferred install/git ──────────\n await initProject({\n name: `${name}-server`,\n directory: join(dir, 'server'),\n packageManager,\n template: 'minimal',\n schemaLib,\n runtime,\n // web/ reads the resolved route map from the ambient KickClientApi\n // namespace, which needs the TS 7 compiler API to produce.\n withClientMap: true,\n // Root owns install + git so the lockfile/commit cover the workspace.\n initGit: false,\n installDeps: false,\n // Production single-origin serving. `web/` builds to `web/dist`, and\n // nothing served it before — `pnpm build` produced a frontend the API had\n // no way to hand out, so every deploy needed a hand-wired static host or\n // a second process. The adapter is inert until `../web/dist` exists, so\n // `dev` (Vite serves the client and proxies /api here) is untouched.\n spaClientDir: '../web/dist',\n })\n\n // ── web/ — Vite + React, typed client ──────────────────────────────\n const versions = await resolveSiblingVersions()\n const clientVersion = versions['@forinda/kickjs-client'] ?? '^0.1.0'\n\n await writeFileSafe(join(dir, 'web/package.json'), webPackageJson(name, clientVersion))\n await writeFileSafe(join(dir, 'web/vite.config.ts'), webViteConfig())\n await writeFileSafe(join(dir, 'web/tsconfig.json'), webTsConfig())\n await writeFileSafe(join(dir, 'web/index.html'), webIndexHtml(name))\n await writeFileSafe(join(dir, 'web/src/main.tsx'), webMain())\n await writeFileSafe(join(dir, 'web/src/App.tsx'), webApp())\n await writeFileSafe(join(dir, 'web/src/api.ts'), webApi())\n\n // ── workspace root ──────────────────────────────────────────────────\n await writeFileSafe(\n join(dir, 'package.json'),\n rootPackageJson(name, packageManager, versions['@forinda/kickjs-cli']),\n )\n // Only pnpm reads this file. npm / yarn / bun declare workspaces via the\n // `workspaces` field in the root package.json instead — see rootPackageJson.\n if (packageManager === 'pnpm') {\n // `allowBuilds` is answered here, not left to pnpm. This scaffold installs\n // non-interactively, so pnpm cannot prompt — it writes\n // `'@swc/core': set this to true or false` and then refuses to run ANY\n // script with ERR_PNPM_IGNORED_BUILDS, leaving a fresh project unable to\n // run `pnpm typecheck` or `pnpm dev` until someone edits this file.\n //\n // Both are build tools this template chose: swc compiles the decorators,\n // esbuild is Vite's. Approving their install scripts is the same decision\n // as depending on them.\n await writeFileSafe(\n join(dir, 'pnpm-workspace.yaml'),\n `packages:\\n - server\\n - web\\n\\nallowBuilds:\\n '@swc/core': true\\n esbuild: true\\n`,\n )\n }\n await writeFileSafe(join(dir, '.gitignore'), rootGitignore())\n await writeFileSafe(join(dir, 'README.md'), rootReadme(name, packageManager))\n\n // Workspace-root agent docs (CLAUDE.md + .agents/) flavored for the\n // fullstack layout — the server/ subdir keeps its own generated set.\n const { generateAgentDocs } = await import('./agent-docs')\n await generateAgentDocs({\n outDir: dir,\n name,\n pm: packageManager,\n template: 'fullstack',\n only: 'all',\n force: true,\n })\n\n // ── install (root — covers both workspace packages) ────────────────\n if (options.installDeps) {\n console.log(`\\n Installing workspace dependencies with ${packageManager}...\\n`)\n try {\n // `runCommand`, not bare execFileSync — on Windows every package\n // manager is a `.cmd` shim that execFileSync cannot spawn.\n runCommand(packageManager, ['install'], { cwd: dir })\n } catch {\n console.log(`\\n Warning: ${packageManager} install failed. Run it manually.`)\n }\n }\n\n // ── typegen (server) so web's KickRoutes.Api resolves immediately ──\n try {\n const { runTypegen } = await import('../typegen')\n await runTypegen({ cwd: join(dir, 'server'), allowDuplicates: true, silent: true })\n } catch {\n // Non-fatal — `kick dev` in server/ retries on boot.\n }\n\n // ── git (root) ──────────────────────────────────────────────────────\n if (options.initGit) {\n try {\n execFileSync('git', ['init'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['branch', '-M', 'main'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['add', '-A'], { cwd: dir, stdio: 'pipe' })\n execFileSync('git', ['commit', '-m', 'chore: initial commit from kick new (fullstack)'], {\n cwd: dir,\n stdio: 'pipe',\n })\n log('Git repository initialized')\n } catch {\n log('Warning: git init failed (git may not be installed)')\n }\n }\n\n console.log('\\n Fullstack workspace scaffolded!')\n console.log()\n log('Next steps:')\n log(` cd ${name}`)\n if (!options.installDeps) log(` ${packageManager} install`)\n if (packageManager === 'pnpm') {\n log(' pnpm dev # runs server (kick dev) + web (vite) together')\n } else {\n log(` ${packageManager} run dev:server # terminal 1`)\n log(` ${packageManager} run dev:web # terminal 2`)\n }\n log('')\n log('The web app calls the API through @forinda/kickjs-client —')\n log(\"edit server/src/modules/hello and watch web/src/App.tsx's types follow.\")\n log('')\n}\n\n// ── web templates ─────────────────────────────────────────────────────\n\nfunction webPackageJson(name: string, clientVersion: string): string {\n return `${JSON.stringify(\n {\n name: `${name}-web`,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts: {\n dev: 'vite',\n build: 'tsc --noEmit && vite build',\n preview: 'vite preview',\n typecheck: 'tsc --noEmit',\n },\n dependencies: {\n '@forinda/kickjs-client': clientVersion,\n react: '^19.0.0',\n 'react-dom': '^19.0.0',\n },\n devDependencies: {\n '@types/react': '^19.0.0',\n '@types/react-dom': '^19.0.0',\n '@vitejs/plugin-react': '^5.0.0',\n typescript: '^5.9.0',\n vite: '^7.0.0',\n },\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction webViteConfig(): string {\n return `import { defineConfig } from 'vite'\nimport react from '@vitejs/plugin-react'\n\nexport default defineConfig({\n plugins: [react()],\n server: {\n // The KickJS server (kick dev) listens on 3000; the client's baseUrl is\n // the relative '/api/v1', so the browser hits Vite and Vite forwards.\n proxy: {\n '/api': 'http://localhost:3000',\n },\n },\n})\n`\n}\n\nexport function webTsConfig(): string {\n return `${JSON.stringify(\n {\n compilerOptions: {\n target: 'ES2022',\n lib: ['ES2022', 'DOM', 'DOM.Iterable'],\n module: 'ESNext',\n moduleResolution: 'bundler',\n jsx: 'react-jsx',\n strict: true,\n skipLibCheck: true,\n noEmit: true,\n isolatedModules: true,\n // The resolved client route map, as an ambient global type package —\n // the same mechanism as \"node\" or \"vitest/globals\". It makes\n // `KickClientApi.Api` available with no import and no bridge file.\n //\n // Note this is a `types` ENTRY, not an `include`: the map is a global\n // type package, not source of this app. It also means the file must\n // exist — `kick new` runs typegen for you, and `kick typegen` in\n // server/ refreshes it. (An `include` entry tolerates the file being\n // absent; a `types` entry reports TS2688, which is the louder and\n // more useful failure for something the app depends on.)\n //\n // No `experimentalDecorators` here: unlike the ambient\n // `KickRoutes.Api` bridge, this map carries no reference to the\n // server's decorated controller sources.\n types: ['../server/.kickjs/types/kick__client'],\n },\n include: ['src'],\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction webIndexHtml(name: string): string {\n return `<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <title>${name}</title>\n </head>\n <body>\n <div id=\"root\"></div>\n <script type=\"module\" src=\"/src/main.tsx\"></script>\n </body>\n</html>\n`\n}\n\nfunction webMain(): string {\n return `import { StrictMode } from 'react'\nimport { createRoot } from 'react-dom/client'\nimport { App } from './App'\n\ncreateRoot(document.getElementById('root')!).render(\n <StrictMode>\n <App />\n </StrictMode>,\n)\n`\n}\n\nfunction webApp(): string {\n return `import { useEffect, useState } from 'react'\nimport { api } from './api'\n\n// The response types below are INFERRED from the server's handlers —\n// change server/src/modules/hello/hello.service.ts and these types follow on\n// the next \\`kick typegen\\`. Not under \\`kick dev\\`: resolving the client map\n// builds a whole TypeScript program, so it is a build step, not a per-save one.\ntype Greeting = Awaited<ReturnType<typeof fetchGreeting>>\n\nfunction fetchGreeting() {\n return api.get('/hello')\n}\n\nexport function App() {\n const [greeting, setGreeting] = useState<Greeting | null>(null)\n const [health, setHealth] = useState<string>('checking…')\n\n useEffect(() => {\n fetchGreeting().then(setGreeting).catch(console.error)\n api\n .get('/hello/health')\n .then((h) => setHealth(h.status))\n .catch(() => setHealth('down'))\n }, [])\n\n return (\n <main style={{ fontFamily: 'system-ui', maxWidth: 640, margin: '4rem auto', padding: '0 1rem' }}>\n <h1>KickJS fullstack</h1>\n <p>\n <strong>{greeting?.message ?? 'loading…'}</strong>\n </p>\n <p>\n Server said hello at <code>{greeting?.timestamp ?? '…'}</code> — health:{' '}\n <code>{health}</code>\n </p>\n <p style={{ color: '#666' }}>\n This call is typed end to end: <code>api.get('/hello')</code> returns the exact shape\n <code> HelloService.greet()</code> produces. Rename a field on the server and this file\n stops compiling.\n </p>\n </main>\n )\n}\n`\n}\n\nexport function webApi(): string {\n return `import { createClient } from '@forinda/kickjs-client'\n\n// KickClientApi is ambient — the resolved route map from\n// server/.kickjs/types/kick__client.d.ts, wired in tsconfig's \\`types\\`. Every\n// response type is a literal shape, so nothing from the server's source graph\n// enters this program.\n//\n// Keys are module-mount-relative paths; the bootstrap-level '/api/v1' prefix\n// lives here in baseUrl, and the Vite dev proxy forwards it to the KickJS\n// server.\n//\n// Prefer an explicit import? The same file exports the type:\n// import type { Api } from '../../server/.kickjs/types/kick__client'\nexport const api = createClient<KickClientApi.Api>({ baseUrl: '/api/v1' })\n`\n}\n\n// ── root templates ────────────────────────────────────────────────────\n\nfunction rootPackageJson(name: string, pm: string, cliVersion: string): string {\n const scripts: Record<string, string> =\n pm === 'pnpm'\n ? {\n dev: 'pnpm --parallel -r run dev',\n // One origin: the server serves `web/dist` through SpaAdapter.\n start: 'pnpm --filter ./server run start',\n 'dev:server': 'pnpm --filter ./server dev',\n 'dev:web': 'pnpm --filter ./web dev',\n build: 'pnpm -r run build',\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\n }\n : {\n // cd-based scripts — the one form npm, yarn (classic AND berry),\n // and bun all run identically; workspace-filter flags differ per\n // manager (--workspace vs `yarn workspace <name>` vs --filter).\n start: `cd server && ${pm} run start`,\n 'dev:server': `cd server && ${pm} run dev`,\n 'dev:web': `cd web && ${pm} run dev`,\n build: `${pm} run build:server && ${pm} run build:web`,\n 'build:server': `cd server && ${pm} run build`,\n 'build:web': `cd web && ${pm} run build`,\n // No `npx`: the binary is `kick` but the package is\n // `@forinda/kickjs-cli`, so npx cannot map one to the other and\n // falls back to the REGISTRY — where `kick` is an unrelated\n // AngularJS scaffolder. It runs, prints its own help, and exits 0,\n // so this script would pass without type-checking anything.\n //\n // Every package manager puts `node_modules/.bin` on PATH for\n // scripts, so the bare name resolves locally, and a missing install\n // fails loudly instead of fetching a stranger.\n typecheck: 'kick typecheck --cwd server && kick typecheck --cwd web',\n }\n return `${JSON.stringify(\n {\n name,\n private: true,\n version: '0.0.0',\n type: 'module',\n scripts,\n // The CLI is a ROOT dependency so the bare `kick` in the scripts above\n // resolves: package managers put `node_modules/.bin` on PATH for\n // scripts, and the CLI otherwise lives only in `server/node_modules`.\n devDependencies: { '@forinda/kickjs-cli': cliVersion },\n workspaces: ['server', 'web'],\n },\n null,\n 2,\n )}\\n`\n}\n\nfunction rootGitignore(): string {\n return `node_modules/\ndist/\n.env\n*.log\n.DS_Store\n`\n}\n\nfunction rootReadme(name: string, pm: string): string {\n return `# ${name}\n\nFullstack KickJS workspace — typed end to end.\n\n| Package | What |\n| --------- | ----------------------------------------------------------------- |\n| \\`server/\\` | KickJS API (decorators, DI, \\`kick dev\\` with typegen watch) |\n| \\`web/\\` | Vite + React, typed against the API via \\`@forinda/kickjs-client\\` |\n\n## Develop\n\n\\`\\`\\`bash\n${pm} install\n${pm === 'pnpm' ? 'pnpm dev # server (kick dev) + web (vite), in parallel' : `${pm} run dev:server # terminal 1\\n${pm} run dev:web # terminal 2`}\n\\`\\`\\`\n\nServer: http://localhost:3000 · Web: http://localhost:5173 (Vite proxies \\`/api\\`).\n\n## The type loop\n\n1. Server handlers **return** their payloads (\\`return this.service.greet(...)\\`).\n2. \\`kick typegen\\` emits \\`server/.kickjs/types/kick__client.d.ts\\` — the flat\n route map with every response type resolved to a literal shape.\n3. \\`web/tsconfig.json\\` lists that file in \\`types\\`, so \\`KickClientApi\\` is\n ambient — no import, no bridge file.\n4. \\`web/src/api.ts\\`'s \\`createClient<KickClientApi.Api>\\` types every call site.\n\nBecause the map holds resolved types rather than references to controllers,\n\\`web\\` never compiles server source: no \\`experimentalDecorators\\`, no path\naliases into \\`server/src\\`.\n\nRename a field in \\`server/src/modules/hello/hello.service.ts\\` → \\`web/src/App.tsx\\`\nstops compiling. That's the point.\n\n### Keeping the map fresh\n\n\\`server/.kickjs/types/kick__client.d.ts\\` is generated, and \\`web\\` reads it as\nan ambient type package. Two things follow.\n\n**It is not refreshed by \\`kick dev\\`.** Resolving it builds a whole TypeScript\nprogram over the server, which is a build-step cost rather than a per-save one,\nso a renamed response field surfaces on the next \\`kick typegen\\` rather than on\nsave. Everything else in \\`.kickjs/types\\` still updates on save. Add\n\\`kick typegen --check\\` to CI and a stale map fails the build.\n\n**It needs a compiler API.** TypeScript 7 ships none, so \\`server\\` depends on\n\\`@typescript/typescript6\\`. Remove it and typegen skips this one file, saying\nso; \\`web\\` then reports \\`TS2688\\` because the file it lists in \\`types\\` is gone.\n\n### The other way to wire it\n\nA \\`types\\` entry says \"this is a global type package\", which is what the map is,\nand it fails loudly when the file is missing. If you would rather it be quiet\nwhen absent — say, a repo where the map is not always generated — use\n\\`include\\` instead:\n\n\\`\\`\\`json\n{ \"include\": [\"src\", \"../server/.kickjs/types/kick__client.d.ts\"] }\n\\`\\`\\`\n\nThat tolerates the file not existing, at the cost of \\`KickClientApi\\` silently\nnot resolving. Note \\`types\\` replaces TypeScript's automatic \\`@types\\`\ninclusion, so if you add entries there, list the ones you rely on too\n(\\`\"types\": [\"node\", \"../server/.kickjs/types/kick__client\"]\\`).\n\nOr skip the global entirely — the same file exports the type:\n\n\\`\\`\\`ts\nimport type { Api } from '../../server/.kickjs/types/kick__client'\n\nexport const api = createClient<Api>({ baseUrl: '/api/v1' })\n\\`\\`\\`\n\nDocs: https://kickjs.app/guide/typed-client.html\n`\n}\n"],"mappings":";;;;;;;;;;uLA8BA,eAAsB,EAAqB,EAA8C,CACvF,GAAM,CAAE,OAAM,YAAW,YAAY,MAAO,UAAU,WAAc,EAI9D,EAAW,CAAC,OAAQ,MAAO,OAAQ,KAAK,CAAC,CAAW,SACxD,EAAQ,cACV,EACM,EAAiB,EAClB,EAAQ,eACT,OACE,EAAM,EACN,EAAO,GAAgB,QAAQ,IAAI,KAAK,GAAK,EAC/C,EAAQ,iBAAmB,IAAA,IAAa,CAAC,GAC3C,EACE,qCAAqC,OAAO,EAAQ,cAAc,EAAE,0BACtE,EAGF,QAAQ,IAAI,4CAA4C,EAAK,GAAG,EAGhE,MAAM,EAAY,CAChB,KAAM,GAAG,EAAK,SACd,UAAW,EAAK,EAAK,QAAQ,EAC7B,iBACA,SAAU,UACV,YACA,UAGA,cAAe,GAEf,QAAS,GACT,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AkC,EAAG,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8DnK"}
|
package/dist/index.d.mts
CHANGED
|
@@ -91,7 +91,7 @@ interface DoctorExtension {
|
|
|
91
91
|
* export default defineConfig({ doctor: prismaDoctor })
|
|
92
92
|
* ```
|
|
93
93
|
*/
|
|
94
|
-
declare function defineDoctorExtension(ext: DoctorExtension): DoctorExtension;
|
|
94
|
+
export declare function defineDoctorExtension(ext: DoctorExtension): DoctorExtension;
|
|
95
95
|
/**
|
|
96
96
|
* Identity helper for a single doctor check. Pairs with
|
|
97
97
|
* `defineDoctorExtension` when assembling an extension from separate
|
|
@@ -114,7 +114,7 @@ declare function defineDoctorExtension(ext: DoctorExtension): DoctorExtension;
|
|
|
114
114
|
* })
|
|
115
115
|
* ```
|
|
116
116
|
*/
|
|
117
|
-
declare function defineDoctorCheck(check: DoctorCheck): DoctorCheck;
|
|
117
|
+
export declare function defineDoctorCheck(check: DoctorCheck): DoctorCheck;
|
|
118
118
|
//#endregion
|
|
119
119
|
//#region src/plugin/types.d.ts
|
|
120
120
|
/** CLI plugin context with the host config narrowed to `KickConfig`. */
|
|
@@ -654,7 +654,7 @@ interface KickConfig {
|
|
|
654
654
|
doctor?: DoctorExtension;
|
|
655
655
|
}
|
|
656
656
|
/** Helper to define a type-safe kick.config.ts */
|
|
657
|
-
declare function defineConfig(config: KickConfig): KickConfig;
|
|
657
|
+
export declare function defineConfig(config: KickConfig): KickConfig;
|
|
658
658
|
/** Schema library a generated schema file is written against. */
|
|
659
659
|
type SchemaLib$1 = 'zod' | 'valibot' | 'yup';
|
|
660
660
|
/**
|
|
@@ -674,7 +674,7 @@ type SchemaLib$1 = 'zod' | 'valibot' | 'yup';
|
|
|
674
674
|
* silently dropping the config (which is what the previous bare-catch
|
|
675
675
|
* did).
|
|
676
676
|
*/
|
|
677
|
-
declare function loadKickConfig(startDir: string): Promise<KickConfig | null>;
|
|
677
|
+
export declare function loadKickConfig(startDir: string): Promise<KickConfig | null>;
|
|
678
678
|
//#endregion
|
|
679
679
|
//#region src/generators/templates/types.d.ts
|
|
680
680
|
/**
|
|
@@ -742,7 +742,7 @@ interface GenerateModuleOptions {
|
|
|
742
742
|
* rest — flat folder: controller + service + DTOs + repo (default)
|
|
743
743
|
* minimal — just controller + module index
|
|
744
744
|
*/
|
|
745
|
-
declare function generateModule(options: GenerateModuleOptions): Promise<string[]>;
|
|
745
|
+
export declare function generateModule(options: GenerateModuleOptions): Promise<string[]>;
|
|
746
746
|
//#endregion
|
|
747
747
|
//#region src/generators/adapter.d.ts
|
|
748
748
|
interface GenerateAdapterOptions {
|
|
@@ -765,7 +765,7 @@ interface GenerateAdapterOptions {
|
|
|
765
765
|
* absent for several releases, and adopters hand-rolled their own
|
|
766
766
|
* `/health/ready` instead of contributing to the built-in one.
|
|
767
767
|
*/
|
|
768
|
-
declare function generateAdapter(options: GenerateAdapterOptions): Promise<string[]>;
|
|
768
|
+
export declare function generateAdapter(options: GenerateAdapterOptions): Promise<string[]>;
|
|
769
769
|
//#endregion
|
|
770
770
|
//#region src/generators/middleware.d.ts
|
|
771
771
|
interface GenerateMiddlewareOptions {
|
|
@@ -784,7 +784,7 @@ interface GenerateMiddlewareOptions {
|
|
|
784
784
|
*/
|
|
785
785
|
runtime?: KickConfig['runtime'];
|
|
786
786
|
}
|
|
787
|
-
declare function generateMiddleware(options: GenerateMiddlewareOptions): Promise<string[]>;
|
|
787
|
+
export declare function generateMiddleware(options: GenerateMiddlewareOptions): Promise<string[]>;
|
|
788
788
|
//#endregion
|
|
789
789
|
//#region src/generators/guard.d.ts
|
|
790
790
|
interface GenerateGuardOptions {
|
|
@@ -795,7 +795,7 @@ interface GenerateGuardOptions {
|
|
|
795
795
|
pattern?: ProjectPattern;
|
|
796
796
|
pluralize?: boolean;
|
|
797
797
|
}
|
|
798
|
-
declare function generateGuard(options: GenerateGuardOptions): Promise<string[]>;
|
|
798
|
+
export declare function generateGuard(options: GenerateGuardOptions): Promise<string[]>;
|
|
799
799
|
//#endregion
|
|
800
800
|
//#region src/generators/service.d.ts
|
|
801
801
|
interface GenerateServiceOptions {
|
|
@@ -806,7 +806,7 @@ interface GenerateServiceOptions {
|
|
|
806
806
|
pattern?: ProjectPattern;
|
|
807
807
|
pluralize?: boolean;
|
|
808
808
|
}
|
|
809
|
-
declare function generateService(options: GenerateServiceOptions): Promise<string[]>;
|
|
809
|
+
export declare function generateService(options: GenerateServiceOptions): Promise<string[]>;
|
|
810
810
|
//#endregion
|
|
811
811
|
//#region src/generators/controller.d.ts
|
|
812
812
|
interface GenerateControllerOptions {
|
|
@@ -817,7 +817,7 @@ interface GenerateControllerOptions {
|
|
|
817
817
|
pattern?: ProjectPattern;
|
|
818
818
|
pluralize?: boolean;
|
|
819
819
|
}
|
|
820
|
-
declare function generateController(options: GenerateControllerOptions): Promise<string[]>;
|
|
820
|
+
export declare function generateController(options: GenerateControllerOptions): Promise<string[]>;
|
|
821
821
|
//#endregion
|
|
822
822
|
//#region src/generators/dto.d.ts
|
|
823
823
|
interface GenerateDtoOptions {
|
|
@@ -835,7 +835,7 @@ interface GenerateDtoOptions {
|
|
|
835
835
|
*/
|
|
836
836
|
schemaLib?: SchemaLib$1;
|
|
837
837
|
}
|
|
838
|
-
declare function generateDto(options: GenerateDtoOptions): Promise<string[]>;
|
|
838
|
+
export declare function generateDto(options: GenerateDtoOptions): Promise<string[]>;
|
|
839
839
|
//#endregion
|
|
840
840
|
//#region src/generators/project.d.ts
|
|
841
841
|
type ProjectTemplate = 'rest' | 'minimal';
|
|
@@ -859,7 +859,7 @@ interface InitProjectOptions {
|
|
|
859
859
|
withClientMap?: boolean;
|
|
860
860
|
}
|
|
861
861
|
/** Scaffold a new KickJS project */
|
|
862
|
-
declare function initProject(options: InitProjectOptions): Promise<void>;
|
|
862
|
+
export declare function initProject(options: InitProjectOptions): Promise<void>;
|
|
863
863
|
//#endregion
|
|
864
864
|
//#region src/utils/project-root.d.ts
|
|
865
865
|
/**
|
|
@@ -877,7 +877,7 @@ declare function initProject(options: InitProjectOptions): Promise<void>;
|
|
|
877
877
|
* land on the project root that owns the config, not on the nearest
|
|
878
878
|
* workspace package boundary in a monorepo.
|
|
879
879
|
*/
|
|
880
|
-
declare function findProjectRoot(startDir?: string): string;
|
|
880
|
+
export declare function findProjectRoot(startDir?: string): string;
|
|
881
881
|
//#endregion
|
|
882
882
|
//#region src/typegen/scanner.d.ts
|
|
883
883
|
/**
|
|
@@ -1316,7 +1316,7 @@ interface TypegenPluginResult {
|
|
|
1316
1316
|
* })
|
|
1317
1317
|
* ```
|
|
1318
1318
|
*/
|
|
1319
|
-
declare function defineTypegen(spec: TypegenPlugin): TypegenPlugin;
|
|
1319
|
+
export declare function defineTypegen(spec: TypegenPlugin): TypegenPlugin;
|
|
1320
1320
|
//#endregion
|
|
1321
1321
|
//#region src/typegen/token-conventions.d.ts
|
|
1322
1322
|
interface TokenConventionWarning {
|
|
@@ -1545,7 +1545,7 @@ declare function buildAssets(config: KickConfig | null, opts: BuildAssetsOptions
|
|
|
1545
1545
|
* Set by `kick dev` (which boots Vite in-process) so the vite plugin's
|
|
1546
1546
|
* own watcher never double-runs the pipeline.
|
|
1547
1547
|
*/
|
|
1548
|
-
declare const TYPEGEN_OWNER_KEY = "__kickjs_typegen_owner";
|
|
1548
|
+
export declare const TYPEGEN_OWNER_KEY = "__kickjs_typegen_owner";
|
|
1549
1549
|
type TypegenWatchEvent = 'add' | 'change' | 'unlink' | 'unlinkDir';
|
|
1550
1550
|
/** Injectable pipeline — production uses the real functions. */
|
|
1551
1551
|
interface TypegenDevPipeline {
|
|
@@ -1591,7 +1591,7 @@ interface TypegenDevWatcher {
|
|
|
1591
1591
|
/** Cancel any pending debounced pass. */
|
|
1592
1592
|
dispose(): void;
|
|
1593
1593
|
}
|
|
1594
|
-
declare function createTypegenDevWatcher(opts: TypegenDevWatcherOptions): TypegenDevWatcher;
|
|
1594
|
+
export declare function createTypegenDevWatcher(opts: TypegenDevWatcherOptions): TypegenDevWatcher;
|
|
1595
1595
|
//#endregion
|
|
1596
1596
|
//#region src/generator-extension/discover.d.ts
|
|
1597
1597
|
/**
|
|
@@ -1629,7 +1629,7 @@ interface DiscoveryResult {
|
|
|
1629
1629
|
* generator sees the same shape regardless of how the name was typed
|
|
1630
1630
|
* on the command line (`Post` vs `post` vs `user_post`).
|
|
1631
1631
|
*/
|
|
1632
|
-
declare function buildGeneratorContext(input: {
|
|
1632
|
+
export declare function buildGeneratorContext(input: {
|
|
1633
1633
|
name: string;
|
|
1634
1634
|
args?: string[];
|
|
1635
1635
|
flags?: Record<string, string | boolean>;
|
|
@@ -1647,17 +1647,17 @@ declare function buildGeneratorContext(input: {
|
|
|
1647
1647
|
//#endregion
|
|
1648
1648
|
//#region src/utils/naming.d.ts
|
|
1649
1649
|
/** Convert a name to PascalCase */
|
|
1650
|
-
declare function toPascalCase(name: string): string;
|
|
1650
|
+
export declare function toPascalCase(name: string): string;
|
|
1651
1651
|
/** Convert a name to camelCase */
|
|
1652
|
-
declare function toCamelCase(name: string): string;
|
|
1652
|
+
export declare function toCamelCase(name: string): string;
|
|
1653
1653
|
/** Convert a name to kebab-case */
|
|
1654
|
-
declare function toKebabCase(name: string): string;
|
|
1654
|
+
export declare function toKebabCase(name: string): string;
|
|
1655
1655
|
/**
|
|
1656
1656
|
* Pluralize a kebab-case name for directory/file names.
|
|
1657
1657
|
* Uses the `pluralize` npm package for correct English pluralization
|
|
1658
1658
|
* including irregulars (person → people, status → statuses, child → children).
|
|
1659
1659
|
*/
|
|
1660
|
-
declare function pluralize(name: string): string;
|
|
1660
|
+
export declare function pluralize(name: string): string;
|
|
1661
1661
|
//#endregion
|
|
1662
|
-
export { type DiscoveredGenerator, type DiscoveryResult, type DoctorCheck, type DoctorContext, type DoctorExtension, type DoctorResult, type GeneratorArg, type GeneratorContext, type GeneratorFile, type GeneratorFlag, type GeneratorSpec, type KickCliPlugin, type KickCliPluginContext, type KickCommandDefinition, type KickConfig, type KickDbConfigBlock, KickPluginConflictError,
|
|
1662
|
+
export { type DiscoveredGenerator, type DiscoveryResult, type DoctorCheck, type DoctorContext, type DoctorExtension, type DoctorResult, type GeneratorArg, type GeneratorContext, type GeneratorFile, type GeneratorFlag, type GeneratorSpec, type KickCliPlugin, type KickCliPluginContext, type KickCommandDefinition, type KickConfig, type KickDbConfigBlock, KickPluginConflictError, type TypegenContext, type TypegenDevWatcher, type TypegenDevWatcherOptions, type TypegenPlugin, type TypegenPluginResult, type TypegenWatchEvent, defineCliPlugin, defineGenerator };
|
|
1663
1663
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/commands/add.ts","../src/commands/doctor.ts","../src/plugin/types.ts","../src/config.ts","../src/generators/templates/types.ts","../src/generators/module.ts","../src/generators/adapter.ts","../src/generators/middleware.ts","../src/generators/guard.ts","../src/generators/service.ts","../src/generators/controller.ts","../src/generators/dto.ts","../src/generators/project.ts","../src/utils/project-root.ts","../src/typegen/scanner.ts","../src/typegen/plugin.ts","../src/typegen/token-conventions.ts","../src/typegen/index.ts","../src/typegen/run-plugins.ts","../src/asset-manager/build.ts","../src/typegen/dev-watcher.ts","../src/generator-extension/discover.ts","../src/generator-extension/context.ts","../src/utils/naming.ts"],"mappings":";;;;KA2OY;;;;;;;;;;;;;;;;;;;UChNK;EACf;EACA;;;;;;;EAOA;;;;;;EAMA,SAAS;;UAGM;;EAEf;EACA;;EAEA;;EAEA;;KAGU,eACV,KAAK,kBACF,eAAe,wBAAwB,QAAQ,eAAe;;;;;;UAOlD;;EAEf,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/commands/add.ts","../src/commands/doctor.ts","../src/plugin/types.ts","../src/config.ts","../src/generators/templates/types.ts","../src/generators/module.ts","../src/generators/adapter.ts","../src/generators/middleware.ts","../src/generators/guard.ts","../src/generators/service.ts","../src/generators/controller.ts","../src/generators/dto.ts","../src/generators/project.ts","../src/utils/project-root.ts","../src/typegen/scanner.ts","../src/typegen/plugin.ts","../src/typegen/token-conventions.ts","../src/typegen/index.ts","../src/typegen/run-plugins.ts","../src/asset-manager/build.ts","../src/typegen/dev-watcher.ts","../src/generator-extension/discover.ts","../src/generator-extension/context.ts","../src/utils/naming.ts"],"mappings":";;;;KA2OY;;;;;;;;;;;;;;;;;;;UChNK;EACf;EACA;;;;;;;EAOA;;;;;;EAMA,SAAS;;UAGM;;EAEf;EACA;;EAEA;;EAEA;;KAGU,eACV,KAAK,kBACF,eAAe,wBAAwB,QAAQ,eAAe;;;;;;UAOlD;;EAEf,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAqCK,sBAAsB,KAAK,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;wBA0B7C,kBAAkB,OAAO,cAAc;;;;KChG3C,uBAAuB,uBAAoB;;KAG3C,gBAAgB,gBAAa;;;;UC7BxB;;EAEf;;EAEA;;;;;;;;;EASA;;EAEA;;;KAIU;;KAGA;;;;;;;;;;;;;KAgBA;;UA0BK;EACf;;;KAIU,iBAAiB,oBAAkB;;;;;;;;;;;KAYnC;;;;;;UAOK;;;;;;;EAOf;;;;;;;EAOA;;;;;;EAMA;;;;;;;;;;;;;;;;;;;;;;EAsBA;;;;;;;;;;;;;;;;;;;;;;;;UAyBe;;;;;EAKf;;;;;EAKA;;EAEA;;;;;;;EAOA;;;;;;;EAOA,0BAA0B;;;UAIX;;;;;EAKf;;;;;EAKA;;;;;;;;;;;;;EAaA,kBAAkB;;;;;;;;;;EAUlB;;;;;;;;;;;;;;;;;;EAkBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgCA,mBAAmB;;;UAIJ;;EAEf;;;;;;;;EAQA;;;UAIe;;EAEf;;;;;;;;;;;;;;;;;;;;;;EAsBA,OAAO;;E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AA8B;EAC9B,oBAAoB;;UAGL;EACf;;EAEA,QAAQ;;;;;EAKR,cAAc;;;;;;EAMd;;EAEA;;EAEA,WAAW;;UAGI;;EAEf,iBAAiB,OAAO,mBAAmB;;;;;EAK3C;;;;;;EAMA;;EAEA;;wBAGc,wBAAwB,MAAM,2BAA2B;;;;;;;;UC3ExD;EACf;EACA,MAAM;;;;;;;UAQS;EACf,YAAY;;EAEZ;;;;;EAKA,QAAQ;IAAQ;IAAgB;;;;;;;;;;;wBCblB,sBAAsB;EACpC;EACA;EACA,QAAQ;EACR;EACA;;;;;;;EAOA;EACA;IACE;;;;wBC5BY,aAAa;;wBAOb,YAAY;;wBAMZ,YAAY;;;;;;wBAYZ,UAAU"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v8.1.
|
|
2
|
+
* @forinda/kickjs-cli v8.1.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/
|
|
11
|
-
import{A as e,M as t,N as n,P as r,S as i,_ as a,c as o,d as s,g as c,h as l,l as u,m as d,n as f,o as p,p as m,s as h,t as g,y as _}from"./doctor-
|
|
11
|
+
import{A as e,M as t,N as n,P as r,S as i,_ as a,c as o,d as s,g as c,h as l,l as u,m as d,n as f,o as p,p as m,s as h,t as g,y as _}from"./doctor-CtPbmFxW.mjs";import{t as v}from"./project-Dq4SdxF6.mjs";import{o as y,r as b}from"./config-BaIkyt4R.mjs";import{t as x}from"./project-root-BRMuHEs3.mjs";import{n as S,t as C}from"./types-D8Vtq4vL.mjs";export{C as KickPluginConflictError,o as TYPEGEN_OWNER_KEY,p as buildGeneratorContext,u as createTypegenDevWatcher,S as defineCliPlugin,b as defineConfig,g as defineDoctorCheck,f as defineDoctorExtension,h as defineGenerator,s as defineTypegen,x as findProjectRoot,_ as generateAdapter,d as generateController,m as generateDto,c as generateGuard,a as generateMiddleware,i as generateModule,l as generateService,v as initProject,y as loadKickConfig,e as pluralize,t as toCamelCase,n as toKebabCase,r as toPascalCase};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @forinda/kickjs-cli v8.1.7
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Felix Orinda
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
|
+
import"./types-D8Vtq4vL.mjs";import{r as e}from"./run-plugins-BYPm9bbY.mjs";export{e as mergeCliPlugins};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v8.1.
|
|
2
|
+
* @forinda/kickjs-cli v8.1.7
|
|
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-BAJI6YvG.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-D4iNxhPu.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};
|