diff --git a/data-migration/package-lock.json b/data-migration/package-lock.json index 4de3be8..3de550d 100644 --- a/data-migration/package-lock.json +++ b/data-migration/package-lock.json @@ -785,16 +785,16 @@ } }, "node_modules/@hono/node-server": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.3.tgz", - "integrity": "sha512-TA//nWMqPhbfdfneACk6t5a9eqbS9lABEPyKn0/xZTah3H3U2XaVg85rJFl0/Fyit0I552YDHgXGVSf3GwqbUw==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.8.tgz", + "integrity": "sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==", "devOptional": true, "license": "MIT", "engines": { "node": ">=20" }, "peerDependencies": { - "hono": "^4" + "hono": "^4 || ^5.0.0-0" } }, "node_modules/@humanfs/core": { @@ -4014,9 +4014,9 @@ } }, "node_modules/hono": { - "version": "4.13.11", - "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.11.tgz", - "integrity": "sha512-/SMX/RQNJn7oNmFwH6DtwDqcrzZU2otm1FD6OJe2cWF6cfy/F8hq0XVBv7xW3FTJshRQwuBnXHDq2kNsdZnshg==", + "version": "4.13.18", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.18.tgz", + "integrity": "sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==", "devOptional": true, "license": "MIT", "engines": { diff --git a/data-migration/package.json b/data-migration/package.json index 3fff2c8..46c15be 100644 --- a/data-migration/package.json +++ b/data-migration/package.json @@ -39,11 +39,11 @@ "yarn": "1.22.19" }, "overrides": { - "@hono/node-server": "2.1.3", + "@hono/node-server": "2.1.8", "deepmerge-ts": "8.0.0", "effect": "3.22.0", "glob": "14.0.2", - "hono": "4.13.11", + "hono": "4.13.18", "lodash": "4.18.1", "valibot": "1.4.2", "mysql2": "3.23.1", diff --git a/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js b/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js index 68da35d..f9fe432 100644 --- a/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js +++ b/data-migration/src/scripts/importHistoricalMarathonMatches/descriptionSourcing.js @@ -283,19 +283,19 @@ const convertRichTextSectionToMarkdown = (value) => { .replace(/\s*(?:<\/br>)?/gi, "\n") .replace(/<(tt|code|type)\b[^>]*>([\s\S]*?)<\/\1>/gi, (_, __, content) => { const inline = toInlineText(content); - return inline ? `\`${inline}\`` : ""; + return inline ? `\`${inline}\`` : " "; }) .replace(/<(b|strong)\b[^>]*>([\s\S]*?)<\/\1>/gi, (_, __, content) => { const inline = toInlineText(content); - return inline ? `**${inline}**` : ""; + return inline ? `**${inline}**` : " "; }) .replace(/<(i|em)\b[^>]*>([\s\S]*?)<\/\1>/gi, (_, __, content) => { const inline = toInlineText(content); - return inline ? `*${inline}*` : ""; + return inline ? `*${inline}*` : " "; }) .replace(/]*>([\s\S]*?)<\/sup>/gi, (_, content) => { const inline = toInlineText(content); - return inline ? `^${inline}^` : ""; + return inline ? `^${inline}^` : " "; }) .replace(/]*>/gi, "\n- ") .replace(/<\/li>/gi, "\n") diff --git a/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js b/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js index 2e59d62..aee8f37 100644 --- a/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js +++ b/data-migration/test/importHistoricalMarathonMatches.descriptionSourcing.test.js @@ -78,4 +78,18 @@ describe("importHistoricalMarathonMatches description sourcing", () => { source: "legacy-component-text-markdown", }); }); + + test.each(["tt", "code", "type", "b", "strong", "i", "em", "sup"])( + "keeps a separator when an empty %s element interrupts an HTML tag", + (tag) => { + const markdown = convertComponentXmlToMarkdown( + `before <${tag}>iframe src='https://evil.example'>after` + ); + + expect(markdown).toContain("before"); + expect(markdown).toContain("after"); + expect(markdown).toContain("iframe src='https://evil.example'>after"); + expect(markdown).not.toMatch(/=1.4-r0' openssl WORKDIR /challenge-api RUN npm install --global pnpm@${PNPM_VERSION} @@ -41,7 +41,7 @@ FROM alpine:${ALPINE_VERSION} AS runtime COPY --from=node-base /usr/local/bin/node /usr/local/bin/node ARG NODE_VERSION RUN apk upgrade --no-cache \ - && apk add --no-cache ca-certificates libatomic libstdc++ openssl \ + && apk add --no-cache 'zlib>=1.4-r0' ca-certificates libatomic libstdc++ openssl \ && test "$(node --version)" = "v${NODE_VERSION}" \ && addgroup -S app \ && adduser -S -D -u 10001 -G app app diff --git a/mock-api/Dockerfile b/mock-api/Dockerfile index f3cb1c4..ed03921 100644 --- a/mock-api/Dockerfile +++ b/mock-api/Dockerfile @@ -1,4 +1,4 @@ -ARG NODE_VERSION=26.5.1 +ARG NODE_VERSION=26.13.1 ARG ALPINE_VERSION=3.24 ARG PNPM_VERSION=11.15.1 @@ -9,7 +9,7 @@ FROM node-base AS build ARG PNPM_VERSION RUN apk upgrade --no-cache \ - && apk add --no-cache openssl \ + && apk add --no-cache 'zlib>=1.4-r0' openssl \ && npm install --global pnpm@${PNPM_VERSION} WORKDIR /challenge-api @@ -38,7 +38,7 @@ FROM alpine:${ALPINE_VERSION} AS runtime COPY --from=node-base /usr/local/bin/node /usr/local/bin/node ARG NODE_VERSION RUN apk upgrade --no-cache \ - && apk add --no-cache ca-certificates libatomic libstdc++ openssl \ + && apk add --no-cache 'zlib>=1.4-r0' ca-certificates libatomic libstdc++ openssl \ && test "$(node --version)" = "v${NODE_VERSION}" \ && addgroup -S app \ && adduser -S -D -u 10001 -G app app diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8da9ac8..e356a2a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,7 @@ settings: excludeLinksFromLockfile: false overrides: + tc-core-library-js: github:topcoder-platform/tc-core-library-js#v4.0.0-rc.2 baseline-browser-mapping: 2.11.0 browserslist: 4.28.8 proxy-addr: 2.0.8 @@ -15,8 +16,8 @@ overrides: joi: 18.3.1 moment: 2.31.0 mysql2: 3.23.1 - hono: 4.13.11 - '@hono/node-server': 2.1.3 + hono: 4.13.18 + '@hono/node-server': 2.1.8 js-yaml@^3: 3.15.2 js-yaml@^4: 4.3.2 js-yaml@^5: 5.4.1 @@ -630,11 +631,11 @@ packages: '@hapi/topo@6.0.2': resolution: {integrity: sha512-KR3rD5inZbGMrHmgPxsJ9dbi6zEK+C3ZwUwTa+eMwWLz7oijWUTWD2pMSNNYJAU6Qq+65NkxXjqHr/7LM2Xkqg==} - '@hono/node-server@2.1.3': - resolution: {integrity: sha512-TA//nWMqPhbfdfneACk6t5a9eqbS9lABEPyKn0/xZTah3H3U2XaVg85rJFl0/Fyit0I552YDHgXGVSf3GwqbUw==} + '@hono/node-server@2.1.8': + resolution: {integrity: sha512-jdf7FHh6A1lzjpHHQUgxsg2GeER2vMetnAOfeActzcoli6jamlK+NAwL6Dsr5Fl3BS3tYUQzCdtZjU8Qxv7bEA==} engines: {node: '>=20'} peerDependencies: - hono: 4.13.11 + hono: 4.13.18 '@humanfs/core@0.19.2': resolution: {integrity: sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==} @@ -1836,6 +1837,7 @@ packages: axios-retry@4.5.0: resolution: {integrity: sha512-aR99oXhpEDGo0UuAlYcn2iGRds30k366Zfa05XWScR9QaQD4JYiP3/1Qt1u7YlefUOK+cn0CcwoL1oefavQUlQ==} + deprecated: axios-retry is no longer maintained. See https://github.com/softonic/axios-retry for alternatives. peerDependencies: axios: 1.20.0 @@ -2776,8 +2778,8 @@ packages: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true - hono@4.13.11: - resolution: {integrity: sha512-/SMX/RQNJn7oNmFwH6DtwDqcrzZU2otm1FD6OJe2cWF6cfy/F8hq0XVBv7xW3FTJshRQwuBnXHDq2kNsdZnshg==} + hono@4.13.18: + resolution: {integrity: sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==} engines: {node: '>=16.9.0'} html-escaper@2.0.2: @@ -3336,6 +3338,7 @@ packages: node-abort-controller@3.1.1: resolution: {integrity: sha512-AGK2yQKIjRuqnc6VkX2Xj5d+QW8xZ87pa1UK6yA6ouUyuxfHuMP6umE5QK7UmTeOAymo+Zx1Fxiuw9rVx8taHQ==} + deprecated: This package is no longer needed on supported Node.js versions. Node.js 16+ includes AbortController and AbortSignal as built-in globals. All Node.js versions requiring this polyfill are end-of-life. Use the built-in globals instead. node-cache@5.1.2: resolution: {integrity: sha512-t1QzWwnk4sjLWaQAS8CHgOJ+RAfmHpxFWmc36IWTiWHQfs0w5JDMBS1b1ZxQteo0vVVuWJvIUKHDkkeK7vIGCg==} @@ -5102,9 +5105,9 @@ snapshots: dependencies: '@hapi/hoek': 11.0.7 - '@hono/node-server@2.1.3(hono@4.13.11)': + '@hono/node-server@2.1.8(hono@4.13.18)': dependencies: - hono: 4.13.11 + hono: 4.13.18 '@humanfs/core@0.19.2': dependencies: @@ -5532,13 +5535,13 @@ snapshots: '@electric-sql/pglite': 0.4.1 '@electric-sql/pglite-socket': 0.1.1(@electric-sql/pglite@0.4.1) '@electric-sql/pglite-tools': 0.3.1(@electric-sql/pglite@0.4.1) - '@hono/node-server': 2.1.3(hono@4.13.11) + '@hono/node-server': 2.1.8(hono@4.13.18) '@prisma/get-platform': 7.2.0 '@prisma/query-plan-executor': 7.2.0 '@prisma/streams-local': 0.1.2 foreground-child: 3.3.1 get-port-please: 3.2.0 - hono: 4.13.11 + hono: 4.13.18 http-status-codes: 2.3.0 pathe: 2.0.3 proper-lockfile: 4.1.2 @@ -7618,7 +7621,7 @@ snapshots: he@1.2.0: {} - hono@4.13.11: {} + hono@4.13.18: {} html-escaper@2.0.2: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 3345499..04df46c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -12,6 +12,8 @@ allowBuilds: dtrace-provider: false overrides: + # Keep linked service packages on the same hardened JWT verifier as this API. + tc-core-library-js: github:topcoder-platform/tc-core-library-js#v4.0.0-rc.2 'baseline-browser-mapping': 2.11.0 'browserslist': 4.28.8 'proxy-addr': 2.0.8 @@ -22,8 +24,8 @@ overrides: 'joi': 18.3.1 'moment': 2.31.0 'mysql2': 3.23.1 - 'hono': 4.13.11 - '@hono/node-server': 2.1.3 + 'hono': 4.13.18 + '@hono/node-server': 2.1.8 'js-yaml@^3': 3.15.2 'js-yaml@^4': 4.3.2 'js-yaml@^5': 5.4.1