From a39aecae5f71c2ac49e4e12b147b21da3ce5c5f3 Mon Sep 17 00:00:00 2001 From: saberzero1 Date: Mon, 16 Mar 2026 18:54:39 +0100 Subject: [PATCH] fix: centralize type declarations and add missing peer dependency - Update types/globals.d.ts with centralized type declarations - Add hast-util-to-jsx-runtime as devDependency (peer dep from @quartz-community/utils) - Add .prettierignore, update .eslintrc.json with triple-slash-reference override - Remove duplicate scripts.d.ts/styles.d.ts --- .eslintrc.json | 10 ++- .prettierignore | 1 + package-lock.json | 217 ++++++++++++++++++++++----------------------- package.json | 8 +- src/styles.d.ts | 4 - tsconfig.json | 2 +- types/globals.d.ts | 36 ++++++++ 7 files changed, 160 insertions(+), 118 deletions(-) create mode 100644 .prettierignore delete mode 100644 src/styles.d.ts create mode 100644 types/globals.d.ts diff --git a/.eslintrc.json b/.eslintrc.json index a9ba90d..dda1fa0 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -22,5 +22,13 @@ "caughtErrorsIgnorePattern": "^_" } ] - } + }, + "overrides": [ + { + "files": ["types/**/*.d.ts"], + "rules": { + "@typescript-eslint/triple-slash-reference": "off" + } + } + ] } diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..1521c8b --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +dist diff --git a/package-lock.json b/package-lock.json index 6a0bd4e..459d410 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,6 +20,8 @@ "@typescript-eslint/parser": "^7.18.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", + "github-slugger": "^2.0.0", + "hast-util-to-jsx-runtime": "^2.3.6", "preact": "^10.28.2", "prettier": "^3.6.2", "sass": "^1.97.3", @@ -1445,8 +1447,8 @@ "version": "4.1.12", "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/ms": "*" } @@ -1462,8 +1464,8 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/estree": "*" } @@ -1492,8 +1494,8 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", - "license": "MIT", - "optional": true + "devOptional": true, + "license": "MIT" }, "node_modules/@types/node": { "version": "24.10.13", @@ -1942,17 +1944,6 @@ "node": ">=12" } }, - "node_modules/bail": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", - "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", - "license": "MIT", - "optional": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -2023,8 +2014,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2068,8 +2059,8 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2079,8 +2070,8 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2090,8 +2081,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2101,8 +2092,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2165,8 +2156,8 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2243,8 +2234,8 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "character-entities": "^2.0.0" }, @@ -2274,8 +2265,8 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "devOptional": true, "license": "MIT", - "optional": true, "engines": { "node": ">=6" } @@ -2295,8 +2286,8 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "dequal": "^2.0.0" }, @@ -2577,8 +2568,8 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/unified" @@ -2614,13 +2605,6 @@ "node": ">=12.0.0" } }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "license": "MIT", - "optional": true - }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -2781,6 +2765,14 @@ "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, + "node_modules/github-slugger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", + "devOptional": true, + "license": "ISC", + "peer": true + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -2894,12 +2886,41 @@ "node": ">=8" } }, + "node_modules/hast-util-to-jsx-runtime": { + "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==", + "devOptional": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/hast-util-whitespace": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/hast": "^3.0.0" }, @@ -2975,15 +2996,15 @@ "version": "0.2.7", "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", - "license": "MIT", - "optional": true + "devOptional": true, + "license": "MIT" }, "node_modules/is-alphabetical": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -2993,8 +3014,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "is-alphabetical": "^2.0.0", "is-decimal": "^2.0.0" @@ -3008,8 +3029,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -3042,8 +3063,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -3069,19 +3090,6 @@ "node": ">=8" } }, - "node_modules/is-plain-obj": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", - "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", - "license": "MIT", - "optional": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -3214,8 +3222,8 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -3242,8 +3250,8 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -3267,8 +3275,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", @@ -3286,8 +3294,8 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", @@ -3311,8 +3319,8 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", @@ -3330,8 +3338,8 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" @@ -3345,8 +3353,8 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", @@ -3367,8 +3375,8 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/mdast": "^4.0.0" }, @@ -3391,6 +3399,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3402,7 +3411,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", @@ -3427,6 +3435,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3438,7 +3447,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", @@ -3462,6 +3470,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3473,7 +3482,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", @@ -3484,6 +3492,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3495,7 +3504,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", @@ -3507,6 +3515,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3518,7 +3527,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -3528,6 +3536,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3539,7 +3548,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -3551,6 +3559,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3562,7 +3571,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", @@ -3574,6 +3582,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3585,7 +3594,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -3595,6 +3603,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3606,7 +3615,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-symbol": "^2.0.0" } @@ -3615,6 +3623,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3626,7 +3635,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", @@ -3637,6 +3645,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3648,7 +3657,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" @@ -3658,6 +3666,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3669,7 +3678,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-symbol": "^2.0.0" } @@ -3678,6 +3686,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3689,7 +3698,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", @@ -3701,6 +3709,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3711,13 +3720,13 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/micromark-util-html-tag-name": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3728,13 +3737,13 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/micromark-util-normalize-identifier": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3746,7 +3755,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-symbol": "^2.0.0" } @@ -3755,6 +3763,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3766,7 +3775,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-types": "^2.0.0" } @@ -3775,6 +3783,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3786,7 +3795,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", @@ -3797,6 +3805,7 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3808,7 +3817,6 @@ } ], "license": "MIT", - "optional": true, "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", @@ -3820,6 +3828,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3830,13 +3839,13 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/micromark-util-types": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "devOptional": true, "funding": [ { "type": "GitHub Sponsors", @@ -3847,8 +3856,7 @@ "url": "https://opencollective.com/unified" } ], - "license": "MIT", - "optional": true + "license": "MIT" }, "node_modules/micromatch": { "version": "4.0.8", @@ -4033,8 +4041,8 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/unist": "^2.0.0", "character-entities-legacy": "^3.0.0", @@ -4053,8 +4061,8 @@ "version": "2.0.11", "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", - "license": "MIT", - "optional": true + "devOptional": true, + "license": "MIT" }, "node_modules/path-exists": { "version": "4.0.0", @@ -4175,6 +4183,7 @@ } ], "license": "MIT", + "peer": true, "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", @@ -4268,8 +4277,8 @@ "version": "7.1.0", "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.1.0.tgz", "integrity": "sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4899,8 +4908,8 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4924,8 +4933,8 @@ "version": "4.0.4", "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" @@ -4965,8 +4974,8 @@ "version": "1.1.21", "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "style-to-object": "1.0.14" } @@ -4975,8 +4984,8 @@ "version": "1.0.14", "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "inline-style-parser": "0.2.7" } @@ -5186,17 +5195,6 @@ "tree-kill": "cli.js" } }, - "node_modules/trough": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", - "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", - "license": "MIT", - "optional": true, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/wooorm" - } - }, "node_modules/ts-api-utils": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", @@ -5346,8 +5344,8 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/unist": "^3.0.0" }, @@ -5360,8 +5358,8 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/unist": "^3.0.0" }, @@ -5388,8 +5386,8 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", @@ -5404,8 +5402,8 @@ "version": "6.0.2", "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "devOptional": true, "license": "MIT", - "optional": true, "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" @@ -5438,6 +5436,7 @@ "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", "devOptional": true, "license": "MIT", + "peer": true, "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" @@ -6123,8 +6122,8 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "devOptional": true, "license": "MIT", - "optional": true, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" diff --git a/package.json b/package.json index 42fd6e6..70f0b34 100644 --- a/package.json +++ b/package.json @@ -69,14 +69,16 @@ "@typescript-eslint/parser": "^7.18.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", + "github-slugger": "^2.0.0", + "hast-util-to-jsx-runtime": "^2.3.6", "preact": "^10.28.2", "prettier": "^3.6.2", "sass": "^1.97.3", "sass-embedded": "^1.97.3", - "vfile": "^6.0.3", - "vitest": "^2.1.9", "tsup": "^8.5.0", - "typescript": "^5.9.3" + "typescript": "^5.9.3", + "vfile": "^6.0.3", + "vitest": "^2.1.9" }, "engines": { "node": ">=22", diff --git a/src/styles.d.ts b/src/styles.d.ts deleted file mode 100644 index 0a31e5e..0000000 --- a/src/styles.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare module "*.scss" { - const content: string; - export default content; -} diff --git a/tsconfig.json b/tsconfig.json index 99ca5e7..e2479a9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,6 +21,6 @@ "jsx": "react-jsx", "jsxImportSource": "preact" }, - "include": ["src", "test", "tsup.config.ts", "vitest.config.ts"], + "include": ["src", "test", "tsup.config.ts", "vitest.config.ts", "types"], "exclude": ["dist", "node_modules"] } diff --git a/types/globals.d.ts b/types/globals.d.ts new file mode 100644 index 0000000..a9e71ae --- /dev/null +++ b/types/globals.d.ts @@ -0,0 +1,36 @@ +declare module "*.scss" { + const content: string; + export default content; +} + +declare module "*.inline.ts" { + const content: string; + export default content; +} + +interface CustomEventMap { + nav: CustomEvent<{ url: string }>; + prenav: CustomEvent; + themechange: CustomEvent<{ theme: "light" | "dark" }>; + readermodechange: CustomEvent<{ mode: "on" | "off" }>; + render: CustomEvent; +} + +interface Document { + addEventListener( + type: K, + listener: (this: Document, ev: CustomEventMap[K]) => void, + ): void; + removeEventListener( + type: K, + listener: (this: Document, ev: CustomEventMap[K]) => void, + ): void; + dispatchEvent(ev: CustomEventMap[K] | UIEvent): void; +} + +interface Window { + addCleanup(fn: (...args: unknown[]) => void): void; + spaNavigate?(url: URL, isBack: boolean): Promise; +} + +declare const fetchData: Promise>;