Files
backstage/docs-ui/README.md
T
Johan Persson 67f5310557 feat(docs-ui): add automated changelog sync from @backstage/ui
Adds automated synchronization of component changelogs from
@backstage/ui package to the documentation site, eliminating
manual changelog maintenance.

The sync script parses CHANGELOG.md using remark/unified, extracts
component-specific entries via "Affected components:" tags, and
generates per-version TypeScript files with preserved markdown
formatting. Includes GitHub API integration to automatically fetch
PR numbers for changelog entries.

Key features:
- Version comparison to sync only new releases
- Per-version file structure (changelogs/v0.2.0.ts, etc.)
- Markdown preservation via AST position slicing
- Component name mapping (PascalCase → kebab-case)
- Duplicate detection for idempotent syncing
- GitHub authentication via gh CLI or GITHUB_TOKEN
- Dry-run mode with preview

Usage:
```bash
yarn sync:changelog              # Sync new entries
yarn sync:changelog:dry-run      # Preview changes
```

Technical changes:
- Added scripts/sync-changelog.mjs (991 lines)
- Refactored changelog.ts to import per-version files
- Extracted types to separate types.ts file
- Added dependencies: @octokit/rest, unified (remark-parse via @mdx-js/mdx)
- Added documentation in README.md

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-11-17 11:37:39 +01:00

1.2 KiB

Backstage UI Docs

Backstage UI is our internal UI library built for Backstage. We built this website to document the library and its components. You can view this website here.

How to run locally

This website is built with Next.js and it is hosted on Github pages. To run it locally, you can run the following command:

yarn start

Deployment

Deployments are done automatically when a PR is merged into the master branch. We host the website using Github pages.

Maintaining Component Changelogs

After a @backstage/ui release, sync the component changelogs to keep documentation up-to-date:

yarn sync:changelog

This script:

  • Parses packages/ui/CHANGELOG.md for new versions
  • Extracts entries tagged with "Affected components: ..."
  • Updates src/utils/changelog.ts with new entries
  • Handles both component-specific and general package changes

After running, review the changes in src/utils/changelog.ts and commit them.

Preview changes before writing:

yarn sync:changelog:dry-run

Running this gives you a summary of what would be written, without actually adding or changing any files.