Skip to content

Commit

Permalink
feat: sub-reexport for shiki
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 12, 2024
1 parent 45e24f8 commit 5debf9d
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/engine-oniguruma/src/wasm-inlined.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-expect-error this will be compiled to ArrayBuffer
import type { WebAssemblyInstantiator } from '@shikijs/types'
// @ts-expect-error this will be compiled to ArrayBuffer
import binary from 'vscode-oniguruma/release/onig.wasm'

export const wasmBinary = binary as ArrayBuffer
Expand Down
23 changes: 23 additions & 0 deletions packages/shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@
"types": "./dist/theme-css-variables.d.mts",
"default": "./dist/theme-css-variables.mjs"
},
"./engine/javascript": {
"types": "./dist/engine-javascript.d.mts",
"default": "./dist/engine-javascript.mjs"
},
"./engine/oniguruma": {
"types": "./dist/engine-oniguruma.d.mts",
"default": "./dist/engine-oniguruma.mjs"
},
"./textmate": {
"types": "./dist/textmate.d.mts",
"default": "./dist/textmate.mjs"
},
"./bundle/full": {
"types": "./dist/bundle-full.d.mts",
"default": "./dist/bundle-full.mjs"
Expand Down Expand Up @@ -79,6 +91,15 @@
"bundle/web": [
"./dist/bundle-web.d.mts"
],
"engine/javascript": [
"./dist/engine-javascript.d.mts"
],
"engine/oniguruma": [
"./dist/engine-oniguruma.d.mts"
],
"textmate": [
"./dist/textmate.d.mts"
],
"theme-css-variables": [
"./dist/theme-css-variables.d.mts"
],
Expand All @@ -101,6 +122,8 @@
},
"dependencies": {
"@shikijs/core": "workspace:*",
"@shikijs/engine-javascript": "workspace:*",
"@shikijs/engine-oniguruma": "workspace:*",
"@shikijs/types": "workspace:*",
"@shikijs/vscode-textmate": "catalog:",
"@types/hast": "catalog:"
Expand Down
6 changes: 6 additions & 0 deletions packages/shiki/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,19 @@ const entries = [
'src/bundle-full.ts',
'src/bundle-web.ts',
'src/theme-css-variables.ts',
'src/engine-javascript.ts',
'src/engine-oniguruma.ts',
'src/textmate.ts',
]

const external = [
'@shikijs/types',
'@shikijs/core',
'@shikijs/core/wasm-inlined',
'@shikijs/core/types',
'@shikijs/engine-javascript',
'@shikijs/engine-oniguruma',
'@shikijs/vscode-textmate',
'shiki/wasm',
]

Expand Down
1 change: 1 addition & 0 deletions packages/shiki/src/engine-javascript.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@shikijs/engine-javascript'
1 change: 1 addition & 0 deletions packages/shiki/src/engine-oniguruma.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@shikijs/engine-oniguruma'
1 change: 1 addition & 0 deletions packages/shiki/src/textmate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from '@shikijs/vscode-textmate'
6 changes: 6 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5debf9d

Please sign in to comment.