@logickernel/agileflow 0.12.0 → 0.13.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 +1 -5
- package/docs/branching-strategy.md +2 -2
- package/docs/conventional-commits.md +11 -11
- package/docs/getting-started.md +7 -14
- package/docs/release-management.md +8 -8
- package/package.json +2 -2
- package/src/utils.js +8 -9
package/README.md
CHANGED
|
@@ -161,11 +161,7 @@ AgileFlow analyzes commits since the last version tag to determine the appropria
|
|
|
161
161
|
| Breaking change | `feat!: redesign API` | **Minor** (0.1.0 → 0.2.0) | **Major** (1.0.0 → 2.0.0) |
|
|
162
162
|
| Feature | `feat: add login` | **Minor** | **Minor** |
|
|
163
163
|
| Fix | `fix: resolve crash` | **Patch** | **Patch** |
|
|
164
|
-
|
|
|
165
|
-
| Refactor | `refactor: simplify logic` | **Patch** | **Patch** |
|
|
166
|
-
| Build/CI | `build: update deps` | **Patch** | **Patch** |
|
|
167
|
-
| Docs only | `docs: update README` | No bump | No bump |
|
|
168
|
-
| Style changes | `style: update variable name` | No bump | No bump |
|
|
164
|
+
| Everything else | `docs: update README` | No bump | No bump |
|
|
169
165
|
|
|
170
166
|
---
|
|
171
167
|
|
|
@@ -189,8 +189,6 @@ AgileFlow determines version bumps from commits:
|
|
|
189
189
|
```bash
|
|
190
190
|
# Patch bump (v1.0.0 → v1.0.1)
|
|
191
191
|
fix: resolve login bug
|
|
192
|
-
perf: optimize queries
|
|
193
|
-
refactor: simplify logic
|
|
194
192
|
|
|
195
193
|
# Minor bump (v1.0.0 → v1.1.0)
|
|
196
194
|
feat: add user dashboard
|
|
@@ -199,6 +197,8 @@ feat: add user dashboard
|
|
|
199
197
|
feat!: remove deprecated API
|
|
200
198
|
|
|
201
199
|
# No bump
|
|
200
|
+
perf: optimize queries
|
|
201
|
+
refactor: simplify logic
|
|
202
202
|
docs: update README
|
|
203
203
|
chore: update dependencies
|
|
204
204
|
```
|
|
@@ -29,14 +29,14 @@ type(scope): description
|
|
|
29
29
|
|
|
30
30
|
| Type | Description | 1.0.0+ | 0.x.x |
|
|
31
31
|
|------|-------------|--------|-------|
|
|
32
|
-
| `feat` | New features | Minor |
|
|
32
|
+
| `feat` | New features | Minor | Minor |
|
|
33
33
|
| `fix` | Bug fixes | Patch | Patch |
|
|
34
|
-
| `perf` | Performance improvements |
|
|
35
|
-
| `refactor` | Code refactoring |
|
|
36
|
-
| `build` | Build system changes |
|
|
37
|
-
| `ci` | CI/CD changes |
|
|
38
|
-
| `test` | Test changes |
|
|
39
|
-
| `revert` | Revert commits |
|
|
34
|
+
| `perf` | Performance improvements | None | None |
|
|
35
|
+
| `refactor` | Code refactoring | None | None |
|
|
36
|
+
| `build` | Build system changes | None | None |
|
|
37
|
+
| `ci` | CI/CD changes | None | None |
|
|
38
|
+
| `test` | Test changes | None | None |
|
|
39
|
+
| `revert` | Revert commits | None | None |
|
|
40
40
|
| `docs` | Documentation | None | None |
|
|
41
41
|
| `style` | Code style | None | None |
|
|
42
42
|
| `chore` | Maintenance | None | None |
|
|
@@ -123,9 +123,9 @@ chore: update development dependencies
|
|
|
123
123
|
When multiple commits exist, the highest priority wins:
|
|
124
124
|
|
|
125
125
|
1. **Breaking changes** → Major (or Minor for 0.x.x)
|
|
126
|
-
2. **Features** → Minor
|
|
127
|
-
3. **Fixes
|
|
128
|
-
4. **
|
|
126
|
+
2. **Features** → Minor
|
|
127
|
+
3. **Fixes** → Patch
|
|
128
|
+
4. **Everything else** → No bump
|
|
129
129
|
|
|
130
130
|
### Example
|
|
131
131
|
|
|
@@ -190,7 +190,7 @@ docs: internal notes [skip release]
|
|
|
190
190
|
## Non-Conventional Commits
|
|
191
191
|
|
|
192
192
|
Commits not following the format:
|
|
193
|
-
- Trigger **
|
|
193
|
+
- Trigger **no bump** by default
|
|
194
194
|
- Appear under "Other changes" in release notes
|
|
195
195
|
- Use `[skip release]` to prevent bump
|
|
196
196
|
|
package/docs/getting-started.md
CHANGED
|
@@ -154,19 +154,12 @@ This creates an annotated tag and pushes it. Configure your CI to trigger on tag
|
|
|
154
154
|
|
|
155
155
|
AgileFlow analyzes commit messages to determine the bump:
|
|
156
156
|
|
|
157
|
-
| Commit Type | Example |
|
|
158
|
-
|
|
159
|
-
| Breaking change | `feat!: redesign API` | **Major** (1.0.0 → 2.0.0) |
|
|
160
|
-
| Feature | `feat: add login` | **Minor**
|
|
161
|
-
| Fix | `fix: resolve crash` | **Patch**
|
|
162
|
-
|
|
|
163
|
-
| Docs only | `docs: update README` | No bump |
|
|
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
|
|
157
|
+
| Commit Type | Example | 0.x.x | 1.0.0+ |
|
|
158
|
+
|-------------|---------|-------|--------|
|
|
159
|
+
| Breaking change | `feat!: redesign API` | **Minor** (0.1.0 → 0.2.0) | **Major** (1.0.0 → 2.0.0) |
|
|
160
|
+
| Feature | `feat: add login` | **Minor** | **Minor** |
|
|
161
|
+
| Fix | `fix: resolve crash` | **Patch** | **Patch** |
|
|
162
|
+
| Everything else | `docs: update README` | No bump | No bump |
|
|
170
163
|
|
|
171
164
|
### No Bump Needed
|
|
172
165
|
|
|
@@ -226,7 +219,7 @@ Yes! Running `npx @logickernel/agileflow` without a command shows the next versi
|
|
|
226
219
|
|
|
227
220
|
### No Version Bump Detected
|
|
228
221
|
- Use conventional commit format (`type: description`)
|
|
229
|
-
- Include bump-triggering types: `feat
|
|
222
|
+
- Include bump-triggering types: `feat` (minor) or `fix` (patch)
|
|
230
223
|
|
|
231
224
|
---
|
|
232
225
|
|
|
@@ -30,13 +30,12 @@ MAJOR.MINOR.PATCH
|
|
|
30
30
|
|
|
31
31
|
### Automatic Version Calculation
|
|
32
32
|
|
|
33
|
-
| Commit Type | Example |
|
|
34
|
-
|
|
35
|
-
| Breaking | `feat!:
|
|
36
|
-
| Feature | `feat: add login` | Minor |
|
|
37
|
-
| Fix | `fix: resolve crash` | Patch |
|
|
38
|
-
|
|
|
39
|
-
| No bump | `docs: update README` | None |
|
|
33
|
+
| Commit Type | Example | 0.x.x | 1.0.0+ |
|
|
34
|
+
|-------------|---------|-------|--------|
|
|
35
|
+
| Breaking change | `feat!: redesign API` | **Minor** (0.1.0 → 0.2.0) | **Major** (1.0.0 → 2.0.0) |
|
|
36
|
+
| Feature | `feat: add login` | **Minor** | **Minor** |
|
|
37
|
+
| Fix | `fix: resolve crash` | **Patch** | **Patch** |
|
|
38
|
+
| Everything else | `docs: update README` | No bump | No bump |
|
|
40
39
|
|
|
41
40
|
---
|
|
42
41
|
|
|
@@ -170,7 +169,8 @@ git tag -l -n99 v1.2.4
|
|
|
170
169
|
|
|
171
170
|
New projects start at v0.0.0:
|
|
172
171
|
|
|
173
|
-
- Features
|
|
172
|
+
- Features → Minor bump (0.0.0 → 0.1.0)
|
|
173
|
+
- Fixes → Patch bump (0.0.0 → 0.0.1)
|
|
174
174
|
- Breaking changes → Minor bump (0.0.0 → 0.1.0)
|
|
175
175
|
|
|
176
176
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@logickernel/agileflow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Automatic semantic versioning and changelog generation based on conventional commits",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -35,6 +35,6 @@
|
|
|
35
35
|
"type": "git",
|
|
36
36
|
"url": "git@code.logickernel.com:kernel/agileflow.git"
|
|
37
37
|
},
|
|
38
|
-
"author": "Víctor
|
|
38
|
+
"author": "Víctor Valle <victor.valle@logickernel.com>",
|
|
39
39
|
"license": "ISC"
|
|
40
40
|
}
|
package/src/utils.js
CHANGED
|
@@ -73,7 +73,6 @@ function getCurrentBranch() {
|
|
|
73
73
|
|
|
74
74
|
// Conventional commit type configuration
|
|
75
75
|
const TYPE_ORDER = ['feat', 'fix', 'perf', 'refactor', 'style', 'test', 'build', 'ci', 'docs', 'chore', 'revert'];
|
|
76
|
-
const PATCH_TYPES = ['fix', 'perf', 'refactor', 'test', 'build', 'ci', 'revert'];
|
|
77
76
|
const SEMVER_PATTERN = /^v(\d+)\.(\d+)\.(\d+)(-[a-zA-Z0-9.-]+)?$/;
|
|
78
77
|
|
|
79
78
|
// Friendly header names for changelog
|
|
@@ -208,19 +207,19 @@ function parseVersion(version) {
|
|
|
208
207
|
|
|
209
208
|
/**
|
|
210
209
|
* Determines version bump type based on commit analysis.
|
|
211
|
-
* @param {{hasBreaking: boolean, hasFeat: boolean,
|
|
210
|
+
* @param {{hasBreaking: boolean, hasFeat: boolean, hasFix: boolean}} analysis
|
|
212
211
|
* @param {boolean} isPreOneZero - Whether current version is 0.x.x
|
|
213
212
|
* @returns {'major'|'minor'|'patch'|'none'}
|
|
214
213
|
*/
|
|
215
214
|
function determineVersionBumpType(analysis, isPreOneZero) {
|
|
216
|
-
const { hasBreaking, hasFeat,
|
|
215
|
+
const { hasBreaking, hasFeat, hasFix } = analysis;
|
|
217
216
|
if (isPreOneZero) {
|
|
218
217
|
if (hasBreaking || hasFeat) return 'minor';
|
|
219
|
-
if (
|
|
218
|
+
if (hasFix) return 'patch';
|
|
220
219
|
} else {
|
|
221
220
|
if (hasBreaking) return 'major';
|
|
222
221
|
if (hasFeat) return 'minor';
|
|
223
|
-
if (
|
|
222
|
+
if (hasFix) return 'patch';
|
|
224
223
|
}
|
|
225
224
|
return 'none';
|
|
226
225
|
}
|
|
@@ -255,12 +254,12 @@ function isBreakingChange(commit, parsed) {
|
|
|
255
254
|
/**
|
|
256
255
|
* Analyzes commits to determine version bump requirements.
|
|
257
256
|
* @param {Array} commits - Array of commit objects
|
|
258
|
-
* @returns {{hasBreaking: boolean, hasFeat: boolean,
|
|
257
|
+
* @returns {{hasBreaking: boolean, hasFeat: boolean, hasFix: boolean, commitsByType: Object, breakingCommits: Array}}
|
|
259
258
|
*/
|
|
260
259
|
function analyzeCommitsForVersioning(commits) {
|
|
261
260
|
const commitsByType = Object.fromEntries(TYPE_ORDER.map(t => [t, []]));
|
|
262
261
|
const breakingCommits = [];
|
|
263
|
-
let hasBreaking = false, hasFeat = false,
|
|
262
|
+
let hasBreaking = false, hasFeat = false, hasFix = false;
|
|
264
263
|
|
|
265
264
|
for (const commit of commits) {
|
|
266
265
|
const parsed = parseConventionalCommit(commit.message);
|
|
@@ -275,7 +274,7 @@ function analyzeCommitsForVersioning(commits) {
|
|
|
275
274
|
} else {
|
|
276
275
|
// Only add to type sections if not breaking
|
|
277
276
|
if (type === 'feat') hasFeat = true;
|
|
278
|
-
else if (
|
|
277
|
+
else if (type === 'fix') hasFix = true;
|
|
279
278
|
|
|
280
279
|
if (commitsByType[type]) {
|
|
281
280
|
commitsByType[type].push(commit);
|
|
@@ -283,7 +282,7 @@ function analyzeCommitsForVersioning(commits) {
|
|
|
283
282
|
}
|
|
284
283
|
}
|
|
285
284
|
|
|
286
|
-
return { hasBreaking, hasFeat,
|
|
285
|
+
return { hasBreaking, hasFeat, hasFix, commitsByType, breakingCommits };
|
|
287
286
|
}
|
|
288
287
|
|
|
289
288
|
/**
|