fix: restore registry json on vercel cache hit#74
Merged
Conversation
The registry JSON files were missing from production deployments (fixes #73) because turbo's registry:build cache only restores files inside packages/registry/public/r/, while copy-to-web.mjs also wrote to apps/web/public/r/ — an output path outside the task's package scope. When Vercel hit the remote cache, the copy script didn't re-run and apps/web/public/r/ was left empty, so /r/*.json returned 404. Move the cross-package copy into web:build and declare public/r/** as a web:build output so the files are cached and restored alongside .next/. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #73 —
npx shadcn@latest add https://data-table.openstatus.dev/r/data-table.jsonreturns 404.registry:buildoutputs are scoped topackages/registry/public/r/**, butcopy-to-web.mjsalso wrote toapps/web/public/r/**. On Vercel cache hits, the copy script doesn't re-run and files outside the task's package scope aren't restored — soapps/web/public/r/was left empty and Next.js served 404s for/r/*.json.web:build(via a newapps/web/scripts/copy-registry.mjs) and declarepublic/r/**as abuildoutput so the files are cached and restored alongside.next/.Test plan
pnpm prettier --check .passespnpm turbo lintpassespnpm turbo typecheckpassesDATABASE_URL= pnpm turbo testpassespnpm turbo build --filter=web --forceproducesapps/web/public/r/*.jsonapps/web/public/r/+.next/, runpnpm turbo build --filter=web→FULL TURBO(522ms) and JSON files are restoredhttps://data-table.openstatus.dev/r/data-table.jsonwith 200🤖 Generated with Claude Code