Improve script

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
Charles de Dreuille
2026-01-26 10:12:10 +00:00
parent 1df8ef4a47
commit 4926084387
4 changed files with 10 additions and 12 deletions
+7 -9
View File
@@ -188,7 +188,9 @@ async function parseChangelogMd(changelogPath, sinceVersion, validComponents) {
// Skip headings that are just markdown content within changelog entries
if (/^\d+\.\d+\.\d+/.test(versionText)) {
// Skip pre-release versions (e.g., 0.11.0-next.1, 0.9.0-alpha.2) to avoid duplicates
// Pre-release commits are included in the final release version
// While normalizeVersion() strips the suffix when writing entries, we need to skip
// pre-release sections entirely during parsing, otherwise we'd process the same
// commits twice: once from 0.11.0-next.1 and again from 0.11.0
if (/^\d+\.\d+\.\d+-/.test(versionText)) {
currentVersion = null;
currentSection = null;
@@ -328,7 +330,8 @@ async function parseListItem(
.replace(/\n*\*\*Affected components:\*\*[ \t]*[^\n]+/g, '')
.trim();
} else {
// Fallback: try old format without bold markers
// Fallback: try old format without bold markers for backwards compatibility
// Some older changelog entries may not have been migrated to the new format
const oldFormatMatch = description.match(
/Affected components?:\s*([^\n]+)/i,
);
@@ -385,18 +388,13 @@ async function parseListItem(
}
/**
* Infer change type from section and description
* Determine if a change is breaking based on semver rules
* Breaking change rules (semver):
* - version >= 1.0.0: Major changes are breaking
* - version < 1.0.0: Major and Minor changes are breaking
*/
function isBreakingChange(section, description, version) {
// Mark as breaking if explicitly mentioned in description
if (description.includes('BREAKING')) {
return true;
}
// Parse version to determine breaking change rules
// Parse version to determine breaking change rules based on semver
const normalizedVersion = normalizeVersion(version);
const [major] = normalizedVersion.split('.').map(Number);
+1 -1
View File
@@ -78,7 +78,7 @@ export const changelog_0_7_0: ChangelogProps[] = [
version: '0.7.0',
prs: ['30701'],
description: `**BREAKING**: Move breadcrumb to fit in the \`HeaderPage\` instead of the \`Header\` in Backstage UI.`,
breaking: true,
commitSha: '230b410',
},
{
+1 -1
View File
@@ -326,7 +326,7 @@ import { Disclosure, Button, DisclosurePanel } from 'react-aria-components';
components: [],
version: '0.9.0',
prs: ['31432'],
description: `Fix default font wight and font family in Backstage UI.`,
description: `Fix default font weight and font family in Backstage UI.`,
commitSha: '00bfb83',
},
+1 -1
View File
@@ -711,7 +711,7 @@
- dac851f: Fix the default font size in Backstage UI.
- 3c0ea67: Fix CSS layer ordering in Backstage UI to make sure component styles are loaded after tokens and base declarations.
- 4eb455c: Fix font smoothing as default in Backstage UI.
- 00bfb83: Fix default font wight and font family in Backstage UI.
- 00bfb83: Fix default font weight and font family in Backstage UI.
## 0.8.0