diff --git a/apps/v4/app/(create)/components/template-picker.tsx b/apps/v4/app/(create)/components/template-picker.tsx index ebfe977d43..da0071dd3e 100644 --- a/apps/v4/app/(create)/components/template-picker.tsx +++ b/apps/v4/app/(create)/components/template-picker.tsx @@ -68,7 +68,7 @@ export function TemplatePicker({ value={params.template} onValueChange={(value) => { setParams({ - template: value as "next" | "start" | "vite", + template: value as "next" | "next-monorepo" | "start" | "vite", }) }} > diff --git a/apps/v4/app/(create)/components/toolbar-controls.tsx b/apps/v4/app/(create)/components/toolbar-controls.tsx index 4b22edbeee..685910e703 100644 --- a/apps/v4/app/(create)/components/toolbar-controls.tsx +++ b/apps/v4/app/(create)/components/toolbar-controls.tsx @@ -1,17 +1,17 @@ "use client" -import * as React from "react" -import Link from "next/link" import { ComputerTerminal01Icon, Copy01Icon, Tick02Icon, } from "@hugeicons/core-free-icons" import { HugeiconsIcon } from "@hugeicons/react" +import * as React from "react" import { toast } from "sonner" -import { useConfig } from "@/hooks/use-config" +import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params" import { copyToClipboardWithMeta } from "@/components/copy-button" +import { useConfig } from "@/hooks/use-config" import { Button } from "@/registry/new-york-v4/ui/button" import { Dialog, @@ -41,12 +41,6 @@ import { TabsList, TabsTrigger, } from "@/registry/new-york-v4/ui/tabs" -import { - Tooltip, - TooltipContent, - TooltipTrigger, -} from "@/registry/new-york-v4/ui/tooltip" -import { useDesignSystemSearchParams } from "@/app/(create)/lib/search-params" const TEMPLATES = [ { @@ -54,6 +48,11 @@ const TEMPLATES = [ title: "Next.js", logo: 'Next.js', }, + { + value: "next-monorepo", + title: "Next.js (Monorepo)", + logo: 'Next.js', + }, { value: "start", title: "TanStack Start", @@ -180,10 +179,10 @@ export function ToolbarControls() { value={params.template} onValueChange={(value) => { setParams({ - template: value as "next" | "start" | "vite", + template: value as "next" | "next-monorepo" | "start" | "vite", }) }} - className="grid grid-cols-3 gap-2" + className="grid grid-cols-2 gap-2" > {TEMPLATES.map((template) => ( Enable RTL -
+
pnpm npm yarn bun - - - - - - {hasCopied ? "Copied!" : "Copy command"} - - +
{Object.entries(commands).map(([key, cmd]) => { return ( diff --git a/apps/v4/app/(create)/init/route.ts b/apps/v4/app/(create)/init/route.ts index 3f590b8e56..606edba2a7 100644 --- a/apps/v4/app/(create)/init/route.ts +++ b/apps/v4/app/(create)/init/route.ts @@ -18,7 +18,7 @@ export async function GET(request: NextRequest) { menuAccent: searchParams.get("menuAccent"), menuColor: searchParams.get("menuColor"), radius: searchParams.get("radius"), - template: searchParams.get("template"), + template: searchParams.get("template") ?? undefined, rtl: searchParams.get("rtl") === "true", }) diff --git a/apps/v4/app/(create)/lib/search-params.ts b/apps/v4/app/(create)/lib/search-params.ts index 9d2733845b..ab00904568 100644 --- a/apps/v4/app/(create)/lib/search-params.ts +++ b/apps/v4/app/(create)/lib/search-params.ts @@ -63,6 +63,7 @@ const designSystemSearchParams = { ).withDefault("default"), template: parseAsStringLiteral([ "next", + "next-monorepo", "start", "vite", ] as const).withDefault("next"), diff --git a/apps/v4/registry/config.ts b/apps/v4/registry/config.ts index 0fce7ca99d..e5e62482c7 100644 --- a/apps/v4/registry/config.ts +++ b/apps/v4/registry/config.ts @@ -94,7 +94,7 @@ export const designSystemConfigSchema = z radius: z .enum(RADII.map((r) => r.name) as [RadiusValue, ...RadiusValue[]]) .default("default"), - template: z.enum(["next", "start", "vite"]).default("next").optional(), + template: z.enum(["next", "next-monorepo", "start", "vite"]).default("next").optional(), }) .refine( (data) => { @@ -433,7 +433,7 @@ export function buildRegistryBase(config: DesignSystemConfig) { }, }, ...(config.rtl && { - docs: `To learn how to set up the RTL provider and fonts for your app, see https://ui.shadcn.com/docs/rtl/${config.template ?? "next"}`, + docs: `To learn how to set up the RTL provider and fonts for your app, see https://ui.shadcn.com/docs/rtl/${config.template === "next-monorepo" ? "next" : (config.template ?? "next")}`, }), } } diff --git a/packages/shadcn/package.json b/packages/shadcn/package.json index affb0d7a50..25e348493c 100644 --- a/packages/shadcn/package.json +++ b/packages/shadcn/package.json @@ -61,7 +61,7 @@ "build": "tsup", "typecheck": "tsc --noEmit", "clean": "rimraf dist && rimraf components", - "start:dev": "cross-env REGISTRY_URL=http://localhost:4000/r node dist/index.js", + "start:dev": "cross-env REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates node dist/index.js", "start:prod": "cross-env REGISTRY_URL=https://ui.shadcn.com/r node dist/index.js", "start": "node dist/index.js", "format:write": "prettier --write \"**/*.{ts,tsx,mdx}\" --cache", @@ -71,7 +71,7 @@ "pub:next": "pnpm build && pnpm publish --no-git-checks --access public --tag next", "pub:release": "pnpm build && pnpm publish --access public", "test": "vitest run", - "test:dev": "REGISTRY_URL=http://localhost:4000/r vitest run", + "test:dev": "REGISTRY_URL=http://localhost:4000/r SHADCN_TEMPLATE_DIR=../../templates vitest run", "mcp:inspect": "pnpm dlx @modelcontextprotocol/inspector node dist/index.js mcp" }, "dependencies": { diff --git a/packages/shadcn/src/commands/create.ts b/packages/shadcn/src/commands/create.ts index 8247040f82..6316c9383f 100644 --- a/packages/shadcn/src/commands/create.ts +++ b/packages/shadcn/src/commands/create.ts @@ -23,6 +23,7 @@ import { initOptionsSchema, runInit } from "./init" const CREATE_TEMPLATES = { next: "Next.js", + "next-monorepo": "Next.js (Monorepo)", vite: "Vite", start: "TanStack Start", } as const @@ -35,7 +36,7 @@ export const create = new Command() .argument("[name]", "the name of your project") .option( "-t, --template