Skip to content

Commit 7b1e0f7

Browse files
committed
docs+code: note staged is npm-only + per-package assumption (per-target when multi-target lands)
1 parent 5a8f125 commit 7b1e0f7

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

‎docs/configuration.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ Requirements:
108108
- npm >= 11.15.0
109109
- The package must already exist on the npm registry (first publish cannot be staged)
110110

111+
Staging is an **npm-registry feature** — it only applies to packages published through the standard npm flow. Packages that publish via a `publishCommand` (jsr, cargo, anything custom) have no staging equivalent, so they publish live as usual. In a mixed release, npm packages stage while custom-target packages go live immediately; each finalizes independently. Staged tracking also relies on **GitHub releases** (the staged state and finalize step live in the draft release), so it needs `gh` available — there's no staged flow without a GitHub release to track it on.
112+
111113
```json
112114
{
113115
"publish": {

‎packages/bumpy/src/commands/publish.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,11 @@ async function runPublishFlow(
602602

603603
const { registry, repoSlug } = registryByPkg.get(release.name) || {};
604604
let changed = false;
605+
// `published`/`staged`/`failed` are per-package (see PublishResult), so every target
606+
// of the package takes the same status. That's correct while each package has exactly
607+
// one target (see publishTargetsByPkg above). If a package ever publishes to a mix of
608+
// stageable (npm) and live (jsr/cargo) targets in one run, this loop must switch to a
609+
// per-target result so it can mark "npm staged, jsr success" independently.
605610
for (const targetName of targets) {
606611
// Skip already-succeeded targets
607612
if (info.metadata.targets[targetName]?.status === 'success') continue;

‎packages/bumpy/src/core/publish-pipeline.ts‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,15 @@ export async function publishPackages(
260260
}
261261

262262
// Staged publishing only applies to the standard npm flow (not custom commands),
263-
// and never to snapshots (opts.noStage).
263+
// and never to snapshots (opts.noStage). Staging is an npm-registry feature — no
264+
// other publish target (jsr, cargo, custom commands) has an equivalent.
265+
//
266+
// NOTE: this is a per-*package* decision because bumpy currently gives each package
267+
// exactly one publish target (see publishTargetsByPkg in commands/publish.ts). If a
268+
// future multi-target model lets one package publish to npm (stageable) AND another
269+
// target (live) in the same run, this — and PublishResult below — must become
270+
// per-target: a package could be "npm staged, jsr live" at once, which a per-package
271+
// staged/published split can't express.
264272
const isStaged =
265273
publishConfig.npmStaged && publishConfig.publishManager === 'npm' && !pkgConfig.publishCommand && !opts.noStage;
266274

0 commit comments

Comments
 (0)