From 709d5a26029d9c17300a7d554fe8c07fb0041689 Mon Sep 17 00:00:00 2001 From: Jeremias Menichelli Date: Tue, 5 May 2026 16:21:36 +0200 Subject: [PATCH] build: Enable static generation on preview --- apps/docs/app/guides/ai/[[...slug]]/page.tsx | 8 +++---- apps/docs/app/guides/api/[[...slug]]/page.tsx | 8 +++---- .../docs/app/guides/auth/[[...slug]]/page.tsx | 8 +++---- .../docs/app/guides/cron/[[...slug]]/page.tsx | 8 +++---- .../app/guides/database/[[...slug]]/page.tsx | 8 +++---- .../extensions/wrappers/[[...slug]]/page.tsx | 23 +++++++++--------- .../guides/deployment/[[...slug]]/page.tsx | 8 +++---- .../deployment/terraform/[[...slug]]/page.tsx | 24 +++++++++---------- .../app/guides/functions/[[...slug]]/page.tsx | 8 +++---- .../getting-started/[[...slug]]/page.tsx | 8 +++---- .../app/guides/graphql/[[...slug]]/page.tsx | 15 ++++++------ .../guides/integrations/[[...slug]]/page.tsx | 8 +++---- .../local-development/[[...slug]]/page.tsx | 8 +++---- .../app/guides/platform/[[...slug]]/page.tsx | 8 +++---- .../app/guides/queues/[[...slug]]/page.tsx | 8 +++---- .../app/guides/realtime/[[...slug]]/page.tsx | 4 ++-- .../app/guides/resources/[[...slug]]/page.tsx | 8 +++---- .../app/guides/security/[[...slug]]/page.tsx | 8 +++---- .../guides/self-hosting/[[...slug]]/page.tsx | 8 +++---- .../app/guides/storage/[[...slug]]/page.tsx | 4 ++-- .../app/guides/telemetry/[[...slug]]/page.tsx | 8 +++---- 21 files changed, 99 insertions(+), 99 deletions(-) diff --git a/apps/docs/app/guides/ai/[[...slug]]/page.tsx b/apps/docs/app/guides/ai/[[...slug]]/page.tsx index f517756dd7..c17bd51fb1 100644 --- a/apps/docs/app/guides/ai/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/ai/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const AiGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('ai') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('ai') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['ai', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/api/[[...slug]]/page.tsx b/apps/docs/app/guides/api/[[...slug]]/page.tsx index f68aadb62e..1ec826244b 100644 --- a/apps/docs/app/guides/api/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/api/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const ApiGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('api') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('api') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['api', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/auth/[[...slug]]/page.tsx b/apps/docs/app/guides/auth/[[...slug]]/page.tsx index 49c670824a..f4c062505b 100644 --- a/apps/docs/app/guides/auth/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/auth/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const AuthGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('auth') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('auth') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['auth', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/cron/[[...slug]]/page.tsx b/apps/docs/app/guides/cron/[[...slug]]/page.tsx index e77e622d82..3c40eef45c 100644 --- a/apps/docs/app/guides/cron/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/cron/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const CronGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('cron') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('cron') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['cron', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/database/[[...slug]]/page.tsx b/apps/docs/app/guides/database/[[...slug]]/page.tsx index 8b6622d22f..124f0b315a 100644 --- a/apps/docs/app/guides/database/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/database/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const DatabaseGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('database') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('database') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['database', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx index ddce4af8b8..aa0e0fd0c1 100644 --- a/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/database/extensions/wrappers/[[...slug]]/page.tsx @@ -1,15 +1,5 @@ -import matter from 'gray-matter' -import Link from 'next/link' -import { notFound } from 'next/navigation' import { readFile } from 'node:fs/promises' import { join, relative } from 'node:path' -import rehypeSlug from 'rehype-slug' -import emoji from 'remark-emoji' -// End of third-party imports - -import { IS_PROD, isFeatureEnabled } from 'common' -import { Button } from 'ui' -import { Admonition } from 'ui-patterns' import { genGuideMeta, genGuidesStaticParams, @@ -17,6 +7,9 @@ import { } from '~/features/docs/GuidesMdx.utils' import { newEditLink } from '~/features/helpers.edit-link' import { Guide, GuideArticle, GuideFooter, GuideHeader, GuideMdxContent } from '~/features/ui/guide' +// End of third-party imports + +import { IS_DEV } from '~/lib/constants' import { GUIDES_DIRECTORY, isValidGuideFrontmatter } from '~/lib/docs' import { linkTransform, type UrlTransformFunction } from '~/lib/mdx/plugins/rehypeLinkTransform' import remarkMkDocsAdmonition from '~/lib/mdx/plugins/remarkAdmonition' @@ -24,6 +17,14 @@ import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle' import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs' import { getGitHubFileContents, octokit } from '~/lib/octokit' import type { SerializeOptions } from '~/types/next-mdx-remote-serialize' +import { isFeatureEnabled } from 'common' +import matter from 'gray-matter' +import Link from 'next/link' +import { notFound } from 'next/navigation' +import rehypeSlug from 'rehype-slug' +import emoji from 'remark-emoji' +import { Button } from 'ui' +import { Admonition } from 'ui-patterns' // We fetch these docs at build time from an external repo const org = 'supabase' @@ -424,7 +425,7 @@ const urlTransform: UrlTransformFunction = (url) => { } const generateStaticParams = async () => { - if (IS_PROD) { + if (!IS_DEV) { return [] } diff --git a/apps/docs/app/guides/deployment/[[...slug]]/page.tsx b/apps/docs/app/guides/deployment/[[...slug]]/page.tsx index 7b8be32adc..0b15eb80b1 100644 --- a/apps/docs/app/guides/deployment/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/deployment/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const DeploymentGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('deployment') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('deployment') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['deployment', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx b/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx index c97957170c..07c76c8da4 100644 --- a/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/deployment/terraform/[[...slug]]/page.tsx @@ -1,24 +1,24 @@ +import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' +import { genGuideMeta, removeRedundantH1 } from '~/features/docs/GuidesMdx.utils' +import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' +import { isValidGuideFrontmatter } from '~/lib/docs' +import { linkTransform, UrlTransformFunction } from '~/lib/mdx/plugins/rehypeLinkTransform' +import remarkMkDocsAdmonition from '~/lib/mdx/plugins/remarkAdmonition' +import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle' +import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs' +import { getGitHubFileContents } from '~/lib/octokit' +import { SerializeOptions } from '~/types/next-mdx-remote-serialize' import matter from 'gray-matter' import { notFound } from 'next/navigation' import rehypeSlug from 'rehype-slug' -import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' -import { genGuideMeta, removeRedundantH1 } from '~/features/docs/GuidesMdx.utils' -import { getGitHubFileContents } from '~/lib/octokit' -import { isValidGuideFrontmatter } from '~/lib/docs' -import { UrlTransformFunction, linkTransform } from '~/lib/mdx/plugins/rehypeLinkTransform' -import remarkMkDocsAdmonition from '~/lib/mdx/plugins/remarkAdmonition' -import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle' -import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs' import { terraformDocsBranch, terraformDocsDocsDir, terraformDocsOrg, terraformDocsRepo, } from '../terraformConstants' -import { SerializeOptions } from '~/types/next-mdx-remote-serialize' -import { IS_PROD } from 'common' -import { getEmptyArray } from '~/features/helpers.fn' // Each external docs page is mapped to a local page const pageMap = [ @@ -143,7 +143,7 @@ const getContent = async ({ slug }: Params) => { } } -const generateStaticParams = IS_PROD +const generateStaticParams = !IS_DEV ? async () => pageMap.map(({ slug }) => ({ slug: slug ? [slug] : [] })) : getEmptyArray const generateMetadata = genGuideMeta(getContent) diff --git a/apps/docs/app/guides/functions/[[...slug]]/page.tsx b/apps/docs/app/guides/functions/[[...slug]]/page.tsx index e416a7b17a..416735e703 100644 --- a/apps/docs/app/guides/functions/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/functions/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const FunctionsGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('functions') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('functions') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['functions', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/getting-started/[[...slug]]/page.tsx b/apps/docs/app/guides/getting-started/[[...slug]]/page.tsx index 52e9425c92..a3c33a9a54 100644 --- a/apps/docs/app/guides/getting-started/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/getting-started/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const GettingStartedGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('getting-started') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('getting-started') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['getting-started', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/graphql/[[...slug]]/page.tsx b/apps/docs/app/guides/graphql/[[...slug]]/page.tsx index 5368816194..eb0c01b48f 100644 --- a/apps/docs/app/guides/graphql/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/graphql/[[...slug]]/page.tsx @@ -1,17 +1,16 @@ -import { notFound } from 'next/navigation' import { isAbsolute, relative } from 'path' -import rehypeSlug from 'rehype-slug' - import { GuideTemplate, newEditLink } from '~/features/docs/GuidesMdx.template' import { genGuideMeta } from '~/features/docs/GuidesMdx.utils' -import { getGitHubFileContents } from '~/lib/octokit' -import { UrlTransformFunction, linkTransform } from '~/lib/mdx/plugins/rehypeLinkTransform' +import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' +import { linkTransform, UrlTransformFunction } from '~/lib/mdx/plugins/rehypeLinkTransform' import remarkMkDocsAdmonition from '~/lib/mdx/plugins/remarkAdmonition' import { removeTitle } from '~/lib/mdx/plugins/remarkRemoveTitle' import remarkPyMdownTabs from '~/lib/mdx/plugins/remarkTabs' +import { getGitHubFileContents } from '~/lib/octokit' import { SerializeOptions } from '~/types/next-mdx-remote-serialize' -import { IS_PROD } from 'common' -import { getEmptyArray } from '~/features/helpers.fn' +import { notFound } from 'next/navigation' +import rehypeSlug from 'rehype-slug' // We fetch these docs at build time from an external repo const org = 'supabase' @@ -190,7 +189,7 @@ const urlTransform: UrlTransformFunction = (url) => { } } -const generateStaticParams = IS_PROD +const generateStaticParams = !IS_DEV ? async () => pageMap.map(({ slug }) => ({ slug: slug ? [slug] : [] })) : getEmptyArray const generateMetadata = genGuideMeta(getContent) diff --git a/apps/docs/app/guides/integrations/[[...slug]]/page.tsx b/apps/docs/app/guides/integrations/[[...slug]]/page.tsx index 819c1e0bfd..cc02780dc7 100644 --- a/apps/docs/app/guides/integrations/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/integrations/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const IntegrationsGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('integrations') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('integrations') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['integrations', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/local-development/[[...slug]]/page.tsx b/apps/docs/app/guides/local-development/[[...slug]]/page.tsx index 4166055f26..81dcba599a 100644 --- a/apps/docs/app/guides/local-development/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/local-development/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const LocalDevelopmentGuidePage = async (props: { params: Promise }) => return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('local-development') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('local-development') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['local-development', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/platform/[[...slug]]/page.tsx b/apps/docs/app/guides/platform/[[...slug]]/page.tsx index 7ca7571781..dce62f3cf7 100644 --- a/apps/docs/app/guides/platform/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/platform/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const PlatformGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('platform') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('platform') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['platform', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/queues/[[...slug]]/page.tsx b/apps/docs/app/guides/queues/[[...slug]]/page.tsx index 991c81c189..fa3852979b 100644 --- a/apps/docs/app/guides/queues/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/queues/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const QueuesGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('queues') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('queues') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['queues', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/realtime/[[...slug]]/page.tsx b/apps/docs/app/guides/realtime/[[...slug]]/page.tsx index c65eb2ae99..8b9f7bbbce 100644 --- a/apps/docs/app/guides/realtime/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/realtime/[[...slug]]/page.tsx @@ -1,4 +1,3 @@ -import { IS_PROD } from 'common' import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { genGuideMeta, @@ -6,6 +5,7 @@ import { getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const RealtimeGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('realtime') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('realtime') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['realtime', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/resources/[[...slug]]/page.tsx b/apps/docs/app/guides/resources/[[...slug]]/page.tsx index c4ef4796b4..d32333d1b9 100644 --- a/apps/docs/app/guides/resources/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/resources/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const ResourcesGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('resources') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('resources') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['resources', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/security/[[...slug]]/page.tsx b/apps/docs/app/guides/security/[[...slug]]/page.tsx index 4a62d58281..ce65389dc7 100644 --- a/apps/docs/app/guides/security/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/security/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const SecurityGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('security') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('security') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['security', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/self-hosting/[[...slug]]/page.tsx b/apps/docs/app/guides/self-hosting/[[...slug]]/page.tsx index 39f7d03b45..9d17d547ad 100644 --- a/apps/docs/app/guides/self-hosting/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/self-hosting/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const SelfHostingGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('self-hosting') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('self-hosting') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['self-hosting', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/storage/[[...slug]]/page.tsx b/apps/docs/app/guides/storage/[[...slug]]/page.tsx index 67ad5d4230..6f01587f27 100644 --- a/apps/docs/app/guides/storage/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/storage/[[...slug]]/page.tsx @@ -1,4 +1,3 @@ -import { IS_PROD } from 'common' import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { genGuideMeta, @@ -6,6 +5,7 @@ import { getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const StorageGuidePage = async (props: { params: Promise }) => { return } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('storage') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('storage') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['storage', ...(params.slug ?? [])]) ) diff --git a/apps/docs/app/guides/telemetry/[[...slug]]/page.tsx b/apps/docs/app/guides/telemetry/[[...slug]]/page.tsx index 26be534bde..0aa9feceb0 100644 --- a/apps/docs/app/guides/telemetry/[[...slug]]/page.tsx +++ b/apps/docs/app/guides/telemetry/[[...slug]]/page.tsx @@ -1,11 +1,11 @@ +import { GuideTemplate } from '~/features/docs/GuidesMdx.template' import { - getGuidesMarkdown, genGuideMeta, genGuidesStaticParams, + getGuidesMarkdown, } from '~/features/docs/GuidesMdx.utils' -import { GuideTemplate } from '~/features/docs/GuidesMdx.template' -import { IS_PROD } from 'common' import { getEmptyArray } from '~/features/helpers.fn' +import { IS_DEV } from '~/lib/constants' type Params = { slug?: string[] } @@ -17,7 +17,7 @@ const MonitoringTroubleshootingGuidePage = async (props: { params: Promise } -const generateStaticParams = IS_PROD ? genGuidesStaticParams('telemetry') : getEmptyArray +const generateStaticParams = !IS_DEV ? genGuidesStaticParams('telemetry') : getEmptyArray const generateMetadata = genGuideMeta((params: { slug?: string[] }) => getGuidesMarkdown(['telemetry', ...(params.slug ?? [])]) )