From 4e4118f3cfa3f1817477f90549bdfc7afa406deb Mon Sep 17 00:00:00 2001 From: adrianhelvikspond <117183540+adrianhelvikspond@users.noreply.github.com> Date: Tue, 3 Sep 2024 20:21:51 +0200 Subject: [PATCH] Fix init command for default style - fixes #4722 (#4724) * Fix init command for default style The empty dependency string was tripping up package managers. * fix(www): registry dependencies for default --------- Co-authored-by: shadcn --- apps/www/public/r/styles/default/index.json | 3 +-- apps/www/scripts/build-registry.mts | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/apps/www/public/r/styles/default/index.json b/apps/www/public/r/styles/default/index.json index 8de00cf03e..d13e4c8203 100644 --- a/apps/www/public/r/styles/default/index.json +++ b/apps/www/public/r/styles/default/index.json @@ -4,8 +4,7 @@ "dependencies": [ "tailwindcss-animate", "class-variance-authority", - "lucide-react", - "" + "lucide-react" ], "registryDependencies": [ "utils" diff --git a/apps/www/scripts/build-registry.mts b/apps/www/scripts/build-registry.mts index f8903061f2..e12bb23d28 100644 --- a/apps/www/scripts/build-registry.mts +++ b/apps/www/scripts/build-registry.mts @@ -426,16 +426,21 @@ async function buildStylesIndex() { for (const style of styles) { const targetPath = path.join(REGISTRY_PATH, "styles", style.name) + const dependencies = [ + "tailwindcss-animate", + "class-variance-authority", + "lucide-react", + ] + + // TODO: Remove this when we migrate to lucide-react. + if (style.name === "new-york") { + dependencies.push("@radix-ui/react-icons") + } + const payload: RegistryEntry = { name: style.name, type: "registry:style", - dependencies: [ - "tailwindcss-animate", - "class-variance-authority", - "lucide-react", - // TODO: Remove this when we migrate to lucide-react. - style.name === "new-york" ? "@radix-ui/react-icons" : "", - ], + dependencies, registryDependencies: ["utils"], tailwind: { config: {