Skip to content

feat(cli): expose release notes in dv release --json (#18)#34

Merged
ben-laird merged 1 commit into
mainfrom
feat/issue-18-release-notes-json
Jun 8, 2026
Merged

feat(cli): expose release notes in dv release --json (#18)#34
ben-laird merged 1 commit into
mainfrom
feat/issue-18-release-notes-json

Conversation

@ben-laird

Copy link
Copy Markdown
Owner

Closes #18.

dv release runs after dv version consumed the Records that fed the notes, so it can't re-render them. But dv owns the CHANGELOG format, so a first-party extractor recovers the notes from the file dv itself wrote — instead of every consumer rolling its own fragile ## [version] slice (the .github release script did exactly that, with a comment pointing at this issue).

Changes

  • changelog/extract.ts (new, pure): extractReleaseSection({ changelogText, version }) — the inverse of renderReleaseSection. Slices the ## [version] body back out, heading dropped.
  • Plan schema: new required releaseNotes: string on each Plan.awaitingRelease entry (plan-schema.ts + regenerated specs/schemas/plan.json). Empty string when no section is found; never absent (matches the firstStable "never absent" convention).
  • release.ts: populates releaseNotes at the command edge, where CHANGELOG IO belongs — the pure plan builder stays pure, so dv status / dv version Plans keep "".
  • DRY: the resolveOutputPathFromTemplate helper that was duplicated verbatim in version.ts and v1.ts moves into the changelog subtool (changelog/path.ts) and is now shared by version, v1, and release.
  • Consumer cleanup: .github/scripts/release.ts drops its private readChangelogSection / findChangelogPath and reads entry.releaseNotes directly — closing the loop the issue describes.

Tests

  • extract.test.ts: round-trip a rendered section, last-section-to-EOF, missing-version → null.
  • release.test.ts: a new integration test asserting releaseNotes is populated from the CHANGELOG (and "" for a package without one).

deno task verify passes (380 tests, schemas in sync, publish:check clean). A Record (feat@dv-cli/dv) is included.

🤖 Generated with Claude Code

dv release runs after dv version consumed the Records, so it can't
re-render the notes. But dv owns the CHANGELOG format, so a first-party
extractor recovers them from the file dv itself wrote — instead of every
consumer rolling a fragile slice (the .github release script did exactly
that).

- New pure changelog/extract.ts (extractReleaseSection): the inverse of
  renderReleaseSection — slices the `## [version]` body back out.
- New required `releaseNotes` field on Plan.awaitingRelease entries
  (plan-schema.ts + regenerated specs/schemas/plan.json). Empty string
  when no section is found; never absent.
- release.ts populates it at the command edge (CHANGELOG IO stays out of
  the pure plan builder), so status/version Plans keep `""`.
- DRY: the duplicated resolveOutputPathFromTemplate in version.ts and
  v1.ts moves to the changelog subtool (changelog/path.ts), now shared by
  version, v1, and release.
- .github/scripts/release.ts drops its private readChangelogSection /
  findChangelogPath and reads entry.releaseNotes directly.

Tests: extract round-trip / EOF / missing-version; a release integration
test asserting notes are populated from the CHANGELOG (and "" when none).
deno task verify passes; 380 tests.

Closes #18.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ben-laird ben-laird force-pushed the feat/issue-18-release-notes-json branch from e3d0b98 to 34c68e7 Compare June 8, 2026 01:42
@ben-laird ben-laird merged commit 3adae53 into main Jun 8, 2026
1 check passed
@ben-laird ben-laird deleted the feat/issue-18-release-notes-json branch June 8, 2026 01:44
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.

Expose release notes in dv release --json

1 participant