Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

build: Enable static generation on preview (#45592)

Jeremias Menichelli5065e3ae9f0a
diff --git a/apps/docs/app/guides/ai/[[...slug]]/page.tsx b/apps/docs/app/guides/ai/[[...slug]]/page.tsx
index f517756dd71..c17bd51fb12 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 f68aadb62e4..1ec826244b8 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 49c670824a4..f4c062505be 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 e77e622d824..3c40eef45c9 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 8b6622d22fc..124f0b315a9 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 ddce4af8b82..aa0e0fd0c15 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 7b8be32adcc..0b15eb80b1f 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 c97957170c2..07c76c8da40 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 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 { getEmptyArray } from '~/features/helpers.fn'
+import { IS_DEV } from '~/lib/constants'
import { isValidGuideFrontmatter } from '~/lib/docs'
-import { UrlTransformFunction, linkTransform } from '~/lib/mdx/plugins/rehypeLinkTransform'
+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 {
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 e416a7b17ae..416735e703c 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 52e9425c92f..a3c33a9a546 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 5368816194c..eb0c01b48f5 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 819c1e0bfd7..cc02780dc73 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 4166055f268..81dcba599a6 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<Params> }) =>
return <GuideTemplate {...data!} />
}
-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 7ca75717816..dce62f3cf79 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 991c81c189b..fa3852979b4 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 c65eb2ae994..8b9f7bbbce4 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 c4ef4796b42..d32333d1b97 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 4a62d58281d..ce65389dc74 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 39f7d03b452..9d17d547ad6 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 67ad5d42301..6f01587f27f 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<Params> }) => {
return <GuideTemplate {...data!} />
}
-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 26be534bde8..0aa9feceb0d 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<Param
return <GuideTemplate {...data!} />
}
-const generateStaticParams = IS_PROD ? genGuidesStaticParams('telemetry') : getEmptyArray
+const generateStaticParams = !IS_DEV ? genGuidesStaticParams('telemetry') : getEmptyArray
const generateMetadata = genGuideMeta((params: { slug?: string[] }) =>
getGuidesMarkdown(['telemetry', ...(params.slug ?? [])])
)