Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: fetchTheme theme 'include' directory joining for absolute paths #173

Merged
merged 4 commits into from
Aug 13, 2022

Conversation

Oblongmana
Copy link
Contributor

Combo bug report/pull request here - please review carefully when you can, I definitely may have missed things, and I've only examined this fix in the context of using it in a VSCode plugin, and in the node REPL - I haven't tested it in browser etc. I've written some extra tests too. Note though that I'm assuming loadTheme is only meant to work with absolute URLs - see my extra notes at the bottom of this post. Apologies for the wall of text!

I was using shiki to load vscode themes using absolute pargs from my local file-system, and if I called shiki.loadTheme (i.e. loader.fetchTheme) with an absolute path for a theme with an 'include' property referring to a second theme, it would try to load the second theme using only the last directory in the path of the first theme, combined with the 'include' property - e.g. if first theme was in /foo/bar/baz/bing.json and had an include for ./buzz.json, it would think the path for the second file was baz/buzz.json due to the call (join(dirname(themePath), shikiTheme.include).

So because fetchTheme would say the path for the included theme was baz/buzz.json, this would get to the _resolvePath function, it would think it was a relative path, and return path.resolve(__dirname, '..', filepath); - giving a very wrong path - in this case, assuming I'm running in /project, it would give /project/node_modules/shiki/bar/buzz.json.

An example below, where I ran this in the node REPL (having already yarn added shiki) to import the light_plus theme, which includes the light_vs theme. Should be easy to repro, assuming you are running Windows and have VSCode installed - where I'm trying to load the theme from (this is just an example - I know some of these themes are included in shiki itself!)

$ node
> shiki = require('shiki')
> shiki.loadTheme("c:\\Users\\james.000\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\theme-defaults\\themes\\light_plus.json");
Promise { <pending> }
> (node:37452) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'C:\Users\james.000\repositories\vscodeExts\salesforce-doc-lookup\node_modules\shiki\themes\light_vs.json'

Relative URLs

As far as I can tell, calling shiki.loadTheme doesn't work with with relative URLs? If I try to follow the instructions in themes.md to use a relative parg, it always seems to treat them as relative to the node_modules/shiki directory, regardless of where I run them from - likely due to the _resolvePath function prepending them with __dirname. I haven't touched that functionality at all - possibly it might be worth specifying in themes.md that custom themes must always be absolute URLs, and maybe adding a guard against it? Probably depends on whether it's meant to handle relative urls or not

@matthewjamesadam
Copy link

Hi there, I have run into the same issue this PR resolves -- specifically, loading themes directly from VSCode installations does not work because of the relative path issues outlined here. Is there any chance this PR could be merged?

@netlify
Copy link

netlify bot commented Aug 11, 2022

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit c26c14d
🔍 Latest deploy log https://app.netlify.com/sites/shiki-matsu/deploys/62f6ff4bb6c0a30008b06f2d
😎 Deploy Preview https://deploy-preview-173--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@orta
Copy link
Contributor

orta commented Aug 11, 2022

👋🏻 sorry for the super late review, trying to get a sense of why this is marked as draft?

I think supporting relative paths is a good call (think I hit this also) and your implementation is thoroughly tested and looks good to me

@Oblongmana Oblongmana marked this pull request as ready for review August 11, 2022 11:26
@Oblongmana
Copy link
Contributor Author

👋 Hey @orta - I've forgotten exactly why I marked it as draft, I think! 🙈 Reading my notes, I think I felt I'd perhaps not manually tested thoroughly enough - not enough in the browser perhaps, just in the VSCode extension context I was hacking around in?

I've removed the draft flag so it's marked ready for review. Getting late here, but I'll take a look in at those test failures tomorrow, though at a glance I'm not sure they're related to this PR? 🕵️

@orta
Copy link
Contributor

orta commented Aug 11, 2022

Yep, I bet a rebase will fix it with #335

If themeOne included themeTwo using an 'include' property, fetchTheme
would previously take ONLY the dirname component of themeOne (i.e. the
last directory in the path), and combine it with the 'included' value.
E.g. if ~/foo/bar/baz.json included `./bing.json`, fetchTheme would try
to get the include by using bar/bing,json, which wouldn't work.

This amends it to use the entire path of the original, _except_ for
whatever comes after the last dir separator. So now if
e.g. ~/foo/bar/baz.json included `./bing.json`, fetchTheme will get
the include by using `/foo/bar/bing.json`
@Oblongmana Oblongmana force-pushed the fix/theme-include-directory-joinin branch from d523998 to 42ef15f Compare August 13, 2022 00:33
@Oblongmana
Copy link
Contributor Author

Nearly there - rebased, but looks like json5 (which the new fetchtheme.test.ts used) has been replaced with jsonc-parser. Will take a look into it today 🕵️‍♂️

@Oblongmana
Copy link
Contributor Author

@orta Rebased, and updated that test - looks like we're good to go! Let me know if you need anything else 🙏

@orta
Copy link
Contributor

orta commented Aug 13, 2022

👍🏻 thanks!

@orta orta merged commit 1ad7634 into shikijs:main Aug 13, 2022
fuxingloh pushed a commit to fuxingloh/contented that referenced this pull request Sep 1, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [shiki](https://togithub.com/octref/shiki/tree/main/packages/shiki)
([source](https://togithub.com/octref/shiki)) | [`^0.11.1` ->
`^0.14.4`](https://renovatebot.com/diffs/npm/shiki/0.11.1/0.14.4) |
[![age](https://developer.mend.io/api/mc/badges/age/npm/shiki/0.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/shiki/0.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/shiki/0.11.1/0.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/shiki/0.11.1/0.14.4?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>octref/shiki (shiki)</summary>

###
[`v0.14.4`](https://togithub.com/octref/shiki/blob/HEAD/CHANGELOG.md#0144--2023-08-31)

[Compare
Source](https://togithub.com/octref/shiki/compare/v0.14.3...v0.14.4)

##### 🚀 Features & Fixes

-   feat: add ziglang
- fix: inconsistent git core.ignorecase causes marko.sample
added/removed
-   feat: add mojo lang
-   feat: add `mdc` grammar

##### 🙌 Contributions

- feat: add additional sample code |
[#&#8203;511](https://togithub.com/shikijs/shiki/pull/511) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)
- fix: Compiler errors in Node |
[#&#8203;504](https://togithub.com/shikijs/shiki/pull/504) |
[@&#8203;Gerrit0](https://togithub.com/Gerrit0)
- feat: add splunk grammar |
[#&#8203;505](https://togithub.com/shikijs/shiki/pull/505) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)
- Add bun support |
[#&#8203;493](https://togithub.com/shikijs/shiki/pull/493) |
[@&#8203;aabccd021](https://togithub.com/aabccd021)
- feat: add shellsession grammar |
[#&#8203;483](https://togithub.com/shikijs/shiki/pull/483) |
[@&#8203;mashehu](https://togithub.com/mashehu)

###
[`v0.14.3`](https://togithub.com/octref/shiki/blob/HEAD/CHANGELOG.md#0143--2023-06-25)

[Compare
Source](https://togithub.com/octref/shiki/compare/v0.14.2...v0.14.3)

##### 🚀 Features & Fixes

-   fix: exclude dark/light modern themes for now
- fix: fix unzipping issue with unzipper. fix
[#&#8203;478](https://togithub.com/octref/shiki/issues/478)

##### 🙌 Contributions

- feat: add narrat grammar |
[#&#8203;489](https://togithub.com/shikijs/shiki/pull/489) |
[@&#8203;liana-p](https://togithub.com/liana-p)
- feat: add glimmer js/ts language |
[#&#8203;486](https://togithub.com/shikijs/shiki/pull/486) |
[@&#8203;IgnaceMaes](https://togithub.com/IgnaceMaes)
- feat: add `displayName` to `BUNDLED_LANGUAGES` |
[#&#8203;470](https://togithub.com/shikijs/shiki/pull/470) |
[@&#8203;lawvs](https://togithub.com/lawvs)
- Specify langs in browser based example |
[#&#8203;477](https://togithub.com/shikijs/shiki/pull/477) |
[@&#8203;wesbos](https://togithub.com/wesbos)
- feat: add hjson |
[#&#8203;471](https://togithub.com/shikijs/shiki/pull/471) |
[@&#8203;AkaraChen](https://togithub.com/AkaraChen)
- feat: add nextflow grammar |
[#&#8203;472](https://togithub.com/shikijs/shiki/pull/472) |
[@&#8203;mashehu](https://togithub.com/mashehu)
- feat: add cypher grammar |
[#&#8203;465](https://togithub.com/shikijs/shiki/pull/465) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)
- feat: add vyper grammar |
[#&#8203;466](https://togithub.com/shikijs/shiki/pull/466) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)
- feat: add beancount grammar |
[#&#8203;468](https://togithub.com/shikijs/shiki/pull/468) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)

###
[`v0.14.2`](https://togithub.com/octref/shiki/blob/HEAD/CHANGELOG.md#0142--2023-04-28)

[Compare
Source](https://togithub.com/octref/shiki/compare/v0.14.1...v0.14.2)

##### 🚀 Features & Fixes

-   fix: improve changelog generation
-   fix: remove dlx to avoid playwright version mismatch
- feat: generate changelog. fix
[#&#8203;223](https://togithub.com/octref/shiki/issues/223)

##### 🙌 Contributions

- feat: add kusto grammar
([#&#8203;431](https://togithub.com/octref/shiki/issues/431)) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)
- Add support for the css-variables theme to ansi rendering |
[#&#8203;435](https://togithub.com/shikijs/shiki/pull/435) |
[@&#8203;blake-mealey](https://togithub.com/blake-mealey)
- feat: add wolfram grammar |
[#&#8203;464](https://togithub.com/shikijs/shiki/pull/464) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)
- feat: add c++ and golang support |
[#&#8203;459](https://togithub.com/shikijs/shiki/pull/459) |
[@&#8203;xinconan](https://togithub.com/xinconan)
- fix: avoid poisoning global scope |
[#&#8203;457](https://togithub.com/shikijs/shiki/pull/457) |
[@&#8203;Ayc0](https://togithub.com/Ayc0)
- fix(type): `theme` field autocompletion |
[#&#8203;449](https://togithub.com/shikijs/shiki/pull/449) |
[@&#8203;vaakian](https://togithub.com/vaakian)
- feat: add reg grammar |
[#&#8203;455](https://togithub.com/shikijs/shiki/pull/455) |
[@&#8203;KevinBatdorf](https://togithub.com/KevinBatdorf)
- Update Kotlin grammar and add a sample |
[#&#8203;445](https://togithub.com/shikijs/shiki/pull/445) |
[@&#8203;alllex](https://togithub.com/alllex)
- fix: marko, mdx, vue |
[#&#8203;452](https://togithub.com/shikijs/shiki/pull/452) |
[@&#8203;LeoDog896](https://togithub.com/LeoDog896)
- feat(gd\*): add gdscript family |
[#&#8203;451](https://togithub.com/shikijs/shiki/pull/451) |
[@&#8203;LeoDog896](https://togithub.com/LeoDog896)
- fix: add `protobuf` language id alias |
[#&#8203;446](https://togithub.com/shikijs/shiki/pull/446) |
[@&#8203;dimitropoulos](https://togithub.com/dimitropoulos)
- feat(lang): add alias dockerfile -> docker |
[#&#8203;444](https://togithub.com/shikijs/shiki/pull/444) |
[@&#8203;ezracelli](https://togithub.com/ezracelli)
- fix: faster parsing time for assets |
[#&#8203;443](https://togithub.com/shikijs/shiki/pull/443) |
[@&#8203;banga](https://togithub.com/banga)
- docs: update the src of VS Code Oniguruma repo |
[#&#8203;440](https://togithub.com/shikijs/shiki/pull/440) |
[@&#8203;donaldxdonald](https://togithub.com/donaldxdonald)
- docs: fix grammar of "grammar's" |
[#&#8203;442](https://togithub.com/shikijs/shiki/pull/442) |
[@&#8203;comex](https://togithub.com/comex)

***

##### 0.14.1 | 2023-02-09

- 🙌 Scrollable <pre> elements should be focusable.
[#&#8203;428](https://togithub.com/shikijs/shiki/issues/428). Thanks to
contribution from
[@&#8203;kevinleedrum](https://togithub.com/kevinleedrum).

##### 0.14.0 | 2023-01-29

- 🙌 ANSI support.
[#&#8203;386](https://togithub.com/shikijs/shiki/issues/386). Thanks to
contribution from
[@&#8203;blake-mealey](https://togithub.com/blake-mealey).

##### 0.13.0 | 2023-01-27

-   Improve grammar/theme fetching from marketplace.
- 🙌 Support CSON grammar sources.
[#&#8203;413](https://togithub.com/shikijs/shiki/issues/413). Thanks to
contribution from
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger)
-   Add a [Next.js 13 example](https://togithub.com/shikijs/next-shiki).
- Add a `bgFillOpacity` option for SVG renderer.
[#&#8203;276](https://togithub.com/shikijs/shiki/issues/276).

*Languages*

- Added `console` as an alias for `shell`.
[#&#8203;389](https://togithub.com/shikijs/shiki/issues/389).
- 🙌 Added `jison` and `wgsl` languages.
[#&#8203;413](https://togithub.com/shikijs/shiki/issues/413). Thanks to
contribution from
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger)

*Themes*

- Renamed `material-<themeName>` to `material-theme-<themeName>`. For
example, `material-ocean` to `material-theme-ocean`. `material-default`
is renamed to `material-theme`.

***

##### 0.10.1

- 🙌: feat: add ZenScript support
[#&#8203;300](https://togithub.com/shikijs/shiki/pull/300) |
**[@&#8203;jaredlll08](https://togithub.com/jaredlll08)**
- 🙌: feat: add marko language
[#&#8203;299](https://togithub.com/shikijs/shiki/pull/299) |
**[@&#8203;manan-gup](https://togithub.com/manan-gup)**
- 🙌: fix: split plaintext into lines
[#&#8203;298](https://togithub.com/shikijs/shiki/pull/298) |
**[@&#8203;silvenon](https://togithub.com/silvenon)**
- 🙌: fix(docs): fixed custom language instructions
[#&#8203;294](https://togithub.com/shikijs/shiki/pull/294) |
**[@&#8203;JuanM04](https://togithub.com/JuanM04)**
- 🙌: fix: updated astro grammar source
[#&#8203;293](https://togithub.com/shikijs/shiki/pull/293) |
**[@&#8203;JuanM04](https://togithub.com/JuanM04)**
- 🙌: feat: add rel lang
[#&#8203;287](https://togithub.com/shikijs/shiki/pull/287) |
**[@&#8203;robbear](https://togithub.com/robbear)**
- 🙌: feat: add rose pine themes
[#&#8203;282](https://togithub.com/shikijs/shiki/pull/281) |
**[@&#8203;EmeraldSnorlax](https://togithub.com/EmeraldSnorlax)**
- 🙌: feat: add stata lang
[#&#8203;281](https://togithub.com/shikijs/shiki/pull/281) |
**[@&#8203;kylebutts](kylebutts)**

**Full Changelog**:
[v0.10.0...v0.10.1](https://togithub.com/shikijs/shiki/compare/v0.10.0...v0.10.1)

***

##### 0.2.7 | 2020-11-13

- Fix color fallback issues.
[#&#8203;100](https://togithub.com/shikijs/shiki/issues/100).
- 🙌 Add Applescript grammar.
[#&#8203;99](https://togithub.com/shikijs/shiki/issues/99). Thanks to
contribution from [Arturo Galán](https://togithub.com/arturogalan).

##### 0.2.6 | 2020-09-28

-   Upgrade to onigasm 2.2.5.
-   Add Erlang grammar.
- 🙌 Add Elixir grammar.
[#&#8203;95](https://togithub.com/shikijs/shiki/issues/95). Thanks to
contribution from [Sebastien
Baudray](https://togithub.com/https://github.com/sbaudray).
- 🙌 Fix wrong escape sequence in vuepress plugin.
[#&#8203;93](https://togithub.com/shikijs/shiki/issues/93). Thanks to
contribution from [Yu Zhang](https://togithub.com/yzhang-gh).

##### 0.2.5 | 2020-09-17

- Reduce dependency size (shiki-themes is 47M).
[#&#8203;94](https://togithub.com/shikijs/shiki/issues/94).

##### 0.2.4 | 2020-09-13

-   Fix `RangeError: Invalid array length` in `vuepress-plugin-shiki`.
- 🙌 Wrap line in `<span class='line'></span>`.
[#&#8203;76](https://togithub.com/shikijs/shiki/issues/76). Thanks to
contribution from [Christoph Werner](https://togithub.com/codepunkt).

##### 0.2.3 | 2020-09-08

- Add `文言` language.
[#&#8203;88](https://togithub.com/shikijs/shiki/issues/88).
- Add `slack-theme-dark-mode` and `slack-theme-ochin` themes. Thanks to
contribution from [Christoph Werner](https://togithub.com/codepunkt).
[#&#8203;78](https://togithub.com/shikijs/shiki/pull/78).

##### 0.2.2 | 2020-08-26

-   Fix dark-plus syntax highlighting for uncolored white text.

##### 0.2.1 | 2020-08-24

- Allow custom languages for vuepress.
[#&#8203;80](https://togithub.com/shikijs/shiki/issues/80).
- Fix `php` syntax highlighting.
[#&#8203;21](https://togithub.com/shikijs/shiki/issues/21).
- Add `jinja-html` language, which embeds `jinja` language.
[#&#8203;24](https://togithub.com/shikijs/shiki/issues/24).
-   Remove `vue-html` language. Either use `vue` or `html` language.

##### 0.2.0 | 2020-08-24

-   Normalize all theme names to kebab-case.
-   Add GitHub light/dark themes.
-   Remove less popular themes.
- Add `hlsl`, `asm` (x86 Assembly), `m` (Matlab), `sas`, `d`, `dart`,
`plsql`, `logo`, , `pas` (Object Pascal/Delphi), `cobol`, `kt` (Kotlin),
`scala`, `abap`, `julia`, `scheme`, `prolog`, `ada`, `lisp`, `apex`,
`fortran`, `haskell`, `hcl`, `hack`, `awk`, `as` (ActionScript), `tcl`,
`ocaml`, `viml`, `puppet`, `jsonnet`, `smalltalk`, `cr` (Crystal), `wat`
(WASM), `nix`, `elm`, `purescript` and `svelte` languages.
-   Add `pug` language and make `jade` an alias of it.
- Use GitHub workflow to update grammars periodically.
[#&#8203;72](https://togithub.com/shikijs/shiki/issues/72).
- Use GitHub workflow to update themes periodically.
[#&#8203;71](https://togithub.com/shikijs/shiki/issues/71).
- Use theme foreground color when color of token is `undefined`.
[#&#8203;27](https://togithub.com/shikijs/shiki/issues/27).
- SVG Renderer.
[#&#8203;2](https://togithub.com/shikijs/shiki/issues/2).
- Fix HTML escaping.
[#&#8203;26](https://togithub.com/octref/shiki/issues/26) and
[#&#8203;28](https://togithub.com/octref/shiki/pull/28). Thanks to
contribution from [@&#8203;jackens](https://togithub.com/jackens).
- 🙌 Add an option to skip generating the explanation text.
[#&#8203;52](https://togithub.com/shikijs/shiki/pull/52). Thanks to
contribution from [Gerrit Birkeland](https://togithub.com/Gerrit0).
- 🙌 Improve performance by avoiding some unnecessary string copies.
[#&#8203;51](https://togithub.com/shikijs/shiki/pull/51). Thanks to
contribution from [Gerrit Birkeland](https://togithub.com/Gerrit0).
- 🙌 Allow loading custom `tmLanguage`.
[#&#8203;10](https://togithub.com/octref/shiki/issues/10) and
[#&#8203;49](https://togithub.com/octref/shiki/pull/49). Thanks to
contribution from [Orta Therox](https://togithub.com/orta) and
[@&#8203;pngwn](https://togithub.com/pngwn).
- 🙌 Update Java grammar.
[#&#8203;36](https://togithub.com/octref/shiki/issues/36) and
[#&#8203;37](https://togithub.com/octref/shiki/issues/37). Thanks to
contribution from [@&#8203;0xflotus](https://togithub.com/0xflotus).

##### 0.1.7 | 2020-04-28

-   Update to latest Dark+/Light+ theme from VS Code.

##### 0.1.6 | 2019-09-19

- Add `toml` language from https://github.com/bungcip/better-toml.
[#&#8203;20](https://togithub.com/octref/shiki/issues/20).

##### 0.1.5 | 2019-09-09

- Begin to keep a changelog.
[#&#8203;7](https://togithub.com/octref/shiki/issues/7).
- Accept `plaintext`, `text` and `txt` as `lang`. Will return `code` as
it is. [#&#8203;16](https://togithub.com/octref/shiki/issues/16).
- Add `jsonc` language.
[#&#8203;18](https://togithub.com/octref/shiki/issues/18).
- Add `csharp` language.
[#&#8203;14](https://togithub.com/octref/shiki/issues/14).
-   Add `md` as an alias for `markdown`.
-   Add `zsh` as an alias for `bash`.
-   Add `yml` as an alias for `yaml`.
- 🙌 Use json5 for parsing theme as JSONC.
[#&#8203;11](https://togithub.com/octref/shiki/issues/11). Thanks to
contribution from [Wes Bos](https://togithub.com/wesbos).

###
[`v0.14.1`](https://togithub.com/octref/shiki/blob/HEAD/CHANGELOG.md#0141--2023-02-09)

[Compare
Source](https://togithub.com/octref/shiki/compare/v0.14.0...v0.14.1)

- 🙌 Scrollable <pre> elements should be focusable.
[#&#8203;428](https://togithub.com/shikijs/shiki/issues/428). Thanks to
contribution from
[@&#8203;kevinleedrum](https://togithub.com/kevinleedrum).

###
[`v0.14.0`](https://togithub.com/octref/shiki/blob/HEAD/CHANGELOG.md#0140--2023-01-29)

[Compare
Source](https://togithub.com/octref/shiki/compare/v0.13.0...v0.14.0)

- 🙌 ANSI support.
[#&#8203;386](https://togithub.com/shikijs/shiki/issues/386). Thanks to
contribution from
[@&#8203;blake-mealey](https://togithub.com/blake-mealey).

###
[`v0.13.0`](https://togithub.com/octref/shiki/blob/HEAD/CHANGELOG.md#0130--2023-01-27)

[Compare
Source](https://togithub.com/octref/shiki/compare/3009d740b25ee2d74ca4ac6ac0e02b06bf567019...v0.13.0)

-   Improve grammar/theme fetching from marketplace.
- 🙌 Support CSON grammar sources.
[#&#8203;413](https://togithub.com/shikijs/shiki/issues/413). Thanks to
contribution from
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger)
-   Add a [Next.js 13 example](https://togithub.com/shikijs/next-shiki).
- Add a `bgFillOpacity` option for SVG renderer.
[#&#8203;276](https://togithub.com/shikijs/shiki/issues/276).

*Languages*

- Added `console` as an alias for `shell`.
[#&#8203;389](https://togithub.com/shikijs/shiki/issues/389).
- 🙌 Added `jison` and `wgsl` languages.
[#&#8203;413](https://togithub.com/shikijs/shiki/issues/413). Thanks to
contribution from
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger)

*Themes*

- Renamed `material-<themeName>` to `material-theme-<themeName>`. For
example, `material-ocean` to `material-theme-ocean`. `material-default`
is renamed to `material-theme`.

***

###
[`v0.12.1`](https://togithub.com/octref/shiki/compare/v0.12.0...3009d740b25ee2d74ca4ac6ac0e02b06bf567019)

[Compare
Source](https://togithub.com/octref/shiki/compare/v0.12.0...3009d740b25ee2d74ca4ac6ac0e02b06bf567019)

### [`v0.12.0`](https://togithub.com/shikijs/shiki/releases/tag/v0.12.0)

[Compare
Source](https://togithub.com/octref/shiki/compare/0b4eec41aab694bab82327aa9740af90054699fb...v0.12.0)

<!-- Release notes generated using configuration in .github/release.yml
at v0.12.0 -->

#### Key Changes

Updates to the core libraries used in Shiki, and a *huge* set of docs
improvements.

- feat: dependency updates incl. textmate by
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger) in
[shikijs/shiki#377
- feat: upgrade to vscode-textmate-v7. fix
[#&#8203;343](https://togithub.com/octref/shiki/issues/343) by
[@&#8203;octref](https://togithub.com/octref) in
[shikijs/shiki#361
- feat: resolve embedded languages automatically by
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger) in
[shikijs/shiki#379

#### What's Changed

- Fix: `fetchTheme` theme 'include' directory joining for absolute paths
by [@&#8203;Oblongmana](https://togithub.com/Oblongmana) in
[shikijs/shiki#173
- feat: update HCL grammar source by
[@&#8203;dbanck](https://togithub.com/dbanck) in
[shikijs/shiki#340
- Add several alias of languages by
[@&#8203;dannypsnl](https://togithub.com/dannypsnl) in
[shikijs/shiki#344
- feat: add proto grammar by
[@&#8203;ruanspies](https://togithub.com/ruanspies) in
[shikijs/shiki#352
- fix: add 'cs' alias for csharp and 'fs' alias for fsharp by
[@&#8203;mysticmind](https://togithub.com/mysticmind) in
[shikijs/shiki#353
- add imba as a shiki syntax by
[@&#8203;haikyuu](https://togithub.com/haikyuu) in
[shikijs/shiki#363
- feat(lang): Add V support + robot: update grammars by
[@&#8203;wennerryle](https://togithub.com/wennerryle) in
[shikijs/shiki#374
- feat: update/add language definitions by
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger) in
[shikijs/shiki#378
- feat: add documentation / optimize WASM loading by
[@&#8203;muenzpraeger](https://togithub.com/muenzpraeger) in
[shikijs/shiki#384

#### New Contributors

- [@&#8203;Oblongmana](https://togithub.com/Oblongmana) made their first
contribution in
[shikijs/shiki#173
- [@&#8203;dbanck](https://togithub.com/dbanck) made their first
contribution in
[shikijs/shiki#340
- [@&#8203;dannypsnl](https://togithub.com/dannypsnl) made their first
contribution in
[shikijs/shiki#344
- [@&#8203;ruanspies](https://togithub.com/ruanspies) made their first
contribution in
[shikijs/shiki#352
- [@&#8203;haikyuu](https://togithub.com/haikyuu) made their first
contribution in
[shikijs/shiki#363
- [@&#8203;wennerryle](https://togithub.com/wennerryle) made their first
contribution in
[shikijs/shiki#374
- [@&#8203;muenzpraeger](https://togithub.com/muenzpraeger) made their
first contribution in
[shikijs/shiki#377

**Full Changelog**:
shikijs/shiki@v0.11.0...v0.12.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/levaintech/contented).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi42OC4xIiwidXBkYXRlZEluVmVyIjoiMzYuNjguMSIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants