From 76ba624dce0d8d519e8afeb0e88a389769d7031d Mon Sep 17 00:00:00 2001 From: shadcn Date: Fri, 20 Feb 2026 16:40:41 +0400 Subject: [PATCH] fix --- apps/v4/app/(create)/create/v0/route.ts | 12 +- apps/v4/content/docs/installation/manual.mdx | 9 +- packages/shadcn/src/commands/create.ts | 1 + packages/shadcn/src/commands/init.ts | 167 +++- .../shadcn/src/preflights/preflight-init.ts | 8 +- packages/shadcn/src/utils/add-components.ts | 129 +-- packages/shadcn/src/utils/get-project-info.ts | 20 +- packages/shadcn/src/utils/preset.test.ts | 23 +- packages/shadcn/src/utils/preset.ts | 6 +- .../src/utils/updaters/update-css-vars.ts | 15 +- .../shadcn/src/utils/updaters/update-css.ts | 41 +- .../shadcn/src/utils/updaters/update-files.ts | 9 - .../src/utils/updaters/update-fonts.test.ts | 118 +++ .../shadcn/src/utils/updaters/update-fonts.ts | 24 +- .../frameworks/next-monorepo/app/page.tsx | 3 + .../frameworks/next-monorepo/package.json | 6 + .../next-monorepo/packages/ui/src/globals.css | 1 + .../shadcn/test/utils/add-components.test.ts | 780 ++++++++++++++++++ .../test/utils/get-tailwind-css-file.test.ts | 29 + templates/next-app/.prettierignore | 7 + templates/next-monorepo/.eslintrc.js | 17 +- templates/next-monorepo/.prettierignore | 7 + .../packages/eslint-config/base.js | 2 +- templates/react-router-app/.prettierignore | 7 + templates/vite-app/.prettierignore | 7 + 25 files changed, 1267 insertions(+), 181 deletions(-) create mode 100644 packages/shadcn/test/fixtures/frameworks/next-monorepo/app/page.tsx create mode 100644 packages/shadcn/test/fixtures/frameworks/next-monorepo/package.json create mode 100644 packages/shadcn/test/fixtures/frameworks/next-monorepo/packages/ui/src/globals.css create mode 100644 packages/shadcn/test/utils/add-components.test.ts create mode 100644 templates/next-app/.prettierignore create mode 100644 templates/next-monorepo/.prettierignore create mode 100644 templates/react-router-app/.prettierignore create mode 100644 templates/vite-app/.prettierignore diff --git a/apps/v4/app/(create)/create/v0/route.ts b/apps/v4/app/(create)/create/v0/route.ts index 3c727b997c..fff93a3f54 100644 --- a/apps/v4/app/(create)/create/v0/route.ts +++ b/apps/v4/app/(create)/create/v0/route.ts @@ -129,13 +129,13 @@ function buildGlobalsCss(registryBase: RegistryItem) { --color-sidebar-accent-foreground: var(--sidebar-accent-foreground); --color-sidebar-border: var(--sidebar-border); --color-sidebar-ring: var(--sidebar-ring); - --radius-sm: calc(var(--radius) - 4px); - --radius-md: calc(var(--radius) - 2px); + --radius-sm: calc(var(--radius) * 0.6); + --radius-md: calc(var(--radius) * 0.8); --radius-lg: var(--radius); - --radius-xl: calc(var(--radius) + 4px); - --radius-2xl: calc(var(--radius) + 8px); - --radius-3xl: calc(var(--radius) + 12px); - --radius-4xl: calc(var(--radius) + 16px); + --radius-xl: calc(var(--radius) * 1.4); + --radius-2xl: calc(var(--radius) * 1.8); + --radius-3xl: calc(var(--radius) * 2.2); + --radius-4xl: calc(var(--radius) * 2.6); } :root { diff --git a/apps/v4/content/docs/installation/manual.mdx b/apps/v4/content/docs/installation/manual.mdx index f6b5451357..3d338fe1c8 100644 --- a/apps/v4/content/docs/installation/manual.mdx +++ b/apps/v4/content/docs/installation/manual.mdx @@ -74,10 +74,13 @@ Add the following to your styles/globals.css file. You can learn more about usin --color-chart-3: var(--chart-3); --color-chart-4: var(--chart-4); --color-chart-5: var(--chart-5); - --radius-sm: calc(var(--radius) - 4px); - --radius-md: calc(var(--radius) - 2px); + --radius-sm: calc(var(--radius) * 0.6); + --radius-md: calc(var(--radius) * 0.8); --radius-lg: var(--radius); - --radius-xl: calc(var(--radius) + 4px); + --radius-xl: calc(var(--radius) * 1.4); + --radius-2xl: calc(var(--radius) * 1.8); + --radius-3xl: calc(var(--radius) * 2.2); + --radius-4xl: calc(var(--radius) * 2.6); --color-sidebar: var(--sidebar); --color-sidebar-foreground: var(--sidebar-foreground); --color-sidebar-primary: var(--sidebar-primary); diff --git a/packages/shadcn/src/commands/create.ts b/packages/shadcn/src/commands/create.ts index c2e359f077..e8134fa2e9 100644 --- a/packages/shadcn/src/commands/create.ts +++ b/packages/shadcn/src/commands/create.ts @@ -199,6 +199,7 @@ export const create = new Command() initUrl = resolveInitUrl( { ...decoded, + base: "radix", rtl: opts.rtl ?? false, }, { template } diff --git a/packages/shadcn/src/commands/init.ts b/packages/shadcn/src/commands/init.ts index 21c0f095f0..59853dbb72 100644 --- a/packages/shadcn/src/commands/init.ts +++ b/packages/shadcn/src/commands/init.ts @@ -58,12 +58,14 @@ export const initOptionsSchema = z.object({ yes: z.boolean(), defaults: z.boolean(), force: z.boolean(), - reinstall: z.boolean(), + reinstall: z.boolean().optional(), silent: z.boolean(), isNewProject: z.boolean().default(false), cssVariables: z.boolean().default(true), rtl: z.boolean().optional(), + base: z.enum(["radix", "base"]).optional(), template: z.string().optional(), + existingConfig: z.record(z.unknown()).optional(), installStyleIndex: z.boolean().default(true), registryBaseConfig: rawConfigSchema.deepPartial().optional(), }) @@ -77,6 +79,7 @@ export const init = new Command() "-t, --template