Skip to content

Commit 7d8a2bc

Browse files
committed
docs: unify bundledDependencies story (propagation + change detection)
Explain that bundledDependencies is one declaration driving two behaviors β€” cascade on the dep's own release (internal workspace deps only) and change-detection flagging when its range is edited (any dep). Add an explicit "internal workspace deps: bundled vs not" note, since that's the knob for which devDependencies affect published output. Rename the heading and fix the inbound anchor links.
1 parent 2f8360d commit 7d8a2bc

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

β€Ždocs/configuration.mdβ€Ž

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ A package is "changed" (and so needs a bump file) when a changed file inside it
3434

3535
So when `package.json` is the **only** changed file in a package, bumpy diffs it against the base branch and only flags the package if a field **outside** `ignoredPackageJsonFields` changed. The default ignore list is `["devDependencies"]`, meaning dev-only dependency updates don't require a bump file. Every other field β€” `dependencies`, `exports`, `bin`, `files`, `description`, `scripts`, etc. β€” still counts.
3636

37-
One exception keeps this safe: a changed `devDependencies` entry that matches the package's [`bundledDependencies`](#example-a-bundled-dependency-consumer-side) **does** flag the package, since a bundled dep ships in the published output.
37+
One exception keeps this safe: a changed `devDependencies` entry that matches the package's [`bundledDependencies`](#bundled-dependencies-consumer-side) **does** flag the package, since a bundled dep ships in the published output.
3838

3939
To relax additional fields (e.g. treat `scripts` changes as non-releasing too), extend the list:
4040

@@ -242,11 +242,9 @@ Or with custom trigger/bumpAs:
242242
}
243243
```
244244

245-
### Example: a bundled dependency (consumer-side)
245+
### Bundled dependencies (consumer-side)
246246

247-
When a package bundles a dependency into its published output (inlined by esbuild/tsup/rollup), a change to that dependency changes what consumers receive β€” so the bundler must be republished. This is common with deps declared under `devDependencies`, since they aren't resolved at runtime.
248-
249-
The simplest way to express this is `bundledDependencies`. Any bump to a listed dep republishes this package with a **patch** bump:
247+
When a package bundles a dependency into its published output (inlined by esbuild/tsup/rollup), a change to that dependency changes what consumers receive β€” so the bundler must be republished. This is common with deps declared under `devDependencies`, since they aren't resolved at runtime. List them in `bundledDependencies`:
250248

251249
```json
252250
{
@@ -257,7 +255,20 @@ The simplest way to express this is `bundledDependencies`. Any bump to a listed
257255
}
258256
```
259257

260-
This is shorthand for a `cascadeFrom` rule of `{ "trigger": "patch", "bumpAs": "patch" }`. If you re-export the bundled dependency's API and want **proportional** bumps (a minor in the dep β†’ a minor here), use `cascadeFrom` directly instead β€” an explicit `cascadeFrom` rule for the same source takes precedence:
258+
`bundledDependencies` declares intent β€” "this dependency ships inside my output" β€” and that drives **two** behaviors:
259+
260+
1. **Propagation** β€” when the bundled dependency gets its **own release**, this package is cascaded a **patch** bump (shorthand for a `cascadeFrom` rule of `{ "trigger": "patch", "bumpAs": "patch" }`). This only applies to **internal workspace** deps, since bumpy only releases packages in your workspace.
261+
2. **Change detection** β€” when the bundled dependency's version is edited in **this** package's `package.json` (e.g. a Dependabot PR, or a manual bump), this package is flagged as changed and needs a bump file β€” even though `devDependencies` edits are normally ignored (see [Change detection](#change-detection-and-packagejson-fields)). This applies to **any** bundled dep, internal or external.
262+
263+
So for an **internal** bundled workspace dep, both paths fire; for an **external** bundled dep (e.g. a published npm package you inline), only change detection applies β€” listing it is still useful, and is a harmless no-op for propagation.
264+
265+
#### Internal workspace deps: bundled vs. not
266+
267+
This is exactly the knob for "which devDependencies affect my published output." An internal workspace package listed under `devDependencies` is, by default, treated as dev-only β€” its releases don't cascade ([`dependencyBumpRules.devDependencies` is `false`](#dependency-bump-rules)) and bumping its range doesn't flag you. Add it to `bundledDependencies` to flip both: now its releases republish you, and editing its range flags you. Leave it out and it stays dev-only. No global setting is involved β€” it's per-dependency, per-consumer.
268+
269+
#### Proportional bumps
270+
271+
If you re-export the bundled dependency's API and want **proportional** bumps (a minor in the dep β†’ a minor here), use `cascadeFrom` directly instead β€” an explicit `cascadeFrom` rule for the same source takes precedence over the `bundledDependencies` patch default:
261272

262273
```json
263274
{

β€Ždocs/version-propagation.mdβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The bump type applied to the dependent depends on the dependency type:
2525

2626
For peer deps, "matches the triggering bump" means if `core` gets a minor bump that breaks the range, `plugin` also gets a minor bump. This keeps version bumps proportional β€” especially important for `0.x` packages where `^` ranges cause minor bumps to go out of range frequently.
2727

28-
> † `devDependencies` are skipped because they normally don't ship to consumers. The exception is a dependency **bundled** into your published output (inlined by esbuild/tsup/rollup) β€” often declared under `devDependencies` since it isn't runtime-resolved. List those under `bundledDependencies` (or use `cascadeFrom`) so any bump to them republishes the bundling package. See [Configuration](./configuration.md#example-a-bundled-dependency-consumer-side).
28+
> † `devDependencies` are skipped because they normally don't ship to consumers. The exception is a dependency **bundled** into your published output (inlined by esbuild/tsup/rollup) β€” often declared under `devDependencies` since it isn't runtime-resolved. List those under `bundledDependencies` (or use `cascadeFrom`) so any bump to them republishes the bundling package. See [Configuration](./configuration.md#bundled-dependencies-consumer-side).
2929
3030
This phase is a **safety net** β€” it cannot be skipped. It ensures that published packages always have valid dependency ranges.
3131

0 commit comments

Comments
Β (0)