diff --git a/packages/twenty-website/project.json b/packages/twenty-website/project.json index ca84969c31..0fe0d98ad9 100644 --- a/packages/twenty-website/project.json +++ b/packages/twenty-website/project.json @@ -39,7 +39,7 @@ "executor": "nx:run-commands", "options": { "cwd": "{projectRoot}", - "command": "node scripts/check-conventions.mjs && npx oxlint -c .oxlintrc.json . && npx oxfmt --check ." + "command": "node scripts/check-partners-marketplace-routes.mjs && node scripts/check-conventions.mjs && npx oxlint -c .oxlintrc.json . && npx oxfmt --check ." }, "configurations": { "fix": { diff --git a/packages/twenty-website/scripts/check-partners-marketplace-routes.mjs b/packages/twenty-website/scripts/check-partners-marketplace-routes.mjs new file mode 100644 index 0000000000..9f4e44154d --- /dev/null +++ b/packages/twenty-website/scripts/check-partners-marketplace-routes.mjs @@ -0,0 +1,31 @@ +import fs from 'fs'; +import path from 'path'; +import { fileURLToPath } from 'url'; + +const root = path.join(path.dirname(fileURLToPath(import.meta.url)), '..'); +const routes = [ + 'src/app/[locale]/(site)/partners/list/page.tsx', + 'src/app/[locale]/(site)/partners/profile/[slug]/page.tsx', +]; + +const failures = []; + +for (const relativePath of routes) { + const fullPath = path.join(root, relativePath); + const source = fs.readFileSync(fullPath, 'utf8'); + if (!/export const dynamic = 'force-dynamic';/.test(source)) { + failures.push( + `${relativePath}: must export dynamic = 'force-dynamic' (OpenNext runtime fetch; build has no TWENTY_PARTNERS_API_KEY).`, + ); + } +} + +if (failures.length > 0) { + console.error('check-partners-marketplace-routes: FAILED'); + for (const failure of failures) { + console.error(` ${failure}`); + } + process.exit(1); +} + +console.log('check-partners-marketplace-routes: OK'); diff --git a/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx b/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx index 3c8471ab8b..cb84dd1eaf 100644 --- a/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx +++ b/packages/twenty-website/src/app/[locale]/(site)/partners/profile/[slug]/page.tsx @@ -14,6 +14,8 @@ import { Menu } from '@/sections/menu'; type PartnerProfileParams = { locale: string; slug: string }; +export const dynamic = 'force-dynamic'; + export const dynamicParams = true; export async function generateStaticParams(): Promise> {