From 4926084387c84852786ba3ced2c8d6e26e012c31 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Mon, 26 Jan 2026 10:12:10 +0000 Subject: [PATCH] Improve script Signed-off-by: Charles de Dreuille --- docs-ui/scripts/sync-changelog.mjs | 16 +++++++--------- docs-ui/src/utils/changelogs/v0.7.0.ts | 2 +- docs-ui/src/utils/changelogs/v0.9.0.ts | 2 +- packages/ui/CHANGELOG.md | 2 +- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/docs-ui/scripts/sync-changelog.mjs b/docs-ui/scripts/sync-changelog.mjs index d46ff2b108..5d89b87242 100644 --- a/docs-ui/scripts/sync-changelog.mjs +++ b/docs-ui/scripts/sync-changelog.mjs @@ -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); diff --git a/docs-ui/src/utils/changelogs/v0.7.0.ts b/docs-ui/src/utils/changelogs/v0.7.0.ts index a42d693661..ebef164d96 100644 --- a/docs-ui/src/utils/changelogs/v0.7.0.ts +++ b/docs-ui/src/utils/changelogs/v0.7.0.ts @@ -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', }, { diff --git a/docs-ui/src/utils/changelogs/v0.9.0.ts b/docs-ui/src/utils/changelogs/v0.9.0.ts index 0e6d90b978..a8e0fc6680 100644 --- a/docs-ui/src/utils/changelogs/v0.9.0.ts +++ b/docs-ui/src/utils/changelogs/v0.9.0.ts @@ -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', }, diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 80c42db125..0cff52fe45 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -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