From da04dacbee01e2839cf969e2e35455aab4d66fd9 Mon Sep 17 00:00:00 2001 From: FleetAdmiralJakob Date: Sun, 21 Jan 2024 20:24:43 +0100 Subject: [PATCH] fix: Fixed a bug which caused a major outage of the APIs --- apps/web/next.config.mjs | 1 + packages/api/env.mjs | 3 ++- packages/api/package.json | 3 ++- packages/api/tsconfig.json | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index f42d368d..6a6bd79b 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,5 +1,6 @@ // Importing env files here to validate on build import './src/env.mjs' +import '@weatherio/api/env' import withBundleAnalyzer from '@next/bundle-analyzer' import pkg from './next-i18next.config.js' import withPWAInit from '@ducanh2912/next-pwa' diff --git a/packages/api/env.mjs b/packages/api/env.mjs index aa85c631..be4ed209 100644 --- a/packages/api/env.mjs +++ b/packages/api/env.mjs @@ -12,7 +12,7 @@ export const env = createEnv({ UPSTASH_RATELIMITER_EXCLUDED_IPS: z.string().min(1), RESEND_API_KEY: z.string().min(1), QWEATHER_API_KEY: z.string().min(1), - API_NINJA_API_KEY: z.string().min(1) + API_NINJA_API_KEY: z.string().min(1), }, client: {}, runtimeEnv: { @@ -22,6 +22,7 @@ export const env = createEnv({ UPSTASH_REDIS_REST_TOKEN: process.env.UPSTASH_REDIS_REST_TOKEN, UPSTASH_RATELIMITER_TOKENS_PER_TIME: process.env.UPSTASH_RATELIMITER_TOKENS_PER_TIME, UPSTASH_RATELIMITER_TIME_INTERVAL: process.env.UPSTASH_RATELIMITER_TIME_INTERVAL, + UPSTASH_RATELIMITER_EXCLUDED_IPS: process.env.UPSTASH_RATELIMITER_EXCLUDED_IPS, RESEND_API_KEY: process.env.RESEND_API_KEY, QWEATHER_API_KEY: process.env.QWEATHER_API_KEY, API_NINJA_API_KEY: process.env.API_NINJA_API_KEY diff --git a/packages/api/package.json b/packages/api/package.json index 02c3d0ed..eb1c8b0b 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -4,7 +4,8 @@ "private": true, "type": "module", "exports": { - ".": "./src/index.ts" + ".": "./src/index.ts", + "./env": "./env.mjs" }, "license": "MIT", "scripts": { diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index 6c1d4ab5..197d7e0d 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -3,6 +3,6 @@ "compilerOptions": { "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, - "include": ["src", "../../reset.d.ts", "*.mjs"], + "include": ["src", "../../reset.d.ts", "**/*.mjs", "."], "exclude": ["node_modules"] }