@forinda/kickjs-cli 1.2.13 → 1.3.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/README.md CHANGED
@@ -5,6 +5,10 @@ CLI for KickJS — project scaffolding, DDD module generation, dev/build/start c
5
5
  ## Install
6
6
 
7
7
  ```bash
8
+ # Using the KickJS CLI (recommended — installs as dev dependency)
9
+ kick add cli
10
+
11
+ # Manual install
8
12
  pnpm add -D @forinda/kickjs-cli
9
13
  ```
10
14
 
@@ -17,41 +21,79 @@ kick build # Production build via Vite
17
21
  kick start # Run production build
18
22
  kick info # Print system and framework info
19
23
 
20
- kick g module <name> # Generate full DDD module
24
+ kick g module <names...> # Generate one or more DDD modules
25
+ kick g scaffold <name> # Generate CRUD module from field definitions
21
26
  kick g controller <name> # Generate controller
22
27
  kick g service <name> # Generate service
23
28
  kick g middleware <name> # Generate middleware
24
29
  kick g guard <name> # Generate auth guard
25
30
  kick g adapter <name> # Generate lifecycle adapter
26
31
  kick g dto <name> # Generate DTO with Zod schema
32
+
33
+ kick rm module <names...> # Remove one or more modules
34
+ kick add <pkg> # Install a KickJS package + peers
35
+ kick add --list # Show all available packages
27
36
  ```
28
37
 
29
38
  ## Generator Flags
30
39
 
31
40
  ```bash
32
- kick g module users --no-entity # Skip entity/value objects
33
- kick g module users --minimal # Only index.ts + controller
34
- kick g module users --dry-run # Preview without writing
41
+ kick g module users --no-entity # Skip entity/value objects
42
+ kick g module users --no-tests # Skip test files
43
+ kick g module users --minimal # Only index.ts + controller
44
+ kick g module users --dry-run # Preview without writing
45
+ kick g module users --repo prisma # Use Prisma repository (working code)
46
+ kick g module users --repo drizzle # Use Drizzle repository (working code)
47
+ kick g module users --no-pluralize # Singular names: src/modules/user/
35
48
  ```
36
49
 
37
- ## Custom Commands
50
+ ## Repository Types
51
+
52
+ The `--repo` flag or `defaultRepo` config controls the generated repository implementation:
38
53
 
39
- Extend the CLI via `kick.config.ts`:
54
+ | Type | File | Code |
55
+ |------|------|------|
56
+ | `inmemory` (default) | `in-memory-{name}.repository.ts` | Working Map-based store |
57
+ | `drizzle` | `drizzle-{name}.repository.ts` | Working Drizzle ORM queries |
58
+ | `prisma` | `prisma-{name}.repository.ts` | Working Prisma Client queries |
59
+ | `{ name: 'custom' }` | `custom-{name}.repository.ts` | In-memory stub with TODO markers |
60
+
61
+ Custom repo types accept any string and generate a stub repository with the correct class/file naming:
62
+
63
+ ```bash
64
+ kick g module user --repo typeorm # → typeorm-user.repository.ts, TypeormUserRepository
65
+ kick g module user --repo mongoose # → mongoose-user.repository.ts, MongooseUserRepository
66
+ ```
67
+
68
+ ## Configuration
69
+
70
+ Configure defaults in `kick.config.ts`:
40
71
 
41
72
  ```typescript
42
73
  import { defineConfig } from '@forinda/kickjs-cli'
43
74
 
44
75
  export default defineConfig({
76
+ pattern: 'ddd',
77
+
78
+ // Module generation settings
79
+ modules: {
80
+ dir: 'src/modules',
81
+ repo: 'prisma', // built-in: 'drizzle' | 'inmemory' | 'prisma'
82
+ // repo: { name: 'typeorm' }, // custom ORM
83
+ pluralize: true, // set false for singular module names
84
+ schemaDir: 'prisma/', // schema output directory
85
+ },
86
+
45
87
  commands: [
46
- { name: 'db:migrate', description: 'Run migrations', steps: 'npx drizzle-kit migrate' },
47
- { name: 'db:seed', description: 'Seed database', steps: 'npx tsx src/db/seed.ts' },
88
+ { name: 'db:migrate', description: 'Run migrations', steps: 'npx prisma migrate dev' },
89
+ { name: 'db:seed', description: 'Seed database', steps: 'npx prisma db seed' },
48
90
  ],
49
91
  })
50
92
  ```
51
93
 
52
94
  ## Documentation
53
95
 
54
- [Full documentation](https://github.com/forinda/kick-js)
96
+ [Full documentation](https://forinda.github.io/kick-js/guide/generators)
55
97
 
56
98
  ## License
57
99