mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
chore: bump up shiki version to v2 (#9793)
This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [shiki](https://redirect.github.com/shikijs/shiki) ([source](https://redirect.github.com/shikijs/shiki/tree/HEAD/packages/shiki)) | [`^1.14.1` -> `^2.0.0`](https://renovatebot.com/diffs/npm/shiki/1.29.1/2.0.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | | [shiki](https://redirect.github.com/shikijs/shiki) ([source](https://redirect.github.com/shikijs/shiki/tree/HEAD/packages/shiki)) | [`^1.12.0` -> `^2.0.0`](https://renovatebot.com/diffs/npm/shiki/1.29.1/2.0.3) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | [](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>shikijs/shiki (shiki)</summary> ### [`v2.0.3`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.3) [Compare Source](https://redirect.github.com/shikijs/shiki/compare/v2.0.2...v2.0.3) ##### 🐞 Bug Fixes - **core**: Soft require `engine` options - by [@​antfu](https://redirect.github.com/antfu) [<samp>(10a6f)</samp>](https://redirect.github.com/shikijs/shiki/commit/10a6f781) ##### [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v2.0.2...v2.0.3) ### [`v2.0.2`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.2) [Compare Source](https://redirect.github.com/shikijs/shiki/compare/v2.0.1...v2.0.2) ##### 🐞 Bug Fixes - Mark `engine` required in `createHighlighterCore` - by [@​antfu](https://redirect.github.com/antfu) [<samp>(1212f)</samp>](https://redirect.github.com/shikijs/shiki/commit/1212f473) ##### [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v2.0.1...v2.0.2) ### [`v2.0.1`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.1) [Compare Source](https://redirect.github.com/shikijs/shiki/compare/v2.0.0...v2.0.1) ##### 🚀 Features - Improve warning messages - by [@​antfu](https://redirect.github.com/antfu) [<samp>(0f27a)</samp>](https://redirect.github.com/shikijs/shiki/commit/0f27a20d) ##### 🐞 Bug Fixes - Warn about missing deprecation - by [@​antfu](https://redirect.github.com/antfu) [<samp>(708e3)</samp>](https://redirect.github.com/shikijs/shiki/commit/708e3f24) - **colorized-brackets**: Use object style `htmlStyle` - by [@​antfu](https://redirect.github.com/antfu) [<samp>(eab5b)</samp>](https://redirect.github.com/shikijs/shiki/commit/eab5bd18) ##### [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v2.0.0...v2.0.1) ### [`v2.0.0`](https://redirect.github.com/shikijs/shiki/releases/tag/v2.0.0) [Compare Source](https://redirect.github.com/shikijs/shiki/compare/v1.29.1...v2.0.0) ##### Read the announcement: [Shiki v2](https://shiki.style/blog/v2) ##### [View changes on GitHub](https://redirect.github.com/shikijs/shiki/compare/v1.29.1...v2.0.0) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->
This commit is contained in:
@@ -6,6 +6,7 @@ import { type Signal, signal } from '@preact/signals-core';
|
||||
import {
|
||||
bundledLanguagesInfo,
|
||||
createHighlighterCore,
|
||||
createOnigurumaEngine,
|
||||
type HighlighterCore,
|
||||
type MaybeGetter,
|
||||
} from 'shiki';
|
||||
@@ -42,7 +43,7 @@ export class CodeBlockService extends BlockService {
|
||||
this.bindHotKey(textKeymap(this.std));
|
||||
|
||||
createHighlighterCore({
|
||||
loadWasm: getWasm,
|
||||
engine: createOnigurumaEngine(() => getWasm),
|
||||
})
|
||||
.then(async highlighter => {
|
||||
const config = this.std.getConfig('affine:code');
|
||||
|
||||
Reference in New Issue
Block a user