mirror of
https://github.com/theoludwig/theoludwig.git
synced 2025-05-29 22:37:44 +02:00
build(deps): update Next.js to v15 and ESLint to v9
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
{
|
||||
"root": true,
|
||||
"extends": ["@repo/eslint-config"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts", "*.tsx"],
|
||||
"plugins": ["@typescript-eslint"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"projectService": true
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
13
packages/i18n/eslint.config.js
Normal file
13
packages/i18n/eslint.config.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import typescriptESLint from "typescript-eslint"
|
||||
import config from "@repo/eslint-config"
|
||||
|
||||
export default typescriptESLint.config(...config, {
|
||||
files: ["**/*.ts", "**/*.tsx"],
|
||||
languageOptions: {
|
||||
parser: typescriptESLint.parser,
|
||||
parserOptions: {
|
||||
projectService: true,
|
||||
tsconfigRootDir: import.meta.dirname,
|
||||
},
|
||||
},
|
||||
})
|
@@ -5,13 +5,12 @@
|
||||
"type": "module",
|
||||
"exports": {
|
||||
"./translations/*.json": "./src/translations/*.json",
|
||||
"./config": "./src/config.tsx",
|
||||
"./i18n": "./src/i18n.ts",
|
||||
"./messages.d.ts": "./src/messages.d.ts",
|
||||
"./navigation": "./src/navigation.ts"
|
||||
"./request": "./src/request.ts",
|
||||
"./routing": "./src/routing.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"lint:eslint": "eslint src --max-warnings 0 --report-unused-disable-directives",
|
||||
"lint:eslint": "eslint src --max-warnings 0",
|
||||
"lint:typescript": "tsc --noEmit",
|
||||
"test": "vitest run"
|
||||
},
|
||||
@@ -30,6 +29,7 @@
|
||||
"@types/react-dom": "catalog:",
|
||||
"@total-typescript/ts-reset": "catalog:",
|
||||
"eslint": "catalog:",
|
||||
"typescript-eslint": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
"vitest": "catalog:"
|
||||
}
|
||||
|
@@ -1,26 +0,0 @@
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
import type { RichTranslationValues } from "next-intl"
|
||||
|
||||
export interface LocaleProps {
|
||||
params: {
|
||||
locale: Locale
|
||||
}
|
||||
}
|
||||
|
||||
export const defaultTranslationValues: RichTranslationValues = {
|
||||
br: () => {
|
||||
return <br />
|
||||
},
|
||||
strong: (children) => {
|
||||
return <strong>{children}</strong>
|
||||
},
|
||||
em: (children) => {
|
||||
return <em>{children}</em>
|
||||
},
|
||||
s: (children) => {
|
||||
return <s>{children}</s>
|
||||
},
|
||||
u: (children) => {
|
||||
return <u>{children}</u>
|
||||
},
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
import { createSharedPathnamesNavigation } from "next-intl/navigation"
|
||||
|
||||
import { LOCALES, LOCALE_PREFIX } from "@repo/utils/constants"
|
||||
|
||||
export const { Link, redirect, usePathname, useRouter, permanentRedirect } =
|
||||
createSharedPathnamesNavigation({
|
||||
locales: LOCALES,
|
||||
localePrefix: LOCALE_PREFIX,
|
||||
})
|
@@ -1,15 +1,14 @@
|
||||
import deepmerge from "deepmerge"
|
||||
import type { AbstractIntlMessages } from "next-intl"
|
||||
import { getRequestConfig } from "next-intl/server"
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
import { LOCALE_DEFAULT, LOCALES } from "@repo/utils/constants"
|
||||
import { defaultTranslationValues } from "./config.tsx"
|
||||
|
||||
export default getRequestConfig(async ({ locale }) => {
|
||||
export default getRequestConfig(async ({ requestLocale }) => {
|
||||
let locale = await requestLocale
|
||||
if (!LOCALES.includes(locale as Locale)) {
|
||||
return notFound()
|
||||
locale = LOCALE_DEFAULT
|
||||
}
|
||||
|
||||
const userMessages = (await import(`./translations/${locale}.json`)).default
|
||||
@@ -22,7 +21,7 @@ export default getRequestConfig(async ({ locale }) => {
|
||||
)
|
||||
|
||||
return {
|
||||
locale,
|
||||
messages,
|
||||
defaultTranslationValues,
|
||||
}
|
||||
})
|
26
packages/i18n/src/routing.ts
Normal file
26
packages/i18n/src/routing.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { createNavigation } from "next-intl/navigation"
|
||||
|
||||
import { LOCALES, LOCALE_DEFAULT, LOCALE_PREFIX } from "@repo/utils/constants"
|
||||
import { defineRouting } from "next-intl/routing"
|
||||
import type { Locale } from "@repo/utils/constants"
|
||||
|
||||
export interface LocaleProps {
|
||||
params: Promise<{
|
||||
locale: Locale
|
||||
}>
|
||||
}
|
||||
|
||||
export const routing = defineRouting({
|
||||
locales: LOCALES,
|
||||
defaultLocale: LOCALE_DEFAULT,
|
||||
localePrefix: LOCALE_PREFIX,
|
||||
})
|
||||
|
||||
export const {
|
||||
Link,
|
||||
redirect,
|
||||
usePathname,
|
||||
useRouter,
|
||||
getPathname,
|
||||
permanentRedirect,
|
||||
} = createNavigation(routing)
|
@@ -10,10 +10,10 @@
|
||||
"institution": "Conservatoire National des Arts et Métiers (CNAM), in Eckbolsheim - UIMM Alsace - ITII Alsace",
|
||||
"study-type": "Engineer in Computer Science and Information Systems (IS)",
|
||||
"years": {
|
||||
"2024-2025": {
|
||||
"2024-2027": {
|
||||
"courses": {},
|
||||
"description": "1st year",
|
||||
"title": "2024 - 2025"
|
||||
"description": "",
|
||||
"title": "2024 - 2027"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -10,10 +10,10 @@
|
||||
"institution": "Conservatoire National des Arts et Métiers (CNAM) à Eckbolsheim - UIMM Alsace - ITII Alsace",
|
||||
"study-type": "Ingénieur en Informatique et Systèmes d'Information (SI)",
|
||||
"years": {
|
||||
"2024-2025": {
|
||||
"2024-2027": {
|
||||
"courses": {},
|
||||
"description": "1ère année",
|
||||
"title": "2024 - 2025"
|
||||
"description": "",
|
||||
"title": "2024 - 2027"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user