@mdit-vue/shared 0.3.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [0.6.0](https://github.com/mdit-vue/mdit-vue/compare/v0.5.0...v0.6.0) (2022-07-11)
7
+
8
+ ### Features
9
+
10
+ - **types:** extract types from shared package ([5fc56ce](https://github.com/mdit-vue/mdit-vue/commit/5fc56ce6439159584e09e13ca9a6e87abe8f4389))
11
+
12
+ # [0.5.0](https://github.com/mdit-vue/mdit-vue/compare/v0.4.0...v0.5.0) (2022-07-06)
13
+
14
+ **Note:** Version bump only for package @mdit-vue/shared
15
+
16
+ # [0.4.0](https://github.com/mdit-vue/mdit-vue/compare/v0.3.1...v0.4.0) (2022-07-02)
17
+
18
+ **Note:** Version bump only for package @mdit-vue/shared
19
+
6
20
  # [0.3.0](https://github.com/mdit-vue/mdit-vue/compare/v0.2.0...v0.3.0) (2022-06-25)
7
21
 
8
22
  ### Features
package/README.md CHANGED
@@ -1,32 +1,11 @@
1
1
  # @mdit-vue/shared
2
2
 
3
- [![npm](https://badgen.net/npm/v/@mdit-vue/shared)](https://www.npmjs.com/package/@mdit-vue/plugin-sfc)
3
+ [![npm](https://badgen.net/npm/v/@mdit-vue/shared)](https://www.npmjs.com/package/@mdit-vue/shared)
4
4
 
5
- Shared utils and types of mdit-vue.
5
+ Shared utils of mdit-vue.
6
6
 
7
7
  ## Install
8
8
 
9
9
  ```sh
10
10
  npm i @mdit-vue/shared
11
11
  ```
12
-
13
- ## Usage
14
-
15
- Add more properties to `env` via [TypeScript module augmentation](https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation):
16
-
17
- ```ts
18
- declare module '@mdit-vue/shared' {
19
- interface MarkdownItEnv {
20
- foo?: string[];
21
- }
22
- }
23
- ```
24
-
25
- ```ts
26
- import MarkdownIt from 'markdown-it';
27
- import type { MarkdownItEnv } from '@mdit-vue/shared';
28
-
29
- const md = MarkdownIt({ html: true });
30
- const env: MarkdownItEnv = {};
31
- const rendered = md.render('raw markdown text', env);
32
- ```
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { MarkdownItHeader } from '@mdit-vue/types';
1
2
  import Token from 'markdown-it/lib/token';
2
3
 
3
4
  /**
@@ -10,15 +11,6 @@ declare const htmlEscape: (str: string) => string;
10
11
  */
11
12
  declare const htmlUnescape: (str: string) => string;
12
13
 
13
- interface MarkdownItEnv {
14
- }
15
- interface MarkdownItHeader {
16
- level: number;
17
- title: string;
18
- slug: string;
19
- children: MarkdownItHeader[];
20
- }
21
-
22
14
  /**
23
15
  * Resolve headers from markdown-it tokens
24
16
  */
@@ -45,4 +37,4 @@ declare const resolveTitleFromToken: (token: Token, { shouldAllowHtml, shouldEsc
45
37
  */
46
38
  declare const slugify: (str: string) => string;
47
39
 
48
- export { MarkdownItEnv, MarkdownItHeader, htmlEscape, htmlUnescape, resolveHeadersFromTokens, resolveTitleFromToken, slugify };
40
+ export { htmlEscape, htmlUnescape, resolveHeadersFromTokens, resolveTitleFromToken, slugify };
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@mdit-vue/shared",
3
- "version": "0.3.0",
3
+ "version": "0.6.0",
4
4
  "description": "Shared utils and types of mdit-vue",
5
5
  "keywords": [
6
6
  "markdown-it",
7
- "vue"
7
+ "vue",
8
+ "utils"
8
9
  ],
9
10
  "homepage": "https://github.com/mdit-vue",
10
11
  "bugs": {
@@ -31,16 +32,17 @@
31
32
  "test": "vitest"
32
33
  },
33
34
  "dependencies": {
35
+ "@mdit-vue/types": "0.6.0",
34
36
  "@types/markdown-it": "^12.2.3",
35
37
  "markdown-it": "^13.0.1"
36
38
  },
37
39
  "devDependencies": {
38
40
  "c8": "^7.11.3",
39
41
  "unbuild": "^0.7.4",
40
- "vitest": "^0.15.2"
42
+ "vitest": "^0.18.0"
41
43
  },
42
44
  "publishConfig": {
43
45
  "access": "public"
44
46
  },
45
- "gitHead": "bcbfd4705d747ee71d6c7c32f8be6155261e9c90"
47
+ "gitHead": "654a3a4d52f4fb9711bf5f7ba3674ff58ec663bf"
46
48
  }
package/src/index.ts CHANGED
@@ -3,4 +3,3 @@ export * from './html-unescape';
3
3
  export * from './resolve-headers-from-tokens';
4
4
  export * from './resolve-title-from-token';
5
5
  export * from './slugify';
6
- export * from './types';
@@ -1,6 +1,6 @@
1
+ import type { MarkdownItHeader } from '@mdit-vue/types';
1
2
  import type Token from 'markdown-it/lib/token';
2
3
  import { resolveTitleFromToken } from './resolve-title-from-token';
3
- import type { MarkdownItHeader } from './types';
4
4
 
5
5
  /**
6
6
  * Resolve headers from markdown-it tokens
package/src/types.ts DELETED
@@ -1,11 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
2
- export interface MarkdownItEnv {
3
- // to be extended with module augmentation
4
- }
5
-
6
- export interface MarkdownItHeader {
7
- level: number;
8
- title: string;
9
- slug: string;
10
- children: MarkdownItHeader[];
11
- }