Skip to content

Commit 557f0c7

Browse files
committed
Update biome to v2, zod to v4, all other deps as well
1 parent c8a1bdc commit 557f0c7

File tree

15 files changed

+1618
-1931
lines changed

15 files changed

+1618
-1931
lines changed

app/entry.server.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ export default async function handleRequest(
2222
const callbackName = isbot(request.headers.get("user-agent")) ? "onAllReady" : "onShellReady"
2323
const instance = createInstance()
2424
const lng = appContext.lang
25-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
26-
const ns = i18nextOpts.getRouteNamespaces(context as any)
25+
const ns = i18nextOpts.getRouteNamespaces(context)
2726

2827
await instance
2928
.use(initReactI18next) // Tell our instance to use react-i18next

app/env.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod"
1+
import { z } from "zod/v4"
22

33
const envSchema = z.object({
44
NODE_ENV: z.enum(["development", "production", "test"]).default("development"),
@@ -13,7 +13,7 @@ let env: ServerEnv
1313
* @returns Initialized env vars
1414
*/
1515
function initEnv() {
16-
// biome-ignore lint/nursery/noProcessEnv: This should be the only place to use process.env directly
16+
// biome-ignore lint/style/noProcessEnv: This should be the only place to use process.env directly
1717
const envData = envSchema.safeParse(process.env)
1818

1919
if (!envData.success) {

app/library/link/Link.browser.test.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { userEvent } from "@vitest/browser/context"
33
import { useLocation } from "react-router"
44
import type { StubRouteEntry } from "tests/setup.browser"
55
import { Link, type LinkProps } from "./link"
6+
67
const getEntries: (linkProps?: LinkProps) => StubRouteEntry[] = (linkProps) => [
78
{
89
path: "/first",

app/library/link/useEnhancedTo.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,15 @@ export const useEnhancedTo = ({
3131
language,
3232
to,
3333
keepSearchParams,
34-
}: { language?: Language; to: To; keepSearchParams?: boolean }) => {
34+
}: {
35+
language?: Language
36+
to: To
37+
keepSearchParams?: boolean
38+
}) => {
3539
const [params] = useSearchParams()
3640
const { lng, ...searchParams } = Object.fromEntries(params.entries())
3741
// allow language override for language switcher or manually setting the language in specific cases
38-
const lang = language ?? params.get("lng")
42+
const lang = language ?? lng
3943
const newSearchParams = new URLSearchParams(searchParams)
4044
const searchString = newSearchParams.toString()
4145
const hasSearchParams = searchString.length > 0

app/localization/resource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const languages = ["en", "bs"] as const
55
export const supportedLanguages = [...languages]
66
export type Language = (typeof languages)[number]
77

8-
type Resource = {
8+
export type Resource = {
99
common: typeof english
1010
}
1111

app/root.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useTranslation } from "react-i18next"
2-
import { Links, Meta, Outlet, Scripts, ScrollRestoration, isRouteErrorResponse, useRouteError } from "react-router"
32
import type { LinksFunction } from "react-router"
3+
import { isRouteErrorResponse, Links, Meta, Outlet, Scripts, ScrollRestoration, useRouteError } from "react-router"
44
import { useChangeLanguage } from "remix-i18next/react"
55
import type { Route } from "./+types/root"
66
import { LanguageSwitcher } from "./library/language-switcher"

app/routes/resource.locales.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
11
import { cacheHeader } from "pretty-cache-header"
2-
import { z } from "zod"
3-
import { resources } from "~/localization/resource"
2+
import { z } from "zod/v4"
3+
import { type Language, type Namespace, resources } from "~/localization/resource"
44
import type { Route } from "./+types/resource.locales"
55

66
export async function loader({ request, context }: Route.LoaderArgs) {
77
const { isProductionDeployment } = context
88
const url = new URL(request.url)
99

10-
const lng = z
11-
.string()
12-
.refine((lng): lng is keyof typeof resources => Object.keys(resources).includes(lng))
13-
.parse(url.searchParams.get("lng"))
10+
const lng = z.enum(Object.keys(resources) as Language[]).parse(url.searchParams.get("lng"))
1411

1512
const namespaces = resources[lng]
1613

17-
const ns = z
18-
.string()
19-
.refine((ns): ns is keyof typeof namespaces => {
20-
return Object.keys(resources[lng]).includes(ns)
21-
})
22-
.parse(url.searchParams.get("ns"))
14+
const ns = z.enum(Object.keys(resources[lng]) as Namespace[]).parse(url.searchParams.get("ns"))
2315

2416
const headers = new Headers()
2517

app/tailwind.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@import "tailwindcss";
2-
2+
/** biome-ignore lint/nursery/noUnknownAtRule: This is a rule for the Tailwind CSS file */
33
@theme {
44
/* Your theme styles go here */
55
--animate-float: float 3s ease-in-out infinite;

biome.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
33
"files": {
4-
"ignore": ["app/library/icon/**/*"]
4+
"includes": ["**", "!**/app/library/icon/**/*"]
55
},
66
"vcs": {
77
"enabled": true,
@@ -13,9 +13,7 @@
1313
"enabled": true,
1414
"lineWidth": 120
1515
},
16-
"organizeImports": {
17-
"enabled": true
18-
},
16+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
1917
"linter": {
2018
"enabled": true,
2119
"rules": {
@@ -25,7 +23,18 @@
2523
"noConsole": "error"
2624
},
2725
"style": {
28-
"recommended": true
26+
"recommended": true,
27+
"noParameterAssign": "error",
28+
"useAsConstAssertion": "error",
29+
"useDefaultParameterLast": "error",
30+
"useEnumInitializers": "error",
31+
"useSelfClosingElements": "error",
32+
"useSingleVarDeclarator": "error",
33+
"noUnusedTemplateLiteral": "error",
34+
"useNumberNamespace": "error",
35+
"noInferrableTypes": "error",
36+
"noUselessElse": "error",
37+
"noProcessEnv": "error"
2938
},
3039
"complexity": {
3140
"recommended": true
@@ -48,7 +57,6 @@
4857
},
4958
"nursery": {
5059
"recommended": true,
51-
"noProcessEnv": "error",
5260
"useSortedClasses": {
5361
"level": "error",
5462
"fix": "safe",

package.json

Lines changed: 51 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -27,68 +27,73 @@
2727
"postinstall": "pnpm run typegen"
2828
},
2929
"dependencies": {
30-
"@epic-web/client-hints": "1.3.5",
31-
"@forge42/seo-tools": "1.3.0",
32-
"@react-router/node": "7.2.0",
30+
"@epic-web/client-hints": "1.3.7",
31+
"@forge42/seo-tools": "1.4.2",
32+
"@react-router/node": "7.6.3",
3333
"clsx": "2.1.1",
34-
"hono": "4.6.20",
35-
"i18next": "24.2.2",
36-
"i18next-browser-languagedetector": "8.0.2",
34+
"hono": "4.8.4",
35+
"i18next": "25.3.1",
36+
"i18next-browser-languagedetector": "8.2.0",
3737
"i18next-http-backend": "3.0.2",
38-
"isbot": "5.1.22",
38+
"isbot": "5.1.28",
3939
"pretty-cache-header": "1.0.0",
40-
"react": "19.0.0",
41-
"react-dom": "19.0.0",
42-
"react-i18next": "15.4.0",
43-
"react-router": "7.2.0",
44-
"react-router-hono-server": "2.10.0",
40+
"react": "19.1.0",
41+
"react-dom": "19.1.0",
42+
"react-i18next": "15.6.0",
43+
"react-router": "7.6.3",
44+
"react-router-hono-server": "2.13.0",
4545
"remix-hono": "0.0.18",
46-
"remix-i18next": "7.0.2",
47-
"tailwind-merge": "3.0.1",
48-
"zod": "3.24.1"
46+
"remix-i18next": "7.2.1",
47+
"tailwind-merge": "3.3.1",
48+
"zod": "3.25.74"
4949
},
5050
"devDependencies": {
51-
"@babel/preset-typescript": "7.26.0",
52-
"@biomejs/biome": "1.9.4",
53-
"@dotenvx/dotenvx": "1.34.0",
54-
"@react-router/dev": "7.2.0",
55-
"@react-router/fs-routes": "7.2.0",
56-
"@tailwindcss/vite": "4.0.9",
57-
"@testing-library/react": "16.2.0",
58-
"@types/node": "22.13.1",
51+
"@babel/preset-typescript": "7.27.1",
52+
"@biomejs/biome": "2.0.6",
53+
"@dotenvx/dotenvx": "1.45.2",
54+
"@react-router/dev": "7.6.3",
55+
"@react-router/fs-routes": "7.6.3",
56+
"@tailwindcss/vite": "4.1.11",
57+
"@testing-library/react": "16.3.0",
58+
"@types/node": "24.0.10",
5959
"@types/prompt": "1.1.9",
60-
"@types/react": "19.0.8",
61-
"@types/react-dom": "19.0.3",
62-
"@vitest/browser": "3.0.5",
63-
"@vitest/coverage-v8": "3.0.5",
64-
"@vitest/ui": "3.0.5",
65-
"babel-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
60+
"@types/react": "19.1.8",
61+
"@types/react-dom": "19.1.6",
62+
"@vitest/browser": "3.2.4",
63+
"@vitest/coverage-v8": "3.2.4",
64+
"@vitest/ui": "3.2.4",
65+
"babel-plugin-react-compiler": "19.1.0-rc.2",
6666
"chalk": "5.4.1",
67-
"happy-dom": "16.8.1",
68-
"knip": "5.43.6",
69-
"lefthook": "1.10.10",
70-
"playwright": "1.50.1",
67+
"happy-dom": "18.0.1",
68+
"knip": "5.61.3",
69+
"lefthook": "1.11.16",
70+
"playwright": "1.53.2",
7171
"prompt": "1.3.0",
72-
"react-router-devtools": "5.0.4",
73-
"tailwindcss": "4.0.9",
74-
"tsx": "4.19.2",
75-
"typescript": "5.7.3",
76-
"vite": "6.2.0",
77-
"vite-plugin-babel": "1.3.0",
72+
"react-router-devtools": "5.0.6",
73+
"tailwindcss": "4.1.11",
74+
"tsx": "4.20.3",
75+
"typescript": "5.8.3",
76+
"vite": "7.0.2",
77+
"vite-plugin-babel": "1.3.2",
7878
"vite-plugin-icons-spritesheet": "3.0.1",
7979
"vite-tsconfig-paths": "5.1.4",
80-
"vitest": "3.0.5",
81-
"vitest-browser-react": "0.0.4"
80+
"vitest": "3.2.4",
81+
"vitest-browser-react": "1.0.0"
8282
},
83-
"packageManager": "pnpm@10.2.0",
83+
"packageManager": "pnpm@10.12.4",
8484
"optionalDependencies": {
85-
"@rollup/rollup-linux-x64-gnu": "^4.34.3"
85+
"@rollup/rollup-linux-x64-gnu": "^4.44.2"
8686
},
8787
"engines": {
88-
"node": ">=22.11.0",
89-
"pnpm": ">=10.2.0"
88+
"node": ">=24.3.0",
89+
"pnpm": ">=10.12.4"
9090
},
9191
"pnpm": {
92-
"onlyBuiltDependencies": ["@biomejs/biome", "esbuild", "lefthook", "msw"]
92+
"onlyBuiltDependencies": [
93+
"@biomejs/biome",
94+
"esbuild",
95+
"lefthook",
96+
"msw"
97+
]
9398
}
9499
}

0 commit comments

Comments
 (0)