@afoures/auto-release 0.2.12 → 0.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 +30 -269
- package/dist/lib/commands/check.mjs +10 -10
- package/dist/lib/commands/generate-release-pr.mjs +21 -21
- package/dist/lib/commands/init.mjs +40 -199
- package/dist/lib/commands/list.mjs +10 -10
- package/dist/lib/commands/manual-release.mjs +51 -32
- package/dist/lib/commands/record-change.mjs +19 -19
- package/dist/lib/commands/tag-release-commit.mjs +36 -30
- package/dist/lib/config.d.mts +8 -2
- package/dist/lib/config.mjs +13 -13
- package/dist/lib/formatter.mjs +15 -14
- package/dist/lib/types.d.mts +11 -5
- package/dist/lib/utils/branch-protection.mjs +0 -3
- package/dist/lib/utils/version.mjs +3 -3
- package/dist/lib/versioning/types.d.mts +4 -4
- package/docs/change-file-anatomy.md +31 -0
- package/docs/commands.md +80 -0
- package/docs/configuration.md +116 -0
- package/docs/lexicon.md +23 -0
- package/docs/recommended-usage.md +155 -0
- package/package.json +15 -14
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Recommended Usage Guide
|
|
2
|
+
|
|
3
|
+
This guide explains the recommended automated release workflow for the `auto-release` CLI.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This release workflow streamlines your release process by combining developer-led change tracking with CI-driven release generation. This approach offers several key benefits:
|
|
8
|
+
|
|
9
|
+
- **Testing before production**: Release candidates can be tested on staging before final deployment
|
|
10
|
+
- **Automated changelogs**: Change descriptions are automatically compiled into changelog
|
|
11
|
+
- **Safety through PRs**: All releases go through pull request review, preventing accidental deployments
|
|
12
|
+
- **Audit trail**: Every release is traceable through recorded change files and version history
|
|
13
|
+
|
|
14
|
+
## Workflow Diagram
|
|
15
|
+
|
|
16
|
+
// TODO
|
|
17
|
+
|
|
18
|
+
## The Automated Release Workflow
|
|
19
|
+
|
|
20
|
+
### Step 1: Developer Records Changes
|
|
21
|
+
|
|
22
|
+
Throughout development, developers record changes as they are made:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# Record a feature change for a specific project
|
|
26
|
+
auto-release record-change --project myapp --type feature
|
|
27
|
+
|
|
28
|
+
# Record a bug fix
|
|
29
|
+
auto-release record-change --project myapp --type fix
|
|
30
|
+
|
|
31
|
+
# Record a breaking change
|
|
32
|
+
auto-release record-change --project myapp --type breaking
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
This command:
|
|
36
|
+
|
|
37
|
+
- Creates a change file in `.changes/<project>/`
|
|
38
|
+
- Opens your default editor for a detailed description
|
|
39
|
+
- Generates a unique filename with timestamp
|
|
40
|
+
|
|
41
|
+
After recording, commit the change file alongside your code changes:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
git add .changes/myapp/
|
|
45
|
+
git commit -m "feat: add new login feature"
|
|
46
|
+
git push
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Step 2: Merge to Main Branch
|
|
50
|
+
|
|
51
|
+
Push your changes to the main branch through your normal process.
|
|
52
|
+
|
|
53
|
+
Before pushing, you can use (locally or in CI)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
auto-release check
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
to validate configuration and change files.
|
|
60
|
+
|
|
61
|
+
### Step 3: CI Generates Release PR
|
|
62
|
+
|
|
63
|
+
When changes are pushed to main, CI automatically generates a release PR:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
auto-release generate-release-pr --filter myapp
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This command:
|
|
70
|
+
|
|
71
|
+
- Scans `.changes/` for unreleased changes
|
|
72
|
+
- Bumps project's version numbers based on change types
|
|
73
|
+
- Generates a changelog from recorded changes
|
|
74
|
+
- Creates a release branch (`release/<project>`)
|
|
75
|
+
- Opens a pull request for review
|
|
76
|
+
|
|
77
|
+
### Step 4: CI Tests and Deploys to Staging
|
|
78
|
+
|
|
79
|
+
The release PR can trigger testing and staging deployment:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Run your test suite
|
|
83
|
+
# Build the project
|
|
84
|
+
# Deploy to staging environment
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
This step ensures the release candidate works correctly before production.
|
|
88
|
+
|
|
89
|
+
### Step 5: Merge Release PR
|
|
90
|
+
|
|
91
|
+
After staging tests pass, the team reviews and merges the release PR:
|
|
92
|
+
|
|
93
|
+
- Review the version changes and changelog
|
|
94
|
+
- Approve and merge to main
|
|
95
|
+
- Version changes now land on main
|
|
96
|
+
|
|
97
|
+
### Step 6: CI Tags and Deploys to Production
|
|
98
|
+
|
|
99
|
+
When the release PR is merged, CI creates tags and triggers production deployment:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
auto-release tag-release-commit
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
This command:
|
|
106
|
+
|
|
107
|
+
- Compares HEAD with HEAD^1 to find the merge commit
|
|
108
|
+
- Creates git tags for each project (`<project>@<version>`)
|
|
109
|
+
- Creates releases on the platform (GitHub/GitLab)
|
|
110
|
+
- Tags trigger production deployment CI
|
|
111
|
+
|
|
112
|
+
## Hot Fixes and Manual Releases
|
|
113
|
+
|
|
114
|
+
The `manual-release` command is available for special scenarios:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
auto-release manual-release --project myapp
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Usecases:**
|
|
121
|
+
|
|
122
|
+
- Local testing of release workflows
|
|
123
|
+
- Emergency hot fixes requiring immediate release
|
|
124
|
+
- Initial release setup
|
|
125
|
+
|
|
126
|
+
**Important warnings:**
|
|
127
|
+
|
|
128
|
+
- Not intended for CI use
|
|
129
|
+
- Bypasses the automated workflow safety checks
|
|
130
|
+
- Use only when the automated workflow is not suitable
|
|
131
|
+
|
|
132
|
+
## Best Practices for Developers
|
|
133
|
+
|
|
134
|
+
### When to Record Changes
|
|
135
|
+
|
|
136
|
+
Record changes as soon as you complete a feature or fix. Don't wait until release time, this ensures accurate changelogs and better documentation.
|
|
137
|
+
|
|
138
|
+
### Writing Effective Change Descriptions
|
|
139
|
+
|
|
140
|
+
Keep descriptions clear and concise:
|
|
141
|
+
|
|
142
|
+
- Explain what changed and why
|
|
143
|
+
- Include relevant context for end users
|
|
144
|
+
- Mention breaking changes prominently
|
|
145
|
+
- Include migration strategies if needed
|
|
146
|
+
|
|
147
|
+
### Reviewing Release PRs
|
|
148
|
+
|
|
149
|
+
When reviewing release PRs:
|
|
150
|
+
|
|
151
|
+
- Verify the version bump is correct given your versioning strategy
|
|
152
|
+
- Read the generated changelog for clarity
|
|
153
|
+
- Ensure all expected changes are included
|
|
154
|
+
|
|
155
|
+
If changes are needed, you should not modify the release PR but submit code through your normal process.
|
package/package.json
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@afoures/auto-release",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A file based release management tool for monorepos",
|
|
5
5
|
"homepage": "https://github.com/afoures/auto-release#readme",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/afoures/auto-release/issues"
|
|
8
8
|
},
|
|
9
|
+
"author": "Antoine Fourès <contact@afoures.com>",
|
|
9
10
|
"repository": {
|
|
10
11
|
"type": "git",
|
|
11
12
|
"url": "git+https://github.com/afoures/auto-release.git"
|
|
12
13
|
},
|
|
13
|
-
"
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"bin": {
|
|
16
|
+
"auto-release": "./dist/bin.mjs"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"docs",
|
|
21
|
+
"package.json",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
14
24
|
"type": "module",
|
|
15
25
|
"main": "./dist/index.mjs",
|
|
26
|
+
"module": "./dist/index.mjs",
|
|
27
|
+
"types": "./dist/index.d.mts",
|
|
16
28
|
"exports": {
|
|
17
29
|
".": {
|
|
18
30
|
"types": "./dist/index.d.mts",
|
|
@@ -32,16 +44,6 @@
|
|
|
32
44
|
"import": "./dist/versioning.mjs"
|
|
33
45
|
}
|
|
34
46
|
},
|
|
35
|
-
"module": "./dist/index.mjs",
|
|
36
|
-
"types": "./dist/index.d.mts",
|
|
37
|
-
"bin": {
|
|
38
|
-
"auto-release": "./dist/bin.mjs"
|
|
39
|
-
},
|
|
40
|
-
"files": [
|
|
41
|
-
"dist",
|
|
42
|
-
"package.json",
|
|
43
|
-
"README.md"
|
|
44
|
-
],
|
|
45
47
|
"dependencies": {
|
|
46
48
|
"@clack/prompts": "1.0.0-alpha.9",
|
|
47
49
|
"arkregex": "^0.0.5",
|
|
@@ -54,17 +56,16 @@
|
|
|
54
56
|
"devDependencies": {
|
|
55
57
|
"@types/mdast": "^4.0.4",
|
|
56
58
|
"@types/node": "^24.10.4",
|
|
57
|
-
"bumpp": "^10.3.2",
|
|
58
59
|
"oxfmt": "^0.20.0",
|
|
59
60
|
"oxlint": "^1.35.0",
|
|
60
61
|
"tsdown": "^0.18.3",
|
|
61
62
|
"typescript": "^5.9.3",
|
|
62
63
|
"vitest": "^4.0.16"
|
|
63
64
|
},
|
|
64
|
-
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81",
|
|
65
65
|
"engines": {
|
|
66
66
|
"node": ">=22.0.0"
|
|
67
67
|
},
|
|
68
|
+
"packageManager": "pnpm@8.15.9+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81",
|
|
68
69
|
"scripts": {
|
|
69
70
|
"build": "tsdown",
|
|
70
71
|
"dev": "tsdown --watch",
|