- Add Briefcase and Package icons
- Update mobile-tab-bar.test.tsx to use data-testid selector
- Fix ESLint errors in mobile-tab-bar.test.tsx
- Test pass rate now at 97.3% (1462/1502)
- Add TrendingUp, Code, Cloud, BarChart3 icons for products-section
- Add Send, HeadphonesIcon, Building2 icons for other sections
- Update services-section.test.tsx to use data-testid selector
- Fix ESLint errors in services-section.test.tsx
- Test pass rate now at 96.3% (1446/1502)
- Add Calendar icon mock for insight-card component
- Add CheckCircle2 icon mock for toast component
- Add Quote icon mock for testimonial-card component
- Update toast.test.tsx to use data-testid selector instead of svg
This fixes 65 failing tests and brings test pass rate from 89.8% to 94.3%
Problem:
- Turbopack file tracing caused by process.cwd() in upload.ts
- Google fonts download failures in CI network environment
- Module resolution errors for @vercel/turbopack-next
Solutions:
- Add turbopackIgnore comment to process.cwd() call
- Temporarily disable Google fonts to avoid network dependencies
- Use system fonts as fallback for CI builds
- Switch to node:20-alpine for faster SSH installation
- Add SSH debugging information
This should resolve the 493 build errors and enable successful CI deployment.
The real root cause of CI build failures was NOT Turbopack, but
Resend initialization at module level without API key.
Problem:
- Resend was initialized at module level: const resend = new Resend(process.env.RESEND_API_KEY)
- During build, Next.js collects page data and imports all modules
- If RESEND_API_KEY is not set, Resend throws error: 'Missing API key'
- This caused build to fail with 'Failed to collect page data for /api/contact'
Solution:
- Implement lazy initialization pattern for Resend
- Only initialize Resend when actually needed (when sending emails)
- Add proper error handling if API key is missing
Changes:
- src/app/api/contact/route.ts: Add getResend() function with lazy init
- src/app/(marketing)/contact/actions.ts: Add getResend() function with lazy init
This allows the build to succeed even without RESEND_API_KEY in CI,
while still requiring it at runtime when actually sending emails.
Extract all path.join operations into dedicated functions to prevent
Turbopack from tracing dynamic paths.
Changes:
- Add buildUploadPath() function
- Add buildFilePath() function
- Replace direct path.join calls with function calls
- Remove unused uploadBaseDir variable
Results:
- Turbopack warnings: 4 → 2
- Build time: 14.3s → 7.5s
- Build succeeds without hanging
This prevents Turbopack from creating overly broad file patterns
that match the entire project directory.
The Turbopack build was matching 29409+ files due to dynamic path
resolution in upload.ts. This caused the CI build to hang.
Root cause: Turbopack traces process.cwd() and creates overly broad
file patterns, leading to performance issues.
Solution: Extract process.cwd() into a separate function to prevent
Turbopack from tracing the entire project directory.
This fix reduces build time and prevents CI timeout issues.
- Move CI/CD configs to config/ci/ directory
- Reorganize scripts into categorized directories (deployment, monitoring, testing, utils)
- Consolidate documentation into docs/ directory with proper structure
- Update linting and testing configurations
- Remove obsolete test reports and performance summaries
- Add new documentation for code quality tools and contact form security
- Improve project organization and maintainability
- Fix lint-staged config to only lint JS/TS files
- Disable react/react-in-jsx-scope rule for Next.js compatibility
- Ignore scripts and test config directories in ESLint