1
0
mirror of https://github.com/theoludwig/theoludwig.git synced 2025-12-12 20:46:52 +01:00

Compare commits

...

17 Commits

Author SHA1 Message Date
f70a66e251 fix: replace standard open source contributions by nodejs.org 2025-02-08 20:56:56 +01:00
38eb296088 feat: themeColor metadata 2025-02-08 20:51:22 +01:00
43d91bfc28 chore: fix storybook configuration 2025-02-08 20:48:19 +01:00
b63cc3a66e chore: cleaner setup 2025-02-08 20:00:47 +01:00
semantic-release-bot
270920111a chore(release): 4.1.3 [skip ci] 2025-01-23 12:17:18 +00:00
d91feb8de4 fix: use Plausible 2025-01-23 13:16:20 +01:00
e68cb08a6f fix: update Node.js to v22.13.1 (security release)
Ref: https://nodejs.org/en/blog/release/v22.13.1
2025-01-23 13:11:57 +01:00
semantic-release-bot
09d677bd37 chore(release): 4.1.2 [skip ci] 2024-12-06 22:22:48 +00:00
db1159f20c fix(blog): issue with CSS loading
Ref: https://github.com/nodejs/node/issues/56155
2024-12-06 23:16:40 +01:00
semantic-release-bot
af5c845e4b chore(release): 4.1.1 [skip ci] 2024-12-06 08:35:37 +00:00
3f66dfe46e fix: error 404 not found 2024-12-06 09:30:49 +01:00
d52a0c6f08 build(deps): update latest 2024-12-06 09:30:44 +01:00
semantic-release-bot
251b0b4038 chore(release): 4.1.0 [skip ci] 2024-11-09 20:10:23 +00:00
a5baffe9eb fix(ui): button outline, hover effect 2024-11-09 21:01:31 +01:00
1351e4122d fix(blog): shiki syntax highlighting for txt 2024-11-09 20:21:09 +01:00
4c69d5a852 refactor(ui): allow all tailwind css colors 2024-11-09 20:14:30 +01:00
9e840b8dae build(deps): update Next.js to v15 and ESLint to v9 2024-11-09 19:50:22 +01:00
115 changed files with 5410 additions and 8392 deletions

View File

@@ -1,2 +1,2 @@
TZ=UTC TZ=Europe/Paris
WEBSITE_PORT=3000 WEBSITE_PORT=3000

View File

@@ -10,15 +10,19 @@ jobs:
chromatic: chromatic:
timeout-minutes: 30 timeout-minutes: 30
runs-on: "ubuntu-latest" runs-on: "ubuntu-latest"
env:
DO_NOT_TRACK: "1"
TURBO_TELEMETRY_DISABLED: "1"
NEXT_TELEMETRY_DISABLED: "1"
steps: steps:
- uses: "actions/checkout@v4.2.1" - uses: "actions/checkout@v4.2.2"
with: with:
fetch-depth: 0 fetch-depth: 0
- uses: "pnpm/action-setup@v4.0.0" - uses: "pnpm/action-setup@v4.1.0"
- name: "Setup Node.js" - name: "Setup Node.js"
uses: "actions/setup-node@v4.0.4" uses: "actions/setup-node@v4.2.0"
with: with:
node-version: "22.x" node-version: "22.x"
cache: "pnpm" cache: "pnpm"

View File

@@ -10,13 +10,17 @@ jobs:
ci: ci:
timeout-minutes: 30 timeout-minutes: 30
runs-on: "ubuntu-latest" runs-on: "ubuntu-latest"
env:
DO_NOT_TRACK: "1"
TURBO_TELEMETRY_DISABLED: "1"
NEXT_TELEMETRY_DISABLED: "1"
steps: steps:
- uses: "actions/checkout@v4.2.1" - uses: "actions/checkout@v4.2.2"
- uses: "pnpm/action-setup@v4.0.0" - uses: "pnpm/action-setup@v4.1.0"
- name: "Setup Node.js" - name: "Setup Node.js"
uses: "actions/setup-node@v4.0.4" uses: "actions/setup-node@v4.2.0"
with: with:
node-version: "22.x" node-version: "22.x"
cache: "pnpm" cache: "pnpm"
@@ -38,6 +42,6 @@ jobs:
commitlint: commitlint:
runs-on: "ubuntu-latest" runs-on: "ubuntu-latest"
steps: steps:
- uses: "actions/checkout@v4.2.1" - uses: "actions/checkout@v4.2.2"
- uses: "wagoid/commitlint-github-action@v6.1.2" - uses: "wagoid/commitlint-github-action@v6.1.2"

View File

@@ -1,45 +0,0 @@
name: "Release"
on:
push:
branches: [main, staging]
jobs:
release:
timeout-minutes: 30
runs-on: "ubuntu-latest"
permissions:
contents: "write"
issues: "write"
pull-requests: "write"
id-token: "write"
steps:
- uses: "actions/checkout@v4.2.1"
with:
fetch-depth: 0
persist-credentials: false
- name: "Import GPG key"
uses: "crazy-max/ghaction-import-gpg@v6.1.0"
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
- uses: "pnpm/action-setup@v4.0.0"
- name: "Setup Node.js"
uses: "actions/setup-node@v4.0.4"
with:
node-version: "22.x"
cache: "pnpm"
- name: "Install dependencies"
run: "pnpm install --frozen-lockfile"
- name: "Release"
run: "node --run release"
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_COMMITTER_NAME: ${{ secrets.GIT_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.GIT_EMAIL }}

View File

@@ -1,12 +0,0 @@
{
"config": {
"extends": "markdownlint/style/prettier",
"default": true,
"relative-links": true,
"no-duplicate-heading": false,
"no-inline-html": false,
},
"globs": ["**/*.md"],
"ignores": ["**/node_modules"],
"customRules": ["markdownlint-rule-relative-links"],
}

16
.markdownlint-cli2.mjs Normal file
View File

@@ -0,0 +1,16 @@
import relativeLinksRule from "markdownlint-rule-relative-links"
const config = {
config: {
extends: "markdownlint/style/prettier",
default: true,
"relative-links": true,
"no-duplicate-heading": false,
"no-inline-html": false,
},
globs: ["**/*.md"],
ignores: ["**/node_modules"],
customRules: [relativeLinksRule],
}
export default config

View File

@@ -1,34 +0,0 @@
{
"branches": ["main", { "name": "staging", "prerelease": true }],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/exec",
{
"prepareCmd": "replace-in-files --regex='version\": *\"[^\"]*' --replacement='\"version\": \"${nextRelease.version}\"' '**/package.json' '!**/node_modules/**'"
}
],
[
"@semantic-release/git",
{
"assets": [
"package.json",
"apps/*/package.json",
"packages/*/package.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]"
}
],
"@semantic-release/github",
[
"@saithodev/semantic-release-backmerge",
{
"branches": [
{ "from": "main", "to": "develop" },
{ "from": "staging", "to": "develop" }
]
}
]
]
}

View File

@@ -7,19 +7,15 @@
"editor.formatOnSave": true, "editor.formatOnSave": true,
"editor.codeActionsOnSave": { "editor.codeActionsOnSave": {
"source.fixAll": "explicit", "source.fixAll": "explicit",
"source.organizeImports": "explicit" "source.organizeImports": "never"
}, },
"eslint.options": {
"ignorePath": ".gitignore"
},
"prettier.ignorePath": ".gitignore",
"tailwindCSS.experimental.classRegex": [ "tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"], ["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"] ["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
], ],
"i18n-ally.localesPaths": ["./packages/i18n/src/translations/"], "i18n-ally.localesPaths": ["./packages/i18n/src/translations/"],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",
"i18n-ally.sortKeys": true, "i18n-ally.sortKeys": false,
"i18n-ally.sourceLanguage": "en-US", "i18n-ally.sourceLanguage": "en-US",
"i18n-ally.displayLanguage": "en-US", "i18n-ally.displayLanguage": "en-US",
"i18n-ally.enabledFrameworks": ["next-intl", "general"], "i18n-ally.enabledFrameworks": ["next-intl", "general"],

View File

@@ -31,8 +31,8 @@ The commit message guidelines adheres to [Conventional Commits](https://www.conv
### Prerequisites ### Prerequisites
- [Node.js](https://nodejs.org/) >= 22.0.0 - [Node.js](https://nodejs.org/) >= 22.12.0 [(`nvm install 22`)](https://nvm.sh)
- [pnpm](https://pnpm.io/) >= 9.12.1 [(`corepack enable`)](https://nodejs.org/docs/latest-v22.x/api/corepack.html) - [pnpm](https://pnpm.io/) >= 10.2.1 [(`corepack enable`)](https://nodejs.org/docs/latest-v22.x/api/corepack.html)
- [Docker](https://www.docker.com/) - [Docker](https://www.docker.com/)
### Installation ### Installation
@@ -83,9 +83,9 @@ node --run test
```sh ```sh
# Setup and run all the services for you # Setup and run all the services for you
docker compose up --build VERSION=$(git describe --tags) docker compose up --build --detach
``` ```
#### Services started #### Services started
`theoludwig`: <http://127.0.0.1:3000> `theoludwig`: <http://localhost:3000>

View File

@@ -1,4 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config"]
}

View File

@@ -13,11 +13,10 @@ const config: StorybookConfig = {
"../stories/*.mdx", "../stories/*.mdx",
], ],
addons: [ addons: [
"@chromatic-com/storybook",
"@storybook/addon-essentials", "@storybook/addon-essentials",
"@storybook/addon-storysource", "@storybook/addon-storysource",
"@storybook/addon-a11y", "@storybook/addon-a11y",
"@storybook/addon-links",
"@chromatic-com/storybook",
"@storybook/addon-interactions", "@storybook/addon-interactions",
"storybook-dark-mode", "storybook-dark-mode",
], ],

View File

@@ -1,13 +1,18 @@
import "@repo/config-tailwind/styles.css" import "@repo/config-tailwind/styles.css"
import { defaultTranslationValues } from "@repo/i18n/config" import "./storybook-css-overrides.css"
import i18nMessagesEnglish from "@repo/i18n/translations/en-US.json" import i18nMessages from "@repo/i18n/translations/en-US.json"
import { LOCALE_DEFAULT } from "@repo/utils/constants" import { LOCALE_DEFAULT, TIMEZONE } from "@repo/utils/constants"
import type { Preview } from "@storybook/react" import type { Preview } from "@storybook/react"
import { NextIntlClientProvider } from "next-intl" import { NextIntlClientProvider } from "next-intl"
import { ThemeProvider as NextThemeProvider } from "next-themes" import { ThemeProvider as NextThemeProvider } from "next-themes"
import React from "react" import React from "react"
const preview: Preview = { const preview: Preview = {
globals: {
a11y: {
manual: true,
},
},
parameters: { parameters: {
nextjs: { nextjs: {
appDirectory: true, appDirectory: true,
@@ -28,7 +33,7 @@ const preview: Preview = {
disableSaveFromUI: true, disableSaveFromUI: true,
matchers: { matchers: {
color: /(background|color)$/i, color: /(background|color)$/i,
date: /Date$/i, date: /date$/i,
}, },
}, },
}, },
@@ -37,10 +42,9 @@ const preview: Preview = {
return ( return (
<NextThemeProvider enableColorScheme={false}> <NextThemeProvider enableColorScheme={false}>
<NextIntlClientProvider <NextIntlClientProvider
messages={i18nMessagesEnglish} messages={i18nMessages}
locale={LOCALE_DEFAULT} locale={LOCALE_DEFAULT}
defaultTranslationValues={defaultTranslationValues} timeZone={TIMEZONE}
timeZone={process.env["TZ"] ?? "UTC"}
> >
<Story /> <Story />
</NextIntlClientProvider> </NextIntlClientProvider>

View File

@@ -0,0 +1,3 @@
body {
overflow: auto !important;
}

View File

@@ -13,7 +13,8 @@ const config: TestRunnerConfig = {
async postVisit(page, context) { async postVisit(page, context) {
const storyContext = await getStoryContext(page, context) const storyContext = await getStoryContext(page, context)
if (storyContext.parameters?.a11y?.disable) { const isA11yDisabled = storyContext.parameters?.a11y?.disable as boolean
if (isA11yDisabled) {
return return
} }

View File

@@ -0,0 +1,13 @@
import typescriptESLint from "typescript-eslint"
import config from "@repo/config-eslint"
export default typescriptESLint.config(...config, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})

View File

@@ -0,0 +1,84 @@
import http from "node:http"
import fs from "node:fs"
import path from "node:path"
import util from "node:util"
import mime from "mime"
const MIMETYPE_DEFAULT = "application/octet-stream"
const args = util.parseArgs({
options: {
path: { type: "string", default: "public", required: true },
port: { type: "string", default: "3000", required: true },
host: { type: "string", default: "0.0.0.0" },
},
})
const host = args.values.host
const basePath = args.values.path
const port = Number.parseInt(args.values.port, 10)
if (Number.isNaN(port)) {
console.error("Error: Invalid port number.")
process.exit(1)
}
const serverURL = `http://${host}:${port}`
const server = http.createServer(async (request, response) => {
if (request.url == null) {
response.writeHead(400, { "Content-Type": "text/plain" })
response.end("Bad Request")
return
}
const url = new URL(request.url, serverURL)
const urlPath = url.pathname
const filePath = path.join(process.cwd(), basePath, urlPath)
try {
const stat = await fs.promises.stat(filePath)
if (stat.isDirectory()) {
const indexFile = path.join(filePath, "index.html")
try {
const fileContent = await fs.promises.readFile(indexFile)
response.writeHead(200, { "Content-Type": "text/html" })
response.end(fileContent)
} catch {
response.writeHead(403, { "Content-Type": "text/plain" })
response.end("Error: Directory listing not allowed.")
}
} else {
const mimeType = mime.getType(filePath) ?? MIMETYPE_DEFAULT
const fileContent = await fs.promises.readFile(filePath)
response.writeHead(200, { "Content-Type": mimeType })
response.end(fileContent)
}
} catch (error) {
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
response.writeHead(404, { "Content-Type": "text/plain" })
response.end("Error: File not found.")
} else {
response.writeHead(500, { "Content-Type": "text/plain" })
response.end("Error: Internal Server Error.")
}
}
})
const gracefulShutdown = (): void => {
server.close()
process.exit(0)
}
process.on("SIGTERM", gracefulShutdown)
process.on("SIGINT", gracefulShutdown)
server.listen(
{
host,
port,
},
() => {
console.log(
`HTTP Server is listening at ${util.styleText("cyan", serverURL)}`,
)
console.log(`Serving files from: \`${basePath}\``)
},
)

View File

@@ -1,14 +1,14 @@
{ {
"name": "@repo/storybook", "name": "@repo/storybook",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
"build": "storybook build", "build": "storybook build",
"dev": "storybook dev --port 6006 --no-open", "dev": "storybook dev --port 6006 --no-open",
"start": "http-server \"storybook-static\" --port 6006 --silent", "start": "node --experimental-strip-types http-server.ts --path=storybook-static --port=6006",
"test": "start-server-and-test \"start\" http://127.0.0.1:6006 \"test:storybook\"", "test": "start-server-and-test \"start\" http://localhost:6006 \"test:storybook\"",
"test:dev": "start-server-and-test \"dev\" http://127.0.0.1:6006 \"test:storybook\"", "test:dev": "start-server-and-test \"dev\" http://localhost:6006 \"test:storybook\"",
"test:storybook": "test-storybook --testTimeout=60000 --maxWorkers=2", "test:storybook": "test-storybook --testTimeout=60000 --maxWorkers=2",
"chromatic": "chromatic" "chromatic": "chromatic"
}, },
@@ -22,17 +22,18 @@
"next-intl": "catalog:", "next-intl": "catalog:",
"next-themes": "catalog:", "next-themes": "catalog:",
"react": "catalog:", "react": "catalog:",
"react-dom": "catalog:" "react-dom": "catalog:",
"mime": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "workspace:*", "@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*",
"@chromatic-com/storybook": "catalog:", "@chromatic-com/storybook": "catalog:",
"@playwright/test": "catalog:", "@playwright/test": "catalog:",
"@storybook/addon-a11y": "catalog:",
"@storybook/addon-essentials": "catalog:", "@storybook/addon-essentials": "catalog:",
"@storybook/addon-interactions": "catalog:",
"@storybook/addon-links": "catalog:",
"@storybook/addon-storysource": "catalog:", "@storybook/addon-storysource": "catalog:",
"@storybook/addon-a11y": "catalog:",
"@storybook/addon-interactions": "catalog:",
"@storybook/addon-themes": "catalog:", "@storybook/addon-themes": "catalog:",
"@storybook/blocks": "catalog:", "@storybook/blocks": "catalog:",
"@storybook/nextjs": "catalog:", "@storybook/nextjs": "catalog:",
@@ -45,12 +46,12 @@
"axe-playwright": "catalog:", "axe-playwright": "catalog:",
"chromatic": "catalog:", "chromatic": "catalog:",
"eslint": "catalog:", "eslint": "catalog:",
"http-server": "catalog:",
"start-server-and-test": "catalog:", "start-server-and-test": "catalog:",
"storybook": "catalog:", "storybook": "catalog:",
"storybook-dark-mode": "catalog:", "storybook-dark-mode": "catalog:",
"postcss": "catalog:", "postcss": "catalog:",
"tailwindcss": "catalog:", "tailwindcss": "catalog:",
"typescript-eslint": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }
} }

View File

@@ -6,7 +6,7 @@ import tailwindConfig from "@repo/config-tailwind"
<Title>Colors</Title> <Title>Colors</Title>
<ColorPalette> <ColorPalette>
{Object.entries(tailwindConfig.theme.colors).map( {Object.entries(tailwindConfig.theme.extend.colors).map(
([colorName, colorValue]) => { ([colorName, colorValue]) => {
const colors = {} const colors = {}

View File

@@ -0,0 +1,7 @@
{
"extends": "@repo/config-typescript/tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ESNext"]
},
"include": ["http-server.ts", "./.storybook/**/*.ts", "./.storybook/**/*.tsx"]
}

View File

@@ -1,5 +1,5 @@
{ {
"$schema": "https://turbo.build/schema.json", "$schema": "../../node_modules/turbo/schema.json",
"extends": ["//"], "extends": ["//"],
"tasks": { "tasks": {
"test": { "test": {

View File

@@ -1,4 +1,4 @@
TZ=UTC TZ=Europe/Paris
HOSTNAME=0.0.0.0 HOSTNAME=0.0.0.0
PORT=3000 PORT=3000
NEXT_TELEMETRY_DISABLED=1 NEXT_TELEMETRY_DISABLED=1

View File

@@ -1,14 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config/nextjs/.eslintrc.json"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projectService": true
}
}
]
}

View File

@@ -1,14 +1,15 @@
FROM node:22.4.1-slim AS node-pnpm FROM node:22.13.1-slim AS node-pnpm
ENV PNPM_HOME="/pnpm" ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH" ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable RUN npm install --global corepack@0.31.0 && corepack enable
ENV TURBO_TELEMETRY_DISABLED=1 ENV TURBO_TELEMETRY_DISABLED=1
ENV NEXT_TELEMETRY_DISABLED=1
ENV DO_NOT_TRACK=1 ENV DO_NOT_TRACK=1
WORKDIR /usr/src/app WORKDIR /usr/src/app
FROM node-pnpm AS builder FROM node-pnpm AS builder
COPY ./ ./ COPY ./ ./
RUN pnpm install --global turbo@2.1.3 RUN pnpm install --global turbo@2.4.0
RUN turbo prune @repo/website --docker RUN turbo prune @repo/website --docker
FROM node-pnpm AS installer FROM node-pnpm AS installer
@@ -20,12 +21,15 @@ COPY --from=builder /usr/src/app/out/pnpm-lock.yaml ./pnpm-lock.yaml
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
COPY --from=builder /usr/src/app/out/full/ ./ COPY --from=builder /usr/src/app/out/full/ ./
COPY turbo.json turbo.json COPY turbo.json turbo.json
ARG VERSION="0.0.0-develop"
RUN pnpm install --global replace-in-files-cli@3.0.0
RUN VERSION_STRIPPED=${VERSION#v} && replace-in-files --regex='version": *"[^"]*' --replacement='"version": "'"$VERSION_STRIPPED"'"' '**/package.json' '!**/node_modules/**'
RUN pnpm --filter=@repo/website... exec turbo run build RUN pnpm --filter=@repo/website... exec turbo run build
FROM node-pnpm AS runner FROM node-pnpm AS runner
ENV NODE_ENV=production ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0 ENV HOSTNAME=0.0.0.0
ENV NEXT_TELEMETRY_DISABLED=1
ENV IS_STANDALONE=true ENV IS_STANDALONE=true
RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 applicationrunner RUN addgroup --system --gid 1001 nodejs && adduser --system --uid 1001 applicationrunner

View File

@@ -4,19 +4,20 @@ import { notFound } from "next/navigation"
import { getBlogPostBySlug, getBlogPosts } from "@repo/blog" import { getBlogPostBySlug, getBlogPosts } from "@repo/blog"
import { BlogPostUI } from "@repo/blog/BlogPostUI" import { BlogPostUI } from "@repo/blog/BlogPostUI"
import type { Locale } from "@repo/utils/constants" import type { Locale } from "@repo/utils/constants"
import { unstable_setRequestLocale } from "next-intl/server" import { setRequestLocale } from "next-intl/server"
interface BlogPostPageProps { interface BlogPostPageProps {
params: { params: Promise<{
slug: string slug: string
locale: Locale locale: Locale
} }>
} }
export const generateMetadata = async ( export const generateMetadata = async (
props: BlogPostPageProps, props: BlogPostPageProps,
): Promise<Metadata> => { ): Promise<Metadata> => {
const blogPost = await getBlogPostBySlug(props.params.slug) const { slug } = await props.params
const blogPost = await getBlogPostBySlug(slug)
if (blogPost == null) { if (blogPost == null) {
return notFound() return notFound()
} }
@@ -50,10 +51,11 @@ export const generateStaticParams = async (): Promise<
const BlogPostPage: React.FC<BlogPostPageProps> = async (props) => { const BlogPostPage: React.FC<BlogPostPageProps> = async (props) => {
const { params } = props const { params } = props
const { locale, slug } = await params
// Enable static rendering // Enable static rendering
unstable_setRequestLocale(params.locale) setRequestLocale(locale)
const blogPost = await getBlogPostBySlug(params.slug) const blogPost = await getBlogPostBySlug(slug)
if (blogPost == null) { if (blogPost == null) {
return notFound() return notFound()
} }

View File

@@ -1,6 +1,6 @@
import { getBlogPosts } from "@repo/blog" import { getBlogPosts } from "@repo/blog"
import { BlogPosts } from "@repo/blog/BlogPosts" import { BlogPosts } from "@repo/blog/BlogPosts"
import type { LocaleProps } from "@repo/i18n/config" import type { LocaleProps } from "@repo/i18n/routing"
import { MainLayout } from "@repo/ui/Layout/MainLayout" import { MainLayout } from "@repo/ui/Layout/MainLayout"
import { import {
Section, Section,
@@ -9,7 +9,7 @@ import {
} from "@repo/ui/Layout/Section" } from "@repo/ui/Layout/Section"
import { LOCALE_DEFAULT } from "@repo/utils/constants" import { LOCALE_DEFAULT } from "@repo/utils/constants"
import type { Metadata } from "next" import type { Metadata } from "next"
import { unstable_setRequestLocale } from "next-intl/server" import { setRequestLocale } from "next-intl/server"
const title = "Blog | Théo LUDWIG" const title = "Blog | Théo LUDWIG"
const description = const description =
@@ -36,8 +36,9 @@ interface BlogPageProps extends LocaleProps {}
const BlogPage: React.FC<BlogPageProps> = async (props) => { const BlogPage: React.FC<BlogPageProps> = async (props) => {
const { params } = props const { params } = props
const { locale } = await params
// Enable static rendering // Enable static rendering
unstable_setRequestLocale(params.locale) setRequestLocale(locale)
const posts = await getBlogPosts() const posts = await getBlogPosts()

View File

@@ -1,18 +1,19 @@
import "@repo/config-tailwind/styles.css" import "@repo/config-tailwind/styles.css"
import type { LocaleProps } from "@repo/i18n/config" import type { LocaleProps } from "@repo/i18n/routing"
import { Footer } from "@repo/ui/Layout/Footer" import { Footer } from "@repo/ui/Layout/Footer"
import { Header } from "@repo/ui/Layout/Header" import { Header } from "@repo/ui/Layout/Header"
import { ThemeProvider } from "@repo/ui/Layout/Header/SwitchTheme" import { ThemeProvider } from "@repo/ui/Layout/Header/SwitchTheme"
import { VERSION } from "@repo/utils/constants" import { VERSION } from "@repo/utils/constants"
import { unstable_setRequestLocale } from "next-intl/server" import { setRequestLocale } from "next-intl/server"
interface MainLayoutProps extends React.PropsWithChildren, LocaleProps {} interface MainLayoutProps extends React.PropsWithChildren, LocaleProps {}
const MainLayout: React.FC<MainLayoutProps> = async (props) => { const MainLayout: React.FC<MainLayoutProps> = async (props) => {
const { children, params } = props const { children, params } = props
const { locale } = await params
// Enable static rendering // Enable static rendering
unstable_setRequestLocale(params.locale) setRequestLocale(locale)
return ( return (
<ThemeProvider> <ThemeProvider>

View File

@@ -1,4 +1,4 @@
import type { LocaleProps } from "@repo/i18n/config" import type { LocaleProps } from "@repo/i18n/routing"
import { About } from "@repo/ui/Home/About" import { About } from "@repo/ui/Home/About"
import { Interests } from "@repo/ui/Home/Interests" import { Interests } from "@repo/ui/Home/Interests"
import { OpenSource } from "@repo/ui/Home/OpenSource" import { OpenSource } from "@repo/ui/Home/OpenSource"
@@ -6,15 +6,16 @@ import { Portfolio } from "@repo/ui/Home/Portfolio"
import { Skills } from "@repo/ui/Home/Skills" import { Skills } from "@repo/ui/Home/Skills"
import { MainLayout } from "@repo/ui/Layout/MainLayout" import { MainLayout } from "@repo/ui/Layout/MainLayout"
import { RevealFade } from "@repo/ui/Layout/Section" import { RevealFade } from "@repo/ui/Layout/Section"
import { unstable_setRequestLocale } from "next-intl/server" import { setRequestLocale } from "next-intl/server"
interface HomePageProps extends LocaleProps {} interface HomePageProps extends LocaleProps {}
const HomePage: React.FC<HomePageProps> = (props) => { const HomePage: React.FC<HomePageProps> = async (props) => {
const { params } = props const { params } = props
const { locale } = await params
// Enable static rendering // Enable static rendering
unstable_setRequestLocale(params.locale) setRequestLocale(locale)
return ( return (
<MainLayout> <MainLayout>

View File

@@ -1,7 +1,7 @@
import "@repo/config-tailwind/styles.css" import "@repo/config-tailwind/styles.css"
import type { LocaleProps } from "@repo/i18n/config" import type { LocaleProps } from "@repo/i18n/routing"
import { ThemeProvider } from "@repo/ui/Layout/Header/SwitchTheme" import { ThemeProvider } from "@repo/ui/Layout/Header/SwitchTheme"
import { unstable_setRequestLocale } from "next-intl/server" import { setRequestLocale } from "next-intl/server"
interface CurriculumVitaeLayoutProps interface CurriculumVitaeLayoutProps
extends React.PropsWithChildren, extends React.PropsWithChildren,
@@ -12,8 +12,9 @@ const CurriculumVitaeLayout: React.FC<CurriculumVitaeLayoutProps> = async (
) => { ) => {
const { children, params } = props const { children, params } = props
const { locale } = await params
// Enable static rendering // Enable static rendering
unstable_setRequestLocale(params.locale) setRequestLocale(locale)
return <ThemeProvider forcedTheme="light">{children}</ThemeProvider> return <ThemeProvider forcedTheme="light">{children}</ThemeProvider>
} }

View File

@@ -1,14 +1,15 @@
import type { LocaleProps } from "@repo/i18n/config" import type { LocaleProps } from "@repo/i18n/routing"
import { CurriculumVitae } from "@repo/ui/CurriculumVitae" import { CurriculumVitae } from "@repo/ui/CurriculumVitae"
import { unstable_setRequestLocale } from "next-intl/server" import { setRequestLocale } from "next-intl/server"
interface CurriculumVitaeProps extends LocaleProps {} interface CurriculumVitaeProps extends LocaleProps {}
const CurriculumVitaePage: React.FC<CurriculumVitaeProps> = (props) => { const CurriculumVitaePage: React.FC<CurriculumVitaeProps> = async (props) => {
const { params } = props const { params } = props
const { locale } = await params
// Enable static rendering // Enable static rendering
unstable_setRequestLocale(params.locale) setRequestLocale(locale)
return <CurriculumVitae /> return <CurriculumVitae />
} }

View File

@@ -1,24 +1,32 @@
import "@repo/config-tailwind/styles.css" import "@repo/config-tailwind/styles.css"
import type { LocaleProps } from "@repo/i18n/config" import type { LocaleProps } from "@repo/i18n/routing"
import type { Locale } from "@repo/utils/constants" import type { Locale } from "@repo/utils/constants"
import { LOCALES } from "@repo/utils/constants" import { LOCALES } from "@repo/utils/constants"
import type { Metadata } from "next" import type { Metadata, Viewport } from "next"
import { NextIntlClientProvider } from "next-intl" import { NextIntlClientProvider } from "next-intl"
import { import {
getMessages, getMessages,
getTranslations, getTranslations,
unstable_setRequestLocale, setRequestLocale,
} from "next-intl/server" } from "next-intl/server"
import Script from "next/script"
const DOMAIN = "theoludwig.fr"
export const viewport: Viewport = {
themeColor: "#00aeff",
}
export const generateMetadata = async ({ export const generateMetadata = async ({
params, params,
}: LocaleProps): Promise<Metadata> => { }: LocaleProps): Promise<Metadata> => {
const t = await getTranslations({ locale: params.locale }) const { locale } = await params
const t = await getTranslations({ locale })
const title = t("meta.title") const title = t("meta.title")
const description = `${title} - ${t("meta.description")}` const description = `${title} - ${t("meta.description")}`
const image = "/images/logo.webp" const image = "/images/logo.webp"
const url = new URL("https://theoludwig.fr") const url = new URL(`https://${DOMAIN}`)
const locale = LOCALES.join(", ") const locales = LOCALES.join(", ")
return { return {
title, title,
@@ -36,7 +44,7 @@ export const generateMetadata = async ({
height: 96, height: 96,
}, },
], ],
locale, locale: locales,
type: "website", type: "website",
}, },
twitter: { twitter: {
@@ -61,17 +69,24 @@ interface LocaleLayoutProps extends React.PropsWithChildren, LocaleProps {}
const LocaleLayout: React.FC<LocaleLayoutProps> = async (props) => { const LocaleLayout: React.FC<LocaleLayoutProps> = async (props) => {
const { children, params } = props const { children, params } = props
const { locale } = await params
// Enable static rendering // Enable static rendering
unstable_setRequestLocale(params.locale) setRequestLocale(locale)
const messages = await getMessages() const messages = await getMessages()
return ( return (
<html lang={params.locale} suppressHydrationWarning> <html lang={locale} suppressHydrationWarning>
<body> <body>
<NextIntlClientProvider messages={messages}> <NextIntlClientProvider messages={messages}>
{children} {children}
</NextIntlClientProvider> </NextIntlClientProvider>
<Script
defer
data-domain={DOMAIN}
src="https://plausible.theoludwig.fr/js/script.js"
/>
</body> </body>
</html> </html>
) )

View File

@@ -0,0 +1,13 @@
import typescriptESLint from "typescript-eslint"
import configNextjs from "@repo/config-eslint/nextjs"
export default typescriptESLint.config(...configNextjs, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})

View File

@@ -1,3 +0,0 @@
import i18nConfig from "@repo/i18n/i18n"
export default i18nConfig

View File

@@ -0,0 +1,3 @@
import i18nRequestConfig from "@repo/i18n/request"
export default i18nRequestConfig

View File

@@ -1,25 +1,26 @@
import { LOCALES, LOCALE_DEFAULT, LOCALE_PREFIX } from "@repo/utils/constants" import { routing } from "@repo/i18n/routing"
import createMiddleware from "next-intl/middleware" import createIntlMiddleware from "next-intl/middleware"
export default createMiddleware({ const intlMiddleware = createIntlMiddleware(routing)
locales: LOCALES,
defaultLocale: LOCALE_DEFAULT, export default intlMiddleware
localePrefix: LOCALE_PREFIX,
})
export const config = { export const config = {
matcher: [ matcher: [
// Enable a redirect to a matching locale at the root // Enable a redirect to a matching locale at the root
"/", "/",
// Set a cookie to remember the previous locale for
// all requests that have a locale prefix
// Next.js issue, middleware matcher should support template literals: // Next.js issue, middleware matcher should support template literals:
// https://github.com/vercel/next.js/issues/56398 // https://github.com/vercel/next.js/issues/56398
"/(en-US|fr-FR)/:path*", "/(en-US|fr-FR)/:path*",
// Enable redirects that add missing locales /*
// (e.g. `/pathnames` -> `/en/pathnames`) * Match all request paths except for the ones starting with:
"/((?!_next|_vercel|.*\\..*).*)", * - api (API routes)
* - _next/static (static files)
* - _next/image (image optimization files)
* - favicon.ico (favicon file)
*/
"/((?!api|_next/static|_next/image|images|favicon.ico).*)",
], ],
} }

View File

@@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" /> /// <reference types="next/image-types/global" />
// NOTE: This file should not be edited // NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@@ -9,10 +9,6 @@ const nextConfig = {
unoptimized: true, unoptimized: true,
}, },
compress: false, compress: false,
// https://github.com/hashicorp/next-mdx-remote/issues/436#issuecomment-2066971842
transpilePackages: ["next-mdx-remote", "shiki"],
eslint: { eslint: {
ignoreDuringBuilds: true, ignoreDuringBuilds: true,
}, },

View File

@@ -1,16 +1,16 @@
{ {
"name": "@repo/website", "name": "@repo/website",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"imports": { "imports": {
"#*": "./*" "#*": "./*"
}, },
"scripts": { "scripts": {
"dev": "next dev --port 3000 --turbo", "dev": "next dev --port 3000 --turbopack",
"build": "next build", "build": "next build",
"start": "next start --port 3000", "start": "next start --port 3000",
"lint:eslint": "eslint . --max-warnings 0 --report-unused-disable-directives", "lint:eslint": "eslint . --max-warnings 0",
"lint:typescript": "tsc --noEmit" "lint:typescript": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
@@ -19,13 +19,16 @@
"@repo/utils": "workspace:*", "@repo/utils": "workspace:*",
"@repo/i18n": "workspace:*", "@repo/i18n": "workspace:*",
"@repo/ui": "workspace:*", "@repo/ui": "workspace:*",
"@mdx-js/mdx": "catalog:",
"next-mdx-remote": "catalog:",
"shiki": "catalog:",
"next": "catalog:", "next": "catalog:",
"next-intl": "catalog:", "next-intl": "catalog:",
"react": "catalog:", "react": "catalog:",
"react-dom": "catalog:" "react-dom": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "workspace:*", "@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*", "@repo/config-typescript": "workspace:*",
"@types/node": "catalog:", "@types/node": "catalog:",
"@types/react": "catalog:", "@types/react": "catalog:",
@@ -34,6 +37,7 @@
"eslint": "catalog:", "eslint": "catalog:",
"postcss": "catalog:", "postcss": "catalog:",
"tailwindcss": "catalog:", "tailwindcss": "catalog:",
"typescript-eslint": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }
} }

View File

@@ -6,6 +6,8 @@ services:
build: build:
context: "./" context: "./"
dockerfile: "./apps/website/Dockerfile" dockerfile: "./apps/website/Dockerfile"
args:
VERSION: ${VERSION-0.0.0-develop}
ports: ports:
- "${WEBSITE_PORT-3000}:${WEBSITE_PORT-3000}" - "${WEBSITE_PORT-3000}:${WEBSITE_PORT-3000}"
environment: environment:

View File

@@ -0,0 +1,35 @@
import typescriptESLint from "typescript-eslint"
import configConventions from "eslint-config-conventions"
import importX from "eslint-plugin-import-x"
export default typescriptESLint.config(
{
ignores: [
".next",
"**/next.config.js",
"**/eslint.config.js",
"**/tailwind.config.js",
"**/postcss.config.js",
"**/kysely.config.ts",
],
},
...configConventions,
{
name: "config-eslint",
plugins: {
"import-x": importX,
},
rules: {
"import-x/extensions": [
"error",
"ignorePackages",
{
ts: "always",
tsx: "always",
js: "never",
jsx: "never",
},
],
},
},
)

7
configs/config-eslint/index.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
import type typescriptESLint from "typescript-eslint"
declare const eslintConfigConventions: ReturnType<
typeof typescriptESLint.config
>
export default eslintConfigConventions

View File

@@ -0,0 +1,61 @@
import { FlatCompat } from "@eslint/eslintrc"
import storybook from "eslint-plugin-storybook"
import tailwind from "eslint-plugin-tailwindcss"
import typescriptESLint from "typescript-eslint"
import config from "../eslint.config.js"
const flatCompat = new FlatCompat()
export default typescriptESLint.config(
...config,
...flatCompat.extends("next/core-web-vitals"),
...tailwind.configs["flat/recommended"],
...storybook.configs["flat/recommended"],
{
name: "config-eslint/nextjs",
settings: {
tailwindcss: {
callees: ["classNames", "cva"],
},
react: {
version: "detect",
},
},
rules: {
"tailwindcss/classnames-order": "off",
"tailwindcss/no-custom-classname": "off",
"@next/next/no-html-link-for-pages": "off",
"@next/next/no-img-element": "off",
"react/self-closing-comp": [
"error",
{
component: true,
html: true,
},
],
"react/void-dom-elements-no-children": "error",
"react/jsx-boolean-value": "error",
"no-restricted-imports": [
"error",
{
paths: [
{
name: "next/link",
message: "Please import from `@repo/i18n/routing` instead.",
},
{
name: "next/navigation",
importNames: [
"redirect",
"permanentRedirect",
"useRouter",
"usePathname",
],
message: "Please import from `@repo/i18n/routing` instead.",
},
],
},
],
},
},
)

View File

@@ -0,0 +1,34 @@
{
"name": "@repo/config-eslint",
"version": "0.0.0-develop",
"private": true,
"type": "module",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./eslint.config.js",
"require": "./eslint.config.js",
"default": "./eslint.config.js"
},
"./nextjs": {
"types": "./index.d.ts",
"import": "./nextjs/eslint.config.js",
"require": "./nextjs/eslint.config.js",
"default": "./nextjs/eslint.config.js"
}
},
"devDependencies": {
"@eslint/eslintrc": "catalog:",
"typescript-eslint": "catalog:",
"eslint": "catalog:",
"eslint-config-conventions": "catalog:",
"eslint-plugin-promise": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"eslint-config-next": "catalog:",
"eslint-plugin-storybook": "catalog:",
"eslint-plugin-tailwindcss": "catalog:",
"eslint-plugin-import-x": "catalog:",
"typescript": "catalog:",
"globals": "catalog:"
}
}

View File

@@ -0,0 +1,13 @@
import typescriptESLint from "typescript-eslint"
import config from "@repo/config-eslint"
export default typescriptESLint.config(...config, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})

View File

@@ -1,6 +1,6 @@
{ {
"name": "@repo/config-tailwind", "name": "@repo/config-tailwind",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"main": "./tailwind.config.js", "main": "./tailwind.config.js",
@@ -21,9 +21,10 @@
"tailwind-merge": "catalog:" "tailwind-merge": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "workspace:*", "@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*", "@repo/config-typescript": "workspace:*",
"@tailwindcss/typography": "catalog:", "@tailwindcss/typography": "catalog:",
"typescript-eslint": "catalog:",
"eslint": "catalog:", "eslint": "catalog:",
"postcss": "catalog:", "postcss": "catalog:",
"tailwindcss": "catalog:" "tailwindcss": "catalog:"

View File

@@ -9,6 +9,11 @@
@tailwind utilities; @tailwind utilities;
@layer base { @layer base {
[type="search"]::-webkit-search-decoration,
[type="search"]::-webkit-search-cancel-button {
appearance: none;
}
b, b,
strong { strong {
@apply font-semibold; @apply font-semibold;
@@ -36,11 +41,11 @@
@apply italic tracking-wider; @apply italic tracking-wider;
} }
blockquote { blockquote {
@apply border-gray border-l-4 pl-3 italic; @apply border-gray-lighter border-l-4 pl-3 italic;
} }
kbd { kbd {
@apply bg-gray rounded-md px-2 dark:text-black; @apply bg-gray-lighter rounded-md px-2 dark:text-black;
} }
mark { mark {
@@ -82,7 +87,7 @@ body {
} }
.prose { .prose {
@apply dark:text-gray !max-w-5xl scroll-smooth text-black; @apply dark:text-gray-lighter !max-w-5xl scroll-smooth text-black;
} }
.prose p { .prose p {
@@ -107,7 +112,7 @@ body {
} }
.prose strong { .prose strong {
@apply dark:text-gray text-black; @apply dark:text-gray-lighter text-black;
} }
.prose h2, .prose h2,
@@ -151,10 +156,6 @@ code .line::before {
word-break: normal; word-break: normal;
} }
code .line:last-child {
display: none;
}
.katex .base { .katex .base {
display: inline !important; display: inline !important;
white-space: normal !important; white-space: normal !important;

View File

@@ -0,0 +1,51 @@
import typographyPlugin from "@tailwindcss/typography"
/** @type {Omit<import('tailwindcss').Config, "content">} */
const config = {
darkMode: "selector",
theme: {
extend: {
colors: {
primary: {
DEFAULT: "#0056b3",
dark: "#00aeff",
},
background: {
DEFAULT: "#fff",
dark: "#181818",
},
"gray-lighter": "#d1d5db",
"gray-darker": {
DEFAULT: "#4b5563",
dark: "#9ca3af",
},
yellow: "#fef08a",
},
boxShadow: {
dark: "0px 0px 2px 2px rgba(0, 0, 0, 0.25)",
light: "0px 0px 2px 2px rgba(0, 0, 0, 0.10)",
darkFlag: "0px 1px 10px hsla(0, 0%, 100%, 0.2)",
lightFlag: "0px 1px 10px rgba(0, 0, 0, 0.25)",
},
fontFamily: {
sans: ["Montserrat", "sans-serif"],
},
typography: {
DEFAULT: {
css: {
a: {
textDecoration: "none",
"&:hover": {
textDecoration: "underline",
fontWeight: 400,
},
},
},
},
},
},
},
plugins: [typographyPlugin],
}
export default config

View File

@@ -1,6 +1,6 @@
{ {
"name": "@repo/config-typescript", "name": "@repo/config-typescript",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"files": [ "files": [
"tsconfig.json" "tsconfig.json"

View File

@@ -24,9 +24,6 @@
"target": "ESNext", "target": "ESNext",
"module": "ESNext", "module": "ESNext",
"moduleResolution": "Bundler", "moduleResolution": "Bundler",
"resolveJsonModule": true, "resolveJsonModule": true
"experimentalDecorators": true,
"emitDecoratorMetadata": true
} }
} }

View File

@@ -1,12 +1,12 @@
{ {
"name": "repo", "name": "repo",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"packageManager": "pnpm@9.12.1+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4", "packageManager": "pnpm@10.2.1+sha512.398035c7bd696d0ba0b10a688ed558285329d27ea994804a52bad9167d8e3a72bcb993f9699585d3ca25779ac64949ef422757a6c31102c12ab932e5cbe5cc92",
"engines": { "engines": {
"node": ">=22.0.0", "node": ">=22.12.0",
"pnpm": ">=9.12.1" "pnpm": ">=10.2.1"
}, },
"scripts": { "scripts": {
"build": "turbo run build", "build": "turbo run build",
@@ -17,13 +17,9 @@
"lint:markdown": "markdownlint-cli2", "lint:markdown": "markdownlint-cli2",
"lint:typescript": "turbo run lint:typescript", "lint:typescript": "turbo run lint:typescript",
"lint:eslint": "turbo run lint:eslint", "lint:eslint": "turbo run lint:eslint",
"lint:prettier": "prettier . --check", "lint:prettier": "prettier . --check"
"release": "semantic-release"
}, },
"devDependencies": { "devDependencies": {
"@saithodev/semantic-release-backmerge": "catalog:",
"@semantic-release/exec": "catalog:",
"@semantic-release/git": "catalog:",
"editorconfig-checker": "catalog:", "editorconfig-checker": "catalog:",
"playwright": "catalog:", "playwright": "catalog:",
"prettier": "catalog:", "prettier": "catalog:",
@@ -31,8 +27,6 @@
"markdownlint-cli2": "catalog:", "markdownlint-cli2": "catalog:",
"markdownlint": "catalog:", "markdownlint": "catalog:",
"markdownlint-rule-relative-links": "catalog:", "markdownlint-rule-relative-links": "catalog:",
"replace-in-files-cli": "catalog:",
"semantic-release": "catalog:",
"turbo": "catalog:", "turbo": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }

View File

@@ -1,14 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config/nextjs/.eslintrc.json"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projectService": true
}
}
]
}

View File

@@ -0,0 +1,13 @@
import typescriptESLint from "typescript-eslint"
import configNextjs from "@repo/config-eslint/nextjs"
export default typescriptESLint.config(...configNextjs, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})

View File

@@ -1,6 +1,6 @@
{ {
"name": "@repo/blog", "name": "@repo/blog",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"exports": { "exports": {
@@ -9,7 +9,7 @@
"./BlogPostUI": "./src/BlogPostUI.tsx" "./BlogPostUI": "./src/BlogPostUI.tsx"
}, },
"scripts": { "scripts": {
"lint:eslint": "eslint src --max-warnings 0 --report-unused-disable-directives", "lint:eslint": "eslint src --max-warnings 0",
"lint:typescript": "tsc --noEmit" "lint:typescript": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
@@ -37,7 +37,7 @@
"react-icons": "catalog:" "react-icons": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "workspace:*", "@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*", "@repo/config-typescript": "workspace:*",
"@types/node": "catalog:", "@types/node": "catalog:",
"@types/react": "catalog:", "@types/react": "catalog:",
@@ -49,6 +49,7 @@
"eslint": "catalog:", "eslint": "catalog:",
"postcss": "catalog:", "postcss": "catalog:",
"tailwindcss": "catalog:", "tailwindcss": "catalog:",
"typescript-eslint": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }
} }

View File

@@ -9,7 +9,7 @@ import rehypeSlug from "rehype-slug"
import remarkGfm from "remark-gfm" import remarkGfm from "remark-gfm"
import remarkMath from "remark-math" import remarkMath from "remark-math"
import { Link } from "@repo/i18n/navigation" import { Link } from "@repo/i18n/routing"
import "katex/dist/katex.min.css" import "katex/dist/katex.min.css"
import { BlogPostComments } from "./BlogPostComments.tsx" import { BlogPostComments } from "./BlogPostComments.tsx"
@@ -103,13 +103,14 @@ export const BlogPostContent: React.FC<BlogPostContentProps> = async (
}, },
a: (props) => { a: (props) => {
const { href = "", ...rest } = props const { href = "", ...rest } = props
if (href.startsWith("#")) { const hrefString = href as string
if (hrefString.startsWith("#")) {
return <a {...props} /> return <a {...props} />
} }
if (href.startsWith("../posts/")) { if (hrefString.startsWith("../posts/")) {
return ( return (
<Link <Link
href={href href={hrefString
.replace("../posts/", "/blog/") .replace("../posts/", "/blog/")
.replace(".md", "")} .replace(".md", "")}
{...rest} {...rest}

View File

@@ -1,4 +1,4 @@
import { Link } from "@repo/i18n/navigation" import { Link } from "@repo/i18n/routing"
import { Typography } from "@repo/ui/Design/Typography" import { Typography } from "@repo/ui/Design/Typography"
import { Section, SectionContent } from "@repo/ui/Layout/Section" import { Section, SectionContent } from "@repo/ui/Layout/Section"
import { getISODate } from "@repo/utils/dates" import { getISODate } from "@repo/utils/dates"

View File

@@ -1,26 +0,0 @@
{
"extends": ["conventions"],
"plugins": ["import-x"],
"rules": {
"import-x/no-absolute-path": "error",
"import-x/no-webpack-loader-syntax": "error",
"import-x/no-self-import": "error",
"import-x/no-useless-path-segments": "error",
"import-x/export": "error",
"import-x/no-duplicates": "error",
"import-x/no-named-default": "error",
"import-x/no-empty-named-blocks": "error",
"import-x/no-anonymous-default-export": "error",
"import-x/extensions": [
"error",
"ignorePackages",
{
"ts": "always",
"tsx": "always",
"js": "never",
"jsx": "never"
}
],
"import-x/consistent-type-specifier-style": ["error", "prefer-top-level"]
}
}

View File

@@ -1,57 +0,0 @@
{
"extends": [
"../.eslintrc.json",
"next/core-web-vitals",
"plugin:tailwindcss/recommended",
"plugin:storybook/recommended"
],
"ignorePatterns": [
"next.config.js",
"tailwind.config.js",
"postcss.config.js",
"vitest.config.ts"
],
"settings": {
"tailwindcss": {
"callees": ["classNames", "cva"]
},
"react": {
"version": "detect"
}
},
"rules": {
"tailwindcss/classnames-order": "off",
"tailwindcss/no-custom-classname": "off",
"@next/next/no-html-link-for-pages": "off",
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
],
"react/void-dom-elements-no-children": "error",
"react/jsx-boolean-value": "error",
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "next/link",
"message": "Please import from `@repo/i18n/navigation` instead."
},
{
"name": "next/navigation",
"importNames": [
"redirect",
"permanentRedirect",
"useRouter",
"usePathname"
],
"message": "Please import from `@repo/i18n/navigation` instead."
}
]
}
]
}
}

View File

@@ -1,23 +0,0 @@
{
"name": "@repo/eslint-config",
"version": "4.0.0",
"private": true,
"main": ".eslintrc.json",
"files": [
".eslintrc.json",
"nextjs/.eslintrc.json"
],
"devDependencies": {
"@typescript-eslint/eslint-plugin": "catalog:",
"@typescript-eslint/parser": "catalog:",
"eslint": "catalog:",
"eslint-config-conventions": "catalog:",
"eslint-plugin-promise": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"eslint-config-next": "catalog:",
"eslint-plugin-storybook": "catalog:",
"eslint-plugin-tailwindcss": "catalog:",
"eslint-plugin-import-x": "catalog:",
"typescript": "catalog:"
}
}

View File

@@ -1,14 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projectService": true
}
}
]
}

View File

@@ -1,57 +0,0 @@
import typographyPlugin from "@tailwindcss/typography"
import { fontFamily } from "tailwindcss/defaultTheme"
/** @type {Omit<import('tailwindcss').Config, "content">} */
const config = {
darkMode: "class",
theme: {
colors: {
primary: {
DEFAULT: "#0056b3",
dark: "#00aeff",
},
background: {
DEFAULT: "#fff",
dark: "#181818",
},
white: "#fff",
black: "#000",
gray: "#d1d5db",
"gray-darker": {
DEFAULT: "#4b5563",
dark: "#9ca3af",
},
yellow: "#fef08a",
transparent: "transparent",
inherit: "inherit",
current: "currentColor",
},
boxShadow: {
dark: "0px 0px 2px 2px rgba(0, 0, 0, 0.25)",
light: "0px 0px 2px 2px rgba(0, 0, 0, 0.10)",
darkFlag: "0px 1px 10px hsla(0, 0%, 100%, 0.2)",
lightFlag: "0px 1px 10px rgba(0, 0, 0, 0.25)",
},
fontFamily: {
sans: ["'Montserrat'", ...fontFamily.sans],
},
extend: {
typography: {
DEFAULT: {
css: {
a: {
textDecoration: "none",
"&:hover": {
textDecoration: "underline",
fontWeight: 400,
},
},
},
},
},
},
},
plugins: [typographyPlugin],
}
export default config

View File

@@ -1,14 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projectService": true
}
}
]
}

View File

@@ -0,0 +1,13 @@
import typescriptESLint from "typescript-eslint"
import config from "@repo/config-eslint"
export default typescriptESLint.config(...config, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})

View File

@@ -1,36 +1,33 @@
{ {
"name": "@repo/i18n", "name": "@repo/i18n",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"exports": { "exports": {
"./translations/*.json": "./src/translations/*.json", "./translations/*.json": "./src/translations/*.json",
"./config": "./src/config.tsx",
"./i18n": "./src/i18n.ts",
"./messages.d.ts": "./src/messages.d.ts", "./messages.d.ts": "./src/messages.d.ts",
"./navigation": "./src/navigation.ts" "./request": "./src/request.ts",
"./routing": "./src/routing.ts"
}, },
"scripts": { "scripts": {
"lint:eslint": "eslint src --max-warnings 0 --report-unused-disable-directives", "lint:eslint": "eslint src --max-warnings 0",
"lint:typescript": "tsc --noEmit", "lint:typescript": "tsc --noEmit"
"test": "vitest run"
}, },
"dependencies": { "dependencies": {
"@repo/utils": "workspace:*", "@repo/utils": "workspace:*",
"deepmerge": "catalog:",
"next": "catalog:", "next": "catalog:",
"next-intl": "catalog:", "next-intl": "catalog:",
"react": "catalog:", "react": "catalog:",
"react-dom": "catalog:" "react-dom": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "workspace:*", "@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*", "@repo/config-typescript": "workspace:*",
"@types/react": "catalog:", "@types/react": "catalog:",
"@types/react-dom": "catalog:", "@types/react-dom": "catalog:",
"@total-typescript/ts-reset": "catalog:", "@total-typescript/ts-reset": "catalog:",
"eslint": "catalog:", "eslint": "catalog:",
"typescript": "catalog:", "typescript-eslint": "catalog:",
"vitest": "catalog:" "typescript": "catalog:"
} }
} }

View File

@@ -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>
},
}

View File

@@ -1,6 +1,6 @@
import type en from "./translations/en-US.json" import type fr from "./translations/fr-FR.json"
type Messages = typeof en type Messages = typeof fr
declare global { declare global {
/** /**

View File

@@ -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,
})

View File

@@ -1,28 +1,27 @@
import deepmerge from "deepmerge"
import type { AbstractIntlMessages } from "next-intl" import type { AbstractIntlMessages } from "next-intl"
import { getRequestConfig } from "next-intl/server" import { getRequestConfig } from "next-intl/server"
import { notFound } from "next/navigation"
import type { Locale } from "@repo/utils/constants" import type { Locale } from "@repo/utils/constants"
import { LOCALE_DEFAULT, LOCALES } from "@repo/utils/constants" import { LOCALE_DEFAULT, LOCALES } from "@repo/utils/constants"
import { defaultTranslationValues } from "./config.tsx" import { deepMerge } from "@repo/utils/objects"
export default getRequestConfig(async ({ locale }) => { export default getRequestConfig(async ({ requestLocale }) => {
let locale = await requestLocale
if (!LOCALES.includes(locale as Locale)) { if (!LOCALES.includes(locale as Locale)) {
return notFound() locale = LOCALE_DEFAULT
} }
const userMessages = (await import(`./translations/${locale}.json`)).default const userMessages = (await import(`./translations/${locale}.json`)).default
const defaultMessages = ( const defaultMessages = (
await import(`./translations/${LOCALE_DEFAULT}.json`) await import(`./translations/${LOCALE_DEFAULT}.json`)
).default ).default
const messages = deepmerge<AbstractIntlMessages>( const messages = deepMerge<AbstractIntlMessages>(
defaultMessages, defaultMessages,
userMessages, userMessages,
) )
return { return {
locale,
messages, messages,
defaultTranslationValues,
} }
}) })

View File

@@ -0,0 +1,33 @@
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"
// Countries: https://github.com/umpirsky/country-list/blob/master/data/en/country.json
// Country flag picture: https://purecatamphetamine.github.io/country-flag-icons/3x2/US.svg
// Locale codes: https://simplelocalize.io/data/locales/
// Locale code is a combination of ISO 639-1 language code and ISO 3166-1 country code.
// For example, `fr-FR` is a locale code for French language in France.
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)

View File

@@ -1,7 +0,0 @@
import { expectTypeOf, test } from "vitest"
import en from "../translations/en-US.json"
import fr from "../translations/fr-FR.json"
test("translations types should match", () => {
expectTypeOf(en).toEqualTypeOf(fr)
})

View File

@@ -1,4 +1,24 @@
{ {
"meta": {
"description": "Developer Full Stack • Open-Source Enthusiast",
"title": "Théo LUDWIG"
},
"locales": {
"en-US": "English",
"fr-FR": "French"
},
"loading": "Loading...",
"errors": {
"error": "Error",
"not-found": "Not Found",
"page-doesnt-exist": "This page doesn't exist!",
"return-to-home-page": "Return to the home page?",
"server-error": "Internal Server Error!",
"try-again": "Try again?"
},
"footer": {
"all-rights-reserved": "All rights reserved"
},
"curriculum-vitae": { "curriculum-vitae": {
"about": { "about": {
"description": "I constantly wonder how to improve our present, to make our future better, particularly thanks to the advancements in computer science. <br></br> My priority is to craft intuitive user experiences (UX), that meet the needs of the users in the most efficient way possible.", "description": "I constantly wonder how to improve our present, to make our future better, particularly thanks to the advancements in computer science. <br></br> My priority is to craft intuitive user experiences (UX), that meet the needs of the users in the most efficient way possible.",
@@ -10,10 +30,10 @@
"institution": "Conservatoire National des Arts et Métiers (CNAM), in Eckbolsheim - UIMM Alsace - ITII Alsace", "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)", "study-type": "Engineer in Computer Science and Information Systems (IS)",
"years": { "years": {
"2024-2025": { "2024-2027": {
"courses": {}, "courses": {},
"description": "1st year", "description": "",
"title": "2024 - 2025" "title": "2024 - 2027"
} }
} }
}, },
@@ -84,17 +104,6 @@
"title": "Work experiences" "title": "Work experiences"
} }
}, },
"errors": {
"error": "Error",
"not-found": "Not Found",
"page-doesnt-exist": "This page doesn't exist!",
"return-to-home-page": "Return to the home page?",
"server-error": "Internal Server Error!",
"try-again": "Try again?"
},
"footer": {
"all-rights-reserved": "All rights reserved"
},
"home": { "home": {
"about": { "about": {
"birth-date": { "birth-date": {
@@ -150,13 +159,5 @@
"software-tools": "Software and tools", "software-tools": "Software and tools",
"title": "Skills" "title": "Skills"
} }
},
"locales": {
"en-US": "English",
"fr-FR": "French"
},
"meta": {
"description": "Developer Full Stack • Open-Source Enthusiast",
"title": "Théo LUDWIG"
} }
} }

View File

@@ -1,4 +1,24 @@
{ {
"meta": {
"description": "Développeur Full Stack • Enthousiaste de l'Open-Source",
"title": "Théo LUDWIG"
},
"locales": {
"en-US": "Anglais",
"fr-FR": "Français"
},
"loading": "Chargement...",
"errors": {
"error": "Erreur",
"not-found": "Introuvable",
"page-doesnt-exist": "Cette page n'existe pas !",
"return-to-home-page": "Retour à la page d'accueil ?",
"server-error": "Erreur interne du serveur !",
"try-again": "Réessayer ?"
},
"footer": {
"all-rights-reserved": "Tous droits réservés"
},
"curriculum-vitae": { "curriculum-vitae": {
"about": { "about": {
"description": "Je me demande constamment comment améliorer notre présent, afin de rendre notre futur meilleur, particulièrement grâce aux progrès de l'informatique. <br></br> Ma priorité réside dans la création d'expériences utilisateurs (UX) intuitives, répondant aux besoins des utilisateurs de la manière la plus efficace que possible.", "description": "Je me demande constamment comment améliorer notre présent, afin de rendre notre futur meilleur, particulièrement grâce aux progrès de l'informatique. <br></br> Ma priorité réside dans la création d'expériences utilisateurs (UX) intuitives, répondant aux besoins des utilisateurs de la manière la plus efficace que possible.",
@@ -10,10 +30,10 @@
"institution": "Conservatoire National des Arts et Métiers (CNAM) à Eckbolsheim - UIMM Alsace - ITII Alsace", "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)", "study-type": "Ingénieur en Informatique et Systèmes d'Information (SI)",
"years": { "years": {
"2024-2025": { "2024-2027": {
"courses": {}, "courses": {},
"description": "1ère année", "description": "",
"title": "2024 - 2025" "title": "2024 - 2027"
} }
} }
}, },
@@ -84,17 +104,6 @@
"title": "Expériences professionnelles" "title": "Expériences professionnelles"
} }
}, },
"errors": {
"error": "Erreur",
"not-found": "Introuvable",
"page-doesnt-exist": "Cette page n'existe pas !",
"return-to-home-page": "Retour à la page d'accueil ?",
"server-error": "Erreur interne du serveur !",
"try-again": "Réessayer ?"
},
"footer": {
"all-rights-reserved": "Tous droits réservés"
},
"home": { "home": {
"about": { "about": {
"birth-date": { "birth-date": {
@@ -150,13 +159,5 @@
"software-tools": "Logiciels et outils", "software-tools": "Logiciels et outils",
"title": "Compétences" "title": "Compétences"
} }
},
"locales": {
"en-US": "Anglais",
"fr-FR": "Français"
},
"meta": {
"description": "Développeur Full Stack • Enthousiaste de l'Open-Source",
"title": "Théo LUDWIG"
} }
} }

View File

@@ -1,9 +0,0 @@
import { defineConfig } from "vitest/config"
export default defineConfig({
test: {
typecheck: {
enabled: true,
},
},
})

View File

@@ -1,14 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config/nextjs/.eslintrc.json"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projectService": true
}
}
]
}

View File

@@ -0,0 +1,13 @@
import typescriptESLint from "typescript-eslint"
import configNextjs from "@repo/config-eslint/nextjs"
export default typescriptESLint.config(...configNextjs, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})

View File

@@ -1,6 +1,6 @@
{ {
"name": "@repo/react-hooks", "name": "@repo/react-hooks",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"exports": { "exports": {
@@ -8,28 +8,22 @@
"./useIsMounted": "./src/useIsMounted.ts" "./useIsMounted": "./src/useIsMounted.ts"
}, },
"scripts": { "scripts": {
"lint:eslint": "eslint src --max-warnings 0 --report-unused-disable-directives", "lint:eslint": "eslint src --max-warnings 0",
"lint:typescript": "tsc --noEmit", "lint:typescript": "tsc --noEmit"
"test": "vitest run --browser.headless",
"test:ui": "vitest --ui --no-open"
}, },
"dependencies": { "dependencies": {
"react": "catalog:", "react": "catalog:",
"react-dom": "catalog:" "react-dom": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "workspace:*", "@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*", "@repo/config-typescript": "workspace:*",
"@testing-library/react": "catalog:",
"@types/react": "catalog:", "@types/react": "catalog:",
"@types/react-dom": "catalog:", "@types/react-dom": "catalog:",
"@total-typescript/ts-reset": "catalog:", "@total-typescript/ts-reset": "catalog:",
"@vitest/browser": "catalog:",
"@vitest/coverage-istanbul": "catalog:",
"@vitest/ui": "catalog:",
"eslint": "catalog:", "eslint": "catalog:",
"playwright": "catalog:", "playwright": "catalog:",
"typescript": "catalog:", "typescript": "catalog:",
"vitest": "catalog:" "typescript-eslint": "catalog:"
} }
} }

View File

@@ -1,83 +0,0 @@
import { act, renderHook } from "@testing-library/react"
import { describe, expect, it } from "vitest"
import { useBoolean } from "../useBoolean.ts"
describe("useBoolean", () => {
const initialValues = [true, false]
for (const initialValue of initialValues) {
it(`should set the initial value to ${initialValue}`, () => {
// Arrange - Given
const { result } = renderHook(() => {
return useBoolean({ initialValue })
})
// Assert - Then
expect(result.current.value).toBe(initialValue)
})
}
it("should by default set the initial value to false", () => {
// Arrange - Given
const { result } = renderHook(() => {
return useBoolean()
})
// Assert - Then
expect(result.current.value).toBe(false)
})
it("should toggle the value", () => {
// Arrange - Given
const { result } = renderHook(() => {
return useBoolean({ initialValue: false })
})
// Act - When
act(() => {
return result.current.toggle()
})
// Assert - Then
expect(result.current.value).toBe(true)
// Act - When
act(() => {
return result.current.toggle()
})
// Assert - Then
expect(result.current.value).toBe(false)
})
it("should set the value to true", () => {
// Arrange - Given
const { result } = renderHook(() => {
return useBoolean({ initialValue: false })
})
// Act - When
act(() => {
return result.current.setTrue()
})
// Assert - Then
expect(result.current.value).toBe(true)
})
it("should set the value to false", () => {
// Arrange - Given
const { result } = renderHook(() => {
return useBoolean({ initialValue: true })
})
// Act - When
act(() => {
return result.current.setFalse()
})
// Assert - Then
expect(result.current.value).toBe(false)
})
})

View File

@@ -1,16 +0,0 @@
import { renderHook } from "@testing-library/react"
import { describe, expect, it } from "vitest"
import { useIsMounted } from "../useIsMounted.ts"
describe("useIsMounted", () => {
it("should return true", () => {
// Arrange - Given
const { result } = renderHook(() => {
return useIsMounted()
})
// Assert - Then
expect(result.current.isMounted).toBe(true)
})
})

View File

@@ -18,11 +18,11 @@ export interface UseBooleanInput {
/** /**
* Hook to manage a boolean state. * Hook to manage a boolean state.
* @param options * @param input
* @returns * @returns
*/ */
export const useBoolean = (options: UseBooleanInput = {}): UseBooleanOutput => { export const useBoolean = (input: UseBooleanInput = {}): UseBooleanOutput => {
const { initialValue = false } = options const { initialValue = false } = input
const [value, setValue] = useState(initialValue) const [value, setValue] = useState(initialValue)

View File

@@ -1,15 +0,0 @@
import { defineConfig } from "vitest/config"
export default defineConfig({
test: {
browser: {
provider: "playwright",
enabled: true,
name: "chromium",
},
coverage: {
enabled: true,
provider: "istanbul",
},
},
})

View File

@@ -1,14 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config/nextjs/.eslintrc.json"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projectService": true
}
}
]
}

View File

@@ -0,0 +1,13 @@
import typescriptESLint from "typescript-eslint"
import configNextjs from "@repo/config-eslint/nextjs"
export default typescriptESLint.config(...configNextjs, {
files: ["**/*.ts", "**/*.tsx"],
languageOptions: {
parser: typescriptESLint.parser,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
})

View File

@@ -1,6 +1,6 @@
{ {
"name": "@repo/ui", "name": "@repo/ui",
"version": "4.0.0", "version": "0.0.0-develop",
"private": true, "private": true,
"type": "module", "type": "module",
"exports": { "exports": {
@@ -23,7 +23,7 @@
"./Layout/Section": "./src/Layout/Section/Section.tsx" "./Layout/Section": "./src/Layout/Section/Section.tsx"
}, },
"scripts": { "scripts": {
"lint:eslint": "eslint src --max-warnings 0 --report-unused-disable-directives", "lint:eslint": "eslint src --max-warnings 0",
"lint:typescript": "tsc --noEmit" "lint:typescript": "tsc --noEmit"
}, },
"dependencies": { "dependencies": {
@@ -40,7 +40,7 @@
"react-icons": "catalog:" "react-icons": "catalog:"
}, },
"devDependencies": { "devDependencies": {
"@repo/eslint-config": "workspace:*", "@repo/config-eslint": "workspace:*",
"@repo/config-typescript": "workspace:*", "@repo/config-typescript": "workspace:*",
"@types/react": "catalog:", "@types/react": "catalog:",
"@types/react-dom": "catalog:", "@types/react-dom": "catalog:",
@@ -51,6 +51,7 @@
"eslint": "catalog:", "eslint": "catalog:",
"postcss": "catalog:", "postcss": "catalog:",
"tailwindcss": "catalog:", "tailwindcss": "catalog:",
"typescript-eslint": "catalog:",
"typescript": "catalog:" "typescript": "catalog:"
} }
} }

View File

@@ -13,7 +13,13 @@ export const CurriculumVitaeAbout: React.FC<CurriculumVitaeAboutProps> = () => {
title={t("curriculum-vitae.about.title")} title={t("curriculum-vitae.about.title")}
icon={<FaUser size={24} />} icon={<FaUser size={24} />}
> >
<p>{t.rich("curriculum-vitae.about.description")}</p> <p>
{t.rich("curriculum-vitae.about.description", {
br: () => {
return <br />
},
})}
</p>
</CurriculumVitaeSection> </CurriculumVitaeSection>
) )
} }

View File

@@ -11,10 +11,10 @@ export const CurriculumVitaeEducation: React.FC<
const educations = [ const educations = [
{ {
years: t("curriculum-vitae.education.cnam.years.2024-2025.title"), years: t("curriculum-vitae.education.cnam.years.2024-2027.title"),
studyType: t("curriculum-vitae.education.cnam.study-type"), studyType: t("curriculum-vitae.education.cnam.study-type"),
institution: t("curriculum-vitae.education.cnam.institution"), institution: t("curriculum-vitae.education.cnam.institution"),
score: t("curriculum-vitae.education.cnam.years.2024-2025.description"), score: t("curriculum-vitae.education.cnam.years.2024-2027.description"),
courses: [], courses: [],
}, },
{ {

View File

@@ -1,4 +1,4 @@
import { Link } from "@repo/i18n/navigation" import { Link } from "@repo/i18n/routing"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import Image from "next/image" import Image from "next/image"
import { BirthDate } from "../Home/About/AboutList/BirthDate.tsx" import { BirthDate } from "../Home/About/AboutList/BirthDate.tsx"

View File

@@ -1,5 +1,5 @@
import { classNames } from "@repo/config-tailwind/classNames" import { classNames } from "@repo/config-tailwind/classNames"
import { Link as NextLink } from "@repo/i18n/navigation" import { Link as NextLink } from "@repo/i18n/routing"
import type { VariantProps } from "cva" import type { VariantProps } from "cva"
import { cva } from "cva" import { cva } from "cva"
@@ -12,7 +12,7 @@ const buttonVariants = cva({
variant: { variant: {
solid: "bg-primary hover:bg-primary/80 text-white", solid: "bg-primary hover:bg-primary/80 text-white",
outline: outline:
"dark:border-primary-dark/60 dark:text-primary-dark dark:hover:border-primary-dark border-primary/60 text-primary hover:border-primary hover:bg-gray border bg-transparent dark:hover:bg-transparent", "dark:border-primary-dark/60 dark:text-primary-dark dark:hover:border-primary-dark border-primary/60 text-primary hover:border-primary hover:bg-primary border bg-transparent hover:text-white",
}, },
size: { size: {
small: "h-9 rounded-md px-3", small: "h-9 rounded-md px-3",

View File

@@ -1,5 +1,5 @@
import { classNames } from "@repo/config-tailwind/classNames" import { classNames } from "@repo/config-tailwind/classNames"
import { Link as NextLink } from "@repo/i18n/navigation" import { Link as NextLink } from "@repo/i18n/routing"
import { FiExternalLink } from "react-icons/fi" import { FiExternalLink } from "react-icons/fi"
export interface LinkProps extends React.ComponentProps<typeof NextLink> { export interface LinkProps extends React.ComponentProps<typeof NextLink> {

View File

@@ -1,6 +1,6 @@
"use client" "use client"
import { useRouter } from "@repo/i18n/navigation" import { useRouter } from "@repo/i18n/routing"
import { useTranslations } from "next-intl" import { useTranslations } from "next-intl"
import { useEffect, useTransition } from "react" import { useEffect, useTransition } from "react"
import { Button } from "../../Design/Button/Button.tsx" import { Button } from "../../Design/Button/Button.tsx"

View File

@@ -8,9 +8,13 @@ export const AboutDescription: React.FC<AboutDescriptionProps> = () => {
const t = useTranslations() const t = useTranslations()
return ( return (
<div className="dark:text-gray my-6 max-w-md text-center text-black"> <div className="dark:text-gray-lighter my-6 max-w-md text-center text-black">
<Typography as="p" variant="text1" className="my-6"> <Typography as="p" variant="text1" className="my-6">
{t.rich("home.about.description")} {t.rich("home.about.description", {
strong: (children) => {
return <strong>{children}</strong>
},
})}
</Typography> </Typography>
<Button href="/curriculum-vitae" variant="outline"> <Button href="/curriculum-vitae" variant="outline">

View File

@@ -12,7 +12,7 @@ export const AboutItem: React.FC<AboutItemProps> = (props) => {
<strong className="w-24 text-sm text-black lg:w-32 dark:text-white"> <strong className="w-24 text-sm text-black lg:w-32 dark:text-white">
{label} {label}
</strong> </strong>
<span className="dark:text-gray block text-sm font-normal text-black"> <span className="dark:text-gray-lighter block text-sm font-normal text-black">
{link != null ? ( {link != null ? (
<a className="hover:underline" href={link}> <a className="hover:underline" href={link}>
{value} {value}

View File

@@ -17,7 +17,7 @@ export const InterestItem: React.FC<InterestItemProps> = (props) => {
<Typography <Typography
as="p" as="p"
variant="text1" variant="text1"
className="dark:text-gray my-2 text-black" className="dark:text-gray-lighter my-2 text-black"
> >
{description} {description}
</Typography> </Typography>

View File

@@ -19,6 +19,12 @@ export const Interests: React.FC<InterestsProps> = () => {
id: "code", id: "code",
title: t("home.interests.code.title"), title: t("home.interests.code.title"),
description: t.rich("home.interests.code.description", { description: t.rich("home.interests.code.description", {
br: () => {
return <br />
},
strong: (children) => {
return <strong>{children}</strong>
},
"abbr-ux": (children) => { "abbr-ux": (children) => {
return <abbr title="User Experience">{children}</abbr> return <abbr title="User Experience">{children}</abbr>
}, },
@@ -29,6 +35,12 @@ export const Interests: React.FC<InterestsProps> = () => {
id: "open-source", id: "open-source",
title: t("home.interests.open-source.title"), title: t("home.interests.open-source.title"),
description: t.rich("home.interests.open-source.description", { description: t.rich("home.interests.open-source.description", {
br: () => {
return <br />
},
strong: (children) => {
return <strong>{children}</strong>
},
"github-link": (children) => { "github-link": (children) => {
return ( return (
<Link href={GIT_REPO_LINK} target="_blank"> <Link href={GIT_REPO_LINK} target="_blank">

View File

@@ -26,9 +26,9 @@ export const OpenSource: React.FC<OpenSourceProps> = () => {
href="https://github.com/nodejs/node/commits?author=theoludwig" href="https://github.com/nodejs/node/commits?author=theoludwig"
/> />
<Repository <Repository
name="standard/standard" name="nodejs/nodejs.org"
description="🌟 JavaScript Style Guide, with linter & automatic code fixer" description="The Node.js® Website"
href="https://github.com/standard/standard/commits?author=theoludwig" href="https://github.com/nodejs/nodejs.org/commits/main/?author=theoludwig"
/> />
<Repository <Repository
name="DefinitelyTyped/DefinitelyTyped" name="DefinitelyTyped/DefinitelyTyped"

View File

@@ -1,7 +1,7 @@
"use client" "use client"
import { classNames } from "@repo/config-tailwind/classNames" import { classNames } from "@repo/config-tailwind/classNames"
import { usePathname, useRouter } from "@repo/i18n/navigation" import { usePathname, useRouter } from "@repo/i18n/routing"
import type { Locale } from "@repo/utils/constants" import type { Locale } from "@repo/utils/constants"
import { LOCALES } from "@repo/utils/constants" import { LOCALES } from "@repo/utils/constants"
import { useLocale } from "next-intl" import { useLocale } from "next-intl"

View File

@@ -1,14 +0,0 @@
{
"root": true,
"extends": ["@repo/eslint-config"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"plugins": ["@typescript-eslint"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projectService": true
}
}
]
}

Some files were not shown because too many files have changed in this diff Show More