@cluerise/tools 5.2.2 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configs/release.config.js +72 -57
- package/package.json +1 -1
|
@@ -7,7 +7,6 @@ export const defaultReleaseRules = [
|
|
|
7
7
|
{ type: 'fix', release: 'patch' },
|
|
8
8
|
{ type: 'perf', release: 'minor' },
|
|
9
9
|
{ type: 'deps', release: false },
|
|
10
|
-
{ type: 'deps', scope: 'prod', release: 'patch' },
|
|
11
10
|
{ type: 'refactor', release: false },
|
|
12
11
|
{ type: 'docs', release: false },
|
|
13
12
|
{ type: 'chore', release: false },
|
|
@@ -20,8 +19,7 @@ export const defaultReleaseRules = [
|
|
|
20
19
|
export const defaultChangelogTypes = [
|
|
21
20
|
{ type: 'feat', section: 'Features' },
|
|
22
21
|
{ type: 'fix', section: 'Fixes' },
|
|
23
|
-
{ type: 'perf', section: 'Performance improvements' }
|
|
24
|
-
{ type: 'deps', scope: 'prod', section: 'Dependency updates' }
|
|
22
|
+
{ type: 'perf', section: 'Performance improvements' }
|
|
25
23
|
];
|
|
26
24
|
|
|
27
25
|
const getRepositoryUrl = (path) => {
|
|
@@ -38,58 +36,74 @@ export const createReleaseConfig = ({
|
|
|
38
36
|
repository,
|
|
39
37
|
path = '',
|
|
40
38
|
tagFormat,
|
|
41
|
-
releaseRules = defaultReleaseRules,
|
|
42
|
-
changelogTypes = defaultChangelogTypes
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
)
|
|
81
|
-
})),
|
|
82
|
-
collapse: commitGroup.title === 'Dependency updates'
|
|
83
|
-
}));
|
|
84
|
-
|
|
85
|
-
return {
|
|
86
|
-
...context,
|
|
87
|
-
owner,
|
|
88
|
-
repository,
|
|
89
|
-
commitGroups
|
|
90
|
-
};
|
|
39
|
+
releaseRules: inputReleaseRules = defaultReleaseRules,
|
|
40
|
+
changelogTypes: inputChangelogTypes = defaultChangelogTypes,
|
|
41
|
+
dependencyScopes = ['prod']
|
|
42
|
+
}) => {
|
|
43
|
+
const releaseRules = [
|
|
44
|
+
...inputReleaseRules,
|
|
45
|
+
...dependencyScopes.map((scope) => ({ type: 'deps', scope, release: 'patch' }))
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const changelogTypes = [
|
|
49
|
+
...inputChangelogTypes,
|
|
50
|
+
...dependencyScopes.map((scope) => ({
|
|
51
|
+
type: 'deps',
|
|
52
|
+
scope,
|
|
53
|
+
section: 'Dependency updates'
|
|
54
|
+
}))
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
extends: [Path.join(import.meta.dirname, 'release-cwd.config.cjs')],
|
|
59
|
+
branches: ['main'],
|
|
60
|
+
repositoryUrl: getRepositoryUrl(path),
|
|
61
|
+
tagFormat,
|
|
62
|
+
preset: 'conventionalcommits',
|
|
63
|
+
dryRun: true,
|
|
64
|
+
|
|
65
|
+
plugins: [
|
|
66
|
+
[
|
|
67
|
+
'@semantic-release/commit-analyzer',
|
|
68
|
+
{
|
|
69
|
+
releaseRules
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
[
|
|
73
|
+
'@semantic-release/release-notes-generator',
|
|
74
|
+
{
|
|
75
|
+
host,
|
|
76
|
+
presetConfig: {
|
|
77
|
+
types: changelogTypes
|
|
91
78
|
},
|
|
92
|
-
|
|
79
|
+
writerOpts: {
|
|
80
|
+
commitGroupsSort: ({ title: titleA }, { title: titleB }) => {
|
|
81
|
+
const indexA = changelogTypes.findIndex(({ section }) => section === titleA);
|
|
82
|
+
const indexB = changelogTypes.findIndex(({ section }) => section === titleB);
|
|
83
|
+
|
|
84
|
+
return indexA - indexB;
|
|
85
|
+
},
|
|
86
|
+
finalizeContext: (context) => {
|
|
87
|
+
const commitGroups = context.commitGroups.map((commitGroup) => ({
|
|
88
|
+
...commitGroup,
|
|
89
|
+
commits: commitGroup.commits.map((commit) => ({
|
|
90
|
+
...commit,
|
|
91
|
+
subject: commit.subject.replace(
|
|
92
|
+
`${host}/${context.owner}/${context.repository}`,
|
|
93
|
+
`${host}/${owner}/${repository}`
|
|
94
|
+
)
|
|
95
|
+
})),
|
|
96
|
+
collapse: commitGroup.title === 'Dependency updates'
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
...context,
|
|
101
|
+
owner,
|
|
102
|
+
repository,
|
|
103
|
+
commitGroups
|
|
104
|
+
};
|
|
105
|
+
},
|
|
106
|
+
mainTemplate: `{{> header}}
|
|
93
107
|
|
|
94
108
|
{{#if noteGroups}}
|
|
95
109
|
{{#each noteGroups}}
|
|
@@ -121,11 +135,12 @@ export const createReleaseConfig = ({
|
|
|
121
135
|
{{/if}}
|
|
122
136
|
|
|
123
137
|
{{/each}}`
|
|
138
|
+
}
|
|
124
139
|
}
|
|
125
|
-
|
|
140
|
+
]
|
|
126
141
|
]
|
|
127
|
-
|
|
128
|
-
}
|
|
142
|
+
};
|
|
143
|
+
};
|
|
129
144
|
|
|
130
145
|
export default createReleaseConfig({
|
|
131
146
|
host: 'https://github.com',
|