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 theweb
application@repo/utils
: a typescript library shared by theweb
application andui
package@repo/eslint-config
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)@repo/typescript-config
:tsconfig.json
s used throughout the monorepo@repo/tailwind-config
: unified configs oftailwind.config.ts
andpostcss.config.js
Attention: In the project I've used:
config-typescript
as directory name for@repo/typescript-config
packageconfig-eslint
as directory name for@repo/eslint-config
packageconfig-tailwind
as directory name for@repo/tailwind-config
package
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.yaml
andpnpm-workspace.yaml
from 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 i
to install your dependencies and it's done!