@vuepress/plugin-shiki 2.0.0-beta.8 → 2.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- import { shikiPlugin } from './shikiPlugin';
2
- export * from './shikiPlugin';
1
+ import { shikiPlugin } from './shikiPlugin.js';
2
+ export * from './shikiPlugin.js';
3
3
  export default shikiPlugin;
package/lib/node/index.js CHANGED
@@ -1,15 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- const shikiPlugin_1 = require("./shikiPlugin");
14
- __exportStar(require("./shikiPlugin"), exports);
15
- exports.default = shikiPlugin_1.shikiPlugin;
1
+ import { shikiPlugin } from './shikiPlugin.js';
2
+ export * from './shikiPlugin.js';
3
+ export default shikiPlugin;
@@ -3,5 +3,5 @@ import type { HighlighterOptions } from 'shiki';
3
3
  /**
4
4
  * Options of @vuepress/plugin-shiki
5
5
  */
6
- export declare type ShikiPluginOptions = Pick<HighlighterOptions, 'theme' | 'langs'>;
7
- export declare const shikiPlugin: Plugin<ShikiPluginOptions>;
6
+ export type ShikiPluginOptions = Pick<HighlighterOptions, 'theme' | 'langs'>;
7
+ export declare const shikiPlugin: ({ theme, langs, }?: ShikiPluginOptions) => Plugin;
@@ -1,15 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shikiPlugin = void 0;
4
- const shiki_1 = require("shiki");
5
- const shikiPlugin = ({ theme = 'nord', langs = [], }) => ({
1
+ import { getHighlighter } from 'shiki';
2
+ export const shikiPlugin = ({ theme = 'nord', langs, } = {}) => ({
6
3
  name: '@vuepress/plugin-shiki',
7
- async extendsMarkdown(md) {
8
- const highlighter = await shiki_1.getHighlighter({
4
+ extendsMarkdown: async (md) => {
5
+ const highlighter = await getHighlighter({
9
6
  theme,
10
7
  langs,
11
8
  });
12
- md.options.highlight = (code, lang) => highlighter.codeToHtml(code, lang);
9
+ md.options.highlight = (code, lang) => highlighter.codeToHtml(code, {
10
+ lang,
11
+ });
13
12
  },
14
13
  });
15
- exports.shikiPlugin = shikiPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/plugin-shiki",
3
- "version": "2.0.0-beta.8",
3
+ "version": "2.0.0-rc.0",
4
4
  "description": "VuePress plugin - shiki",
5
5
  "keywords": [
6
6
  "vuepress-plugin",
@@ -19,21 +19,25 @@
19
19
  },
20
20
  "license": "MIT",
21
21
  "author": "meteorlxy",
22
- "main": "lib/node/index.js",
23
- "types": "lib/node/index.d.ts",
22
+ "type": "module",
23
+ "exports": {
24
+ ".": "./lib/node/index.js",
25
+ "./package.json": "./package.json"
26
+ },
27
+ "main": "./lib/node/index.js",
28
+ "types": "./lib/node/index.d.ts",
24
29
  "files": [
25
30
  "lib"
26
31
  ],
27
- "scripts": {
28
- "build": "tsc -b tsconfig.build.json",
29
- "clean": "rimraf lib *.tsbuildinfo"
30
- },
31
32
  "dependencies": {
32
- "@vuepress/core": "2.0.0-beta.8",
33
- "shiki": "^0.9.3"
33
+ "shiki": "^0.14.5",
34
+ "@vuepress/core": "2.0.0-rc.0"
34
35
  },
35
36
  "publishConfig": {
36
37
  "access": "public"
37
38
  },
38
- "gitHead": "5ab99126fcaecb845248fcf9d3c88c25ce8572cb"
39
- }
39
+ "scripts": {
40
+ "build": "tsc -b tsconfig.build.json",
41
+ "clean": "rimraf lib *.tsbuildinfo"
42
+ }
43
+ }
package/CHANGELOG.md DELETED
@@ -1,43 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [2.0.0-beta.8](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.7...v2.0.0-beta.8) (2021-04-11)
7
-
8
-
9
- ### Code Refactoring
10
-
11
- * normalize themes and plugins structure ([7781172](https://github.com/vuepress/vuepress-next/commit/77811722401bf1ed1fec44c64158ab0cd1ab3179))
12
-
13
-
14
- ### BREAKING CHANGES
15
-
16
- * client API that provided by plugins should be imported from `plugin-foo/lib/client`
17
-
18
-
19
-
20
-
21
-
22
- # [2.0.0-beta.7](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.6...v2.0.0-beta.7) (2021-04-09)
23
-
24
- **Note:** Version bump only for package @vuepress/plugin-shiki
25
-
26
-
27
-
28
-
29
-
30
- # [2.0.0-beta.6](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.5...v2.0.0-beta.6) (2021-03-26)
31
-
32
- **Note:** Version bump only for package @vuepress/plugin-shiki
33
-
34
-
35
-
36
-
37
-
38
- # [2.0.0-beta.5](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.4...v2.0.0-beta.5) (2021-03-26)
39
-
40
-
41
- ### Features
42
-
43
- * **plugin-shiki:** add shiki plugin ([66bbcbd](https://github.com/vuepress/vuepress-next/commit/66bbcbde497cca525fc585b4046b11784e8d61bc))