From 0abee1048c44a4e79d2f07f38b186eb52051a624 Mon Sep 17 00:00:00 2001 From: Amruth Pillai Date: Mon, 11 May 2026 00:09:07 +0200 Subject: [PATCH] fix(docs): update healthcheck test script on docs, resolves #3027 --- docs/self-hosting/docker.mdx | 6 ++--- docs/self-hosting/examples.mdx | 6 ++--- packages/pdf/package.json | 1 + packages/pdf/src/hooks/use-register-fonts.ts | 3 ++- pnpm-lock.yaml | 26 ++++++++++++++++++++ 5 files changed, 35 insertions(+), 7 deletions(-) diff --git a/docs/self-hosting/docker.mdx b/docs/self-hosting/docker.mdx index aa208c2e5..b25194fe0 100644 --- a/docs/self-hosting/docker.mdx +++ b/docs/self-hosting/docker.mdx @@ -180,7 +180,7 @@ services: postgres: condition: service_healthy healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] + test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then((r) => { if (!r.ok) process.exit(1); }).catch(() => process.exit(1));"] interval: 30s timeout: 10s retries: 3 @@ -404,7 +404,7 @@ The Docker Compose configuration includes a health check that periodically calls ```yaml healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] + test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then((r) => { if (!r.ok) process.exit(1); }).catch(() => process.exit(1));"] interval: 30s timeout: 10s retries: 3 @@ -467,7 +467,7 @@ A healthy response returns HTTP 200. Any other response (or a connection failure - **Common cause**: storage health failed (not only database). - **Fix**: inspect the endpoint response payload and - check the `storage` field: ```bash curl -s http://localhost:3000/api/health ``` + check the `storage` field: http://127.0.0.1:3000/api/health diff --git a/docs/self-hosting/examples.mdx b/docs/self-hosting/examples.mdx index 9b806f037..595f5ee94 100644 --- a/docs/self-hosting/examples.mdx +++ b/docs/self-hosting/examples.mdx @@ -104,7 +104,7 @@ services: - "traefik.http.routers.reactive-resume.tls.certresolver=letsencrypt" - "traefik.http.services.reactive-resume.loadbalancer.server.port=3000" healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] + test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then((r) => { if (!r.ok) process.exit(1); }).catch(() => process.exit(1));"] interval: 30s timeout: 10s retries: 3 @@ -183,7 +183,7 @@ services: postgres: condition: service_healthy healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] + test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then((r) => { if (!r.ok) process.exit(1); }).catch(() => process.exit(1));"] interval: 30s timeout: 10s retries: 3 @@ -363,7 +363,7 @@ services: - S3_ENDPOINT=$S3_ENDPOINT - S3_BUCKET=$S3_BUCKET healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"] + test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then((r) => { if (!r.ok) process.exit(1); }).catch(() => process.exit(1));"] interval: 30s timeout: 10s retries: 3 diff --git a/packages/pdf/package.json b/packages/pdf/package.json index cc7ea314c..aa1ad258a 100644 --- a/packages/pdf/package.json +++ b/packages/pdf/package.json @@ -21,6 +21,7 @@ "@reactive-resume/fonts": "workspace:*", "@reactive-resume/schema": "workspace:*", "@reactive-resume/utils": "workspace:*", + "cjk-regex": "^3.4.0", "node-html-parser": "^7.1.0", "phosphor-icons-react-pdf": "^0.1.3", "react": "^19.2.6", diff --git a/packages/pdf/src/hooks/use-register-fonts.ts b/packages/pdf/src/hooks/use-register-fonts.ts index 50f324c62..49fee2b9c 100644 --- a/packages/pdf/src/hooks/use-register-fonts.ts +++ b/packages/pdf/src/hooks/use-register-fonts.ts @@ -1,6 +1,7 @@ import type { FontWeight } from "@reactive-resume/fonts"; import type { Typography } from "@reactive-resume/schema/resume/data"; import { Font } from "@react-pdf/renderer"; +import { all as cjk } from "cjk-regex"; import { getFont, getPdfCjkFallbackFontFamily, @@ -66,7 +67,7 @@ const resolvePdfTypography = (typography: Typography): Typography => { export const registerFonts = (typography: Typography): PdfTypography => { Font.registerHyphenationCallback((word) => { - if (word.match(/\p{Script=Han}/u)) return word.split("").flatMap((l) => [l, ""]); + if (cjk().toRegExp().test(word)) return word.split("").flatMap((l) => [l, ""]); return [word]; }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6374bd53e..f5cd079b6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -672,6 +672,9 @@ importers: '@reactive-resume/utils': specifier: workspace:* version: link:../utils + cjk-regex: + specifier: ^3.4.0 + version: 3.4.0 node-html-parser: specifier: ^7.1.0 version: 7.1.0 @@ -5438,6 +5441,10 @@ packages: citty@0.2.2: resolution: {integrity: sha512-+6vJA3L98yv+IdfKGZHBNiGW5KHn22e/JwID0Strsz8h4S/csAu/OuICwxrg44k5MRiZHWIo8XXuJgQTriRP4w==} + cjk-regex@3.4.0: + resolution: {integrity: sha512-m+gbmlIP6gAG7tDvo2kpeSPAz/uh5wY5/zx10ymjdpbbiTHNTNoYnP2lCiyqtmbLxwhEdq8/lsVbsy4GTc9oUw==} + engines: {node: '>=16'} + class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} @@ -7839,6 +7846,10 @@ packages: regenerate@1.4.2: resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==} + regexp-util@2.0.3: + resolution: {integrity: sha512-GP6h9OgJmhAZpb3dbNbXTfRWVnGcoMhWRZv/HxgM4/qCVqs1P9ukQdYxaUhjWBSAs9oJ/uPXUUvGT1VMe0Bs0Q==} + engines: {node: '>=16'} + regexp.prototype.flags@1.5.4: resolution: {integrity: sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA==} engines: {node: '>= 0.4'} @@ -8452,6 +8463,10 @@ packages: resolution: {integrity: sha512-hpbDzxUY9BFwX+UeBnxv3Sh1q7HFxj48DTmXchNgRa46lO8uj3/1iEn3MiNUYTg1g9ctIqXCCERn8gYZhHC5lQ==} engines: {node: '>=4'} + unicode-regex@4.2.0: + resolution: {integrity: sha512-fEYz7CCnvHDAdrb8OYAP7qlQCWzXBO5cHXQ3XI+HoZaBpiAwyC6b2nixMGl91yrDYEIRm7NDskgTvnLZ7mqrKQ==} + engines: {node: '>=16'} + unicode-trie@2.0.0: resolution: {integrity: sha512-x7bc76x0bm4prf1VLg79uhAzKw8DVboClSN5VxJuQ+LKDOVEW9CdH+VY7SP+vX7xCYQqzzgQpFqz15zeLvAtZQ==} @@ -13785,6 +13800,11 @@ snapshots: citty@0.2.2: {} + cjk-regex@3.4.0: + dependencies: + regexp-util: 2.0.3 + unicode-regex: 4.2.0 + class-variance-authority@0.7.1: dependencies: clsx: 2.1.1 @@ -16167,6 +16187,8 @@ snapshots: regenerate@1.4.2: {} + regexp-util@2.0.3: {} + regexp.prototype.flags@1.5.4: dependencies: call-bind: 1.0.9 @@ -16943,6 +16965,10 @@ snapshots: unicode-property-aliases-ecmascript@2.2.0: {} + unicode-regex@4.2.0: + dependencies: + regexp-util: 2.0.3 + unicode-trie@2.0.0: dependencies: pako: 0.2.9