Skip to content

feat(monorepo): cross-package dependency bump propagation #493

Description

@BryanFRD

Problem

`workspace.dependsOn` triggers a downstream bump when an upstream package is bumped, but `src/monorepo/run/mod.rs:535-617` always emits a patch, regardless of the upstream bump type:

```rust
compute_next_version(.., BumpType::Patch, strategy) // line ~568
```

That means: if `@scope/core` goes `1.x → 2.0.0` (breaking), `@scope/cli` which depends on it gets a `patch` bump — even though `cli` is now compiling against a breaking new `core` API. End users upgrade `cli` thinking it's a patch and break in prod.

Also, the dependency version range declared in `package.json` / `Cargo.toml` peer maps is never rewritten — consumers continue pinning the old range.

Comparison

  • changesets propagates the bump type and offers `updateInternalDependencies: "patch"|"minor"` to tune.
  • release-please does manifest-level cascade with the same bump type.

Proposal

  1. Track the bump type of upstream packages and propagate it. Default: `major-on-major` (only major cascades).
  2. Optional `workspace.update_dependents: true` that, when bumping pkg `B`, rewrites version constraints in `A`'s manifest where `A.dependsOn = ["B"]`.
  3. Config shape:
    ```toml
    [[package]]
    depends_on = [{ name = "core", propagate = "major-on-major" }]
    ```

Test plan

  • Fixture: `feat!:` on B with A depending on B → A gets major.
  • Fixture: `update_dependents = true` rewrites `A/package.json` deps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions