@forinda/kickjs-cli 1.1.2 → 1.2.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/cli.js +1303 -172
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +88 -67
- package/dist/index.js +1031 -68
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,68 +1,3 @@
|
|
|
1
|
-
interface GenerateModuleOptions {
|
|
2
|
-
name: string;
|
|
3
|
-
modulesDir: string;
|
|
4
|
-
noEntity?: boolean;
|
|
5
|
-
noTests?: boolean;
|
|
6
|
-
repo?: 'drizzle' | 'inmemory';
|
|
7
|
-
minimal?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Generate a full DDD module with all layers:
|
|
11
|
-
* presentation/ — controller
|
|
12
|
-
* application/ — use-cases, DTOs
|
|
13
|
-
* domain/ — entity, value objects, repository interface, domain service
|
|
14
|
-
* infrastructure/ — repository implementation
|
|
15
|
-
*/
|
|
16
|
-
declare function generateModule(options: GenerateModuleOptions): Promise<string[]>;
|
|
17
|
-
|
|
18
|
-
interface GenerateAdapterOptions {
|
|
19
|
-
name: string;
|
|
20
|
-
outDir: string;
|
|
21
|
-
}
|
|
22
|
-
declare function generateAdapter(options: GenerateAdapterOptions): Promise<string[]>;
|
|
23
|
-
|
|
24
|
-
interface GenerateMiddlewareOptions {
|
|
25
|
-
name: string;
|
|
26
|
-
outDir: string;
|
|
27
|
-
}
|
|
28
|
-
declare function generateMiddleware(options: GenerateMiddlewareOptions): Promise<string[]>;
|
|
29
|
-
|
|
30
|
-
interface GenerateGuardOptions {
|
|
31
|
-
name: string;
|
|
32
|
-
outDir: string;
|
|
33
|
-
}
|
|
34
|
-
declare function generateGuard(options: GenerateGuardOptions): Promise<string[]>;
|
|
35
|
-
|
|
36
|
-
interface GenerateServiceOptions {
|
|
37
|
-
name: string;
|
|
38
|
-
outDir: string;
|
|
39
|
-
}
|
|
40
|
-
declare function generateService(options: GenerateServiceOptions): Promise<string[]>;
|
|
41
|
-
|
|
42
|
-
interface GenerateControllerOptions {
|
|
43
|
-
name: string;
|
|
44
|
-
outDir: string;
|
|
45
|
-
}
|
|
46
|
-
declare function generateController(options: GenerateControllerOptions): Promise<string[]>;
|
|
47
|
-
|
|
48
|
-
interface GenerateDtoOptions {
|
|
49
|
-
name: string;
|
|
50
|
-
outDir: string;
|
|
51
|
-
}
|
|
52
|
-
declare function generateDto(options: GenerateDtoOptions): Promise<string[]>;
|
|
53
|
-
|
|
54
|
-
type ProjectTemplate = 'rest' | 'graphql' | 'ddd' | 'microservice' | 'minimal';
|
|
55
|
-
interface InitProjectOptions {
|
|
56
|
-
name: string;
|
|
57
|
-
directory: string;
|
|
58
|
-
packageManager?: 'pnpm' | 'npm' | 'yarn';
|
|
59
|
-
initGit?: boolean;
|
|
60
|
-
installDeps?: boolean;
|
|
61
|
-
template?: ProjectTemplate;
|
|
62
|
-
}
|
|
63
|
-
/** Scaffold a new KickJS project */
|
|
64
|
-
declare function initProject(options: InitProjectOptions): Promise<void>;
|
|
65
|
-
|
|
66
1
|
/** A custom command that developers can register via kick.config.ts */
|
|
67
2
|
interface KickCommandDefinition {
|
|
68
3
|
/** The command name (e.g. 'db:migrate', 'seed', 'proto:gen') */
|
|
@@ -82,7 +17,7 @@ interface KickCommandDefinition {
|
|
|
82
17
|
aliases?: string[];
|
|
83
18
|
}
|
|
84
19
|
/** Project pattern — controls what generators produce and which deps are installed */
|
|
85
|
-
type ProjectPattern = 'rest' | 'graphql' | 'ddd' | '
|
|
20
|
+
type ProjectPattern = 'rest' | 'graphql' | 'ddd' | 'cqrs' | 'minimal';
|
|
86
21
|
/** Configuration for the kick.config.ts file */
|
|
87
22
|
interface KickConfig {
|
|
88
23
|
/**
|
|
@@ -90,7 +25,7 @@ interface KickConfig {
|
|
|
90
25
|
* - 'rest' — Express + Swagger (default)
|
|
91
26
|
* - 'graphql' — GraphQL + GraphiQL
|
|
92
27
|
* - 'ddd' — Full DDD modules with use cases, entities, value objects
|
|
93
|
-
* - '
|
|
28
|
+
* - 'cqrs' — CQRS with commands, queries, events, WebSocket + queue
|
|
94
29
|
* - 'minimal' — Bare Express with no scaffolding
|
|
95
30
|
*/
|
|
96
31
|
pattern?: ProjectPattern;
|
|
@@ -132,6 +67,92 @@ declare function defineConfig(config: KickConfig): KickConfig;
|
|
|
132
67
|
/** Load kick.config.* from the project root */
|
|
133
68
|
declare function loadKickConfig(cwd: string): Promise<KickConfig | null>;
|
|
134
69
|
|
|
70
|
+
type RepoType = 'drizzle' | 'inmemory' | 'prisma';
|
|
71
|
+
interface GenerateModuleOptions {
|
|
72
|
+
name: string;
|
|
73
|
+
modulesDir: string;
|
|
74
|
+
noEntity?: boolean;
|
|
75
|
+
noTests?: boolean;
|
|
76
|
+
repo?: RepoType;
|
|
77
|
+
minimal?: boolean;
|
|
78
|
+
force?: boolean;
|
|
79
|
+
pattern?: ProjectPattern;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Generate a module — structure depends on the project pattern.
|
|
83
|
+
*
|
|
84
|
+
* Patterns:
|
|
85
|
+
* rest — flat folder: controller + service + DTOs + repo
|
|
86
|
+
* ddd — nested DDD: presentation/ application/ domain/ infrastructure/
|
|
87
|
+
* graphql — flat folder: resolver + service + DTOs + repo (future)
|
|
88
|
+
* cqrs — commands, queries, events with WS/queue integration
|
|
89
|
+
* minimal — just controller + module index
|
|
90
|
+
*/
|
|
91
|
+
declare function generateModule(options: GenerateModuleOptions): Promise<string[]>;
|
|
92
|
+
|
|
93
|
+
interface GenerateAdapterOptions {
|
|
94
|
+
name: string;
|
|
95
|
+
outDir: string;
|
|
96
|
+
}
|
|
97
|
+
declare function generateAdapter(options: GenerateAdapterOptions): Promise<string[]>;
|
|
98
|
+
|
|
99
|
+
interface GenerateMiddlewareOptions {
|
|
100
|
+
name: string;
|
|
101
|
+
outDir?: string;
|
|
102
|
+
moduleName?: string;
|
|
103
|
+
modulesDir?: string;
|
|
104
|
+
pattern?: ProjectPattern;
|
|
105
|
+
}
|
|
106
|
+
declare function generateMiddleware(options: GenerateMiddlewareOptions): Promise<string[]>;
|
|
107
|
+
|
|
108
|
+
interface GenerateGuardOptions {
|
|
109
|
+
name: string;
|
|
110
|
+
outDir?: string;
|
|
111
|
+
moduleName?: string;
|
|
112
|
+
modulesDir?: string;
|
|
113
|
+
pattern?: ProjectPattern;
|
|
114
|
+
}
|
|
115
|
+
declare function generateGuard(options: GenerateGuardOptions): Promise<string[]>;
|
|
116
|
+
|
|
117
|
+
interface GenerateServiceOptions {
|
|
118
|
+
name: string;
|
|
119
|
+
outDir?: string;
|
|
120
|
+
moduleName?: string;
|
|
121
|
+
modulesDir?: string;
|
|
122
|
+
pattern?: ProjectPattern;
|
|
123
|
+
}
|
|
124
|
+
declare function generateService(options: GenerateServiceOptions): Promise<string[]>;
|
|
125
|
+
|
|
126
|
+
interface GenerateControllerOptions {
|
|
127
|
+
name: string;
|
|
128
|
+
outDir?: string;
|
|
129
|
+
moduleName?: string;
|
|
130
|
+
modulesDir?: string;
|
|
131
|
+
pattern?: ProjectPattern;
|
|
132
|
+
}
|
|
133
|
+
declare function generateController(options: GenerateControllerOptions): Promise<string[]>;
|
|
134
|
+
|
|
135
|
+
interface GenerateDtoOptions {
|
|
136
|
+
name: string;
|
|
137
|
+
outDir?: string;
|
|
138
|
+
moduleName?: string;
|
|
139
|
+
modulesDir?: string;
|
|
140
|
+
pattern?: ProjectPattern;
|
|
141
|
+
}
|
|
142
|
+
declare function generateDto(options: GenerateDtoOptions): Promise<string[]>;
|
|
143
|
+
|
|
144
|
+
type ProjectTemplate = 'rest' | 'graphql' | 'ddd' | 'cqrs' | 'minimal';
|
|
145
|
+
interface InitProjectOptions {
|
|
146
|
+
name: string;
|
|
147
|
+
directory: string;
|
|
148
|
+
packageManager?: 'pnpm' | 'npm' | 'yarn';
|
|
149
|
+
initGit?: boolean;
|
|
150
|
+
installDeps?: boolean;
|
|
151
|
+
template?: ProjectTemplate;
|
|
152
|
+
}
|
|
153
|
+
/** Scaffold a new KickJS project */
|
|
154
|
+
declare function initProject(options: InitProjectOptions): Promise<void>;
|
|
155
|
+
|
|
135
156
|
/** Convert a name to PascalCase */
|
|
136
157
|
declare function toPascalCase(name: string): string;
|
|
137
158
|
/** Convert a name to camelCase */
|