Skip to content

Commit 5f6795b

Browse files
fix: Simplify code for skip-typegen
Let's not pollute the base `turbo.json` file, and instead pollute the package.json file because that's slightly better
1 parent 1ffd187 commit 5f6795b

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

bin/start-frontend

+1-7
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,4 @@ set -e
99
export DEBUG=0
1010

1111
pnpm --filter=@posthog/frontend... install
12-
13-
# Choose between start and start-no-typegen based on SKIP_TYPEGEN env variable
14-
if [ "${SKIP_TYPEGEN}" = "1" ]; then
15-
bin/turbo --filter=@posthog/frontend start-no-typegen
16-
else
17-
bin/turbo --filter=@posthog/frontend start
18-
fi
12+
bin/turbo --filter=@posthog/frontend start

frontend/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@
2323
"build:esbuild": "DEBUG=0 node ./build.mjs",
2424
"build:tailwind": "pnpm --filter=@posthog/tailwind build",
2525
"watch:tailwind": "pnpm --filter=@posthog/tailwind start",
26-
"start": "concurrently -n ESBUILD,TYPEGEN,TAILWIND -c yellow,green,blue \"pnpm start-http\" \"pnpm run typegen:watch\" \"sleep 40 && pnpm watch:tailwind\"",
27-
"start-no-typegen": "concurrently -n ESBUILD,TAILWIND -c yellow,blue \"pnpm start-http\" \"sleep 40 && pnpm watch:tailwind\"",
26+
"start": "if [ -n \"$SKIP_TYPEGEN\" ]; then pnpm start-no-typegen; else pnpm start-all; fi",
27+
"start-all": "concurrently -n ESBUILD,TYPEGEN,TAILWIND -c yellow,green,blue \"pnpm start-http\" \"${SKIP_TYPEGEN:-pnpm run typegen:watch}\" \"sleep 40 && pnpm watch:tailwind\"",
28+
"start-no-typegen": "concurrently -n ESBUILD,TAILWIND -c yellow,green,blue \"pnpm start-http\" \"sleep 40 && pnpm watch:tailwind\"",
2829
"start-http": "pnpm clean && pnpm copy-scripts && pnpm build:esbuild --dev",
2930
"start-docker": "pnpm start-http --host 0.0.0.0",
3031
"typegen:write": "cd .. && kea-typegen write --delete --show-ts-errors",

turbo.json

+2-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@
2121
"start": {
2222
"dependsOn": ["^build"],
2323
"persistent": true,
24-
"cache": false
25-
},
26-
"start-no-typegen": {
27-
"dependsOn": ["^build"],
28-
"persistent": true,
29-
"cache": false
24+
"cache": false,
25+
"passThroughEnv": ["SKIP_TYPEGEN"]
3026
},
3127
"dev": {
3228
"dependsOn": ["^build"],

0 commit comments

Comments
 (0)