-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy path.release-it.cjs
More file actions
72 lines (63 loc) · 2.13 KB
/
.release-it.cjs
File metadata and controls
72 lines (63 loc) · 2.13 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
const fs = require('node:fs');
function readIfExists(p) {
try {
return fs.readFileSync(p, 'utf8').trim();
} catch {
return '';
}
}
module.exports = {
git: {
requireCleanWorkingDir: true,
tagName: 'v${version}',
commitMessage: 'chore(release): v${version}',
},
github: {
release: true,
skipChecks: true,
// Prefer curated notes; fall back to generated notes; otherwise let release-it decide.
releaseNotes: () => {
const curated = readIfExists('RELEASE_NOTES.md');
if (curated) return curated;
const generated = readIfExists('RELEASE_NOTES.generated.md');
if (generated) return generated;
return undefined;
},
},
// Workspace plugin publishes packages; root is not published directly.
// publish: false keeps the npm plugin active for version reading (package.json)
// while preventing release-it from publishing the private root package itself.
npm: { publish: false, allowSameVersion: true },
plugins: {
'@release-it/conventional-changelog': {
preset: {
name: 'angular',
types: [
{ type: 'feat', section: 'Features' },
{ type: 'fix', section: 'Bug Fixes' },
{ type: 'perf', section: 'Performance Improvements' },
{ type: 'revert', section: 'Reverts' },
{ type: 'refactor', section: 'Refactoring' },
{ type: 'chore', section: 'Chores' },
],
},
infile: 'CHANGELOG.md',
header: '# Changelog',
},
'@release-it-plugins/workspaces': {
// --no-git-checks prevents pnpm from prompting when not on the
// default publish-branch (e.g. when releasing from version-3.0).
publishCommand: 'node scripts/publish-workspace.cjs',
},
},
hooks: {
// Create dist and validate before releasing
'before:init': ['pnpm test', 'pnpm run build'],
// Create generated notes + per-package changelogs from the updated root changelog
'after:changelog': [
'node scripts/split-changelog.cjs',
// Inject curated notes into the newest release section (optional)
'node scripts/inject-release-notes.cjs',
],
},
};