feat: setup twoslash for codeblocks
This is working now, but with a few caveats:
Preview
Short-term
- [x] ~~
twoslashis not stable yet: https://github.com/twoslashes/twoslash~~ - [x] ~~Using
shikiji's beta https://shikiji.netlify.app/packages/twoslash, which is wait fortwoslash~~ - [x] ~~Once
shikijiv0.10 released and VitePress upgrade to it, the pnpm overrides can be removed~~
Long-term
__VUE_OPTIONS_API__: trueis required at this moment becausefloating-vueis still using Options API- ~~
shamefully-hoist=trueis required at this moment fortwoslashto resolve the types correctly~~
And later we need to revise code blocks across the docs to add the twoslash flag.
Deploy Preview for vuejs ready!
| Name | Link |
|---|---|
| Latest commit | c41715704b4222d1be1eccb7b0955a574f349868 |
| Latest deploy log | https://app.netlify.com/sites/vuejs/deploys/65e72cc7e95a7e0008476cf4 |
| Deploy Preview | https://deploy-preview-2668--vuejs.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
I think it's ready now. The only thing is that if we should bring Options API or wait for Floating Vue to adopt to Composition API only
@antfu thank you for working on this! Looks great ✨
Could you please resolve the conflicts? I'll merge the PR and add twoslash to the codeblocks
I'll release vitepress by tomorrow. It will have shiki@v1. We can remove resolutions from package.json here.
Also, is it possible to use the older code background with twoslash? github-dark's default background doesn't look nice with other stuff.
Let's enable Options API then, it's ok for now until we have a version of floating-vue that is Composition API based.
Should be good to go now
I think we need to be a bit selective on where to use these, let me take a pass on the rest of the docs so it doesn't become distractive.