๐ŸŽจ Front-End

[Shadcn UI] ์„ค์น˜ ์˜ค๋ฅ˜: bunx --bun shadcn@latest init

์˜ฌใ„น1๋ธŒ 2025. 2. 1. 01:36
๋ฐ˜์‘ํ˜•


# ์—…๋ฐ์ดํŠธ (25.03.04 ๊ธฐ์ค€)

  • Tailwindcss 4.0์€ React 19 ๊ธฐ์ค€์œผ๋กœ ์ œ๊ณต๋จ: ํ•ด๋‹น ํ™˜๊ฒฝ์„ ๋งž์ถ˜ ๋‹ค์Œ npx shadcn@canary init ํ†ตํ•ด ์ดˆ๊ธฐํ™” ๊ฐ€๋Šฅ (๊ด€๋ จ ๋งํฌ: https://github.com/shadcn-ui/ui/issues/6585)
  • ๋งŒ์•ฝ React 18์„ ๊ธฐ์ค€์œผ๋กœ ์ง„ํ–‰์ด ํ•„์š”ํ•  ๊ฒฝ์šฐ์—๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ migration ์ ˆ์ฐจ (#์ง„ํ–‰ ๋ฐฉ๋ฒ•) ๋ฅผ ๊ฑฐ์น˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

# ํ™˜๊ฒฝ

  • React + Bun + Vite + TypeScript

# ํ˜„์ƒ: Shadcn UI Installation ์ค‘ bunx --bun shadcn@latest init ์‹คํ–‰ ์‹œ ์˜ค๋ฅ˜ ๋ฐœ์ƒ (tailwind.config.js ํŒŒ์ผ์ด ์žˆ์—ˆ์Œ)

PS C:\olive\app> bunx --bun shadcn@latest init
โœ” Preflight checks.
โ ‹ Verifying framework.
No Tailwind CSS configuration found at C:\olive\app
It is likely you do not have Tailwind CSS installed or have an invalid configuration.
Install Tailwind CSS then try again.
Visit https://tailwindcss.com/docs/guides/vite to get started.

 

# ์›์ธ

  • Shadcn UI ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋ฌธ์„œ ์ž‘์„ฑ ์‹œ Tailwindcss ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๊ฐ€ ์„ธํŒ…๋˜์—ˆ๋˜ ์ตœ์‹  ๋ฒ„์ „์€ 3.x ๊ธฐ์ค€ (tailwindcss@latest = 3.x)
  • ์ตœ๊ทผ Tailwindcss ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์˜ ๋ฒ„์ „์ด 3.x -> 4.0์œผ๋กœ ์—…๊ทธ๋ ˆ์ด๋“œ ๋˜๋ฉด์„œ ๋ฒ„์ „ ๊ฐ„ ์ถฉ๋Œ ๋ฐœ์ƒ
  • ๋”ฐ๋ผ์„œ ํ˜„์žฌ Shadcn UI ๊ณต์‹ ํ™ˆํŽ˜์ด์ง€์—์„œ ์ œ๊ณตํ•˜๋Š” Installation๋Œ€๋กœ ์ง„ํ–‰ํ•˜๋ฉด ์•ˆ ๋จ. ์•„๋ž˜ ๋‚ด์šฉ ๊ทธ๋Œ€๋กœ ์ง„ํ–‰ํ•˜์„ธ์š”.

# ์ง„ํ–‰ ๋ฐฉ๋ฒ•

  • TailWindCSS v3 ๋ฒ„์ „์œผ๋กœ ์„ค์น˜: bun add -D tailwindcss@3.4.0 postcss autoprefixer
bun add v1.2.0 (b0c5a765)

installed tailwindcss@3.4.0 with binaries:
 - tailwind
 - tailwindcss
installed postcss@8.5.1
installed autoprefixer@10.4.20 with binaries:
 - autoprefixer

39 packages installed [3.65s]
  • TailWindCSS v3 ๋ฒ„์ „์œผ๋กœ ์ดˆ๊ธฐํ™”: bunx --bun tailwindcss init -p
Created Tailwind CSS config file: tailwind.config.js
Created PostCSS config file: postcss.config.js
  • Shadcn UI ์ดˆ๊ธฐํ™”: bunx --bun shadcn@latest init
โœ” Preflight checks.
โœ” Verifying framework. Found Vite.
โœ” Validating Tailwind CSS.
โœ” Validating import alias.
√ Which style would you like to use? » New York
√ Which color would you like to use as the base color? » Zinc
√ Would you like to use CSS variables for theming? ... no / yes
โœ” Writing components.json.
โœ” Checking registry.
โœ” Updating tailwind.config.js
โœ” Updating src\index.css
โœ” Installing dependencies.
  - src\lib\utils.ts

Success! Project initialization completed.
You may now add components.
  • Shadcn UI Components ์ „์ฒด ์ถ”๊ฐ€: bunx --bun shadcn@latest add --all
โœ” Checking registry.
โœ” Updating tailwind.config.js
โœ” Updating src\index.css
โœ” Installing dependencies.
  - src\components\ui\accordion.tsx
  - src\components\ui\alert-dialog.tsx
  - src\components\ui\aspect-ratio.tsx
  - src\components\ui\avatar.tsx
  - src\components\ui\badge.tsx
  - src\components\ui\breadcrumb.tsx
  - src\components\ui\calendar.tsx
  - src\components\ui\card.tsx
  - src\components\ui\carousel.tsx
  - src\components\ui\chart.tsx
  - src\components\ui\checkbox.tsx
  - src\components\ui\collapsible.tsx
  - src\components\ui\command.tsx
  - src\components\ui\dialog.tsx
  - src\components\ui\context-menu.tsx
  - src\components\ui\drawer.tsx
  - src\components\ui\dropdown-menu.tsx
  - src\components\ui\form.tsx
  - src\components\ui\hover-card.tsx
  - src\components\ui\input-otp.tsx
  - src\components\ui\menubar.tsx
  - src\components\ui\navigation-menu.tsx
  - src\components\ui\pagination.tsx
  - src\components\ui\popover.tsx
  - src\components\ui\progress.tsx
  - src\components\ui\radio-group.tsx
  - src\components\ui\resizable.tsx
  - src\components\ui\scroll-area.tsx
  - src\components\ui\select.tsx
  - src\components\ui\slider.tsx
  - src\components\ui\sonner.tsx
  - src\components\ui\switch.tsx
  - src\components\ui\table.tsx
  - src\components\ui\toast.tsx
  - src\hooks\use-toast.ts
  - src\components\ui\toaster.tsx
  - src\components\ui\toggle.tsx
  - src\components\ui\toggle-group.tsx
  - src\components\ui\alert.tsx
  - src\components\ui\button.tsx
  - src\components\ui\label.tsx
  - src\components\ui\input.tsx
  - src\components\ui\separator.tsx
  - src\components\ui\sheet.tsx
  - src\components\ui\sidebar.tsx
  - src\components\ui\tooltip.tsx
  - src\hooks\use-mobile.tsx
  - src\components\ui\skeleton.tsx
  - src\components\ui\tabs.tsx
  - src\components\ui\textarea.tsx
  • TailWindCSS 4.0 Migration:  npx @tailwindcss/upgrade@next
    • ์ฃผ์˜: bunx --bun @tailwindcss/upgrade@next ์‹คํ–‰ํ•  ๊ฒฝ์šฐ, ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒ๋œ๋‹ค -> ์œ„ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•ด์ฃผ๋ฉด ์˜ค๋ฅ˜๊ฐ€ ๋”๋Š” ๋ฐœ์ƒํ•˜์ง€ ์•Š๋Š”๋‹ค.
      •   โš™๏ธ  tree-sitter [1/2] error: could not determine executable to run for package exec
      • error: install script from "tree-sitter-typescript" exited with 1

# ์ฐธ๊ณ  (deprecated)

  • ์ด์Šˆ : https://github.com/shadcn-ui/ui/issues/6446 ํ˜„์žฌ ์ง„ํ–‰ ์ค‘์ธ ์‚ฌํ•ญ์ด๋ฉฐ (4์ผ ์ „ ์—…๋ฐ์ดํŠธ), ์œ„ ๋‚ด์šฉ์€ ์–ธ์ œ๋“ ์ง€ ๋ณ€๊ฒฝ๋  ์ˆ˜ ์žˆ์Œ
  • React 18 + Tailwind v3, React 19 + Tailwind v4 ๋“ฑ ๋ฒ„์ „๋ณ„ ํ˜ธํ™˜์— ๋ฌธ์ œ๊ฐ€ ์žˆ์–ด ์ž‘์—… ์ง„ํ–‰์ค‘์ด๋ผ๋Š” ๋‚ด์šฉ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์—ˆ์Œ(์ˆ˜์ •ํ•  ๋‚ด์šฉ์ด ๋งŽ๋‹ค๊ณ ๋„..) ๋‹น์žฅ ์ดˆ๊ธฐ ์„ธํŒ…์„ ์ง„ํ–‰ํ•˜์‹œ๋Š” ๊ฒฝ์šฐ ์ฐธ๊ณ ํ•˜์‹œ๊ธธ ๋ฐ”๋žŒ

 

๋ฐ˜์‘ํ˜•