Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove node env from build pipeline #1105

Closed
wants to merge 12 commits into from
5 changes: 5 additions & 0 deletions .changeset/spotty-windows-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"uploadthing": patch
---

fix: automatic dev mode detection not always inferring from NODE_ENV
1 change: 1 addition & 0 deletions packages/uploadthing/src/internal/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions packages/uploadthing/src/internal/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
),
Expand Down
8 changes: 1 addition & 7 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Loading