1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-05-29 22:37:44 +02:00

build: update to Node.js v24.0.0, pnpm v10, Tailwind CSS v4

This commit is contained in:
2025-05-11 16:59:11 +02:00
parent cec70161f7
commit 69af1bccc3
43 changed files with 3941 additions and 3664 deletions

View File

@@ -0,0 +1,5 @@
{
"plugins": {
"@tailwindcss/postcss": {}
}
}

View File

@@ -49,6 +49,7 @@
"eslint": "catalog:",
"postcss": "catalog:",
"tailwindcss": "catalog:",
"@tailwindcss/postcss": "catalog:",
"typescript-eslint": "catalog:",
"typescript": "catalog:"
}

View File

@@ -1,7 +0,0 @@
const config = {
plugins: {
tailwindcss: {},
},
}
export default config

View File

@@ -109,11 +109,11 @@ const transaction = charge(user, subscription)
```typescript
interface Car {
carModel: string
carColor: "red" | "blue" | "yellow"
carModel: string
carColor: "red" | "blue" | "yellow"
}
const printCar = (car: Car): void => {
console.log(`${car.carModel} (${car.carColor})`)
console.log(`${car.carModel} (${car.carColor})`)
}
```
@@ -121,11 +121,11 @@ const printCar = (car: Car): void => {
```typescript
interface Car {
model: string
color: "red" | "blue" | "yellow"
model: string
color: "red" | "blue" | "yellow"
}
const printCar = (car: Car): void => {
console.log(`${car.model} (${car.color})`)
console.log(`${car.model} (${car.color})`)
}
```
@@ -174,13 +174,13 @@ import fs from "node:fs"
import path from "node:path"
const createFile = async (
name: string,
isTemporary: boolean = false,
name: string,
isTemporary: boolean = false,
): Promise<void> => {
if (isTemporary) {
return await fs.promises.writeFile(path.join("temporary", name), "")
}
return await fs.promises.writeFile(name, "")
if (isTemporary) {
return await fs.promises.writeFile(path.join("temporary", name), "")
}
return await fs.promises.writeFile(name, "")
}
```
@@ -193,11 +193,11 @@ import fs from "node:fs"
import path from "node:path"
const createFile = async (name: string): Promise<void> => {
await fs.promises.writeFile(name, "")
await fs.promises.writeFile(name, "")
}
const createTemporaryFile = async (name: string): Promise<void> => {
await createFile(path.join("temporary", name))
await createFile(path.join("temporary", name))
}
```

View File

@@ -39,23 +39,23 @@ The code of this website is open source on [GitHub](https://github.com/theoludwi
- [Next.js](https://nextjs.org/)
It allows to have a server-side rendered website, that means that it is faster and easier to have a good <abbr title="Search Engine Optimization">SEO</abbr> than a <abbr title="Single Page Application">SPA</abbr>.
It allows to have a server-side rendered website, that means that it is faster and easier to have a good <abbr title="Search Engine Optimization">SEO</abbr> than a <abbr title="Single Page Application">SPA</abbr>.
- [MDX](https://mdxjs.com/)
MDX is an extension of Markdown that allows you to use custom React components.
MDX is an extension of Markdown that allows you to use custom React components.
Here's what Markdown looks like:
Here's what Markdown looks like:
```md
A simple paragraph, with some **bold** text and some `inline code`.
```
```md
A simple paragraph, with some **bold** text and some `inline code`.
```
When using Markdown in a web application, there's a "compile" step; the Markdown needs to be transformed into HTML, so that it can be understood by the browser. Those asterisks get turned into a `<strong>` tag, and each paragraph gets a `<p>` tag etc.
When using Markdown in a web application, there's a "compile" step; the Markdown needs to be transformed into HTML, so that it can be understood by the browser. Those asterisks get turned into a `<strong>` tag, and each paragraph gets a `<p>` tag etc.
- [Tailwind CSS](https://tailwindcss.com/)
Tailwind is a CSS framework to rapidly build modern websites without ever leaving HTML.
Tailwind is a CSS framework to rapidly build modern websites without ever leaving HTML.
## Conclusion

View File

@@ -2,7 +2,6 @@ import sharedConfig from "@repo/config-tailwind"
/** @type {Pick<import('tailwindcss').Config, "presets" | "content">} */
const config = {
content: ["./src/**/*.tsx"],
presets: [sharedConfig],
}

View File

@@ -1,10 +1,9 @@
import type fr from "./translations/fr-FR.json"
import type { routing } from "./routing.ts"
import type messages from "./translations/en-US.json"
type Messages = typeof fr
declare global {
/**
* Use type safe message keys with `next-intl`.
*/
interface IntlMessages extends Messages {}
declare module "next-intl" {
interface AppConfig {
Locale: (typeof routing.locales)[number]
Messages: typeof messages
}
}

View File

@@ -1,15 +1,16 @@
import type { AbstractIntlMessages } from "next-intl"
import { hasLocale } from "next-intl"
import { getRequestConfig } from "next-intl/server"
import { routing } from "./routing.ts"
import type { Locale } from "@repo/utils/constants"
import { LOCALE_DEFAULT, LOCALES } from "@repo/utils/constants"
import { LOCALE_DEFAULT } from "@repo/utils/constants"
import { deepMerge } from "@repo/utils/objects"
export default getRequestConfig(async ({ requestLocale }) => {
let locale = await requestLocale
if (!LOCALES.includes(locale as Locale)) {
locale = LOCALE_DEFAULT
}
const requested = await requestLocale
const locale = hasLocale(routing.locales, requested)
? requested
: routing.defaultLocale
const userMessages = (await import(`./translations/${locale}.json`)).default
const defaultMessages = (

View File

@@ -0,0 +1,5 @@
{
"plugins": {
"@tailwindcss/postcss": {}
}
}

View File

@@ -51,6 +51,7 @@
"eslint": "catalog:",
"postcss": "catalog:",
"tailwindcss": "catalog:",
"@tailwindcss/postcss": "catalog:",
"typescript-eslint": "catalog:",
"typescript": "catalog:"
}

View File

@@ -1,7 +0,0 @@
const config = {
plugins: {
tailwindcss: {},
},
}
export default config

View File

@@ -2,7 +2,6 @@ import sharedConfig from "@repo/config-tailwind"
/** @type {Pick<import('tailwindcss').Config, "presets" | "content">} */
const config = {
content: ["./src/**/*.tsx"],
presets: [sharedConfig],
}