brel 0.1.2 → 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/CHANGELOG.md CHANGED
@@ -1,4 +1,27 @@
1
- ## [unreleased]
1
+ ## [0.3.0] - 2026-02-18
2
+
3
+ ### 🚀 Features
4
+
5
+ - Version_selector dsl
6
+
7
+ ### 💼 Other
8
+
9
+ - Cargo release
10
+ ## [0.2.0] - 2026-02-18
11
+
12
+ ### 🚀 Features
13
+
14
+ - Tag after release
15
+ - Tag templating
16
+
17
+ ### 🐛 Bug Fixes
18
+
19
+ - Changelog generation tag
20
+
21
+ ### ⚙️ Miscellaneous Tasks
22
+
23
+ - *(release)* V0.2.0
24
+ ## [0.1.2] - 2026-02-18
2
25
 
3
26
  ### 🐛 Bug Fixes
4
27
 
package/README.md CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  - `brel init` generates a managed GitHub Actions workflow.
8
8
  - `brel release-pr` computes the next version, updates configured files, commits, pushes, and creates/updates a release PR.
9
+ - `brel next-version` computes the next releasable version and prints it as plain SemVer.
9
10
 
10
11
  ## `release-pr` Prerequisites
11
12
 
@@ -50,6 +51,10 @@ pr_template_file = ".github/brel/release-pr-body.hbs"
50
51
  enabled = true
51
52
  output_file = "CHANGELOG.md"
52
53
 
54
+ [release_pr.tagging]
55
+ enabled = false
56
+ tag_template = "v{version}"
57
+
53
58
  [release_pr.commit_author]
54
59
  name = "brel[bot]"
55
60
  email = "brel[bot]@users.noreply.github.com"
@@ -59,7 +64,7 @@ email = "brel[bot]@users.noreply.github.com"
59
64
 
60
65
  When you run `brel release-pr`:
61
66
 
62
- 1. It finds the highest stable SemVer tag (`vX.Y.Z` or `X.Y.Z`).
67
+ 1. It finds the highest stable SemVer tag that matches `release_pr.tagging.tag_template` (default `v{version}`).
63
68
  2. If no valid tag exists, it uses `0.0.0`.
64
69
  3. It scans commits since that tag (or all commits when no tag exists).
65
70
  4. It picks one bump level from Conventional Commit signals:
@@ -68,9 +73,19 @@ When you run `brel release-pr`:
68
73
  - patch: `fix: ...`
69
74
  5. If no releasable commits are found, it exits successfully with no changes.
70
75
 
76
+ `brel next-version` uses the same versioning rules:
77
+
78
+ - when releasable commits exist, it prints the next version (for example `1.2.3`)
79
+ - when none exist, it prints nothing and exits successfully
80
+
71
81
  ## How File Updates Work
72
82
 
73
- - `release_pr.version_updates` maps exact repo-relative file paths to dot-separated key paths.
83
+ - `release_pr.version_updates` maps exact repo-relative file paths to selector paths.
84
+ - Selector syntax:
85
+ - key: `version`
86
+ - nested key: `package.version`
87
+ - index selector: `packages[0].version`
88
+ - filter selector: `package[name=brel].version`
74
89
  - Supported file formats:
75
90
  - inferred from extension (`.json`, `.toml`)
76
91
  - or forced via `release_pr.format_overrides`
@@ -78,13 +93,28 @@ When you run `brel release-pr`:
78
93
  - a file is missing,
79
94
  - format cannot be determined,
80
95
  - parse fails,
81
- - a key path does not exist,
82
- - target value is not scalar.
96
+ - a selector is invalid,
97
+ - a selector matches no values,
98
+ - a selector uses index/filter on a non-array segment,
99
+ - a matched value is not a string.
100
+ - Match behavior:
101
+ - all values matched by a selector are updated
102
+ - selectors do not create missing keys/paths
83
103
 
84
- Example key paths:
104
+ Example selectors:
85
105
 
86
106
  - JSON: `"package.json" = ["version", "tooling.release.version"]`
107
+ - JSON with filter: `"package.json" = ["package[name=brel].version"]`
87
108
  - TOML: `"Cargo.toml" = ["package.version"]`
109
+ - Cargo.lock (explicit format override required):
110
+
111
+ ```toml
112
+ [release_pr.version_updates]
113
+ "Cargo.lock" = ["package[name=brel].version"]
114
+
115
+ [release_pr.format_overrides]
116
+ "Cargo.lock" = "toml"
117
+ ```
88
118
 
89
119
  ## Changelog Generation (`git-cliff`)
90
120
 
@@ -92,6 +122,10 @@ Example key paths:
92
122
  - Configure changelog behavior with `[release_pr.changelog]`:
93
123
  - `enabled` (default `true`)
94
124
  - `output_file` (default `"CHANGELOG.md"`)
125
+ - Generated workflow behavior:
126
+ - computes `next-version` first via `brel next-version`
127
+ - runs `git-cliff` only when a next version exists
128
+ - passes `--unreleased --tag <rendered-tag-template>` so the newest changelog section is versioned instead of `[unreleased]`
95
129
  - If changelog generation is enabled, `brel release-pr` stages `output_file` in the release commit when that file exists.
96
130
  - Disable changelog generation:
97
131
 
@@ -106,7 +140,11 @@ enabled = false
106
140
 
107
141
  - Default branch pattern: `brel/release/v{{version}}`
108
142
  - Only `{{version}}` is supported as a token.
109
- - Commit message: `chore(release): vX.Y.Z`
143
+ - `release_pr.tagging.tag_template` controls rendered release tags (default `v{version}`).
144
+ - `tag_template` accepts `{version}` and legacy `{{version}}` (normalized to `{version}`).
145
+ - `tag_template` must include exactly one version token.
146
+ - Commit message: `chore(release): <rendered-tag>`
147
+ - PR title: `Release <rendered-tag>`
110
148
  - Commit author defaults to:
111
149
  - `name = "brel[bot]"`
112
150
  - `email = "brel[bot]@users.noreply.github.com"`
@@ -118,6 +156,13 @@ For PRs:
118
156
  - If found, it updates that PR (continuity wins over recomputing branch name).
119
157
  - If not found, it creates a new PR.
120
158
 
159
+ ## Tagging on Merge
160
+
161
+ - Optional config: `[release_pr.tagging] enabled = true` (default `false`).
162
+ - Tag format config: `[release_pr.tagging] tag_template = "v{version}"` (default shown).
163
+ - When enabled, the generated workflow listens for merged pull requests into the configured default branch.
164
+ - If the merged PR is managed by `brel` and titled `Release <rendered-tag>`, the workflow validates it against `tag_template`, then creates and pushes that tag when it does not already exist.
165
+
121
166
  ## PR Body Templates
122
167
 
123
168
  If `release_pr.pr_template_file` is set, `brel` renders that Handlebars template.
@@ -125,6 +170,7 @@ If `release_pr.pr_template_file` is set, `brel` renders that Handlebars template
125
170
  Available variables:
126
171
 
127
172
  - `version`
173
+ - `tag`
128
174
  - `base_branch`
129
175
  - `release_branch`
130
176
  - `commits` (array of `{ sha_short, subject }`)
@@ -156,3 +202,9 @@ Run with explicit config:
156
202
  ```bash
157
203
  brel release-pr --config ./configs/release.toml
158
204
  ```
205
+
206
+ Preview the next release version:
207
+
208
+ ```bash
209
+ brel next-version
210
+ ```
@@ -23,7 +23,7 @@
23
23
  "hasInstallScript": true,
24
24
  "license": "MIT",
25
25
  "name": "brel",
26
- "version": "0.1.2"
26
+ "version": "0.3.0"
27
27
  },
28
28
  "node_modules/@isaacs/balanced-match": {
29
29
  "engines": {
@@ -515,5 +515,5 @@
515
515
  }
516
516
  },
517
517
  "requires": true,
518
- "version": "0.1.2"
518
+ "version": "0.3.0"
519
519
  }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "artifactDownloadUrl": "https://github.com/better-releases/brel/releases/download/0.1.2",
2
+ "artifactDownloadUrl": "https://github.com/better-releases/brel/releases/download/0.3.0",
3
3
  "bin": {
4
4
  "brel": "run-brel.js"
5
5
  },
@@ -97,7 +97,7 @@
97
97
  "zipExt": ".tar.xz"
98
98
  }
99
99
  },
100
- "version": "0.1.2",
100
+ "version": "0.3.0",
101
101
  "volta": {
102
102
  "node": "18.14.1",
103
103
  "npm": "9.5.0"