Skip to content

Commit

Permalink
fix: ui imports for open in v0 (#6029)
Browse files Browse the repository at this point in the history
  • Loading branch information
shadcn authored Dec 10, 2024
1 parent 729b9ec commit 7049912
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/www/actions/edit-in-v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ export async function editInV0({
// Remove v0 prefix from the name
registryItem.name = registryItem.name.replace(/^v0-/, "")

// Replace `@/registry/new-york/` in files.
registryItem.files = registryItem.files.map((file) => {
if (file.content?.includes("@/registry/new-york/ui")) {
file.content = file.content?.replaceAll(
"@/registry/new-york/ui",
"@/components/ui"
)
}
return file
})

const payload = {
version: 2,
payload: registryItem,
Expand Down

0 comments on commit 7049912

Please sign in to comment.