@logickernel/agileflow 0.2.2 → 0.4.1
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 +133 -211
- package/docs/README.md +39 -24
- package/docs/best-practices.md +201 -234
- package/docs/branching-strategy.md +153 -254
- package/docs/cli-reference.md +84 -64
- package/docs/configuration.md +154 -167
- package/docs/conventional-commits.md +207 -160
- package/docs/getting-started.md +162 -117
- package/docs/installation.md +244 -106
- package/docs/migration-guide.md +212 -299
- package/docs/release-management.md +195 -384
- package/docs/troubleshooting.md +276 -250
- package/docs/version-centric-cicd.md +239 -116
- package/package.json +3 -2
- package/src/index.js +47 -7
- package/src/utils.js +43 -13
package/docs/getting-started.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# Getting Started
|
|
1
|
+
# Getting Started
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Get up and running with AgileFlow in minutes. This guide covers local usage and CI/CD integration.
|
|
4
4
|
|
|
5
5
|
## What You'll Learn
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- Understanding of how the version-centric approach works
|
|
7
|
+
- How to preview your next version locally
|
|
8
|
+
- How to set up automatic versioning in CI/CD
|
|
9
|
+
- How conventional commits affect version bumps
|
|
11
10
|
|
|
12
11
|
## Prerequisites
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
- Node.js 14+ installed (for local usage)
|
|
13
|
+
- Node.js 14+ (for local usage)
|
|
16
14
|
- A Git repository with commit history
|
|
17
|
-
- Basic understanding of
|
|
15
|
+
- Basic understanding of conventional commits
|
|
16
|
+
|
|
17
|
+
---
|
|
18
18
|
|
|
19
19
|
## Quick Start
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### 1. Preview Your Next Version
|
|
22
22
|
|
|
23
|
-
Run AgileFlow
|
|
23
|
+
Run AgileFlow in any Git repository:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npx @logickernel/agileflow
|
|
@@ -30,7 +30,6 @@ Example output:
|
|
|
30
30
|
```
|
|
31
31
|
Current version: v1.2.3
|
|
32
32
|
Next version: v1.2.4
|
|
33
|
-
Commits since current version: 3
|
|
34
33
|
|
|
35
34
|
Changelog:
|
|
36
35
|
### fix
|
|
@@ -41,153 +40,199 @@ Changelog:
|
|
|
41
40
|
- update README with usage examples
|
|
42
41
|
```
|
|
43
42
|
|
|
44
|
-
###
|
|
43
|
+
### 2. Get Just the Version
|
|
45
44
|
|
|
46
|
-
Use `--quiet` to only
|
|
45
|
+
Use `--quiet` to output only the version (useful for scripts):
|
|
47
46
|
|
|
48
47
|
```bash
|
|
49
48
|
VERSION=$(npx @logickernel/agileflow --quiet)
|
|
50
|
-
echo "Next version
|
|
49
|
+
echo "Next version: $VERSION"
|
|
51
50
|
```
|
|
52
51
|
|
|
52
|
+
---
|
|
53
|
+
|
|
53
54
|
## CI/CD Integration
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
AgileFlow uses a **decoupled architecture**:
|
|
56
57
|
|
|
57
|
-
1. **
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
| `AGILEFLOW_TOKEN` | Your GitLab API token | Yes | Yes |
|
|
64
|
-
|
|
65
|
-
Create the token at **Settings > Access Tokens** with:
|
|
66
|
-
- **Name**: AgileFlow Bot
|
|
67
|
-
- **Role**: Maintainer
|
|
68
|
-
- **Scopes**: api
|
|
69
|
-
|
|
70
|
-
2. **Add AgileFlow to your pipeline**
|
|
71
|
-
|
|
72
|
-
```yaml
|
|
73
|
-
stages:
|
|
74
|
-
- version
|
|
75
|
-
- build
|
|
76
|
-
|
|
77
|
-
agileflow:
|
|
78
|
-
stage: version
|
|
79
|
-
image: node:20-alpine
|
|
80
|
-
script:
|
|
81
|
-
- npx @logickernel/agileflow gitlab
|
|
82
|
-
only:
|
|
83
|
-
- main
|
|
84
|
-
|
|
85
|
-
build:
|
|
86
|
-
stage: build
|
|
87
|
-
script:
|
|
88
|
-
- echo "Building..."
|
|
89
|
-
needs:
|
|
90
|
-
- agileflow
|
|
91
|
-
```
|
|
58
|
+
1. **AgileFlow creates a version tag** (on merge to main)
|
|
59
|
+
2. **Your pipelines trigger on the tag** (build, deploy, etc.)
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
Merge to main ──▶ AgileFlow ──▶ Tag v1.2.3 ──▶ Your build/deploy
|
|
63
|
+
```
|
|
92
64
|
|
|
93
65
|
### GitHub Actions
|
|
94
66
|
|
|
95
|
-
1
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
67
|
+
**Step 1**: Add a secret `AGILEFLOW_TOKEN` with a Personal Access Token (`contents: write` permission).
|
|
68
|
+
|
|
69
|
+
**Step 2**: Create `.github/workflows/version.yml`:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
name: Version
|
|
73
|
+
on:
|
|
74
|
+
push:
|
|
75
|
+
branches: [main]
|
|
76
|
+
|
|
77
|
+
jobs:
|
|
78
|
+
version:
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
steps:
|
|
81
|
+
- uses: actions/checkout@v4
|
|
82
|
+
with:
|
|
83
|
+
fetch-depth: 0
|
|
84
|
+
|
|
85
|
+
- uses: actions/setup-node@v4
|
|
86
|
+
with:
|
|
87
|
+
node-version: '20'
|
|
88
|
+
|
|
89
|
+
- name: Create version tag
|
|
90
|
+
env:
|
|
91
|
+
AGILEFLOW_TOKEN: ${{ secrets.AGILEFLOW_TOKEN }}
|
|
92
|
+
run: npx @logickernel/agileflow github
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Step 3**: Create `.github/workflows/release.yml` for builds:
|
|
96
|
+
|
|
97
|
+
```yaml
|
|
98
|
+
name: Release
|
|
99
|
+
on:
|
|
100
|
+
push:
|
|
101
|
+
tags:
|
|
102
|
+
- 'v*'
|
|
103
|
+
|
|
104
|
+
jobs:
|
|
105
|
+
build:
|
|
106
|
+
runs-on: ubuntu-latest
|
|
107
|
+
steps:
|
|
108
|
+
- uses: actions/checkout@v4
|
|
109
|
+
- run: |
|
|
110
|
+
VERSION=${GITHUB_REF#refs/tags/}
|
|
111
|
+
echo "Building $VERSION"
|
|
112
|
+
docker build -t myapp:$VERSION .
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### GitLab CI
|
|
116
|
+
|
|
117
|
+
**Step 1**: Add a CI/CD variable `AGILEFLOW_TOKEN` with a Project Access Token (`api` scope, `Maintainer` role).
|
|
118
|
+
|
|
119
|
+
**Step 2**: Update `.gitlab-ci.yml`:
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
# Runs on merge to main - creates the tag
|
|
123
|
+
agileflow:
|
|
124
|
+
stage: version
|
|
125
|
+
image: node:20-alpine
|
|
126
|
+
script:
|
|
127
|
+
- npx @logickernel/agileflow gitlab
|
|
128
|
+
rules:
|
|
129
|
+
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
130
|
+
|
|
131
|
+
# Runs on tag creation - builds the release
|
|
132
|
+
build:
|
|
133
|
+
stage: build
|
|
134
|
+
script:
|
|
135
|
+
- echo "Building $CI_COMMIT_TAG"
|
|
136
|
+
- docker build -t myapp:$CI_COMMIT_TAG .
|
|
137
|
+
rules:
|
|
138
|
+
- if: '$CI_COMMIT_TAG =~ /^v/'
|
|
139
|
+
```
|
|
126
140
|
|
|
127
141
|
### Native Git Push
|
|
128
142
|
|
|
129
|
-
|
|
143
|
+
For other platforms:
|
|
130
144
|
|
|
131
145
|
```bash
|
|
132
146
|
npx @logickernel/agileflow push
|
|
133
147
|
```
|
|
134
148
|
|
|
135
|
-
This creates an annotated tag and pushes it to
|
|
149
|
+
This creates an annotated tag and pushes it. Configure your CI to trigger on tags.
|
|
136
150
|
|
|
137
|
-
|
|
151
|
+
---
|
|
138
152
|
|
|
139
|
-
|
|
140
|
-
- Analyzes commit messages since the last version tag
|
|
141
|
-
- Uses conventional commits to determine version bump type
|
|
142
|
-
- Generates semantic versions automatically (v1.0.0, v1.0.1, etc.)
|
|
153
|
+
## How Version Bumps Work
|
|
143
154
|
|
|
144
|
-
|
|
155
|
+
AgileFlow analyzes commit messages to determine the bump:
|
|
145
156
|
|
|
146
157
|
| Commit Type | Example | Version Bump |
|
|
147
158
|
|-------------|---------|--------------|
|
|
148
|
-
| Breaking change | `feat!: redesign API` | Major (1.0.0 → 2.0.0) |
|
|
149
|
-
| Feature | `feat: add login` | Minor (1.0.0 → 1.1.0) |
|
|
150
|
-
| Fix | `fix: resolve crash` | Patch (1.0.0 → 1.0.1) |
|
|
151
|
-
| Performance | `perf: optimize query` | Patch |
|
|
152
|
-
| Refactor | `refactor: simplify logic` | Patch |
|
|
159
|
+
| Breaking change | `feat!: redesign API` | **Major** (1.0.0 → 2.0.0) |
|
|
160
|
+
| Feature | `feat: add login` | **Minor** (1.0.0 → 1.1.0) |
|
|
161
|
+
| Fix | `fix: resolve crash` | **Patch** (1.0.0 → 1.0.1) |
|
|
162
|
+
| Performance | `perf: optimize query` | **Patch** |
|
|
153
163
|
| Docs only | `docs: update README` | No bump |
|
|
154
|
-
|
|
164
|
+
|
|
165
|
+
### Pre-1.0.0 Behavior
|
|
166
|
+
|
|
167
|
+
During initial development (0.x.x):
|
|
168
|
+
- Features and fixes → **patch** bump
|
|
169
|
+
- Breaking changes → **minor** bump
|
|
155
170
|
|
|
156
171
|
### No Bump Needed
|
|
157
172
|
|
|
158
|
-
If all commits
|
|
173
|
+
If all commits are docs/chore/style types, AgileFlow skips tag creation.
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Your First Release
|
|
178
|
+
|
|
179
|
+
### Starting Fresh
|
|
180
|
+
|
|
181
|
+
No version tags? AgileFlow starts from v0.0.0:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
git commit -m "feat: initial project setup"
|
|
185
|
+
# → Creates v0.0.1
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Creating v1.0.0
|
|
189
|
+
|
|
190
|
+
Version 1.0.0 is your first stable release. Create it manually when ready:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
git tag -a v1.0.0 -m "First stable release"
|
|
194
|
+
git push origin v1.0.0
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
After v1.0.0, AgileFlow continues with standard semantic versioning.
|
|
198
|
+
|
|
199
|
+
---
|
|
159
200
|
|
|
160
201
|
## Common Questions
|
|
161
202
|
|
|
162
|
-
|
|
163
|
-
A: AgileFlow analyzes your commit messages using conventional commits. Features bump the minor version, fixes bump the patch version, and breaking changes bump the major version.
|
|
203
|
+
**How does the decoupled approach work?**
|
|
164
204
|
|
|
165
|
-
|
|
166
|
-
A: AgileFlow starts from v0.0.0 and calculates the first version based on your commits.
|
|
205
|
+
AgileFlow only creates version tags. Your build/deploy pipelines are separate workflows that trigger on tag creation. This keeps versioning independent from your build process.
|
|
167
206
|
|
|
168
|
-
|
|
169
|
-
A: Yes! Run `npx @logickernel/agileflow` to preview the next version without creating any tags.
|
|
207
|
+
**What if no version bump is needed?**
|
|
170
208
|
|
|
171
|
-
|
|
172
|
-
A: The push commands (`push`, `gitlab`, `github`) will skip tag creation and exit successfully.
|
|
209
|
+
AgileFlow skips tag creation. No tag means no build/deploy triggered.
|
|
173
210
|
|
|
174
|
-
|
|
211
|
+
**Can I preview without creating tags?**
|
|
175
212
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
213
|
+
Yes! Running `npx @logickernel/agileflow` without a command shows the next version without creating anything.
|
|
214
|
+
|
|
215
|
+
---
|
|
216
|
+
|
|
217
|
+
## Troubleshooting
|
|
179
218
|
|
|
180
219
|
### "AGILEFLOW_TOKEN not set" Error
|
|
181
|
-
-
|
|
182
|
-
-
|
|
220
|
+
- Verify the environment variable is configured
|
|
221
|
+
- Check token permissions (GitHub: `contents: write`, GitLab: `api` scope)
|
|
222
|
+
|
|
223
|
+
### Tag Created but Build Didn't Run
|
|
224
|
+
- Ensure your release workflow triggers on `tags: ['v*']`
|
|
225
|
+
- Check the tag pattern in your CI configuration
|
|
183
226
|
|
|
184
227
|
### No Version Bump Detected
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
|
|
228
|
+
- Use conventional commit format (`type: description`)
|
|
229
|
+
- Include bump-triggering types: `feat`, `fix`, `perf`, etc.
|
|
230
|
+
|
|
231
|
+
---
|
|
188
232
|
|
|
189
233
|
## Next Steps
|
|
190
234
|
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
235
|
+
- [CLI Reference](./cli-reference.md) — All commands and options
|
|
236
|
+
- [Installation Guide](./installation.md) — Detailed setup
|
|
237
|
+
- [Conventional Commits](./conventional-commits.md) — Commit format
|
|
238
|
+
- [Version-Centric CI/CD](./version-centric-cicd.md) — The methodology
|