Skip to content

Commit 5ef56a7

Browse files
committed
Fix freebuff web build
1 parent 33a8547 commit 5ef56a7

5 files changed

Lines changed: 30 additions & 25 deletions

File tree

bun.lock

Lines changed: 12 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

freebuff/web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"clsx": "^2.1.1",
2222
"framer-motion": "^11.13.3",
2323
"lucide-react": "^0.487.0",
24-
"next": "15.5.11",
24+
"next": "15.5.16",
2525
"next-auth": "^4.24.11",
2626
"next-themes": "^0.4.6",
2727
"pino": "^9.6.0",

freebuff/web/src/app/home-client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const faqs = [
2626
{
2727
question: 'What models do you use?',
2828
answer:
29-
'Pick DeepSeek V4 Pro (default and smartest, but its API collects data for training) or Kimi K2.6 (no data retention) as the main coding agent. Gemini 3.1 Flash Lite for finding files and research.\n\nConnect your ChatGPT subscription to unlock GPT-5.4 for deep thinking.',
29+
'You can choose from three coding models. DeepSeek and Kimi share 5 one-hour premium sessions per day:\n\n- DeepSeek V4 Pro: premium and smartest. Its API collects data for training.\n- Kimi K2.6: premium and balanced.\n- MiniMax M2.7: fastest, with unlimited sessions.\n\nGemini 3.1 Flash Lite handles file finding and research. Connect your ChatGPT subscription to unlock GPT-5.4 for deep thinking.',
3030
},
3131
{
3232
question: 'Which countries is Freebuff available in?',

packages/internal/src/env.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ import { serverEnvSchema, serverProcessEnv } from './env-schema'
33
// Only provide safe defaults in CI to avoid schema failures during tests
44
// In local dev, missing env vars should fail fast so devs know to configure them
55
const isCI = process.env.CI === 'true' || process.env.CI === '1'
6+
const isNextProductionBuild =
7+
process.env.NEXT_PHASE === 'phase-production-build'
68
const envInput = { ...serverProcessEnv }
79

8-
if (isCI) {
9-
const ensureEnvDefault = (key: string, value: string) => {
10-
if (!process.env[key]) {
11-
process.env[key] = value
12-
}
13-
envInput[key as keyof typeof envInput] = process.env[key]
10+
const ensureEnvDefault = (key: keyof typeof envInput, value: string) => {
11+
if (!process.env[key]) {
12+
process.env[key] = value
1413
}
14+
envInput[key] = process.env[key]
15+
}
1516

17+
if (isCI) {
1618
ensureEnvDefault('OPEN_ROUTER_API_KEY', 'test')
1719
ensureEnvDefault('OPENAI_API_KEY', 'test')
1820
ensureEnvDefault('ANTHROPIC_API_KEY', 'test')
@@ -41,6 +43,13 @@ if (isCI) {
4143
ensureEnvDefault('DISCORD_APPLICATION_ID', 'test')
4244
}
4345

46+
// Next imports server route modules while collecting production build data.
47+
// Freebuff auth routes do not use IPinfo, so keep build-time validation from
48+
// requiring the runtime-only country-gating token. Runtime still fails fast.
49+
if (isNextProductionBuild) {
50+
ensureEnvDefault('IPINFO_TOKEN', 'build-time-placeholder')
51+
}
52+
4453
// Only log environment in non-production
4554
if (process.env.NEXT_PUBLIC_CB_ENVIRONMENT !== 'prod') {
4655
console.log('Using environment:', process.env.NEXT_PUBLIC_CB_ENVIRONMENT)

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"geoip-lite": "^2.0.0",
7474
"lucide-react": "^0.487.0",
7575
"mermaid": "^11.8.1",
76-
"next": "15.5.11",
76+
"next": "15.5.16",
7777
"next-auth": "^4.24.11",
7878
"next-contentlayer2": "^0.5.8",
7979
"next-themes": "^0.4.6",

0 commit comments

Comments
 (0)