Skip to content

Commit d6d290c

Browse files
committed
bump deps
1 parent ca1575e commit d6d290c

File tree

11 files changed

+362
-418
lines changed

11 files changed

+362
-418
lines changed

.changeset/heavy-lemons-destroy.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'fumadocs-typescript': patch
3+
'fumadocs-twoslash': patch
4+
'fumadocs-openapi': patch
5+
'fumadocs-core': patch
6+
---
7+
8+
Upgrade Shiki

apps/docs/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@radix-ui/react-popover": "^1.1.2",
2121
"@radix-ui/react-slot": "^1.1.0",
2222
"@radix-ui/react-tooltip": "^1.1.3",
23-
"@shikijs/rehype": "^1.22.1",
23+
"@shikijs/rehype": "^1.22.2",
2424
"algoliasearch": "4.24.0",
2525
"class-variance-authority": "^0.7.0",
2626
"fumadocs-core": "workspace:*",
@@ -46,7 +46,7 @@
4646
"remark-rehype": "^11.1.1",
4747
"remark-stringify": "^11.0.0",
4848
"scroll-into-view-if-needed": "^3.1.0",
49-
"shiki": "^1.22.1",
49+
"shiki": "^1.22.2",
5050
"tailwind-merge": "^2.5.4",
5151
"ts-morph": "^24.0.0",
5252
"zod": "^3.23.8"
@@ -70,7 +70,7 @@
7070
"tailwindcss": "^3.4.14",
7171
"tailwindcss-animate": "^1.0.7",
7272
"tsconfig": "workspace:*",
73-
"tsx": "^4.19.1",
73+
"tsx": "^4.19.2",
7474
"typescript": "^5.6.3",
7575
"webpack": "^5.95.0"
7676
}

examples/openapi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"postcss": "^8.4.47",
1919
"react": "18.3.1",
2020
"react-dom": "18.3.1",
21-
"shiki": "^1.22.1",
21+
"shiki": "^1.22.2",
2222
"tailwindcss": "^3.4.14",
2323
"zod": "^3.23.8"
2424
},

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"turbo": "2.2.3",
3232
"typescript": "^5.6.3",
3333
"typescript-eslint": "^8.11.0",
34-
"vitest": "^2.1.3"
34+
"vitest": "^2.1.4"
3535
},
3636
"packageManager": "pnpm@9.12.3",
3737
"engines": {

packages/cli/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"dependencies": {
3737
"@clack/prompts": "^0.7.0",
3838
"commander": "^12.1.0",
39-
"execa": "^9.4.1",
39+
"execa": "^9.5.0",
4040
"package-manager-detector": "^0.2.2",
4141
"picocolors": "^1.1.1",
4242
"ts-morph": "^24.0.0"
@@ -48,7 +48,7 @@
4848
"eslint-config-custom": "workspace:*",
4949
"fast-glob": "^3.3.1",
5050
"tsconfig": "workspace:*",
51-
"tsx": "^4.19.1"
51+
"tsx": "^4.19.2"
5252
},
5353
"publishConfig": {
5454
"access": "public"

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
"dependencies": {
7979
"@formatjs/intl-localematcher": "^0.5.6",
8080
"@orama/orama": "^3.0.1",
81-
"@shikijs/rehype": "^1.22.1",
81+
"@shikijs/rehype": "^1.22.2",
8282
"github-slugger": "^2.0.0",
8383
"hast-util-to-estree": "^3.1.0",
8484
"hast-util-to-jsx-runtime": "^2.3.2",
@@ -88,11 +88,10 @@
8888
"remark": "^15.0.0",
8989
"remark-gfm": "^4.0.0",
9090
"scroll-into-view-if-needed": "^3.1.0",
91-
"shiki": "^1.22.1",
91+
"shiki": "^1.22.2",
9292
"unist-util-visit": "^5.0.0"
9393
},
9494
"devDependencies": {
95-
"shiki-transformers": "^1.0.0",
9695
"@algolia/client-search": "4.24.0",
9796
"@mdx-js/mdx": "^3.1.0",
9897
"@types/estree-jsx": "^1.0.5",
@@ -109,6 +108,7 @@
109108
"next": "^15.0.0",
110109
"remark-mdx": "^3.1.0",
111110
"remark-rehype": "^11.1.1",
111+
"shiki-transformers": "^1.0.0",
112112
"tsconfig": "workspace:*",
113113
"unified": "^11.0.5"
114114
},

packages/core/src/server/shiki.ts

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ import {
55
type CodeOptionsMeta,
66
type HighlighterCoreOptions,
77
type CodeToHastOptionsCommon,
8-
type Highlighter,
9-
createHighlighter,
108
getSingletonHighlighter,
119
} from 'shiki';
1210
import type { BundledTheme } from 'shiki/themes';
1311
import { type Components, toJsxRuntime } from 'hast-util-to-jsx-runtime';
1412
import { Fragment, type ReactNode } from 'react';
1513
import { jsx, jsxs } from 'react/jsx-runtime';
14+
import { createOnigurumaEngine } from 'shiki/engine/oniguruma';
1615

1716
export function createStyleTransformer(): ShikiTransformer {
1817
return {
@@ -41,46 +40,27 @@ export type HighlightOptions = CodeToHastOptionsCommon<BundledLanguage> &
4140
components?: Partial<Components>;
4241
};
4342

44-
let instance: Promise<Highlighter> | undefined;
45-
4643
export async function highlight(
4744
code: string,
4845
options: HighlightOptions,
4946
): Promise<ReactNode> {
5047
const { lang, components, engine, ...rest } = options;
5148

52-
if (!instance) {
53-
if (!engine) {
54-
// use existing one if not specified
55-
instance = getSingletonHighlighter();
56-
} else {
57-
instance = createHighlighter({
58-
langs: [],
59-
themes: [],
60-
engine,
61-
});
62-
}
63-
}
64-
6549
let themes: CodeOptionsThemes<BundledTheme> = { themes: defaultThemes };
6650
if ('theme' in options && options.theme) {
6751
themes = { theme: options.theme };
6852
} else if ('themes' in options && options.themes) {
6953
themes = { themes: options.themes };
7054
}
7155

72-
const highlighter = await instance;
73-
await Promise.all([
74-
highlighter.loadLanguage(lang as BundledLanguage),
75-
76-
'theme' in themes
77-
? highlighter.loadTheme(themes.theme as BundledTheme)
78-
: highlighter.loadTheme(
79-
...(Object.values(themes.themes).filter(
80-
(v) => v !== undefined,
81-
) as BundledTheme[]),
82-
),
83-
]);
56+
const highlighter = await getSingletonHighlighter({
57+
langs: [lang],
58+
engine: engine ?? createOnigurumaEngine(() => import('shiki/wasm')),
59+
themes:
60+
'theme' in themes
61+
? [themes.theme]
62+
: Object.values(themes.themes).filter((v) => v !== undefined),
63+
});
8464

8565
const hast = highlighter.codeToHast(code, {
8666
lang,

packages/openapi/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@
5353
"react-hook-form": "^7.53.1",
5454
"remark": "^15.0.1",
5555
"remark-rehype": "^11.1.1",
56-
"shiki": "^1.22.1"
56+
"shiki": "^1.22.2"
5757
},
5858
"devDependencies": {
5959
"@types/js-yaml": "^4.0.9",
6060
"@types/node": "22.8.1",
6161
"@types/openapi-sampler": "^1.0.3",
6262
"@types/react": "^18.3.12",
63-
"bunchee": "^5.5.1",
63+
"bunchee": "^5.6.0",
6464
"eslint-config-custom": "workspace:*",
6565
"lucide-react": "^0.453.0",
6666
"next": "15.0.1",

packages/twoslash/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
"dependencies": {
3939
"@radix-ui/react-popover": "^1.1.2",
40-
"@shikijs/twoslash": "^1.22.1",
40+
"@shikijs/twoslash": "^1.22.2",
4141
"mdast-util-from-markdown": "^2.0.2",
4242
"mdast-util-gfm": "^3.0.0",
4343
"mdast-util-to-hast": "^13.2.0",
@@ -52,7 +52,7 @@
5252
"fumadocs-ui": "workspace:*",
5353
"postcss": "^8.4.47",
5454
"postcss-lightningcss": "^1.0.1",
55-
"shiki": "^1.22.1",
55+
"shiki": "^1.22.2",
5656
"tailwindcss": "^3.4.14",
5757
"tsconfig": "workspace:*"
5858
},

packages/typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"mdast-util-from-markdown": "^2.0.2",
4242
"mdast-util-gfm": "^3.0.0",
4343
"mdast-util-to-hast": "^13.2.0",
44-
"shiki": "^1.22.1",
44+
"shiki": "^1.22.2",
4545
"ts-morph": "^24.0.0"
4646
},
4747
"devDependencies": {

0 commit comments

Comments
 (0)