Skip to content

chore: adopt changelog fragments (changelog.d/) to eliminate CHANGELOG conflicts (closes #53)#54

Merged
tonytino merged 2 commits into
mainfrom
chore/53-changelog-fragments
Jun 25, 2026
Merged

chore: adopt changelog fragments (changelog.d/) to eliminate CHANGELOG conflicts (closes #53)#54
tonytino merged 2 commits into
mainfrom
chore/53-changelog-fragments

Conversation

@tonytino

Copy link
Copy Markdown
Owner

Closes #53.

Concurrent PRs that each edit the shared ## [Unreleased] block collide on merge — #50, #51, and #52 all did during this batch. This replaces the hand-edited block with per-PR fragment files under changelog.d/, assembled into a versioned section at release time. Each PR adds a unique new file, so PRs never collide on the changelog again.

Custom, not Changesets — so the existing [propagate] / [template-only] / [manual] tags, the migration-guide flow, and .construct version tracking are all preserved. No new dependency.

The new workflow

  • Day to day: instead of editing CHANGELOG.md, drop a file changelog.d/<slug>.<category>.md (category = added/changed/fixed/…), with bullets that carry a propagation tag. See changelog.d/README.md.
  • pnpm changelog:preview renders the pending [Unreleased] section from fragments.
  • pnpm changelog:check validates fragments (now a CI step).
  • pnpm changelog:release <version> folds fragments into a ## [X.Y.Z] - DATE section in CHANGELOG.md (grouped, tags preserved) and deletes them.

What's here

release-check.yml is intentionally untouched — release still writes the ## [X.Y.Z] section it greps for, so the version-bump rule keeps working.

Verification (local)

  • pnpm preflight green — Biome + tsc + 42 tests (incl. the 11 new ones).
  • release 0.3.0 dry-run in a throwaway copy: inserted the section above [0.2.0], preserved tags, deleted the 3 consumed fragments (README kept).
  • Scaffold dry-run: instance keeps changelog.mjs, changelog.d/ reset to README-only, changelog:check passes, and instance preflight runs the surviving changelog.test.ts (23 tests).

Design choices worth your eyes

  • [Unreleased] is kept as a heading with a "do not hand-edit" note (vs. removing it entirely) — keeps the file readable and release-check happy.
  • Fragment filename encodes the category (*.added.md); bullets keep their propagation tags verbatim.

🤖 Generated with Claude Code


Generated by Claude Code

claude added 2 commits June 25, 2026 01:59
…flicts

Concurrent PRs each editing the shared `## [Unreleased]` block collide on
merge (#50/#51/#52 all did). Replace the hand-edited block with per-PR
fragment files under `changelog.d/`, assembled into a versioned section at
release time. Each PR adds a unique new file, so PRs never collide.

Custom (no Changesets) to preserve the `[propagate]`/`[template-only]`/
`[manual]` tags and the migration-guide + propagation flow.

- `scripts/changelog.mjs` — `preview` / `check` / `release <version>`, no deps,
  pure helpers unit-tested in tests/unit/changelog.test.ts
- `changelog.d/` — README + the three current [Unreleased] entries migrated to
  fragments (#43/#44/#46); CHANGELOG [Unreleased] becomes a pointer note
- CI: `pnpm changelog:check` step validates fragments
- Docs: docs/agents/releases.md, PR template, AGENTS.md sub-doc index
- Scaffold: instances keep scripts/changelog.mjs, get a reset changelog.d/

release-check.yml is unchanged — `release` still produces the `## [X.Y.Z]`
section it greps for. Verified: preflight green (42 tests), release dry-run
folds + deletes fragments, scaffold dry-run yields a working instance.

Closes #53.
Validation alone didn't enforce that PRs add a fragment. Add a
`changelog-fragment` CI job that fails a PR which adds no fragment under
changelog.d/, with a `skip-changelog` label escape hatch for changes that
need no entry (typo fixes, CI tweaks, the release PR itself).

- New `changelog-fragment` job in ci.yml (PR-only; skipped when labeled)
- `skip-changelog` label added to scripts/labels.mjs + tasks.md + the PR
  template checklist
- changelog.d/ fragment describing the fragments feature itself
- releases.md / changelog.d/README.md document the requirement
@tonytino tonytino merged commit 6c6779f into main Jun 25, 2026
5 checks passed
@tonytino tonytino deleted the chore/53-changelog-fragments branch June 25, 2026 02:09
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.

[Task]: Adopt changelog fragments (changelog.d/) to eliminate CHANGELOG merge conflicts

2 participants