buster/web/next.config.mjs

104 lines
2.9 KiB
JavaScript
Raw Normal View History

Biome linter test (#336) * update files for use with biom * fix prettier formats * minor biome fixes * fix additional files * update linting rules * fix additional linting errors * fix linting errors * update lib * run check in the lib direcotyr * update some linting errors * fix problems * move addtional files to stricter linting * fix imports and linting errors * update some biome settings * fix query parser * quick wins * update files * fix addtional things * fix context files * update additional biome files * fix additional files * biome fixes * fixin files * fix broken * fix additional files and problems * fix biome buster stuff * fix helpers and * stricter linting * fixed * fix missing types * fix linting * remove missing imports * update more biome test stuff * update fixes * update imports * more updates * fix some linting errors * fix broken children as prop errors * lint ci * update lint check * Update package.json * Update next.config.mjs * fix some broken tests * update some tests * chore(versions): bump api to v0.1.16; bump web to v0.1.16; bump cli to v0.1.16 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-unit-tests.yml * fix some tests * chore(versions): bump api to v0.1.17; bump web to v0.1.17; bump cli to v0.1.17 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update ignore files * chore(versions): bump api to v0.1.18; bump web to v0.1.18; bump cli to v0.1.18 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-lint.yml * chore(versions): bump api to v0.1.19; bump web to v0.1.19; bump cli to v0.1.19 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update boime package settings * chore(versions): bump api to v0.1.20; bump web to v0.1.20; bump cli to v0.1.20 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * save to dropdown bug fixes * update console logs * update chart animation * chore(versions): bump api to v0.1.21; bump web to v0.1.21; bump cli to v0.1.21 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update build * chore(versions): bump api to v0.1.22; bump web to v0.1.22; bump cli to v0.1.22 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * additinal updates for biome 2 * update imports * chore(versions): bump api to v0.1.23; bump web to v0.1.23; bump cli to v0.1.23 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * final updates * chore(versions): bump api to v0.1.24; bump web to v0.1.24; bump cli to v0.1.24 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update dashboard-updates.test.ts * chore(versions): bump api to v0.1.25; bump web to v0.1.25; bump cli to v0.1.25 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * crazy fix * chore(versions): bump api to v0.1.26; bump web to v0.1.26; bump cli to v0.1.26 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * more attempts for stable tests * chore(versions): bump api to v0.1.27; bump web to v0.1.27; bump cli to v0.1.27 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update tests * split the test off * chore(versions): bump api to v0.1.28; bump web to v0.1.28; bump cli to v0.1.28 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update pie-styling-updates.spec.ts * Create web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.29; bump web to v0.1.29; bump cli to v0.1.29 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update tests * chore(versions): bump api to v0.1.30; bump web to v0.1.30; bump cli to v0.1.30 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.31; bump web to v0.1.31; bump cli to v0.1.31 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.32; bump web to v0.1.32; bump cli to v0.1.32 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.33; bump web to v0.1.33; bump cli to v0.1.33 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.34; bump web to v0.1.34; bump cli to v0.1.34 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * Update web-e2e-tests-optimized.yml * Revert "Update web-e2e-tests-optimized.yml" This reverts commit dfc9263a2621f1c00dee30e28dbb01a9f8f914ef. * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.35; bump web to v0.1.35; bump cli to v0.1.35 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.36; bump web to v0.1.36; bump cli to v0.1.36 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-05-31 01:16:48 +08:00
import path, { dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
2025-04-02 02:58:24 +08:00
// Function to create CSP header with dynamic API URLs
const createCspHeader = (isEmbed = false) => {
const apiUrl = process.env.NEXT_PUBLIC_API_URL
? new URL(process.env.NEXT_PUBLIC_API_URL).origin
: '';
const wsUrl = process.env.NEXT_PUBLIC_WEB_SOCKET_URL
? new URL(process.env.NEXT_PUBLIC_WEB_SOCKET_URL).origin
.replace('https', 'wss')
.replace('http', 'ws')
: '';
const isDev = process.env.NODE_ENV === 'development';
const localDomains = isDev ? 'http://127.0.0.1:* ws://127.0.0.1:*' : '';
2025-04-02 02:58:24 +08:00
return [
// Default directives
"default-src 'self'",
// Scripts
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://vercel.live https://*.vercel.app https://cdn.jsdelivr.net https://*.cloudflareinsights.com https://*.posthog.com",
2025-04-02 02:58:24 +08:00
// Styles
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com https://cdn.jsdelivr.net",
// Images
"img-src 'self' blob: data: https://*.vercel.app https://*.supabase.co",
// Fonts
"font-src 'self' https://fonts.gstatic.com https://cdn.jsdelivr.net",
// Frame ancestors
isEmbed ? `frame-ancestors 'self' *` : "frame-ancestors 'none'",
2025-04-02 03:12:07 +08:00
// Frame sources
"frame-src 'self' https://vercel.live",
2025-04-02 02:58:24 +08:00
// Connect sources for API calls
`connect-src 'self' ${localDomains} https://*.vercel.app https://*.supabase.co wss://*.supabase.co https://*.posthog.com ${apiUrl} ${wsUrl}`.trim(),
2025-04-02 02:58:24 +08:00
// Media
"media-src 'self'",
// Object
"object-src 'none'",
// Form actions
"form-action 'self'",
// Base URI
"base-uri 'self'",
// Manifest
2025-04-23 00:32:32 +08:00
"manifest-src 'self'",
// Worker sources
"worker-src 'self' blob: data:",
// Child sources
"child-src 'self' blob: data:"
2025-04-02 02:58:24 +08:00
].join('; ');
};
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
Biome linter test (#336) * update files for use with biom * fix prettier formats * minor biome fixes * fix additional files * update linting rules * fix additional linting errors * fix linting errors * update lib * run check in the lib direcotyr * update some linting errors * fix problems * move addtional files to stricter linting * fix imports and linting errors * update some biome settings * fix query parser * quick wins * update files * fix addtional things * fix context files * update additional biome files * fix additional files * biome fixes * fixin files * fix broken * fix additional files and problems * fix biome buster stuff * fix helpers and * stricter linting * fixed * fix missing types * fix linting * remove missing imports * update more biome test stuff * update fixes * update imports * more updates * fix some linting errors * fix broken children as prop errors * lint ci * update lint check * Update package.json * Update next.config.mjs * fix some broken tests * update some tests * chore(versions): bump api to v0.1.16; bump web to v0.1.16; bump cli to v0.1.16 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-unit-tests.yml * fix some tests * chore(versions): bump api to v0.1.17; bump web to v0.1.17; bump cli to v0.1.17 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update ignore files * chore(versions): bump api to v0.1.18; bump web to v0.1.18; bump cli to v0.1.18 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-lint.yml * chore(versions): bump api to v0.1.19; bump web to v0.1.19; bump cli to v0.1.19 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update boime package settings * chore(versions): bump api to v0.1.20; bump web to v0.1.20; bump cli to v0.1.20 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * save to dropdown bug fixes * update console logs * update chart animation * chore(versions): bump api to v0.1.21; bump web to v0.1.21; bump cli to v0.1.21 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update build * chore(versions): bump api to v0.1.22; bump web to v0.1.22; bump cli to v0.1.22 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * additinal updates for biome 2 * update imports * chore(versions): bump api to v0.1.23; bump web to v0.1.23; bump cli to v0.1.23 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * final updates * chore(versions): bump api to v0.1.24; bump web to v0.1.24; bump cli to v0.1.24 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update dashboard-updates.test.ts * chore(versions): bump api to v0.1.25; bump web to v0.1.25; bump cli to v0.1.25 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * crazy fix * chore(versions): bump api to v0.1.26; bump web to v0.1.26; bump cli to v0.1.26 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * more attempts for stable tests * chore(versions): bump api to v0.1.27; bump web to v0.1.27; bump cli to v0.1.27 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update tests * split the test off * chore(versions): bump api to v0.1.28; bump web to v0.1.28; bump cli to v0.1.28 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update pie-styling-updates.spec.ts * Create web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.29; bump web to v0.1.29; bump cli to v0.1.29 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * update tests * chore(versions): bump api to v0.1.30; bump web to v0.1.30; bump cli to v0.1.30 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.31; bump web to v0.1.31; bump cli to v0.1.31 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.32; bump web to v0.1.32; bump cli to v0.1.32 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.33; bump web to v0.1.33; bump cli to v0.1.33 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.34; bump web to v0.1.34; bump cli to v0.1.34 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * Update web-e2e-tests-optimized.yml * Revert "Update web-e2e-tests-optimized.yml" This reverts commit dfc9263a2621f1c00dee30e28dbb01a9f8f914ef. * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.35; bump web to v0.1.35; bump cli to v0.1.35 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] * Update web-e2e-tests-optimized.yml * chore(versions): bump api to v0.1.36; bump web to v0.1.36; bump cli to v0.1.36 [skip ci] * chore: update tag_info.json with potential release versions [skip ci] --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-05-31 01:16:48 +08:00
// Disable ESLint during builds since we're using Biome
eslint: {
ignoreDuringBuilds: true
},
// Disable TypeScript type checking during builds
typescript: {
ignoreBuildErrors: true
},
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
silenceDeprecations: ['legacy-js-api']
},
experimental: {
serverActions: {
bodySizeLimit: '2mb'
}
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
2025-04-02 02:58:24 +08:00
value: createCspHeader(false)
}
]
},
{
source: '/embed/:path*',
headers: [
{
key: 'Content-Security-Policy',
2025-04-02 02:58:24 +08:00
value: createCspHeader(true)
}
]
}
];
}
};
2025-04-09 23:17:08 +08:00
// export default withBundleAnalyzer({
// enabled: process.env.ANALYZE === 'true'
// })(nextConfig);
2025-03-08 07:02:56 +08:00
export default nextConfig;