super-release 0.3.1 → 0.4.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 CHANGED
@@ -7,26 +7,34 @@ Analyzes [conventional commits](https://www.conventionalcommits.org/) to determi
7
7
  ## Features
8
8
 
9
9
  - Monorepo-first: discovers all `package.json` packages and associates commits by changed files
10
- - Parallel commit analysis using rayon (configurable with `-j`)
11
10
  - Prerelease branches (`beta`, `next`, or dynamic from branch name)
12
11
  - Maintenance branches (`1.x`, `2.x`) with major-version capping
13
12
  - Changelog generation powered by [git-cliff](https://git-cliff.org/)
14
- - Plugin system: changelog, npm, git-tag (extensible)
15
13
  - Configurable tag format templates
16
14
  - Dependency-aware npm publish (topological order)
17
15
  - Dry-run mode with pretty, truncated output
18
16
 
19
17
  ## Installation
20
18
 
19
+ The easiest way — no install needed:
20
+
21
21
  ```bash
22
- cargo install --path .
22
+ npx -y super-release --dry-run
23
+ ```
24
+
25
+ Or install as a dev dependency:
26
+
27
+ ```bash
28
+ # npm / yarn / pnpm
29
+ pnpm add -D super-release
23
30
  ```
24
31
 
25
- Or build a release binary:
32
+ The npm package automatically downloads the prebuilt native binary for your platform on first run.
33
+
34
+ Alternatively, build from source:
26
35
 
27
36
  ```bash
28
- cargo build --release
29
- # Binary at target/release/super-release
37
+ cargo install --path .
30
38
  ```
31
39
 
32
40
  ## Quick Start
@@ -38,6 +46,12 @@ super-release --dry-run
38
46
  # Run a release
39
47
  super-release
40
48
 
49
+ # Get the next version for a package (useful in CI scripts)
50
+ super-release --show-next-version
51
+
52
+ # Get the next version for a specific package in a monorepo
53
+ super-release --show-next-version --package @acme/core
54
+
41
55
  # Use 4 threads for commit analysis
42
56
  super-release -j 4
43
57
  ```
@@ -48,15 +62,35 @@ super-release -j 4
48
62
  Usage: super-release [OPTIONS]
49
63
 
50
64
  Options:
51
- -n, --dry-run Show what would happen without making changes
52
- -C, --path <PATH> Repository root [default: .]
53
- -c, --config <CONFIG> Path to config file [default: .release.yaml]
54
- -v, --verbose Verbose output
55
- -j, --jobs <JOBS> Parallel jobs for commit analysis [default: 50% of CPUs]
56
- -h, --help Print help
57
- -V, --version Print version
65
+ -n, --dry-run Show what would happen without making changes
66
+ -C, --path <PATH> Repository root [default: .]
67
+ -c, --config <CONFIG> Path to config file [default: .release.yaml]
68
+ --show-next-version Print the next version and exit
69
+ -p, --package <PACKAGE> Filter to a specific package (for --show-next-version)
70
+ -v, --verbose Verbose output
71
+ -j, --jobs <JOBS> Parallel jobs for commit analysis [default: 50% of CPUs]
72
+ -h, --help Print help
73
+ -V, --version Print version
58
74
  ```
59
75
 
76
+ ### `--show-next-version`
77
+
78
+ Outputs only the next version (or the current version if no bump is needed) and exits silently. Useful for CI scripts that need the version for downstream steps:
79
+
80
+ ```bash
81
+ # Use in CI to set a version variable
82
+ VERSION=$(super-release --show-next-version)
83
+ echo "Next version: $VERSION"
84
+
85
+ # Build with the correct version baked in
86
+ SUPER_RELEASE_VERSION=$VERSION cargo build --release
87
+
88
+ # In a monorepo, query a specific package
89
+ super-release --show-next-version -p @acme/core
90
+ ```
91
+
92
+ In single-package repos, no `--package` flag is needed. In monorepos, if `--package` is omitted, the root package is used. If there's no root package, an error lists the available packages.
93
+
60
94
  ## How It Works
61
95
 
62
96
  1. **Discover packages** -- finds all directories with a `package.json`
@@ -70,13 +104,13 @@ Options:
70
104
 
71
105
  super-release follows the [Conventional Commits](https://www.conventionalcommits.org/) specification:
72
106
 
73
- | Commit | Bump |
74
- |---|---|
75
- | `fix: ...` | patch |
76
- | `feat: ...` | minor |
77
- | `feat!: ...` or `BREAKING CHANGE:` in footer | major |
78
- | `perf: ...` | patch |
79
- | `chore: ...`, `docs: ...`, `ci: ...` | no release |
107
+ | Commit | Bump |
108
+ |----------------------------------------------|------------|
109
+ | `fix: ...` | patch |
110
+ | `feat: ...` | minor |
111
+ | `feat!: ...` or `BREAKING CHANGE:` in footer | major |
112
+ | `perf: ...` | patch |
113
+ | `chore: ...`, `docs: ...`, `ci: ...` | no release |
80
114
 
81
115
  ## Configuration
82
116
 
@@ -127,12 +161,12 @@ plugins:
127
161
 
128
162
  Defines which branches can produce releases and what kind.
129
163
 
130
- | Form | Type | Example versions |
131
- |---|---|---|
132
- | `- main` | Stable | `1.0.0`, `1.1.0`, `2.0.0` |
133
- | `- name: beta`<br>` prerelease: beta` | Prerelease (fixed channel) | `2.0.0-beta.1`, `2.0.0-beta.2` |
134
- | `- name: "test-*"`<br>` prerelease: true` | Prerelease (branch name as channel) | `2.0.0-test-my-feature.1` |
135
- | `- name: "1.x"`<br>` maintenance: true` | Maintenance | `1.5.1`, `1.6.0` (major capped) |
164
+ | Form | Type | Example versions |
165
+ |--------------------------------------------|-------------------------------------|---------------------------------|
166
+ | `- main` | Stable | `1.0.0`, `1.1.0`, `2.0.0` |
167
+ | `- name: beta`<br>` prerelease: beta` | Prerelease (fixed channel) | `2.0.0-beta.1`, `2.0.0-beta.2` |
168
+ | `- name: "test-*"`<br>` prerelease: true` | Prerelease (branch name as channel) | `2.0.0-test-my-feature.1` |
169
+ | `- name: "1.x"`<br>` maintenance: true` | Maintenance | `1.5.1`, `1.6.0` (major capped) |
136
170
 
137
171
  **Tag filtering by branch**: Stable branches only see stable tags. Prerelease branches see their own channel's tags plus stable tags. This prevents a `v2.0.0-beta.1` tag from affecting version calculation on `main`.
138
172
 
@@ -228,13 +262,13 @@ plugins:
228
262
  remote: origin # git remote to push to (default: "origin")
229
263
  ```
230
264
 
231
- | Plugin | Prepare | Publish |
232
- |---|---|---|
233
- | `changelog` | Generates/updates changelog per package (parallel) | -- |
234
- | `npm` | Updates `package.json` versions (auto-detects npm/yarn/pnpm) | Publishes packages (parallel within dependency levels) |
235
- | `exec` | Runs custom shell command per package | Runs custom shell command per package |
236
- | `git-commit` | -- | Stages changed files, commits with release message, optionally pushes |
237
- | `git-tag` | -- | Creates annotated git tags, optionally pushes |
265
+ | Plugin | Prepare | Publish |
266
+ |--------------|--------------------------------------------------------------|-----------------------------------------------------------------------|
267
+ | `changelog` | Generates/updates changelog per package (parallel) | -- |
268
+ | `npm` | Updates `package.json` versions (auto-detects npm/yarn/pnpm) | Publishes packages (parallel within dependency levels) |
269
+ | `exec` | Runs custom shell command per package | Runs custom shell command per package |
270
+ | `git-commit` | -- | Stages changed files, commits with release message, optionally pushes |
271
+ | `git-tag` | -- | Creates annotated git tags, optionally pushes |
238
272
 
239
273
  The default plugin order ensures: changelogs and version bumps are written first, then committed, then tagged.
240
274
 
@@ -298,9 +332,10 @@ super-release is designed to be fast:
298
332
  - **Precomputed file mapping**: file-to-package association is computed once, not per-package
299
333
 
300
334
  Benchmark (2001 commits, 8 packages, Apple Silicon):
301
- | Scenario | Time |
302
- |---|---|
303
- | All commits since initial tag | 0.11s |
335
+
336
+ | Scenario | Time |
337
+ |-------------------------------|--------|
338
+ | All commits since initial tag | 0.11s |
304
339
  | 100 commits since recent tags | 0.035s |
305
340
 
306
341
  ## Acknowledgements
@@ -26,7 +26,10 @@ if (!existsSync(binPath)) {
26
26
  }
27
27
 
28
28
  try {
29
- execFileSync(binPath, process.argv.slice(2), { stdio: "inherit" });
29
+ execFileSync(binPath, process.argv.slice(2), {
30
+ stdio: "inherit",
31
+ env: { ...process.env, SUPER_RELEASE_VERSION: pkg.version },
32
+ });
30
33
  process.exit(0);
31
34
  } catch (err) {
32
35
  process.exit(err.status ?? 1);
package/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  "url": "git+https://github.com/BowlingX/super-release.git"
29
29
  },
30
30
  "type": "module",
31
- "version": "0.3.1",
31
+ "version": "0.4.0",
32
32
  "scripts": {
33
33
  "super-release": "node npm/bin/super-release.js"
34
34
  }