From 18865def0635b30fcb7e0af0fed502490645abd0 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 03:25:51 +0200 Subject: [PATCH 01/26] fix(config): patch CVE-affected deps (vite, vitest, happy-dom) - vite 7.3.3 -> 7.3.6 (GHSA-fx2h-pf6j-xcff HIGH, GHSA-v6wh-96g9-6wx3 MED) - vitest 3.2.4 -> 3.2.7 (GHSA-5xrq-8626-4rwp CRITICAL, dev-only) - happy-dom 16.8.1 -> 20.10.6 (GHSA-37j7-fg3j-429f CRITICAL, dev-only) - esbuild -> 0.28.1 within vite range, js-yaml lockfile refresh pnpm audit: 0 known vulnerabilities; typecheck + 174/174 tests green --- package.json | 6 +- pnpm-lock.yaml | 404 +++++++++++++++++++++++++++---------------------- 2 files changed, 226 insertions(+), 184 deletions(-) diff --git a/package.json b/package.json index 1b696b4b..71426be5 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "react-router-dom": "^7.1.1", - "vite": "^7.0.0", + "vite": "^7.3.6", "zod": "^3.24.1", "zustand": "^5.0.2" }, @@ -43,10 +43,10 @@ "eslint-plugin-react": "^7.37.3", "eslint-plugin-react-hooks": "^5.1.0", "globals": "^15.14.0", - "happy-dom": "^16.3.0", + "happy-dom": "^20.10.6", "prettier": "^3.4.2", "typescript": "^5.7.2", "typescript-eslint": "^8.19.0", - "vitest": "^3.0.0" + "vitest": "^3.2.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aec85ab3..b656b2dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,10 +10,10 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.3.0 - version: 4.3.0(vite@7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) + version: 4.3.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) '@vitejs/plugin-react-swc': specifier: ^3.7.2 - version: 3.11.0(vite@7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) + version: 3.11.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) canvg: specifier: ^4.0.2 version: 4.0.3 @@ -33,8 +33,8 @@ importers: specifier: ^7.1.1 version: 7.15.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) vite: - specifier: ^7.0.0 - version: 7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) + specifier: ^7.3.6 + version: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) zod: specifier: ^3.24.1 version: 3.25.76 @@ -73,8 +73,8 @@ importers: specifier: ^15.14.0 version: 15.15.0 happy-dom: - specifier: ^16.3.0 - version: 16.8.1 + specifier: ^20.10.6 + version: 20.10.6 prettier: specifier: ^3.4.2 version: 3.8.3 @@ -85,8 +85,8 @@ importers: specifier: ^8.19.0 version: 8.59.3(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3) vitest: - specifier: ^3.0.0 - version: 3.2.4(@types/node@20.19.41)(happy-dom@16.8.1)(jiti@2.7.0)(lightningcss@1.32.0) + specifier: ^3.2.7 + version: 3.2.7(@types/node@20.19.41)(happy-dom@20.10.6)(jiti@2.7.0)(lightningcss@1.32.0) packages: @@ -105,158 +105,158 @@ packages: resolution: {integrity: sha512-JiDShH45zKHWyGe4ZNVRrCjBz8Nh9TMmZG1kh4QTK8hCBTWBi8Da+i7s1fJw7/lYpM4ccepSNfqzZ/QvABBi5g==} engines: {node: '>=6.9.0'} - '@esbuild/aix-ppc64@0.27.7': - resolution: {integrity: sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==} + '@esbuild/aix-ppc64@0.28.1': + resolution: {integrity: sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.27.7': - resolution: {integrity: sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==} + '@esbuild/android-arm64@0.28.1': + resolution: {integrity: sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.27.7': - resolution: {integrity: sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==} + '@esbuild/android-arm@0.28.1': + resolution: {integrity: sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.27.7': - resolution: {integrity: sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==} + '@esbuild/android-x64@0.28.1': + resolution: {integrity: sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.27.7': - resolution: {integrity: sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==} + '@esbuild/darwin-arm64@0.28.1': + resolution: {integrity: sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.27.7': - resolution: {integrity: sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==} + '@esbuild/darwin-x64@0.28.1': + resolution: {integrity: sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.27.7': - resolution: {integrity: sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==} + '@esbuild/freebsd-arm64@0.28.1': + resolution: {integrity: sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.27.7': - resolution: {integrity: sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==} + '@esbuild/freebsd-x64@0.28.1': + resolution: {integrity: sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.27.7': - resolution: {integrity: sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==} + '@esbuild/linux-arm64@0.28.1': + resolution: {integrity: sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.27.7': - resolution: {integrity: sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==} + '@esbuild/linux-arm@0.28.1': + resolution: {integrity: sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.27.7': - resolution: {integrity: sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==} + '@esbuild/linux-ia32@0.28.1': + resolution: {integrity: sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.27.7': - resolution: {integrity: sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==} + '@esbuild/linux-loong64@0.28.1': + resolution: {integrity: sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.27.7': - resolution: {integrity: sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==} + '@esbuild/linux-mips64el@0.28.1': + resolution: {integrity: sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.27.7': - resolution: {integrity: sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==} + '@esbuild/linux-ppc64@0.28.1': + resolution: {integrity: sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.27.7': - resolution: {integrity: sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==} + '@esbuild/linux-riscv64@0.28.1': + resolution: {integrity: sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.27.7': - resolution: {integrity: sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==} + '@esbuild/linux-s390x@0.28.1': + resolution: {integrity: sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.27.7': - resolution: {integrity: sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==} + '@esbuild/linux-x64@0.28.1': + resolution: {integrity: sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.27.7': - resolution: {integrity: sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==} + '@esbuild/netbsd-arm64@0.28.1': + resolution: {integrity: sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.27.7': - resolution: {integrity: sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==} + '@esbuild/netbsd-x64@0.28.1': + resolution: {integrity: sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.27.7': - resolution: {integrity: sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==} + '@esbuild/openbsd-arm64@0.28.1': + resolution: {integrity: sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.27.7': - resolution: {integrity: sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==} + '@esbuild/openbsd-x64@0.28.1': + resolution: {integrity: sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openharmony-arm64@0.27.7': - resolution: {integrity: sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==} + '@esbuild/openharmony-arm64@0.28.1': + resolution: {integrity: sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] - '@esbuild/sunos-x64@0.27.7': - resolution: {integrity: sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==} + '@esbuild/sunos-x64@0.28.1': + resolution: {integrity: sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.27.7': - resolution: {integrity: sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==} + '@esbuild/win32-arm64@0.28.1': + resolution: {integrity: sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.27.7': - resolution: {integrity: sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==} + '@esbuild/win32-ia32@0.28.1': + resolution: {integrity: sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.27.7': - resolution: {integrity: sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==} + '@esbuild/win32-x64@0.28.1': + resolution: {integrity: sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==} engines: {node: '>=18'} cpu: [x64] os: [win32] @@ -730,6 +730,12 @@ packages: '@types/react@19.2.14': resolution: {integrity: sha512-ilcTH/UniCkMdtexkoCN0bI7pMcJDvmQFPvuPvmEaYA/NSfFTAgdUSLAoVjaRJm7+6PvcM+q1zYOwS4wTYMF9w==} + '@types/whatwg-mimetype@3.0.2': + resolution: {integrity: sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==} + + '@types/ws@8.18.1': + resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + '@typescript-eslint/eslint-plugin@8.59.3': resolution: {integrity: sha512-PwFvSKsXGShKGW6n5bZOhGHEcCZXM8HofLK9fNsEwZXzFRjoY+XT1Vsf1zgyXdwTr0ZYz1/2tkZ0DBTT9jZjhw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -794,11 +800,11 @@ packages: peerDependencies: vite: ^4 || ^5 || ^6 || ^7 - '@vitest/expect@3.2.4': - resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + '@vitest/expect@3.2.7': + resolution: {integrity: sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==} - '@vitest/mocker@3.2.4': - resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + '@vitest/mocker@3.2.7': + resolution: {integrity: sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==} peerDependencies: msw: ^2.4.9 vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 @@ -808,20 +814,20 @@ packages: vite: optional: true - '@vitest/pretty-format@3.2.4': - resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + '@vitest/pretty-format@3.2.7': + resolution: {integrity: sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==} - '@vitest/runner@3.2.4': - resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + '@vitest/runner@3.2.7': + resolution: {integrity: sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==} - '@vitest/snapshot@3.2.4': - resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + '@vitest/snapshot@3.2.7': + resolution: {integrity: sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==} - '@vitest/spy@3.2.4': - resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + '@vitest/spy@3.2.7': + resolution: {integrity: sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==} - '@vitest/utils@3.2.4': - resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + '@vitest/utils@3.2.7': + resolution: {integrity: sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==} acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -912,6 +918,10 @@ packages: resolution: {integrity: sha512-kLpxurY4Z4r9sgMsyG0Z9uzsBlgiU/EFKhj/h91/8yHu0edo7XuixOIH3VcJ8kkxs6/jPzoI6U9Vj3WqbMQ94g==} engines: {node: 18 || 20 || >=22} + buffer-image-size@0.6.4: + resolution: {integrity: sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ==} + engines: {node: '>=4.0'} + cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} @@ -1034,6 +1044,10 @@ packages: resolution: {integrity: sha512-QyL119InA+XXEkNLNTPCXPugSvOfhwv0JOlGNzvxs0hZaiHLNvXSpudUWsOlsXGWJh8G6ckCScEkVHfX3kw/2Q==} engines: {node: '>=10.13.0'} + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + es-abstract@1.24.2: resolution: {integrity: sha512-2FpH9Q5i2RRwyEP1AylXe6nYLR5OhaJTZwmlcP0dL/+JCbgg7yyEo/sEK6HeGZRf3dFpWwThaRHVApXSkW3xeg==} engines: {node: '>= 0.4'} @@ -1069,8 +1083,8 @@ packages: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} - esbuild@0.27.7: - resolution: {integrity: sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==} + esbuild@0.28.1: + resolution: {integrity: sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==} engines: {node: '>=18'} hasBin: true @@ -1248,9 +1262,9 @@ packages: graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - happy-dom@16.8.1: - resolution: {integrity: sha512-n0QrmT9lD81rbpKsyhnlz3DgnMZlaOkJPpgi746doA+HvaMC79bdWkwjrNnGJRvDrWTI8iOcJiVTJ5CdT/AZRw==} - engines: {node: '>=18.0.0'} + happy-dom@20.10.6: + resolution: {integrity: sha512-6QD0ilzDDt93tX44y8tbmZdAcdTRYDhUP+Asgi6pC8Pp5IA3cvaZGyoVN/EGtlq9ziT65iPuBBn3ASLr6hCgVw==} + engines: {node: '>=20.0.0'} has-bigints@1.1.0: resolution: {integrity: sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg==} @@ -1419,8 +1433,8 @@ packages: js-tokens@9.0.1: resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} - js-yaml@4.1.1: - resolution: {integrity: sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==} + js-yaml@4.3.0: + resolution: {integrity: sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==} hasBin: true json-buffer@3.0.1: @@ -1977,8 +1991,8 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@7.3.3: - resolution: {integrity: sha512-/4XH147Ui7OGTjg3HbdWe5arnZQSbfuRzdr9Ec7TQi5I7R+ir0Rlc9GIvD4v0XZurELqA035KVXJXpR61xhiTA==} + vite@7.3.6: + resolution: {integrity: sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -2017,16 +2031,16 @@ packages: yaml: optional: true - vitest@3.2.4: - resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + vitest@3.2.7: + resolution: {integrity: sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/debug': ^4.1.12 '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 - '@vitest/browser': 3.2.4 - '@vitest/ui': 3.2.4 + '@vitest/browser': 3.2.7 + '@vitest/ui': 3.2.7 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -2045,10 +2059,6 @@ packages: jsdom: optional: true - webidl-conversions@7.0.0: - resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} - engines: {node: '>=12'} - whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} @@ -2083,6 +2093,18 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + ws@8.21.0: + resolution: {integrity: sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -2122,82 +2144,82 @@ snapshots: '@babel/runtime@7.29.2': {} - '@esbuild/aix-ppc64@0.27.7': + '@esbuild/aix-ppc64@0.28.1': optional: true - '@esbuild/android-arm64@0.27.7': + '@esbuild/android-arm64@0.28.1': optional: true - '@esbuild/android-arm@0.27.7': + '@esbuild/android-arm@0.28.1': optional: true - '@esbuild/android-x64@0.27.7': + '@esbuild/android-x64@0.28.1': optional: true - '@esbuild/darwin-arm64@0.27.7': + '@esbuild/darwin-arm64@0.28.1': optional: true - '@esbuild/darwin-x64@0.27.7': + '@esbuild/darwin-x64@0.28.1': optional: true - '@esbuild/freebsd-arm64@0.27.7': + '@esbuild/freebsd-arm64@0.28.1': optional: true - '@esbuild/freebsd-x64@0.27.7': + '@esbuild/freebsd-x64@0.28.1': optional: true - '@esbuild/linux-arm64@0.27.7': + '@esbuild/linux-arm64@0.28.1': optional: true - '@esbuild/linux-arm@0.27.7': + '@esbuild/linux-arm@0.28.1': optional: true - '@esbuild/linux-ia32@0.27.7': + '@esbuild/linux-ia32@0.28.1': optional: true - '@esbuild/linux-loong64@0.27.7': + '@esbuild/linux-loong64@0.28.1': optional: true - '@esbuild/linux-mips64el@0.27.7': + '@esbuild/linux-mips64el@0.28.1': optional: true - '@esbuild/linux-ppc64@0.27.7': + '@esbuild/linux-ppc64@0.28.1': optional: true - '@esbuild/linux-riscv64@0.27.7': + '@esbuild/linux-riscv64@0.28.1': optional: true - '@esbuild/linux-s390x@0.27.7': + '@esbuild/linux-s390x@0.28.1': optional: true - '@esbuild/linux-x64@0.27.7': + '@esbuild/linux-x64@0.28.1': optional: true - '@esbuild/netbsd-arm64@0.27.7': + '@esbuild/netbsd-arm64@0.28.1': optional: true - '@esbuild/netbsd-x64@0.27.7': + '@esbuild/netbsd-x64@0.28.1': optional: true - '@esbuild/openbsd-arm64@0.27.7': + '@esbuild/openbsd-arm64@0.28.1': optional: true - '@esbuild/openbsd-x64@0.27.7': + '@esbuild/openbsd-x64@0.28.1': optional: true - '@esbuild/openharmony-arm64@0.27.7': + '@esbuild/openharmony-arm64@0.28.1': optional: true - '@esbuild/sunos-x64@0.27.7': + '@esbuild/sunos-x64@0.28.1': optional: true - '@esbuild/win32-arm64@0.27.7': + '@esbuild/win32-arm64@0.28.1': optional: true - '@esbuild/win32-ia32@0.27.7': + '@esbuild/win32-ia32@0.28.1': optional: true - '@esbuild/win32-x64@0.27.7': + '@esbuild/win32-x64@0.28.1': optional: true '@eslint-community/eslint-utils@4.9.1(eslint@9.39.4(jiti@2.7.0))': @@ -2231,7 +2253,7 @@ snapshots: globals: 14.0.0 ignore: 5.3.2 import-fresh: 3.3.1 - js-yaml: 4.1.1 + js-yaml: 4.3.0 minimatch: 3.1.5 strip-json-comments: 3.1.1 transitivePeerDependencies: @@ -2487,12 +2509,12 @@ snapshots: '@tailwindcss/oxide-win32-arm64-msvc': 4.3.0 '@tailwindcss/oxide-win32-x64-msvc': 4.3.0 - '@tailwindcss/vite@4.3.0(vite@7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0))': + '@tailwindcss/vite@4.3.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0))': dependencies: '@tailwindcss/node': 4.3.0 '@tailwindcss/oxide': 4.3.0 tailwindcss: 4.3.0 - vite: 7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) + vite: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) '@testing-library/dom@10.4.1': dependencies: @@ -2557,6 +2579,12 @@ snapshots: dependencies: csstype: 3.2.3 + '@types/whatwg-mimetype@3.0.2': {} + + '@types/ws@8.18.1': + dependencies: + '@types/node': 20.19.41 + '@typescript-eslint/eslint-plugin@8.59.3(@typescript-eslint/parser@8.59.3(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3))(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3)': dependencies: '@eslint-community/regexpp': 4.12.2 @@ -2648,53 +2676,53 @@ snapshots: '@typescript-eslint/types': 8.59.3 eslint-visitor-keys: 5.0.1 - '@vitejs/plugin-react-swc@3.11.0(vite@7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0))': + '@vitejs/plugin-react-swc@3.11.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0))': dependencies: '@rolldown/pluginutils': 1.0.0-beta.27 '@swc/core': 1.15.33 - vite: 7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) + vite: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) transitivePeerDependencies: - '@swc/helpers' - '@vitest/expect@3.2.4': + '@vitest/expect@3.2.7': dependencies: '@types/chai': 5.2.3 - '@vitest/spy': 3.2.4 - '@vitest/utils': 3.2.4 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0))': + '@vitest/mocker@3.2.7(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0))': dependencies: - '@vitest/spy': 3.2.4 + '@vitest/spy': 3.2.7 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) + vite: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) - '@vitest/pretty-format@3.2.4': + '@vitest/pretty-format@3.2.7': dependencies: tinyrainbow: 2.0.0 - '@vitest/runner@3.2.4': + '@vitest/runner@3.2.7': dependencies: - '@vitest/utils': 3.2.4 + '@vitest/utils': 3.2.7 pathe: 2.0.3 strip-literal: 3.1.0 - '@vitest/snapshot@3.2.4': + '@vitest/snapshot@3.2.7': dependencies: - '@vitest/pretty-format': 3.2.4 + '@vitest/pretty-format': 3.2.7 magic-string: 0.30.21 pathe: 2.0.3 - '@vitest/spy@3.2.4': + '@vitest/spy@3.2.7': dependencies: tinyspy: 4.0.4 - '@vitest/utils@3.2.4': + '@vitest/utils@3.2.7': dependencies: - '@vitest/pretty-format': 3.2.4 + '@vitest/pretty-format': 3.2.7 loupe: 3.2.1 tinyrainbow: 2.0.0 @@ -2805,6 +2833,10 @@ snapshots: dependencies: balanced-match: 4.0.4 + buffer-image-size@0.6.4: + dependencies: + '@types/node': 20.19.41 + cac@6.7.14: {} call-bind-apply-helpers@1.0.2: @@ -2930,6 +2962,8 @@ snapshots: graceful-fs: 4.2.11 tapable: 2.3.3 + entities@7.0.1: {} + es-abstract@1.24.2: dependencies: array-buffer-byte-length: 1.0.2 @@ -3033,34 +3067,34 @@ snapshots: is-date-object: 1.1.0 is-symbol: 1.1.1 - esbuild@0.27.7: + esbuild@0.28.1: optionalDependencies: - '@esbuild/aix-ppc64': 0.27.7 - '@esbuild/android-arm': 0.27.7 - '@esbuild/android-arm64': 0.27.7 - '@esbuild/android-x64': 0.27.7 - '@esbuild/darwin-arm64': 0.27.7 - '@esbuild/darwin-x64': 0.27.7 - '@esbuild/freebsd-arm64': 0.27.7 - '@esbuild/freebsd-x64': 0.27.7 - '@esbuild/linux-arm': 0.27.7 - '@esbuild/linux-arm64': 0.27.7 - '@esbuild/linux-ia32': 0.27.7 - '@esbuild/linux-loong64': 0.27.7 - '@esbuild/linux-mips64el': 0.27.7 - '@esbuild/linux-ppc64': 0.27.7 - '@esbuild/linux-riscv64': 0.27.7 - '@esbuild/linux-s390x': 0.27.7 - '@esbuild/linux-x64': 0.27.7 - '@esbuild/netbsd-arm64': 0.27.7 - '@esbuild/netbsd-x64': 0.27.7 - '@esbuild/openbsd-arm64': 0.27.7 - '@esbuild/openbsd-x64': 0.27.7 - '@esbuild/openharmony-arm64': 0.27.7 - '@esbuild/sunos-x64': 0.27.7 - '@esbuild/win32-arm64': 0.27.7 - '@esbuild/win32-ia32': 0.27.7 - '@esbuild/win32-x64': 0.27.7 + '@esbuild/aix-ppc64': 0.28.1 + '@esbuild/android-arm': 0.28.1 + '@esbuild/android-arm64': 0.28.1 + '@esbuild/android-x64': 0.28.1 + '@esbuild/darwin-arm64': 0.28.1 + '@esbuild/darwin-x64': 0.28.1 + '@esbuild/freebsd-arm64': 0.28.1 + '@esbuild/freebsd-x64': 0.28.1 + '@esbuild/linux-arm': 0.28.1 + '@esbuild/linux-arm64': 0.28.1 + '@esbuild/linux-ia32': 0.28.1 + '@esbuild/linux-loong64': 0.28.1 + '@esbuild/linux-mips64el': 0.28.1 + '@esbuild/linux-ppc64': 0.28.1 + '@esbuild/linux-riscv64': 0.28.1 + '@esbuild/linux-s390x': 0.28.1 + '@esbuild/linux-x64': 0.28.1 + '@esbuild/netbsd-arm64': 0.28.1 + '@esbuild/netbsd-x64': 0.28.1 + '@esbuild/openbsd-arm64': 0.28.1 + '@esbuild/openbsd-x64': 0.28.1 + '@esbuild/openharmony-arm64': 0.28.1 + '@esbuild/sunos-x64': 0.28.1 + '@esbuild/win32-arm64': 0.28.1 + '@esbuild/win32-ia32': 0.28.1 + '@esbuild/win32-x64': 0.28.1 escape-string-regexp@4.0.0: {} @@ -3264,10 +3298,18 @@ snapshots: graceful-fs@4.2.11: {} - happy-dom@16.8.1: + happy-dom@20.10.6: dependencies: - webidl-conversions: 7.0.0 + '@types/node': 20.19.41 + '@types/whatwg-mimetype': 3.0.2 + '@types/ws': 8.18.1 + buffer-image-size: 0.6.4 + entities: 7.0.1 whatwg-mimetype: 3.0.0 + ws: 8.21.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate has-bigints@1.1.0: {} @@ -3435,7 +3477,7 @@ snapshots: js-tokens@9.0.1: {} - js-yaml@4.1.1: + js-yaml@4.3.0: dependencies: argparse: 2.0.1 @@ -4035,7 +4077,7 @@ snapshots: debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) + vite: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) transitivePeerDependencies: - '@types/node' - jiti @@ -4050,9 +4092,9 @@ snapshots: - tsx - yaml - vite@7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0): + vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0): dependencies: - esbuild: 0.27.7 + esbuild: 0.28.1 fdir: 6.5.0(picomatch@4.0.4) picomatch: 4.0.4 postcss: 8.5.14 @@ -4064,16 +4106,16 @@ snapshots: jiti: 2.7.0 lightningcss: 1.32.0 - vitest@3.2.4(@types/node@20.19.41)(happy-dom@16.8.1)(jiti@2.7.0)(lightningcss@1.32.0): + vitest@3.2.7(@types/node@20.19.41)(happy-dom@20.10.6)(jiti@2.7.0)(lightningcss@1.32.0): dependencies: '@types/chai': 5.2.3 - '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) - '@vitest/pretty-format': 3.2.4 - '@vitest/runner': 3.2.4 - '@vitest/snapshot': 3.2.4 - '@vitest/spy': 3.2.4 - '@vitest/utils': 3.2.4 + '@vitest/expect': 3.2.7 + '@vitest/mocker': 3.2.7(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) + '@vitest/pretty-format': 3.2.7 + '@vitest/runner': 3.2.7 + '@vitest/snapshot': 3.2.7 + '@vitest/spy': 3.2.7 + '@vitest/utils': 3.2.7 chai: 5.3.3 debug: 4.4.3 expect-type: 1.3.0 @@ -4086,12 +4128,12 @@ snapshots: tinyglobby: 0.2.16 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.3.3(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) + vite: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) vite-node: 3.2.4(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 20.19.41 - happy-dom: 16.8.1 + happy-dom: 20.10.6 transitivePeerDependencies: - jiti - less @@ -4106,8 +4148,6 @@ snapshots: - tsx - yaml - webidl-conversions@7.0.0: {} - whatwg-mimetype@3.0.0: {} which-boxed-primitive@1.1.1: @@ -4162,6 +4202,8 @@ snapshots: word-wrap@1.2.5: {} + ws@8.21.0: {} + yocto-queue@0.1.0: {} zod@3.25.76: {} From 3f91a4566039e8aff32822cd7b8f8b53bf09e724 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 03:32:50 +0200 Subject: [PATCH 02/26] fix(editor): sanitize user-imported SVGs before DOM insertion SvgEditorRoute.loadSVG inserted dropped SVG files with no stripping; pathology-editor stripped descendants but missed the root element's on* attributes and javascript: hrefs. Both now remove script/ foreignObject nodes, on* handlers (root included) and javascript: hrefs before appendChild. Impact bounded (no auth/backend), MEDIUM. --- public/pathology-editor.html | 7 +++++-- src/app/routes/SvgEditorRoute.tsx | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/public/pathology-editor.html b/public/pathology-editor.html index e8b973ba..adb79e21 100644 --- a/public/pathology-editor.html +++ b/public/pathology-editor.html @@ -1125,9 +1125,12 @@ clearChildren(canvasInner); var imported = document.importNode(svg, true); imported.querySelectorAll('script, foreignObject').forEach(function (e) { e.remove(); }); - imported.querySelectorAll('*').forEach(function (e) { + [imported].concat(Array.prototype.slice.call(imported.querySelectorAll('*'))).forEach(function (e) { for (var i = e.attributes.length - 1; i >= 0; i--) { - if (e.attributes[i].name.match(/^on/i)) e.removeAttribute(e.attributes[i].name); + var a = e.attributes[i]; + var isHandler = a.name.match(/^on/i); + var isJsHref = a.name.match(/href$/i) && a.value.match(/^\s*javascript:/i); + if (isHandler || isJsHref) e.removeAttribute(a.name); } }); canvasInner.appendChild(imported); diff --git a/src/app/routes/SvgEditorRoute.tsx b/src/app/routes/SvgEditorRoute.tsx index 5d5224df..d4a8460f 100644 --- a/src/app/routes/SvgEditorRoute.tsx +++ b/src/app/routes/SvgEditorRoute.tsx @@ -495,6 +495,19 @@ function initSvgEditor( }, sig) } + /** Strip active content from an untrusted SVG: scripts, foreignObject, + * event-handler attributes (root included) and javascript: hrefs. */ + function sanitizeSvg(root: Element) { + root.querySelectorAll('script, foreignObject').forEach((el) => el.remove()) + for (const el of [root, ...root.querySelectorAll('*')]) { + for (const attr of [...el.attributes]) { + const isHandler = /^on/i.test(attr.name) + const isJsHref = /href$/i.test(attr.name) && /^\s*javascript:/i.test(attr.value) + if (isHandler || isJsHref) el.removeAttribute(attr.name) + } + } + } + function loadSVG(svgText: string) { const parser = new DOMParser() const doc = parser.parseFromString(svgText, 'image/svg+xml') @@ -505,8 +518,10 @@ function initSvgEditor( return } + const imported = document.importNode(parsedSvg, true) + sanitizeSvg(imported) canvasInner.textContent = '' - canvasInner.appendChild(document.importNode(parsedSvg, true)) + canvasInner.appendChild(imported) svgRoot = canvasInner.querySelector('svg') if (!svgRoot) { alert(t('svg_editor.alert_invalid_svg')) From 187dfb53715f8a113d987effd27d5632358c399f Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 03:34:00 +0200 Subject: [PATCH 03/26] fix(config): move build toolchain to devDependencies vite, @vitejs/plugin-react-swc, @tailwindcss/vite are build-time only; they were inflating the production dependency audit surface. Build + tests verified green after the move. --- package.json | 6 +++--- pnpm-lock.yaml | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 71426be5..6e784f89 100644 --- a/package.json +++ b/package.json @@ -20,25 +20,24 @@ "scaffold:species": "node scripts/scaffold-species.mjs" }, "dependencies": { - "@tailwindcss/vite": "^4.3.0", - "@vitejs/plugin-react-swc": "^3.7.2", "canvg": "^4.0.2", "motion": "^11.11.17", "pdf-lib": "^1.17.1", "react": "^19.0.0", "react-dom": "^19.0.0", "react-router-dom": "^7.1.1", - "vite": "^7.3.6", "zod": "^3.24.1", "zustand": "^5.0.2" }, "devDependencies": { + "@tailwindcss/vite": "^4.3.0", "@testing-library/jest-dom": "^6.6.3", "@testing-library/react": "^16.1.0", "@testing-library/user-event": "^14.5.2", "@types/node": "^20.19.41", "@types/react": "^19.0.1", "@types/react-dom": "^19.0.1", + "@vitejs/plugin-react-swc": "^3.7.2", "eslint": "^9.17.0", "eslint-plugin-react": "^7.37.3", "eslint-plugin-react-hooks": "^5.1.0", @@ -47,6 +46,7 @@ "prettier": "^3.4.2", "typescript": "^5.7.2", "typescript-eslint": "^8.19.0", + "vite": "^7.3.6", "vitest": "^3.2.7" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b656b2dd..63d8a45b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,6 @@ importers: .: dependencies: - '@tailwindcss/vite': - specifier: ^4.3.0 - version: 4.3.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) - '@vitejs/plugin-react-swc': - specifier: ^3.7.2 - version: 3.11.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) canvg: specifier: ^4.0.2 version: 4.0.3 @@ -32,9 +26,6 @@ importers: react-router-dom: specifier: ^7.1.1 version: 7.15.1(react-dom@19.2.6(react@19.2.6))(react@19.2.6) - vite: - specifier: ^7.3.6 - version: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) zod: specifier: ^3.24.1 version: 3.25.76 @@ -42,6 +33,9 @@ importers: specifier: ^5.0.2 version: 5.0.13(@types/react@19.2.14)(react@19.2.6) devDependencies: + '@tailwindcss/vite': + specifier: ^4.3.0 + version: 4.3.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) '@testing-library/jest-dom': specifier: ^6.6.3 version: 6.9.1 @@ -60,6 +54,9 @@ importers: '@types/react-dom': specifier: ^19.0.1 version: 19.2.3(@types/react@19.2.14) + '@vitejs/plugin-react-swc': + specifier: ^3.7.2 + version: 3.11.0(vite@7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0)) eslint: specifier: ^9.17.0 version: 9.39.4(jiti@2.7.0) @@ -84,6 +81,9 @@ importers: typescript-eslint: specifier: ^8.19.0 version: 8.59.3(eslint@9.39.4(jiti@2.7.0))(typescript@5.9.3) + vite: + specifier: ^7.3.6 + version: 7.3.6(@types/node@20.19.41)(jiti@2.7.0)(lightningcss@1.32.0) vitest: specifier: ^3.2.7 version: 3.2.7(@types/node@20.19.41)(happy-dom@20.10.6)(jiti@2.7.0)(lightningcss@1.32.0) From d8e478a104cb5bda59fd645b88da05671f3c8608 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 03:46:59 +0200 Subject: [PATCH 04/26] fix(docker): run container fully as non-root nginx user semgrep HIGH: no USER directive before ENTRYPOINT (container ran as root). Runtime dirs, conf.d and html dir chowned to nginx so the entrypoint (env.js write + PORT envsubst) and nginx master both run as uid 101. Verified: docker build + run, HTTP 200, SPA fallback, env override OK, ps shows master+workers as nginx. CONSTRAINT: PORT env var must now be >=1024 (default 8080 unaffected). --- Dockerfile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6b580612..34afefa3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,10 +25,16 @@ COPY --from=builder /app/dist /usr/share/nginx/html COPY docker/nginx.conf /etc/nginx/conf.d/default.conf COPY docker/entrypoint.sh /entrypoint.sh -RUN chmod +x /entrypoint.sh +# Run fully as non-root (port 8080 is unprivileged). nginx needs to own: +# its runtime dirs, the config it rewrites at startup (PORT envsubst), +# and the html dir (entrypoint writes env.js there). +RUN chmod +x /entrypoint.sh \ + && touch /var/run/nginx.pid \ + && chown -R nginx:nginx /var/cache/nginx /var/run/nginx.pid \ + /etc/nginx/conf.d /usr/share/nginx/html + +USER nginx -# Drop root: nginx master runs as root for port binding, workers as nginx -# The entrypoint writes env.js before exec-ing nginx EXPOSE 8080 ENTRYPOINT ["/entrypoint.sh"] From a2bd884bb139a868e22c4e89a162998d1f02916f Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 03:46:59 +0200 Subject: [PATCH 05/26] fix(config): add minimum-release-age supply-chain guard semgrep MEDIUM: pnpm installs now skip package versions published less than 24h ago (npm supply-chain attack window). --- .npmrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.npmrc b/.npmrc index 3e6c04e8..630ea829 100644 --- a/.npmrc +++ b/.npmrc @@ -1,2 +1,4 @@ shamefully-hoist=false strict-peer-dependencies=false +# Supply-chain guard: only install package versions published >= 24h ago +minimum-release-age=1440 From c55da076974d23349a855a0d13453e45fdca5e71 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 03:48:05 +0200 Subject: [PATCH 06/26] fix(docker): pin runner base image to nginx:1.31-alpine Unpinned nginx:alpine made builds non-reproducible across releases. Minor-version pin keeps patch updates. Verified: build + HTTP 200. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 34afefa3..81b05f47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY . . RUN pnpm build # ---- stage 2: runner ------------------------------------------------ -FROM nginx:alpine AS runner +FROM nginx:1.31-alpine AS runner # Copy built static assets COPY --from=builder /app/dist /usr/share/nginx/html From bbdc0e851a21ffc014c1ca9c0d1cfe4481ec0da6 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 04:47:54 +0200 Subject: [PATCH 07/26] chore: remove dead code and duplicate logic - drop unused assertNever, canvg dependency (never imported), readonly re-export shim in VertebraPicker, stale equine named export - unexport validateBoneElement (internal only) - getBoneIdFromEvent now delegates to getAnnotatedElement (dup walk-up) - rasterizeSvg: drop ignored _scale param (2 call sites + tests) - extract byte-identical word-wrap into pdf/render/text.ts - extract mergeBones helper in EditorRoute (block duplicated twice) - fix stale canvg comment in observationPage Checks: typecheck, lint, 174/174 tests, build all green --- package.json | 1 - pnpm-lock.yaml | 50 ------------------- src/anatomy/svgConvention.ts | 10 +--- src/app/routes/EditorRoute.tsx | 30 +++++------ src/components/observation/VertebraPicker.tsx | 2 - src/domain/species/equine/index.ts | 5 +- src/lib/assert.ts | 8 --- src/pdf/export.ts | 2 +- src/pdf/render/conclusionPage.ts | 22 ++------ src/pdf/render/observationPage.ts | 24 ++------- src/pdf/render/svgToPng.ts | 8 +-- src/pdf/render/text.ts | 27 ++++++++++ tests/unit/components.VertebraPicker.test.tsx | 5 +- tests/unit/pdf.svgToPng.test.ts | 2 - 14 files changed, 55 insertions(+), 141 deletions(-) create mode 100644 src/pdf/render/text.ts diff --git a/package.json b/package.json index 6e784f89..4d9d163a 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "scaffold:species": "node scripts/scaffold-species.mjs" }, "dependencies": { - "canvg": "^4.0.2", "motion": "^11.11.17", "pdf-lib": "^1.17.1", "react": "^19.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 63d8a45b..bfe0c7cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ importers: .: dependencies: - canvg: - specifier: ^4.0.2 - version: 4.0.3 motion: specifier: ^11.11.17 version: 11.18.2(react-dom@19.2.6(react@19.2.6))(react@19.2.6) @@ -719,9 +716,6 @@ packages: '@types/node@20.19.41': resolution: {integrity: sha512-ECymXOukMnOoVkC2bb1Vc/w/836DXncOg5m8Xj1RH7xSHZJWNYY6Zh7EH477vcnD5egKNNfy2RpNOmuChhFPgQ==} - '@types/raf@3.4.3': - resolution: {integrity: sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==} - '@types/react-dom@19.2.3': resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==} peerDependencies: @@ -942,10 +936,6 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - canvg@4.0.3: - resolution: {integrity: sha512-fKzMoMBwus3CWo1Uy8XJc4tqqn98RoRrGV6CsIkaNiQT5lOeHuMh4fOt+LXLzn2Wqtr4p/c2TOLz4xtu4oBlFA==} - engines: {node: '>=12.0.0'} - chai@5.3.3: resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} engines: {node: '>=18'} @@ -1674,9 +1664,6 @@ packages: pdf-lib@1.17.1: resolution: {integrity: sha512-V/mpyJAoTsN4cnP31vc0wfNA1+p20evqqnap0KLoRUN0Yk/p3wN52DOEsL4oBFcLdb76hlpKPtzJIgo67j/XLw==} - performance-now@2.1.0: - resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} - picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -1712,9 +1699,6 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - raf@3.4.1: - resolution: {integrity: sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==} - react-dom@19.2.6: resolution: {integrity: sha512-0prMI+hvBbPjsWnxDLxlCGyM8PN6UuWjEUCYmZhO67xIV9Xasa/r/vDnq+Xyq4Lo27g8QSbO5YzARu0D1Sps3g==} peerDependencies: @@ -1768,10 +1752,6 @@ packages: engines: {node: '>= 0.4'} hasBin: true - rgbcolor@1.0.1: - resolution: {integrity: sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==} - engines: {node: '>= 0.8.15'} - rollup@4.60.4: resolution: {integrity: sha512-WHeFSbZYsPu3+bLoNRUuAO+wavNlocOPf3wSHTP7hcFKVnJeWsYlCDbr3mTS14FCizf9ccIxXA8sGL8zKeQN3g==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} @@ -1850,10 +1830,6 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - stackblur-canvas@2.7.0: - resolution: {integrity: sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==} - engines: {node: '>=0.1.14'} - std-env@3.10.0: resolution: {integrity: sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==} @@ -1899,10 +1875,6 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svg-pathdata@6.0.3: - resolution: {integrity: sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==} - engines: {node: '>=12.0.0'} - tailwindcss@4.3.0: resolution: {integrity: sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==} @@ -2569,8 +2541,6 @@ snapshots: dependencies: undici-types: 6.21.0 - '@types/raf@3.4.3': {} - '@types/react-dom@19.2.3(@types/react@19.2.14)': dependencies: '@types/react': 19.2.14 @@ -2858,14 +2828,6 @@ snapshots: callsites@3.1.0: {} - canvg@4.0.3: - dependencies: - '@types/raf': 3.4.3 - raf: 3.4.1 - rgbcolor: 1.0.1 - stackblur-canvas: 2.7.0 - svg-pathdata: 6.0.3 - chai@5.3.3: dependencies: assertion-error: 2.0.1 @@ -3691,8 +3653,6 @@ snapshots: pako: 1.0.11 tslib: 1.14.1 - performance-now@2.1.0: {} - picocolors@1.1.1: {} picomatch@4.0.4: {} @@ -3723,10 +3683,6 @@ snapshots: punycode@2.3.1: {} - raf@3.4.1: - dependencies: - performance-now: 2.1.0 - react-dom@19.2.6(react@19.2.6): dependencies: react: 19.2.6 @@ -3788,8 +3744,6 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - rgbcolor@1.0.1: {} - rollup@4.60.4: dependencies: '@types/estree': 1.0.8 @@ -3910,8 +3864,6 @@ snapshots: stackback@0.0.2: {} - stackblur-canvas@2.7.0: {} - std-env@3.10.0: {} stop-iteration-iterator@1.1.0: @@ -3979,8 +3931,6 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svg-pathdata@6.0.3: {} - tailwindcss@4.3.0: {} tapable@2.3.3: {} diff --git a/src/anatomy/svgConvention.ts b/src/anatomy/svgConvention.ts index 529842da..67c0c3cc 100644 --- a/src/anatomy/svgConvention.ts +++ b/src/anatomy/svgConvention.ts @@ -12,7 +12,7 @@ import type { Bone, BoneCategory } from './types' * string is accepted. New SVGs are free to introduce new categories * without touching this parser. */ -export function validateBoneElement(el: Element): void { +function validateBoneElement(el: Element): void { const boneId = el.getAttribute('data-anno-id') ?? '' if (!boneId) { throw new SvgConventionError( @@ -94,13 +94,7 @@ export function parseSvgBones(svgRoot: SVGSVGElement): Map { * annotated element. */ export function getBoneIdFromEvent(event: Event): string | null { - let node = event.target as Element | null - while (node && node.nodeType === 1) { - const id = node.getAttribute?.('data-anno-id') - if (id) return id - node = node.parentElement - } - return null + return getAnnotatedElement(event)?.getAttribute('data-anno-id') || null } export function getAnnotatedElement(event: Event): Element | null { diff --git a/src/app/routes/EditorRoute.tsx b/src/app/routes/EditorRoute.tsx index 7edd3985..59507112 100644 --- a/src/app/routes/EditorRoute.tsx +++ b/src/app/routes/EditorRoute.tsx @@ -3,9 +3,8 @@ import { useNavigate } from 'react-router-dom' import AnatomyCanvas from '@/components/canvas/AnatomyCanvas' import DetailModal from '@/components/canvas/DetailModal' import ObservationList from '@/components/observation/ObservationList' -import VertebraPicker, { - regionFromLabel, -} from '@/components/observation/VertebraPicker' +import VertebraPicker from '@/components/observation/VertebraPicker' +import { regionFromLabel } from '@/lib/spineZones' import LateralityPicker from '@/components/observation/LateralityPicker' import type { LateralSide } from '@/domain/schema/observation' import ConclusionPanel from '@/components/report/ConclusionPanel' @@ -32,6 +31,15 @@ import { boneLabel } from '@/anatomy/labels' const DISCLAIMER_FLAG = 'osteo:disclaimer-shown' +/** Merges newly parsed bones into the accumulated map without overwriting. */ +function mergeBones(prev: Map, parsed: Map) { + const merged = new Map(prev) + parsed.forEach((b, id) => { + if (!merged.has(id)) merged.set(id, b) + }) + return merged +} + export default function EditorRoute() { const navigate = useNavigate() const t = useT() @@ -135,13 +143,7 @@ export default function EditorRoute() { loadSvg(path) .then((root) => { const parsed = parseSvgBones(root) - setDetailBones((prev) => { - const merged = new Map(prev) - parsed.forEach((b, id) => { - if (!merged.has(id)) merged.set(id, b) - }) - return merged - }) + setDetailBones((prev) => mergeBones(prev, parsed)) }) .catch((err) => { console.warn(`EditorRoute: failed to preload detail SVG ${path}`, err) @@ -162,13 +164,7 @@ export default function EditorRoute() { loadSvg(detail.src).then((root) => { if (cancelled) return const parsed = parseSvgBones(root) - setDetailBones((prev) => { - const merged = new Map(prev) - parsed.forEach((b, id) => { - if (!merged.has(id)) merged.set(id, b) - }) - return merged - }) + setDetailBones((prev) => mergeBones(prev, parsed)) }) return () => { cancelled = true diff --git a/src/components/observation/VertebraPicker.tsx b/src/components/observation/VertebraPicker.tsx index 3486760b..26c7ca18 100644 --- a/src/components/observation/VertebraPicker.tsx +++ b/src/components/observation/VertebraPicker.tsx @@ -6,8 +6,6 @@ import type { Vertebra, VertebralRegion } from '@/domain/schema/observation' import type { VertebralFormula } from '@/domain/species/types' import { useT } from '@/i18n/useT' -export { regionFromLabel } from '@/lib/spineZones' - const REGIONS: VertebralRegion[] = ['C', 'T', 'L', 'S', 'Cd'] const REGION_KEY: Record = { C: 'vertebra.region.C', diff --git a/src/domain/species/equine/index.ts b/src/domain/species/equine/index.ts index 037e41bb..4be81161 100644 --- a/src/domain/species/equine/index.ts +++ b/src/domain/species/equine/index.ts @@ -1,7 +1,7 @@ import type { SpeciesManifest } from '@/domain/species/types' import { EQUINE_VERTEBRAL_FORMULA } from './vertebrae' -export const equine: SpeciesManifest = { +const equine: SpeciesManifest = { id: 'equine', labelFr: 'Cheval', mainSvg: '/species/equine/Horse.svg', @@ -13,6 +13,5 @@ export const equine: SpeciesManifest = { } // Default export is the convention picked up by the registry's -// import.meta.glob() auto-discovery. Keep the named export for any -// code that still imports the manifest by name. +// import.meta.glob() auto-discovery. export default equine diff --git a/src/lib/assert.ts b/src/lib/assert.ts index 906cb9b6..6fe3b382 100644 --- a/src/lib/assert.ts +++ b/src/lib/assert.ts @@ -7,11 +7,3 @@ export function assert(condition: unknown, message: string): asserts condition { throw new Error(`Assertion failed: ${message}`) } } - -/** - * Marks a code path as unreachable for exhaustive switch coverage. - * TypeScript will error at compile time if the path is reachable. - */ -export function assertNever(value: never, message?: string): never { - throw new Error(message ?? `Unexpected value: ${JSON.stringify(value)}`) -} diff --git a/src/pdf/export.ts b/src/pdf/export.ts index 611642a9..02c51aa3 100644 --- a/src/pdf/export.ts +++ b/src/pdf/export.ts @@ -130,7 +130,7 @@ export async function exportReportToPdf( const resp = await fetch('/Paws_in_harmony.svg') if (!resp.ok) throw new Error(`Paws logo fetch failed: HTTP ${resp.status}`) const svgText = await resp.text() - const pawsPngBytes = await rasterizeSvg(svgText, 1) + const pawsPngBytes = await rasterizeSvg(svgText) pawsLogoPdf = await pdfDoc.embedPng(pawsPngBytes) } catch (err) { console.warn('Paws in Harmony logo embed failed:', err) diff --git a/src/pdf/render/conclusionPage.ts b/src/pdf/render/conclusionPage.ts index d7ffab25..84d15fa9 100644 --- a/src/pdf/render/conclusionPage.ts +++ b/src/pdf/render/conclusionPage.ts @@ -1,9 +1,10 @@ -import { rgb, PageSizes, type PDFDocument, type PDFFont } from 'pdf-lib' +import { rgb, PageSizes, type PDFDocument } from 'pdf-lib' import type { EmbeddedFonts } from '@/pdf/fonts' import type { Report } from '@/domain/schema/report' import type { Locale } from '@/i18n/types' import { getDict } from '@/i18n' import { drawHeader, type HeaderAssets } from './header' +import { wrapLines } from './text' import { formatDate } from '@/lib/dates' const MARGIN_X = 36 @@ -20,23 +21,6 @@ const COLOR_INK = rgb(0.12, 0.11, 0.09) const COLOR_MUTED = rgb(0.42, 0.39, 0.35) const COLOR_ACCENT = rgb(0.72, 0.35, 0.25) -function wrap(text: string, font: PDFFont, size: number, max: number): string[] { - const words = text.split(/\s+/) - const lines: string[] = [] - let line = '' - for (const w of words) { - const test = line ? `${line} ${w}` : w - if (font.widthOfTextAtSize(test, size) > max && line) { - lines.push(line) - line = w - } else { - line = test - } - } - if (line) lines.push(line) - return lines -} - export async function addConclusionPage( pdfDoc: PDFDocument, report: Report, @@ -101,7 +85,7 @@ export async function addConclusionPage( color: COLOR_ACCENT, }) cursorY -= SECTION_LABEL_GAP + 10 - wrap(body, fonts.bodyRegular, 11, max).forEach((line) => { + wrapLines(body, fonts.bodyRegular, 11, max).forEach((line) => { page.drawText(line, { x: MARGIN_X, y: cursorY, diff --git a/src/pdf/render/observationPage.ts b/src/pdf/render/observationPage.ts index 03c6f55b..76ce4032 100644 --- a/src/pdf/render/observationPage.ts +++ b/src/pdf/render/observationPage.ts @@ -1,4 +1,4 @@ -import { rgb, PageSizes, type PDFDocument, type PDFFont, type PDFPage } from 'pdf-lib' +import { rgb, PageSizes, type PDFDocument, type PDFPage } from 'pdf-lib' import type { EmbeddedFonts } from '@/pdf/fonts' import type { Report } from '@/domain/schema/report' import type { Finding, Observation } from '@/domain/schema/observation' @@ -8,6 +8,7 @@ import { getDict } from '@/i18n' import type { ZoneLabelPair } from '@/pdf/export' import { drawHeader, type HeaderAssets } from './header' import { rasterizeSvg } from './svgToPng' +import { wrapLines } from './text' import { loadSvg } from '@/anatomy/svgLoader' import { parseSvgBones } from '@/anatomy/svgConvention' import { getSpecies } from '@/domain/species/registry' @@ -141,23 +142,6 @@ function drawSegmentedText( return y - TEXT_LINE_HEIGHT } -function wrapLines(text: string, font: PDFFont, size: number, max: number): string[] { - const words = text.split(/\s+/) - const lines: string[] = [] - let line = '' - for (const w of words) { - const test = line ? `${line} ${w}` : w - if (font.widthOfTextAtSize(test, size) > max && line) { - lines.push(line) - line = w - } else { - line = test - } - } - if (line) lines.push(line) - return lines -} - const SVG_NS = 'http://www.w3.org/2000/svg' const HALO_FILTER_ID = 'osteo-halo' @@ -203,7 +187,7 @@ function ensureHaloFilter(root: SVGSVGElement): void { const merge = doc.createElementNS(SVG_NS, 'feMerge') // Stack the wide halo three times so its contribution survives the - // canvg → PNG → pdf-lib pipeline (each pass attenuates alpha) and + // SVG → PNG → pdf-lib pipeline (each pass attenuates alpha) and // still reads as a strong glow at print scale. for (let i = 0; i < 3; i += 1) { const n = doc.createElementNS(SVG_NS, 'feMergeNode') @@ -359,7 +343,7 @@ export async function addObservationPage( const rendered = await Promise.all( items.map(async (it) => { const svgStr = await colorizedSvgString(it.src, observation, it.sourceId) - const png = await rasterizeSvg(svgStr, 2) + const png = await rasterizeSvg(svgStr) const img = await pdfDoc.embedPng(png) const aspect = img.width > 0 ? img.height / img.width : 0.6 return { label: it.label, img, aspect } diff --git a/src/pdf/render/svgToPng.ts b/src/pdf/render/svgToPng.ts index faa67fae..912c0e3b 100644 --- a/src/pdf/render/svgToPng.ts +++ b/src/pdf/render/svgToPng.ts @@ -113,14 +113,8 @@ async function canvasToPngBytes(canvas: HTMLCanvasElement): Promise * the inline anatomy canvas. * * @param svgString Serialized SVG (must declare `xmlns`) - * @param _scale Reserved — current implementation renders at a fixed - * TARGET_WIDTH derived from the viewBox; kept for API - * compatibility. */ -export async function rasterizeSvg( - svgString: string, - _scale: number, -): Promise { +export async function rasterizeSvg(svgString: string): Promise { const { widthPx, heightPx } = readViewBox(svgString) const canvas = await rasterizeWithImageElement(svgString, widthPx, heightPx) return canvasToPngBytes(canvas) diff --git a/src/pdf/render/text.ts b/src/pdf/render/text.ts new file mode 100644 index 00000000..0dbc58cd --- /dev/null +++ b/src/pdf/render/text.ts @@ -0,0 +1,27 @@ +import type { PDFFont } from 'pdf-lib' + +/** + * Greedy word-wrap: splits `text` into lines whose rendered width at + * `size` points stays within `max` for the given font. + */ +export function wrapLines( + text: string, + font: PDFFont, + size: number, + max: number, +): string[] { + const words = text.split(/\s+/) + const lines: string[] = [] + let line = '' + for (const w of words) { + const test = line ? `${line} ${w}` : w + if (font.widthOfTextAtSize(test, size) > max && line) { + lines.push(line) + line = w + } else { + line = test + } + } + if (line) lines.push(line) + return lines +} diff --git a/tests/unit/components.VertebraPicker.test.tsx b/tests/unit/components.VertebraPicker.test.tsx index 0b6d8968..6da76dee 100644 --- a/tests/unit/components.VertebraPicker.test.tsx +++ b/tests/unit/components.VertebraPicker.test.tsx @@ -1,9 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' import { render, screen } from '@testing-library/react' import userEvent from '@testing-library/user-event' -import VertebraPicker, { - regionFromLabel, -} from '@/components/observation/VertebraPicker' +import VertebraPicker from '@/components/observation/VertebraPicker' +import { regionFromLabel } from '@/lib/spineZones' import { EQUINE_VERTEBRAL_FORMULA } from '@/domain/species/equine/vertebrae' import { useLocaleStore } from '@/state/localeStore' diff --git a/tests/unit/pdf.svgToPng.test.ts b/tests/unit/pdf.svgToPng.test.ts index bed71fe3..0c11980c 100644 --- a/tests/unit/pdf.svgToPng.test.ts +++ b/tests/unit/pdf.svgToPng.test.ts @@ -48,7 +48,6 @@ describe('rasterizeSvg', () => { const out = await rasterizeSvg( '', - 2, ) expect(out).toBeInstanceOf(Uint8Array) expect(out[0]).toBe(0x89) @@ -79,7 +78,6 @@ describe('rasterizeSvg', () => { const out = await rasterizeSvg( '', - 2, ) expect(out[0]).toBe(0x89) expect(out[1]).toBe(0x50) From 4ea8c90c7f498ecc9e8aab1b9b93fcb96fc5f27d Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 04:48:04 +0200 Subject: [PATCH 08/26] chore(i18n): drop dead dict keys, wire LanguageSwitcher through dict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6 keys unused in both dicts removed (common.back, common.none, editors.title, lateral.bilateral, lateral.unpaired, pdf.export_date_prefix). LanguageSwitcher hardcoded strings identical to existing lang.* keys — now reads them via t(); rendered output unchanged (values identical in both dicts). --- src/components/brand/LanguageSwitcher.tsx | 12 +++++++----- src/i18n/en.ts | 6 ------ src/i18n/fr.ts | 6 ------ 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/components/brand/LanguageSwitcher.tsx b/src/components/brand/LanguageSwitcher.tsx index 25325e1d..32501a87 100644 --- a/src/components/brand/LanguageSwitcher.tsx +++ b/src/components/brand/LanguageSwitcher.tsx @@ -1,14 +1,16 @@ import { useLocaleStore } from '@/state/localeStore' +import { useT } from '@/i18n/useT' import type { Locale } from '@/i18n/types' -const ITEMS: { value: Locale; label: string; ariaLabel: string }[] = [ - { value: 'fr', label: 'FR', ariaLabel: 'Passer en français' }, - { value: 'en', label: 'EN', ariaLabel: 'Switch to English' }, +const ITEMS: { value: Locale; labelKey: string; ariaKey: string }[] = [ + { value: 'fr', labelKey: 'lang.fr', ariaKey: 'lang.switch_to_fr' }, + { value: 'en', labelKey: 'lang.en', ariaKey: 'lang.switch_to_en' }, ] export default function LanguageSwitcher() { const locale = useLocaleStore((s) => s.locale) const setLocale = useLocaleStore((s) => s.setLocale) + const t = useT() return (
setLocale(item.value)} className={[ @@ -31,7 +33,7 @@ export default function LanguageSwitcher() { : 'text-[var(--color-ink)] hover:bg-[var(--color-surface-strong)]', ].join(' ')} > - {item.label} + {t(item.labelKey)} ) })} diff --git a/src/i18n/en.ts b/src/i18n/en.ts index cb39e871..b12af026 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -6,14 +6,12 @@ export const en: Dict = { 'common.confirm': 'Confirm', 'common.delete': 'Delete', 'common.add': 'Add', - 'common.back': 'Back', 'common.home': 'Home', 'common.understood': 'Got it', 'common.collapse': 'Collapse', 'common.expand': 'Expand', 'common.move_up': 'Move up', 'common.move_down': 'Move down', - 'common.none': 'None', 'common.back_to_home': 'Back to home', 'home.new_report.title': 'New report', @@ -37,7 +35,6 @@ export const en: Dict = { 'footer.in_partnership': 'In partnership with', // editors page - 'editors.title': 'Editors', 'editors.svg.title': 'SVG Editor', 'editors.svg.description': 'Annotate an anatomical SVG file: add clickable zones, categories, and FR/EN labels.', @@ -135,8 +132,6 @@ export const en: Dict = { 'lateral.both': 'Both', 'lateral.left_short': 'L', 'lateral.right_short': 'R', - 'lateral.bilateral': 'Bilateral', - 'lateral.unpaired': 'Unilateral', 'severity.aria': 'Severity', 'severity.légère': 'mild', @@ -159,7 +154,6 @@ export const en: Dict = { 'pdf.empty': '—', 'pdf.owner_prefix': 'Owner: ', 'pdf.siret_prefix': 'SIRET ', - 'pdf.export_date_prefix': 'Exported on ', 'pdf.title.suffix.bilan': 'Faunosteo — ', 'pdf.subject': 'Animal osteopathic report', diff --git a/src/i18n/fr.ts b/src/i18n/fr.ts index 4d61744a..821d7624 100644 --- a/src/i18n/fr.ts +++ b/src/i18n/fr.ts @@ -7,14 +7,12 @@ export const fr: Dict = { 'common.confirm': 'Valider', 'common.delete': 'Supprimer', 'common.add': 'Ajouter', - 'common.back': 'Retour', 'common.home': 'Accueil', 'common.understood': 'Compris', 'common.collapse': 'Réduire', 'common.expand': 'Développer', 'common.move_up': 'Monter', 'common.move_down': 'Descendre', - 'common.none': 'Aucun', 'common.back_to_home': "Retour à l'accueil", // home @@ -41,7 +39,6 @@ export const fr: Dict = { 'footer.in_partnership': 'En partenariat avec', // editors page - 'editors.title': 'Éditeurs', 'editors.svg.title': 'Éditeur SVG', 'editors.svg.description': 'Annoter un fichier SVG anatomique : ajouter des zones cliquables, catégories et labels FR/EN.', @@ -149,8 +146,6 @@ export const fr: Dict = { 'lateral.both': 'Les deux', 'lateral.left_short': 'G', 'lateral.right_short': 'D', - 'lateral.bilateral': 'Bilatéral', - 'lateral.unpaired': 'Unilatéral', // severity 'severity.aria': 'Sévérité', @@ -175,7 +170,6 @@ export const fr: Dict = { 'pdf.empty': '—', 'pdf.owner_prefix': 'Propriétaire : ', 'pdf.siret_prefix': 'SIRET ', - 'pdf.export_date_prefix': 'Exporté le ', 'pdf.title.suffix.bilan': 'Bilan ostéo — ', 'pdf.subject': "Bilan d'ostéopathie animalière", From 86ac3661362ca9a6c4e757354666dd7bc47b5c04 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 04:48:04 +0200 Subject: [PATCH 09/26] chore(ui): read Brand logo alt text from config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit alt="Faunosteo" hardcoded — identity strings must come from useConfig() (CLAUDE.md identity rule). Output identical under default config; custom APP_BRAND_NAME now honored. --- src/components/brand/Brand.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/brand/Brand.tsx b/src/components/brand/Brand.tsx index 01901361..0d518ca1 100644 --- a/src/components/brand/Brand.tsx +++ b/src/components/brand/Brand.tsx @@ -1,10 +1,13 @@ +import { useConfig } from '@/app/providers/ConfigProvider' + const HEIGHT = { sm: 'h-7', md: 'h-9', lg: 'h-11' } as const export default function Brand({ size = 'md' }: { size?: 'sm' | 'md' | 'lg' }) { + const { brandName } = useConfig() return ( Faunosteo ) From 1078f74793e97bb8c7e3991f1f1e85f27e2f1782 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Sun, 12 Jul 2026 11:57:19 +0200 Subject: [PATCH 10/26] docs: sync README, DEPLOY, CHANGELOG with tour fixes (canvg drop, non-root container, base pin) --- CHANGELOG.md | 11 +++++++++++ DEPLOY.md | 9 +++++---- README.md | 3 +-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1dec3db..6236a7d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,10 +21,21 @@ Versions follow [Semantic Versioning](https://semver.org/). - **Responsive mobile** — full phone/tablet adaptation across all components. - **Project renamed** Zoosteo → Faunosteo across the whole codebase. +### Removed + +- **`canvg` dependency** — PDF SVG rasterization now uses the browser's native `Image`/`canvas` pipeline (`src/pdf/render/svgToPng.ts`) instead of the `canvg` library. + ### Fixed - **`pathology-editor.html` 404 in production** — it lived at the repo root, Vite never bundled it into `dist/`; moved to `public/` so it ships (LRN-029). - **Docker species caching** — `Cache-Control: no-cache` header added for `/species/` assets so an updated catalog is served fresh. +- **nginx runner base image** pinned to `nginx:1.31-alpine` (was the floating `nginx:alpine` tag). + +### Security + +- **Docker container runs fully as non-root** (`USER nginx`) — `PORT` must now be `>=1024` (default `8080` unaffected). +- **Supply-chain guard** — `.npmrc` gained `minimum-release-age=1440`, blocking install of package versions published less than 24h ago. +- **User-imported SVGs sanitized** — the SVG editor and the standalone pathology editor now strip `