diff --git a/.yarn/install-state.gz b/.yarn/install-state.gz
index c99c60a..2624b15 100644
Binary files a/.yarn/install-state.gz and b/.yarn/install-state.gz differ
diff --git a/examples/app-router/app/globals.css b/examples/app-router/app/globals.css
index 66b454e..5703ff0 100644
--- a/examples/app-router/app/globals.css
+++ b/examples/app-router/app/globals.css
@@ -7,3 +7,292 @@
--primary-light: 85 215 153;
}
}
+
+/* ===== Basic ===== */
+:root {
+ --twoslash-border-color: #8888;
+ --twoslash-underline-color: currentColor;
+ --twoslash-highlighted-border: #c37d0d50;
+ --twoslash-highlighted-bg: #c37d0d20;
+ --twoslash-popup-bg: #f8f8f8;
+ --twoslash-popup-color: inherit;
+ --twoslash-popup-shadow: rgba(0, 0, 0, 0.08) 0px 1px 4px;
+ --twoslash-docs-color: #888;
+ --twoslash-docs-font: sans-serif;
+ --twoslash-code-font: inherit;
+ --twoslash-code-font-size: 1em;
+ --twoslash-matched-color: inherit;
+ --twoslash-unmatched-color: #888;
+ --twoslash-cursor-color: #8888;
+ --twoslash-error-color: #d45656;
+ --twoslash-error-bg: #d4565620;
+ --twoslash-warn-color: #c37d0d;
+ --twoslash-warn-bg: #c37d0d20;
+ --twoslash-tag-color: #3772cf;
+ --twoslash-tag-bg: #3772cf20;
+ --twoslash-tag-warn-color: var(--twoslash-warn-color);
+ --twoslash-tag-warn-bg: var(--twoslash-warn-bg);
+ --twoslash-tag-annotate-color: #1ba673;
+ --twoslash-tag-annotate-bg: #1ba67320;
+}
+
+/* Respect people's wishes to not have animations */
+@media (prefers-reduced-motion: reduce) {
+ .twoslash * {
+ transition: none !important;
+ }
+}
+
+/* ===== Hover Info ===== */
+.twoslash:hover .twoslash-hover {
+ border-color: var(--twoslash-underline-color);
+}
+
+.twoslash .twoslash-hover {
+ border-bottom: 1px dotted transparent;
+ transition-timing-function: ease;
+ transition: border-color 0.3s;
+ position: relative;
+}
+
+.twoslash .twoslash-popup-container {
+ position: absolute;
+ opacity: 0;
+ display: inline-flex;
+ flex-direction: column;
+ transform: translateY(1.1em);
+ background: var(--twoslash-popup-bg);
+ color: var(--twoslash-popup-color);
+ border: 1px solid var(--twoslash-border-color);
+ transition: opacity 0.3s;
+ border-radius: 4px;
+ pointer-events: none;
+ z-index: 10;
+ user-select: none;
+ text-align: left;
+ box-shadow: var(--twoslash-popup-shadow);
+}
+
+/* .twoslash .twoslash-query-presisted .twoslash-popup-container { */
+/* z-index: 9; */
+/* transform: translateY(1.5em); */
+/* } */
+
+.twoslash .twoslash-hover:hover .twoslash-popup-container,
+.twoslash .twoslash-error-hover:hover .twoslash-popup-container,
+/* .twoslash .twoslash-query-presisted .twoslash-popup-container, */
+.twoslash .twoslash-query-line .twoslash-popup-container {
+ opacity: 1;
+ pointer-events: auto;
+}
+
+.twoslash .twoslash-popup-container:hover {
+ user-select: auto;
+}
+
+.twoslash .twoslash-popup-arrow {
+ position: absolute;
+ top: -4px;
+ left: 1em;
+ border-top: 1px solid var(--twoslash-border-color);
+ border-right: 1px solid var(--twoslash-border-color);
+ background: var(--twoslash-popup-bg);
+ transform: rotate(-45deg);
+ width: 6px;
+ height: 6px;
+ pointer-events: none;
+}
+
+.twoslash .twoslash-popup-code,
+.twoslash .twoslash-popup-error,
+.twoslash .twoslash-popup-docs {
+ padding: 6px 8px !important;
+}
+
+.twoslash .twoslash-popup-code {
+ font-family: var(--twoslash-code-font);
+ font-size: var(--twoslash-code-font-size);
+}
+
+.twoslash .twoslash-popup-docs {
+ color: var(--twoslash-docs-color);
+ font-family: var(--twoslash-docs-font);
+ font-size: 0.8em;
+ border-top: 1px solid var(--twoslash-border-color);
+}
+
+.twoslash .twoslash-popup-error {
+ color: var(--twoslash-error-color);
+ background-color: var(--twoslash-error-bg);
+ font-family: var(--twoslash-docs-font);
+ font-size: 0.8em;
+}
+
+.twoslash .twoslash-popup-docs-tags {
+ display: flex;
+ flex-direction: column;
+ font-family: var(--twoslash-docs-font);
+}
+
+.twoslash .twoslash-popup-docs-tags,
+.twoslash .twoslash-popup-docs-tag-name {
+ margin-right: 0.5em;
+}
+
+.twoslash .twoslash-popup-docs-tag-name {
+ font-family: var(--twoslash-code-font);
+}
+
+/* ===== Query Line ===== */
+.twoslash .twoslash-query-line .twoslash-popup-container {
+ position: relative;
+ margin-bottom: 1.4em;
+ transform: translateY(0.6em);
+}
+
+/* ===== Error Line ===== */
+.twoslash .twoslash-error-line {
+ position: relative;
+ background-color: var(--twoslash-error-bg);
+ border-left: 3px solid var(--twoslash-error-color);
+ color: var(--twoslash-error-color);
+ padding: 6px 12px;
+ margin: 0.2em 0;
+ min-width: 100%;
+ width: max-content;
+}
+
+.twoslash .twoslash-error-line.twoslash-error-level-warning {
+ background-color: var(--twoslash-warn-bg);
+ border-left: 3px solid var(--twoslash-warn-color);
+ color: var(--twoslash-warn-color);
+}
+
+.twoslash .twoslash-error {
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
+ repeat-x bottom left;
+ padding-bottom: 2px;
+}
+
+.twoslash .twoslash-error.twoslash-error-level-warning {
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c37d0d'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
+ repeat-x bottom left;
+ padding-bottom: 2px;
+}
+
+/* ===== Completeions ===== */
+.twoslash .twoslash-completion-cursor {
+ position: relative;
+}
+
+.twoslash .twoslash-completion-cursor .twoslash-completion-list {
+ user-select: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ transform: translate(0, 1.2em);
+ margin: 3px 0 0 -1px;
+ display: inline-block;
+ z-index: 8;
+ box-shadow: var(--twoslash-popup-shadow);
+ background: var(--twoslash-popup-bg);
+ border: 1px solid var(--twoslash-border-color);
+}
+
+.twoslash-completion-list {
+ width: 240px;
+ font-size: 0.8rem;
+ padding: 4px;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+
+.twoslash-completion-list:hover {
+ user-select: auto;
+}
+
+.twoslash-completion-list::before {
+ background-color: var(--twoslash-cursor-color);
+ width: 2px;
+ position: absolute;
+ top: -1.6em;
+ height: 1.4em;
+ left: -1px;
+ content: ' ';
+}
+
+.twoslash-completion-list li {
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ gap: 0.25em;
+ line-height: 1em;
+}
+
+.twoslash-completion-list li span.twoslash-completions-unmatched {
+ color: var(--twoslash-unmatched-color);
+}
+
+.twoslash-completion-list .deprecated {
+ text-decoration: line-through;
+ opacity: 0.5;
+}
+
+.twoslash-completion-list li span.twoslash-completions-matched {
+ color: var(--twoslash-matched-color);
+}
+
+/* Highlights */
+.twoslash-highlighted {
+ background-color: var(--twoslash-highlighted-bg);
+ border: 1px solid var(--twoslash-highlighted-border);
+ padding: 1px 2px;
+ margin: -1px -3px;
+ border-radius: 4px;
+}
+
+/* Icons */
+.twoslash-completion-list .twoslash-completions-icon {
+ color: var(--twoslash-unmatched-color);
+ width: 1em;
+ flex: none;
+}
+
+/* Custom Tags */
+.twoslash .twoslash-tag-line {
+ position: relative;
+ background-color: var(--twoslash-tag-bg);
+ border-left: 3px solid var(--twoslash-tag-color);
+ color: var(--twoslash-tag-color);
+ padding: 6px 10px;
+ margin: 0.2em 0;
+ display: flex;
+ align-items: center;
+ gap: 0.3em;
+ min-width: 100%;
+ width: max-content;
+}
+
+.twoslash .twoslash-tag-line .twoslash-tag-icon {
+ width: 1.1em;
+ color: inherit;
+}
+
+.twoslash .twoslash-tag-line.twoslash-tag-error-line {
+ background-color: var(--twoslash-error-bg);
+ border-left: 3px solid var(--twoslash-error-color);
+ color: var(--twoslash-error-color);
+}
+
+.twoslash .twoslash-tag-line.twoslash-tag-warn-line {
+ background-color: var(--twoslash-tag-warn-bg);
+ border-left: 3px solid var(--twoslash-tag-warn-color);
+ color: var(--twoslash-tag-warn-color);
+}
+
+.twoslash .twoslash-tag-line.twoslash-tag-annotate-line {
+ background-color: var(--twoslash-tag-annotate-bg);
+ border-left: 3px solid var(--twoslash-tag-annotate-color);
+ color: var(--twoslash-tag-annotate-color);
+}
diff --git a/examples/app-router/examples/highlight-example.mdx b/examples/app-router/examples/highlight-example.mdx
index c4d8463..64bd2dc 100644
--- a/examples/app-router/examples/highlight-example.mdx
+++ b/examples/app-router/examples/highlight-example.mdx
@@ -49,3 +49,95 @@ public class Program
}
}
```
+
+## Testing Twoslash
+
+### Twoslash disabled without any additional configs or filenames
+
+```ts
+// This is a tooltip that will appear on the next line
+const myVariable = 'hello world';
+// ^?
+
+// This is the second line
+// You can include [links](#anchor) in your hover content
+function myFunction() {
+ // ^?
+ return myVariable;
+}
+```
+
+### Twoslash enabled without any additional configs or filenames
+
+```ts mint-twoslash
+// This is a tooltip that will appear on the next line
+const myVariable = 'hello world';
+// ^?
+
+// This is the second line
+// You can include [links](#anchor) in your hover content
+function myFunction() {
+ // ^?
+ return myVariable;
+}
+```
+
+### Twoslash disabled with additional configs and filename
+
+```js something_with_external_packages.tsx icon="js" lines
+import { useEffect, useState } from 'react';
+
+export function Component() {
+ // ^?
+ const [count, setCount] = useState(0);
+ // ^? ^?
+
+ useEffect(() => {
+ setTimeout(() => setCount(count + 1), 1000);
+ // ^?
+ }, [count]);
+
+ return
{count}
;
+}
+```
+
+### Twoslash enabled with additional configs
+
+```js something_with_external_packages.tsx icon="js" lines mint-twoslash
+import { useEffect, useState } from 'react';
+
+export function Component() {
+ // ^?
+ const [count, setCount] = useState(0);
+ // ^? ^?
+
+ useEffect(() => {
+ setTimeout(() => setCount(count + 1), 1000);
+ // ^?
+ }, [count]);
+
+ return {count}
;
+}
+```
+
+### Twoslash disabled with just filename
+
+```ts Vue Sample
+import { ref } from 'vue';
+
+console.log('Hi! Shiki + Twoslash on CDN :)');
+
+const count = ref(0);
+// ^?
+```
+
+### Twoslash enabled with just filename
+
+```ts mint-twoslash Vue Sample
+import { ref } from 'vue';
+
+console.log('Hi! Shiki + Twoslash on CDN :)');
+
+const count = ref(0);
+// ^?
+```
diff --git a/examples/app-router/next.config.js b/examples/app-router/next.config.js
index 658404a..bec2b4c 100644
--- a/examples/app-router/next.config.js
+++ b/examples/app-router/next.config.js
@@ -1,4 +1,6 @@
/** @type {import('next').NextConfig} */
-const nextConfig = {};
+const nextConfig = {
+ serverExternalPackages: ['@shikijs/twoslash'],
+};
module.exports = nextConfig;
diff --git a/examples/app-router/package.json b/examples/app-router/package.json
index 1fcc137..745682a 100644
--- a/examples/app-router/package.json
+++ b/examples/app-router/package.json
@@ -10,9 +10,9 @@
},
"dependencies": {
"@mintlify/mdx": "workspace:^",
- "next": "14.0.4",
- "react": "^18",
- "react-dom": "^18"
+ "next": "15.4.2",
+ "react": "18.3.1",
+ "react-dom": "18.3.1"
},
"devDependencies": {
"@tailwindcss/typography": "^0.5.10",
diff --git a/examples/pages-router/examples/highlight-example.mdx b/examples/pages-router/examples/highlight-example.mdx
index c4d8463..64bd2dc 100644
--- a/examples/pages-router/examples/highlight-example.mdx
+++ b/examples/pages-router/examples/highlight-example.mdx
@@ -49,3 +49,95 @@ public class Program
}
}
```
+
+## Testing Twoslash
+
+### Twoslash disabled without any additional configs or filenames
+
+```ts
+// This is a tooltip that will appear on the next line
+const myVariable = 'hello world';
+// ^?
+
+// This is the second line
+// You can include [links](#anchor) in your hover content
+function myFunction() {
+ // ^?
+ return myVariable;
+}
+```
+
+### Twoslash enabled without any additional configs or filenames
+
+```ts mint-twoslash
+// This is a tooltip that will appear on the next line
+const myVariable = 'hello world';
+// ^?
+
+// This is the second line
+// You can include [links](#anchor) in your hover content
+function myFunction() {
+ // ^?
+ return myVariable;
+}
+```
+
+### Twoslash disabled with additional configs and filename
+
+```js something_with_external_packages.tsx icon="js" lines
+import { useEffect, useState } from 'react';
+
+export function Component() {
+ // ^?
+ const [count, setCount] = useState(0);
+ // ^? ^?
+
+ useEffect(() => {
+ setTimeout(() => setCount(count + 1), 1000);
+ // ^?
+ }, [count]);
+
+ return {count}
;
+}
+```
+
+### Twoslash enabled with additional configs
+
+```js something_with_external_packages.tsx icon="js" lines mint-twoslash
+import { useEffect, useState } from 'react';
+
+export function Component() {
+ // ^?
+ const [count, setCount] = useState(0);
+ // ^? ^?
+
+ useEffect(() => {
+ setTimeout(() => setCount(count + 1), 1000);
+ // ^?
+ }, [count]);
+
+ return {count}
;
+}
+```
+
+### Twoslash disabled with just filename
+
+```ts Vue Sample
+import { ref } from 'vue';
+
+console.log('Hi! Shiki + Twoslash on CDN :)');
+
+const count = ref(0);
+// ^?
+```
+
+### Twoslash enabled with just filename
+
+```ts mint-twoslash Vue Sample
+import { ref } from 'vue';
+
+console.log('Hi! Shiki + Twoslash on CDN :)');
+
+const count = ref(0);
+// ^?
+```
diff --git a/examples/pages-router/styles/globals.css b/examples/pages-router/styles/globals.css
index 66b454e..5703ff0 100644
--- a/examples/pages-router/styles/globals.css
+++ b/examples/pages-router/styles/globals.css
@@ -7,3 +7,292 @@
--primary-light: 85 215 153;
}
}
+
+/* ===== Basic ===== */
+:root {
+ --twoslash-border-color: #8888;
+ --twoslash-underline-color: currentColor;
+ --twoslash-highlighted-border: #c37d0d50;
+ --twoslash-highlighted-bg: #c37d0d20;
+ --twoslash-popup-bg: #f8f8f8;
+ --twoslash-popup-color: inherit;
+ --twoslash-popup-shadow: rgba(0, 0, 0, 0.08) 0px 1px 4px;
+ --twoslash-docs-color: #888;
+ --twoslash-docs-font: sans-serif;
+ --twoslash-code-font: inherit;
+ --twoslash-code-font-size: 1em;
+ --twoslash-matched-color: inherit;
+ --twoslash-unmatched-color: #888;
+ --twoslash-cursor-color: #8888;
+ --twoslash-error-color: #d45656;
+ --twoslash-error-bg: #d4565620;
+ --twoslash-warn-color: #c37d0d;
+ --twoslash-warn-bg: #c37d0d20;
+ --twoslash-tag-color: #3772cf;
+ --twoslash-tag-bg: #3772cf20;
+ --twoslash-tag-warn-color: var(--twoslash-warn-color);
+ --twoslash-tag-warn-bg: var(--twoslash-warn-bg);
+ --twoslash-tag-annotate-color: #1ba673;
+ --twoslash-tag-annotate-bg: #1ba67320;
+}
+
+/* Respect people's wishes to not have animations */
+@media (prefers-reduced-motion: reduce) {
+ .twoslash * {
+ transition: none !important;
+ }
+}
+
+/* ===== Hover Info ===== */
+.twoslash:hover .twoslash-hover {
+ border-color: var(--twoslash-underline-color);
+}
+
+.twoslash .twoslash-hover {
+ border-bottom: 1px dotted transparent;
+ transition-timing-function: ease;
+ transition: border-color 0.3s;
+ position: relative;
+}
+
+.twoslash .twoslash-popup-container {
+ position: absolute;
+ opacity: 0;
+ display: inline-flex;
+ flex-direction: column;
+ transform: translateY(1.1em);
+ background: var(--twoslash-popup-bg);
+ color: var(--twoslash-popup-color);
+ border: 1px solid var(--twoslash-border-color);
+ transition: opacity 0.3s;
+ border-radius: 4px;
+ pointer-events: none;
+ z-index: 10;
+ user-select: none;
+ text-align: left;
+ box-shadow: var(--twoslash-popup-shadow);
+}
+
+/* .twoslash .twoslash-query-presisted .twoslash-popup-container { */
+/* z-index: 9; */
+/* transform: translateY(1.5em); */
+/* } */
+
+.twoslash .twoslash-hover:hover .twoslash-popup-container,
+.twoslash .twoslash-error-hover:hover .twoslash-popup-container,
+/* .twoslash .twoslash-query-presisted .twoslash-popup-container, */
+.twoslash .twoslash-query-line .twoslash-popup-container {
+ opacity: 1;
+ pointer-events: auto;
+}
+
+.twoslash .twoslash-popup-container:hover {
+ user-select: auto;
+}
+
+.twoslash .twoslash-popup-arrow {
+ position: absolute;
+ top: -4px;
+ left: 1em;
+ border-top: 1px solid var(--twoslash-border-color);
+ border-right: 1px solid var(--twoslash-border-color);
+ background: var(--twoslash-popup-bg);
+ transform: rotate(-45deg);
+ width: 6px;
+ height: 6px;
+ pointer-events: none;
+}
+
+.twoslash .twoslash-popup-code,
+.twoslash .twoslash-popup-error,
+.twoslash .twoslash-popup-docs {
+ padding: 6px 8px !important;
+}
+
+.twoslash .twoslash-popup-code {
+ font-family: var(--twoslash-code-font);
+ font-size: var(--twoslash-code-font-size);
+}
+
+.twoslash .twoslash-popup-docs {
+ color: var(--twoslash-docs-color);
+ font-family: var(--twoslash-docs-font);
+ font-size: 0.8em;
+ border-top: 1px solid var(--twoslash-border-color);
+}
+
+.twoslash .twoslash-popup-error {
+ color: var(--twoslash-error-color);
+ background-color: var(--twoslash-error-bg);
+ font-family: var(--twoslash-docs-font);
+ font-size: 0.8em;
+}
+
+.twoslash .twoslash-popup-docs-tags {
+ display: flex;
+ flex-direction: column;
+ font-family: var(--twoslash-docs-font);
+}
+
+.twoslash .twoslash-popup-docs-tags,
+.twoslash .twoslash-popup-docs-tag-name {
+ margin-right: 0.5em;
+}
+
+.twoslash .twoslash-popup-docs-tag-name {
+ font-family: var(--twoslash-code-font);
+}
+
+/* ===== Query Line ===== */
+.twoslash .twoslash-query-line .twoslash-popup-container {
+ position: relative;
+ margin-bottom: 1.4em;
+ transform: translateY(0.6em);
+}
+
+/* ===== Error Line ===== */
+.twoslash .twoslash-error-line {
+ position: relative;
+ background-color: var(--twoslash-error-bg);
+ border-left: 3px solid var(--twoslash-error-color);
+ color: var(--twoslash-error-color);
+ padding: 6px 12px;
+ margin: 0.2em 0;
+ min-width: 100%;
+ width: max-content;
+}
+
+.twoslash .twoslash-error-line.twoslash-error-level-warning {
+ background-color: var(--twoslash-warn-bg);
+ border-left: 3px solid var(--twoslash-warn-color);
+ color: var(--twoslash-warn-color);
+}
+
+.twoslash .twoslash-error {
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c94824'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
+ repeat-x bottom left;
+ padding-bottom: 2px;
+}
+
+.twoslash .twoslash-error.twoslash-error-level-warning {
+ background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%206%203'%20enable-background%3D'new%200%200%206%203'%20height%3D'3'%20width%3D'6'%3E%3Cg%20fill%3D'%23c37d0d'%3E%3Cpolygon%20points%3D'5.5%2C0%202.5%2C3%201.1%2C3%204.1%2C0'%2F%3E%3Cpolygon%20points%3D'4%2C0%206%2C2%206%2C0.6%205.4%2C0'%2F%3E%3Cpolygon%20points%3D'0%2C2%201%2C3%202.4%2C3%200%2C0.6'%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")
+ repeat-x bottom left;
+ padding-bottom: 2px;
+}
+
+/* ===== Completeions ===== */
+.twoslash .twoslash-completion-cursor {
+ position: relative;
+}
+
+.twoslash .twoslash-completion-cursor .twoslash-completion-list {
+ user-select: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ transform: translate(0, 1.2em);
+ margin: 3px 0 0 -1px;
+ display: inline-block;
+ z-index: 8;
+ box-shadow: var(--twoslash-popup-shadow);
+ background: var(--twoslash-popup-bg);
+ border: 1px solid var(--twoslash-border-color);
+}
+
+.twoslash-completion-list {
+ width: 240px;
+ font-size: 0.8rem;
+ padding: 4px;
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+
+.twoslash-completion-list:hover {
+ user-select: auto;
+}
+
+.twoslash-completion-list::before {
+ background-color: var(--twoslash-cursor-color);
+ width: 2px;
+ position: absolute;
+ top: -1.6em;
+ height: 1.4em;
+ left: -1px;
+ content: ' ';
+}
+
+.twoslash-completion-list li {
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ gap: 0.25em;
+ line-height: 1em;
+}
+
+.twoslash-completion-list li span.twoslash-completions-unmatched {
+ color: var(--twoslash-unmatched-color);
+}
+
+.twoslash-completion-list .deprecated {
+ text-decoration: line-through;
+ opacity: 0.5;
+}
+
+.twoslash-completion-list li span.twoslash-completions-matched {
+ color: var(--twoslash-matched-color);
+}
+
+/* Highlights */
+.twoslash-highlighted {
+ background-color: var(--twoslash-highlighted-bg);
+ border: 1px solid var(--twoslash-highlighted-border);
+ padding: 1px 2px;
+ margin: -1px -3px;
+ border-radius: 4px;
+}
+
+/* Icons */
+.twoslash-completion-list .twoslash-completions-icon {
+ color: var(--twoslash-unmatched-color);
+ width: 1em;
+ flex: none;
+}
+
+/* Custom Tags */
+.twoslash .twoslash-tag-line {
+ position: relative;
+ background-color: var(--twoslash-tag-bg);
+ border-left: 3px solid var(--twoslash-tag-color);
+ color: var(--twoslash-tag-color);
+ padding: 6px 10px;
+ margin: 0.2em 0;
+ display: flex;
+ align-items: center;
+ gap: 0.3em;
+ min-width: 100%;
+ width: max-content;
+}
+
+.twoslash .twoslash-tag-line .twoslash-tag-icon {
+ width: 1.1em;
+ color: inherit;
+}
+
+.twoslash .twoslash-tag-line.twoslash-tag-error-line {
+ background-color: var(--twoslash-error-bg);
+ border-left: 3px solid var(--twoslash-error-color);
+ color: var(--twoslash-error-color);
+}
+
+.twoslash .twoslash-tag-line.twoslash-tag-warn-line {
+ background-color: var(--twoslash-tag-warn-bg);
+ border-left: 3px solid var(--twoslash-tag-warn-color);
+ color: var(--twoslash-tag-warn-color);
+}
+
+.twoslash .twoslash-tag-line.twoslash-tag-annotate-line {
+ background-color: var(--twoslash-tag-annotate-bg);
+ border-left: 3px solid var(--twoslash-tag-annotate-color);
+ color: var(--twoslash-tag-annotate-color);
+}
diff --git a/packages/mdx/package.json b/packages/mdx/package.json
index c779f1b..e3e1ae7 100644
--- a/packages/mdx/package.json
+++ b/packages/mdx/package.json
@@ -1,6 +1,6 @@
{
"name": "@mintlify/mdx",
- "version": "2.0.5",
+ "version": "2.0.6",
"description": "Markdown parser from Mintlify",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -69,6 +69,7 @@
},
"dependencies": {
"@shikijs/transformers": "^3.11.0",
+ "@shikijs/twoslash": "^3.12.2",
"hast-util-to-string": "^3.0.1",
"mdast-util-mdx-jsx": "^3.2.0",
"next-mdx-remote-client": "^1.0.3",
@@ -77,6 +78,7 @@
"remark-math": "^6.0.0",
"remark-smartypants": "^3.0.2",
"shiki": "^3.11.0",
+ "twoslash-cdn": "^0.3.4",
"unified": "^11.0.0",
"unist-util-visit": "^5.0.0"
}
diff --git a/packages/mdx/src/plugins/rehype/rehypeSyntaxHighlighting.ts b/packages/mdx/src/plugins/rehype/rehypeSyntaxHighlighting.ts
index b253bfd..226c127 100644
--- a/packages/mdx/src/plugins/rehype/rehypeSyntaxHighlighting.ts
+++ b/packages/mdx/src/plugins/rehype/rehypeSyntaxHighlighting.ts
@@ -1,7 +1,15 @@
+import {
+ createTransformerFactory,
+ rendererRich,
+ transformerTwoslash,
+ type TransformerTwoslashOptions,
+} from '@shikijs/twoslash';
import type { Element, Root } from 'hast';
import { toString } from 'hast-util-to-string';
import type { MdxJsxFlowElementHast, MdxJsxTextElementHast } from 'mdast-util-mdx-jsx';
import { createHighlighter, type Highlighter } from 'shiki';
+import { createTwoslashFromCDN } from 'twoslash-cdn';
+import ts from 'typescript';
import type { Plugin } from 'unified';
import { visit } from 'unist-util-visit';
@@ -21,6 +29,28 @@ import {
} from './shiki-constants.js';
import { getLanguage } from './utils.js';
+const twoslashCompilerOptions = {
+ target: ts.ScriptTarget.ESNext,
+ lib: ['ESNext', 'DOM', 'esnext', 'dom', 'es2020'],
+};
+
+const twoslashOptions: TransformerTwoslashOptions = {
+ onTwoslashError(err, code, lang) {
+ console.error(JSON.stringify({ err, code, lang }));
+ },
+ onShikiError(err, code, lang) {
+ console.error(JSON.stringify({ err, code, lang }));
+ },
+ renderer: rendererRich(),
+ langs: ['ts', 'typescript', 'js', 'javascript', 'tsx', 'jsx'],
+ explicitTrigger: /mint-twoslash/,
+ twoslashOptions: { compilerOptions: twoslashCompilerOptions },
+};
+
+const cdnTwoslash = createTwoslashFromCDN({ compilerOptions: twoslashCompilerOptions });
+
+const cdnTransformerTwoslash = createTransformerFactory(cdnTwoslash.runSync);
+
export type RehypeSyntaxHighlightingOptions = {
theme?: ShikiTheme;
themes?: Record<'light' | 'dark', ShikiTheme>;
@@ -90,15 +120,17 @@ export const rehypeSyntaxHighlighting: Plugin<[RehypeSyntaxHighlightingOptions?]
getLanguage(child, DEFAULT_LANG_ALIASES) ??
DEFAULT_LANG;
- if (!DEFAULT_LANGS.includes(lang)) {
- asyncNodesToProcess.push(
- highlighter.loadLanguage(lang).then(() => {
+ asyncNodesToProcess.push(
+ (async () => {
+ await cdnTwoslash.prepareTypes(toString(node));
+ if (!DEFAULT_LANGS.includes(lang)) {
+ await highlighter.loadLanguage(lang);
traverseNode(node, index, parent, highlighter, lang, options);
- })
- );
- } else {
- traverseNode(node, index, parent, highlighter, lang, options);
- }
+ } else {
+ traverseNode(node, index, parent, highlighter, lang, options);
+ }
+ })()
+ );
});
await Promise.all(asyncNodesToProcess);
};
@@ -115,8 +147,18 @@ const traverseNode = (
try {
const code = toString(node);
+ const meta = node.data?.meta?.split(' ') ?? [];
+ const twoslashIndex = meta.findIndex((str) => str.toLowerCase() === 'mint-twoslash');
+ const shouldUseTwoslash = twoslashIndex > -1;
+
+ if (node.data && node.data.meta && shouldUseTwoslash) {
+ meta.splice(twoslashIndex, 1);
+ node.data.meta = meta.join(' ').trim() || undefined;
+ }
+
const hast = highlighter.codeToHast(code, {
lang: lang ?? DEFAULT_LANG,
+ meta: shouldUseTwoslash ? { __raw: 'mint-twoslash' } : undefined,
themes: {
light:
options.themes?.light ??
@@ -127,7 +169,11 @@ const traverseNode = (
colorReplacements: shikiColorReplacements,
tabindex: false,
tokenizeMaxLineLength: 1000,
- transformers: SHIKI_TRANSFORMERS,
+ transformers: [
+ ...SHIKI_TRANSFORMERS,
+ transformerTwoslash(twoslashOptions),
+ cdnTransformerTwoslash(twoslashOptions),
+ ],
});
const codeElement = hast.children[0] as Element;
diff --git a/yarn.lock b/yarn.lock
index 6b5d9e8..18354ac 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -186,6 +186,15 @@ __metadata:
languageName: node
linkType: hard
+"@emnapi/runtime@npm:^1.5.0":
+ version: 1.5.0
+ resolution: "@emnapi/runtime@npm:1.5.0"
+ dependencies:
+ tslib: "npm:^2.4.0"
+ checksum: 10c0/a85c9fc4e3af49cbe41e5437e5be2551392a931910cd0a5b5d3572532786927810c9cc1db11b232ec8f9657b33d4e6f7c4f985f1a052917d7cd703b5b2a20faa
+ languageName: node
+ linkType: hard
+
"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0":
version: 4.4.0
resolution: "@eslint-community/eslint-utils@npm:4.4.0"
@@ -278,6 +287,214 @@ __metadata:
languageName: node
linkType: hard
+"@img/colour@npm:^1.0.0":
+ version: 1.0.0
+ resolution: "@img/colour@npm:1.0.0"
+ checksum: 10c0/02261719c1e0d7aa5a2d585981954f2ac126f0c432400aa1a01b925aa2c41417b7695da8544ee04fd29eba7ecea8eaf9b8bef06f19dc8faba78f94eeac40667d
+ languageName: node
+ linkType: hard
+
+"@img/sharp-darwin-arm64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-darwin-arm64@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-darwin-arm64": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-darwin-arm64":
+ optional: true
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@img/sharp-darwin-x64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-darwin-x64@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-darwin-x64": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-darwin-x64":
+ optional: true
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-darwin-arm64@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-darwin-arm64@npm:1.2.3"
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-darwin-x64@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-darwin-x64@npm:1.2.3"
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-linux-arm64@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-linux-arm64@npm:1.2.3"
+ conditions: os=linux & cpu=arm64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-linux-arm@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-linux-arm@npm:1.2.3"
+ conditions: os=linux & cpu=arm & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-linux-ppc64@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-linux-ppc64@npm:1.2.3"
+ conditions: os=linux & cpu=ppc64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-linux-s390x@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-linux-s390x@npm:1.2.3"
+ conditions: os=linux & cpu=s390x & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-linux-x64@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-linux-x64@npm:1.2.3"
+ conditions: os=linux & cpu=x64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-linuxmusl-arm64@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-linuxmusl-arm64@npm:1.2.3"
+ conditions: os=linux & cpu=arm64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@img/sharp-libvips-linuxmusl-x64@npm:1.2.3":
+ version: 1.2.3
+ resolution: "@img/sharp-libvips-linuxmusl-x64@npm:1.2.3"
+ conditions: os=linux & cpu=x64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@img/sharp-linux-arm64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-linux-arm64@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-linux-arm64": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-linux-arm64":
+ optional: true
+ conditions: os=linux & cpu=arm64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-linux-arm@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-linux-arm@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-linux-arm": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-linux-arm":
+ optional: true
+ conditions: os=linux & cpu=arm & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-linux-ppc64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-linux-ppc64@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-linux-ppc64": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-linux-ppc64":
+ optional: true
+ conditions: os=linux & cpu=ppc64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-linux-s390x@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-linux-s390x@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-linux-s390x": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-linux-s390x":
+ optional: true
+ conditions: os=linux & cpu=s390x & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-linux-x64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-linux-x64@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-linux-x64": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-linux-x64":
+ optional: true
+ conditions: os=linux & cpu=x64 & libc=glibc
+ languageName: node
+ linkType: hard
+
+"@img/sharp-linuxmusl-arm64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-linuxmusl-arm64@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-linuxmusl-arm64": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-linuxmusl-arm64":
+ optional: true
+ conditions: os=linux & cpu=arm64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@img/sharp-linuxmusl-x64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-linuxmusl-x64@npm:0.34.4"
+ dependencies:
+ "@img/sharp-libvips-linuxmusl-x64": "npm:1.2.3"
+ dependenciesMeta:
+ "@img/sharp-libvips-linuxmusl-x64":
+ optional: true
+ conditions: os=linux & cpu=x64 & libc=musl
+ languageName: node
+ linkType: hard
+
+"@img/sharp-wasm32@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-wasm32@npm:0.34.4"
+ dependencies:
+ "@emnapi/runtime": "npm:^1.5.0"
+ conditions: cpu=wasm32
+ languageName: node
+ linkType: hard
+
+"@img/sharp-win32-arm64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-win32-arm64@npm:0.34.4"
+ conditions: os=win32 & cpu=arm64
+ languageName: node
+ linkType: hard
+
+"@img/sharp-win32-ia32@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-win32-ia32@npm:0.34.4"
+ conditions: os=win32 & cpu=ia32
+ languageName: node
+ linkType: hard
+
+"@img/sharp-win32-x64@npm:0.34.4":
+ version: 0.34.4
+ resolution: "@img/sharp-win32-x64@npm:0.34.4"
+ conditions: os=win32 & cpu=x64
+ languageName: node
+ linkType: hard
+
"@isaacs/cliui@npm:^8.0.2":
version: 8.0.2
resolution: "@isaacs/cliui@npm:8.0.2"
@@ -434,6 +651,7 @@ __metadata:
"@mintlify/prettier-config": "npm:^1.0.1"
"@mintlify/ts-config": "npm:^2.0.2"
"@shikijs/transformers": "npm:^3.11.0"
+ "@shikijs/twoslash": "npm:^3.12.2"
"@trivago/prettier-plugin-sort-imports": "npm:^4.3.0"
"@tsconfig/recommended": "npm:1.x"
"@types/hast": "npm:^3.0.4"
@@ -458,6 +676,7 @@ __metadata:
remark-smartypants: "npm:^3.0.2"
rimraf: "npm:^5.0.1"
shiki: "npm:^3.11.0"
+ twoslash-cdn: "npm:^0.3.4"
typescript: "npm:^5.7.2"
unified: "npm:^11.0.0"
unist-util-visit: "npm:^5.0.0"
@@ -494,6 +713,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/env@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/env@npm:15.4.2"
+ checksum: 10c0/8ee793035f0a7fb55335ea2bc2794ccd68747e6ab8c591001662dbf1ba328f43b04d02bb3a6c9d6a60ed18b55d44cc157b724121ce8dbea8584ca41272eb90a4
+ languageName: node
+ linkType: hard
+
"@next/eslint-plugin-next@npm:14.0.4":
version: 14.0.4
resolution: "@next/eslint-plugin-next@npm:14.0.4"
@@ -510,6 +736,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-darwin-arm64@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-darwin-arm64@npm:15.4.2"
+ conditions: os=darwin & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@next/swc-darwin-x64@npm:14.0.4":
version: 14.0.4
resolution: "@next/swc-darwin-x64@npm:14.0.4"
@@ -517,6 +750,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-darwin-x64@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-darwin-x64@npm:15.4.2"
+ conditions: os=darwin & cpu=x64
+ languageName: node
+ linkType: hard
+
"@next/swc-linux-arm64-gnu@npm:14.0.4":
version: 14.0.4
resolution: "@next/swc-linux-arm64-gnu@npm:14.0.4"
@@ -524,6 +764,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-linux-arm64-gnu@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-linux-arm64-gnu@npm:15.4.2"
+ conditions: os=linux & cpu=arm64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@next/swc-linux-arm64-musl@npm:14.0.4":
version: 14.0.4
resolution: "@next/swc-linux-arm64-musl@npm:14.0.4"
@@ -531,6 +778,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-linux-arm64-musl@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-linux-arm64-musl@npm:15.4.2"
+ conditions: os=linux & cpu=arm64 & libc=musl
+ languageName: node
+ linkType: hard
+
"@next/swc-linux-x64-gnu@npm:14.0.4":
version: 14.0.4
resolution: "@next/swc-linux-x64-gnu@npm:14.0.4"
@@ -538,6 +792,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-linux-x64-gnu@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-linux-x64-gnu@npm:15.4.2"
+ conditions: os=linux & cpu=x64 & libc=glibc
+ languageName: node
+ linkType: hard
+
"@next/swc-linux-x64-musl@npm:14.0.4":
version: 14.0.4
resolution: "@next/swc-linux-x64-musl@npm:14.0.4"
@@ -545,6 +806,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-linux-x64-musl@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-linux-x64-musl@npm:15.4.2"
+ conditions: os=linux & cpu=x64 & libc=musl
+ languageName: node
+ linkType: hard
+
"@next/swc-win32-arm64-msvc@npm:14.0.4":
version: 14.0.4
resolution: "@next/swc-win32-arm64-msvc@npm:14.0.4"
@@ -552,6 +820,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-win32-arm64-msvc@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-win32-arm64-msvc@npm:15.4.2"
+ conditions: os=win32 & cpu=arm64
+ languageName: node
+ linkType: hard
+
"@next/swc-win32-ia32-msvc@npm:14.0.4":
version: 14.0.4
resolution: "@next/swc-win32-ia32-msvc@npm:14.0.4"
@@ -566,6 +841,13 @@ __metadata:
languageName: node
linkType: hard
+"@next/swc-win32-x64-msvc@npm:15.4.2":
+ version: 15.4.2
+ resolution: "@next/swc-win32-x64-msvc@npm:15.4.2"
+ conditions: os=win32 & cpu=x64
+ languageName: node
+ linkType: hard
+
"@nodelib/fs.scandir@npm:2.1.5":
version: 2.1.5
resolution: "@nodelib/fs.scandir@npm:2.1.5"
@@ -655,6 +937,18 @@ __metadata:
languageName: node
linkType: hard
+"@shikijs/core@npm:3.12.2":
+ version: 3.12.2
+ resolution: "@shikijs/core@npm:3.12.2"
+ dependencies:
+ "@shikijs/types": "npm:3.12.2"
+ "@shikijs/vscode-textmate": "npm:^10.0.2"
+ "@types/hast": "npm:^3.0.4"
+ hast-util-to-html: "npm:^9.0.5"
+ checksum: 10c0/3a05bc0a316a8a0170996ffe5dfc76021d20a459ed2c1aa5e659468a1a65af1cf0f69415535ecbd54387f4c61caf5d4b4e88b8fde21caf6af649d4178da52092
+ languageName: node
+ linkType: hard
+
"@shikijs/engine-javascript@npm:3.11.0":
version: 3.11.0
resolution: "@shikijs/engine-javascript@npm:3.11.0"
@@ -704,6 +998,19 @@ __metadata:
languageName: node
linkType: hard
+"@shikijs/twoslash@npm:^3.12.2":
+ version: 3.12.2
+ resolution: "@shikijs/twoslash@npm:3.12.2"
+ dependencies:
+ "@shikijs/core": "npm:3.12.2"
+ "@shikijs/types": "npm:3.12.2"
+ twoslash: "npm:^0.3.4"
+ peerDependencies:
+ typescript: ">=5.5.0"
+ checksum: 10c0/810808514c8e562585afb8e835cf2a214f26e9bf609c17bfb7faf0bae7b059d545384da715a12fa623f906388ff14db39984c3aad6a53ee191475b158b0f7651
+ languageName: node
+ linkType: hard
+
"@shikijs/types@npm:3.11.0":
version: 3.11.0
resolution: "@shikijs/types@npm:3.11.0"
@@ -714,6 +1021,16 @@ __metadata:
languageName: node
linkType: hard
+"@shikijs/types@npm:3.12.2":
+ version: 3.12.2
+ resolution: "@shikijs/types@npm:3.12.2"
+ dependencies:
+ "@shikijs/vscode-textmate": "npm:^10.0.2"
+ "@types/hast": "npm:^3.0.4"
+ checksum: 10c0/74622ac69a84f0d7b66f6f9253bdaa0fee69b7bc97d5f85e12b2a70a9d77d2b04fdbccf65fcd9460449340a214594cb945fee8b3d2c091175e58e8cdf2cb2920
+ languageName: node
+ linkType: hard
+
"@shikijs/vscode-textmate@npm:^10.0.2":
version: 10.0.2
resolution: "@shikijs/vscode-textmate@npm:10.0.2"
@@ -721,6 +1038,15 @@ __metadata:
languageName: node
linkType: hard
+"@swc/helpers@npm:0.5.15":
+ version: 0.5.15
+ resolution: "@swc/helpers@npm:0.5.15"
+ dependencies:
+ tslib: "npm:^2.8.0"
+ checksum: 10c0/33002f74f6f885f04c132960835fdfc474186983ea567606db62e86acd0680ca82f34647e8e610f4e1e422d1c16fce729dde22cd3b797ab1fd9061a825dabca4
+ languageName: node
+ linkType: hard
+
"@swc/helpers@npm:0.5.2":
version: 0.5.2
resolution: "@swc/helpers@npm:0.5.2"
@@ -1143,6 +1469,17 @@ __metadata:
languageName: node
linkType: hard
+"@typescript/vfs@npm:^1.6.1":
+ version: 1.6.1
+ resolution: "@typescript/vfs@npm:1.6.1"
+ dependencies:
+ debug: "npm:^4.1.1"
+ peerDependencies:
+ typescript: "*"
+ checksum: 10c0/3878686aff4bf26813dad9242aa8e01c5c9734f4d37f31035f93e9c8b850f15ec6a4480f04cf3a3a1cbf78a4e796ae1be5d6c54f7f7c91556eafee913a8d0da4
+ languageName: node
+ linkType: hard
+
"@ungap/structured-clone@npm:^1.0.0":
version: 1.2.1
resolution: "@ungap/structured-clone@npm:1.2.1"
@@ -1269,10 +1606,10 @@ __metadata:
autoprefixer: "npm:^10.0.1"
eslint: "npm:^8"
eslint-config-next: "npm:14.0.4"
- next: "npm:14.0.4"
+ next: "npm:15.4.2"
postcss: "npm:^8"
- react: "npm:^18"
- react-dom: "npm:^18"
+ react: "npm:18.3.1"
+ react-dom: "npm:18.3.1"
tailwindcss: "npm:^3.3.0"
typescript: "npm:^5"
languageName: unknown
@@ -1628,6 +1965,13 @@ __metadata:
languageName: node
linkType: hard
+"caniuse-lite@npm:^1.0.30001579":
+ version: 1.0.30001743
+ resolution: "caniuse-lite@npm:1.0.30001743"
+ checksum: 10c0/1bd730ca10d881a1ca9f55ce864d34c3b18501718c03976e0d3419f4694b715159e13fdef6d58ad47b6d2445d315940f3a01266658876828c820a3331aac021d
+ languageName: node
+ linkType: hard
+
"ccount@npm:^2.0.0":
version: 2.0.1
resolution: "ccount@npm:2.0.1"
@@ -1941,6 +2285,13 @@ __metadata:
languageName: node
linkType: hard
+"detect-libc@npm:^2.1.0":
+ version: 2.1.0
+ resolution: "detect-libc@npm:2.1.0"
+ checksum: 10c0/4d0d36c77fdcb1d3221779d8dfc7d5808dd52530d49db67193fb3cd8149e2d499a1eeb87bb830ad7c442294929992c12e971f88ae492965549f8f83e5336eba6
+ languageName: node
+ linkType: hard
+
"devlop@npm:^1.0.0, devlop@npm:^1.1.0":
version: 1.1.0
resolution: "devlop@npm:1.1.0"
@@ -5052,6 +5403,65 @@ __metadata:
languageName: node
linkType: hard
+"next@npm:15.4.2":
+ version: 15.4.2
+ resolution: "next@npm:15.4.2"
+ dependencies:
+ "@next/env": "npm:15.4.2"
+ "@next/swc-darwin-arm64": "npm:15.4.2"
+ "@next/swc-darwin-x64": "npm:15.4.2"
+ "@next/swc-linux-arm64-gnu": "npm:15.4.2"
+ "@next/swc-linux-arm64-musl": "npm:15.4.2"
+ "@next/swc-linux-x64-gnu": "npm:15.4.2"
+ "@next/swc-linux-x64-musl": "npm:15.4.2"
+ "@next/swc-win32-arm64-msvc": "npm:15.4.2"
+ "@next/swc-win32-x64-msvc": "npm:15.4.2"
+ "@swc/helpers": "npm:0.5.15"
+ caniuse-lite: "npm:^1.0.30001579"
+ postcss: "npm:8.4.31"
+ sharp: "npm:^0.34.3"
+ styled-jsx: "npm:5.1.6"
+ peerDependencies:
+ "@opentelemetry/api": ^1.1.0
+ "@playwright/test": ^1.51.1
+ babel-plugin-react-compiler: "*"
+ react: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
+ react-dom: ^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0
+ sass: ^1.3.0
+ dependenciesMeta:
+ "@next/swc-darwin-arm64":
+ optional: true
+ "@next/swc-darwin-x64":
+ optional: true
+ "@next/swc-linux-arm64-gnu":
+ optional: true
+ "@next/swc-linux-arm64-musl":
+ optional: true
+ "@next/swc-linux-x64-gnu":
+ optional: true
+ "@next/swc-linux-x64-musl":
+ optional: true
+ "@next/swc-win32-arm64-msvc":
+ optional: true
+ "@next/swc-win32-x64-msvc":
+ optional: true
+ sharp:
+ optional: true
+ peerDependenciesMeta:
+ "@opentelemetry/api":
+ optional: true
+ "@playwright/test":
+ optional: true
+ babel-plugin-react-compiler:
+ optional: true
+ sass:
+ optional: true
+ bin:
+ next: dist/bin/next
+ checksum: 10c0/eac6b27e480b45c0441b18d3c1cadf0373847e407e8b032e1d72f87bd22642fbc31b7a9ba99a7d3cbb3e37d1cadc4e5999b0c14844aa6d3e0be6f7291dfe96b0
+ languageName: node
+ linkType: hard
+
"nlcst-to-string@npm:^4.0.0":
version: 4.0.0
resolution: "nlcst-to-string@npm:4.0.0"
@@ -5662,7 +6072,7 @@ __metadata:
languageName: node
linkType: hard
-"react-dom@npm:^18, react-dom@npm:^18.3.1":
+"react-dom@npm:18.3.1, react-dom@npm:^18, react-dom@npm:^18.3.1":
version: 18.3.1
resolution: "react-dom@npm:18.3.1"
dependencies:
@@ -5681,7 +6091,7 @@ __metadata:
languageName: node
linkType: hard
-"react@npm:^18, react@npm:^18.3.1":
+"react@npm:18.3.1, react@npm:^18, react@npm:^18.3.1":
version: 18.3.1
resolution: "react@npm:18.3.1"
dependencies:
@@ -6166,6 +6576,15 @@ __metadata:
languageName: node
linkType: hard
+"semver@npm:^7.7.2":
+ version: 7.7.2
+ resolution: "semver@npm:7.7.2"
+ bin:
+ semver: bin/semver.js
+ checksum: 10c0/aca305edfbf2383c22571cb7714f48cadc7ac95371b4b52362fb8eeffdfbc0de0669368b82b2b15978f8848f01d7114da65697e56cd8c37b0dab8c58e543f9ea
+ languageName: node
+ linkType: hard
+
"serialize-error@npm:^11.0.3":
version: 11.0.3
resolution: "serialize-error@npm:11.0.3"
@@ -6201,6 +6620,84 @@ __metadata:
languageName: node
linkType: hard
+"sharp@npm:^0.34.3":
+ version: 0.34.4
+ resolution: "sharp@npm:0.34.4"
+ dependencies:
+ "@img/colour": "npm:^1.0.0"
+ "@img/sharp-darwin-arm64": "npm:0.34.4"
+ "@img/sharp-darwin-x64": "npm:0.34.4"
+ "@img/sharp-libvips-darwin-arm64": "npm:1.2.3"
+ "@img/sharp-libvips-darwin-x64": "npm:1.2.3"
+ "@img/sharp-libvips-linux-arm": "npm:1.2.3"
+ "@img/sharp-libvips-linux-arm64": "npm:1.2.3"
+ "@img/sharp-libvips-linux-ppc64": "npm:1.2.3"
+ "@img/sharp-libvips-linux-s390x": "npm:1.2.3"
+ "@img/sharp-libvips-linux-x64": "npm:1.2.3"
+ "@img/sharp-libvips-linuxmusl-arm64": "npm:1.2.3"
+ "@img/sharp-libvips-linuxmusl-x64": "npm:1.2.3"
+ "@img/sharp-linux-arm": "npm:0.34.4"
+ "@img/sharp-linux-arm64": "npm:0.34.4"
+ "@img/sharp-linux-ppc64": "npm:0.34.4"
+ "@img/sharp-linux-s390x": "npm:0.34.4"
+ "@img/sharp-linux-x64": "npm:0.34.4"
+ "@img/sharp-linuxmusl-arm64": "npm:0.34.4"
+ "@img/sharp-linuxmusl-x64": "npm:0.34.4"
+ "@img/sharp-wasm32": "npm:0.34.4"
+ "@img/sharp-win32-arm64": "npm:0.34.4"
+ "@img/sharp-win32-ia32": "npm:0.34.4"
+ "@img/sharp-win32-x64": "npm:0.34.4"
+ detect-libc: "npm:^2.1.0"
+ semver: "npm:^7.7.2"
+ dependenciesMeta:
+ "@img/sharp-darwin-arm64":
+ optional: true
+ "@img/sharp-darwin-x64":
+ optional: true
+ "@img/sharp-libvips-darwin-arm64":
+ optional: true
+ "@img/sharp-libvips-darwin-x64":
+ optional: true
+ "@img/sharp-libvips-linux-arm":
+ optional: true
+ "@img/sharp-libvips-linux-arm64":
+ optional: true
+ "@img/sharp-libvips-linux-ppc64":
+ optional: true
+ "@img/sharp-libvips-linux-s390x":
+ optional: true
+ "@img/sharp-libvips-linux-x64":
+ optional: true
+ "@img/sharp-libvips-linuxmusl-arm64":
+ optional: true
+ "@img/sharp-libvips-linuxmusl-x64":
+ optional: true
+ "@img/sharp-linux-arm":
+ optional: true
+ "@img/sharp-linux-arm64":
+ optional: true
+ "@img/sharp-linux-ppc64":
+ optional: true
+ "@img/sharp-linux-s390x":
+ optional: true
+ "@img/sharp-linux-x64":
+ optional: true
+ "@img/sharp-linuxmusl-arm64":
+ optional: true
+ "@img/sharp-linuxmusl-x64":
+ optional: true
+ "@img/sharp-wasm32":
+ optional: true
+ "@img/sharp-win32-arm64":
+ optional: true
+ "@img/sharp-win32-ia32":
+ optional: true
+ "@img/sharp-win32-x64":
+ optional: true
+ checksum: 10c0/c2d8afab823a53bb720c42aaddde2031d7a1e25b7f1bd123e342b6b77ffce5e2730017fd52282cadf6109b325bc16f35be4771caa040cf2855978b709be35f05
+ languageName: node
+ linkType: hard
+
"shebang-command@npm:^2.0.0":
version: 2.0.0
resolution: "shebang-command@npm:2.0.0"
@@ -6558,6 +7055,22 @@ __metadata:
languageName: node
linkType: hard
+"styled-jsx@npm:5.1.6":
+ version: 5.1.6
+ resolution: "styled-jsx@npm:5.1.6"
+ dependencies:
+ client-only: "npm:0.0.1"
+ peerDependencies:
+ react: ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0"
+ peerDependenciesMeta:
+ "@babel/core":
+ optional: true
+ babel-plugin-macros:
+ optional: true
+ checksum: 10c0/ace50e7ea5ae5ae6a3b65a50994c51fca6ae7df9c7ecfd0104c36be0b4b3a9c5c1a2374d16e2a11e256d0b20be6d47256d768ecb4f91ab390f60752a075780f5
+ languageName: node
+ linkType: hard
+
"sucrase@npm:^3.35.0":
version: 3.35.0
resolution: "sucrase@npm:3.35.0"
@@ -6738,13 +7251,43 @@ __metadata:
languageName: node
linkType: hard
-"tslib@npm:^2.4.0":
+"tslib@npm:^2.4.0, tslib@npm:^2.8.0":
version: 2.8.1
resolution: "tslib@npm:2.8.1"
checksum: 10c0/9c4759110a19c53f992d9aae23aac5ced636e99887b51b9e61def52611732872ff7668757d4e4c61f19691e36f4da981cd9485e869b4a7408d689f6bf1f14e62
languageName: node
linkType: hard
+"twoslash-cdn@npm:^0.3.4":
+ version: 0.3.4
+ resolution: "twoslash-cdn@npm:0.3.4"
+ dependencies:
+ twoslash: "npm:0.3.4"
+ peerDependencies:
+ typescript: ^5.5.0
+ checksum: 10c0/dc3bd3d54319f80a7c34057847522e1d5dffaec08c1d1195ea0f16aef73325576c9c3bf60eff10ce7233594c5ab980f68c3c82742d97d4c4b450ac160364a323
+ languageName: node
+ linkType: hard
+
+"twoslash-protocol@npm:0.3.4":
+ version: 0.3.4
+ resolution: "twoslash-protocol@npm:0.3.4"
+ checksum: 10c0/4062a0dced5e8bca37db0b759cbb08f13b00d13572cd676686d139d436ec324d9b1ca959cf0929683b987b090c62ad52f02c8948919e89f8ab76e5502eb1e309
+ languageName: node
+ linkType: hard
+
+"twoslash@npm:0.3.4, twoslash@npm:^0.3.4":
+ version: 0.3.4
+ resolution: "twoslash@npm:0.3.4"
+ dependencies:
+ "@typescript/vfs": "npm:^1.6.1"
+ twoslash-protocol: "npm:0.3.4"
+ peerDependencies:
+ typescript: ^5.5.0
+ checksum: 10c0/1220393b48dce0e0f20c7c9ce2801864ee99dc052b1f78d884a5eb737052164511d26c8ca7652170475a3bff28afdf96a136132d074f8e35dee5d79d6208162c
+ languageName: node
+ linkType: hard
+
"type-check@npm:^0.4.0, type-check@npm:~0.4.0":
version: 0.4.0
resolution: "type-check@npm:0.4.0"