Skip to content

Commit b7bfe73

Browse files
authored
fix: ui imports for open in v0 (shadcn-ui#6029)
1 parent 16fdb2a commit b7bfe73

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

actions/edit-in-v0.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ export async function editInV0({
8282
// Remove v0 prefix from the name
8383
registryItem.name = registryItem.name.replace(/^v0-/, "")
8484

85+
// Replace `@/registry/new-york/` in files.
86+
registryItem.files = registryItem.files.map((file) => {
87+
if (file.content?.includes("@/registry/new-york/ui")) {
88+
file.content = file.content?.replaceAll(
89+
"@/registry/new-york/ui",
90+
"@/components/ui"
91+
)
92+
}
93+
return file
94+
})
95+
8596
const payload = {
8697
version: 2,
8798
payload: registryItem,

0 commit comments

Comments
 (0)