super-release 1.0.2 → 1.1.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.
Files changed (2) hide show
  1. package/README.md +106 -9
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -136,7 +136,10 @@ For editor autocompletion:
136
136
  ```yaml
137
137
  branches:
138
138
  - main
139
- - master
139
+ - name: next
140
+ channel: next # publishes to "next" npm dist-tag
141
+ - name: next-major
142
+ channel: next-major
140
143
  - name: beta
141
144
  prerelease: beta
142
145
  - name: "test-*"
@@ -190,14 +193,56 @@ git:
190
193
  Defines which branches can produce releases. Only configured branches are allowed -- running on an unconfigured branch
191
194
  exits cleanly.
192
195
 
193
- | Form | Type | Example versions |
194
- |--------------------------------------------|-------------------------------------|---------------------------------|
195
- | `- main` | Stable | `1.0.0`, `1.1.0`, `2.0.0` |
196
- | `- name: beta`<br>` prerelease: beta` | Prerelease (fixed channel) | `2.0.0-beta.1`, `2.0.0-beta.2` |
197
- | `- name: "test-*"`<br>` prerelease: true` | Prerelease (branch name as channel) | `2.0.0-test-my-feature.1` |
198
- | `- name: "1.x"`<br>` maintenance: true` | Maintenance | `1.5.1`, `1.6.0` (major capped) |
196
+ | Form | Type | Example versions |
197
+ |-------------------------------------------------|-------------------------------------|----------------------------------|
198
+ | `- main` | Stable (primary) | `1.0.0`, `1.1.0`, `2.0.0` |
199
+ | `- name: next`<br>` channel: next` | Stable (next channel) | `1.1.0` on `next` dist-tag |
200
+ | `- name: next-major`<br>` channel: next-major` | Stable (next-major channel) | `2.0.0` on `next-major` dist-tag |
201
+ | `- name: beta`<br>` prerelease: beta` | Prerelease (fixed channel) | `2.0.0-beta.1`, `2.0.0-beta.2` |
202
+ | `- name: "test-*"`<br>` prerelease: true` | Prerelease (branch name as channel) | `2.0.0-test-my-feature.1` |
203
+ | `- name: "1.x"`<br>` maintenance: true` | Maintenance (major locked) | `1.5.1`, `1.6.0` (no `2.x`) |
204
+ | `- name: "1.5.x"`<br>` maintenance: true` | Maintenance (major+minor locked) | `1.5.1`, `1.5.2` (no `1.6.x`) |
199
205
 
200
- Branches can also filter which packages they release with `packages`:
206
+ ##### Multiple release branches
207
+
208
+ You can have multiple stable release branches (e.g. `main`, `next`, `next-major`) that release independently. Each
209
+ non-primary branch should set a `channel` so it publishes to a different npm dist-tag:
210
+
211
+ ```yaml
212
+ branches:
213
+ - main # primary: publishes to "latest"
214
+ - name: next
215
+ channel: next # publishes to "next" dist-tag
216
+ - name: next-major
217
+ channel: next-major # publishes to "next-major" dist-tag
218
+ ```
219
+
220
+ **Version collision detection**: If a branch tries to release a version that already exists as a tag (e.g. `next`
221
+ released `1.1.0` and `main` also tries `1.1.0`), super-release will error. Merge the higher branch into the lower one
222
+ first, or let the lower branch release a different version.
223
+
224
+ ##### Maintenance branches
225
+
226
+ Maintenance branches cap version bumps to stay within a range inferred from the branch name:
227
+
228
+ - `1.x` -- major is locked: `feat:` bumps minor, `feat!:` is capped to minor, no major bumps
229
+ - `1.5.x` -- major and minor are locked: all bumps become patch only
230
+
231
+ If the branch name doesn't follow the `N.x` / `N.N.x` pattern, set `range` explicitly:
232
+
233
+ ```yaml
234
+ branches:
235
+ - name: legacy-support
236
+ maintenance: true
237
+ range: "1.5.x" # cap to 1.5.x patch range
238
+ ```
239
+
240
+ In monorepos, packages whose version is outside the maintenance range are automatically skipped. For example, on branch
241
+ `1.x`, a package at `v3.0.0` will be skipped while a package at `v1.2.0` will be released normally.
242
+
243
+ ##### Branch options
244
+
245
+ Branches can filter which packages they release with `packages`:
201
246
 
202
247
  ```yaml
203
248
  branches:
@@ -336,7 +381,9 @@ The git step:
336
381
  Tags are idempotent -- existing tags are skipped. The npm step checks the registry before publishing (`npm view`) and
337
382
  skips versions that already exist. Non-404 errors (auth, network) abort the release to prevent partial publishes.
338
383
 
339
- ## Monorepo Structure
384
+ ## Monorepo Support
385
+
386
+ ### Structure
340
387
 
341
388
  ```
342
389
  my-monorepo/
@@ -354,6 +401,56 @@ my-monorepo/
354
401
  Packages are discovered by finding `package.json` files recursively (respects `.gitignore`). Each commit is associated
355
402
  to a package based on which files it changed.
356
403
 
404
+ ### Independent versioning
405
+
406
+ Each package has its own version and release tag. A commit that only touches `packages/core/` will only bump
407
+ `@acme/core`. Packages are versioned independently -- `@acme/core` can be at `v3.0.0` while `@acme/utils` is at
408
+ `v1.2.0`.
409
+
410
+ ### Filtering packages
411
+
412
+ Use `packages` (allow-list) and `exclude` (deny-list) at the top level to control which packages are released:
413
+
414
+ ```yaml
415
+ packages:
416
+ - "@acme/*" # only release @acme-scoped packages
417
+ exclude:
418
+ - my-monorepo-root # skip the root package
419
+ ```
420
+
421
+ ### Dependencies and publish order
422
+
423
+ Packages that depend on each other (via `dependencies` or `devDependencies` in `package.json`) are published in
424
+ dependency order. If `@acme/utils` depends on `@acme/core`, core is published first. Independent packages publish in
425
+ parallel.
426
+
427
+ ### Global file dependencies
428
+
429
+ Files that affect all packages (lock files, shared config) can be declared as global dependencies. A commit that only
430
+ changes `yarn.lock` will trigger releases for all packages:
431
+
432
+ ```yaml
433
+ dependencies:
434
+ - yarn.lock
435
+ - pnpm-lock.yaml
436
+ ```
437
+
438
+ ### Maintenance branches in monorepos
439
+
440
+ On a maintenance branch like `1.x`, packages whose current version is outside the maintenance range are automatically
441
+ skipped. For example, if `@acme/core` is at `v3.0.0` and `@acme/utils` is at `v1.2.0`, only `@acme/utils` will be
442
+ released on the `1.x` branch.
443
+
444
+ You can also use per-branch `packages` filters for explicit control:
445
+
446
+ ```yaml
447
+ branches:
448
+ - name: "1.x"
449
+ maintenance: true
450
+ packages:
451
+ - "@acme/utils" # only release utils on this maintenance branch
452
+ ```
453
+
357
454
  ## Performance
358
455
 
359
456
  - **Tag-bounded history walk**: only walks commits since the oldest package tag
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": "1.0.2",
31
+ "version": "1.1.0",
32
32
  "scripts": {
33
33
  "super-release": "node npm/bin/super-release.js"
34
34
  }