Skip to main content

Baseline a Monorepo One Package at a Time

Baseline each package in a monorepo separately with vg baseline --cwd, then scan each against its own baseline. Every workspace gets its own drift ceiling and its own CI gate.

Difficulty
Advanced
Duration
18 minutes
Steps
5

In a monorepo, one blended DriftScore hides which package is actually drifting. Baselining each package separately gives every workspace its own reference and its own gate, so improvements and regressions are attributed to the right team.

Prerequisites

  • Vibgrate CLI installed (npm i -g @vibgrate/cli)
  • A monorepo with multiple packages or workspaces

Steps

1. Identify your packages

List the package directories you want to baseline independently, for example packages/api and packages/web.

2. Baseline each package

Run the baseline command from inside each package directory, or target a directory with --cwd:

vg baseline --cwd packages/api

Repeat for each package so every one has its own .vibgrate/baseline.json.

3. Scan a package against its baseline

Scan a single package against its own baseline:

vg scan --cwd packages/api --baseline .vibgrate/baseline.json

4. Wire per-package gates in CI

Add one scan step per package so each fails independently when its own drift regresses.

5. Verify per-package isolation

Introduce drift in one package and confirm only that package's scan fails while the others stay green.

Verification

Each package has its own baseline file and its own scan result. A regression in one workspace produces a non-zero exit only for that workspace's step.

Next Steps

  • Assign per-team drift budgets aligned to package ownership.
  • Push each package's results to Vibgrate Cloud for per-workspace trends.

Prerequisites

  • Vibgrate CLI installed
  • A monorepo with multiple packages

Steps

  • 1
    Identify your packages
  • 2
    Baseline each package
  • 3
    Scan a package against its baseline
  • 4
    Wire per-package gates in CI
  • 5
    Verify per-package isolation

Category

Vibgrate