@forinda/kickjs-cli 1.2.13 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -9
- package/dist/cli.js +1095 -484
- package/dist/index.d.ts +70 -5
- package/dist/index.js +980 -377
- package/package.json +15 -4
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,51 @@ interface KickCommandDefinition {
|
|
|
18
18
|
}
|
|
19
19
|
/** Project pattern — controls what generators produce and which deps are installed */
|
|
20
20
|
type ProjectPattern = 'rest' | 'graphql' | 'ddd' | 'cqrs' | 'minimal';
|
|
21
|
+
/** Built-in repository types with first-class code generation support */
|
|
22
|
+
type BuiltinRepoType$1 = 'drizzle' | 'inmemory' | 'prisma';
|
|
23
|
+
/** Custom repository type — generates a stub with TODO markers */
|
|
24
|
+
interface CustomRepoType {
|
|
25
|
+
name: string;
|
|
26
|
+
}
|
|
27
|
+
/** Repository type — built-in string or custom object */
|
|
28
|
+
type RepoTypeConfig = BuiltinRepoType$1 | CustomRepoType;
|
|
29
|
+
/** Module generation settings — controls how `kick g module` produces code */
|
|
30
|
+
interface ModuleConfig {
|
|
31
|
+
/** Where modules live (default: 'src/modules') */
|
|
32
|
+
dir?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Default repository implementation for generators.
|
|
35
|
+
*
|
|
36
|
+
* Built-in types (string): `'drizzle'`, `'inmemory'`, `'prisma'`
|
|
37
|
+
* — generate fully working repository code.
|
|
38
|
+
*
|
|
39
|
+
* Custom types (object): `{ name: 'typeorm' }`
|
|
40
|
+
* — generate a stub repository with TODO markers.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* repo: 'prisma' // built-in
|
|
44
|
+
* repo: { name: 'typeorm' } // custom
|
|
45
|
+
*/
|
|
46
|
+
repo?: RepoTypeConfig;
|
|
47
|
+
/** Schema output directory (e.g. 'src/db/schema' for Drizzle, 'prisma/' for Prisma) */
|
|
48
|
+
schemaDir?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to pluralize module names in generated code.
|
|
51
|
+
* When true (default), `kick g module user` creates `src/modules/users/`.
|
|
52
|
+
* When false, it creates `src/modules/user/` and uses singular names throughout.
|
|
53
|
+
*/
|
|
54
|
+
pluralize?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Import path for the Prisma generated client in `--repo prisma` templates.
|
|
57
|
+
* Must resolve within `src/` for path alias compatibility.
|
|
58
|
+
*
|
|
59
|
+
* @default '@prisma/client' (Prisma 5/6)
|
|
60
|
+
* @example
|
|
61
|
+
* prismaClientPath: '@/generated/prisma/client' // Prisma 7+
|
|
62
|
+
* prismaClientPath: './generated/prisma/client' // relative
|
|
63
|
+
*/
|
|
64
|
+
prismaClientPath?: string;
|
|
65
|
+
}
|
|
21
66
|
/** Configuration for the kick.config.ts file */
|
|
22
67
|
interface KickConfig {
|
|
23
68
|
/**
|
|
@@ -29,12 +74,26 @@ interface KickConfig {
|
|
|
29
74
|
* - 'minimal' — Bare Express with no scaffolding
|
|
30
75
|
*/
|
|
31
76
|
pattern?: ProjectPattern;
|
|
32
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Module generation settings — directory, repo type, pluralization, schema dir.
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* modules: {
|
|
82
|
+
* dir: 'src/modules',
|
|
83
|
+
* repo: 'prisma',
|
|
84
|
+
* pluralize: false,
|
|
85
|
+
* schemaDir: 'prisma/',
|
|
86
|
+
* }
|
|
87
|
+
*/
|
|
88
|
+
modules?: ModuleConfig;
|
|
89
|
+
/** @deprecated Use `modules.dir` instead */
|
|
33
90
|
modulesDir?: string;
|
|
34
|
-
/**
|
|
35
|
-
defaultRepo?:
|
|
36
|
-
/**
|
|
91
|
+
/** @deprecated Use `modules.repo` instead */
|
|
92
|
+
defaultRepo?: RepoTypeConfig;
|
|
93
|
+
/** @deprecated Use `modules.schemaDir` instead */
|
|
37
94
|
schemaDir?: string;
|
|
95
|
+
/** @deprecated Use `modules.pluralize` instead */
|
|
96
|
+
pluralize?: boolean;
|
|
38
97
|
/**
|
|
39
98
|
* Directories to copy to dist/ after build.
|
|
40
99
|
* Useful for EJS templates, email templates, static assets, etc.
|
|
@@ -67,7 +126,8 @@ declare function defineConfig(config: KickConfig): KickConfig;
|
|
|
67
126
|
/** Load kick.config.* from the project root */
|
|
68
127
|
declare function loadKickConfig(cwd: string): Promise<KickConfig | null>;
|
|
69
128
|
|
|
70
|
-
type
|
|
129
|
+
type BuiltinRepoType = 'drizzle' | 'inmemory' | 'prisma';
|
|
130
|
+
type RepoType = BuiltinRepoType | (string & {});
|
|
71
131
|
interface GenerateModuleOptions {
|
|
72
132
|
name: string;
|
|
73
133
|
modulesDir: string;
|
|
@@ -78,6 +138,10 @@ interface GenerateModuleOptions {
|
|
|
78
138
|
force?: boolean;
|
|
79
139
|
pattern?: ProjectPattern;
|
|
80
140
|
dryRun?: boolean;
|
|
141
|
+
/** When false, skip pluralization — use singular names for folders, routes, and classes */
|
|
142
|
+
pluralize?: boolean;
|
|
143
|
+
/** Prisma client import path (default: '@prisma/client', Prisma 7+: '@/generated/prisma/client') */
|
|
144
|
+
prismaClientPath?: string;
|
|
81
145
|
}
|
|
82
146
|
/**
|
|
83
147
|
* Generate a module — structure depends on the project pattern.
|
|
@@ -150,6 +214,7 @@ interface InitProjectOptions {
|
|
|
150
214
|
initGit?: boolean;
|
|
151
215
|
installDeps?: boolean;
|
|
152
216
|
template?: ProjectTemplate;
|
|
217
|
+
defaultRepo?: string;
|
|
153
218
|
}
|
|
154
219
|
/** Scaffold a new KickJS project */
|
|
155
220
|
declare function initProject(options: InitProjectOptions): Promise<void>;
|