Skip to content

Commit

Permalink
build: fix env var name
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanprobst committed Apr 18, 2024
1 parent 621db48 commit 3a16970
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NEXT_PUBLIC_APP_BASE_URL=http://localhost:3000
NEXT_PUBLIC_REDMINE_ID=14595
2 changes: 1 addition & 1 deletion .env.production.local.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
NEXT_PUBLIC_BASE_URL=
NEXT_PUBLIC_APP_BASE_URL=
NEXT_PUBLIC_BOTS=
NEXT_PUBLIC_MATOMO_BASE_URL=
NEXT_PUBLIC_MATOMO_ID=
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN npm install --ci --no-audit --no-fund
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1

ARG NEXT_PUBLIC_BASE_URL
ARG NEXT_PUBLIC_APP_BASE_URL
ARG NEXT_PUBLIC_BOTS
ARG NEXT_PUBLIC_MATOMO_BASE_URL
ARG NEXT_PUBLIC_MATOMO_ID
Expand Down
2 changes: 1 addition & 1 deletion config/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { env } from "~/config/env.config";

export const baseUrl = env.NEXT_PUBLIC_BASE_URL;
export const baseUrl = env.NEXT_PUBLIC_APP_BASE_URL;
8 changes: 4 additions & 4 deletions config/env.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace NodeJS {
interface ProcessEnv {
NEXT_PUBLIC_BASE_URL?: string;
NEXT_PUBLIC_APP_BASE_URL?: string;
NEXT_PUBLIC_BOTS?: string;
NEXT_PUBLIC_MATOMO_BASE_URL?: string;
NEXT_PUBLIC_MATOMO_ID?: string;
Expand All @@ -14,21 +14,21 @@ declare global {
}

interface Env {
NEXT_PUBLIC_BASE_URL: string;
NEXT_PUBLIC_APP_BASE_URL: string;
NEXT_PUBLIC_BOTS?: "disabled" | "enabled";
NEXT_PUBLIC_MATOMO_BASE_URL?: string;
NEXT_PUBLIC_MATOMO_ID?: string;
NEXT_PUBLIC_REDMINE_ID: string;
}

assert(process.env.NEXT_PUBLIC_BASE_URL != null);
assert(process.env.NEXT_PUBLIC_APP_BASE_URL != null);
if (process.env.NEXT_PUBLIC_BOTS != null) {
assert(process.env.NEXT_PUBLIC_BOTS === "enabled" || process.env.NEXT_PUBLIC_BOTS === "disabled");
}
assert(process.env.NEXT_PUBLIC_REDMINE_ID != null);

export const env: Env = {
NEXT_PUBLIC_BASE_URL: process.env["NEXT_PUBLIC_BASE_URL"],
NEXT_PUBLIC_APP_BASE_URL: process.env["NEXT_PUBLIC_APP_BASE_URL"],
NEXT_PUBLIC_BOTS: process.env["NEXT_PUBLIC_BOTS"],
NEXT_PUBLIC_MATOMO_BASE_URL: process.env["NEXT_PUBLIC_MATOMO_BASE_URL"],
NEXT_PUBLIC_MATOMO_ID: process.env["NEXT_PUBLIC_MATOMO_ID"],
Expand Down

0 comments on commit 3a16970

Please sign in to comment.