You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(scripts): shadcn-sync refuses to silently delete local edits, and compiles the package after it writes (#3035)
#3033 stopped the sync writing unresolvable import paths. It did not make
`--update-all` safe to run: the other failure mode is overwriting local
edits, and I was wrong about how that shows up. I expected a loud type
error. It is silent.
`command.tsx` is the worked example. It carries local additions upstream
has never had — a `sr-only` `DialogTitle`/`DialogDescription` on
`CommandDialog` (Radix requires an accessible name) and `contentProps`,
which is the ADR-0054 C4 testability contract letting callers attach a
stable locator to the dialog element. Syncing it deletes 38 lines,
removes both, and **type-checks clean**, because upstream drops each
addition together with its usages. Nothing downstream notices.
So two layers, not one:
**Refuse before writing.** Any line the local file has that the incoming
version does not is reported, and the write is skipped. Comments count —
a comment explaining why we diverged is exactly what must not evaporate.
`--force` overrides. Measured across all 46 registry entries this
discriminates rather than crying wolf: 29 have no local-only lines and
sync cleanly, 17 are protected. `--update-all` now reports skipped
separately from failed.
**Compile after writing.** `--update` and `--update-all` then run
`pnpm --filter @object-ui/components type-check` and say plainly whether
the package still builds, with the rollback command on failure.
`--no-verify` skips it. This is the backstop for whatever the first layer
does not model — it would not have caught `command`, which is precisely
why the first layer exists.
Reporting only; neither layer rolls back for you. Auto-reverting would
throw away a sync someone may want to fix by hand.
Verified end to end: `--update command` refuses and lists the ADR-0054
lines; `--force` overrides it; `--update button` (0 local-only lines)
syncs and leaves the tree byte-identical; the #3033 unmapped-path guard
and the `resizable` reclassification both still hold. Tree restored — no
component file changes here.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
0 commit comments