Skip to content

Commit c9f9e41

Browse files
committed
chore: update dependencies and improve locale handling
Signed-off-by: Rid <rid@cylo.io>
1 parent 3f1b4cf commit c9f9e41

File tree

14 files changed

+801
-916
lines changed

14 files changed

+801
-916
lines changed

apps/web/package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,41 +39,43 @@
3939
"contentlayer2": "^0.5.8",
4040
"date-fns": "^4.1.0",
4141
"deepmerge": "^4.3.1",
42-
"feed": "^4.2.2",
42+
"feed": "^5.1.0",
4343
"framer-motion": "^12.23.25",
4444
"geist": "^1.5.1",
45-
"lucide-react": "0.487.0",
45+
"lucide-react": "0.556.0",
4646
"markdown-wasm": "^1.2.0",
4747
"mdx-bundler": "^10.1.1",
4848
"motion": "^12.23.25",
49-
"next": "15.2.4",
49+
"next": "^16",
5050
"next-contentlayer2": "^0.5.8",
51-
"next-intl": "4.0.2",
51+
"next-intl": "4.5.8",
5252
"next-themes": "^0.4.6",
5353
"normalize-path": "^3.0.0",
5454
"posthog-js": "^1.302.2",
5555
"react": "^19.2.1",
5656
"react-dom": "^19.2.1",
57-
"react-intersection-observer": "^9.16.0",
57+
"react-intersection-observer": "^10.0.0",
5858
"react-wrap-balancer": "^1.1.1",
5959
"simplex-noise": "^4.0.3",
6060
"tailwind-merge": "^3.4.0",
6161
"tailwindcss-animate": "^1.0.7"
6262
},
6363
"devDependencies": {
6464
"@babel/core": "^7.28.5",
65-
"@eslint/compat": "^1.4.1",
65+
"@eslint/compat": "^2.0.0",
6666
"@ianvs/prettier-plugin-sort-imports": "^4.7.0",
6767
"@tanstack/react-query-devtools": "^5.91.1",
68-
"@types/node": "^22.19.1",
68+
"@typescript-eslint/eslint-plugin": "^8.33.0",
69+
"@typescript-eslint/parser": "^8.33.0",
70+
"@types/node": "^24.10.1",
6971
"@types/normalize-path": "^3.0.2",
70-
"@types/react": "19.1.0",
71-
"@types/react-dom": "19.1.1",
72+
"@types/react": "19.2.7",
73+
"@types/react-dom": "19.2.3",
7274
"autoprefixer": "^10.4.22",
7375
"concurrently": "^9.2.1",
74-
"esbuild": "^0.25.12",
76+
"esbuild": "^0.27.1",
7577
"eslint": "^9.39.1",
76-
"eslint-config-next": "^15.5.7",
78+
"eslint-config-next": "^15.3.3",
7779
"eslint-config-prettier": "^10.1.8",
7880
"eslint-plugin-prettier": "^5.5.4",
7981
"mdast-util-toc": "^7.1.0",

apps/web/src/app/[locale]/blog/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ import type { LocaleOptions } from "@/lib/opendocs/types/i18n"
44
interface BlogLayoutProps {
55
children: React.ReactNode
66
params: Promise<{
7-
locale: LocaleOptions
7+
locale: string
88
}>
99
}
1010

1111
export const dynamicParams = true
1212

1313
export default async function BlogLayout(props: BlogLayoutProps) {
1414
const params = await props.params
15+
const locale = params.locale as LocaleOptions
1516

1617
const { children } = props
1718

18-
setRequestLocale(params.locale)
19+
setRequestLocale(locale)
1920

2021
return (
2122
<div className="max-w-container container mx-auto px-4 pt-6 sm:px-6 lg:px-8">

apps/web/src/app/[locale]/blog/og/[slug]/route.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { ImageResponse } from "next/og"
33
import { allBlogs, type Blog } from "contentlayer/generated"
44
import { siteConfig } from "@/config/site"
5-
import { getFonts } from "@/lib/fonts"
5+
import { getFonts } from "@/lib/og-fonts"
66
import type { LocaleOptions } from "@/lib/opendocs/types/i18n"
77
import { truncateText } from "@/lib/utils"
88

@@ -20,13 +20,11 @@ function safeAbsoluteUrl(path: string) {
2020

2121
export async function GET(
2222
request: Request,
23-
{ params }: { params: Promise<{ slug: string; locale: LocaleOptions }> }
23+
{ params }: { params: Promise<{ slug: string; locale: string }> }
2424
) {
2525
const resolvedParams = await params
26-
const post = getBlogPostBySlugAndLocale(
27-
resolvedParams.slug,
28-
resolvedParams.locale
29-
)
26+
const locale = resolvedParams.locale as LocaleOptions
27+
const post = getBlogPostBySlugAndLocale(resolvedParams.slug, locale)
3028

3129
if (!post) {
3230
return new ImageResponse(<Fallback src="/og.jpg" />, {

apps/web/src/app/[locale]/docs/layout.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ import { getServerDocsConfig } from "@/lib/opendocs/utils/get-server-docs-config
77
interface DocsLayoutProps {
88
children: React.ReactNode
99
params: Promise<{
10-
locale: LocaleOptions
10+
locale: string
1111
}>
1212
}
1313

1414
export const dynamicParams = true
1515

1616
export default async function DocsLayout(props: DocsLayoutProps) {
1717
const params = await props.params
18+
const locale = params.locale as LocaleOptions
1819

1920
const { children } = props
2021

21-
setRequestLocale(params.locale)
22+
setRequestLocale(locale)
2223

23-
const docsConfig = await getServerDocsConfig({ locale: params.locale })
24+
const docsConfig = await getServerDocsConfig({ locale })
2425

2526
return (
2627
<div className="border-b">

apps/web/src/app/[locale]/feed/[feed]/route.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const provideWebsiteFeeds = cache(
9494
)
9595

9696
type StaticParams = {
97-
params: Promise<{ feed: RSSFeed["file"]; locale: LocaleOptions }>
97+
params: Promise<{ feed: string; locale: string }>
9898
}
9999

100100
export const generateStaticParams = async (): Promise<
@@ -109,12 +109,14 @@ export const generateStaticParams = async (): Promise<
109109

110110
export const GET = async (_: Request, props: StaticParams) => {
111111
const params = await props.params
112+
const locale = (params.locale || routing.defaultLocale) as LocaleOptions
113+
const feedFile = params.feed as RSSFeed["file"]
112114
const websiteFeed = provideWebsiteFeeds({
113-
feed: params.feed,
114-
locale: params.locale || routing.defaultLocale
115+
feed: feedFile,
116+
locale
115117
})
116118

117-
const feed = blogConfig.rss.find((rss) => rss.file === params.feed)
119+
const feed = blogConfig.rss.find((rss) => rss.file === feedFile)
118120

119121
const contentType = String(
120122
feed?.contentType || blogConfig.rss?.[0]?.contentType

apps/web/src/app/[locale]/layout.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@ import "@/styles/custom-styles.css"
2020
interface AppLayoutProps {
2121
children: React.ReactNode
2222
params: Promise<{
23-
locale: LocaleOptions
23+
locale: string
2424
}>
2525
}
2626

2727
export async function generateMetadata(props: {
28-
params: Promise<{ locale: LocaleOptions }>
28+
params: Promise<{ locale: string }>
2929
}): Promise<Metadata> {
3030
const params = await props.params
31+
const locale = params.locale as LocaleOptions
3132

3233
return {
3334
metadataBase: new URL(siteConfig.url || "https://www.appbox.co"),
@@ -41,7 +42,7 @@ export async function generateMetadata(props: {
4142
template: `%s - ${siteConfig.name}`
4243
},
4344

44-
description: getObjectValueByLocale(siteConfig.description, params.locale),
45+
description: getObjectValueByLocale(siteConfig.description, locale),
4546

4647
keywords: [
4748
"Docs",
@@ -65,10 +66,7 @@ export async function generateMetadata(props: {
6566
title: siteConfig.name,
6667
siteName: siteConfig.name,
6768

68-
description: getObjectValueByLocale(
69-
siteConfig.description,
70-
params.locale
71-
),
69+
description: getObjectValueByLocale(siteConfig.description, locale),
7270

7371
images: [
7472
{

apps/web/src/app/[locale]/policies/layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,18 @@ import type { LocaleOptions } from "@/lib/opendocs/types/i18n"
44
interface PoliciesLayoutProps {
55
children: React.ReactNode
66
params: Promise<{
7-
locale: LocaleOptions
7+
locale: string
88
}>
99
}
1010

1111
export const dynamicParams = true
1212

1313
export default async function PoliciesLayout(props: PoliciesLayoutProps) {
1414
const params = await props.params
15+
const locale = params.locale as LocaleOptions
1516
const { children } = props
1617

17-
setRequestLocale(params.locale)
18+
setRequestLocale(locale)
1819

1920
return (
2021
<div className="border-b">

apps/web/src/components/docs/mdx-components/img.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export const img = ({
99
height,
1010
...props
1111
}: React.ImgHTMLAttributes<HTMLImageElement>) => {
12-
// Return null or a placeholder if src is undefined
13-
if (!src) return null
12+
// Return null or a placeholder if src is undefined or is a Blob
13+
if (!src || typeof src !== "string") return null
1414

1515
// Convert width/height to numbers if they exist
1616
const widthNum = width ? Number(width) : undefined

apps/web/src/components/faq-section.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,22 @@ import {
1010
AccordionTrigger
1111
} from "@/components/ui/accordion-plus"
1212

13+
const questions = [
14+
"payment_methods",
15+
"deployment_time",
16+
"server_location",
17+
"root_access",
18+
"security",
19+
"data_access",
20+
"additional_software",
21+
"fuse_rclone",
22+
"refund_policy",
23+
"custom_domain",
24+
"upgrade_after_purchase",
25+
"resource_multipliers",
26+
"excluded_app_categories"
27+
]
28+
1329
export function FAQSection({
1430
title,
1531
description,
@@ -24,22 +40,6 @@ export function FAQSection({
2440
const searchParams = useSearchParams()
2541
const router = useRouter()
2642

27-
const questions = [
28-
"payment_methods",
29-
"deployment_time",
30-
"server_location",
31-
"root_access",
32-
"security",
33-
"data_access",
34-
"additional_software",
35-
"fuse_rclone",
36-
"refund_policy",
37-
"custom_domain",
38-
"upgrade_after_purchase",
39-
"resource_multipliers",
40-
"excluded_app_categories"
41-
]
42-
4343
useEffect(() => {
4444
// Check if there's a faq query parameter
4545
const faqParam = searchParams.get("faq")
@@ -59,7 +59,7 @@ export function FAQSection({
5959
const newUrl = `${window.location.pathname}${newSearchParams.toString() ? `?${newSearchParams.toString()}` : ""}#faq`
6060
router.replace(newUrl)
6161
}
62-
}, [searchParams, questions, router])
62+
}, [searchParams, router])
6363

6464
return (
6565
<section id={id} className="scroll-mt-16 py-16">

apps/web/src/lib/fonts.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,3 @@ export const fontMono = FontMono({
77
subsets: ["latin"],
88
variable: "--font-mono"
99
})
10-
11-
export async function getFonts() {
12-
const [bold, regular] = await Promise.all([
13-
fetch(
14-
new URL(
15-
"/fonts/Geist-Bold.ttf",
16-
process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"
17-
)
18-
).then((res) => res.arrayBuffer()),
19-
20-
fetch(
21-
new URL(
22-
"/fonts/Geist-Regular.ttf",
23-
process.env.NEXT_PUBLIC_APP_URL || "http://localhost:3000"
24-
)
25-
).then((res) => res.arrayBuffer())
26-
])
27-
28-
return {
29-
bold,
30-
regular
31-
}
32-
}

0 commit comments

Comments
 (0)