Files
WRNexusJS/FIXES-0.6.0-R12-RELEASE-REFERENCE-GATE.md
T
2026-08-01 06:50:37 +05:30

1.3 KiB

R12 release reference gate fix

Failure

bun run scripts/release.ts publish could stop with:

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.