compassmock/next.config.ts
Jake Shore b80ffee3f7
Some checks failed
Tests / E2E Web (chromium) (push) Has been cancelled
Tests / Coverage (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Build (push) Has been cancelled
Tests / Unit Tests (push) Has been cancelled
Tests / E2E Web (firefox) (push) Has been cancelled
Tests / E2E Web (webkit) (push) Has been cancelled
Tests / E2E Desktop (macos-latest) (push) Has been cancelled
Tests / E2E Desktop (ubuntu-latest) (push) Has been cancelled
Tests / E2E Desktop (windows-latest) (push) Has been cancelled
Compass mock mode - runs locally without WorkOS auth
- Middleware bypasses WorkOS when API keys not configured
- AuthWrapper conditionally loads AuthKitProvider
- getCurrentUser() returns mock dev user when no auth
- Demo mode (/demo) sets cookie for dashboard access
- Memory DB provider fallback when D1 unavailable
- CF dev proxy gated behind ENABLE_CF_DEV=1
- All changes conditional - real auth works if keys provided
2026-02-18 21:52:50 -05:00

46 lines
1.7 KiB
TypeScript
Executable File

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
transpilePackages: ["agent-core"],
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
optimizePackageImports: [
"@tabler/icons-react",
"lucide-react",
"@radix-ui/react-icons",
"recharts",
"@workos-inc/node",
"date-fns",
"remeda",
"framer-motion",
],
},
// Node.js native modules that should not be bundled for edge/browser
// memory-provider imports better-sqlite3 which cannot run in Cloudflare Workers
serverExternalPackages: ["better-sqlite3", "./src/db/provider/memory-provider"],
};
export default nextConfig;
// Enable calling `getCloudflareContext()` in `next dev`.
// See https://opennext.js.org/cloudflare/bindings#local-access-to-bindings.
// Only init in dev -- build and lint don't need the wrangler proxy.
// Disabled for local dev without Cloudflare account access:
if (process.env.NODE_ENV === "development" && process.env.ENABLE_CF_DEV === "1") {
import("@opennextjs/cloudflare").then((mod) =>
mod.initOpenNextCloudflareForDev()
);
} else if (process.env.NODE_ENV === "development") {
// When Cloudflare dev proxy is not enabled, set a mock context so
// getCloudflareContext() doesn't throw. Actions check `env?.DB` and
// gracefully return empty data when it's missing.
const sym = Symbol.for("__cloudflare-context__");
(globalThis as Record<symbol, unknown>)[sym] = {
env: {}, // no DB binding — actions will short-circuit
cf: {},
ctx: { waitUntil: () => {}, passThroughOnException: () => {} },
};
}