Skip to content

Commit f14c7db

Browse files
authored
Chore custom changelog (#5174)
* chore: create custom changelog for changesets * chore: changing format * fix: wrong format for changeset
1 parent 4e65e00 commit f14c7db

File tree

9 files changed

+68
-20
lines changed

9 files changed

+68
-20
lines changed

.changeset/config.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/config/schema.json",
3-
"changelog": "@changesets/changelog-git",
3+
"changelog": [
4+
"scripts/github/changesets/create-changelog.js",
5+
{ "owner": "db-ux-design-system", "repo": "core-web" }
6+
],
47
"commit": false,
58
"fixed": [
69
[
@@ -17,6 +20,6 @@
1720
"ignore": ["scripts"],
1821
"linked": [],
1922
"access": "public",
20-
"baseBranch": "main",
23+
"baseBranch": "origin/main",
2124
"updateInternalDependencies": "patch"
2225
}

.changeset/fix-dbtabs-arrows-on-resize.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
---
88

99
fix(DBTabs): ensure navigation arrows appear correctly on window resize
10+
1011
This update resolves an issue where navigation arrows in DBTabs would not appear or update correctly when the window was resized. The component now properly responds to resize events, ensuring arrows are always shown or hidden as needed.

.changeset/sour-brooms-tie.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
"@db-ux/core-foundations": patch
99
---
1010

11-
enabled [`@db-ux/agent-cli`](https://www.npmjs.com/package/@db-ux/agent-cli) for every package to
12-
auto-generate/auto-update `.github/copilot-instructions.md`, to ensure GitHub Copilot
13-
uses DB UX Components for code generation
11+
enabled [`@db-ux/agent-cli`](https://www.npmjs.com/package/@db-ux/agent-cli) for every package
12+
13+
auto-generate/auto-update `.github/copilot-instructions.md`, to ensure GitHub Copilot uses DB UX Components for code generation

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
"@angular/ssr": "19.2.17",
9797
"@axe-core/playwright": "4.10.2",
9898
"@babel/eslint-parser": "7.28.4",
99-
"@changesets/cli": "^2.29.5",
99+
"@changesets/cli": "2.29.7",
100+
"@changesets/types": "6.1.0",
100101
"@commitlint/cli": "20.1.0",
101102
"@commitlint/config-conventional": "20.0.0",
102103
"@db-ux/db-theme": "5.2.0",

packages/components/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If you just need the styling follow this:
2929

3030
**No!** The `@db-ux/core-components` package **automatically includes** all the foundations (`@db-ux/core-foundations`) you need. You only need to install one package:
3131

32-
- **Use `@db-ux/core-components`** - If you want to use UI components (buttons, inputs, etc.)
32+
- **Use `@db-ux/core-components`** - If you want to use UI components (buttons, inputs, etc.)
3333
- **Use `@db-ux/core-foundations`** - If you only need design tokens, colors, spacing, fonts, and assets without any component styles
3434

3535
## Install
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* @type {import('@changesets/types/dist/declarations/src').GetReleaseLine}
3+
*/
4+
const getReleaseLine = async (changeset, _type, options) => {
5+
const [firstLine, ...futureLines] = changeset.summary
6+
.split('\n')
7+
.map((l) => l.trimEnd());
8+
9+
let returnValue = `- ${firstLine}`;
10+
11+
// Options are coming from .changeset/config.json
12+
if (changeset.commit && options.owner && options.repo) {
13+
const link = `https://github.com/${options.owner}/${options.repo}/commit/${changeset.commit}`;
14+
returnValue += ` - [see commit](${link})`;
15+
}
16+
17+
if (futureLines.length > 0) {
18+
returnValue += `:\n\n`;
19+
returnValue += `\n${futureLines
20+
.filter((l) => l.length)
21+
.map((l) => `\t- ${l}`)
22+
.join('\n')}`;
23+
}
24+
25+
returnValue += `\n`;
26+
27+
return returnValue;
28+
};
29+
30+
/**
31+
* @type {import('@changesets/types/dist/declarations/src').GetDependencyReleaseLine}
32+
*/
33+
const getDependencyReleaseLine = async () =>
34+
// We don't want dependencies to show in the changelog, because we align the version anyway
35+
'';
36+
/**
37+
* @type {import('@changesets/types/dist/declarations/src').ChangelogFunctions}
38+
*/
39+
const functions = {
40+
getReleaseLine,
41+
getDependencyReleaseLine
42+
};
43+
44+
export default functions;

scripts/github/changesets/publish.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function getFirstHeadline(changelog: string): string {
4646

4747
function getReleaseNotes(): string {
4848
const repoRoot = path.resolve(__dirname, '../../../');
49-
const changelogFiles = findChangelogFiles(repoRoot);
49+
const changelogFiles = findChangelogFiles(repoRoot, ['output/**']);
5050
const notes: string[] = [];
5151
for (const file of changelogFiles) {
5252
const changelog = fs.readFileSync(file, 'utf8');
@@ -58,15 +58,7 @@ function getReleaseNotes(): string {
5858
}
5959
}
6060

61-
return notes
62-
.map((log) =>
63-
log
64-
.split('\n')
65-
.map((line) => line.replace('#', '##'))
66-
.join('\n')
67-
)
68-
.join('\n\n---\n\n')
69-
.trim();
61+
return notes.join('\n\n---\n\n').trim();
7062
}
7163

7264
function releaseExists(tag: string): boolean {

scripts/github/changesets/utils.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ import { globSync } from 'glob';
33
/**
44
* Find all CHANGELOG.md files in the repo, excluding node_modules, using glob.
55
*/
6-
export function findChangelogFiles(repoRoot: string): string[] {
6+
export function findChangelogFiles(
7+
repoRoot: string,
8+
ignores?: string[]
9+
): string[] {
10+
const ignore = ignores ?? [];
11+
ignore.push('**/node_modules/**');
12+
713
return globSync('**/CHANGELOG.md', {
814
cwd: repoRoot,
9-
ignore: ['**/node_modules/**'],
15+
ignore,
1016
absolute: true
1117
});
1218
}

0 commit comments

Comments
 (0)