Skip to content

fix(shadcn): preserve binary registry files - #11300

Open
hugosmoreira wants to merge 1 commit into
shadcn-ui:mainfrom
hugosmoreira:agent/fix-binary-registry-files
Open

fix(shadcn): preserve binary registry files#11300
hugosmoreira wants to merge 1 commit into
shadcn-ui:mainfrom
hugosmoreira:agent/fix-binary-registry-files

Conversation

@hugosmoreira

Copy link
Copy Markdown

Summary

  • encode binary registry file contents as base64 during shadcn build
  • decode base64 payloads back to their original bytes during installation
  • compare existing binary files byte-for-byte and exclude them from source transforms
  • expose the optional encoding: "base64" field in the registry item schemas
  • add a patch changeset and focused build/install regressions

Root cause

The registry builder read every source file as UTF-8. Binary bytes that are not valid UTF-8 were replaced before the content was serialized to JSON, and the installer later wrote that damaged string back to disk as UTF-8.

Text registry files keep their existing representation. Only content containing null bytes or failing a lossless UTF-8 round trip is base64-encoded.

Validation

  • vitest run packages/shadcn/src/commands/build.test.ts — 2 tests passed
  • focused binary build/install regressions — 2 tests passed
  • tsc --noEmit for packages/shadcn
  • ESLint for all changed TypeScript files
  • Prettier check for all changed files
  • changeset status

Fixes #7287

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

@hugosmoreira is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@hugosmoreira
hugosmoreira force-pushed the agent/fix-binary-registry-files branch from bf9e0a4 to 5c03fc3 Compare July 27, 2026 04:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug]: registry:file writing corrupt font files.

1 participant