fumadocs-typescript 1.0.2 → 2.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/dist/{chunk-KXYVJC2E.js → chunk-ESYFMJFA.js} +15 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +5 -3
- package/dist/ui/index.js +10 -21
- package/package.json +3 -2
|
@@ -149,6 +149,19 @@ function getDocEntry(prop, context) {
|
|
|
149
149
|
return entry;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
// src/markdown.ts
|
|
153
|
+
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
154
|
+
import { gfmFromMarkdown } from "mdast-util-gfm";
|
|
155
|
+
import { toHast } from "mdast-util-to-hast";
|
|
156
|
+
function renderMarkdownToHast(md) {
|
|
157
|
+
const mdast = fromMarkdown(
|
|
158
|
+
md.replace(new RegExp("{@link (?<link>[^}]*)}", "g"), "$1"),
|
|
159
|
+
// replace jsdoc links
|
|
160
|
+
{ mdastExtensions: [gfmFromMarkdown()] }
|
|
161
|
+
);
|
|
162
|
+
return toHast(mdast);
|
|
163
|
+
}
|
|
164
|
+
|
|
152
165
|
export {
|
|
153
166
|
__spreadValues,
|
|
154
167
|
__objRest,
|
|
@@ -156,5 +169,6 @@ export {
|
|
|
156
169
|
getFileSymbol,
|
|
157
170
|
getProgram,
|
|
158
171
|
generateDocumentation,
|
|
159
|
-
generate
|
|
172
|
+
generate,
|
|
173
|
+
renderMarkdownToHast
|
|
160
174
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { G as GenerateOptions, T as TypescriptConfig, a as GeneratedDoc, D as DocEntry } from './base-3iGxlbJG.js';
|
|
2
2
|
export { b as GenerateDocumentationOptions, c as generate, g as generateDocumentation } from './base-3iGxlbJG.js';
|
|
3
3
|
import fg from 'fast-glob';
|
|
4
|
+
import { Nodes } from 'hast';
|
|
4
5
|
import 'typescript';
|
|
5
6
|
|
|
6
7
|
interface Templates {
|
|
@@ -32,4 +33,6 @@ interface GenerateFilesOptions {
|
|
|
32
33
|
}
|
|
33
34
|
declare function generateFiles(options: GenerateFilesOptions): Promise<void>;
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
declare function renderMarkdownToHast(md: string): Nodes;
|
|
37
|
+
|
|
38
|
+
export { DocEntry, type GenerateFilesOptions, type GenerateMDXOptions, GenerateOptions, GeneratedDoc, generateFiles, generateMDX, renderMarkdownToHast };
|
package/dist/index.js
CHANGED
|
@@ -5,8 +5,9 @@ import {
|
|
|
5
5
|
generate,
|
|
6
6
|
generateDocumentation,
|
|
7
7
|
getFileSymbol,
|
|
8
|
-
getProgram
|
|
9
|
-
|
|
8
|
+
getProgram,
|
|
9
|
+
renderMarkdownToHast
|
|
10
|
+
} from "./chunk-ESYFMJFA.js";
|
|
10
11
|
|
|
11
12
|
// src/generate/mdx.ts
|
|
12
13
|
import * as path from "path";
|
|
@@ -103,5 +104,6 @@ export {
|
|
|
103
104
|
generate,
|
|
104
105
|
generateDocumentation,
|
|
105
106
|
generateFiles,
|
|
106
|
-
generateMDX
|
|
107
|
+
generateMDX,
|
|
108
|
+
renderMarkdownToHast
|
|
107
109
|
};
|
package/dist/ui/index.js
CHANGED
|
@@ -1,30 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
|
-
generateDocumentation
|
|
3
|
-
|
|
2
|
+
generateDocumentation,
|
|
3
|
+
renderMarkdownToHast
|
|
4
|
+
} from "../chunk-ESYFMJFA.js";
|
|
4
5
|
|
|
5
6
|
// src/ui/auto-type-table.tsx
|
|
6
7
|
import { TypeTable } from "fumadocs-ui/components/type-table";
|
|
7
|
-
|
|
8
|
-
// src/markdown.ts
|
|
9
|
-
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
10
|
-
import { gfmFromMarkdown } from "mdast-util-gfm";
|
|
11
|
-
import { toHast } from "mdast-util-to-hast";
|
|
12
8
|
import { toJsxRuntime } from "hast-util-to-jsx-runtime";
|
|
13
9
|
import * as runtime from "react/jsx-runtime";
|
|
14
|
-
function renderMarkdown(md) {
|
|
15
|
-
const mdast = fromMarkdown(
|
|
16
|
-
md.replace(new RegExp("{@link (?<link>[^}]*)}", "g"), "$1"),
|
|
17
|
-
// replace jsdoc links
|
|
18
|
-
{ mdastExtensions: [gfmFromMarkdown()] }
|
|
19
|
-
);
|
|
20
|
-
return toJsxRuntime(toHast(mdast), {
|
|
21
|
-
Fragment: runtime.Fragment,
|
|
22
|
-
jsx: runtime.jsx,
|
|
23
|
-
jsxs: runtime.jsxs
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// src/ui/auto-type-table.tsx
|
|
28
10
|
import "server-only";
|
|
29
11
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
30
12
|
function AutoTypeTable({
|
|
@@ -51,6 +33,13 @@ function AutoTypeTable({
|
|
|
51
33
|
}
|
|
52
34
|
);
|
|
53
35
|
}
|
|
36
|
+
function renderMarkdown(md) {
|
|
37
|
+
return toJsxRuntime(renderMarkdownToHast(md), {
|
|
38
|
+
Fragment: runtime.Fragment,
|
|
39
|
+
jsx: runtime.jsx,
|
|
40
|
+
jsxs: runtime.jsxs
|
|
41
|
+
});
|
|
42
|
+
}
|
|
54
43
|
export {
|
|
55
44
|
AutoTypeTable
|
|
56
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-typescript",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Typescript Integration for Fumadocs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -42,12 +42,13 @@
|
|
|
42
42
|
"mdast-util-to-hast": "^13.1.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@types/estree": "^1.0.5",
|
|
45
46
|
"@types/hast": "^3.0.4",
|
|
46
47
|
"@types/mdast": "^4.0.3",
|
|
47
48
|
"@types/react": "18.2.67",
|
|
48
49
|
"@types/react-dom": "18.2.22",
|
|
49
50
|
"eslint-config-custom": "0.0.0",
|
|
50
|
-
"fumadocs-ui": "
|
|
51
|
+
"fumadocs-ui": "11.0.0",
|
|
51
52
|
"tsconfig": "0.0.0"
|
|
52
53
|
},
|
|
53
54
|
"peerDependencies": {
|