Files
twenty/packages/twenty-website-redone/next.config.ts
T
Abdullah. 0f4cb2c2c2 [Website] Full-bleed hero/testimonials, nav restructure, OpenNext deploy config (#21794)
### Full-bleed backgrounds on wide screens

Decorative section backgrounds were capped at the 1512px content width,
leaving large empty gutters on ultra-wide viewports.
- Added an opt-in `fullBleedBackground` prop to `SectionShell` that
lifts the background layer off the content-width cap (default unchanged,
so every other section is untouched).
- Applied it to `HomeHero` (bridge halftone field) and both testimonials
sections.
- Capped the `NotchedCardShape` notch at its width at the content cap,
so the white/dark card can span the full viewport while the notch stays
fixed and centered. The footer and any other capped card are unaffected.

<img width="3024" height="1718" alt="image"
src="https://github.com/user-attachments/assets/a2200677-58af-4740-9257-77f6385ade28"
/>

<img width="3024" height="1224" alt="image"
src="https://github.com/user-attachments/assets/73aa6745-b766-405e-b736-8c0c7591232e"
/>

### Navigation restructure
- Removed **Product** from the menu and footer nav, and promoted **Why**
out of the Resources dropdown to a top-level item in Product's place.
(The Product page itself is unchanged).
- Resources dropdown polish: tightened the preview frame height now that
the list is shorter; restored the cleaner/brighter User Guide and
Developers preview assets from `twenty-website`; gave User Guide a
center + 2× image scale so its halftone fills the frame like Developers,
and raised `NextImage` `sizes` to keep the fine halftone crisp through
that magnification.
- Restored the **current-page highlight** in the Resources dropdown
(active icon/label in highlight blue + marker bar), matching the old
`NavDropdown`.

<p>
<img width="1509" height="323" alt="image"
src="https://github.com/user-attachments/assets/d5702761-31f5-4b4d-9fcc-c33d5c7ae6ab"
/>
</p>

### OpenNext / Cloudflare deployment config
Ported the Cloudflare Workers deployment setup from `twenty-website` so
the same CI/deploy pipeline works against the redone package:
- `open-next.config.ts` (R2 incremental cache + regional cache + skew
protection), `wrangler.jsonc` (dev/prod envs — **worker names, routes,
R2 buckets kept identical** for a seamless cutover),
`initOpenNextCloudflareForDev()` in `next.config.ts`, the
`preview`/`deploy:*`/`cf-typegen` scripts, the `@opennextjs/cloudflare`
+ `wrangler` devDependencies, a `.dev.vars.example` template, and the
relevant `.gitignore` entries.
2026-06-18 19:29:21 +05:00

56 lines
1.9 KiB
TypeScript

import path from 'path';
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
import withLinaria, { type LinariaConfig } from 'next-with-linaria';
import { localeToUrlSegment } from './src/platform/i18n/locale-to-url-segment';
import { buildLocaleRewrites } from './src/platform/routing/locale-rewrite-patterns';
import { WEBSITE_LOCALE_LIST } from './src/platform/i18n/website-locale-list';
// Bundler decision: Next 16 defaults dev and build to Turbopack, and
// next-with-linaria@1.3 branches on process.env.TURBOPACK to apply its
// Turbopack loader config — the same combination the original twenty-website
// already runs in dev. Webpack stays available behind `next dev --webpack`
// as the escape hatch if a wyw-in-js edge case surfaces.
const DEPLOYED_LOCALE_URL_SEGMENTS =
WEBSITE_LOCALE_LIST.map(localeToUrlSegment);
const nextConfig: LinariaConfig = {
reactCompiler: true,
linaria: {
configFile: path.resolve(__dirname, 'wyw-in-js.config.cjs'),
},
experimental: {
swcPlugins: [
[
'@lingui/swc-plugin',
{
runtimeModules: {
i18n: ['@lingui/core', 'i18n'],
trans: ['@lingui/react', 'Trans'],
},
},
],
],
},
// Clean public URLs: the source locale is unprefixed, other locales get a
// short segment. Rewrites map unprefixed paths onto the internal /[locale]
// tree; redirects canonicalize away explicit source-locale prefixes.
async rewrites() {
return {
beforeFiles: buildLocaleRewrites(DEPLOYED_LOCALE_URL_SEGMENTS),
};
},
async redirects() {
return [
{ source: '/en', destination: '/', statusCode: 301 },
{ source: '/en/:path*', destination: '/:path*', statusCode: 301 },
];
},
};
export default withLinaria(nextConfig);
// Binds the Cloudflare dev context (R2 incremental cache, env vars) into
// `next dev` so local runs mirror the deployed OpenNext worker.
initOpenNextCloudflareForDev();