feat: add @mapcn registry alias so install works with add @mapcn

This commit is contained in:
Anmoldeep Singh
2026-02-10 13:06:47 +05:30
parent 52bdd03e29
commit 46c4cf1a48
2 changed files with 4 additions and 7 deletions

View File

@@ -5,8 +5,7 @@ import { Copy, Check, ArrowRight } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "site-url-here";
const installCommand = `npx shadcn@latest add ${siteUrl}/r/map.json`;
const installCommand = "npx shadcn@latest add @mapcn/map";
function CopyButton({ text }: { text: string }) {
const [copied, setCopied] = useState(false);
@@ -58,7 +57,7 @@ export function Hero() {
Built on MapLibre. Styled with Tailwind.
</p>
<div className="mt-8 animate-fade-up delay-300 w-full max-w-xl">
<div className="mt-8 animate-fade-up delay-300 w-full max-w-lg">
<div className="bg-card border border-border rounded-lg shadow-xs overflow-hidden">
<div className="flex items-center gap-1.5 px-3 py-2 border-b border-border/50">
<span className="size-2 rounded-full bg-foreground/20" />

View File

@@ -10,9 +10,7 @@ import { Metadata } from "next";
import { Card } from "@/components/ui/card";
import { Map, MapControls } from "@/registry/map";
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL ?? "site-url-here";
const installCode = `npx shadcn@latest add ${siteUrl}/r/map.json`;
const installCommand = "npx shadcn@latest add @mapcn/map";
const usageCode = `import { Map, MapControls } from "@/components/ui/map";
import { Card } from "@/components/ui/card";
@@ -60,7 +58,7 @@ export default function InstallationPage() {
<DocsSection title="Installation">
<p>Run the following command to add the map component:</p>
<CodeBlock code={installCode} language="bash" />
<CodeBlock code={installCommand} language="bash" />
<p>
This will install <DocsCode>maplibre-gl</DocsCode> and add the map
component to your project.