Skip to content

Commit 616edd8

Browse files
authored
chore: Fix the turbo tasks for docs app (supabase#32941)
* Separate turbo config for docs app into its own separate file. Add a task dependency for codegen tasks. * Fix the clean command. Remove the prebuild command cause it's already covered by turbo.
1 parent 5e12593 commit 616edd8

File tree

3 files changed

+50
-37
lines changed

3 files changed

+50
-37
lines changed

Diff for: apps/docs/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"predev": "pnpm run codegen:references && pnpm run codegen:examples",
88
"dev": "next dev --port 3001",
99
"dev:secrets:pull": "AWS_PROFILE=supabase-dev node ../../scripts/getSecrets.js -n local/docs",
10-
"prebuild": "pnpm run codegen:references && pnpm run codegen:examples",
1110
"build": "next build",
1211
"build:analyze": "ANALYZE=true next build",
1312
"build:sitemap": "tsx ./internals/generate-sitemap.ts",
@@ -27,7 +26,7 @@
2726
"codegen:examples": "cp -r ../../examples ./examples",
2827
"codegen:references": "tsx features/docs/Reference.generated.script.ts",
2928
"codemod:frontmatter": "node ./scripts/codemod/mdx-meta.mjs && prettier --write \"content/**/*.mdx\"",
30-
"clean": "rimraf node_modules ./docs/features/docs/generated ./examples"
29+
"clean": "rimraf node_modules features/docs/generated examples"
3130
},
3231
"dependencies": {
3332
"@code-hike/mdx": "^0.9.0",

Diff for: apps/docs/turbo.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"$schema": "https://turbo.build/schema.json",
3+
"extends": ["//"],
4+
"tasks": {
5+
"codegen:examples": {
6+
"inputs": ["../../examples/**"],
7+
"outputs": ["examples/**"]
8+
},
9+
"codegen:references": {
10+
"inputs": ["spec/**"],
11+
"outputs": ["features/docs/generated/**"]
12+
},
13+
"build": {
14+
"dependsOn": ["^build", "codegen:examples", "codegen:references"],
15+
"env": [
16+
"ANALYZE",
17+
"NEXT_PUBLIC_SUPABASE_URL",
18+
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
19+
"NEXT_PUBLIC_MISC_URL",
20+
"NEXT_PUBLIC_MISC_ANON_KEY",
21+
"NODE_ENV",
22+
"NEXT_PUBLIC_API_URL",
23+
"NEXT_PUBLIC_BASE_PATH",
24+
"NEXT_PUBLIC_SITE_URL",
25+
"NEXT_PUBLIC_DEV_AUTH_PAGE",
26+
"NEXT_PUBLIC_IS_PLATFORM",
27+
"NEXT_PUBLIC_VERCEL_ENV",
28+
// These envs are used in the packages
29+
"NEXT_PUBLIC_STORAGE_KEY",
30+
"NEXT_PUBLIC_AUTH_DEBUG_KEY",
31+
"NEXT_PUBLIC_AUTH_PERSISTED_KEY",
32+
"NEXT_PUBLIC_AUTH_NAVIGATOR_LOCK_KEY",
33+
"NEXT_PUBLIC_AUTH_DETECT_SESSION_IN_URL",
34+
"NEXT_PUBLIC_GOTRUE_URL",
35+
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
36+
// These envs are technically passthrough env vars because they're only used on the server side of Nextjs
37+
"DOCS_GITHUB_APP_ID",
38+
"DOCS_GITHUB_APP_INSTALLATION_ID",
39+
"DOCS_GITHUB_APP_PRIVATE_KEY",
40+
"DOCS_REVALIDATION_KEYS",
41+
"DOCS_REVALIDATION_OVERRIDE_KEYS",
42+
"SUPABASE_SECRET_KEY",
43+
"OPENAI_API_KEY"
44+
],
45+
"inputs": ["$TURBO_DEFAULT$"],
46+
"outputs": [".next/**", "!.next/cache/**"]
47+
}
48+
}
49+
}

Diff for: turbo.json

-35
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,6 @@
2222
],
2323
"outputs": [".next/**", "!.next/cache/**", ".contentlayer/**"]
2424
},
25-
"docs#build": {
26-
"dependsOn": ["^build"],
27-
"env": [
28-
"ANALYZE",
29-
"NEXT_PUBLIC_SUPABASE_URL",
30-
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
31-
"NEXT_PUBLIC_MISC_URL",
32-
"NEXT_PUBLIC_MISC_ANON_KEY",
33-
"NODE_ENV",
34-
"NEXT_PUBLIC_API_URL",
35-
"NEXT_PUBLIC_BASE_PATH",
36-
"NEXT_PUBLIC_SITE_URL",
37-
"NEXT_PUBLIC_DEV_AUTH_PAGE",
38-
"NEXT_PUBLIC_IS_PLATFORM",
39-
"NEXT_PUBLIC_VERCEL_ENV",
40-
// These envs are used in the packages
41-
"NEXT_PUBLIC_STORAGE_KEY",
42-
"NEXT_PUBLIC_AUTH_DEBUG_KEY",
43-
"NEXT_PUBLIC_AUTH_PERSISTED_KEY",
44-
"NEXT_PUBLIC_AUTH_NAVIGATOR_LOCK_KEY",
45-
"NEXT_PUBLIC_AUTH_DETECT_SESSION_IN_URL",
46-
"NEXT_PUBLIC_GOTRUE_URL",
47-
"NEXT_PUBLIC_SUPABASE_ANON_KEY",
48-
// These envs are technically passthrough env vars because they're only used on the server side of Nextjs
49-
"DOCS_GITHUB_APP_ID",
50-
"DOCS_GITHUB_APP_INSTALLATION_ID",
51-
"DOCS_GITHUB_APP_PRIVATE_KEY",
52-
"DOCS_REVALIDATION_KEYS",
53-
"DOCS_REVALIDATION_OVERRIDE_KEYS",
54-
"SUPABASE_SECRET_KEY",
55-
"OPENAI_API_KEY"
56-
],
57-
"inputs": ["$TURBO_DEFAULT$", "../../examples"],
58-
"outputs": [".next/**", "!.next/cache/**"]
59-
},
6025
"studio#build": {
6126
"dependsOn": ["^build"],
6227
"env": [

0 commit comments

Comments
 (0)