Skip to content

OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.

ralph(M15-201): R14: the residue sweep - NEXT_PUBLIC_ out of core, fika/V1 leftovers, _deprecated scripts

ralph20f63a8f5dc7
diff --git a/apps/api/src/config/env.test.ts b/apps/api/src/config/env.test.ts
index ec00a3ad0..c44465db1 100644
--- a/apps/api/src/config/env.test.ts
+++ b/apps/api/src/config/env.test.ts
@@ -195,18 +195,10 @@ describe('tuning knobs keep the module default on a malformed value', () => {
});
describe('derived values, computed once in the transform', () => {
- it('DASHBOARD_URL wins over NEXT_PUBLIC_DASHBOARD_URL; neither means empty', () => {
+ it('dashboardUrl is DASHBOARD_URL, unset means empty', () => {
expect(loadConfig(base).core.dashboardUrl).toBe('');
expect(
- loadConfig({ ...base, NEXT_PUBLIC_DASHBOARD_URL: 'https://next' }).core
- .dashboardUrl
- ).toBe('https://next');
- expect(
- loadConfig({
- ...base,
- DASHBOARD_URL: 'https://own',
- NEXT_PUBLIC_DASHBOARD_URL: 'https://next',
- }).core.dashboardUrl
+ loadConfig({ ...base, DASHBOARD_URL: 'https://own' }).core.dashboardUrl
).toBe('https://own');
});
diff --git a/apps/api/src/config/env.ts b/apps/api/src/config/env.ts
index 069e52048..fe7217dbe 100644
--- a/apps/api/src/config/env.ts
+++ b/apps/api/src/config/env.ts
@@ -323,7 +323,6 @@ const rawSchema = z.object({
* boot, exactly as V1 did — changing an origin has always needed a restart.
*/
DASHBOARD_URL: optionalString,
- NEXT_PUBLIC_DASHBOARD_URL: optionalString,
API_CORS_ORIGINS: optionalString,
/**
* Signs the three GSC OAuth cookies. Always set in a real deployment
@@ -582,7 +581,7 @@ function checkProfileBackfillProjectsHaveAFlag(
// --- derivations ------------------------------------------------------------
function deriveDashboardUrl(raw: RawEnv): string {
- return raw.DASHBOARD_URL ?? raw.NEXT_PUBLIC_DASHBOARD_URL ?? '';
+ return raw.DASHBOARD_URL ?? '';
}
function deriveCoreConfig(raw: RawEnv): CoreConfig {
diff --git a/apps/start/package.json b/apps/start/package.json
index 63e1984eb..10f844944 100644
--- a/apps/start/package.json
+++ b/apps/start/package.json
@@ -4,7 +4,6 @@
"type": "module",
"scripts": {
"dev": "bun run with-env vite dev --port 3000",
- "start_deprecated": "bun run with-env node .output/server/index.mjs",
"preview": "vite preview",
"deploy": "bun run build && bunx wrangler deploy",
"cf-typegen": "wrangler types",
diff --git a/apps/start/src/server/get-envs.ts b/apps/start/src/server/get-envs.ts
index f1202c096..3a763f1ac 100644
--- a/apps/start/src/server/get-envs.ts
+++ b/apps/start/src/server/get-envs.ts
@@ -3,10 +3,8 @@ import { createServerFn } from '@tanstack/react-start';
export const getServerEnvs = createServerFn().handler(() => {
const envs = {
- apiUrl: String(process.env.API_URL || process.env.NEXT_PUBLIC_API_URL),
- dashboardUrl: String(
- process.env.DASHBOARD_URL || process.env.NEXT_PUBLIC_DASHBOARD_URL
- ),
+ apiUrl: String(process.env.API_URL),
+ dashboardUrl: String(process.env.DASHBOARD_URL),
isSelfHosted: process.env.SELF_HOSTED !== undefined,
isMaintenance: process.env.MAINTENANCE === '1',
isDemo: process.env.DEMO_USER_ID !== undefined,