Skip to content

Commit

Permalink
feat: better turborepo caching
Browse files Browse the repository at this point in the history
  • Loading branch information
ixahmedxi committed May 21, 2024
1 parent 43618cc commit eb43f36
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 11 deletions.
2 changes: 1 addition & 1 deletion apps/marketing/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default defineConfig({
},
],
webServer: {
command: 'pnpm dev',
command: 'pnpm start',
url: 'http://localhost:4321',
reuseExistingServer: !process.env['CI'],
},
Expand Down
11 changes: 10 additions & 1 deletion apps/marketing/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
"extends": ["//"],
"pipeline": {
"lint": {
"dependsOn": ["^build", "build"]
"dependsOn": ["^build", "build"],
"inputs": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.cjs",
"**/*.mjs"
]
}
}
}
2 changes: 1 addition & 1 deletion apps/web/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default defineConfig({
},
],
webServer: {
command: 'pnpm dev',
command: 'pnpm start',
url: 'http://localhost:3000',
reuseExistingServer: !process.env['CI'],
},
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default function RootLayout({
<html lang="en" suppressHydrationWarning>
<body className={`${GeistSans.variable} ${GeistMono.variable}`}>
<NextSSRPlugin routerConfig={extractRouterConfig(fileRouter)} />
<ThemeProvider attribute="class" enableSystem>
<ThemeProvider attribute="class" enableSystem disableTransitionOnChange>
<TRPCReactProvider>{children}</TRPCReactProvider>
<Toaster />
</ThemeProvider>
Expand Down
60 changes: 53 additions & 7 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,66 @@
{
"$schema": "https://turbo.build/schema.json",
"globalDotEnv": ["apps/web/.env.local"],
"pipeline": {
"build": {
"dependsOn": ["^build", "^db:migrate"],
"inputs": ["$TURBO_DEFAULT$", "!.eslintrc.cjs"],
"inputs": [
"$TURBO_DEFAULT$",
"!.eslintrc.cjs",
"!CHANGELOG.md",
"!playwright.config.ts",
"!e2e/**"
],
"env": [
"DATABASE_URL",
"UPLOADTHING_SECRET",
"UPLOADTHING_APP_ID",
"UNKEY_ROOT_KEY",
"UNKEY_NAMESPACE",
"AUTH_GITHUB_ID",
"AUTH_GITHUB_SECRET",
"AUTH_GOOGLE_ID",
"AUTH_GOOGLE_SECRET",
"AUTH_GOOGLE_CODE_VERIFIER"
],
"outputs": [".next/**", "!.next/cache/**", "dist/**", ".astro/**"]
},
"db:migrate": {
"dependsOn": ["db:generate"]
"dependsOn": ["db:generate"],
"inputs": ["drizzle/**"]
},
"db:generate": {
"outputs": ["drizzle/**"]
"outputs": ["drizzle/**"],
"inputs": ["src/schema/**", "drizzle.config.ts"]
},
"test:e2e": {
"dependsOn": ["^build"],
"dependsOn": ["^build", "build"],
"outputs": ["playwright-report/**", "test-results/**"],
"inputs": ["e2e/**", "playwright.config.ts"]
},
"lint": {
"dependsOn": ["^build"]
"dependsOn": ["^build"],
"inputs": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.cjs",
"**/*.mjs"
]
},
"typecheck": {
"dependsOn": ["^build"]
"dependsOn": ["^build"],
"inputs": [
"**/*.ts",
"**/*.d.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.cjs",
"**/*.mjs"
]
},
"dev": {
"dependsOn": ["^build"],
Expand All @@ -40,7 +79,14 @@
},
"build-storybook": {
"dependsOn": ["^build"],
"outputs": ["storybook-static/**"]
"outputs": ["storybook-static/**"],
"inputs": [
"$TURBO_DEFAULT$",
"!.eslintrc.cjs",
"!CHANGELOG.md",
"!tsup.config.ts",
"!tsconfig.build.json"
]
}
}
}

0 comments on commit eb43f36

Please sign in to comment.