Skip to content

Re-bundled Shiki which avoids dependencies not used by TypeDoc

License

Notifications You must be signed in to change notification settings

un-ts/mini-shiki

Repository files navigation

mini-shiki

GitHub Actions Workflow Status Codecov type-coverage CodeRabbit Pull Request Reviews npm GitHub Release

Conventional Commits Renovate enabled JavaScript Style Guide Code Style: Prettier changesets

This is a re-bundled version of Shiki which strips out the dependencies which aren't necessary for TypeDoc's usage.

Note

This is an unscoped version of @gerrit0/mini-shiki, please view Gerrit0/mini-shiki#3 for more information.

TOC

Why?

Compare Shiki's dependency tree:

To this package's dependency tree:

The Shiki maintainers have declined to split up the package in a way which makes it possible to avoid these dependencies when just relying on shikijs published packages.

Releases

This package will be released and keep the same major/minor version numbers as Shiki. Patch versions will generally be the same as Shiki, but may differ if adjustments are necessary to fix compatibility issues.

ESM / CommonJS

This package is ESM, but does not use top level await, so may be required in Node 23, or Node 20.17+ with the --experimental-require-module flag.

Usage

import {
  codeToTokensWithThemes,
  createShikiInternal,
  createOnigurumaEngine,
  bundledLanguages,
  bundledThemes,
  loadBuiltinWasm,
} from 'mini-shiki'

await loadBuiltinWasm()
const shiki = await createShikiInternal({
  engine: createOnigurumaEngine(),
  langs: [bundledLanguages.typescript],
  themes: [bundledThemes['light-plus']],
})

const lines = codeToTokensWithThemes(shiki, "console.log('Hello world!')", {
  themes: { light: 'light-plus' },
  lang: 'typescript',
})

Sponsors and Backers

Sponsors

Sponsors

1stG RxTS UnTS
1stG Open Collective sponsors RxTS Open Collective sponsors UnTS Open Collective sponsors

Backers

1stG RxTS UnTS
1stG Open Collective backers RxTS Open Collective backers UnTS Open Collective backers

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

MIT © JounQin@1stG.me

About

Re-bundled Shiki which avoids dependencies not used by TypeDoc

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 6