Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: shikijs/shiki
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.10.1
Choose a base ref
...
head repository: shikijs/shiki
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.10.2
Choose a head ref
  • 6 commits
  • 23 files changed
  • 1 contributor

Commits on Jul 7, 2024

  1. fix(core): external @types/hast dep

    fix #713
    antfu committed Jul 7, 2024
    Copy the full SHA
    65b20f5 View commit details
  2. feat: update grammars

    antfu committed Jul 7, 2024
    Copy the full SHA
    317be40 View commit details
  3. chore: lint

    antfu committed Jul 7, 2024
    Copy the full SHA
    df95518 View commit details
  4. chore: fix types bundling

    antfu committed Jul 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    af71314 View commit details
  5. chore: update snap

    antfu committed Jul 7, 2024
    Copy the full SHA
    55053e9 View commit details
  6. chore: release v1.10.2

    antfu committed Jul 7, 2024
    Copy the full SHA
    9013316 View commit details
2 changes: 2 additions & 0 deletions docs/guide/transformers.md
Original file line number Diff line number Diff line change
@@ -67,6 +67,8 @@ Transformers can also access markdown 'meta' strings in [supported integrations]

You can access the raw meta using:

<!-- eslint-skip -->

```ts
options.meta
// => { meta: 'here', __raw: 'meta=here' }
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -14,12 +14,12 @@
"@iconify-json/svg-spinners": "^1.1.2",
"@shikijs/transformers": "workspace:*",
"@shikijs/twoslash": "workspace:*",
"@unocss/reset": "^0.61.0",
"@unocss/reset": "^0.61.2",
"@vueuse/core": "^10.11.0",
"floating-vue": "^5.2.2",
"pinia": "^2.1.7",
"shiki": "workspace:*",
"unocss": "^0.61.0",
"unocss": "^0.61.2",
"unplugin-vue-components": "^0.27.2",
"vitepress": "^1.2.3",
"vue": "^3.4.31"
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"private": true,
"packageManager": "pnpm@9.4.0",
"scripts": {
@@ -14,7 +14,7 @@
"prepare": "simple-git-hooks"
},
"devDependencies": {
"@antfu/eslint-config": "^2.21.2",
"@antfu/eslint-config": "^2.22.0-beta.2",
"@antfu/ni": "^0.21.12",
"@antfu/utils": "^0.7.10",
"@rollup/plugin-alias": "^5.1.0",
@@ -30,7 +30,7 @@
"@shikijs/vitepress-twoslash": "workspace:*",
"@types/fs-extra": "^11.0.4",
"@types/hast": "^3.0.4",
"@types/node": "^20.14.9",
"@types/node": "^20.14.10",
"@vitest/coverage-v8": "^1.6.0",
"ansi-sequence-parser": "^1.1.1",
"bumpp": "^9.4.1",
@@ -48,23 +48,23 @@
"ofetch": "^1.3.4",
"pnpm": "^9.4.0",
"prettier": "^3.3.2",
"rimraf": "^5.0.7",
"rimraf": "^5.0.8",
"rollup": "^4.18.0",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"rollup-plugin-typescript2": "^0.36.0",
"shiki": "workspace:*",
"simple-git-hooks": "^2.11.1",
"taze": "^0.14.1",
"taze": "^0.14.2",
"typescript": "^5.5.3",
"unbuild": "^2.0.0",
"vite": "^5.3.2",
"vite": "^5.3.3",
"vite-tsconfig-paths": "^4.3.2",
"vitepress-plugin-mermaid": "^2.0.16",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.24",
"wrangler": "^3.62.0"
"vue-tsc": "^2.0.26",
"wrangler": "^3.63.1"
},
"resolutions": {
"@shikijs/compat": "workspace:*",
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/cli",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "Shiki in the command line",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/compat/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/compat",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "Shiki v0.x compatible API",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
5 changes: 4 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/core",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "Core of Shiki",
"author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
@@ -65,6 +65,9 @@
"prepublishOnly": "nr build",
"test": "vitest"
},
"dependencies": {
"@types/hast": "^3.0.4"
},
"devDependencies": {
"hast-util-to-html": "^9.0.1",
"vscode-oniguruma": "^1.7.0"
4 changes: 3 additions & 1 deletion packages/core/rollup.config.mjs
Original file line number Diff line number Diff line change
@@ -71,7 +71,9 @@ export default defineConfig([
if (!/Circular|an empty chunk/.test(warning.message))
warn(warning)
},
external: [],
external: [
'hast',
],
},
])

2 changes: 1 addition & 1 deletion packages/core/src/oniguruma/onig.ts
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ export default async function main(init: Instantiator): Promise<IOnigBinding> {
updateGlobalBufferAndViews(wasmMemory.buffer)
return 1
}
catch (e) {}
catch {}
}
function _emscripten_resize_heap(requestedSize: number) {
const oldSize = binding.HEAPU8.length
2 changes: 1 addition & 1 deletion packages/markdown-it/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/markdown-it",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "markdown-it integration for shiki",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
2 changes: 1 addition & 1 deletion packages/monaco/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/monaco",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "Use Shiki for Monaco Editor",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
4 changes: 2 additions & 2 deletions packages/monaco/playground/package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@
"play": "vite"
},
"devDependencies": {
"typescript": "^5.5.2",
"vite": "^5.3.2"
"typescript": "^5.5.3",
"vite": "^5.3.3"
}
}
2 changes: 1 addition & 1 deletion packages/rehype/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/rehype",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "rehype integration for shiki",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
9 changes: 5 additions & 4 deletions packages/shiki/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "shiki",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "A beautiful Syntax Highlighter.",
"author": "Pine Wu <octref@gmail.com>; Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
@@ -100,11 +100,12 @@
"test:cf": "wrangler dev test/cf.ts --port 60001"
},
"dependencies": {
"@shikijs/core": "workspace:*"
"@shikijs/core": "workspace:*",
"@types/hast": "^3.0.4"
},
"devDependencies": {
"tm-grammars": "^1.13.0",
"tm-themes": "^1.5.0",
"tm-grammars": "^1.13.6",
"tm-themes": "^1.5.1",
"vscode-oniguruma": "^1.7.0"
}
}
16 changes: 10 additions & 6 deletions packages/shiki/src/assets/langs-bundle-web.ts
Original file line number Diff line number Diff line change
@@ -48,11 +48,6 @@ export const bundledLanguagesInfo: BundledLanguageInfo[] = [
'name': 'CSS',
'import': (() => import('./langs/css')) as DynamicImportLanguageRegistration
},
{
'id': 'edge',
'name': 'Edge',
'import': (() => import('./langs/edge')) as DynamicImportLanguageRegistration
},
{
'id': 'glsl',
'name': 'GLSL',
@@ -219,6 +214,14 @@ export const bundledLanguagesInfo: BundledLanguageInfo[] = [
'name': 'R',
'import': (() => import('./langs/r')) as DynamicImportLanguageRegistration
},
{
'id': 'regexp',
'name': 'RegExp',
'aliases': [
'regex'
],
'import': (() => import('./langs/regexp')) as DynamicImportLanguageRegistration
},
{
'id': 'ruby',
'name': 'Ruby',
@@ -335,7 +338,6 @@ export type BundledLanguage =
| 'coffeescript'
| 'cpp'
| 'css'
| 'edge'
| 'glsl'
| 'gql'
| 'graphql'
@@ -373,6 +375,8 @@ export type BundledLanguage =
| 'python'
| 'r'
| 'rb'
| 'regex'
| 'regexp'
| 'ruby'
| 'sass'
| 'scss'
1 change: 1 addition & 0 deletions packages/shiki/src/bundle-full.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import type { BundledTheme } from './themes'
import { bundledLanguages } from './assets/langs-bundle-full'
import { bundledThemes } from './themes'
import { getWasmInlined } from './wasm-dynamic'
import type {} from 'hast'

export * from './core'
export * from './themes'
1 change: 1 addition & 0 deletions packages/shiki/src/bundle-web.ts
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@ import type { BundledTheme } from './themes'
import { bundledLanguages } from './assets/langs-bundle-web'
import { bundledThemes } from './themes'
import { getWasmInlined } from './wasm-dynamic'
import type {} from 'hast'

export * from './core'
export * from './themes'
2 changes: 1 addition & 1 deletion packages/shiki/test/bundle.test.ts
Original file line number Diff line number Diff line change
@@ -17,5 +17,5 @@ it('bundle-web', async () => {
}))

expect(highlighter.getLoadedLanguages().length)
.toMatchInlineSnapshot(`82`)
.toMatchInlineSnapshot(`83`)
})
2 changes: 2 additions & 0 deletions packages/shiki/test/core.test.ts
Original file line number Diff line number Diff line change
@@ -72,11 +72,13 @@ describe('should', () => {
expect(shiki.getLoadedLanguages())
.toMatchInlineSnapshot(`
[
"regexp",
"sql",
"c",
"glsl",
"cpp-macro",
"cpp",
"regex",
"c++",
]
`)
2 changes: 1 addition & 1 deletion packages/shiki/test/hast.test.ts
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import { toHtml } from 'hast-util-to-html'
import { codeToHtml, createHighlighter } from '../src'

afterEach(() => {
vi.restoreAllMocks
vi.restoreAllMocks()
})

describe('should', () => {
2 changes: 1 addition & 1 deletion packages/transformers/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/transformers",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "Collective of common transformers transformers for Shiki",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
4 changes: 2 additions & 2 deletions packages/twoslash/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/twoslash",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "Shiki transformer for twoslash",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
@@ -63,6 +63,6 @@
"@iconify-json/codicon": "^1.1.49",
"@shikijs/twoslash": "^3.1.2",
"hast-util-from-html": "^2.0.1",
"typescript": "^5.5.2"
"typescript": "^5.5.3"
}
}
2 changes: 1 addition & 1 deletion packages/vitepress-twoslash/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@shikijs/vitepress-twoslash",
"type": "module",
"version": "1.10.1",
"version": "1.10.2",
"description": "Enable Twoslash support in VitePress",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
Loading