@nuxtjs/mdc 0.8.1 → 0.8.3

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.
@@ -0,0 +1,66 @@
1
+ import { BuiltinTheme, Highlighter as Highlighter$1, ShikiTransformer, HighlighterCore } from 'shiki';
2
+ import { Processor } from 'unified';
3
+ import { ElementContent } from 'hast';
4
+
5
+ type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
6
+ interface HighlighterOptions {
7
+ highlights?: number[];
8
+ meta?: string;
9
+ }
10
+ interface HighlightResult {
11
+ tree: ElementContent[];
12
+ className?: string;
13
+ style?: string;
14
+ inlineStyle?: string;
15
+ }
16
+ type Highlighter = (code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Promise<HighlightResult>;
17
+ interface RehypeHighlightOption {
18
+ theme?: MdcThemeOptions;
19
+ highlighter?: Highlighter;
20
+ }
21
+
22
+ type Awaitable<T> = T | Promise<T>;
23
+ interface MdcConfig {
24
+ /**
25
+ * Hooks for the unified markdown pipeline
26
+ */
27
+ unified?: {
28
+ /**
29
+ * Custom setup for unified processor before other plugins
30
+ */
31
+ pre?: (processor: Processor) => Awaitable<void | Processor>;
32
+ /**
33
+ * Custom setup for unified processor after remark but before rehype
34
+ */
35
+ remark?: (processor: Processor) => Awaitable<void | Processor>;
36
+ /**
37
+ * Custom setup for unified processor after rehype
38
+ */
39
+ rehype?: (processor: Processor) => Awaitable<void | Processor>;
40
+ /**
41
+ * Custom setup for unified processor after all plugins
42
+ */
43
+ post?: (processor: Processor) => Awaitable<void | Processor>;
44
+ };
45
+ /**
46
+ * Custom hightlighter, available when `highlighter` is set to `custom`
47
+ */
48
+ highlighter?: Highlighter$1;
49
+ /**
50
+ * Hooks for shiki
51
+ */
52
+ shiki?: {
53
+ /**
54
+ * Get transformers for shiki
55
+ */
56
+ transformers?: ShikiTransformer[] | ((code: string, lang: string, theme: MdcThemeOptions, options: Partial<HighlighterOptions>) => Awaitable<ShikiTransformer[]>);
57
+ /**
58
+ * Custom setup for shiki instance, only called once on server or client
59
+ */
60
+ setup?: (highlighter: HighlighterCore) => Awaitable<void>;
61
+ };
62
+ }
63
+
64
+ declare function defineConfig(config: MdcConfig): MdcConfig;
65
+
66
+ export { type Awaitable as A, type HighlighterOptions as H, type MdcConfig as M, type RehypeHighlightOption as R, type MdcThemeOptions as a, type HighlightResult as b, type Highlighter as c, defineConfig as d };
package/dist/types.d.mts CHANGED
@@ -1,17 +1 @@
1
-
2
- import type { ModuleOptions } from './module.js'
3
-
4
-
5
-
6
- declare module '@nuxt/schema' {
7
- interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
8
- interface NuxtOptions { ['mdc']?: ModuleOptions }
9
- }
10
-
11
- declare module 'nuxt/schema' {
12
- interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
13
- interface NuxtOptions { ['mdc']?: ModuleOptions }
14
- }
15
-
16
-
17
- export type { DefaultHighlightLangs, ModuleOptions, UnistPlugin, default } from './module.js'
1
+ export { type Awaitable, type HighlightResult, type Highlighter, type HighlighterOptions, type defineConfig } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1,17 +1 @@
1
-
2
- import type { ModuleOptions } from './module'
3
-
4
-
5
-
6
- declare module '@nuxt/schema' {
7
- interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
8
- interface NuxtOptions { ['mdc']?: ModuleOptions }
9
- }
10
-
11
- declare module 'nuxt/schema' {
12
- interface NuxtConfig { ['mdc']?: Partial<ModuleOptions> }
13
- interface NuxtOptions { ['mdc']?: ModuleOptions }
14
- }
15
-
16
-
17
- export type { DefaultHighlightLangs, ModuleOptions, UnistPlugin, default } from './module'
1
+ export { type Awaitable, type HighlightResult, type Highlighter, type HighlighterOptions, type defineConfig } from './module'
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nuxtjs/mdc",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Nuxt MDC module",
5
5
  "repository": "nuxt-modules/mdc",
6
6
  "license": "MIT",
7
7
  "type": "module",
8
8
  "exports": {
9
9
  ".": {
10
- "types": "./dist/types.d.ts",
10
+ "types": "./dist/module.d.ts",
11
11
  "import": "./dist/module.mjs",
12
12
  "require": "./dist/module.cjs"
13
13
  },
@@ -71,11 +71,11 @@
71
71
  "test:watch": "vitest watch"
72
72
  },
73
73
  "dependencies": {
74
- "@nuxt/kit": "^3.12.1",
75
- "@shikijs/transformers": "^1.6.4",
74
+ "@nuxt/kit": "^3.12.2",
75
+ "@shikijs/transformers": "^1.10.0",
76
76
  "@types/hast": "^3.0.4",
77
77
  "@types/mdast": "^4.0.4",
78
- "@vue/compiler-core": "^3.4.27",
78
+ "@vue/compiler-core": "^3.4.31",
79
79
  "consola": "^3.2.3",
80
80
  "debug": "^4.3.5",
81
81
  "defu": "^6.1.4",
@@ -100,9 +100,9 @@
100
100
  "remark-parse": "^11.0.0",
101
101
  "remark-rehype": "^11.1.0",
102
102
  "scule": "^1.3.0",
103
- "shiki": "^1.6.4",
103
+ "shiki": "^1.10.0",
104
104
  "ufo": "^1.5.3",
105
- "unified": "^11.0.4",
105
+ "unified": "^11.0.5",
106
106
  "unist-builder": "^4.0.0",
107
107
  "unist-util-visit": "^5.0.0",
108
108
  "unwasm": "^0.3.9"
@@ -110,21 +110,22 @@
110
110
  "devDependencies": {
111
111
  "@nuxt/devtools": "latest",
112
112
  "@nuxt/eslint-config": "^0.3.13",
113
- "@nuxt/module-builder": "^0.7.1",
114
- "@nuxt/schema": "^3.12.1",
113
+ "@nuxt/module-builder": "^0.8.1",
114
+ "@nuxt/schema": "^3.12.2",
115
115
  "@nuxt/test-utils": "^3.13.1",
116
- "@nuxt/ui": "^2.16.0",
117
- "@types/node": "^20.14.2",
116
+ "@nuxt/ui": "^2.17.0",
117
+ "@nuxtjs/mdc": "link:.",
118
+ "@types/node": "^20.14.9",
118
119
  "changelogen": "^0.5.5",
119
- "eslint": "^9.4.0",
120
- "nuxt": "^3.12.1",
120
+ "eslint": "^9.6.0",
121
+ "nuxt": "^3.12.2",
121
122
  "rehype": "^13.0.1",
122
- "release-it": "^17.3.0",
123
- "typescript": "^5.4.5",
123
+ "release-it": "^17.4.0",
124
+ "typescript": "^5.5.2",
124
125
  "vitest": "^1.6.0",
125
- "vue-tsc": "^2.0.19"
126
+ "vue-tsc": "^2.0.24"
126
127
  },
127
- "packageManager": "pnpm@9.3.0",
128
+ "packageManager": "pnpm@9.4.0",
128
129
  "release-it": {
129
130
  "git": {
130
131
  "commitMessage": "chore(release): release v${version}"
@@ -1,9 +0,0 @@
1
- import { BuiltinTheme } from 'shiki';
2
-
3
- type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
4
- interface HighlighterOptions {
5
- highlights?: number[];
6
- meta?: string;
7
- }
8
-
9
- export type { HighlighterOptions as H, MdcThemeOptions as M };
@@ -1,9 +0,0 @@
1
- import { BuiltinTheme } from 'shiki';
2
-
3
- type MdcThemeOptions = BuiltinTheme | string | Record<string, BuiltinTheme | string>;
4
- interface HighlighterOptions {
5
- highlights?: number[];
6
- meta?: string;
7
- }
8
-
9
- export type { HighlighterOptions as H, MdcThemeOptions as M };