Skip to content

Commit

Permalink
Fix Unhappy Changelog (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
samchungy committed Mar 25, 2024
1 parent 6f5e007 commit 147659c
Showing 1 changed file with 5 additions and 32 deletions.
37 changes: 5 additions & 32 deletions .changeset/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const boldScope = (firstLine) => firstLine.replace(/^([^:]+): /, '**$1:** ');
* @type import('@changesets/types').ChangelogFunctions
*/
const defaultChangelogFunctions = {
getDependencyReleaseLine: async (changesets, dependenciesUpdated) => {
getDependencyReleaseLine: async (_changesets, _dependenciesUpdated) => {
return '';
},
getReleaseLine: async (changeset) => {
Expand All @@ -47,38 +47,11 @@ const defaultChangelogFunctions = {
*/
const gitHubChangelogFunctions = {
getDependencyReleaseLine: async (
changesets,
dependenciesUpdated,
options,
_changesets,
_dependenciesUpdated,
_options,
) => {
if (!options.repo) {
throw new Error(
'Please provide a repo to this changelog generator like this:\n"changelog": ["./changelog.js", { "repo": "org/repo" }]',
);
}
if (dependenciesUpdated.length === 0) return '';

const changesetLink = `- Updated dependencies [${(
await Promise.all(
changesets.map(async (cs) => {
if (cs.commit) {
let { links } = await getInfo({
repo: options.repo,
commit: cs.commit,
});
return links.commit;
}
}),
)
)
.filter((_) => _)
.join(', ')}]:`;

const updatedDependenciesList = dependenciesUpdated.map(
(dependency) => ` - ${dependency.name}@${dependency.newVersion}`,
);

return [changesetLink, ...updatedDependenciesList].join('\n');
return '';
},
getReleaseLine: async (changeset, _type, options) => {
if (!options || !options.repo) {
Expand Down

0 comments on commit 147659c

Please sign in to comment.