Turborepo & Next.js Starter
Type: Code
Framework: Next.js
CSS: Vanilla CSS
- Starter Overview: An official Turborepo starter for setting up a monorepo project structure.
- Getting Started:
- Initialize a new Turborepo project by running
npx create-turbo@latest.
- Initialize a new Turborepo project by running
Included Packages/Apps:
- Apps:
docs: A Next.js application for documentation.web: Another Next.js application for the main website.
- Packages:
@repo/ui: A React component library shared by both thewebanddocsapplications.@repo/eslint-config: Contains ESLint configurations, including presets for Next.js and Prettier.@repo/typescript-config: Sharedtsconfig.jsonsettings for TypeScript across the monorepo.
Utilities Setup:
- TypeScript for static type checking.
- ESLint for code linting.
- Prettier for code formatting.
Development Commands:
- Build: Compile all apps and packages with
pnpm buildfrom the root directory. - Develop: Start a development environment for all apps and packages with
pnpm dev.
Remote Caching with Turborepo:
- Turborepo supports Remote Caching to share cache artifacts across different machines, beneficial for teams and CI/CD pipelines.
- Enable Remote Caching by linking your Turborepo to a Vercel account using
npx turbo loginandnpx turbo link.
Useful Resources:
- Explore various Turborepo capabilities such as tasks, caching (both local and remote), filtering, configuration options, and CLI usage through the official Turborepo documentation.