@cluerise/tools 5.2.1 → 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.
|
@@ -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',
|
|
@@ -454,9 +454,8 @@ const main = async (args) => {
|
|
|
454
454
|
if (process.env.GITHUB_ACTIONS === "true") {
|
|
455
455
|
ActionsCore.setOutput("release", release);
|
|
456
456
|
ActionsCore.setOutput(`release.${release.name}`, release);
|
|
457
|
-
} else {
|
|
458
|
-
console.log(JsonUtils.prettify(release));
|
|
459
457
|
}
|
|
458
|
+
console.log(JsonUtils.prettify(release));
|
|
460
459
|
return 0;
|
|
461
460
|
}
|
|
462
461
|
case "info": {
|
|
@@ -464,9 +463,8 @@ const main = async (args) => {
|
|
|
464
463
|
if (process.env.GITHUB_ACTIONS === "true") {
|
|
465
464
|
ActionsCore.setOutput("info", info);
|
|
466
465
|
ActionsCore.setOutput(`info.${info.name}`, info);
|
|
467
|
-
} else {
|
|
468
|
-
console.log(JsonUtils.prettify(info));
|
|
469
466
|
}
|
|
467
|
+
console.log(JsonUtils.prettify(info));
|
|
470
468
|
return 0;
|
|
471
469
|
}
|
|
472
470
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cluerise/tools",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Tools for maintaining TypeScript projects.",
|
|
5
5
|
"author": "Branislav Holý <brano@holy.am>",
|
|
6
6
|
"repository": "github:cluerise/tools",
|
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
"@commitlint/config-conventional": "19.8.1",
|
|
23
23
|
"@commitlint/load": "19.8.1",
|
|
24
24
|
"@commitlint/types": "19.8.1",
|
|
25
|
-
"@eslint/js": "9.
|
|
25
|
+
"@eslint/js": "9.32.0",
|
|
26
26
|
"@eslint/json": "0.13.1",
|
|
27
27
|
"@eslint/markdown": "7.1.0",
|
|
28
|
-
"@html-eslint/eslint-plugin": "0.43.
|
|
28
|
+
"@html-eslint/eslint-plugin": "0.43.1",
|
|
29
29
|
"@html-eslint/parser": "0.43.0",
|
|
30
30
|
"@typescript-eslint/parser": "8.38.0",
|
|
31
31
|
"conventional-changelog-conventionalcommits": "9.1.0",
|
|
32
|
-
"eslint": "9.
|
|
32
|
+
"eslint": "9.32.0",
|
|
33
33
|
"eslint-config-prettier": "10.1.8",
|
|
34
34
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
35
35
|
"eslint-plugin-import": "2.32.0",
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
"semver": "7.7.2",
|
|
47
47
|
"smol-toml": "1.4.1",
|
|
48
48
|
"typescript-eslint": "8.38.0",
|
|
49
|
-
"zod": "4.0.
|
|
49
|
+
"zod": "4.0.14"
|
|
50
50
|
}
|
|
51
51
|
}
|