feat(cli): expose release notes in dv release --json (#18)#34
Merged
Conversation
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>
e3d0b98 to
34c68e7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #18.
dv releaseruns afterdv versionconsumed 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.githubrelease script did exactly that, with a comment pointing at this issue).Changes
changelog/extract.ts(new, pure):extractReleaseSection({ changelogText, version })— the inverse ofrenderReleaseSection. Slices the## [version]body back out, heading dropped.releaseNotes: stringon eachPlan.awaitingReleaseentry (plan-schema.ts+ regeneratedspecs/schemas/plan.json). Empty string when no section is found; never absent (matches thefirstStable"never absent" convention).release.ts: populatesreleaseNotesat the command edge, where CHANGELOG IO belongs — the pure plan builder stays pure, sodv status/dv versionPlans keep"".resolveOutputPathFromTemplatehelper that was duplicated verbatim inversion.tsandv1.tsmoves into the changelog subtool (changelog/path.ts) and is now shared by version, v1, and release..github/scripts/release.tsdrops its privatereadChangelogSection/findChangelogPathand readsentry.releaseNotesdirectly — 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 assertingreleaseNotesis populated from the CHANGELOG (and""for a package without one).deno task verifypasses (380 tests, schemas in sync, publish:check clean). A Record (feat→@dv-cli/dv) is included.🤖 Generated with Claude Code