Sentry Integration (補強 SignOz): - Add @sentry/nextjs for frontend error tracking + session replay - Add sentry-sdk[fastapi] for backend error tracking - Create sentry.client/server/edge.config.ts - Integrate with next.config.js + instrumentation.ts - Add Sentry exception capture in FastAPI error handler - Create deployment scripts for Self-Hosted @ 192.168.0.110 CI/CD Fixes: - Fix F821 Undefined name 'Field' in incidents.py - Add NEXT_PUBLIC_API_URL env var to CI build step - Add build-arg to Docker build verification E2E Test Improvements: - Fix strict mode violations in dashboard-acceptance tests - Add timeout increase for Phase 4 demo tests - Make tests more resilient to UI variations Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
38 lines
1.2 KiB
JavaScript
38 lines
1.2 KiB
JavaScript
const { withSentryConfig } = require('@sentry/nextjs')
|
||
const createNextIntlPlugin = require('next-intl/plugin')
|
||
|
||
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts')
|
||
|
||
/** @type {import('next').NextConfig} */
|
||
const nextConfig = {
|
||
reactStrictMode: true,
|
||
transpilePackages: ['@awoooi/lewooogo-core'],
|
||
output: 'standalone',
|
||
experimental: {
|
||
typedRoutes: true,
|
||
},
|
||
// CI/CD: ESLint 在獨立 lint job 執行,build 時跳過
|
||
eslint: {
|
||
ignoreDuringBuilds: true,
|
||
},
|
||
// CI/CD: TypeScript 錯誤在獨立 type-check job 處理
|
||
typescript: {
|
||
ignoreBuildErrors: true,
|
||
},
|
||
}
|
||
|
||
// Sentry 配置 (Self-Hosted @ 192.168.0.110)
|
||
const sentryWebpackPluginOptions = {
|
||
// 只在有 AUTH_TOKEN 時上傳 source maps
|
||
silent: true,
|
||
// 組織與專案 (Self-Hosted 設定)
|
||
org: process.env.SENTRY_ORG || 'awoooi',
|
||
project: process.env.SENTRY_PROJECT || 'awoooi-web',
|
||
// 禁用自動 source map 上傳 (Self-Hosted 需手動配置)
|
||
disableServerWebpackPlugin: !process.env.SENTRY_AUTH_TOKEN,
|
||
disableClientWebpackPlugin: !process.env.SENTRY_AUTH_TOKEN,
|
||
}
|
||
|
||
// 組合: next-intl → sentry
|
||
module.exports = withSentryConfig(withNextIntl(nextConfig), sentryWebpackPluginOptions)
|