chore: wire Carplace into dev and production stacks
Build & Deploy / Build & Push Docker Image (push) Successful in 2m55s
Test / Type Check (all packages) (push) Successful in 54s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Failing after 48s
Test / Homepage Unit Tests (push) Successful in 43s
Test / Storefront Unit Tests (push) Failing after 40s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Failing after 42s
Test / API Integration Tests (push) Successful in 1m0s

This commit is contained in:
root
2026-07-02 18:15:42 -04:00
parent ad5f5ebab7
commit 7ff2dbb139
214 changed files with 5258 additions and 5906 deletions
+37
View File
@@ -0,0 +1,37 @@
/** @type {import('next').NextConfig} */
const { buildSecurityHeaders, normalizeAssetPrefix } = require('../../config/nextSecurityHeaders')
const CARPLACE_ASSET_PREFIX = '/carplace'
const carplaceAssetPrefix = normalizeAssetPrefix(
process.env.CARPLACE_ASSET_PREFIX ?? (process.env.NODE_ENV === 'production' ? CARPLACE_ASSET_PREFIX : undefined),
CARPLACE_ASSET_PREFIX,
)
const securityHeaders = buildSecurityHeaders({ assetSources: [carplaceAssetPrefix] })
const nextConfig = {
...(carplaceAssetPrefix ? { assetPrefix: carplaceAssetPrefix } : {}),
images: {
remotePatterns: [{ protocol: 'https', hostname: 'res.cloudinary.com' }],
},
transpilePackages: ['@rentaldrivego/types'],
async headers() {
return [{ source: '/:path*', headers: securityHeaders }]
},
async rewrites() {
const apiOrigin = (process.env.API_INTERNAL_URL ?? process.env.API_URL ?? 'http://api:4000').replace(/\/api\/v1\/?$/, '')
return {
beforeFiles: [
{ source: '/carplace/api/:path*', destination: `${apiOrigin}/api/:path*` },
],
afterFiles: [
{ source: '/carplace', destination: '/' },
{ source: '/carplace/:path*', destination: '/:path*' },
],
fallback: [],
}
},
}
module.exports = nextConfig