-
Notifications
You must be signed in to change notification settings - Fork 763
Description
Affected Packages
I believe the issue is in changeset's CLI monorepo.
Problem
Previously, when I ran pnpm changeset version the changes applied to
CHANGELOG.md were only adding a new entry to the list of versions, but a few
days ago I started noticing that the formatting for the entire CHANGELOG.md
file was changing.
To reproduce it, just have a project with a prettier formated CHANGELOG.md, in
which lists use - and are followed by 3 spaces:
- like thisAnd you'll see that after running pnpm changeset and then
pnpm changeset version the spacing for list items is changed to:
- a single space 🥺This seems to be happening even after custom changelog scripts. I have a
custom changelog.cjs script that has the formatting I want for the new list
items, but this formatting is overriding that.
Code of my changelog.cjs because maybe is relevant for y'all
/**
* Changesets custom changelog functions.
* @see [Changeset documentation](https://github.com/changesets/changesets/blob/main/docs/modifying-changelog-format.md)
*/
// eslint-disable-next-line functional/immutable-data
module.exports = Object.freeze(
/** @type {const} @satisfies {import("@changesets/types").ChangelogFunctions} */ ({
getDependencyReleaseLine: (_changesets, dependenciesUpdated) =>
Promise.resolve(
dependenciesUpdated.length === 0 ?
""
: dependenciesUpdated
.map(
({ name, newVersion }) =>
`- ⬆️ upgrade \`${name}\` to \`v${newVersion}\``,
)
.join("\n"),
),
getReleaseLine: ({ summary }) =>
Promise.resolve(
summary
.split("\n")
.map(line =>
line.startsWith("-") || line.startsWith(" ") ?
line
: `- ${line}`,
)
.join("\n"),
),
}),
);So now after each pnpm changeset version I need to run prettier over
CHANGELOG.md, which isn't fun at all.
Proposed solution
Whatever changed in the way CHANGELOG.md is being parsed and then formatted
should be reverted, or if the idea is to format it, then at least it should
follow the local prettier configuration.
I'm willing to help with a PR if you can point me in the right direction to deal
with this issue.