Please feel free to suggest for updates!
-
Create a new mono repo project
npx create-turbo@latest
-
Update
typescript-config/nextjs.json
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Next.js",
"extends": "./base.json",
"compilerOptions": {
"plugins": [{ "name": "next" }],
"module": "ESNext",
"moduleResolution": "Bundler",
"allowJs": true,
"jsx": "preserve",
"noEmit": true,
"paths": {
"@ui/*": ["../../packages/ui/src/*"] <--add this line
}
}
}
- under
packages/ui
update package.json
scripts
"scripts": {
"lint": "eslint . --max-warnings 0",
"generate:component": "turbo gen react-component",
"ui:add": "pnpm dlx shadcn-ui@latest add" <-- add this
},
add components.json
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "./tailwind.config.ts",
"css": "./src/global.css",
"baseColor": "slate",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@ui/components",
"utils": "@ui/lib/utils"
}
}
tsconfig.json
{
"extends": "@repo/typescript-config/react-library.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist",
"paths": {
"@ui/*": ["./src/*"]
}
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
- Root
package.json
{
"name": "shopday-webs",
"private": true,
"scripts": {
"build": "turbo build",
"dev": "turbo dev",
"lint": "turbo lint",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"ui:add": "pnpm --filter @repo/ui ui:add"
},
"devDependencies": {
"@repo/eslint-config": "*",
"@repo/typescript-config": "*",
"prettier": "^3.2.5",
"turbo": "latest"
},
"engines": {
"node": ">=18"
},
"packageManager": "[email protected]",
"workspaces": ["apps/*", "packages/*"]
}