Skip to content

Commit c839fe8

Browse files
committed
feat: improve release automation and script quality based on code review
- Add @semantic-release/npm and @semantic-release/exec plugins to bump versions in all files - Separate would_convert counter from skipped count in ra2mp3 for clearer dry-run reporting - Improve case preservation in PR title normalization (preserve proper nouns/brands) - Update semantic-release config to update VERSION strings in shell scripts - Address critical issues identified in code review
1 parent 176ba7e commit c839fe8

File tree

556 files changed

+31318
-265012
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

556 files changed

+31318
-265012
lines changed

.github/scripts/normalize-pr-title.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ function normalizeCaseOnly(title) {
4848
const normalizedType = type.toLowerCase();
4949
const normalizedScope = scope ? scope.toLowerCase() : '';
5050
const normalizedBreaking = breaking || '';
51-
// Lowercase the entire description, not just first character
52-
const normalizedDescription = description.toLowerCase();
51+
// Preserve proper case in description, only ensure sentence case (first letter lowercase)
52+
const normalizedDescription = description.charAt(0).toLowerCase() + description.slice(1);
5353

5454
if (scope) {
5555
return `${normalizedType}(${normalizedScope})${normalizedBreaking}: ${normalizedDescription}`;
@@ -156,8 +156,8 @@ function generateTitle(currentTitle, commits, branchName) {
156156

157157
// No commits - use branch name to determine type
158158
if (commits.length === 0) {
159-
// Lowercase the entire title for consistency
160-
const titleToUse = currentTitle.toLowerCase();
159+
// Preserve case but ensure sentence case (first letter lowercase)
160+
const titleToUse = currentTitle.charAt(0).toLowerCase() + currentTitle.slice(1);
161161
if (branchName && branchName.includes('feat')) {
162162
return `feat: ${titleToUse}`;
163163
} else if (branchName && branchName.includes('fix')) {
@@ -173,8 +173,8 @@ function generateTitle(currentTitle, commits, branchName) {
173173
const msgMatch = result.message.match(/^([^:]+):\s*(.+)$/i);
174174
if (msgMatch) {
175175
const [, prefix, description] = msgMatch;
176-
// Lowercase the entire description
177-
const normalizedDescription = description.toLowerCase();
176+
// Preserve case but ensure sentence case (first letter lowercase)
177+
const normalizedDescription = description.charAt(0).toLowerCase() + description.slice(1);
178178
let newTitle = `${prefix.toLowerCase()}: ${normalizedDescription}`;
179179

180180
// Add breaking change indicator if needed
@@ -193,8 +193,8 @@ function generateTitle(currentTitle, commits, branchName) {
193193
let baseTitle = currentTitle
194194
.replace(' [semantic pr title]', '')
195195
.replace(patterns.removePrefix, '');
196-
// Lowercase the entire base title
197-
baseTitle = baseTitle.toLowerCase();
196+
// Preserve case but ensure sentence case (first letter lowercase)
197+
baseTitle = baseTitle.charAt(0).toLowerCase() + baseTitle.slice(1);
198198

199199
// Build the type prefix
200200
let typePrefix = primaryType;
@@ -255,22 +255,22 @@ function ensureValidFormat(title) {
255255
}
256256

257257
// Add chore prefix if no valid type found
258-
const desc = title.toLowerCase();
258+
const desc = title.charAt(0).toLowerCase() + title.slice(1);
259259
return `chore: ${desc}`;
260260
}
261261

262262
/**
263263
* Final normalization step
264264
*/
265265
function finalNormalize(title) {
266-
// Normalize the entire title: lowercase type/scope and entire description
266+
// Normalize the title: lowercase type/scope but preserve case in description (sentence case)
267267
return title.replace(/^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\((.+?)\))?(!?): (.+)$/i,
268268
(match, type, scopeGroup, scope, breaking, description) => {
269269
const normalizedType = type.toLowerCase();
270270
const normalizedScope = scope ? scope.toLowerCase() : '';
271271
const normalizedBreaking = breaking || '';
272-
// Lowercase the entire description
273-
const normalizedDescription = description.toLowerCase();
272+
// Preserve case but ensure sentence case (first letter lowercase)
273+
const normalizedDescription = description.charAt(0).toLowerCase() + description.slice(1);
274274

275275
if (scopeGroup) {
276276
return `${normalizedType}(${normalizedScope})${normalizedBreaking}: ${normalizedDescription}`;

node_modules/.bin/JSONStream

Lines changed: 0 additions & 1 deletion
This file was deleted.

node_modules/.bin/conventional-changelog-writer

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

node_modules/.bin/conventional-commits-parser

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

0 commit comments

Comments
 (0)