From e4db39037859c1ef1c9441eb00775bf5880c8d3f Mon Sep 17 00:00:00 2001 From: julien-712dev Date: Mon, 8 Apr 2024 22:55:46 +0530 Subject: [PATCH] fix(blocks): replace code with @/components/ui imports while copying from lift-mode (#3401) FIXES : https://x.com/jimmeyer/status/1776487418150981661?s=46 The copy button in lift mode was copying code having imports as "@/registry/.../*.tsx" This PR replaces all the imports by "@/components/ui/*.tsx" --- apps/www/lib/blocks.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/www/lib/blocks.ts b/apps/www/lib/blocks.ts index 520cbd6..dd44e97 100644 --- a/apps/www/lib/blocks.ts +++ b/apps/www/lib/blocks.ts @@ -55,7 +55,9 @@ export async function getBlock( return { ...chunk, - code: sourceFile.getText(), + code: sourceFile + .getText() + .replaceAll(`@/registry/${style}/`, "@/components/"), } }) )