diff --git a/.changeset/wicked-ravens-notice.md b/.changeset/wicked-ravens-notice.md new file mode 100644 index 0000000..2a17d5e --- /dev/null +++ b/.changeset/wicked-ravens-notice.md @@ -0,0 +1,5 @@ +--- +"rehype-pretty-code": patch +--- + +Support Shiki 4 diff --git a/examples/next/package.json b/examples/next/package.json index c19122d..74a11b8 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -22,7 +22,7 @@ "rehype-pretty-code": "workspace:*", "rehype-slug": "^6.0.0", "rehype-stringify": "^10.0.0", - "shiki": "^3.0.0", + "shiki": "^4.0.1", "tailwindcss": "^3.4.4" }, "devDependencies": { diff --git a/package.json b/package.json index 6d4138a..0b428ed 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "@types/node": "^20.14.9", "bun": "^1.1.17", "markdownlint-cli2": "^0.13.0", - "shiki": "^3.0.0", + "shiki": "^4.0.1", "turbo": "^2.0.5", "typescript": "^5.5.2" }, diff --git a/packages/core/package.json b/packages/core/package.json index da69bdd..28e4593 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -41,13 +41,13 @@ }, "devDependencies": { "@arethetypeswrong/cli": "^0.15.3", - "@shikijs/transformers": "^3.0.0", + "@shikijs/transformers": "^4.0.1", "@types/node": "^20.14.9", "hast-util-to-html": "^9.0.1", "mdast-util-to-hast": "^13.2.0", "prettier": "^3.3.2", "remark": "^15.0.1", - "shiki": "^3.0.0", + "shiki": "^4.0.1", "tsup": "^8.1.0", "tsx": "^4.15.7", "typescript": "^5.5.2", @@ -55,7 +55,7 @@ "vitest": "^1.6.0" }, "peerDependencies": { - "shiki": "^1.0.0 || ^2.0.0 || ^3.0.0" + "shiki": "^1.0.0 || ^2.0.0 || ^3.0.0 || ^4.0.0" }, "engines": { "node": ">=18" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ff1d23..154eca8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,8 +30,8 @@ importers: specifier: ^0.13.0 version: 0.13.0 shiki: - specifier: ^3.0.0 - version: 3.0.0 + specifier: ^4.0.1 + version: 4.0.1 turbo: specifier: ^2.0.5 version: 2.0.5 @@ -181,8 +181,8 @@ importers: specifier: ^10.0.0 version: 10.0.0 shiki: - specifier: ^3.0.0 - version: 3.0.0 + specifier: ^4.0.1 + version: 4.0.1 tailwindcss: specifier: ^3.4.4 version: 3.4.4 @@ -280,8 +280,8 @@ importers: specifier: ^0.15.3 version: 0.15.3 '@shikijs/transformers': - specifier: ^3.0.0 - version: 3.0.0 + specifier: ^4.0.1 + version: 4.0.1 '@types/node': specifier: ^20.14.9 version: 20.14.9 @@ -298,8 +298,8 @@ importers: specifier: ^15.0.1 version: 15.0.1 shiki: - specifier: ^3.0.0 - version: 3.0.0 + specifier: ^4.0.1 + version: 4.0.1 tsup: specifier: ^8.1.0 version: 8.1.0(postcss@8.4.38)(typescript@5.5.2) @@ -1225,32 +1225,42 @@ packages: '@shikijs/core@1.9.1': resolution: {integrity: sha512-EmUful2MQtY8KgCF1OkBtOuMcvaZEvmdubhW0UHCGXi21O9dRLeADVCj+k6ZS+de7Mz9d2qixOXJ+GLhcK3pXg==} - '@shikijs/core@3.0.0': - resolution: {integrity: sha512-gSm3JQf2J2psiUn5bWokmZwnu5N0jfBtRps4CQ1B+qrFvmZCRAkMVoaxgl9qZgAFK5KisLAS3//XaMFVytYHKw==} + '@shikijs/core@4.0.1': + resolution: {integrity: sha512-vWvqi9JNgz1dRL9Nvog5wtx7RuNkf7MEPl2mU/cyUUxJeH1CAr3t+81h8zO8zs7DK6cKLMoU9TvukWIDjP4Lzg==} + engines: {node: '>=20'} '@shikijs/engine-javascript@1.29.2': resolution: {integrity: sha512-iNEZv4IrLYPv64Q6k7EPpOCE/nuvGiKl7zxdq0WFuRPF5PAE9PRo2JGq/d8crLusM59BRemJ4eOqrFrC4wiQ+A==} - '@shikijs/engine-javascript@3.0.0': - resolution: {integrity: sha512-zoB10hTfvk1iZk1ldt6VaF+0iucQL+4TtSvTdTu5MhOeLPLEf5nZ8Wz6uxlp99y627OLalYa2z4W0iTTwb6oyA==} + '@shikijs/engine-javascript@4.0.1': + resolution: {integrity: sha512-DJK9NiwtGYqMuKCRO4Ip0FKNDQpmaiS+K5bFjJ7DWFn4zHueDWgaUG8kAofkrnXF6zPPYYQY7J5FYVW9MbZyBg==} + engines: {node: '>=20'} '@shikijs/engine-oniguruma@1.29.2': resolution: {integrity: sha512-7iiOx3SG8+g1MnlzZVDYiaeHe7Ez2Kf2HrJzdmGwkRisT7r4rak0e655AcM/tF9JG/kg5fMNYlLLKglbN7gBqA==} - '@shikijs/engine-oniguruma@3.0.0': - resolution: {integrity: sha512-uM9lqwMrlPHPVcdpAN/4pAzTJah1pY7mi9f1MxG887SDkjF/tdiQK+5200Y8N5Hg125sewdMQ1K2agoAo8hDiA==} + '@shikijs/engine-oniguruma@4.0.1': + resolution: {integrity: sha512-oCWdCTDch3J8Kc0OZJ98KuUPC02O1VqIE3W/e2uvrHqTxYRR21RGEJMtchrgrxhsoJJCzmIciKsqG+q/yD+Cxg==} + engines: {node: '>=20'} - '@shikijs/langs@3.0.0': - resolution: {integrity: sha512-HBsZAukiYz7k3hzttPWa0en3PABEwK3cpxcAcERRwvwuKc5pn0Y+yPxAIYZtN9cFdtNqrbFJNhfcEu/xbG1u/A==} + '@shikijs/langs@4.0.1': + resolution: {integrity: sha512-v/mluaybWdnGJR4GqAR6zh8qAZohW9k+cGYT28Y7M8+jLbC0l4yG085O1A+WkseHTn+awd+P3UBymb2+MXFc8w==} + engines: {node: '>=20'} - '@shikijs/themes@3.0.0': - resolution: {integrity: sha512-mz63nyVB5nXWsv5H2hifDFIThZEJ/cJhMq1/+0JjMdOuuBq2H2D1Fn8UM5yzUtEvap/ipRltv381+hsHZFs4ug==} + '@shikijs/primitive@4.0.1': + resolution: {integrity: sha512-ns0hHZc5eWZuvuIEJz2pTx3Qecz0aRVYumVQJ8JgWY2tq/dH8WxdcVM49Fc2NsHEILNIT6vfdW9MF26RANWiTA==} + engines: {node: '>=20'} + + '@shikijs/themes@4.0.1': + resolution: {integrity: sha512-FW41C/D6j/yKQkzVdjrRPiJCtgeDaYRJFEyCKFCINuRJRj9WcmubhP4KQHPZ4+9eT87jruSrYPyoblNRyDFzvA==} + engines: {node: '>=20'} '@shikijs/transformers@1.29.2': resolution: {integrity: sha512-NHQuA+gM7zGuxGWP9/Ub4vpbwrYCrho9nQCLcCPfOe3Yc7LOYwmSuhElI688oiqIXk9dlZwDiyAG9vPBTuPJMA==} - '@shikijs/transformers@3.0.0': - resolution: {integrity: sha512-N6iwlPt1IN4oQMdwSqWJhveBjfY2eLBjdmGglPngQ9ML1OPAgCPog0hI1lFPl52Rx7+s7GGuvWsSIu4zCUv2XA==} + '@shikijs/transformers@4.0.1': + resolution: {integrity: sha512-oE46W2eHpvD06+C0MBthd2YrDM6cktvJDFl764tOEXxfr3dAJhxMc0uNZ2tQXp+bkMgl4E7IL88Mj9RnSqiayw==} + engines: {node: '>=20'} '@shikijs/twoslash@1.29.2': resolution: {integrity: sha512-2S04ppAEa477tiaLfGEn1QJWbZUmbk8UoPbAEw4PifsrxkBXtAtOflIZJNtuCwz8ptc/TPxy7CO7gW4Uoi6o/g==} @@ -1258,8 +1268,9 @@ packages: '@shikijs/types@1.29.2': resolution: {integrity: sha512-VJjK0eIijTZf0QSTODEXCqinjBn0joAHQ+aPSBzrv4O2d/QSbsMw+ZeSRx03kV34Hy7NzUvV/7NqfYGRLrASmw==} - '@shikijs/types@3.0.0': - resolution: {integrity: sha512-kh/xgZHxI6m9trVvPw+C47jyVHx190r0F5gkF+VO5vYB54UtcoPJe66dzZmK7GbJbzmtGEGbOwct/jsoPjjUqg==} + '@shikijs/types@4.0.1': + resolution: {integrity: sha512-EaygPEn57+jJ76mw+nTLvIpJMAcMPokFbrF8lufsZP7Ukk+ToJYEcswN1G0e49nUZAq7aCQtoeW219A8HK1ZOw==} + engines: {node: '>=20'} '@shikijs/vscode-textmate@10.0.2': resolution: {integrity: sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==} @@ -2354,6 +2365,9 @@ packages: hast-util-to-html@9.0.4: resolution: {integrity: sha512-wxQzXtdbhiwGAUKrnQJXlOPmHnEehzphwkK7aluUPQ+lEc1xefC8pblMgpp2w5ldBTEfveRIrADcrhGIWrlTDA==} + hast-util-to-html@9.0.5: + resolution: {integrity: sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==} + hast-util-to-jsx-runtime@2.3.0: resolution: {integrity: sha512-H/y0+IWPdsLLS738P8tDnrQ8Z+dj12zQQ6WC11TIM21C8WFVoIxcqWXf2H3hiTVZjF1AWqoimGwrTWecWrnmRQ==} @@ -3083,11 +3097,14 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} + oniguruma-parser@0.12.1: + resolution: {integrity: sha512-8Unqkvk1RYc6yq2WBYRj4hdnsAxVze8i7iPfQr8e4uSP3tRv0rpZcbGUDvxfQQcdwHt/e9PrMvGCsa8OqG9X3w==} + oniguruma-to-es@2.3.0: resolution: {integrity: sha512-bwALDxriqfKGfUufKGGepCzu9x7nJQuoRoAFp4AnwehhC2crqrDIAP/uN2qdlsAvSMpeRC3+Yzhqc7hLmle5+g==} - oniguruma-to-es@3.1.0: - resolution: {integrity: sha512-BJ3Jy22YlgejHSO7Fvmz1kKazlaPmRSUH+4adTDUS/dKQ4wLxI+gALZ8updbaux7/m7fIlpgOZ5fp/Inq5jUAw==} + oniguruma-to-es@4.3.4: + resolution: {integrity: sha512-3VhUGN3w2eYxnTzHn+ikMI+fp/96KoRSVK9/kMTcFqj1NRDh2IhQCKvYxDnWePKRXY/AqH+Fuiyb7VHSzBjHfA==} ora@8.0.1: resolution: {integrity: sha512-ANIvzobt1rls2BDny5fWZ3ZVKyD6nscLvfFRpQgfWsythlcsVUC9kL0zq6j2Z5z9wwp1kd7wpsD/T9qNPVLCaQ==} @@ -3309,6 +3326,9 @@ packages: property-information@6.5.0: resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + property-information@7.1.0: + resolution: {integrity: sha512-TwEZ+X+yCJmYfL7TPUOcvBZ4QfoT5YenQiJuX//0th53DE6w0xxLEtfK3iyryQFddXuvkIk51EEgrJQ0WJkOmQ==} + pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} @@ -3541,8 +3561,9 @@ packages: shiki@1.9.1: resolution: {integrity: sha512-8PDkgb5ja3nfujTjvC4VytL6wGOGCtFAClUb2r3QROevYXxcq+/shVJK5s6gy0HZnjaJgFxd6BpPqpRfqne5rA==} - shiki@3.0.0: - resolution: {integrity: sha512-x6MMdYN9auPGx7kMFtyKbaj65eCdetfrfkvQZwqisZLnGMnAZsZxOpcWD0ElvLPFWHOSMukVyN9Opm7TxQjnZA==} + shiki@4.0.1: + resolution: {integrity: sha512-EkAEhDTN5WhpoQFXFw79OHIrSAfHhlImeCdSyg4u4XvrpxKEmdo/9x/HWSowujAnUrFsGOwWiE58a6GVentMnQ==} + engines: {node: '>=20'} siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -5292,12 +5313,13 @@ snapshots: '@shikijs/core@1.9.1': {} - '@shikijs/core@3.0.0': + '@shikijs/core@4.0.1': dependencies: - '@shikijs/types': 3.0.0 + '@shikijs/primitive': 4.0.1 + '@shikijs/types': 4.0.1 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 - hast-util-to-html: 9.0.4 + hast-util-to-html: 9.0.5 '@shikijs/engine-javascript@1.29.2': dependencies: @@ -5305,39 +5327,45 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 oniguruma-to-es: 2.3.0 - '@shikijs/engine-javascript@3.0.0': + '@shikijs/engine-javascript@4.0.1': dependencies: - '@shikijs/types': 3.0.0 + '@shikijs/types': 4.0.1 '@shikijs/vscode-textmate': 10.0.2 - oniguruma-to-es: 3.1.0 + oniguruma-to-es: 4.3.4 '@shikijs/engine-oniguruma@1.29.2': dependencies: '@shikijs/types': 1.29.2 '@shikijs/vscode-textmate': 10.0.2 - '@shikijs/engine-oniguruma@3.0.0': + '@shikijs/engine-oniguruma@4.0.1': dependencies: - '@shikijs/types': 3.0.0 + '@shikijs/types': 4.0.1 '@shikijs/vscode-textmate': 10.0.2 - '@shikijs/langs@3.0.0': + '@shikijs/langs@4.0.1': + dependencies: + '@shikijs/types': 4.0.1 + + '@shikijs/primitive@4.0.1': dependencies: - '@shikijs/types': 3.0.0 + '@shikijs/types': 4.0.1 + '@shikijs/vscode-textmate': 10.0.2 + '@types/hast': 3.0.4 - '@shikijs/themes@3.0.0': + '@shikijs/themes@4.0.1': dependencies: - '@shikijs/types': 3.0.0 + '@shikijs/types': 4.0.1 '@shikijs/transformers@1.29.2': dependencies: '@shikijs/core': 1.29.2 '@shikijs/types': 1.29.2 - '@shikijs/transformers@3.0.0': + '@shikijs/transformers@4.0.1': dependencies: - '@shikijs/core': 3.0.0 - '@shikijs/types': 3.0.0 + '@shikijs/core': 4.0.1 + '@shikijs/types': 4.0.1 '@shikijs/twoslash@1.29.2(typescript@5.5.2)': dependencies: @@ -5353,7 +5381,7 @@ snapshots: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 - '@shikijs/types@3.0.0': + '@shikijs/types@4.0.1': dependencies: '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4 @@ -6687,6 +6715,20 @@ snapshots: stringify-entities: 4.0.4 zwitch: 2.0.4 + hast-util-to-html@9.0.5: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.2 + ccount: 2.0.1 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 3.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.0 + property-information: 7.1.0 + space-separated-tokens: 2.0.2 + stringify-entities: 4.0.4 + zwitch: 2.0.4 + hast-util-to-jsx-runtime@2.3.0: dependencies: '@types/estree': 1.0.5 @@ -7668,15 +7710,17 @@ snapshots: dependencies: mimic-fn: 4.0.0 + oniguruma-parser@0.12.1: {} + oniguruma-to-es@2.3.0: dependencies: emoji-regex-xs: 1.0.0 regex: 5.1.1 regex-recursion: 5.1.1 - oniguruma-to-es@3.1.0: + oniguruma-to-es@4.3.4: dependencies: - emoji-regex-xs: 1.0.0 + oniguruma-parser: 0.12.1 regex: 6.0.1 regex-recursion: 6.0.2 @@ -7894,6 +7938,8 @@ snapshots: property-information@6.5.0: {} + property-information@7.1.0: {} + pseudomap@1.0.2: {} punycode.js@2.3.1: {} @@ -8254,14 +8300,14 @@ snapshots: dependencies: '@shikijs/core': 1.9.1 - shiki@3.0.0: + shiki@4.0.1: dependencies: - '@shikijs/core': 3.0.0 - '@shikijs/engine-javascript': 3.0.0 - '@shikijs/engine-oniguruma': 3.0.0 - '@shikijs/langs': 3.0.0 - '@shikijs/themes': 3.0.0 - '@shikijs/types': 3.0.0 + '@shikijs/core': 4.0.1 + '@shikijs/engine-javascript': 4.0.1 + '@shikijs/engine-oniguruma': 4.0.1 + '@shikijs/langs': 4.0.1 + '@shikijs/themes': 4.0.1 + '@shikijs/types': 4.0.1 '@shikijs/vscode-textmate': 10.0.2 '@types/hast': 3.0.4