Skip to content

Commit afe83c7

Browse files
committed
chore: custom changelog format and clean up CHANGELOG
1 parent 29f57d0 commit afe83c7

5 files changed

Lines changed: 45 additions & 15 deletions

File tree

.changeset/changelog-config.cjs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
const { getInfo } = require('@changesets/get-github-info');
2+
3+
const repo = 'wangdicoder/tiny-design';
4+
5+
const getReleaseLine = async (changeset, _type) => {
6+
const [firstLine, ...rest] = changeset.summary.split('\n').map((l) => l.trimEnd());
7+
8+
// Try to get PR and commit info from GitHub
9+
let prLink = '';
10+
let commitLink = '';
11+
12+
if (changeset.commit) {
13+
try {
14+
const { links } = await getInfo({ repo, commit: changeset.commit });
15+
prLink = links.pull || '';
16+
commitLink = links.commit || '';
17+
} catch {
18+
// Fall back to just the commit hash
19+
const short = changeset.commit.slice(0, 7);
20+
commitLink = `[\`${short}\`](https://github.com/${repo}/commit/${changeset.commit})`;
21+
}
22+
}
23+
24+
const suffix = [prLink, commitLink].filter(Boolean).join(' ');
25+
const firstLineStr = suffix ? `- ${firstLine} - ${suffix}` : `- ${firstLine}`;
26+
const restStr = rest.length > 0 ? `\n${rest.map((l) => ` ${l}`).join('\n')}` : '';
27+
28+
return `\n${firstLineStr}${restStr}`;
29+
};
30+
31+
const getDependencyReleaseLine = async () => {
32+
// Omit "Updated dependencies" section
33+
return '';
34+
};
35+
36+
module.exports = {
37+
getReleaseLine,
38+
getDependencyReleaseLine,
39+
};

.changeset/config.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3-
"changelog": [
4-
"@changesets/changelog-github",
5-
{ "repo": "wangdicoder/tiny-design" }
6-
],
3+
"changelog": "./changelog-config.cjs",
74
"commit": false,
85
"fixed": [
96
[

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"devDependencies": {
2828
"@changesets/changelog-github": "^0.6.0",
2929
"@changesets/cli": "^2.30.0",
30+
"@changesets/get-github-info": "^0.8.0",
3031
"@eslint/js": "^9.0.0",
3132
"eslint": "^9.0.0",
3233
"eslint-plugin-jest": "^28.0.0",

packages/react/CHANGELOG.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,7 @@
44

55
### Patch Changes
66

7-
- [#50](https://github.com/wangdicoder/tiny-design/pull/50) [`582bc46`](https://github.com/wangdicoder/tiny-design/commit/582bc46828a5a8032ee9fe4d98ead5f0d547f61e) Thanks [@wangdicoder](https://github.com/wangdicoder)! - Fix conditional hook call in Heading component
8-
9-
- Updated dependencies []:
10-
- @tiny-design/icons@1.0.10
11-
- @tiny-design/tokens@1.0.10
12-
13-
## Release Schedule
14-
15-
- **x version**: release is not included in this schedule for breaking change and new features.
16-
- **y version**: minor version at the end of every month for new features.
17-
- **z version**: patch version at the end of every week for routine bugfix (anytime for urgent bugfix).
7+
- Fix conditional hook call in Heading component - [#50](https://github.com/wangdicoder/tiny-design/pull/50) [`582bc46`](https://github.com/wangdicoder/tiny-design/commit/582bc46828a5a8032ee9fe4d98ead5f0d547f61e)
188

199
## [1.0.9](https://github.com/wangdicoder/tiny-ui/compare/v1.0.7...v1.0.8) (2026-03-12)
2010

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)