mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Some checks failed
all-good: Did all the other checks pass? / all-good (push) Has been cancelled
Ensure Prisma migrations are in sync with the schema / check_prisma_migrations (22.x) (push) Has been cancelled
DB migration compat / Check if migrations changed (push) Has been cancelled
Docker Server Build and Push / Docker Build and Push Server (push) Has been cancelled
Docker Server Build and Run / docker (push) Has been cancelled
Runs E2E API Tests (Local Emulator) / E2E Tests (Local Emulator, Node ${{ matrix.node-version }}) (22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (mock, 22.x) (push) Has been cancelled
Runs E2E API Tests / E2E Tests (Node ${{ matrix.node-version }}, Freestyle ${{ matrix.freestyle-mode }}) (prod, 22.x) (push) Has been cancelled
Runs E2E API Tests with custom port prefix / build (22.x) (push) Has been cancelled
Runs E2E Fallback Tests / E2E Fallback Tests (Node ${{ matrix.node-version }}) (22.x) (push) Has been cancelled
Lint & build / lint_and_build (24) (push) Has been cancelled
TOC Generator / TOC Generator (push) Has been cancelled
DB migration compat / Back-compat — Current branch migrations with ${{ needs.check-migrations-changed.outputs.base_branch }} branch code (push) Has been cancelled
DB migration compat / Forward-compat — Current branch code with ${{ needs.check-migrations-changed.outputs.base_branch }} branch migrations (push) Has been cancelled
DB migration compat / No migration changes (skipped) (push) Has been cancelled
108 lines
3.0 KiB
JavaScript
108 lines
3.0 KiB
JavaScript
import { createMDX } from 'fumadocs-mdx/next';
|
|
|
|
const withMDX = createMDX();
|
|
const dashboardUrl = process.env.NEXT_PUBLIC_HEXCLAVE_DASHBOARD_URL ?? process.env.NEXT_PUBLIC_STACK_DASHBOARD_URL ?? 'http://localhost:8101';
|
|
|
|
/** @type {import('next').NextConfig} */
|
|
const config = {
|
|
reactStrictMode: true,
|
|
eslint: {
|
|
// Temporarily disable ESLint during builds for Vercel deployment
|
|
ignoreDuringBuilds: false,
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
// Allow CORS for docs-embed routes to be accessed by the dashboard app
|
|
source: '/docs-embed/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Access-Control-Allow-Origin',
|
|
value: dashboardUrl, // Dashboard app origin
|
|
},
|
|
{
|
|
key: 'Access-Control-Allow-Methods',
|
|
value: 'GET, POST, PUT, DELETE, OPTIONS',
|
|
},
|
|
{
|
|
key: 'Access-Control-Allow-Headers',
|
|
value: 'Content-Type, Authorization',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
// Allow CORS for api-embed routes to be accessed by the dashboard app
|
|
source: '/api-embed/:path*',
|
|
headers: [
|
|
{
|
|
key: 'Access-Control-Allow-Origin',
|
|
value: dashboardUrl, // Dashboard app origin
|
|
},
|
|
{
|
|
key: 'Access-Control-Allow-Methods',
|
|
value: 'GET, POST, PUT, DELETE, OPTIONS',
|
|
},
|
|
{
|
|
key: 'Access-Control-Allow-Headers',
|
|
value: 'Content-Type, Authorization',
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
// Include OpenAPI files in output tracing for Vercel deployments
|
|
outputFileTracingIncludes: {
|
|
'/**/*': ['./content/**/*', './openapi/**/*'],
|
|
},
|
|
async redirects() {
|
|
return [
|
|
// Redirect root to docs overview
|
|
{
|
|
source: '/',
|
|
destination: '/docs/overview',
|
|
permanent: false,
|
|
},
|
|
// Redirect /docs/api to the overview page
|
|
{
|
|
source: '/docs/api',
|
|
destination: '/docs/api/overview',
|
|
permanent: false,
|
|
},
|
|
];
|
|
},
|
|
async rewrites() {
|
|
return [
|
|
// PostHog proxy rewrites to prevent ad blockers
|
|
{
|
|
source: "/consume/static/:path*",
|
|
destination: "https://eu-assets.i.posthog.com/static/:path*",
|
|
},
|
|
{
|
|
source: "/consume/:path*",
|
|
destination: "https://eu.i.posthog.com/:path*",
|
|
},
|
|
{
|
|
source: "/consume/decide",
|
|
destination: "https://eu.i.posthog.com/decide",
|
|
},
|
|
// Redirect .mdx requests to the llms.mdx route handler
|
|
{
|
|
source: '/docs/:path*.mdx',
|
|
destination: '/llms.mdx/:path*',
|
|
},
|
|
{
|
|
source: '/api/:path*.mdx',
|
|
destination: '/llms.mdx/:path*',
|
|
},
|
|
// Serve OpenAPI files from the openapi directory
|
|
{
|
|
source: '/openapi/:path*',
|
|
destination: '/openapi/:path*',
|
|
},
|
|
// No other rewrites needed for API docs - they're served directly from /docs/api/*
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withMDX(config);
|