From 811615dd066a11bce171c10e9b8bb7fdf157fa84 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Tue, 12 May 2026 14:23:09 +0000 Subject: [PATCH] fix(docs): Remove skipLibCheck and address React 19 namespace issues per package * Update hast-util-to-jsx-runtime with npm override * Re-export JSX as namespace for remaining packages with issues May be addressed by future package updates or upgrading to docusaurus 3.10.x --- docsite/package-lock.json | 48 ++++++++++++++++++++++++++---------- docsite/package.json | 3 ++- docsite/tsconfig.client.json | 3 +-- docsite/types/global.d.ts | 27 ++++++++++++++++++++ 4 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 docsite/types/global.d.ts diff --git a/docsite/package-lock.json b/docsite/package-lock.json index 311e9803..63b62568 100644 --- a/docsite/package-lock.json +++ b/docsite/package-lock.json @@ -12266,9 +12266,10 @@ } }, "node_modules/hast-util-to-jsx-runtime": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.2.tgz", - "integrity": "sha512-1ngXYb+V9UT5h+PxNRa1O1FYguZK/XL+gkeqvp7EdHlB9oHUG0eYRo/vY5inBdcqo3RkPMC58/H94HvkbfGdyg==", + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", "dependencies": { "@types/estree": "^1.0.0", "@types/hast": "^3.0.0", @@ -12280,9 +12281,9 @@ "mdast-util-mdx-expression": "^2.0.0", "mdast-util-mdx-jsx": "^3.0.0", "mdast-util-mdxjs-esm": "^2.0.0", - "property-information": "^6.0.0", + "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", - "style-to-object": "^1.0.0", + "style-to-js": "^1.0.0", "unist-util-position": "^5.0.0", "vfile-message": "^4.0.0" }, @@ -12291,6 +12292,16 @@ "url": "https://opencollective.com/unified" } }, + "node_modules/hast-util-to-jsx-runtime/node_modules/property-information": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", + "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, "node_modules/hast-util-to-parse5": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz", @@ -12883,9 +12894,10 @@ } }, "node_modules/inline-style-parser": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.4.tgz", - "integrity": "sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==" + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" }, "node_modules/invariant": { "version": "2.2.4", @@ -20835,12 +20847,22 @@ "integrity": "sha512-i/n8VsZydrugj3Iuzll8+x/00GH2vnYsk1eomD8QiRrSAeW6ItbCQDtfXCeJHd0iwiNagqjQkvpvREEPtW3IoQ==", "license": "MIT" }, - "node_modules/style-to-object": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.8.tgz", - "integrity": "sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==", + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", "dependencies": { - "inline-style-parser": "0.2.4" + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" } }, "node_modules/stylehacks": { diff --git a/docsite/package.json b/docsite/package.json index 4637cf35..8640608f 100644 --- a/docsite/package.json +++ b/docsite/package.json @@ -66,6 +66,7 @@ }, "overrides": { "lodash": "4.18.1", - "satori": "0.25.0" + "satori": "0.25.0", + "hast-util-to-jsx-runtime": "2.3.6" } } diff --git a/docsite/tsconfig.client.json b/docsite/tsconfig.client.json index 9c667f4c..9f2723ee 100644 --- a/docsite/tsconfig.client.json +++ b/docsite/tsconfig.client.json @@ -1,6 +1,5 @@ { "compilerOptions": { - "skipLibCheck": true, "noEmit": false, "composite": true, "incremental": true, @@ -15,5 +14,5 @@ "baseUrl": "./docs", "lib": ["DOM"] }, - "include": ["src/socialCard/ImageRenderers.tsx"] + "include": ["src/socialCard/ImageRenderers.tsx", "types"] } \ No newline at end of file diff --git a/docsite/types/global.d.ts b/docsite/types/global.d.ts new file mode 100644 index 00000000..934754d1 --- /dev/null +++ b/docsite/types/global.d.ts @@ -0,0 +1,27 @@ +import * as React from 'react' + +/** + * React 19 removed the JSX namespace + * https://react.dev/blog/2024/04/25/react-19-upgrade-guide#the-jsx-namespace-in-typescript + * and any packages that still use it will produce ts warnings/errors + * + * this can be bypassed by using tsconfig's compilerOptions.skipLibCheck: true + * but that is not super great for detecting actual issues with third party libraries before compile time + * + * Some of the below may be fixed by upgrading docusaurus to 3.10.x but for now: + * + * * hast-util-to-jsx-runtime version had to be overriden to use a newer package to fix NS issue + * * packages below have no newer version with fixed NS so we just provide global overrides to re-export React as JSX NS + * + */ + +// https://github.com/mdx-js/mdx/issues/2487#issuecomment-3462720757 +declare module 'mdx/types.js' { + export import JSX = React.JSX +} + +declare module 'react-helmet-async' { + export import JSX = React.JSX +} + +export {} \ No newline at end of file