dependency-maintenance
Dependency & Maintenance Guide
This document explains how we keep dependencies up to date and the project healthy over time. It covers what’s automated, what to do manually, and how to respond to security events.
What’s automated today
-
Renovate weekly maintenance
- Groups related updates (devDependencies, runtime deps, vitest, eslint) via
renovate.jsonrules. - Auto-merges safe minor/patch devDependency updates (lockfile + manifest only).
- Lockfile maintenance runs early Monday (UTC) to keep resolution fresh.
- Location:
.github/renovate.json(ensure the GitHub Renovate app is installed).
- Groups related updates (devDependencies, runtime deps, vitest, eslint) via
-
GitHub Actions updates
- Renovate also handles workflow action version bumps under the
github-actionsmanager. - Commit prefix semantic:
chore(gha): …via packageRules.
- Renovate also handles workflow action version bumps under the
-- PR gating and security scanning
-
Dependency Review blocks risky new dependencies in PRs (severity ≥ moderate by default).
-
OSV Scanner / security workflow detects newly disclosed CVEs.
-
Locations:
.github/workflows/dependency-review.yml.github/workflows/security.yml
-
Package hygiene checks
- Publint + AreTheTypesWrong run in CI to ensure publish metadata and types are correct.
- Location:
.github/workflows/package-hygiene.ymlanddocs/package-hygiene.md
-
Provenance and SBOM on release
- Releases publish with npm OIDC provenance and produce a CycloneDX SBOM artifact.
- Location:
.github/workflows/release.ymlanddocs/security-supply-chain.md
Manual maintenance (as needed)
-
Inspect available updates
- Outdated overview:
pnpm outdated - Why a package is included:
pnpm why <name>
- Outdated overview:
-
Perform safe upgrades locally
- Interactive constrained update:
pnpm up -Lri - Full latest (be cautious):
pnpm up --latest - After upgrading: run tests and package checks
pnpm testpnpm coverage(optional)pnpm hygiene
- Interactive constrained update:
-
Audit vulnerabilities
- Quick scan:
pnpm audit(triage, link to advisories) - If transitive: prefer upgrading the top-level maintainer package first
- Quick scan:
Pull request workflow
- For devDependencies: Dependabot PRs labeled
dev-dependencieswill auto-merge after CI and scope checks. - For direct/runtime deps: Review carefully, ensure tests are green, and add a
Changeset entry as needed (e.g.,
fix:for security patches,chore:for routine bumps). - If Dependency Review flags a risk, either upgrade to a safe version or document a temporary mitigation and open a tracking issue.
Security remediation playbook
- OSV alerts or Dependabot security notifications surface a CVE.
- Confirm impact with
pnpm whyand the SBOM artifact from the latest release. - Identify the minimal upgrade path (patch/minor preferred). Update and open a PR with a Changeset.
- If no fix exists, consider pinning, patching (e.g.,
patch-package), or temporary deny policies; document in the PR.
Node and tooling policy
- Engines:
package.jsonspecifies the supported Node range. Keep local Node aligned withengines.nodefor consistent CI parity. - Package manager: We standardize on
pnpm(lockfile is authoritative).
Quick reference commands
# List available updates
pnpm outdated
# Interactive minor/patch updates, with prompts
pnpm up -Lri
# Run tests and coverage
pnpm test
pnpm coverage
# Package hygiene checks (publint + types)
pnpm hygiene
# Vulnerability scan
pnpm audit
Renovate Quickstart
- Install the Renovate GitHub App (organization level) if not already active.
- Review grouping rules in
.github/renovate.json:- Dev minor/patch auto-merge (
devDependencies (minor/patch)group). - Runtime deps grouped separately (manual review, semantic commit prefix
chore(deps):). - Tooling bundles (eslint, vitest) for coherent updates.
- Dev minor/patch auto-merge (
- For a one-off refresh outside schedule: trigger Renovate by closing/reopening a stale PR or using the dashboard (if enabled).
- Override behavior per-package with inline
packageRulesadditions (e.g., pinning, separate major group).
FAQ
- Why Renovate over Dependabot?
- Advanced grouping, custom schedules, pnpm lockfile maintenance, semantic commit prefixes, and auto-merge logic are centralized.
- How are auto-merges restricted?
- Only dev minor/patch updates meeting branch status and file-change constraints; major bumps always require manual review.
- How do I force a rebase or refresh?
- Comment
@renovate rebaseon the PR or use the Renovate dashboard.
- Comment
- Where do security results show up?
- GitHub Security tab and failing PR checks (Dependency Review + OSV workflow).
For changes to cadence or policy, update .github/renovate.json and related
workflows, then reflect the change here.