Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .changeset/changelog.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const github = require("@changesets/changelog-github").default;

// GitHub renders bare scoped package names as @mentions unless they are code.
const SCOPED =
/(?<![\w`.@/-])@[a-z0-9][\w.-]*\/[\w.*-]+(?:@[\w.^~<>=+*-]*[\w*])?|(?<![\w`.@/-])@(?:variablelab|rrlab|vlandoss)\b/gi;
const CODE = /(```[\s\S]*?```|`[^`\n]*`)/;

function codeScopes(text) {
return text
.split(CODE)
.map((part, i) => (i % 2 ? part : part.replace(SCOPED, (name) => `\`${name}\``)))
.join("");
}

module.exports = {
async getReleaseLine(...args) {
return codeScopes(await github.getReleaseLine(...args));
},
async getDependencyReleaseLine(...args) {
return codeScopes(await github.getDependencyReleaseLine(...args));
},
};
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.1.1/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "withvariablelab/theme-toggle" }],
"changelog": ["./changelog.cjs", { "repo": "withvariablelab/theme-toggle" }],
"commit": true,
"fixed": [],
"linked": [],
Expand Down
Loading