Skip to content

fix: pass preset parserOpts and writerOpts to conventional-changelog#1045

Merged
sarahdayan merged 4 commits intomainfrom
fix/changelog-extraction-small-tag
Feb 5, 2026
Merged

fix: pass preset parserOpts and writerOpts to conventional-changelog#1045
sarahdayan merged 4 commits intomainfrom
fix/changelog-extraction-small-tag

Conversation

@sarahdayan
Copy link
Member

@sarahdayan sarahdayan commented Feb 5, 2026

Summary

Fixes changelog entries missing version links and having <small> tags around patch versions.

Problem

Changelog entries for patch releases looked like:

## <small>0.28.1 (2026-02-05)</small>

Instead of the expected format with a compare link:

## [0.28.1](https://github.com/algolia/shipjs/compare/v0.28.0...v0.28.1) (2026-02-05)

This also caused GitHub releases to have empty bodies since extractSpecificChangelog couldn't match the <small> format.

Root Cause

The angular preset's parserOpts and writerOpts (which include the header template with links) weren't being passed to conventional-changelog-core:

// Before
conventionalChangelogCore(
  args,
  templateContext,
  gitRawCommitsOpts,
  undefined,  // parserOpts not passed
  undefined,  // writerOpts not passed
  execOpts
)

This caused conventional-changelog-writer to fall back to its default header template which wraps patch versions in <small> tags and omits links.

Solution

Extract and pass the preset's parserOpts and writerOpts:

const { parserOpts, writerOpts } = args.config || {};
conventionalChangelogCore(
  args,
  templateContext,
  gitRawCommitsOpts,
  parserOpts,
  writerOpts,
  execOpts
)

sarahdayan and others added 3 commits February 5, 2026 12:54
conventional-changelog wraps patch version headers in <small> tags,
e.g., `## <small>0.28.1 (2026-02-05)</small>`. The regex wasn't
matching this format, causing GitHub releases to have empty bodies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The angular preset's header template (with links and proper formatting)
wasn't being used because parserOpts and writerOpts from the loaded
preset weren't being passed to conventional-changelog-core.

This caused changelog entries to use the default writer template which:
- Wraps patch versions in <small> tags
- Omits the compare link on versions

Now the preset's templates are properly applied, producing consistent
changelog entries like:
## [0.28.1](https://github.com/.../compare/v0.28.0...v0.28.1) (date)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sarahdayan sarahdayan changed the title fix: handle <small> tag in changelog extraction fix: pass preset parserOpts and writerOpts to conventional-changelog Feb 5, 2026
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sarahdayan sarahdayan requested review from a team, FabienMotte, dhayab and shaejaz and removed request for a team and shaejaz February 5, 2026 12:06
@sarahdayan sarahdayan merged commit 447dd87 into main Feb 5, 2026
7 checks passed
@sarahdayan sarahdayan deleted the fix/changelog-extraction-small-tag branch February 5, 2026 12:34
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.

2 participants