A Turborepo starter template with Next.js, Nextra, and a shared pre-configured shadcn/ui package, powered by Bun and Biome 🚀
Note
This repo uses bun
as the package manager. 📦
Clone the repository:
git clone https://github.com/gmickel/turborepo-shadcn-nextjs.git
Install dependencies:
cd turborepo-shadcn-nextjs
bun install
Use the pre-made script:
bun ui:add:component <component-name>
This works just like the add command in the
shadcn/ui
CLI. 🎨
This Turborepo includes the following:
@repo/docs
: a placeholder documentation site powered by Nextra 3 alpha 📚@repo/web
: the main Next.js web application 🌐@repo/ui
: core React components and design system shared by bothweb
anddocs
applications (🚀 powered by shadcn/ui)@repo/utils
: shared React utilities 🛠️@repo/tsconfig
: sharedtsconfig.json
s used throughout the monorepo 🛡️
Each package and app is 100% TypeScript. 💪
This Turborepo has some additional tools already set up for you:
- TypeScript for static type checking ✅
- Biome for code linting, formatting, and fixing 🌿
- Changesets for managing versioning, changelogs, and publishing 📝
bun build
- Build all apps and packagesbun dev
- Develop all apps and packagesbun dev:ui
- Develop all apps and packages and display the output in Turbo's new experimental UIbun lint
- Lint and format all packagesbun lint:fix
- Lint, format, and fix all packagesbun changeset
- Generate a changeset 🚧 - WIPbun clean
- Clean up allnode_modules
anddist
folders (runs each package's clean script)bun ui:add:component
- Add a shadcn/ui component to the@repo/ui
package
Turborepo offers a simple command to add new apps or packages to the monorepo. To add a new app, run the following command:
bun turbo gen workspace [--name <app-name>]
You will be prompted to choose the name and workspace type (app or package) to use.
You can copy an existing app or package with:
bun turbo gen workspace [--name <app-name>] --copy
You will be prompted to choose the name and workspace type (app or package) of the new app and which app or package to copy.
Note
Remember to run bun install
after copying an app.
🚧 WIP
For more information, refer to the official Changesets documentation.
Learn more about Turborepo:
Learn more about Next.js:
Learn more about Nextra:
Learn more about shadcn/ui:
Learn more about Bun:
Learn more about Biome:
Learn more about Changesets: