34 lines
1.3 KiB
Markdown
34 lines
1.3 KiB
Markdown
# R12 release reference gate fix
|
|
|
|
## Failure
|
|
|
|
`bun run scripts/release.ts publish` could stop with:
|
|
|
|
```text
|
|
UI component reference is stale.
|
|
M packages/ui/component-reference.json
|
|
```
|
|
|
|
even when the generated content was current.
|
|
|
|
## Root cause
|
|
|
|
The release gate used `git status --short` immediately after the generator ran. On Windows, generated files are written with LF while an `autocrlf` checkout may use CRLF. Git status can report the worktree file as modified even when its canonical Git content is unchanged.
|
|
|
|
The generator also writes `component-catalog.json`, but that file was not part of the release gate. Component ordering used `localeCompare`, which can vary by operating-system locale.
|
|
|
|
## Fix
|
|
|
|
- Compare generated files with `git diff --quiet`, which applies Git text normalization.
|
|
- Show real differences with `git diff --name-status`.
|
|
- Include all generated UI reference files:
|
|
- `packages/ui/component-catalog.json`
|
|
- `packages/ui/component-reference.json`
|
|
- `packages/ui/COMPONENTS.md`
|
|
- Replace locale-dependent sorting with a deterministic ASCII comparator.
|
|
- Add validation guards for the complete release gate.
|
|
|
|
## Expected result
|
|
|
|
A line-ending-only rewrite does not block publication. A real component-reference, catalog, or documentation difference still blocks publication and prints the exact changed files.
|