diff --git a/apps/v4/app/(create)/components/project-form.tsx b/apps/v4/app/(create)/components/project-form.tsx index 2e197f357..f9da815fc 100644 --- a/apps/v4/app/(create)/components/project-form.tsx +++ b/apps/v4/app/(create)/components/project-form.tsx @@ -51,6 +51,7 @@ const TURBOREPO_LOGO = 'Turborepo' const ORIGIN = process.env.NEXT_PUBLIC_APP_URL || "http://localhost:4000" const IS_LOCAL_DEV = ORIGIN.includes("localhost") +const SHADCN_VERSION = process.env.NEXT_PUBLIC_RC ? "@rc" : "@latest" const PACKAGE_MANAGERS = ["pnpm", "npm", "yarn", "bun"] as const type PackageManager = (typeof PACKAGE_MANAGERS)[number] @@ -84,7 +85,7 @@ export function ProjectForm({ const rtlFlag = params.rtl ? " --rtl" : "" const flags = `${presetFlag}${templateFlag}${monorepoFlag}${rtlFlag}` - return IS_LOCAL_DEV + return IS_LOCAL_DEV && !process.env.NEXT_PUBLIC_RC ? { pnpm: `shadcn init${flags}`, npm: `shadcn init${flags}`, @@ -92,10 +93,10 @@ export function ProjectForm({ bun: `shadcn init${flags}`, } : { - pnpm: `pnpm dlx shadcn@latest init${flags}`, - npm: `npx shadcn@latest init${flags}`, - yarn: `yarn dlx shadcn@latest init${flags}`, - bun: `bunx --bun shadcn@latest init${flags}`, + pnpm: `pnpm dlx shadcn${SHADCN_VERSION} init${flags}`, + npm: `npx shadcn${SHADCN_VERSION} init${flags}`, + yarn: `yarn dlx shadcn${SHADCN_VERSION} init${flags}`, + bun: `bunx --bun shadcn${SHADCN_VERSION} init${flags}`, } }, [framework, isMonorepo, params.rtl, presetCode]) diff --git a/packages/shadcn/src/commands/build.ts b/packages/shadcn/src/commands/build.ts index 2403ea966..6116d9242 100644 --- a/packages/shadcn/src/commands/build.ts +++ b/packages/shadcn/src/commands/build.ts @@ -57,8 +57,7 @@ export const build = new Command() buildSpinner.start(`Building ${registryItem.name}...`) // Add the schema to the registry item. - registryItem["$schema"] = - `${SHADCN_URL}/schema/registry-item.json` + registryItem["$schema"] = `${SHADCN_URL}/schema/registry-item.json` // Loop through each file in the files array. for (const file of registryItem.files ?? []) { diff --git a/packages/shadcn/src/commands/registry/build.ts b/packages/shadcn/src/commands/registry/build.ts index 94754dc62..c3ab9d0eb 100644 --- a/packages/shadcn/src/commands/registry/build.ts +++ b/packages/shadcn/src/commands/registry/build.ts @@ -121,8 +121,7 @@ async function buildRegistry(opts: z.infer) { buildSpinner.start(`Building ${registryItem.name}...`) // Add the schema to the registry item. - registryItem["$schema"] = - `${SHADCN_URL}/schema/registry-item.json` + registryItem["$schema"] = `${SHADCN_URL}/schema/registry-item.json` for (const file of registryItem.files) { const absPath = path.resolve(resolvePaths.cwd, file.path) diff --git a/packages/shadcn/src/preflights/preflight-add.ts b/packages/shadcn/src/preflights/preflight-add.ts index 450d1892b..d9bdb628e 100644 --- a/packages/shadcn/src/preflights/preflight-add.ts +++ b/packages/shadcn/src/preflights/preflight-add.ts @@ -66,9 +66,7 @@ export async function preFlightAdd(options: z.infer) { )} file by running the ${highlighter.info("init")} command.` ) logger.error( - `Learn more at ${highlighter.info( - `${SHADCN_URL}/docs/components-json` - )}.` + `Learn more at ${highlighter.info(`${SHADCN_URL}/docs/components-json`)}.` ) logger.break() process.exit(1) diff --git a/packages/shadcn/src/preflights/preflight-migrate.ts b/packages/shadcn/src/preflights/preflight-migrate.ts index ed9d9a343..f63cf10f4 100644 --- a/packages/shadcn/src/preflights/preflight-migrate.ts +++ b/packages/shadcn/src/preflights/preflight-migrate.ts @@ -55,9 +55,7 @@ export async function preFlightMigrate( )} file by running the ${highlighter.info("init")} command.` ) logger.error( - `Learn more at ${highlighter.info( - `${SHADCN_URL}/docs/components-json` - )}.` + `Learn more at ${highlighter.info(`${SHADCN_URL}/docs/components-json`)}.` ) logger.break() process.exit(1) diff --git a/packages/shadcn/src/registry/errors.ts b/packages/shadcn/src/registry/errors.ts index d866dfa29..18f7a7e1f 100644 --- a/packages/shadcn/src/registry/errors.ts +++ b/packages/shadcn/src/registry/errors.ts @@ -245,8 +245,7 @@ export class RegistryParseError extends RegistryError { code: RegistryErrorCode.PARSE_ERROR, cause: parseError, context: { item }, - suggestion: - `The registry item may be corrupted or have an invalid format. Please make sure it returns a valid JSON object. See ${SHADCN_URL}/schema/registry-item.json.`, + suggestion: `The registry item may be corrupted or have an invalid format. Please make sure it returns a valid JSON object. See ${SHADCN_URL}/schema/registry-item.json.`, }) this.parseError = parseError