Skip to content

chore(changesets): categorized, contributor-attributed, patch-only changesets - #2981

Merged
cixzhang merged 1 commit into
mainfrom
navi/chore/changeset-encapsulation
Jun 22, 2026
Merged

cixzhang merged 1 commit into
mainfrom
navi/chore/changeset-encapsulation

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Why

Watching the release process, our changesets weren't pulling their weight on three fronts. This encapsulates the conventions that the Release-Process wiki currently asks us to apply by hand at version time into the changeset itself.

Problem Before After
Changelogs are per-package but changes are repo-wide Manually "bump the other packages to match" each release fixed lockstep co-bumps all publishable packages; only affected packages get a changelog entry
Changesets auto-map to semver while we're pre-1.0 Discipline-only; a stray minor jumps 0.0.x → 0.1.0 changeset:new forces patch; check:changesets rejects minor/major pre-1.0. Breaking changes use the [breaking] category, not a semver bump
Contributor isn't captured Reconstructed at release via git log/gh pr list — credits the release bot under bot-driven releases Captured at authoring time in the changeset body; #### Contributors is generated from it

What changed

  • scripts/changeset-entry-format.cjs — shared parser for the body convention ([category] headline + @handle line). Single source of truth.
  • .changeset/changelog.cjs — custom changelog module (wired via config.json "changelog"). Renders categorized, attributed release lines; suppresses lockstep "Updated dependencies" noise.
  • scripts/changeset-new.mjs → pnpm changeset:new — authoring wrapper. Auto-detects changed packages from the git diff, prompts for category + contributor (defaulting to your gh/git identity), forces patch. Built on Node's readline — no new deps.
  • scripts/check-changesets.mjs → pnpm check:changesets — CI gate, wired into check:repo. Enforces category, contributor, patch-only, and publishable-package validity.
  • scripts/format-changelogs.mjs — post-version formatter. Promotes to the doc-site heading format (# version, #### <Category> in canonical order) and aggregates #### Contributors. Idempotent, with a --check drift mode. Wired into version-packages.
  • .changeset/config.json — changelog → custom module; fixed group of the 12 publishable packages.
  • eslint.config.js — ignore .changeset/** (CJS release glue, consistent with scripts/**).
  • CONTRIBUTING.md — documents the new workflow.
  • Migrated the existing pending changeset to the new format.

Authoring example

pnpm changeset:new
---
'@xds/core': patch
---

[fix] Spinner inherits the variant foreground on themed buttons (#2717)
@yourhandle

Generated output

A core-only [fix] produces @xds/core:

# 0.0.16

#### Fixes

- Spinner inherits the variant foreground on themed buttons (#2717)

#### Contributors

Thanks to everyone who contributed to this release:

- @cindyxz

…while themes co-bump to 0.0.16 with a clean version-only entry (no cross-package noise).

Testing

End-to-end on a real pnpm version-packages run: per-package isolation verified, all 12 packages co-bump, formatter is idempotent and --check-clean, and edge cases (reject minor, missing category/contributor, private package) all gate correctly. pnpm lint is green (0 errors).

Note on bump types

This intentionally does not change our pre-1.0 patch-only stance — it enforces it. When we hit 1.0, check:changesets drops the patch-only gate automatically (it keys off whether publishable packages are still 0.x).

…angesets

Encapsulate the release conventions that were previously applied by hand at
version time (see the Release-Process wiki) into the changeset itself:

- Per-package changelogs for repo-wide changes: publishable packages are a
  `fixed` lockstep group, so one change co-bumps them to the same version
  while only genuinely-affected packages receive a changelog entry (themes
  etc. get a clean version-only bump, no cross-package noise).

- Pre-1.0 patch-only: `changeset:new` always writes `patch`, and
  `check:changesets` rejects any `minor`/`major` while the repo is < 1.0
  (those would jump 0.0.x). Breaking changes are signalled via the
  `[breaking]` category, decoupled from semver.

- Contributor encapsulation: the contributor is captured at authoring time
  (defaulting to the author's gh/git identity) in the changeset body, so the
  generated `#### Contributors` section credits the real human rather than the
  release bot.

Pieces:
- scripts/changeset-entry-format.cjs — shared body parser (category + @handle)
- .changeset/changelog.cjs — custom changelog module (wired via config.json)
- scripts/changeset-new.mjs — `pnpm changeset:new` authoring wrapper
- scripts/check-changesets.mjs — CI gate (`pnpm check:changesets`, in check:repo)
- scripts/format-changelogs.mjs — post-version formatter (doc-site headings +
  aggregated Contributors), idempotent with a --check drift mode; wired into
  `version-packages`

Also migrates the existing changeset to the new format and documents the
workflow in CONTRIBUTING.md.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 22, 2026
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
xds-sandbox Ignored Ignored Jun 22, 2026 5:10pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Vercel Preview Deployment

Status ✅ Deployed
Preview Open Preview
Commit e37287c
Inspect Vercel Dashboard
Workflow View Logs

No authentication required — anyone with the link can view the preview.

@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core N/A 4.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 5a258a1 into main Jun 22, 2026
22 checks passed
@github-actions
github-actions Bot deleted the navi/chore/changeset-encapsulation branch July 12, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants