-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbeachball.config.ts
48 lines (46 loc) · 1.72 KB
/
beachball.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import type { BeachballConfig } from 'beachball';
const config: BeachballConfig = {
access: 'public',
registry: 'https://registry.npmjs.org',
ignorePatterns: [
'.*ignore',
'.yamllint',
'.eslintrc.cjs',
'.pnpm-store/**',
'.vscode/**',
'prettier.config.cjs',
'pnpm-lock.yaml',
],
changelog: {
customRenderers: {
// eslint-disable-next-line @typescript-eslint/require-await
async renderChangeTypeHeader(changeType, renderInfo) {
const changelogDate = renderInfo.newVersionChangelog.date
.toLocaleDateString('zh-CN')
.replace(/\//g, '-');
const heading =
changeType === 'major' || changeType === 'minor' ? '##' : '###';
return `${heading} [${
renderInfo.newVersionChangelog.version
}](https://github.com/RightCapitalHQ/verdaccio-package-diff/tree/${encodeURIComponent(
renderInfo.newVersionChangelog.tag,
)}) (${changelogDate})`;
},
// Original template: https://github.com/microsoft/beachball/blob/aefbc1ac37ee85961cc787133c827f1fd3925550/src/changelog/renderPackageChangelog.ts#L93
// eslint-disable-next-line @typescript-eslint/require-await
async renderEntry(entry) {
if (entry.author === 'beachball') {
return `- ${entry.comment}`;
}
// Imitate GitHub's commit format https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls#commit-shas
return `- ${entry.comment} ([${entry.commit.substring(
0,
7,
)}](https://github.com/RightCapitalHQ/verdaccio-package-diff/commit/${
entry.commit
}))`;
},
},
},
};
export default config;