This is my Turborepo starter.
This Turborepo includes the following packages/apps:
web: a Next.js app@repo/ui: a stub React component library shared by thewebapplication@repo/utils: a typescript library shared by thewebapplication anduipackage@repo/eslint-config:eslintconfigurations (includeseslint-config-nextandeslint-config-prettier)@repo/typescript-config:tsconfig.jsons used throughout the monorepo@repo/tailwind-config: unified configs oftailwind.config.tsandpostcss.config.js
Attention: In the project I've used:
config-typescriptas directory name for@repo/typescript-configpackageconfig-eslintas directory name for@repo/eslint-configpackageconfig-tailwindas directory name for@repo/tailwind-configpackage
The naming of directories are done this way to start with config- so that editors put them next to each other and having a better developer experience while looking for config packages and no other reasons!
This Turborepo has some additional tools already setup for you:
- TypeScript for static type checking
- Tailwindcss for styling
- ESLint for code linting
- Prettier for code formatting
To build all apps and packages, run the following command:
(If it's for the first time don't forget to run pnpm i)
cd turborepo-starter-with-tailwind
pnpm build
To develop all apps and packages, run the following command:
(If it's for the first time don't forget to run pnpm i)
cd turborepo-starter-with-tailwind
pnpm dev
Follow these steps:
- remove
pnpm-lock.yamlandpnpm-workspace.yamlfrom root. - add this to the root package.json :
"workspaces": [
"apps/*",
"packages/*"
]
- while you're in the root package.json, change
packageManager's value tonpm@your_npm_version. You can get your npm version by runningnpm -v. - replace every
workspace:*in each package.json with*. - now run
npm ito install your dependencies and it's done!