From 46511b8287f292f2d008732b5ab55e71295e9352 Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Mon, 30 Dec 2024 12:24:59 +0100 Subject: [PATCH 01/12] remove node env from build pipeline --- packages/uploadthing/src/internal/config.test.ts | 1 + packages/uploadthing/src/internal/config.ts | 1 + turbo.json | 8 +------- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/uploadthing/src/internal/config.test.ts b/packages/uploadthing/src/internal/config.test.ts index 70eeeda818..08a5af7180 100644 --- a/packages/uploadthing/src/internal/config.test.ts +++ b/packages/uploadthing/src/internal/config.test.ts @@ -277,6 +277,7 @@ describe("IsDevelopment", () => { it.effect("is true if NODE_ENV is development", () => Effect.gen(function* () { // @ts-expect-error - it says it's readonly but we can mutate it + // eslint-disable-next-line turbo/no-undeclared-env-vars process.env.NODE_ENV = "development"; const isDev = yield* IsDevelopment.pipe( diff --git a/packages/uploadthing/src/internal/config.ts b/packages/uploadthing/src/internal/config.ts index 73a5b0b74e..d8b6deab9b 100644 --- a/packages/uploadthing/src/internal/config.ts +++ b/packages/uploadthing/src/internal/config.ts @@ -53,6 +53,7 @@ export const configProvider = (options: unknown) => export const IsDevelopment = Config.boolean("isDev").pipe( Config.orElse(() => Config.succeed( + // eslint-disable-next-line turbo/no-undeclared-env-vars typeof process !== "undefined" ? process.env.NODE_ENV : undefined, ).pipe(Config.map((_) => _ === "development")), ), diff --git a/turbo.json b/turbo.json index c84000d74d..44b76df20d 100644 --- a/turbo.json +++ b/turbo.json @@ -9,13 +9,7 @@ "UPLOADTHING_API_URL", "UPLOADTHING_INGEST_URL" ], - "globalPassThroughEnv": [ - "VERCEL_URL", - "VERCEL_ENV", - "NODE", - "NODE_ENV", - "CI" - ], + "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI"], "tasks": { "topo": { "dependsOn": ["^topo"] From eaa42bd8f4211128210ec0745af862538b2f0224 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 30 Dec 2024 12:27:04 +0100 Subject: [PATCH 02/12] Create spotty-windows-fold.md --- .changeset/spotty-windows-fold.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/spotty-windows-fold.md diff --git a/.changeset/spotty-windows-fold.md b/.changeset/spotty-windows-fold.md new file mode 100644 index 0000000000..6fb135aefd --- /dev/null +++ b/.changeset/spotty-windows-fold.md @@ -0,0 +1,5 @@ +--- +"uploadthing": patch +--- + +fix: automatic dev mode detection not always inferring from NODE_ENV From 3875bc9cf4d86141ba97bbce91c6be0869347113 Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Mon, 30 Dec 2024 12:31:01 +0100 Subject: [PATCH 03/12] include it here instead --- packages/uploadthing/src/internal/config.test.ts | 1 - packages/uploadthing/src/internal/config.ts | 1 - turbo.json | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/uploadthing/src/internal/config.test.ts b/packages/uploadthing/src/internal/config.test.ts index 08a5af7180..70eeeda818 100644 --- a/packages/uploadthing/src/internal/config.test.ts +++ b/packages/uploadthing/src/internal/config.test.ts @@ -277,7 +277,6 @@ describe("IsDevelopment", () => { it.effect("is true if NODE_ENV is development", () => Effect.gen(function* () { // @ts-expect-error - it says it's readonly but we can mutate it - // eslint-disable-next-line turbo/no-undeclared-env-vars process.env.NODE_ENV = "development"; const isDev = yield* IsDevelopment.pipe( diff --git a/packages/uploadthing/src/internal/config.ts b/packages/uploadthing/src/internal/config.ts index d8b6deab9b..73a5b0b74e 100644 --- a/packages/uploadthing/src/internal/config.ts +++ b/packages/uploadthing/src/internal/config.ts @@ -53,7 +53,6 @@ export const configProvider = (options: unknown) => export const IsDevelopment = Config.boolean("isDev").pipe( Config.orElse(() => Config.succeed( - // eslint-disable-next-line turbo/no-undeclared-env-vars typeof process !== "undefined" ? process.env.NODE_ENV : undefined, ).pipe(Config.map((_) => _ === "development")), ), diff --git a/turbo.json b/turbo.json index 44b76df20d..78ef14d5a8 100644 --- a/turbo.json +++ b/turbo.json @@ -3,6 +3,7 @@ "ui": "tui", "globalDependencies": ["**/.env.*local"], "globalEnv": [ + "NODE_ENV", "UPLOADTHING_TOKEN", "UPLOADTHING_TEST_TOKEN", "EXPO_PUBLIC_SERVER_ORIGIN", From 80da62fa5eb2c1cec98884c6865dfd8b89ae1252 Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Mon, 30 Dec 2024 12:37:54 +0100 Subject: [PATCH 04/12] maybe this is the better way --- packages/react/turbo.json | 1 + packages/shared/turbo.json | 1 + packages/uploadthing/turbo.json | 1 + turbo.json | 3 +-- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react/turbo.json b/packages/react/turbo.json index 8d06fbf92f..df4d6f24d1 100644 --- a/packages/react/turbo.json +++ b/packages/react/turbo.json @@ -3,6 +3,7 @@ "extends": ["//"], "tasks": { "build": { + "env": ["!NODE_ENV"], "outputs": ["dist/**", "native/**", "next-ssr-plugin/**"] } } diff --git a/packages/shared/turbo.json b/packages/shared/turbo.json index 48d8a74620..c944862807 100644 --- a/packages/shared/turbo.json +++ b/packages/shared/turbo.json @@ -3,6 +3,7 @@ "extends": ["//"], "tasks": { "build": { + "env": ["!NODE_ENV"], "outputs": ["dist/**"] } } diff --git a/packages/uploadthing/turbo.json b/packages/uploadthing/turbo.json index 24c2f8a688..8745aaa2f2 100644 --- a/packages/uploadthing/turbo.json +++ b/packages/uploadthing/turbo.json @@ -3,6 +3,7 @@ "extends": ["//"], "tasks": { "build": { + "env": ["!NODE_ENV"], "outputs": [ "client/**", "effect-platform/**", diff --git a/turbo.json b/turbo.json index 78ef14d5a8..14ca455705 100644 --- a/turbo.json +++ b/turbo.json @@ -3,14 +3,13 @@ "ui": "tui", "globalDependencies": ["**/.env.*local"], "globalEnv": [ - "NODE_ENV", "UPLOADTHING_TOKEN", "UPLOADTHING_TEST_TOKEN", "EXPO_PUBLIC_SERVER_ORIGIN", "UPLOADTHING_API_URL", "UPLOADTHING_INGEST_URL" ], - "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI"], + "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI", "NODE_ENV"], "tasks": { "topo": { "dependsOn": ["^topo"] From 4da4af21d82e1f739aa24a7e241e9afcfa7d15a0 Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Mon, 30 Dec 2024 12:44:04 +0100 Subject: [PATCH 05/12] this?? --- packages/react/turbo.json | 2 +- packages/shared/turbo.json | 2 +- packages/uploadthing/turbo.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react/turbo.json b/packages/react/turbo.json index df4d6f24d1..266999acee 100644 --- a/packages/react/turbo.json +++ b/packages/react/turbo.json @@ -3,7 +3,7 @@ "extends": ["//"], "tasks": { "build": { - "env": ["!NODE_ENV"], + "passThroughEnv": ["!NODE_ENV"], "outputs": ["dist/**", "native/**", "next-ssr-plugin/**"] } } diff --git a/packages/shared/turbo.json b/packages/shared/turbo.json index c944862807..bb566c6784 100644 --- a/packages/shared/turbo.json +++ b/packages/shared/turbo.json @@ -3,7 +3,7 @@ "extends": ["//"], "tasks": { "build": { - "env": ["!NODE_ENV"], + "passThroughEnv": ["!NODE_ENV"], "outputs": ["dist/**"] } } diff --git a/packages/uploadthing/turbo.json b/packages/uploadthing/turbo.json index 8745aaa2f2..41176d69a6 100644 --- a/packages/uploadthing/turbo.json +++ b/packages/uploadthing/turbo.json @@ -3,7 +3,7 @@ "extends": ["//"], "tasks": { "build": { - "env": ["!NODE_ENV"], + "passThroughEnv": ["!NODE_ENV"], "outputs": [ "client/**", "effect-platform/**", From e80b6254813c3243a2855af55d1c90bd08a5c08b Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Mon, 30 Dec 2024 12:50:53 +0100 Subject: [PATCH 06/12] wtffff turbo --- turbo.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 14ca455705..44b76df20d 100644 --- a/turbo.json +++ b/turbo.json @@ -9,7 +9,7 @@ "UPLOADTHING_API_URL", "UPLOADTHING_INGEST_URL" ], - "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI", "NODE_ENV"], + "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI"], "tasks": { "topo": { "dependsOn": ["^topo"] From 1fc28fd9f5525da3c86442ffbf67b9258582cadd Mon Sep 17 00:00:00 2001 From: juliusmarminge Date: Mon, 30 Dec 2024 12:56:50 +0100 Subject: [PATCH 07/12] just nuke cache when releasing --- .github/workflows/release.yaml | 6 +++--- turbo.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f3fcd059e1..de6e0c87b6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,9 +4,9 @@ on: branches: - main -env: - TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} - TURBO_TEAM: ${{ secrets.TURBO_TEAM }} +# env: +# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} +# TURBO_TEAM: ${{ secrets.TURBO_TEAM }} jobs: release: diff --git a/turbo.json b/turbo.json index 44b76df20d..14ca455705 100644 --- a/turbo.json +++ b/turbo.json @@ -9,7 +9,7 @@ "UPLOADTHING_API_URL", "UPLOADTHING_INGEST_URL" ], - "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI"], + "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI", "NODE_ENV"], "tasks": { "topo": { "dependsOn": ["^topo"] From 062ea334b53dd6a17280ff87564cbe054e461bb8 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 30 Dec 2024 13:08:12 +0100 Subject: [PATCH 08/12] Discard changes to packages/uploadthing/turbo.json --- packages/uploadthing/turbo.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/uploadthing/turbo.json b/packages/uploadthing/turbo.json index 41176d69a6..24c2f8a688 100644 --- a/packages/uploadthing/turbo.json +++ b/packages/uploadthing/turbo.json @@ -3,7 +3,6 @@ "extends": ["//"], "tasks": { "build": { - "passThroughEnv": ["!NODE_ENV"], "outputs": [ "client/**", "effect-platform/**", From c7f504970ec60860e9a1eff1adf67699302de22e Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 30 Dec 2024 13:08:18 +0100 Subject: [PATCH 09/12] Discard changes to turbo.json --- turbo.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/turbo.json b/turbo.json index 14ca455705..c84000d74d 100644 --- a/turbo.json +++ b/turbo.json @@ -9,7 +9,13 @@ "UPLOADTHING_API_URL", "UPLOADTHING_INGEST_URL" ], - "globalPassThroughEnv": ["VERCEL_URL", "VERCEL_ENV", "CI", "NODE_ENV"], + "globalPassThroughEnv": [ + "VERCEL_URL", + "VERCEL_ENV", + "NODE", + "NODE_ENV", + "CI" + ], "tasks": { "topo": { "dependsOn": ["^topo"] From fd6f2ef1aa3c902b93903c83d0d0c474197921f1 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 30 Dec 2024 13:08:23 +0100 Subject: [PATCH 10/12] Discard changes to packages/react/turbo.json --- packages/react/turbo.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react/turbo.json b/packages/react/turbo.json index 266999acee..8d06fbf92f 100644 --- a/packages/react/turbo.json +++ b/packages/react/turbo.json @@ -3,7 +3,6 @@ "extends": ["//"], "tasks": { "build": { - "passThroughEnv": ["!NODE_ENV"], "outputs": ["dist/**", "native/**", "next-ssr-plugin/**"] } } From 8e0822179076e72e95655982cc1ef50dde557d4a Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 30 Dec 2024 13:08:27 +0100 Subject: [PATCH 11/12] Discard changes to packages/shared/turbo.json --- packages/shared/turbo.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/shared/turbo.json b/packages/shared/turbo.json index bb566c6784..48d8a74620 100644 --- a/packages/shared/turbo.json +++ b/packages/shared/turbo.json @@ -3,7 +3,6 @@ "extends": ["//"], "tasks": { "build": { - "passThroughEnv": ["!NODE_ENV"], "outputs": ["dist/**"] } } From 7780e9ebd70b74562d9afa6d07c8119b115c6221 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Mon, 30 Dec 2024 13:08:35 +0100 Subject: [PATCH 12/12] Discard changes to .github/workflows/release.yaml --- .github/workflows/release.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index de6e0c87b6..f3fcd059e1 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -4,9 +4,9 @@ on: branches: - main -# env: -# TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} -# TURBO_TEAM: ${{ secrets.TURBO_TEAM }} +env: + TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} + TURBO_TEAM: ${{ secrets.TURBO_TEAM }} jobs: release: