bunli 0.1.1 → 0.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/README.md +39 -2
- package/dist/cli.js +135 -2
- package/dist/commands/build.d.ts +3 -1
- package/dist/commands/dev.d.ts +6 -1
- package/dist/commands/generate.d.ts +9 -0
- package/dist/commands/init.d.ts +3 -1
- package/dist/commands/release.d.ts +3 -1
- package/dist/commands/test.d.ts +3 -1
- package/dist/config.d.ts +39 -173
- package/dist/index.d.ts +2 -1
- package/dist/index.js +64 -46
- package/package.json +5 -6
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ bun add -g bunli
|
|
|
12
12
|
|
|
13
13
|
### Development
|
|
14
14
|
|
|
15
|
-
Run your CLI in development mode with hot reloading:
|
|
15
|
+
Run your CLI in development mode with hot reloading and automatic type generation:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
18
|
bunli dev
|
|
@@ -35,10 +35,15 @@ Development options:
|
|
|
35
35
|
- `--watch, -w` - Watch for changes (default: true)
|
|
36
36
|
- `--inspect, -i` - Enable debugger
|
|
37
37
|
- `--port, -p` - Debugger port (default: 9229)
|
|
38
|
+
- `--commandsDir` - Commands directory for codegen (default: commands)
|
|
39
|
+
- `--generate` - Enable/disable code generation (default: true)
|
|
40
|
+
- `--clearScreen` - Clear screen on reload (default: true)
|
|
41
|
+
|
|
42
|
+
**Note:** Development mode automatically generates TypeScript definitions from your commands when codegen is enabled in your config.
|
|
38
43
|
|
|
39
44
|
### Building
|
|
40
45
|
|
|
41
|
-
Build your CLI for production:
|
|
46
|
+
Build your CLI for production with automatic type generation:
|
|
42
47
|
|
|
43
48
|
```bash
|
|
44
49
|
# Traditional build (requires Bun runtime)
|
|
@@ -54,11 +59,43 @@ bunli build --targets native
|
|
|
54
59
|
bunli build --targets all
|
|
55
60
|
```
|
|
56
61
|
|
|
62
|
+
**Note:** The build process automatically generates TypeScript definitions from your commands before building when codegen is enabled in your config.
|
|
63
|
+
|
|
64
|
+
### Type Generation
|
|
65
|
+
|
|
66
|
+
Generate TypeScript definitions from your CLI commands for enhanced developer experience:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Generate types once
|
|
70
|
+
bunli generate
|
|
71
|
+
|
|
72
|
+
# Generate types and watch for changes
|
|
73
|
+
bunli generate --watch
|
|
74
|
+
|
|
75
|
+
# Custom commands directory
|
|
76
|
+
bunli generate --commandsDir ./src/commands
|
|
77
|
+
|
|
78
|
+
# Custom output file
|
|
79
|
+
bunli generate --output ./types/commands.gen.ts
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Generate options:
|
|
83
|
+
- `--commandsDir` - Commands directory to scan (default: commands)
|
|
84
|
+
- `--output, -o` - Output file path (default: ./commands.gen.ts)
|
|
85
|
+
- `--watch, -w` - Watch for changes and regenerate
|
|
86
|
+
|
|
87
|
+
The generator creates type-safe command definitions with:
|
|
88
|
+
- Autocomplete for command names and options
|
|
89
|
+
- Type safety at compile time
|
|
90
|
+
- IntelliSense for command metadata
|
|
91
|
+
- Helper functions for command discovery
|
|
92
|
+
|
|
57
93
|
### Available Commands
|
|
58
94
|
|
|
59
95
|
- `bunli init` - Initialize a new Bunli CLI project
|
|
60
96
|
- `bunli dev` - Run CLI in development mode with hot reloading
|
|
61
97
|
- `bunli build` - Build your CLI for production
|
|
98
|
+
- `bunli generate` - Generate TypeScript definitions from commands
|
|
62
99
|
- `bunli test` - Run tests with Bun test runner
|
|
63
100
|
- `bunli release` - Release your CLI package
|
|
64
101
|
|