Skip to content

Sync stale Dock/PixelTransition registry and prevent future drift#166

Open
Gazoon007 wants to merge 3 commits into
DavidHDev:mainfrom
Gazoon007:fix/registry-sync
Open

Sync stale Dock/PixelTransition registry and prevent future drift#166
Gazoon007 wants to merge 3 commits into
DavidHDev:mainfrom
Gazoon007:fix/registry-sync

Conversation

@Gazoon007

@Gazoon007 Gazoon007 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Motivation

This started with the review on #164, where the note was to run pnpm build:registry by hand so the new component's registry file gets generated:

just one thing, run pnpm build:registry, it will create the registry file for this component
(comment)

That manual step is easy to forget, and it is exactly why the Dock and PixelTransition entries drifted out of sync here. Instead of leaning on everyone remembering it, or a reviewer having to flag it every single time, this PR makes the registry rebuild itself during normal development and adds a CI check so it cannot silently fall behind again.

What this does

Keeps the generated jsrepo registry in sync with the components, in two parts:

  1. Rebuilds the registry so public/r/Dock.json and public/r/PixelTransition.json match their current source.
  2. Adds tooling so it stops drifting in the first place.

Why it was out of sync

The public/r/*.json files are generated by pnpm build:registry but committed to the repo, so they go stale whenever a component is edited without rerunning the build.

The registry was last regenerated back in #163 (Revamp 2026), commit 9509966. Two later commits then changed the source without rebuilding it:

  • b69cd0e ("small fixes") set the Dock background from #120F17 to #111
  • de00bda ("type fixes") switched the PixelTransition import to type CSSProperties

So the source moved on and the registry stayed behind. A clean rebuild confirms these were the only two files affected.

Preventing it from happening again

react-bits already handles this by running the registry build in watch mode alongside Vite, so edits regenerate the registry automatically. This PR wires the same thing into dev, reusing the run-p dependency that is already in the project:

"dev": "run-p dev:registry dev:vite"

Two changes back that up:

  • The componentDependencies generator now formats its output with Prettier, so the build, watch, and CI all produce the committed style instead of tabs. This removes a diff that used to show up just from running dev.
  • A small CI workflow rebuilds the registry on every PR and fails if it drifted, so a stale registry gets caught automatically.

The committed source for these components had drifted from their generated
registry files (Dock: background #120F17 -> DavidHDev#111; PixelTransition: import
'type CSSProperties'), but `pnpm build:registry` was never re-run. Regenerate
so the registry matches the source on main.
- dev now runs the registry build in --watch mode alongside Vite (via run-p),
  mirroring react-bits, so editing a component regenerates public/r/*.json and
  componentDependencies.ts automatically — no need to remember build:registry.
- The componentDependencies generator now formats its output with the repo's
  Prettier config, so every path (build, --watch, CI) emits the committed 2-space
  style instead of tabs. Fixes the spurious diff that appeared just from running dev.
Rebuilds the registry on every PR/push and fails if public/r or
componentDependencies.ts drifted from the component sources. Enforcement
backstop so a stale registry is caught automatically, not by a reviewer.
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.

1 participant