Skip to content

Commit

Permalink
chore: update changelog generator
Browse files Browse the repository at this point in the history
  • Loading branch information
o-az committed May 14, 2024
1 parent a0a9cf2 commit cfb7bae
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
24 changes: 24 additions & 0 deletions .changeset/changelog.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/** @type {import('@changesets/types').ChangelogFunctions['getDependencyReleaseLine']} */
const getDependencyReleaseLine = async (_, dependenciesUpdated) => {
if (dependenciesUpdated.length === 0) return '';
const updatedDepenenciesList = dependenciesUpdated.map(
(dependency) => `\`${dependency.name}@${dependency.newVersion}\``,
);
return `- Update dependencies: ${updatedDepenenciesList.join(', ')}`;
};

/** @type {import('@changesets/types').ChangelogFunctions['getReleaseLine']} */
const getReleaseLine = async (changeset) => {
const [firstLine, ...nextLines] = changeset.summary
.split('\n')
.map((l) => l.trimEnd());

if (!nextLines.length) return `- ${firstLine}`;

return `- ${firstLine}\n${nextLines.join('\n')}`;
};

module.exports = {
getDependencyReleaseLine,
getReleaseLine,
};
22 changes: 0 additions & 22 deletions .changeset/changelog.ts

This file was deleted.

2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": "./changelog.ts",
"changelog": "./changelog.cjs",
"commit": false,
"fixed": [],
"linked": [["rehype-pretty-code", "@rehype-pretty/transformers"]],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
"downlevelIteration": true
},
"include": ["scripts"],
"files": ["biome.json", ".changeset/changelog.ts"],
"files": ["biome.json", ".changeset/changelog.cjs"],
"exclude": ["node_modules"]
}

0 comments on commit cfb7bae

Please sign in to comment.