From e8bf80b7d07a8f778b349fd6e0510a6ccf8c46e0 Mon Sep 17 00:00:00 2001 From: shadcn Date: Tue, 10 Dec 2024 14:15:17 +0400 Subject: [PATCH] fix: ui imports for open in v0 --- apps/www/actions/edit-in-v0.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/www/actions/edit-in-v0.ts b/apps/www/actions/edit-in-v0.ts index 8acff92d8bc..35cd2961136 100644 --- a/apps/www/actions/edit-in-v0.ts +++ b/apps/www/actions/edit-in-v0.ts @@ -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,