@forinda/kickjs-cli 5.8.7 → 5.9.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-C3deMUsF.mjs → agent-docs-wxgO-e4t.mjs} +3 -3
- package/dist/{agent-docs-C3deMUsF.mjs.map → agent-docs-wxgO-e4t.mjs.map} +1 -1
- package/dist/{builtins-1ZYIel1L.mjs → builtins-D7wPBRuN.mjs} +2 -2
- package/dist/cli.mjs +48 -40
- package/dist/{config-Bo4xxPHs.mjs → config-BXTsAmnY.mjs} +3 -3
- package/dist/{config-Bo4xxPHs.mjs.map → config-BXTsAmnY.mjs.map} +1 -1
- package/dist/{generator-extension-D4D7ANu6.mjs → doctor-BX8eDq-O.mjs} +81 -73
- package/dist/doctor-BX8eDq-O.mjs.map +1 -0
- package/dist/index.d.mts +139 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{plugin-CGr3DJ01.mjs → plugin-C4EmAaDi.mjs} +3 -3
- package/dist/{plugin-CGr3DJ01.mjs.map → plugin-C4EmAaDi.mjs.map} +1 -1
- package/dist/{project-docs-B5xYM3MX.mjs → project-docs-CGn7Z7h9.mjs} +2 -2
- package/dist/{project-docs-B5xYM3MX.mjs.map → project-docs-CGn7Z7h9.mjs.map} +1 -1
- package/dist/{project-root-C8msA9Mw.mjs → project-root-DFhXihBq.mjs} +3 -3
- package/dist/{project-root-C8msA9Mw.mjs.map → project-root-DFhXihBq.mjs.map} +1 -1
- package/dist/{rolldown-runtime-BMnC1RSc.mjs → rolldown-runtime-DEdkb7-k.mjs} +1 -1
- package/dist/{run-plugins-BiLXFAaa.mjs → run-plugins-CPnfwUUk.mjs} +74 -74
- package/dist/{run-plugins-BiLXFAaa.mjs.map → run-plugins-CPnfwUUk.mjs.map} +1 -1
- package/dist/{typegen-CL2GzEgc.mjs → typegen-C6c4B6mA.mjs} +4 -4
- package/dist/{typegen-CL2GzEgc.mjs.map → typegen-C6c4B6mA.mjs.map} +1 -1
- package/dist/{types-BtdFlcP3.mjs → types-BhbgPiYM.mjs} +2 -2
- package/dist/{types-BtdFlcP3.mjs.map → types-BhbgPiYM.mjs.map} +1 -1
- package/package.json +4 -4
- package/dist/generator-extension-D4D7ANu6.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,106 @@
|
|
|
1
1
|
|
|
2
2
|
import { Command } from "commander";
|
|
3
3
|
|
|
4
|
+
//#region src/commands/doctor.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* `kick doctor` — pre-flight checks for a KickJS project's dev
|
|
7
|
+
* environment. Detects common misconfigs before they bite, with an
|
|
8
|
+
* actionable fix hint for each problem.
|
|
9
|
+
*
|
|
10
|
+
* Sibling command to `kick check --deploy`, which scans for production
|
|
11
|
+
* readiness (JWT, CORS, helmet, etc.). Doctor is the dev-setup
|
|
12
|
+
* counterpart — "is my environment correctly wired?"
|
|
13
|
+
*
|
|
14
|
+
* Extending: adopters can ship their own checks by exporting a
|
|
15
|
+
* `doctor.checks` array from `kick.config.ts`. Each {@link DoctorCheck}
|
|
16
|
+
* receives the same {@link DoctorContext} the built-ins use and
|
|
17
|
+
* returns one or more {@link DoctorResult}s. The framework stays
|
|
18
|
+
* ORM-agnostic — Prisma / Drizzle / Mongoose-specific checks belong
|
|
19
|
+
* in their respective adapters or in adopter config, not in core.
|
|
20
|
+
*/
|
|
21
|
+
interface DoctorContext {
|
|
22
|
+
cwd: string;
|
|
23
|
+
pkg: any | null;
|
|
24
|
+
tsconfig: any | null;
|
|
25
|
+
}
|
|
26
|
+
interface DoctorResult {
|
|
27
|
+
/** Short label for the check (printed first). */
|
|
28
|
+
name: string;
|
|
29
|
+
status: 'pass' | 'warn' | 'fail';
|
|
30
|
+
/** Optional extra context after the label (e.g. resolved version). */
|
|
31
|
+
message?: string;
|
|
32
|
+
/** Multi-line actionable fix shown when status is `warn` or `fail`. */
|
|
33
|
+
fix?: string;
|
|
34
|
+
}
|
|
35
|
+
type DoctorCheck = (ctx: DoctorContext) => DoctorResult | DoctorResult[] | null | Promise<DoctorResult | DoctorResult[] | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Shape of a doctor extension — the `doctor` block on `KickConfig`,
|
|
38
|
+
* also the publishable unit that plugins and shared modules use to
|
|
39
|
+
* ship a bundle of related checks.
|
|
40
|
+
*/
|
|
41
|
+
interface DoctorExtension {
|
|
42
|
+
/** Extra checks merged after the built-ins. */
|
|
43
|
+
checks?: DoctorCheck[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Identity helper for adopters / plugins authoring a doctor extension.
|
|
47
|
+
*
|
|
48
|
+
* Provides type inference + autocomplete on the `checks` array without
|
|
49
|
+
* requiring an explicit `: DoctorExtension` annotation. Mirrors the
|
|
50
|
+
* `defineConfig` pattern.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* // doctor-checks/prisma.ts (shared across projects, or shipped as a
|
|
55
|
+
* // standalone package)
|
|
56
|
+
* import { defineDoctorExtension } from '@forinda/kickjs-cli'
|
|
57
|
+
* import { existsSync } from 'node:fs'
|
|
58
|
+
* import { join } from 'node:path'
|
|
59
|
+
*
|
|
60
|
+
* export const prismaDoctor = defineDoctorExtension({
|
|
61
|
+
* checks: [
|
|
62
|
+
* (ctx) => {
|
|
63
|
+
* if (!existsSync(join(ctx.cwd, 'prisma/schema.prisma'))) return null
|
|
64
|
+
* const generated = join(ctx.cwd, 'node_modules/@prisma/client/default.js')
|
|
65
|
+
* return existsSync(generated)
|
|
66
|
+
* ? { name: 'Prisma client generated', status: 'pass' }
|
|
67
|
+
* : { name: 'Prisma client generated', status: 'fail', fix: 'pnpm exec prisma generate' }
|
|
68
|
+
* },
|
|
69
|
+
* ],
|
|
70
|
+
* })
|
|
71
|
+
*
|
|
72
|
+
* // kick.config.ts
|
|
73
|
+
* import { defineConfig } from '@forinda/kickjs-cli'
|
|
74
|
+
* import { prismaDoctor } from './doctor-checks/prisma'
|
|
75
|
+
*
|
|
76
|
+
* export default defineConfig({ doctor: prismaDoctor })
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
declare function defineDoctorExtension(ext: DoctorExtension): DoctorExtension;
|
|
80
|
+
/**
|
|
81
|
+
* Identity helper for a single doctor check. Pairs with
|
|
82
|
+
* `defineDoctorExtension` when assembling an extension from separate
|
|
83
|
+
* per-check files, and gives the same type-inference win for one-offs.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* import { defineDoctorCheck } from '@forinda/kickjs-cli'
|
|
88
|
+
*
|
|
89
|
+
* export const checkJwtSecretLength = defineDoctorCheck((ctx) => {
|
|
90
|
+
* const v = process.env.JWT_SECRET
|
|
91
|
+
* if (!v || v.length < 32) {
|
|
92
|
+
* return {
|
|
93
|
+
* name: 'JWT_SECRET ≥ 32 chars',
|
|
94
|
+
* status: 'warn',
|
|
95
|
+
* fix: 'Generate a strong secret: openssl rand -hex 32',
|
|
96
|
+
* }
|
|
97
|
+
* }
|
|
98
|
+
* return { name: 'JWT_SECRET ≥ 32 chars', status: 'pass' }
|
|
99
|
+
* })
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
declare function defineDoctorCheck(check: DoctorCheck): DoctorCheck;
|
|
103
|
+
//#endregion
|
|
4
104
|
//#region src/typegen/scanner.d.ts
|
|
5
105
|
/**
|
|
6
106
|
* Static scanner for KickJS decorated classes and DI tokens.
|
|
@@ -29,7 +129,7 @@ import { Command } from "commander";
|
|
|
29
129
|
* @module @forinda/kickjs-cli/typegen/scanner
|
|
30
130
|
*/
|
|
31
131
|
/** Decorators that mark a class as DI-managed */
|
|
32
|
-
declare const DECORATOR_NAMES: readonly [
|
|
132
|
+
declare const DECORATOR_NAMES: readonly ['Service', 'Controller', 'Repository', 'Injectable', 'Component', 'Module'];
|
|
33
133
|
type DecoratorName = (typeof DECORATOR_NAMES)[number];
|
|
34
134
|
/** A single discovered decorated class */
|
|
35
135
|
interface DiscoveredClass {
|
|
@@ -959,6 +1059,43 @@ interface KickConfig {
|
|
|
959
1059
|
trailingComma?: 'all' | 'es5' | 'none';
|
|
960
1060
|
indent?: number;
|
|
961
1061
|
};
|
|
1062
|
+
/**
|
|
1063
|
+
* Extensibility hook for `kick doctor`. Adopters add their own
|
|
1064
|
+
* environment / project-shape checks here; each function receives
|
|
1065
|
+
* the same context the built-in checks see and returns a result (or
|
|
1066
|
+
* `null` to skip).
|
|
1067
|
+
*
|
|
1068
|
+
* The framework stays ORM- and stack-agnostic — Prisma-specific,
|
|
1069
|
+
* Drizzle-specific, deploy-target-specific checks belong in adopter
|
|
1070
|
+
* config (or in adapter packages that ship doctor extensions),
|
|
1071
|
+
* never in core.
|
|
1072
|
+
*
|
|
1073
|
+
* @example
|
|
1074
|
+
* ```ts
|
|
1075
|
+
* import { existsSync } from 'node:fs'
|
|
1076
|
+
* import { join } from 'node:path'
|
|
1077
|
+
* import { defineConfig } from '@forinda/kickjs-cli'
|
|
1078
|
+
*
|
|
1079
|
+
* export default defineConfig({
|
|
1080
|
+
* doctor: {
|
|
1081
|
+
* checks: [
|
|
1082
|
+
* (ctx) => {
|
|
1083
|
+
* if (!existsSync(join(ctx.cwd, 'prisma/schema.prisma'))) return null
|
|
1084
|
+
* const generated = join(ctx.cwd, 'node_modules/@prisma/client/default.js')
|
|
1085
|
+
* return existsSync(generated)
|
|
1086
|
+
* ? { name: 'Prisma client generated', status: 'pass' }
|
|
1087
|
+
* : {
|
|
1088
|
+
* name: 'Prisma client generated',
|
|
1089
|
+
* status: 'fail',
|
|
1090
|
+
* fix: 'Run: pnpm exec prisma generate',
|
|
1091
|
+
* }
|
|
1092
|
+
* },
|
|
1093
|
+
* ],
|
|
1094
|
+
* },
|
|
1095
|
+
* })
|
|
1096
|
+
* ```
|
|
1097
|
+
*/
|
|
1098
|
+
doctor?: DoctorExtension;
|
|
962
1099
|
}
|
|
963
1100
|
/** Helper to define a type-safe kick.config.ts */
|
|
964
1101
|
declare function defineConfig(config: KickConfig): KickConfig;
|
|
@@ -1186,5 +1323,5 @@ declare function toKebabCase(name: string): string;
|
|
|
1186
1323
|
*/
|
|
1187
1324
|
declare function pluralize(name: string): string;
|
|
1188
1325
|
//#endregion
|
|
1189
|
-
export { type DiscoveredGenerator, type DiscoveryResult, type GeneratorArg, type GeneratorContext, type GeneratorFile, type GeneratorFlag, type GeneratorSpec, type KickCliPlugin, type KickCliPluginContext, type KickCommandDefinition, type KickConfig, type KickDbConfigBlock, KickPluginConflictError, type TypegenContext, type TypegenPlugin, type TypegenPluginResult, buildGeneratorContext, defineCliPlugin, defineConfig, defineGenerator, defineTypegen, findProjectRoot, generateAdapter, generateController, generateDto, generateGuard, generateMiddleware, generateModule, generateService, initProject, loadKickConfig, pluralize, toCamelCase, toKebabCase, toPascalCase };
|
|
1326
|
+
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 TypegenPlugin, type TypegenPluginResult, buildGeneratorContext, defineCliPlugin, defineConfig, defineDoctorCheck, defineDoctorExtension, defineGenerator, defineTypegen, findProjectRoot, generateAdapter, generateController, generateDto, generateGuard, generateMiddleware, generateModule, generateService, initProject, loadKickConfig, pluralize, toCamelCase, toKebabCase, toPascalCase };
|
|
1190
1327
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/typegen/scanner.ts","../src/typegen/plugin.ts","../src/generator-extension/define.ts","../src/generator-extension/discover.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/generator-extension/context.ts","../src/utils/naming.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/commands/doctor.ts","../src/typegen/scanner.ts","../src/typegen/plugin.ts","../src/generator-extension/define.ts","../src/generator-extension/discover.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/generator-extension/context.ts","../src/utils/naming.ts"],"mappings":";;;;;;AA0BA;;;;;;;;AAGU;AAGV;;;;;UANiB,aAAA;EACf,GAAA;EACA,GAAA;EACA,QAAA;AAAA;AAAA,UAGe,YAAA;EAUM;EARrB,IAAA;EACA,MAAA;EASG;EAPH,OAAA;EAOkD;EALlD,GAAA;AAAA;AAAA,KAGU,WAAA,IACV,GAAA,EAAK,aAAA,KACF,YAAA,GAAe,YAAA,YAAwB,OAAA,CAAQ,YAAA,GAAe,YAAA;;;;;;UAOlD,eAAA;EAPmC;EASlD,MAAA,GAAS,WAAW;AAAA;AATyD;AAO/E;;;;AAEsB;AAqCtB;;;;;;;;AAA4E;AA0B5E;;;;;;;;AAAkE;;;;ACpFlE;;;;AAOU;AAEV;;ADG+E,iBA8C/D,qBAAA,CAAsB,GAAA,EAAK,eAAA,GAAkB,eAAe;;ACjDzB;AAGnD;;;;;;;;;;;AAUW;AAIX;;;;;;;;iBD0DgB,iBAAA,CAAkB,KAAA,EAAO,WAAA,GAAc,WAAW;;;;;;AA1FlE;;;;;;;;AAGU;AAGV;;;;;;;;;AAOK;AAGL;;;;;cCVa,eAAA;AAAA,KASD,aAAA,WAAwB,eAAe;;UAGlC,eAAA;EDAkC;ECEjD,SA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EACA,UAAA;EACA,UAAA;EACA,OAAA,GAAU,cAAc;EACxB,SAAA;AAAA;AAAA,iBAGoB,kBAAA,CAAmB,OAAA,EAAS,yBAAA,GAA4B,OAAO;;;UCT3E,kBAAA;EACR,IAAA;EACA,MAAA;EACA,UAAA;EACA,UAAA;EACA,OAAA,GAAU,cAAc;EACxB,SAAA;AAAA;AAAA,iBAGoB,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,OAAO;;;KCuElE,eAAA;AAAA,UAEK,kBAAA;EACR,IAAA;EACA,SAAA;EACA,cAAA;EACA,OAAA;EACA,WAAA;EACA,QAAA,GAAW,eAAe;EAC1B,WAAA;EACA,QAAA;AAAA;AfnEQ;AAAA,iBeuEY,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,OAAO;;;;;;Af1EvE;;;;;;;;AAGU;AAGV;;;iBgBZgB,eAAA,CAAgB,QAAgC;;;;;AhBMhE;;;;iBiBTgB,qBAAA,CAAsB,KAAA;EACpC,IAAA;EACA,IAAA;EACA,KAAA,GAAQ,MAAA;EACR,UAAA;EACA,GAAA;EjBU2B;;;;;;EiBH3B,WAAA;EACA,SAAA;AAAA,IACE,gBAAgB;;;;iBC5BJ,YAAA,CAAa,IAAY;;iBAOzB,WAAA,CAAY,IAAY;;iBAMxB,WAAA,CAAY,IAAY;;;;;;iBAYxB,SAAA,CAAU,IAAY"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v5.
|
|
2
|
+
* @forinda/kickjs-cli v5.9.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{
|
|
11
|
+
import{C as e,S as t,_ as n,b as r,c as i,d as a,f as o,l as s,m as c,n as l,o as u,p as d,s as f,t as p,u as m,w as h}from"./doctor-BX8eDq-O.mjs";import{i as g,r as _}from"./config-BXTsAmnY.mjs";import{t as v}from"./project-root-DFhXihBq.mjs";import{n as y,t as b}from"./types-BhbgPiYM.mjs";function x(e){return e}export{b as KickPluginConflictError,u as buildGeneratorContext,y as defineCliPlugin,_ as defineConfig,p as defineDoctorCheck,l as defineDoctorExtension,f as defineGenerator,x as defineTypegen,v as findProjectRoot,c as generateAdapter,m as generateController,s as generateDto,o as generateGuard,d as generateMiddleware,n as generateModule,a as generateService,i as initProject,g as loadKickConfig,r as pluralize,t as toCamelCase,e as toKebabCase,h as toPascalCase};
|
|
12
12
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/typegen/plugin.ts"],"sourcesContent":["// TypegenPlugin contract — M2.B-T7.\n//\n// Each plugin owns a single `.kickjs/types/<id>.d.ts` file. The runner\n// invokes `generate(ctx)` per plugin, prepends a banner, writes only on\n// content change, and surfaces drift in --check mode (CI gate).\n//\n// Built-in plugins (kick/routes, kick/env, kick/assets, kick/db) live under\n// `./builtin`. Adopters register additional plugins via kick.config.ts.\n\nimport type { KickConfig } from '../config'\nimport type { ScanOptions, ScanResult } from './scanner'\n\nexport interface TypegenLogger {\n info(msg: string): void\n warn(msg: string): void\n error(msg: string): void\n}\n\nexport interface TypegenContext {\n cwd: string\n config: KickConfig\n /** Dynamic-import a TS module (Node loader). Used by plugins that need to\n * read the adopter's schema / route map / asset registry at generate time. */\n importTs<T = unknown>(absPath: string): Promise<T>\n /** Write under `cwd`. Caller passes a relPath (e.g. `.kickjs/types/foo.d.ts`). */\n writeFile(relPath: string, contents: string): Promise<void>\n /**\n * Run `scanProject` once per typegen pass, memoizing the result so\n * multiple plugins (`kick/routes`, `kick/env`, future adopter plugins)\n * share a single fs walk + AST extraction.\n *\n * The runner uses an order-independent cache key derived from the\n * resolved options (`root`, `cwd`, `extensions`, `exclude`, `envFile`)\n * — semantically equal options hit the cache regardless of how the\n * caller built the literal. (We deliberately don't `JSON.stringify`\n * the options for caching since that would be sensitive to property\n * insertion order.) Plugins that don't need scanner data can ignore\n * this method entirely.\n *\n * Implementation lives in the runner so test harnesses can inject\n * a stub scanner; plugins only see the function.\n */\n getScanResult(opts: ScanOptions): Promise<ScanResult>\n log: TypegenLogger\n}\n\nexport interface TypegenPlugin {\n /** Stable id — used as filename: `.kickjs/types/${id}<outExtension>` (slashes → `__`). */\n id: string\n /** Glob patterns the Vite watcher subscribes to; change → re-run this plugin. */\n inputs: string[]\n /**\n * Output filename extension. Default `.d.ts` — the right choice for\n * pure module-augmentation plugins (kick/db, kick/assets) since\n * declaration files don't need the runtime-import dance.\n *\n * `kick/routes` overrides to `.ts` because it emits hoisted\n * `import type {...} from '...'` lines at the top of the file. Inline\n * `import('...').X` references inside `.d.ts` silently degrade to\n * `unknown` under `moduleResolution: 'bundler'`; emitting `.ts`\n * sidesteps that quirk and gets full type resolution.\n *\n * Adopter-supplied plugins should leave this unset unless they hit\n * the same hoisted-import constraint.\n */\n outExtension?: string\n /**\n * Return the augmentation source (without banner — runner prepends).\n * Return null to skip emission (e.g. no schema file present).\n */\n generate(ctx: TypegenContext): Promise<string | null>\n}\n\nexport interface TypegenPluginResult {\n id: string\n status: 'written' | 'unchanged' | 'skipped'\n outFile?: string\n}\n\n/**\n * Identity factory for {@link TypegenPlugin}. Returns the spec verbatim.\n * Exists for type inference and forward-compatibility — future\n * fields can be added with defaults without breaking adopters.\n *\n * Mirrors {@link defineGenerator} ergonomics. Use at the call site so\n * the plugin's `generate(ctx)` body gets a fully-typed `ctx` without\n * an explicit annotation:\n *\n * @example\n * ```ts\n * import { defineTypegen } from '@forinda/kickjs-cli'\n *\n * export const drizzleTypegen = defineTypegen({\n * id: 'drizzle',\n * inputs: ['src/db/schema.ts'],\n * async generate(ctx) {\n * const schema = await ctx.importTs(`${ctx.cwd}/src/db/schema.ts`)\n * return `// declare module …`\n * },\n * })\n * ```\n */\nexport function defineTypegen(spec: TypegenPlugin): TypegenPlugin {\n return spec\n}\n"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/typegen/plugin.ts"],"sourcesContent":["// TypegenPlugin contract — M2.B-T7.\n//\n// Each plugin owns a single `.kickjs/types/<id>.d.ts` file. The runner\n// invokes `generate(ctx)` per plugin, prepends a banner, writes only on\n// content change, and surfaces drift in --check mode (CI gate).\n//\n// Built-in plugins (kick/routes, kick/env, kick/assets, kick/db) live under\n// `./builtin`. Adopters register additional plugins via kick.config.ts.\n\nimport type { KickConfig } from '../config'\nimport type { ScanOptions, ScanResult } from './scanner'\n\nexport interface TypegenLogger {\n info(msg: string): void\n warn(msg: string): void\n error(msg: string): void\n}\n\nexport interface TypegenContext {\n cwd: string\n config: KickConfig\n /** Dynamic-import a TS module (Node loader). Used by plugins that need to\n * read the adopter's schema / route map / asset registry at generate time. */\n importTs<T = unknown>(absPath: string): Promise<T>\n /** Write under `cwd`. Caller passes a relPath (e.g. `.kickjs/types/foo.d.ts`). */\n writeFile(relPath: string, contents: string): Promise<void>\n /**\n * Run `scanProject` once per typegen pass, memoizing the result so\n * multiple plugins (`kick/routes`, `kick/env`, future adopter plugins)\n * share a single fs walk + AST extraction.\n *\n * The runner uses an order-independent cache key derived from the\n * resolved options (`root`, `cwd`, `extensions`, `exclude`, `envFile`)\n * — semantically equal options hit the cache regardless of how the\n * caller built the literal. (We deliberately don't `JSON.stringify`\n * the options for caching since that would be sensitive to property\n * insertion order.) Plugins that don't need scanner data can ignore\n * this method entirely.\n *\n * Implementation lives in the runner so test harnesses can inject\n * a stub scanner; plugins only see the function.\n */\n getScanResult(opts: ScanOptions): Promise<ScanResult>\n log: TypegenLogger\n}\n\nexport interface TypegenPlugin {\n /** Stable id — used as filename: `.kickjs/types/${id}<outExtension>` (slashes → `__`). */\n id: string\n /** Glob patterns the Vite watcher subscribes to; change → re-run this plugin. */\n inputs: string[]\n /**\n * Output filename extension. Default `.d.ts` — the right choice for\n * pure module-augmentation plugins (kick/db, kick/assets) since\n * declaration files don't need the runtime-import dance.\n *\n * `kick/routes` overrides to `.ts` because it emits hoisted\n * `import type {...} from '...'` lines at the top of the file. Inline\n * `import('...').X` references inside `.d.ts` silently degrade to\n * `unknown` under `moduleResolution: 'bundler'`; emitting `.ts`\n * sidesteps that quirk and gets full type resolution.\n *\n * Adopter-supplied plugins should leave this unset unless they hit\n * the same hoisted-import constraint.\n */\n outExtension?: string\n /**\n * Return the augmentation source (without banner — runner prepends).\n * Return null to skip emission (e.g. no schema file present).\n */\n generate(ctx: TypegenContext): Promise<string | null>\n}\n\nexport interface TypegenPluginResult {\n id: string\n status: 'written' | 'unchanged' | 'skipped'\n outFile?: string\n}\n\n/**\n * Identity factory for {@link TypegenPlugin}. Returns the spec verbatim.\n * Exists for type inference and forward-compatibility — future\n * fields can be added with defaults without breaking adopters.\n *\n * Mirrors {@link defineGenerator} ergonomics. Use at the call site so\n * the plugin's `generate(ctx)` body gets a fully-typed `ctx` without\n * an explicit annotation:\n *\n * @example\n * ```ts\n * import { defineTypegen } from '@forinda/kickjs-cli'\n *\n * export const drizzleTypegen = defineTypegen({\n * id: 'drizzle',\n * inputs: ['src/db/schema.ts'],\n * async generate(ctx) {\n * const schema = await ctx.importTs(`${ctx.cwd}/src/db/schema.ts`)\n * return `// declare module …`\n * },\n * })\n * ```\n */\nexport function defineTypegen(spec: TypegenPlugin): TypegenPlugin {\n return spec\n}\n"],"mappings":";;;;;;;;;;oSAsGA,SAAgB,EAAc,EAAoC,CAChE,OAAO,CACT"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v5.
|
|
2
|
+
* @forinda/kickjs-cli v5.9.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-DEdkb7-k.mjs";import{t}from"./types-BhbgPiYM.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-DFhXihBq.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-C4EmAaDi.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-
|
|
1
|
+
{"version":3,"file":"plugin-C4EmAaDi.mjs","names":[],"sources":["../src/plugin/merge.ts","../src/plugin/index.ts"],"sourcesContent":["// Plugin → unified registry merge.\n//\n// Resolution rules (per the v1 spec + dogfood pivot):\n// - duplicate plugin `name` across the input array → conflict error.\n// Catches the double-install case (built-in shipped twice, or\n// adopter requiring the same plugin twice).\n// - plugin commands appear first in the merged list, then adopter\n// commands; adopter `commands` of the same name override the\n// plugin entry (filter pass).\n// - duplicate command name across two plugins → conflict error\n// listing both plugin names. Adopter overriding a plugin is\n// allowed and not an error.\n// - duplicate typegen id across two plugins → same error. Typegens\n// have no adopter override path; only plugins contribute them.\n// - register() functions are collected in input order; the caller\n// invokes each one against the same Command program. They have no\n// id-level conflict surface — owners are responsible for picking\n// non-colliding command names inside their own register().\n// - plugin order = array order. No implicit precedence rules.\n\nimport type { Command } from 'commander'\n\nimport type { KickCommandDefinition } from '../config'\nimport type { TypegenPlugin } from '../typegen/plugin'\nimport type { GeneratorSpec } from '../generator-extension/define'\nimport type { DiscoveredGenerator } from '../generator-extension/discover'\nimport { KickPluginConflictError, type KickCliPlugin, type KickCliPluginContext } from './types'\n\nexport interface MergedPlugins {\n commands: KickCommandDefinition[]\n typegens: TypegenPlugin[]\n /** DiscoveredGenerator shape so this list slots into the existing\n * dispatch path next to package.json-discovered entries. `source`\n * carries the plugin name for error attribution. */\n generators: DiscoveredGenerator[]\n /**\n * Apply every plugin's register() in input order. ctx is optional so\n * tests + lightweight callers can invoke `register(program)` without\n * constructing a full context; it falls back to cwd=process.cwd(),\n * config=null, log=no-op.\n */\n register: (program: Command, ctx?: KickCliPluginContext) => Promise<void>\n}\n\nexport function mergeCliPlugins(\n plugins: readonly KickCliPlugin[],\n adopterCommands: readonly KickCommandDefinition[] = [],\n): MergedPlugins {\n // Plugin-name dedup — catches double-install.\n const seenPluginNames = new Map<string, number>()\n for (const p of plugins) {\n const count = (seenPluginNames.get(p.name) ?? 0) + 1\n seenPluginNames.set(p.name, count)\n if (count === 2) {\n throw new KickPluginConflictError('plugin', p.name, [p.name, p.name])\n }\n }\n\n const commandOwners = new Map<string, string>()\n const pluginCommands: KickCommandDefinition[] = []\n for (const p of plugins) {\n for (const cmd of p.commands ?? []) {\n const prior = commandOwners.get(cmd.name)\n if (prior) {\n throw new KickPluginConflictError('command', cmd.name, [prior, p.name])\n }\n commandOwners.set(cmd.name, p.name)\n pluginCommands.push(cmd)\n }\n }\n\n const adopterNames = new Set(adopterCommands.map((c) => c.name))\n const filteredPlugin = pluginCommands.filter((c) => !adopterNames.has(c.name))\n const commands = [...filteredPlugin, ...adopterCommands]\n\n const typegenOwners = new Map<string, string>()\n const typegens: TypegenPlugin[] = []\n for (const p of plugins) {\n for (const tg of p.typegens ?? []) {\n const prior = typegenOwners.get(tg.id)\n if (prior) {\n throw new KickPluginConflictError('typegen', tg.id, [prior, p.name])\n }\n typegenOwners.set(tg.id, p.name)\n typegens.push(tg)\n }\n }\n\n const generatorOwners = new Map<string, string>()\n const generators: DiscoveredGenerator[] = []\n for (const p of plugins) {\n for (const spec of p.generators ?? []) {\n const prior = generatorOwners.get(spec.name)\n if (prior) {\n throw new KickPluginConflictError('generator', spec.name, [prior, p.name])\n }\n generatorOwners.set(spec.name, p.name)\n generators.push({ source: p.name, spec: spec satisfies GeneratorSpec })\n }\n }\n\n /**\n * Apply every plugin's `register()` callback in input order against the\n * given Commander program. Each callback receives a {@link KickCliPluginContext}:\n * caller-supplied ctx wins (test fixtures can inject a different\n * workspace boundary); otherwise a default ctx is built with\n * `findProjectRoot(process.cwd())` as the project root, `cwd` matching\n * `process.cwd()`, null config, no-op log, and the merged generator set\n * threaded through so the `kick/generate` built-in can surface each as\n * a Commander subcommand. The dynamic import of `findProjectRoot` keeps\n * the caller-supplied fast path zero-cost.\n */\n const register = async (program: Command, ctx?: KickCliPluginContext): Promise<void> => {\n let resolved: KickCliPluginContext\n if (ctx) {\n resolved = { generators, ...ctx }\n } else {\n const { findProjectRoot } = await import('../utils/project-root')\n const cwd = process.cwd()\n resolved = {\n cwd,\n projectRoot: findProjectRoot(cwd),\n config: null,\n log: () => {},\n generators,\n }\n }\n for (const p of plugins) {\n if (p.register) await p.register(program, resolved)\n }\n }\n\n return { commands, typegens, generators, register }\n}\n","// Barrel intentionally omits `./builtins` — that module top-level-imports\n// every register*Command, which pulls heavy modules (project scaffolders,\n// fs reads at import time) into the graph. Importers that need the\n// builtin list go through `./plugin/builtins` directly; tests + adopter\n// plugins consuming only the contract types import from here.\n\nexport type { KickCliPlugin } from './types'\nexport { defineCliPlugin, KickPluginConflictError } from './types'\nexport { mergeCliPlugins, type MergedPlugins } from './merge'\n"],"mappings":";;;;;;;;;;wFA4CA,SAAgB,EACd,EACA,EAAoD,CAAC,EACtC,CAEf,IAAM,EAAkB,IAAI,IAC5B,IAAK,IAAM,KAAK,EAAS,CACvB,IAAM,GAAS,EAAgB,IAAI,EAAE,IAAI,GAAK,GAAK,EAEnD,GADA,EAAgB,IAAI,EAAE,KAAM,CAAK,EAC7B,IAAU,EACZ,MAAM,IAAI,EAAwB,SAAU,EAAE,KAAM,CAAC,EAAE,KAAM,EAAE,IAAI,CAAC,CAExE,CAEA,IAAM,EAAgB,IAAI,IACpB,EAA0C,CAAC,EACjD,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAO,EAAE,UAAY,CAAC,EAAG,CAClC,IAAM,EAAQ,EAAc,IAAI,EAAI,IAAI,EACxC,GAAI,EACF,MAAM,IAAI,EAAwB,UAAW,EAAI,KAAM,CAAC,EAAO,EAAE,IAAI,CAAC,EAExE,EAAc,IAAI,EAAI,KAAM,EAAE,IAAI,EAClC,EAAe,KAAK,CAAG,CACzB,CAGF,IAAM,EAAe,IAAI,IAAI,EAAgB,IAAK,GAAM,EAAE,IAAI,CAAC,EAEzD,EAAW,CAAC,GADK,EAAe,OAAQ,GAAM,CAAC,EAAa,IAAI,EAAE,IAAI,CAC1C,EAAG,GAAG,CAAe,EAEjD,EAAgB,IAAI,IACpB,EAA4B,CAAC,EACnC,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAM,EAAE,UAAY,CAAC,EAAG,CACjC,IAAM,EAAQ,EAAc,IAAI,EAAG,EAAE,EACrC,GAAI,EACF,MAAM,IAAI,EAAwB,UAAW,EAAG,GAAI,CAAC,EAAO,EAAE,IAAI,CAAC,EAErE,EAAc,IAAI,EAAG,GAAI,EAAE,IAAI,EAC/B,EAAS,KAAK,CAAE,CAClB,CAGF,IAAM,EAAkB,IAAI,IACtB,EAAoC,CAAC,EAC3C,IAAK,IAAM,KAAK,EACd,IAAK,IAAM,KAAQ,EAAE,YAAc,CAAC,EAAG,CACrC,IAAM,EAAQ,EAAgB,IAAI,EAAK,IAAI,EAC3C,GAAI,EACF,MAAM,IAAI,EAAwB,YAAa,EAAK,KAAM,CAAC,EAAO,EAAE,IAAI,CAAC,EAE3E,EAAgB,IAAI,EAAK,KAAM,EAAE,IAAI,EACrC,EAAW,KAAK,CAAE,OAAQ,EAAE,KAAY,MAA6B,CAAC,CACxE,CAkCF,MAAO,CAAE,WAAU,WAAU,aAAY,eApBjB,EAAkB,IAA8C,CACtF,IAAI,EACJ,GAAI,EACF,EAAW,CAAE,aAAY,GAAG,CAAI,MAC3B,CACL,GAAM,CAAE,mBAAoB,MAAM,OAAO,+BAAA,KAAA,GAAA,EAAA,CAAA,EACnC,EAAM,QAAQ,IAAI,EACxB,EAAW,CACT,MACA,YAAa,EAAgB,CAAG,EAChC,OAAQ,KACR,QAAW,CAAC,EACZ,YACF,CACF,CACA,IAAK,IAAM,KAAK,EACV,EAAE,UAAU,MAAM,EAAE,SAAS,EAAS,CAAQ,CAEtD,CAEkD,CACpD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @forinda/kickjs-cli v5.
|
|
2
|
+
* @forinda/kickjs-cli v5.9.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Felix Orinda
|
|
5
5
|
*
|
|
@@ -855,4 +855,4 @@ Codex / Cursor / Gemini / Claude Code without copy-pasting.
|
|
|
855
855
|
CLI template. Hand-edited content is overwritten — keep customisation
|
|
856
856
|
in \`.agents/COPILOT.local.md\`.
|
|
857
857
|
`}export{C as _,I as a,m as b,w as c,T as d,O as f,u as g,S as h,L as i,M as l,D as m,P as n,N as o,j as p,R as r,A as s,F as t,k as u,b as v,f as y};
|
|
858
|
-
//# sourceMappingURL=project-docs-
|
|
858
|
+
//# sourceMappingURL=project-docs-CGn7Z7h9.mjs.map
|