Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 19 additions & 25 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
directories:
- "/"
- "/apps/*"
- "/packages/*"
- "/qa/tests/playwright"
target-branch: "main"
schedule:
interval: "weekly"
interval: "monthly"
allow:
- dependency-type: "direct"
# Skip regular update PRs, do only security updates
# https://docs.github.com/en/code-security/reference/supply-chain-security/dependabot-options-reference#open-pull-requests-limit-
open-pull-requests-limit: 0

- package-ecosystem: "npm"
directory: "/apps/ui"
schedule:
interval: "weekly"
allow:
- dependency-type: "direct"
open-pull-requests-limit: 0

- package-ecosystem: "npm"
directory: "/apps/strapi"
schedule:
interval: "weekly"
allow:
- dependency-type: "direct"
open-pull-requests-limit: 0
- dependency-name: "@strapi/*"
update-types:
- "version-update:semver-minor"
- "version-update:semver-patch"
groups:
strapi:
patterns:
- "@strapi/*"
group-by: "dependency-name"
update-types:
- "minor"
- "patch"
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- dev
- staging

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion apps/strapi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@strapi/plugin-color-picker": "5.52.2",
"@strapi/plugin-sentry": "5.52.2",
"@strapi/plugin-users-permissions": "5.52.2",
"@strapi/strapi": "5.52.2",
"@strapi/strapi": "catalog:",
"@strapi/utils": "5.52.2",
"jsonwebtoken": "9.0.3",
"lodash": "catalog:",
Expand Down
8 changes: 6 additions & 2 deletions apps/ui/src/app/[locale]/[[...rest]]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import type { Locale } from "next-intl"
import { use } from "react"

import { StrapiPageView } from "@/components/layouts/StrapiPageView"
import { createFallbackPath, debugStaticParams } from "@/lib/build"
import {
createFallbackPath,
debugStaticParams,
withExportFallback,
} from "@/lib/build"
import { isDevelopment } from "@/lib/general-helpers"
import { getMetadataFromStrapi } from "@/lib/metadata"
import { fetchAllPages } from "@/lib/strapi-api/content/server"
Expand Down Expand Up @@ -49,7 +53,7 @@ export async function generateStaticParams({
rest: ["fallback"],
})

return params.length > 0 ? params : [fallbackPath]
return withExportFallback(params, fallbackPath)
}

export async function generateMetadata(
Expand Down
8 changes: 6 additions & 2 deletions apps/ui/src/app/[locale]/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import type { Locale } from "next-intl"
import { use } from "react"

import { StrapiBlogPostView } from "@/components/layouts/StrapiBlogPostView"
import { createFallbackPath, debugStaticParams } from "@/lib/build"
import {
createFallbackPath,
debugStaticParams,
withExportFallback,
} from "@/lib/build"
import { isDevelopment } from "@/lib/general-helpers"
import { getBlogPostMetadata } from "@/lib/metadata"
import { fetchAllBlogPosts } from "@/lib/strapi-api/content/server"
Expand Down Expand Up @@ -36,7 +40,7 @@ export async function generateStaticParams({
slug: "fallback",
})

return params.length > 0 ? params : [fallbackPath]
return withExportFallback(params, fallbackPath)
}

export async function generateMetadata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import type { Locale } from "next-intl"
import { use } from "react"

import { CmsComparisonView } from "@/components/cms-comparison/CmsComparisonView"
import { createFallbackPath, debugStaticParams } from "@/lib/build"
import {
createFallbackPath,
debugStaticParams,
withExportFallback,
} from "@/lib/build"
import { isDevelopment } from "@/lib/general-helpers"
import { getCmsComparisonMetadata } from "@/lib/metadata"
import { fetchAllCmsComparisons } from "@/lib/strapi-api/content/server"
Expand Down Expand Up @@ -38,7 +42,7 @@ export async function generateStaticParams({
slug: "fallback",
})

return params.length > 0 ? params : [fallbackPath]
return withExportFallback(params, fallbackPath)
}

export async function generateMetadata(
Expand Down
8 changes: 6 additions & 2 deletions apps/ui/src/app/[locale]/user-stories/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import type { Locale } from "next-intl"

import { CaseStudyView } from "@/components/case-study/CaseStudyView"
import { createFallbackPath, debugStaticParams } from "@/lib/build"
import {
createFallbackPath,
debugStaticParams,
withExportFallback,
} from "@/lib/build"
import { isDevelopment } from "@/lib/general-helpers"
import { getCaseStudyMetadata } from "@/lib/metadata"
import { fetchAllCaseStudies } from "@/lib/strapi-api/content/server"
Expand Down Expand Up @@ -37,7 +41,7 @@ export async function generateStaticParams({
slug: "fallback",
})

return params.length > 0 ? params : [fallbackPath]
return withExportFallback(params, fallbackPath)
}

interface RouteProps {
Expand Down
28 changes: 21 additions & 7 deletions apps/ui/src/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,25 @@ export const debugStaticParams = (
* @example createFallbackPath("en", { slug: 'fallback', page: 'fallback' }) => {locale: "en", slug: "fallback", page: "fallback"}
* @example createFallbackPath("en", { rest: ['fallback'] }) => {locale: "en", rest: ["fallback"]}
*/
export const createFallbackPath = (
export function createFallbackPath<T extends Record<string, string | string[]>>(
locale: Locale,
params: Record<string, string | string[]>
) => ({
locale,
rest: [], // to satisfy type checking for [[...rest]], but can be overridden via `params`
...params,
})
params: T
): { locale: Locale } & T {
return {
locale,
...params,
}
}

/**
* Static export builds need at least one param for a dynamic segment.
* Standalone builds should stay empty when Strapi returned no entries, so CI
* does not prerender a dummy path against a stopped Strapi.
*/
export function withExportFallback<T>(entries: T[], fallback: T): T[] {
if (entries.length > 0) return entries

if (getEnvVar("NEXT_OUTPUT") === "export") return [fallback]

return []
}
2 changes: 1 addition & 1 deletion packages/strapi-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"sync-types": "if [ -L ./generated ]; then echo 'generated is symlinked; skipping sync'; else mkdir -p ./generated && cp -R ../../apps/strapi/types/generated/. ./generated; fi"
},
"devDependencies": {
"@strapi/strapi": "5.52.2"
"@strapi/strapi": "catalog:"
}
}
Loading
Loading