@auto-engineer/release-automation 1.147.0 → 1.149.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/CHANGELOG.md +45 -0
- package/README.md +174 -422
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @auto-engineer/release-automation
|
|
2
2
|
|
|
3
|
+
## 1.149.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`e1eebbd`](https://github.com/BeOnAuto/auto-engineer/commit/e1eebbdf4f209780e790094d2e6887c4fa809f98) Thanks [@github-actions[bot]](https://github.com/github-actions%5Bbot%5D)! - - **server-generator-apollo-emmett**: add Given state ref hints to state.ts.ejs
|
|
8
|
+
- **server-generator-apollo-emmett**: context-aware nonCommandField instructions
|
|
9
|
+
- **server-generator-apollo-emmett**: add state context instruction
|
|
10
|
+
- **server-generator-apollo-emmett**: extract shared template helpers
|
|
11
|
+
- **server-generator-apollo-emmett**: filter state refs from hasGivenEvents in decide.ts.ejs
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`d38c81e`](https://github.com/BeOnAuto/auto-engineer/commit/d38c81e7bb442a39626564cf4f6d8d55b60d0a38) Thanks [@SamHatoum](https://github.com/SamHatoum)! -
|
|
16
|
+
|
|
17
|
+
## 1.148.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- [`d5ba3a0`](https://github.com/BeOnAuto/auto-engineer/commit/d5ba3a0e3fb0f6a9ad7a3a8b1815590ea77a5b42) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Added state context instruction to generated decide handlers, preventing unnecessary narrowing when Given steps contain only state references
|
|
22
|
+
|
|
23
|
+
- [`e0cdc4e`](https://github.com/BeOnAuto/auto-engineer/commit/e0cdc4e3363ad84d4bc49996a600ac75c97ccc38) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Added context-aware classification of non-command fields in generated decide.ts scaffolds, distinguishing between date-derived, state-derived, and not-yet-tested fields
|
|
24
|
+
|
|
25
|
+
- [`9195db7`](https://github.com/BeOnAuto/auto-engineer/commit/9195db78cb707d658866cee99a1c73d34fb4efde) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Extracted shared template helpers into a dedicated module for cleaner code generation
|
|
26
|
+
|
|
27
|
+
- [`abb6540`](https://github.com/BeOnAuto/auto-engineer/commit/abb6540db7196ed7935c8a8610695828f9035fc3) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Added status variant hints from Given state references to the state template, helping implementers create matching discriminated union variants
|
|
28
|
+
|
|
29
|
+
- [`9195db7`](https://github.com/BeOnAuto/auto-engineer/commit/9195db78cb707d658866cee99a1c73d34fb4efde) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Extracted shared template helper functions into a dedicated module for better code reuse across generators
|
|
30
|
+
- Simplified template specs by removing inline duplicate definitions in favor of the shared helpers
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- [`88fb1da`](https://github.com/BeOnAuto/auto-engineer/commit/88fb1da2b222de04dd4959d87657395ee960a6ce) Thanks [@github-actions[bot]](https://github.com/github-actions%5Bbot%5D)! - - **server-generator-apollo-emmett**: skip empty file plans in scaffold output
|
|
35
|
+
- **server-generator-apollo-emmett**: filter state refs from given() in decide.specs.ts.ejs
|
|
36
|
+
- **server-generator-apollo-emmett**: move CS Given states from events to states array
|
|
37
|
+
- **global**: version packages
|
|
38
|
+
- **server-generator-apollo-emmett**: mark G1+G2 ketchup plan complete
|
|
39
|
+
|
|
40
|
+
- [`4255f6d`](https://github.com/BeOnAuto/auto-engineer/commit/4255f6db0d128979e573244a615886482ce799b0) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Updated ketchup plan for state reference fix in decide template generator
|
|
41
|
+
- Marked generator bug fix milestones G1 and G2 as complete
|
|
42
|
+
|
|
43
|
+
- [`62f1ea3`](https://github.com/BeOnAuto/auto-engineer/commit/62f1ea3dd1b4275211574e3df9d9a6571ae9b27a) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Fixed scaffold generation to correctly distinguish between event and state references in decision handlers
|
|
44
|
+
- Prevented contradictory instructions from appearing in generated code when Given clauses contain only state references
|
|
45
|
+
|
|
46
|
+
- [`ba4f5c9`](https://github.com/BeOnAuto/auto-engineer/commit/ba4f5c9749fb1c15d444e78ca9a2689817f039cb) Thanks [@rami-hatoum](https://github.com/rami-hatoum)! - - Added implementation plan for decide.ts code generation fixes in the Apollo Emmett server generator
|
|
47
|
+
|
|
3
48
|
## 1.147.0
|
|
4
49
|
|
|
5
50
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
# @auto-engineer/release-automation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Generate changesets from conventional commits with optional AI-generated changelogs.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
---
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
- ✅ **OSS-friendly** with free tier AI options and simple fallback
|
|
13
|
-
- ✅ **Library + CLI** - use programmatically or from command line
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
This package bridges the gap between conventional commits and [changesets](https://github.com/changesets/changesets). It parses your git history, determines the semver bump type, generates a human-readable changelog (using Claude CLI, the Anthropic API, or a simple formatter), and writes a changeset file. It works as a CLI in git hooks or CI, and as a library for programmatic use.
|
|
10
|
+
|
|
11
|
+
---
|
|
14
12
|
|
|
15
13
|
## Installation
|
|
16
14
|
|
|
@@ -20,209 +18,28 @@ pnpm add -D @auto-engineer/release-automation
|
|
|
20
18
|
|
|
21
19
|
## Quick Start
|
|
22
20
|
|
|
23
|
-
### CLI Usage
|
|
24
|
-
|
|
25
21
|
```bash
|
|
26
|
-
#
|
|
22
|
+
# Make conventional commits
|
|
23
|
+
git commit -m "feat(auth): add OAuth support"
|
|
24
|
+
git commit -m "fix(api): handle timeout errors"
|
|
25
|
+
|
|
26
|
+
# Generate a changeset from those commits
|
|
27
27
|
release-automation generate
|
|
28
28
|
|
|
29
|
-
# Preview without
|
|
29
|
+
# Preview without writing a file
|
|
30
30
|
release-automation generate --dry-run
|
|
31
31
|
|
|
32
|
-
# Check
|
|
33
|
-
release-automation check --
|
|
34
|
-
|
|
35
|
-
# Force simple changelog (no AI)
|
|
36
|
-
release-automation generate --provider simple
|
|
32
|
+
# Check whether changesets exist (useful in CI)
|
|
33
|
+
release-automation check --require-changesets
|
|
37
34
|
```
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
---
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
import {
|
|
43
|
-
getCommitsSinceLastChangeset,
|
|
44
|
-
parseConventionalCommits,
|
|
45
|
-
determineBumpType,
|
|
46
|
-
generateChangelog,
|
|
47
|
-
createChangesetFile,
|
|
48
|
-
discoverPackages,
|
|
49
|
-
} from '@auto-engineer/release-automation';
|
|
38
|
+
## How-to Guides
|
|
50
39
|
|
|
51
|
-
|
|
52
|
-
const commitHashes = getCommitsSinceLastChangeset();
|
|
53
|
-
|
|
54
|
-
// Parse conventional commits
|
|
55
|
-
const commits = parseConventionalCommits(commitHashes);
|
|
56
|
-
|
|
57
|
-
// Determine semver bump type
|
|
58
|
-
const bumpType = determineBumpType(commits); // 'major' | 'minor' | 'patch'
|
|
59
|
-
|
|
60
|
-
// Generate AI changelog
|
|
61
|
-
const description = await generateChangelog(commits);
|
|
62
|
-
|
|
63
|
-
// Discover packages from changeset config
|
|
64
|
-
const packages = await discoverPackages();
|
|
65
|
-
|
|
66
|
-
// Create changeset file
|
|
67
|
-
createChangesetFile({ bumpType, commits, description }, packages);
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## CLI Commands
|
|
71
|
-
|
|
72
|
-
### `generate`
|
|
40
|
+
### Configure for CI/CD
|
|
73
41
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
release-automation generate [options]
|
|
78
|
-
|
|
79
|
-
Options:
|
|
80
|
-
--since <ref> Git reference to compare against
|
|
81
|
-
--provider <type> Changelog provider (claude-cli|anthropic-api|simple|auto) (default: "auto")
|
|
82
|
-
--no-amend Do not amend the last commit
|
|
83
|
-
--dry-run Preview changeset without creating file
|
|
84
|
-
--config <path> Path to release config file
|
|
85
|
-
--changeset-dir <path> Changeset directory (default: .changeset)
|
|
86
|
-
--packages <names> Comma-separated package names (overrides config)
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
**Exit codes:**
|
|
90
|
-
- `0` - Success
|
|
91
|
-
- `1` - General error
|
|
92
|
-
- `10` - No changesets found (with `--require-changesets`)
|
|
93
|
-
- `11` - No commits to process
|
|
94
|
-
- `12` - No conventional commits found
|
|
95
|
-
- `20` - Configuration error
|
|
96
|
-
- `30` - Git error
|
|
97
|
-
|
|
98
|
-
### `check`
|
|
99
|
-
|
|
100
|
-
Check for pending changesets or commits that need changesets.
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
release-automation check [options]
|
|
104
|
-
|
|
105
|
-
Options:
|
|
106
|
-
--since <ref> Check commits since this reference
|
|
107
|
-
-v, --verbose Show detailed information
|
|
108
|
-
--require-changesets Exit with error if no changesets exist
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
## Configuration
|
|
112
|
-
|
|
113
|
-
### Environment Variables
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
# Enable/disable features
|
|
117
|
-
AUTO_CHANGESET_ENABLED=true|false # Enable auto-changeset (default: true)
|
|
118
|
-
AUTO_CHANGESET_AMEND=true|false # Auto-amend commits (default: true)
|
|
119
|
-
|
|
120
|
-
# Changelog generation
|
|
121
|
-
AUTO_CHANGESET_PROVIDER=auto|claude-cli|anthropic-api|simple # Provider (default: auto)
|
|
122
|
-
ANTHROPIC_API_KEY=sk-ant-... # For anthropic-api provider
|
|
123
|
-
|
|
124
|
-
# Paths
|
|
125
|
-
AUTO_CHANGESET_CONFIG_PATH=.changeset/config.json # Changeset config path
|
|
126
|
-
AUTO_CHANGESET_DIR=.changeset # Changeset directory
|
|
127
|
-
|
|
128
|
-
# Package discovery
|
|
129
|
-
AUTO_CHANGESET_PACKAGES=@pkg/a,@pkg/b # Override package discovery
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Config File
|
|
133
|
-
|
|
134
|
-
Create `.release-automation.json`:
|
|
135
|
-
|
|
136
|
-
```json
|
|
137
|
-
{
|
|
138
|
-
"changesetConfigPath": ".changeset/config.json",
|
|
139
|
-
"changelogProvider": "auto",
|
|
140
|
-
"autoAmend": true,
|
|
141
|
-
"changesetDir": ".changeset"
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Or add to `package.json`:
|
|
146
|
-
|
|
147
|
-
```json
|
|
148
|
-
{
|
|
149
|
-
"releaseAutomation": {
|
|
150
|
-
"changelogProvider": "auto",
|
|
151
|
-
"autoAmend": true
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## Changelog Providers
|
|
157
|
-
|
|
158
|
-
The package tries providers in order until one succeeds:
|
|
159
|
-
|
|
160
|
-
### 1. Claude CLI (Fastest)
|
|
161
|
-
|
|
162
|
-
Requires `claude` in PATH.
|
|
163
|
-
|
|
164
|
-
```bash
|
|
165
|
-
# Check availability
|
|
166
|
-
which claude
|
|
167
|
-
|
|
168
|
-
# Install Claude CLI
|
|
169
|
-
# See: https://docs.anthropic.com/claude/docs/claude-cli
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### 2. Anthropic API
|
|
173
|
-
|
|
174
|
-
Requires `ANTHROPIC_API_KEY` environment variable.
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
export ANTHROPIC_API_KEY=sk-ant-...
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
**Free tier:** $5 credit = 5000+ changeset generations (at ~$0.001 each)
|
|
181
|
-
|
|
182
|
-
**Get API key:** https://console.anthropic.com
|
|
183
|
-
|
|
184
|
-
### 3. Simple Fallback
|
|
185
|
-
|
|
186
|
-
Always available. Formats commit messages into bullet points:
|
|
187
|
-
|
|
188
|
-
- Groups by type (feat, fix, others)
|
|
189
|
-
- Adds scope formatting
|
|
190
|
-
- Limits to 5 items
|
|
191
|
-
|
|
192
|
-
## Git Hook Integration
|
|
193
|
-
|
|
194
|
-
Add to `.husky/pre-push`:
|
|
195
|
-
|
|
196
|
-
```bash
|
|
197
|
-
#!/bin/sh
|
|
198
|
-
|
|
199
|
-
# Check if enabled
|
|
200
|
-
if [ "${AUTO_CHANGESET_ENABLED:-true}" = "false" ]; then
|
|
201
|
-
echo "⏭️ Auto-changeset disabled"
|
|
202
|
-
exit 0
|
|
203
|
-
fi
|
|
204
|
-
|
|
205
|
-
# Generate changesets
|
|
206
|
-
pnpm release-automation generate
|
|
207
|
-
|
|
208
|
-
# Check exit code
|
|
209
|
-
EXIT_CODE=$?
|
|
210
|
-
if [ $EXIT_CODE -ne 0 ] && [ $EXIT_CODE -ne 11 ] && [ $EXIT_CODE -ne 12 ]; then
|
|
211
|
-
echo "❌ Failed to generate changeset"
|
|
212
|
-
exit $EXIT_CODE
|
|
213
|
-
fi
|
|
214
|
-
|
|
215
|
-
# Amend commit if configured
|
|
216
|
-
if [ "${AUTO_CHANGESET_AMEND:-true}" = "true" ]; then
|
|
217
|
-
if [ -n "$(git status --porcelain .changeset/*.md 2>/dev/null)" ]; then
|
|
218
|
-
git add .changeset/*.md
|
|
219
|
-
git commit --amend --no-edit --no-verify
|
|
220
|
-
echo "✅ Changesets added to commit!"
|
|
221
|
-
fi
|
|
222
|
-
fi
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
## GitHub Actions Integration
|
|
42
|
+
Add a changeset check step to your GitHub Actions workflow:
|
|
226
43
|
|
|
227
44
|
```yaml
|
|
228
45
|
- name: Check for changesets
|
|
@@ -248,266 +65,184 @@ fi
|
|
|
248
65
|
git push
|
|
249
66
|
```
|
|
250
67
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
### Git Operations
|
|
254
|
-
|
|
255
|
-
```typescript
|
|
256
|
-
import {
|
|
257
|
-
getCommitsSinceLastChangeset,
|
|
258
|
-
getCommitsInRange,
|
|
259
|
-
getAllCommits,
|
|
260
|
-
getCommitsSinceLastTag,
|
|
261
|
-
getLastChangesetCommit,
|
|
262
|
-
getLastReleaseTag,
|
|
263
|
-
getCommitMessage,
|
|
264
|
-
isGitRepository,
|
|
265
|
-
} from '@auto-engineer/release-automation';
|
|
266
|
-
|
|
267
|
-
// Get commits since last changeset
|
|
268
|
-
const commits = getCommitsSinceLastChangeset('.changeset');
|
|
269
|
-
|
|
270
|
-
// Get commits in range
|
|
271
|
-
const commits = getCommitsInRange('v1.0.0', 'HEAD');
|
|
272
|
-
|
|
273
|
-
// Check if in git repo
|
|
274
|
-
if (isGitRepository()) {
|
|
275
|
-
// ...
|
|
276
|
-
}
|
|
277
|
-
```
|
|
68
|
+
### Set Up a Pre-push Hook
|
|
278
69
|
|
|
279
|
-
|
|
70
|
+
Add to `.husky/pre-push`:
|
|
280
71
|
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
parseConventionalCommit,
|
|
284
|
-
parseConventionalCommits,
|
|
285
|
-
isConventionalCommit,
|
|
286
|
-
extractBreakingChange,
|
|
287
|
-
} from '@auto-engineer/release-automation';
|
|
72
|
+
```bash
|
|
73
|
+
#!/bin/sh
|
|
288
74
|
|
|
289
|
-
|
|
290
|
-
|
|
75
|
+
if [ "${AUTO_CHANGESET_ENABLED:-true}" = "false" ]; then
|
|
76
|
+
exit 0
|
|
77
|
+
fi
|
|
291
78
|
|
|
292
|
-
|
|
293
|
-
const commits = parseConventionalCommits(['abc123', 'def456']);
|
|
79
|
+
pnpm release-automation generate
|
|
294
80
|
|
|
295
|
-
|
|
296
|
-
if
|
|
297
|
-
|
|
298
|
-
|
|
81
|
+
EXIT_CODE=$?
|
|
82
|
+
if [ $EXIT_CODE -ne 0 ] && [ $EXIT_CODE -ne 11 ] && [ $EXIT_CODE -ne 12 ]; then
|
|
83
|
+
exit $EXIT_CODE
|
|
84
|
+
fi
|
|
299
85
|
|
|
300
|
-
|
|
301
|
-
if (
|
|
302
|
-
|
|
303
|
-
|
|
86
|
+
if [ "${AUTO_CHANGESET_AMEND:-true}" = "true" ]; then
|
|
87
|
+
if [ -n "$(git status --porcelain .changeset/*.md 2>/dev/null)" ]; then
|
|
88
|
+
git add .changeset/*.md
|
|
89
|
+
git commit --amend --no-edit --no-verify
|
|
90
|
+
fi
|
|
91
|
+
fi
|
|
304
92
|
```
|
|
305
93
|
|
|
306
|
-
###
|
|
94
|
+
### Use as a Library
|
|
307
95
|
|
|
308
96
|
```typescript
|
|
309
97
|
import {
|
|
98
|
+
getCommitsSinceLastChangeset,
|
|
99
|
+
parseConventionalCommits,
|
|
310
100
|
determineBumpType,
|
|
311
|
-
|
|
312
|
-
|
|
101
|
+
generateChangelog,
|
|
102
|
+
createChangesetFile,
|
|
103
|
+
discoverPackages,
|
|
313
104
|
} from '@auto-engineer/release-automation';
|
|
314
105
|
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
// Determine bump type (major > minor > patch)
|
|
106
|
+
const commitHashes = getCommitsSinceLastChangeset();
|
|
107
|
+
const commits = parseConventionalCommits(commitHashes);
|
|
318
108
|
const bumpType = determineBumpType(commits);
|
|
109
|
+
const description = await generateChangelog(commits);
|
|
110
|
+
const packages = await discoverPackages();
|
|
319
111
|
|
|
320
|
-
|
|
321
|
-
if (hasBreakingChanges(commits)) {
|
|
322
|
-
// Major version bump
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
// Check for features
|
|
326
|
-
if (hasFeatures(commits)) {
|
|
327
|
-
// Minor version bump
|
|
328
|
-
}
|
|
112
|
+
createChangesetFile({ bumpType, commits, description }, packages);
|
|
329
113
|
```
|
|
330
114
|
|
|
331
|
-
### Changelog
|
|
115
|
+
### Choose a Changelog Provider
|
|
332
116
|
|
|
333
|
-
|
|
334
|
-
import { generateChangelog } from '@auto-engineer/release-automation';
|
|
335
|
-
|
|
336
|
-
const commits = parseConventionalCommits(hashes);
|
|
117
|
+
In `auto` mode (the default), providers are tried in order until one succeeds:
|
|
337
118
|
|
|
338
|
-
|
|
339
|
-
|
|
119
|
+
1. **Claude CLI** -- requires `claude` on `PATH`.
|
|
120
|
+
2. **Anthropic API** -- requires `ANTHROPIC_API_KEY` env var.
|
|
121
|
+
3. **Simple** -- always available; formats commits as bullet points grouped by type.
|
|
340
122
|
|
|
341
|
-
|
|
342
|
-
const changelog = await generateChangelog(commits, {
|
|
343
|
-
changelogProvider: 'simple',
|
|
344
|
-
});
|
|
123
|
+
Force a specific provider:
|
|
345
124
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
changelogProvider: 'anthropic-api',
|
|
349
|
-
anthropicApiKey: 'sk-ant-...',
|
|
350
|
-
});
|
|
125
|
+
```bash
|
|
126
|
+
release-automation generate --provider simple
|
|
351
127
|
```
|
|
352
128
|
|
|
353
|
-
|
|
129
|
+
---
|
|
354
130
|
|
|
355
|
-
|
|
356
|
-
import {
|
|
357
|
-
discoverPackages,
|
|
358
|
-
readChangesetConfig,
|
|
359
|
-
getFixedGroupPackages,
|
|
360
|
-
} from '@auto-engineer/release-automation';
|
|
131
|
+
## CLI Reference
|
|
361
132
|
|
|
362
|
-
|
|
363
|
-
const packages = await discoverPackages('.changeset/config.json');
|
|
133
|
+
### `generate`
|
|
364
134
|
|
|
365
|
-
|
|
366
|
-
const config = await readChangesetConfig();
|
|
135
|
+
Generate a changeset from conventional commits.
|
|
367
136
|
|
|
368
|
-
|
|
369
|
-
|
|
137
|
+
```bash
|
|
138
|
+
release-automation generate [options]
|
|
370
139
|
```
|
|
371
140
|
|
|
372
|
-
|
|
141
|
+
| Option | Description | Default |
|
|
142
|
+
|---|---|---|
|
|
143
|
+
| `--since <ref>` | Git reference to compare against | auto-detect |
|
|
144
|
+
| `--provider <type>` | Changelog provider: `claude-cli`, `anthropic-api`, `simple`, `auto` | `auto` |
|
|
145
|
+
| `--no-amend` | Do not amend the last commit | -- |
|
|
146
|
+
| `--dry-run` | Preview changeset without creating a file | -- |
|
|
147
|
+
| `--config <path>` | Path to release config file | -- |
|
|
148
|
+
| `--changeset-dir <path>` | Changeset directory | `.changeset` |
|
|
149
|
+
| `--packages <names>` | Comma-separated package names (overrides discovery) | -- |
|
|
373
150
|
|
|
374
|
-
|
|
375
|
-
import {
|
|
376
|
-
createChangesetFile,
|
|
377
|
-
generateChangesetFrontmatter,
|
|
378
|
-
generateChangesetFilename,
|
|
379
|
-
} from '@auto-engineer/release-automation';
|
|
151
|
+
### `check`
|
|
380
152
|
|
|
381
|
-
|
|
382
|
-
const result = createChangesetFile(
|
|
383
|
-
{
|
|
384
|
-
bumpType: 'minor',
|
|
385
|
-
commits,
|
|
386
|
-
description: 'Changelog content',
|
|
387
|
-
},
|
|
388
|
-
['@pkg/a', '@pkg/b'],
|
|
389
|
-
'.changeset'
|
|
390
|
-
);
|
|
391
|
-
|
|
392
|
-
console.log(result.filename); // 'auto-a1b2c3d4.md'
|
|
393
|
-
console.log(result.path); // '/path/to/.changeset/auto-a1b2c3d4.md'
|
|
394
|
-
|
|
395
|
-
// Generate frontmatter
|
|
396
|
-
const frontmatter = generateChangesetFrontmatter(
|
|
397
|
-
['@pkg/a', '@pkg/b'],
|
|
398
|
-
'minor'
|
|
399
|
-
);
|
|
400
|
-
```
|
|
153
|
+
Check for pending changesets or commits that need changesets.
|
|
401
154
|
|
|
402
|
-
|
|
155
|
+
```bash
|
|
156
|
+
release-automation check [options]
|
|
157
|
+
```
|
|
403
158
|
|
|
404
|
-
|
|
405
|
-
|
|
159
|
+
| Option | Description | Default |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| `--since <ref>` | Check commits since this reference | auto-detect |
|
|
162
|
+
| `-v, --verbose` | Show detailed information | -- |
|
|
163
|
+
| `--require-changesets` | Exit with error if no changesets exist | -- |
|
|
406
164
|
|
|
407
|
-
|
|
408
|
-
const config = await loadConfig();
|
|
165
|
+
### Exit Codes
|
|
409
166
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
167
|
+
| Code | Meaning |
|
|
168
|
+
|---|---|
|
|
169
|
+
| `0` | Success |
|
|
170
|
+
| `1` | General error |
|
|
171
|
+
| `10` | No changesets found (with `--require-changesets`) |
|
|
172
|
+
| `11` | No commits to process |
|
|
173
|
+
| `12` | No conventional commits found |
|
|
174
|
+
| `20` | Configuration error |
|
|
175
|
+
| `30` | Git error |
|
|
416
176
|
|
|
417
|
-
|
|
177
|
+
### Configuration File
|
|
418
178
|
|
|
419
|
-
|
|
179
|
+
Create `.release-automation.json` in the project root:
|
|
420
180
|
|
|
181
|
+
```json
|
|
182
|
+
{
|
|
183
|
+
"changesetConfigPath": ".changeset/config.json",
|
|
184
|
+
"changelogProvider": "auto",
|
|
185
|
+
"autoAmend": true,
|
|
186
|
+
"changesetDir": ".changeset"
|
|
187
|
+
}
|
|
421
188
|
```
|
|
422
|
-
<type>(<scope>): <subject>
|
|
423
189
|
|
|
424
|
-
|
|
190
|
+
Or add a `releaseAutomation` key to `package.json`:
|
|
425
191
|
|
|
426
|
-
|
|
192
|
+
```json
|
|
193
|
+
{
|
|
194
|
+
"releaseAutomation": {
|
|
195
|
+
"changelogProvider": "auto",
|
|
196
|
+
"autoAmend": true
|
|
197
|
+
}
|
|
198
|
+
}
|
|
427
199
|
```
|
|
428
200
|
|
|
429
|
-
|
|
430
|
-
- `feat` - New feature (minor bump)
|
|
431
|
-
- `fix` - Bug fix (patch bump)
|
|
432
|
-
- `docs` - Documentation changes
|
|
433
|
-
- `style` - Code style changes (formatting, etc)
|
|
434
|
-
- `refactor` - Code refactoring
|
|
435
|
-
- `perf` - Performance improvements
|
|
436
|
-
- `test` - Test changes
|
|
437
|
-
- `build` - Build system changes
|
|
438
|
-
- `ci` - CI configuration changes
|
|
439
|
-
- `chore` - Other changes
|
|
440
|
-
- `revert` - Revert previous commit
|
|
441
|
-
|
|
442
|
-
**Breaking changes:**
|
|
443
|
-
- Add `!` after type: `feat!: breaking change`
|
|
444
|
-
- Add footer: `BREAKING CHANGE: description`
|
|
445
|
-
|
|
446
|
-
## Examples
|
|
201
|
+
### Environment Variables
|
|
447
202
|
|
|
448
|
-
|
|
203
|
+
| Variable | Description | Default |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| `AUTO_CHANGESET_ENABLED` | Enable/disable changeset generation | `true` |
|
|
206
|
+
| `AUTO_CHANGESET_AMEND` | Auto-amend commits with changeset | `true` |
|
|
207
|
+
| `AUTO_CHANGESET_PROVIDER` | Changelog provider | `auto` |
|
|
208
|
+
| `AUTO_CHANGESET_CONFIG_PATH` | Path to changeset config | `.changeset/config.json` |
|
|
209
|
+
| `AUTO_CHANGESET_DIR` | Changeset directory | `.changeset` |
|
|
210
|
+
| `AUTO_CHANGESET_PACKAGES` | Comma-separated package names | -- |
|
|
211
|
+
| `ANTHROPIC_API_KEY` | API key for `anthropic-api` provider | -- |
|
|
449
212
|
|
|
450
|
-
|
|
451
|
-
# Make some commits
|
|
452
|
-
git commit -m "feat(cli): add new command"
|
|
453
|
-
git commit -m "fix(server): resolve connection issue"
|
|
213
|
+
Configuration priority: CLI options > environment variables > config file > defaults.
|
|
454
214
|
|
|
455
|
-
|
|
456
|
-
pnpm release-automation generate
|
|
457
|
-
|
|
458
|
-
# Output:
|
|
459
|
-
# ✅ Found 2 valid conventional commit(s)
|
|
460
|
-
# 📊 Determined version bump: minor
|
|
461
|
-
# ✨ Generating changelog...
|
|
462
|
-
# ✅ Created changeset: auto-a1b2c3d4.md
|
|
463
|
-
```
|
|
215
|
+
---
|
|
464
216
|
|
|
465
|
-
|
|
217
|
+
## Troubleshooting
|
|
466
218
|
|
|
467
|
-
|
|
468
|
-
pnpm release-automation generate --dry-run
|
|
469
|
-
|
|
470
|
-
# Output:
|
|
471
|
-
# 📋 Changeset Preview:
|
|
472
|
-
# ---
|
|
473
|
-
# Bump type: minor
|
|
474
|
-
# Packages: @auto-engineer/cli, @auto-engineer/server
|
|
475
|
-
#
|
|
476
|
-
# Changelog:
|
|
477
|
-
# - Added new command functionality
|
|
478
|
-
# - Fixed connection stability issues
|
|
479
|
-
# ---
|
|
480
|
-
```
|
|
219
|
+
### Enable Debug Logging
|
|
481
220
|
|
|
482
|
-
|
|
221
|
+
The CLI uses `ora` spinners and `chalk`-colored log lines. To see raw output without spinners, pipe to a file:
|
|
483
222
|
|
|
484
223
|
```bash
|
|
485
|
-
|
|
486
|
-
pnpm release-automation check --require-changesets
|
|
487
|
-
|
|
488
|
-
# Exit code 0 if changesets exist
|
|
489
|
-
# Exit code 10 if no changesets
|
|
224
|
+
release-automation generate 2>&1 | tee release.log
|
|
490
225
|
```
|
|
491
226
|
|
|
492
|
-
## Troubleshooting
|
|
493
|
-
|
|
494
227
|
### "No conventional commits found"
|
|
495
228
|
|
|
496
|
-
|
|
229
|
+
Commits must follow the `type(scope): subject` format:
|
|
497
230
|
|
|
498
231
|
```bash
|
|
499
|
-
#
|
|
500
|
-
git commit -m "feat(cli): add
|
|
501
|
-
git commit -m "fix:
|
|
232
|
+
# Valid
|
|
233
|
+
git commit -m "feat(cli): add new command"
|
|
234
|
+
git commit -m "fix: resolve timeout"
|
|
502
235
|
|
|
503
|
-
#
|
|
236
|
+
# Invalid -- will be skipped
|
|
504
237
|
git commit -m "added feature"
|
|
505
238
|
git commit -m "WIP"
|
|
506
239
|
```
|
|
507
240
|
|
|
241
|
+
Supported types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`.
|
|
242
|
+
|
|
508
243
|
### "Failed to discover packages"
|
|
509
244
|
|
|
510
|
-
|
|
245
|
+
The package reads `.changeset/config.json` and looks for a `fixed` array:
|
|
511
246
|
|
|
512
247
|
```json
|
|
513
248
|
{
|
|
@@ -515,46 +250,63 @@ Check that `.changeset/config.json` exists and has a `fixed` array:
|
|
|
515
250
|
}
|
|
516
251
|
```
|
|
517
252
|
|
|
253
|
+
Glob patterns (e.g., `@auto-engineer/*`) are expanded by scanning `packages/*/package.json`. If you have no `packages/` directory, list package names explicitly with `--packages` or the `AUTO_CHANGESET_PACKAGES` env var.
|
|
254
|
+
|
|
518
255
|
### "Claude CLI not found"
|
|
519
256
|
|
|
520
|
-
|
|
257
|
+
If the `claude-cli` provider is unavailable, the tool falls back to `anthropic-api`, then `simple`. To skip AI entirely:
|
|
521
258
|
|
|
522
259
|
```bash
|
|
523
|
-
|
|
524
|
-
|
|
260
|
+
release-automation generate --provider simple
|
|
261
|
+
```
|
|
525
262
|
|
|
526
|
-
|
|
527
|
-
export ANTHROPIC_API_KEY=sk-ant-...
|
|
263
|
+
Or set the env var:
|
|
528
264
|
|
|
529
|
-
|
|
530
|
-
|
|
265
|
+
```bash
|
|
266
|
+
export AUTO_CHANGESET_PROVIDER=simple
|
|
531
267
|
```
|
|
532
268
|
|
|
533
|
-
|
|
269
|
+
### Changeset not created in expected directory
|
|
534
270
|
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
271
|
+
Verify the `--changeset-dir` option or `AUTO_CHANGESET_DIR` env var points to the correct path relative to the working directory. The directory is created automatically if it does not exist.
|
|
272
|
+
|
|
273
|
+
---
|
|
538
274
|
|
|
539
|
-
|
|
540
|
-
pnpm build
|
|
275
|
+
## Architecture
|
|
541
276
|
|
|
542
|
-
|
|
543
|
-
|
|
277
|
+
```mermaid
|
|
278
|
+
graph TD
|
|
279
|
+
CLI["bin/release-automation"]
|
|
280
|
+
CLI --> RunCli["cli/index.ts — runCli()"]
|
|
281
|
+
RunCli --> GenCmd["commands/generate"]
|
|
282
|
+
RunCli --> ChkCmd["commands/check"]
|
|
544
283
|
|
|
545
|
-
|
|
546
|
-
|
|
284
|
+
GenCmd --> Git["lib/git — commit history"]
|
|
285
|
+
GenCmd --> Parser["lib/changeset/parser — conventional commit parsing"]
|
|
286
|
+
GenCmd --> Semver["lib/changeset/semver — bump type detection"]
|
|
287
|
+
GenCmd --> Changelog["lib/changelog/generator — changelog text"]
|
|
288
|
+
GenCmd --> Packages["lib/packages/discovery — package list from config"]
|
|
289
|
+
GenCmd --> Writer["lib/changeset/writer — .changeset/*.md files"]
|
|
290
|
+
GenCmd --> Config["lib/config/loader — merged configuration"]
|
|
547
291
|
|
|
548
|
-
|
|
549
|
-
|
|
292
|
+
Changelog --> ClaudeCli["providers/claude-cli"]
|
|
293
|
+
Changelog --> AnthropicApi["providers/anthropic-api"]
|
|
294
|
+
Changelog --> Simple["providers/simple"]
|
|
550
295
|
```
|
|
551
296
|
|
|
552
|
-
|
|
297
|
+
### Subpath Exports
|
|
553
298
|
|
|
554
|
-
|
|
299
|
+
| Export | Entry point | Contents |
|
|
300
|
+
|---|---|---|
|
|
301
|
+
| `@auto-engineer/release-automation` | `src/index.ts` | Full public API (lib + types) |
|
|
302
|
+
| `@auto-engineer/release-automation/lib` | `src/lib/index.ts` | Library functions only |
|
|
303
|
+
| `@auto-engineer/release-automation/cli` | `src/cli/index.ts` | `runCli()` entry point |
|
|
555
304
|
|
|
556
|
-
|
|
305
|
+
### Dependencies
|
|
557
306
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
307
|
+
| Dependency | Purpose |
|
|
308
|
+
|---|---|
|
|
309
|
+
| `commander` | CLI argument parsing |
|
|
310
|
+
| `chalk` | Terminal colors for log output |
|
|
311
|
+
| `ora` | Spinner during changelog generation |
|
|
312
|
+
| `minimatch` | Glob matching for package discovery |
|
package/package.json
CHANGED