Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update @shikijs/vitepress-twoslash to 1.5.0 #16637

Merged
merged 2 commits into from
May 10, 2024

Conversation

btea
Copy link
Collaborator

@btea btea commented May 9, 2024

Description

twoslashes/twoslash#33 Implemented twoslash to support adding spaces in front of cut comments, so <!-- prettier-ignore-start --> can be removed.

Copy link

stackblitz bot commented May 9, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@btea btea requested a review from sapphi-red May 9, 2024 01:23
@bluwy
Copy link
Member

bluwy commented May 9, 2024

It looks like the code examples now look indented though, I think we want to dedent it?

image

Comment on lines 51 to 64
```js twoslash
/** @type {import('vite').UserConfig} */
const config = {
build: {
// ---cut-before---
modulePreload: {
resolveDependencies: (filename, deps, { hostId, hostType }) => {
return deps.filter(condition)
},
},
// ---cut-after---
// ---cut-before---
modulePreload: {
resolveDependencies: (filename, deps, { hostId, hostType }) => {
return deps.filter(condition)
},
},
// ---cut-after---
},
}
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I forgot about dedenting when implementing twoslashes/twoslash#33 😅. I noticed that we can simply this by putting the prettier-ignore inside.

/** @type {import('vite').UserConfig} */
const config = {
  // prettier-ignore
  build: {
// ---cut-before---
modulePreload: {
  resolveDependencies: (filename, deps, { hostId, hostType }) => {
    return deps.filter(condition)
  },
},
// ---cut-after---
  },
}

@btea
Copy link
Collaborator Author

btea commented May 9, 2024

@bluwy Adjusted according to @sapphi-red 's suggestion, now there is no indentation. But now there is no scene with a space before the cut comment. 😃

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for me 👍 But I also wonder if we could use a Shiki transformer to automatic dedent the twoslash code blocks.

@patak-dev patak-dev enabled auto-merge (squash) May 10, 2024 18:10
@patak-dev patak-dev merged commit 4501b5a into vitejs:main May 10, 2024
11 checks passed
@btea btea deleted the chore/update-vitepress-twoslash branch May 10, 2024 22:20
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.

4 participants