@eldrforge/kodrdriv 0.0.7 → 0.0.10
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 +65 -707
- package/dist/arguments.js +79 -55
- package/dist/arguments.js.map +1 -1
- package/dist/commands/commit.js +28 -16
- package/dist/commands/commit.js.map +1 -1
- package/dist/commands/link.js +19 -18
- package/dist/commands/link.js.map +1 -1
- package/dist/commands/publish.js +170 -93
- package/dist/commands/publish.js.map +1 -1
- package/dist/commands/release.js +8 -0
- package/dist/commands/release.js.map +1 -1
- package/dist/commands/unlink.js +21 -20
- package/dist/commands/unlink.js.map +1 -1
- package/dist/constants.js +4 -2
- package/dist/constants.js.map +1 -1
- package/dist/logging.js +35 -23
- package/dist/logging.js.map +1 -1
- package/dist/main.js +49 -3
- package/dist/main.js.map +1 -1
- package/dist/util/child.js +13 -1
- package/dist/util/child.js.map +1 -1
- package/docs/index.html +17 -0
- package/docs/package.json +36 -0
- package/docs/public/README.md +132 -0
- package/docs/public/advanced-usage.md +188 -0
- package/docs/public/code-icon.svg +4 -0
- package/docs/public/commands.md +116 -0
- package/docs/public/configuration.md +274 -0
- package/docs/public/examples.md +352 -0
- package/docs/public/kodrdriv-logo.svg +62 -0
- package/docs/src/App.css +387 -0
- package/docs/src/App.tsx +60 -0
- package/docs/src/components/DocumentPage.tsx +56 -0
- package/docs/src/components/ErrorMessage.tsx +15 -0
- package/docs/src/components/LoadingSpinner.tsx +14 -0
- package/docs/src/components/MarkdownRenderer.tsx +56 -0
- package/docs/src/components/Navigation.css +73 -0
- package/docs/src/components/Navigation.tsx +36 -0
- package/docs/src/index.css +61 -0
- package/docs/src/main.tsx +10 -0
- package/docs/src/test/setup.ts +1 -0
- package/docs/src/vite-env.d.ts +10 -0
- package/docs/tsconfig.node.json +13 -0
- package/docs/vite.config.ts +15 -0
- package/docs/vitest.config.ts +15 -0
- package/eslint.config.mjs +1 -0
- package/package.json +10 -5
- package/vitest.config.ts +3 -3
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
This section provides practical examples of using KodrDriv commands in various scenarios.
|
|
4
|
+
|
|
5
|
+
## Basic Usage Examples
|
|
6
|
+
|
|
7
|
+
### Commit Examples
|
|
8
|
+
|
|
9
|
+
Basic commit message generation:
|
|
10
|
+
```bash
|
|
11
|
+
kodrdriv commit
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Generate a commit message and automatically commit it:
|
|
15
|
+
```bash
|
|
16
|
+
kodrdriv commit --sendit
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Use custom context and message limit:
|
|
20
|
+
```bash
|
|
21
|
+
kodrdriv commit --context "Refactoring for performance" --message-limit 5
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Work with staged changes only:
|
|
25
|
+
```bash
|
|
26
|
+
git add src/components/
|
|
27
|
+
kodrdriv commit --cached
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Release Examples
|
|
31
|
+
|
|
32
|
+
Basic release notes generation:
|
|
33
|
+
```bash
|
|
34
|
+
kodrdriv release
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Generate release notes for a specific range:
|
|
38
|
+
```bash
|
|
39
|
+
kodrdriv release --from v1.0.0 --to v1.1.0
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Include both git log and diff information:
|
|
43
|
+
```bash
|
|
44
|
+
kodrdriv release --content-types log diff
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Use custom context for quarterly release:
|
|
48
|
+
```bash
|
|
49
|
+
kodrdriv release --context "Quarterly release, focus on stability" --message-limit 20
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Publish Examples
|
|
53
|
+
|
|
54
|
+
Basic publish with default settings:
|
|
55
|
+
```bash
|
|
56
|
+
kodrdriv publish
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Publish with different merge methods:
|
|
60
|
+
```bash
|
|
61
|
+
# Use merge commit (preserves individual commits)
|
|
62
|
+
kodrdriv publish --merge-method merge
|
|
63
|
+
|
|
64
|
+
# Use rebase (clean linear history)
|
|
65
|
+
kodrdriv publish --merge-method rebase
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Link Examples
|
|
69
|
+
|
|
70
|
+
Basic linking with single scope:
|
|
71
|
+
```bash
|
|
72
|
+
kodrdriv link --scope-roots '{"@company": "../"}'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Multiple scopes with different root directories:
|
|
76
|
+
```bash
|
|
77
|
+
kodrdriv link --scope-roots '{"@company": "../", "@tools": "../../tools/"}'
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Dry run to preview changes:
|
|
81
|
+
```bash
|
|
82
|
+
kodrdriv link --scope-roots '{"@company": "../"}' --dry-run --verbose
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Custom workspace file:
|
|
86
|
+
```bash
|
|
87
|
+
kodrdriv link --scope-roots '{"@company": "../"}' --workspace-file "workspace.yaml"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Real-world example: linking @company packages from company directory:
|
|
91
|
+
```bash
|
|
92
|
+
kodrdriv link --scope-roots '{"@company": "../../company/"}'
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Advanced Examples
|
|
96
|
+
|
|
97
|
+
### Using Custom Instructions
|
|
98
|
+
|
|
99
|
+
Use custom instructions from a file:
|
|
100
|
+
```bash
|
|
101
|
+
kodrdriv release --instructions ./my-custom-instructions.md
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Enable instruction overrides (requires custom instruction files in `.kodrdriv/instructions/`):
|
|
105
|
+
```bash
|
|
106
|
+
kodrdriv commit --overrides
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Use custom config directory with overrides:
|
|
110
|
+
```bash
|
|
111
|
+
kodrdriv release --config-dir ~/my-kodrdriv-config --overrides
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Excluding Patterns
|
|
115
|
+
|
|
116
|
+
Exclude specific files or directories from diff analysis:
|
|
117
|
+
```bash
|
|
118
|
+
kodrdriv commit --excluded-paths "*.lock" "dist/" "node_modules/"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Exclude patterns from release notes:
|
|
122
|
+
```bash
|
|
123
|
+
kodrdriv release --excluded-paths "package-lock.json" "pnpm-lock.yaml"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Verbose and Debug Mode
|
|
127
|
+
|
|
128
|
+
Run in verbose mode with a custom OpenAI model:
|
|
129
|
+
```bash
|
|
130
|
+
kodrdriv commit --verbose --model gpt-4
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Enable debug logging:
|
|
134
|
+
```bash
|
|
135
|
+
kodrdriv release --debug
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Configuration Debugging
|
|
139
|
+
|
|
140
|
+
Check current configuration (useful for debugging):
|
|
141
|
+
```bash
|
|
142
|
+
kodrdriv --check-config
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Workflow Examples
|
|
146
|
+
|
|
147
|
+
### Development Workflow
|
|
148
|
+
|
|
149
|
+
1. Make changes to your code
|
|
150
|
+
2. Stage the changes you want to commit:
|
|
151
|
+
```bash
|
|
152
|
+
git add src/components/Button.tsx
|
|
153
|
+
```
|
|
154
|
+
3. Generate and commit with a message:
|
|
155
|
+
```bash
|
|
156
|
+
kodrdriv commit --cached --sendit
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Release Workflow
|
|
160
|
+
|
|
161
|
+
1. Generate release notes for review:
|
|
162
|
+
```bash
|
|
163
|
+
kodrdriv release --dry-run
|
|
164
|
+
```
|
|
165
|
+
2. Generate and save release notes:
|
|
166
|
+
```bash
|
|
167
|
+
kodrdriv release
|
|
168
|
+
```
|
|
169
|
+
3. Automated publish process:
|
|
170
|
+
```bash
|
|
171
|
+
kodrdriv publish
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Monorepo Development Workflow
|
|
175
|
+
|
|
176
|
+
1. Link local packages for development:
|
|
177
|
+
```bash
|
|
178
|
+
kodrdriv link --scope-roots '{"@company": "../", "@tools": "../../tools/"}'
|
|
179
|
+
```
|
|
180
|
+
2. Make changes across packages
|
|
181
|
+
3. Generate commit messages for each package:
|
|
182
|
+
```bash
|
|
183
|
+
cd package-a
|
|
184
|
+
kodrdriv commit --context "Cross-package refactoring"
|
|
185
|
+
cd ../package-b
|
|
186
|
+
kodrdriv commit --context "Cross-package refactoring"
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Environment-Specific Examples
|
|
190
|
+
|
|
191
|
+
### CI/CD Pipeline
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Set required environment variables
|
|
195
|
+
export GITHUB_TOKEN="your-token"
|
|
196
|
+
export OPENAI_API_KEY="your-key"
|
|
197
|
+
export NODE_AUTH_TOKEN="your-npm-token"
|
|
198
|
+
|
|
199
|
+
# Run publish command in CI
|
|
200
|
+
kodrdriv publish --verbose
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Local Development
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
# Load environment from .env file
|
|
207
|
+
# (KodrDriv automatically loads .env files)
|
|
208
|
+
|
|
209
|
+
# Use specific model for local development
|
|
210
|
+
kodrdriv commit --model gpt-4o-mini --verbose
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Team Collaboration
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Use team-specific configuration
|
|
217
|
+
kodrdriv commit --config-dir ./.team-kodrdriv
|
|
218
|
+
|
|
219
|
+
# Generate release notes with team context
|
|
220
|
+
kodrdriv release --context ./team-context.md
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## Real-World Scenarios
|
|
224
|
+
|
|
225
|
+
### Feature Development
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Start working on a feature
|
|
229
|
+
git checkout -b feature/user-authentication
|
|
230
|
+
|
|
231
|
+
# Make incremental commits with context
|
|
232
|
+
kodrdriv commit --context "Implementing user authentication system"
|
|
233
|
+
kodrdriv commit --context "Adding password validation"
|
|
234
|
+
kodrdriv commit --context "Integrating with OAuth provider"
|
|
235
|
+
|
|
236
|
+
# Generate comprehensive release notes
|
|
237
|
+
kodrdriv release --from main --to feature/user-authentication
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### Bug Fix
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Quick bug fix with automatic commit
|
|
244
|
+
git add src/utils/validation.ts
|
|
245
|
+
kodrdriv commit --sendit --context "Fixing validation bug #123"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
### Dependency Updates
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
# Update dependencies and commit
|
|
252
|
+
pnpm update
|
|
253
|
+
kodrdriv commit --context "Routine dependency updates"
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### Documentation Updates
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# Update documentation
|
|
260
|
+
git add docs/
|
|
261
|
+
kodrdriv commit --context "Updating API documentation"
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Configuration Examples
|
|
265
|
+
|
|
266
|
+
### Personal Configuration
|
|
267
|
+
|
|
268
|
+
`.kodrdriv/config.json`:
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"model": "gpt-4o-mini",
|
|
272
|
+
"verbose": true,
|
|
273
|
+
"commit": {
|
|
274
|
+
"messageLimit": 5
|
|
275
|
+
},
|
|
276
|
+
"excludedPatterns": [
|
|
277
|
+
"*.lock",
|
|
278
|
+
"dist/",
|
|
279
|
+
".DS_Store"
|
|
280
|
+
]
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Team Configuration
|
|
285
|
+
|
|
286
|
+
`.kodrdriv/config.json`:
|
|
287
|
+
```json
|
|
288
|
+
{
|
|
289
|
+
"model": "gpt-4o-mini",
|
|
290
|
+
"publish": {
|
|
291
|
+
"mergeMethod": "squash",
|
|
292
|
+
"dependencyUpdatePatterns": ["@company/*"],
|
|
293
|
+
"requiredEnvVars": ["NODE_AUTH_TOKEN", "CODECOV_TOKEN"]
|
|
294
|
+
},
|
|
295
|
+
"link": {
|
|
296
|
+
"scopeRoots": {
|
|
297
|
+
"@company": "../",
|
|
298
|
+
"@shared": "../../shared-packages/"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
### Project-Specific Configuration
|
|
305
|
+
|
|
306
|
+
```json
|
|
307
|
+
{
|
|
308
|
+
"contextDirectories": ["src", "docs", "tests"],
|
|
309
|
+
"release": {
|
|
310
|
+
"messageLimit": 15
|
|
311
|
+
},
|
|
312
|
+
"excludedPatterns": [
|
|
313
|
+
"coverage/",
|
|
314
|
+
"*.generated.ts",
|
|
315
|
+
"build/"
|
|
316
|
+
]
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## Error Handling Examples
|
|
321
|
+
|
|
322
|
+
### Missing Environment Variables
|
|
323
|
+
|
|
324
|
+
```bash
|
|
325
|
+
# This will fail with helpful error message
|
|
326
|
+
kodrdriv publish
|
|
327
|
+
# Error: Missing required environment variables: GITHUB_TOKEN, OPENAI_API_KEY
|
|
328
|
+
|
|
329
|
+
# Set the variables and retry
|
|
330
|
+
export GITHUB_TOKEN="your-token"
|
|
331
|
+
export OPENAI_API_KEY="your-key"
|
|
332
|
+
kodrdriv publish
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Missing prepublishOnly Script
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
# This will fail if package.json doesn't have prepublishOnly script
|
|
339
|
+
kodrdriv publish
|
|
340
|
+
# Error: prepublishOnly script is required in package.json
|
|
341
|
+
|
|
342
|
+
# Add script to package.json and retry
|
|
343
|
+
# "prepublishOnly": "pnpm run lint && pnpm run build && pnpm run test"
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Dry Run for Safety
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
# Always test with dry run first
|
|
350
|
+
kodrdriv publish --dry-run
|
|
351
|
+
kodrdriv link --scope-roots '{"@company": "../"}' --dry-run
|
|
352
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<svg width="128" height="128" viewBox="0 0 128 128" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<!-- Background circle -->
|
|
3
|
+
<circle cx="64" cy="64" r="62" fill="#000000" stroke="#333333" stroke-width="2"/>
|
|
4
|
+
|
|
5
|
+
<!-- Thor's hammer handle (vertical shaft) -->
|
|
6
|
+
<rect x="58" y="45" width="12" height="55" fill="#ffffff" rx="2"/>
|
|
7
|
+
|
|
8
|
+
<!-- Hammer head (main block) -->
|
|
9
|
+
<rect x="35" y="25" width="58" height="25" fill="#ffffff" rx="3"/>
|
|
10
|
+
|
|
11
|
+
<!-- Hammer head detail lines -->
|
|
12
|
+
<rect x="40" y="30" width="48" height="2" fill="#000000"/>
|
|
13
|
+
<rect x="40" y="35" width="48" height="2" fill="#000000"/>
|
|
14
|
+
<rect x="40" y="40" width="48" height="2" fill="#000000"/>
|
|
15
|
+
|
|
16
|
+
<!-- Digital bytes/binary elements around the hammer -->
|
|
17
|
+
<!-- Top left -->
|
|
18
|
+
<rect x="20" y="15" width="3" height="3" fill="#ffffff"/>
|
|
19
|
+
<rect x="25" y="15" width="3" height="3" fill="#ffffff"/>
|
|
20
|
+
<rect x="25" y="20" width="3" height="3" fill="#ffffff"/>
|
|
21
|
+
|
|
22
|
+
<!-- Top right -->
|
|
23
|
+
<rect x="100" y="15" width="3" height="3" fill="#ffffff"/>
|
|
24
|
+
<rect x="105" y="15" width="3" height="3" fill="#ffffff"/>
|
|
25
|
+
<rect x="100" y="20" width="3" height="3" fill="#ffffff"/>
|
|
26
|
+
|
|
27
|
+
<!-- Bottom left -->
|
|
28
|
+
<rect x="15" y="100" width="3" height="3" fill="#ffffff"/>
|
|
29
|
+
<rect x="20" y="105" width="3" height="3" fill="#ffffff"/>
|
|
30
|
+
<rect x="25" y="100" width="3" height="3" fill="#ffffff"/>
|
|
31
|
+
|
|
32
|
+
<!-- Bottom right -->
|
|
33
|
+
<rect x="100" y="105" width="3" height="3" fill="#ffffff"/>
|
|
34
|
+
<rect x="105" y="100" width="3" height="3" fill="#ffffff"/>
|
|
35
|
+
<rect x="110" y="105" width="3" height="3" fill="#ffffff"/>
|
|
36
|
+
|
|
37
|
+
<!-- Circuit-like lines connecting to hammer -->
|
|
38
|
+
<path d="M 30 45 L 35 45" stroke="#ffffff" stroke-width="2" fill="none"/>
|
|
39
|
+
<path d="M 93 45 L 98 45" stroke="#ffffff" stroke-width="2" fill="none"/>
|
|
40
|
+
|
|
41
|
+
<!-- Binary numbers around the hammer -->
|
|
42
|
+
<text x="15" y="65" fill="#ffffff" font-family="monospace" font-size="8">01</text>
|
|
43
|
+
<text x="105" y="65" fill="#ffffff" font-family="monospace" font-size="8">10</text>
|
|
44
|
+
<text x="60" y="20" fill="#000000" font-family="monospace" font-size="6">11</text>
|
|
45
|
+
<text x="60" y="115" fill="#ffffff" font-family="monospace" font-size="8">00</text>
|
|
46
|
+
|
|
47
|
+
<!-- Hammer striking effect (lightning/energy) -->
|
|
48
|
+
<path d="M 64 50 L 60 55 L 68 55 L 64 60" fill="#ffffff"/>
|
|
49
|
+
|
|
50
|
+
<!-- Corner circuit elements -->
|
|
51
|
+
<rect x="10" y="10" width="8" height="1" fill="#ffffff"/>
|
|
52
|
+
<rect x="10" y="10" width="1" height="8" fill="#ffffff"/>
|
|
53
|
+
|
|
54
|
+
<rect x="110" y="10" width="8" height="1" fill="#ffffff"/>
|
|
55
|
+
<rect x="117" y="10" width="1" height="8" fill="#ffffff"/>
|
|
56
|
+
|
|
57
|
+
<rect x="10" y="117" width="8" height="1" fill="#ffffff"/>
|
|
58
|
+
<rect x="10" y="110" width="1" height="8" fill="#ffffff"/>
|
|
59
|
+
|
|
60
|
+
<rect x="110" y="117" width="8" height="1" fill="#ffffff"/>
|
|
61
|
+
<rect x="117" y="110" width="1" height="8" fill="#ffffff"/>
|
|
62
|
+
</svg>
|