Files
backstage/docs-ui/package.json
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

58 lines
1.6 KiB
JSON

{
"name": "docs-ui",
"version": "0.1.0",
"private": true,
"scripts": {
"prebuild": "yarn sync:css",
"build": "next build",
"lint": "next lint",
"prestart": "yarn sync:css",
"start": "next dev",
"sync:changelog": "node scripts/sync-changelog.mjs",
"sync:changelog:dry-run": "node scripts/sync-changelog.mjs --dry-run",
"sync:css": "node scripts/sync-css.js",
"sync:css:watch": "node scripts/sync-css.js --watch"
},
"resolutions": {
"@types/react": "19.1.9",
"@types/react-dom": "19.1.7"
},
"dependencies": {
"@base-ui-components/react": "^1.0.0-beta.4",
"@codemirror/lang-sass": "^6.0.2",
"@codemirror/view": "^6.34.4",
"@lezer/highlight": "^1.2.1",
"@mdx-js/loader": "^3.1.0",
"@mdx-js/react": "^3.1.0",
"@next/mdx": "15.3.4",
"@remixicon/react": "^4.6.0",
"@storybook/react": "^8.6.12",
"@uiw/codemirror-themes": "^4.23.7",
"@uiw/react-codemirror": "^4.23.7",
"clsx": "^2.1.1",
"html-react-parser": "^5.2.5",
"motion": "^12.4.1",
"next": "15.4.7",
"next-mdx-remote-client": "^2.1.2",
"prop-types": "^15.8.1",
"react": "19.1.1",
"react-dom": "19.1.1",
"shiki": "^3.13.0",
"storybook": "^8.6.12"
},
"devDependencies": {
"@octokit/rest": "^22.0.1",
"@shikijs/transformers": "^3.13.0",
"@types/mdx": "^2.0.13",
"@types/node": "^20",
"@types/react": "19.1.9",
"@types/react-dom": "19.1.7",
"chokidar": "^3.6.0",
"eslint": "^8",
"eslint-config-next": "15.3.4",
"lightningcss": "^1.28.2",
"typescript": "^5",
"unified": "^11.0.4"
}
}