@mdit-vue/plugin-frontmatter 3.0.1 → 4.0.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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ npm i @mdit-vue/plugin-frontmatter
20
20
 
21
21
  ```ts
22
22
  import { frontmatterPlugin } from '@mdit-vue/plugin-frontmatter';
23
- import type { MarkdownItEnv } from '@mdit-vue/types';
23
+ import type { Env } from 'markdown-it';
24
24
  import MarkdownIt from 'markdown-it';
25
25
 
26
26
  const md = MarkdownIt({ html: true }).use(frontmatterPlugin, {
@@ -30,7 +30,7 @@ const md = MarkdownIt({ html: true }).use(frontmatterPlugin, {
30
30
  excerpt_separator: '<!-- more -->',
31
31
  },
32
32
  });
33
- const env: MarkdownItEnv = {};
33
+ const env: Env = {};
34
34
 
35
35
  const rendered = md.render(
36
36
  `\
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  import grayMatter from "gray-matter";
2
- import { PluginWithOptions } from "markdown-it";
3
-
4
- //#region src/types.d.ts
2
+ import { MarkdownItPlugin } from "@mdit-vue/types";
5
3
  type GrayMatterOptions = grayMatter.GrayMatterOption<string, GrayMatterOptions>;
6
4
  /**
7
5
  * Options of @mdit-vue/plugin-frontmatter
@@ -20,8 +18,8 @@ interface FrontmatterPluginOptions {
20
18
  */
21
19
  renderExcerpt?: boolean;
22
20
  }
23
- declare module '@mdit-vue/types' {
24
- interface MarkdownItEnv {
21
+ declare module 'markdown-it' {
22
+ interface Env {
25
23
  /**
26
24
  * The raw Markdown content without frontmatter
27
25
  */
@@ -39,13 +37,10 @@ declare module '@mdit-vue/types' {
39
37
  frontmatter?: Record<string, unknown>;
40
38
  }
41
39
  }
42
- //#endregion
43
- //#region src/frontmatter-plugin.d.ts
44
40
  /**
45
41
  * Get markdown frontmatter and excerpt
46
42
  *
47
43
  * Extract them into env
48
44
  */
49
- declare const frontmatterPlugin: PluginWithOptions<FrontmatterPluginOptions>;
50
- //#endregion
51
- export { FrontmatterPluginOptions, frontmatterPlugin };
45
+ export declare const frontmatterPlugin: MarkdownItPlugin<FrontmatterPluginOptions>;
46
+ export type { FrontmatterPluginOptions };
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import grayMatter from "gray-matter";
2
-
3
- //#region src/frontmatter-plugin.ts
2
+ // src/frontmatter-plugin.ts
4
3
  /**
5
4
  * Get markdown frontmatter and excerpt
6
5
  *
@@ -19,6 +18,4 @@ const frontmatterPlugin = (md, { grayMatterOptions, renderExcerpt = true } = {})
19
18
  return parse(content, env);
20
19
  };
21
20
  };
22
-
23
- //#endregion
24
- export { frontmatterPlugin };
21
+ export { frontmatterPlugin };
package/package.json CHANGED
@@ -1,54 +1,52 @@
1
1
  {
2
2
  "name": "@mdit-vue/plugin-frontmatter",
3
- "version": "3.0.1",
3
+ "version": "4.0.0",
4
4
  "description": "A markdown-it plugin to get markdown frontmatter",
5
5
  "keywords": [
6
+ "excerpt",
7
+ "frontmatter",
6
8
  "markdown-it",
7
9
  "markdown-it-plugin",
8
- "vue",
9
- "frontmatter",
10
- "excerpt"
10
+ "vue"
11
11
  ],
12
12
  "homepage": "https://github.com/mdit-vue",
13
13
  "bugs": {
14
14
  "url": "https://github.com/mdit-vue/mdit-vue/issues"
15
15
  },
16
+ "license": "MIT",
17
+ "author": "meteorlxy <meteor.lxy@foxmail.com>",
16
18
  "repository": {
17
19
  "type": "git",
18
20
  "url": "git+https://github.com/mdit-vue/mdit-vue.git"
19
21
  },
20
- "license": "MIT",
21
- "author": "meteorlxy <meteor.lxy@foxmail.com>",
22
+ "files": [
23
+ "./dist"
24
+ ],
22
25
  "type": "module",
26
+ "types": "./dist/index.d.ts",
23
27
  "exports": {
24
28
  ".": "./dist/index.js",
25
29
  "./package.json": "./package.json"
26
30
  },
27
- "main": "./dist/index.js",
28
- "module": "./dist/index.js",
29
- "types": "./dist/index.d.ts",
30
- "files": [
31
- "./dist"
32
- ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
33
34
  "scripts": {
34
35
  "build": "tsdown",
36
+ "clean": "rimraf ./dist",
35
37
  "test": "vitest"
36
38
  },
37
39
  "dependencies": {
38
- "@mdit-vue/types": "3.0.1",
39
- "@types/markdown-it": "^14.1.2",
40
+ "@mdit-vue/types": "4.0.0",
40
41
  "gray-matter": "^4.0.3",
41
- "markdown-it": "^14.1.0"
42
+ "markdown-it": "^15.0.3"
42
43
  },
43
44
  "devDependencies": {
44
- "tsdown": "^0.14.0",
45
- "vitest": "^3.2.4"
45
+ "tsdown": "^0.23.7",
46
+ "vitest": "^5.1.0"
46
47
  },
47
48
  "engines": {
48
- "node": ">=20.0.0"
49
- },
50
- "publishConfig": {
51
- "access": "public"
49
+ "node": ">=20.19.0"
52
50
  },
53
- "gitHead": "cdffe386ef7b897f1bf878ce20e38bdd07908fb1"
51
+ "gitHead": "62f17856a1a5dec0e33c6487453a927b82a5883b"
54
52
  }