Skip to content

Read the _ front matter key as changeset metadata - #224

Merged
iorate merged 1 commit into
mainfrom
support-changeset-metadata
Nov 28, 2026
Merged

iorate merged 1 commit into
mainfrom
support-changeset-metadata

Conversation

@iorate

@iorate iorate commented Nov 28, 2026

Copy link
Copy Markdown
Owner

changesets 3.1 reserves the _ key in a changeset's front matter for arbitrary metadata:

---
foo: minor
_:
  pr: 1337
  author: someone
---

Something changed!

Until now such a file failed to load with invalid bump type, because every key was taken as a package name.

  • _ (quoted or not, at any position) is loaded as metadata instead of a package name. Its value must be a mapping.
  • status --output and version --output report it as metadata on each element of changesets. The key is omitted for a changeset without _.
  • set-summary writes the metadata back as the last key when it rebuilds the front matter. Values and key order are kept; comments and flow style inside _ are not.
  • Metadata without a JSON form is rejected when the changeset is loaded: non-string keys, NaN and infinities, and tagged values.

add has no way to write metadata, and changelog contents do not depend on it.

🤖 Generated with Claude Code

changesets 3.1 reserves the `_` key in a changeset's front matter for
arbitrary metadata, so a changeset written for it failed to load here
with an invalid bump type.

Load `_` as metadata, report it as `metadata` on each changeset in the
release plan JSON, and write it back as the last key when `set-summary`
rebuilds the front matter. The value must be a mapping with a JSON form:
non-string keys, non-finite numbers, and tagged values are rejected.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@iorate
iorate merged commit 16a17a6 into main Nov 28, 2026
14 checks passed
@iorate
iorate deleted the support-changeset-metadata branch November 28, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant