This is a starter Turborepo with Next.js and shadcn/ui pre-configured.
Install dependencies:
cd monorepo
npm installTo build all apps and packages, run the following command:
npm run buildTo develop all apps and packages, run the following command:
npm run devTo develop a specific app, run the following command:
npm run dev <app-name>The available apps are shop and web.
Use the pre-made script:
npm run ui:add <component-name>This works just like the add command in the
shadcn/uiCLI.
Turborepo offer a simple command to add a new app:
npx turbo gen workspace --name <app-name>This will create a new empty app in the apps directory.
If you want, you can copy an existing app with:
npx turbo gen workspace --name <app-name> --copyNote
Remember to run npm install after copying an app.
This monorepo includes the following packages/apps:
shop: a Next.js app with Tailwind CSSweb: another Next.js app with Tailwind CSS@monorepo/ui: a stub React component library shared by bothwebandshopapplications (🚀 powered by shadcn/ui)@monorepo/eslint-config:eslintconfigurations (includesprettierconfiguration as well)
This monorepo has some additional tools already setup for you:
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd monorepo
npx turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
npx turbo linkLearn more about the power of Turborepo:
Learn more about shadcn/ui: