Skip to content

Commit

Permalink
feat: update grammar and themes
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Jul 21, 2024
1 parent e8d8e2b commit 91c7f01
Show file tree
Hide file tree
Showing 15 changed files with 1,614 additions and 983 deletions.
10 changes: 5 additions & 5 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
"@iconify-json/svg-spinners": "^1.1.2",
"@shikijs/transformers": "workspace:*",
"@shikijs/twoslash": "workspace:*",
"@unocss/reset": "^0.61.3",
"@unocss/reset": "^0.61.5",
"@vueuse/core": "^10.11.0",
"floating-vue": "^5.2.2",
"pinia": "^2.1.7",
"shiki": "workspace:*",
"unocss": "^0.61.3",
"unplugin-vue-components": "^0.27.2",
"vitepress": "^1.2.3",
"vue": "^3.4.31"
"unocss": "^0.61.5",
"unplugin-vue-components": "^0.27.3",
"vitepress": "^1.3.1",
"vue": "^3.4.33"
}
}
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"version": "1.10.3",
"private": true,
"packageManager": "pnpm@9.4.0",
"packageManager": "pnpm@9.5.0",
"scripts": {
"lint": "eslint . --cache",
"release": "bumpp && pnpm -r publish",
Expand All @@ -14,8 +14,8 @@
"prepare": "simple-git-hooks"
},
"devDependencies": {
"@antfu/eslint-config": "^2.22.0-beta.3",
"@antfu/ni": "^0.21.12",
"@antfu/eslint-config": "^2.23.1",
"@antfu/ni": "^0.22.0",
"@antfu/utils": "^0.7.10",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-commonjs": "^26.0.1",
Expand All @@ -30,11 +30,11 @@
"@shikijs/vitepress-twoslash": "workspace:*",
"@types/fs-extra": "^11.0.4",
"@types/hast": "^3.0.4",
"@types/node": "^20.14.10",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^20.14.11",
"@vitest/coverage-v8": "^2.0.3",
"ansi-sequence-parser": "^1.1.1",
"bumpp": "^9.4.1",
"eslint": "^9.6.0",
"eslint": "^9.7.0",
"eslint-plugin-format": "^0.1.2",
"esno": "^4.7.0",
"fast-glob": "^3.3.2",
Expand All @@ -46,25 +46,25 @@
"mdast-util-gfm": "^3.0.0",
"mdast-util-to-hast": "^13.2.0",
"ofetch": "^1.3.4",
"pnpm": "^9.4.0",
"prettier": "^3.3.2",
"rimraf": "^5.0.8",
"rollup": "^4.18.0",
"pnpm": "^9.5.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"rollup": "^4.19.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.2",
"taze": "^0.16.1",
"typescript": "^5.5.3",
"unbuild": "^2.0.0",
"vite": "^5.3.3",
"vite": "^5.3.4",
"vite-tsconfig-paths": "^4.3.2",
"vitepress-plugin-mermaid": "^2.0.16",
"vitest": "^1.6.0",
"vitest": "^2.0.3",
"vue-tsc": "^2.0.26",
"wrangler": "^3.63.1"
"wrangler": "^3.65.1"
},
"resolutions": {
"@shikijs/compat": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/monaco/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
},
"devDependencies": {
"typescript": "^5.5.3",
"vite": "^5.3.3"
"vite": "^5.3.4"
}
}
4 changes: 2 additions & 2 deletions packages/shiki/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
"@types/hast": "^3.0.4"
},
"devDependencies": {
"tm-grammars": "^1.13.7",
"tm-themes": "^1.5.1",
"tm-grammars": "^1.14.0",
"tm-themes": "^1.5.6",
"vscode-oniguruma": "^1.7.0"
}
}
10 changes: 10 additions & 0 deletions packages/shiki/src/assets/langs-bundle-full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,14 @@ export const bundledLanguagesInfo: BundledLanguageInfo[] = [
'name': 'LaTeX',
'import': (() => import('./langs/latex')) as DynamicImportLanguageRegistration
},
{
'id': 'lean',
'name': 'Lean 4',
'aliases': [
'lean4'
],
'import': (() => import('./langs/lean')) as DynamicImportLanguageRegistration
},
{
'id': 'less',
'name': 'Less',
Expand Down Expand Up @@ -1388,6 +1396,8 @@ export type BundledLanguage =
| 'kts'
| 'kusto'
| 'latex'
| 'lean'
| 'lean4'
| 'less'
| 'liquid'
| 'lisp'
Expand Down
4 changes: 2 additions & 2 deletions packages/shiki/src/assets/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ export const bundledThemesInfo: BundledThemeInfo[] = [
},
{
"id": "dracula",
"displayName": "Dracula",
"displayName": "Dracula Theme",
"type": "dark",
"import": (() => import('./themes/dracula')) as unknown as DynamicImportThemeRegistration
},
{
"id": "dracula-soft",
"displayName": "Dracula Soft",
"displayName": "Dracula Theme Soft",
"type": "dark",
"import": (() => import('./themes/dracula-soft')) as unknown as DynamicImportThemeRegistration
},
Expand Down
4 changes: 2 additions & 2 deletions packages/shiki/test/bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ it('bundle-full', async () => {
}))

expect(highlighter.getLoadedLanguages().length)
.toMatchInlineSnapshot(`296`)
.toMatchInlineSnapshot(`299`)
})

it('bundle-web', async () => {
Expand All @@ -17,5 +17,5 @@ it('bundle-web', async () => {
}))

expect(highlighter.getLoadedLanguages().length)
.toMatchInlineSnapshot(`83`)
.toMatchInlineSnapshot(`84`)
})
35 changes: 28 additions & 7 deletions packages/shiki/test/injections.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ it('injections-side-effects vue', async () => {
expect(before).not.toEqual(after)
})

// It seems that angular-html is not correctly highlighted in the recent update. Bring this back once fixed.
it.skip('injections-side-effects angular-html', async () => {
it('injections-side-effects angular-html', async () => {
const highlighter = await createHighlighterCore({
themes: [
vl,
Expand All @@ -63,7 +62,23 @@ it.skip('injections-side-effects angular-html', async () => {
],
})

const code = `<div [ ngStyle ]="{'max-width.px': i * 2 + 5}"></div>`
const code = `<h2>Hero List</h2>
<p><em>Select a hero from the list to see details.</em></p>
@if (heroes.length > 0) {
<ul>
<li *ngFor="let hero of heroes">
@let isSelected = hero === selectedHero;
<button type="button" (click)="selectHero(hero)" [class.selected]="isSelected">
{{hero.name}}
</button>
</li>
</ul>
}
<app-hero-detail *ngIf="selectedHero" [hero]="selectedHero"></app-hero-detail>
`

const before = highlighter.codeToHtml(code, { lang: 'html', theme: 'vitesse-light' })
expect(before)
Expand Down Expand Up @@ -92,6 +107,7 @@ it.skip('injections-side-effects angular-html', async () => {
"css",
"html",
"angular-expression",
"angular-let-declaration",
"angular-template",
"angular-template-blocks",
"angular-html",
Expand Down Expand Up @@ -126,10 +142,15 @@ import { CartService } from './cart.service';
type="button"
[routerLink]="'/cart'"
>
@if (cartService.length > 0) {
<div>
{{ cartService.length }}
</div>
@if (heroes.length > 0) {
<ul>
<li *ngFor="let hero of heroes">
@let isSelected = hero === selectedHero;
<button type="button" (click)="selectHero(hero)" [class.selected]="isSelected">
{{hero.name}}
</button>
</li>
</ul>
}
Cart
</button>
Expand Down

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

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

Loading

0 comments on commit 91c7f01

Please sign in to comment.