diff --git a/registry-cli.json b/registry-cli.json index 0ef2e0c..867491e 100644 --- a/registry-cli.json +++ b/registry-cli.json @@ -130,7 +130,11 @@ "name": "future-navbar", "type": "registry:component", "devDependencies": [], - "dependencies": ["lucide-react", "class-variance-authority"], + "dependencies": [ + "lucide-react", + "class-variance-authority", + "@left4code/svg-renderer" + ], "registryDependencies": [], "files": [ { @@ -470,7 +474,6 @@ } ] }, - { "name": "playing-card", @@ -1020,4 +1023,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/src/cli/bin/index.js b/src/cli/bin/index.js index 56fc274..e93a7ac 100755 --- a/src/cli/bin/index.js +++ b/src/cli/bin/index.js @@ -135,8 +135,13 @@ try { process.exit(1); } + const hasSrc = fs.existsSync(path.join(process.cwd(), "src")); + const baseLibDir = hasSrc + ? path.join(process.cwd(), "src", "lib") + : path.join(process.cwd(), "lib"); + const cnContent = { - ts: `import { ClassValue, clsx } from "clsx"; + ts: `import { type ClassValue, clsx } from "clsx"; import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { @@ -150,16 +155,22 @@ try { }`, }; - const utilsPath = path.join(process.cwd(), "lib"); const cnPath = path.join( - utilsPath, + baseLibDir, `utils.${language === "js" ? "js" : "ts"}`, ); + let utilsCreated = false; + // Create utils file if it doesn't exist if (!fs.existsSync(cnPath)) { - await fs.promises.mkdir(utilsPath, { recursive: true }); + await fs.promises.mkdir(baseLibDir, { recursive: true }); await fs.promises.writeFile(cnPath, cnContent[language], "utf8"); - console.log(colors.green(`🛠️ Created lib/utils${language}`)); + console.log( + colors.green( + `🛠️ Created ${hasSrc ? "src/lib" : "lib"}/utils.${language}`, + ), + ); + utilsCreated = true; } for (const file of match.files) { @@ -171,19 +182,28 @@ try { if (match?.dependencies?.length) { const pm = detectPackageManager(); const s2 = spinner(); - s2.start( - `📦 Installing dependencies with ${pm}: ${match.dependencies.join(", ")}`, - ); - const cmd = ["add", ...match.dependencies]; - const fallback = ["install", ...match.dependencies]; + const deps = [...(match.dependencies || [])]; + if (utilsCreated) { + deps.push("clsx", "tailwind-merge"); + } - try { - await execa(pm, pm === "npm" ? fallback : cmd, { stdio: "inherit" }); - s2.stop(colors.green("✅ Dependencies installed.")); - } catch (err) { - s2.stop(colors.red("❌ Failed to install dependencies.")); - console.error(err); + if (deps.length > 0) { + const uniqueDeps = [...new Set(deps)]; + s2.start( + `📦 Installing dependencies with ${pm}: ${uniqueDeps.join(", ")}`, + ); + + const cmd = ["add", ...uniqueDeps]; + const fallback = ["install", ...uniqueDeps]; + + try { + await execa(pm, pm === "npm" ? fallback : cmd, { stdio: "inherit" }); + s2.stop(colors.green("✅ Dependencies installed.")); + } catch (err) { + s2.stop(colors.red("❌ Failed to install dependencies.")); + console.error(err); + } } } diff --git a/src/cli/package-lock.json b/src/cli/package-lock.json index 59df6d6..19976bc 100644 --- a/src/cli/package-lock.json +++ b/src/cli/package-lock.json @@ -1,12 +1,12 @@ { "name": "nurui", - "version": "1.0.10", + "version": "1.0.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nurui", - "version": "1.0.10", + "version": "1.0.11", "license": "MIT", "dependencies": { "@clack/prompts": "^0.11.0", diff --git a/src/cli/package.json b/src/cli/package.json index ae6c2dd..43af5e4 100644 --- a/src/cli/package.json +++ b/src/cli/package.json @@ -1,6 +1,6 @@ { "name": "nurui", - "version": "1.0.10", + "version": "1.0.11", "description": "Add beautiful components with one command", "bin": { "nurui": "./bin/index.js" diff --git a/src/components/nurui/creative-pricing.tsx b/src/components/nurui/creative-pricing.tsx index 3f0d203..e8af618 100644 --- a/src/components/nurui/creative-pricing.tsx +++ b/src/components/nurui/creative-pricing.tsx @@ -25,17 +25,17 @@ function CreativePricing({ }) { return (
-
-
+
+
{tag}
-

+

{title} -
+
-
+
⭐️

@@ -156,7 +156,7 @@ function CreativePricing({
))}
-
+
✏️