Skip to content

fix(twoslash): forward tsModule to createTwoslasher#1271

Merged
antfu merged 3 commits into
shikijs:mainfrom
arthurfiorette:main
Apr 13, 2026
Merged

fix(twoslash): forward tsModule to createTwoslasher#1271
antfu merged 3 commits into
shikijs:mainfrom
arthurfiorette:main

Conversation

@arthurfiorette
Copy link
Copy Markdown
Contributor

@arthurfiorette arthurfiorette commented Apr 12, 2026

I did not use AI to write this PR. Opening the PR just now because when I found/fixed the issue, external contributions were disabled.

I ran into an issue while building the new https://html.kitajs.org/ docs. I wanted code blocks to render warnings from @kitajs/ts-html-plugin, a custom tsserver plugin that adds extra diagnostics over JSX syntax, but tsconfig's plugin option is a tsserver only thing, thus we need to extend twoslash's tsModule to simulate this behavior.

transformerTwoslash calls createTwoslasher once at startup and only passes cache to it. tsModule is a create-time option, so it has to be there at that point. passing it inside twoslashOptions is too late since it's only used per-block.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 12, 2026

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit b1f27b4
🔍 Latest deploy log https://app.netlify.com/projects/shiki-matsu/deploys/69dbc5bd4923780008b56b93
😎 Deploy Preview https://deploy-preview-1271--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 12, 2026

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit b1f27b4
🔍 Latest deploy log https://app.netlify.com/projects/shiki-next/deploys/69dbc5bd5f07f00009f68197
😎 Deploy Preview https://deploy-preview-1271--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.67%. Comparing base (4365957) to head (b1f27b4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1271      +/-   ##
==========================================
+ Coverage   89.66%   89.67%   +0.01%     
==========================================
  Files          79       79              
  Lines        3512     3516       +4     
  Branches     1007     1011       +4     
==========================================
+ Hits         3149     3153       +4     
  Misses        327      327              
  Partials       36       36              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@antfu antfu changed the title fix: forward tsModule to createTwoslasher fix(twoslash): forward tsModule to createTwoslasher Apr 13, 2026
@antfu antfu merged commit be89afc into shikijs:main Apr 13, 2026
16 checks passed
@arthurfiorette
Copy link
Copy Markdown
Contributor Author

Hey @antfu, could you release a new version with this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants