React + Turborepo
Monorepo: the app in apps/web, tasks cached by turbo. This page shows exactly what pickstack adds to a React project for Turborepo: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.
$ npm create pickstack@latest my-app -- --framework react --modules turborepo --yesCustomize in the configurator
Packages it adds
| Package | Version | Type |
|---|---|---|
turbo | ^2.11.13 | dev |
New files
node_modules dist .env .env.local .DS_Store
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>my-app</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
{
"name": "web",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc --noEmit && vite build",
"preview": "vite preview",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"react": "^19.3.1",
"react-dom": "^19.3.1"
},
"devDependencies": {
"@types/react": "^19.3.0",
"@types/react-dom": "^19.3.0",
"@vitejs/plugin-react": "^6.3.0",
"typescript": "~6.0.3",
"vite": "^8.3.8"
}
}
import Counter from "./components/Counter";
export default function App() {
return (
<main className="app">
<h1 className="title">my-app</h1>
<Counter />
</main>
);
}
import { useState } from "react";
export default function Counter() {
const [count, setCount] = useState(0);
return (
<div className="card">
<p className="count">{count}</p>
<div className="row">
<button
type="button"
className="btn"
onClick={() => setCount((n) => n - 1)}
>
-1
</button>
<button
type="button"
className="btn"
onClick={() => setCount((n) => n + 1)}
>
+1
</button>
</div>
</div>
);
}
:root {
font-family: system-ui, sans-serif;
color: #0f172a;
background: #f8fafc;
}
body {
margin: 0;
}
.app {
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2rem;
padding: 2rem;
box-sizing: border-box;
}
.title {
font-size: 1.875rem;
margin: 0;
}
.nav {
display: flex;
gap: 1rem;
}
.link {
color: #475569;
text-decoration: none;
font-weight: 500;
}
.link:hover {
color: #0f172a;
}
.page {
display: flex;
flex-direction: column;
align-items: center;
gap: 1.5rem;
}
.text {
max-width: 28rem;
text-align: center;
color: #475569;
}
.card {
background: #fff;
padding: 2rem;
border-radius: 1rem;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
text-align: center;
}
.count {
font-size: 3rem;
font-weight: 700;
margin: 0;
font-variant-numeric: tabular-nums;
}
.row {
margin-top: 1.5rem;
display: flex;
justify-content: center;
gap: 0.75rem;
}
.btn {
background: #0f172a;
color: #fff;
border: 0;
border-radius: 0.5rem;
padding: 0.5rem 1rem;
font: inherit;
cursor: pointer;
}
.btn:hover {
background: #334155;
}
import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
import "./index.css";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
</StrictMode>,
);
{
"compilerOptions": {
"target": "ES2022",
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleResolution": "bundler",
"jsx": "react-jsx",
"strict": true,
"noEmit": true,
"skipLibCheck": true,
"isolatedModules": true,
"verbatimModuleSyntax": true,
"types": ["vite/client"]
},
"include": ["src", "vite.config.ts"]
}
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [react()],
});
{
"$schema": "https://turborepo.dev/schema.json",
"ui": "tui",
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["$TURBO_DEFAULT$", ".env*"],
"outputs": ["dist/**"]
},
"dev": {
"cache": false,
"persistent": true
},
"typecheck": {
"dependsOn": ["^typecheck"]
}
}
}
Changes to existing files
node_modules+.turbo−dist .env .env.local .DS_Store⋯ 1 unchanged lines
Project files
.gitignoreREADME.mdapps/web/.gitignoreapps/web/index.htmlapps/web/package.jsonapps/web/src/App.tsxapps/web/src/components/Counter.tsxapps/web/src/index.cssapps/web/src/main.tsxapps/web/tsconfig.jsonapps/web/vite.config.tspackage.jsonturbo.json