@rspress/plugin-api-docgen 1.41.3 → 1.42.1-canary-20240226
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/index.js +1 -1
- package/index.d.ts +7 -0
- package/package.json +6 -6
- package/static/global-components/API.tsx +4 -2
package/dist/index.js
CHANGED
@@ -101,7 +101,7 @@ var __webpack_exports__ = {};
|
|
101
101
|
overview: 'Overview'
|
102
102
|
}
|
103
103
|
};
|
104
|
-
const isToolEntries = (obj)
|
104
|
+
const isToolEntries = (obj)=>!!obj.documentation || !!obj["react-docgen-typescript"];
|
105
105
|
const docgen = async ({ entries, languages, apiParseTool, appDir, parseToolOptions, isProd })=>{
|
106
106
|
const watchFileMap = {};
|
107
107
|
const genApiDoc = async (entry, tool)=>{
|
package/index.d.ts
ADDED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/plugin-api-docgen",
|
3
|
-
"version": "1.
|
3
|
+
"version": "1.42.1-canary-20240226",
|
4
4
|
"description": "A plugin for rspress to generate api doc.",
|
5
5
|
"bugs": "https://github.com/web-infra-dev/rspress/issues",
|
6
6
|
"repository": {
|
@@ -10,10 +10,11 @@
|
|
10
10
|
},
|
11
11
|
"license": "MIT",
|
12
12
|
"main": "./dist/index.js",
|
13
|
-
"types": "./
|
13
|
+
"types": "./index.d.ts",
|
14
14
|
"files": [
|
15
15
|
"dist",
|
16
16
|
"static",
|
17
|
+
"index.d.ts",
|
17
18
|
"mdx-meta-loader.cjs"
|
18
19
|
],
|
19
20
|
"dependencies": {
|
@@ -22,11 +23,11 @@
|
|
22
23
|
"react-docgen-typescript": "2.2.2",
|
23
24
|
"react-markdown": "8.0.7",
|
24
25
|
"remark-gfm": "3.0.1",
|
25
|
-
"@rspress/shared": "1.
|
26
|
+
"@rspress/shared": "1.42.1-canary-20240226"
|
26
27
|
},
|
27
28
|
"devDependencies": {
|
28
29
|
"@microsoft/api-extractor": "^7.49.2",
|
29
|
-
"@rslib/core": "0.
|
30
|
+
"@rslib/core": "0.5.2",
|
30
31
|
"@types/mdast": "^3.0.15",
|
31
32
|
"@types/node": "^18.11.17",
|
32
33
|
"@types/react": "^18.3.18",
|
@@ -39,7 +40,7 @@
|
|
39
40
|
"unist-util-visit": "^4.1.2"
|
40
41
|
},
|
41
42
|
"peerDependencies": {
|
42
|
-
"@rspress/core": "^1.
|
43
|
+
"@rspress/core": "^1.42.0",
|
43
44
|
"react": ">=17.0.0",
|
44
45
|
"react-router-dom": "^6.8.1",
|
45
46
|
"typescript": "^5.5.3"
|
@@ -57,7 +58,6 @@
|
|
57
58
|
"provenance": true,
|
58
59
|
"registry": "https://registry.npmjs.org/"
|
59
60
|
},
|
60
|
-
"jsnext:source": "./src/index.ts",
|
61
61
|
"scripts": {
|
62
62
|
"build": "rslib build",
|
63
63
|
"dev": "rslib build -w",
|
@@ -1,3 +1,5 @@
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
2
|
+
|
1
3
|
import { useLang, usePageData } from '@rspress/core/runtime';
|
2
4
|
import { getCustomMDXComponent } from '@rspress/core/theme';
|
3
5
|
import ReactMarkdown from 'react-markdown';
|
@@ -9,10 +11,10 @@ export default (props: { moduleName: string }) => {
|
|
9
11
|
const { page } = usePageData();
|
10
12
|
const { moduleName } = props;
|
11
13
|
// some api doc have two languages.
|
12
|
-
const apiDocMap = page.apiDocMap
|
14
|
+
const apiDocMap = page.apiDocMap;
|
13
15
|
// avoid error when no page data
|
14
16
|
const apiDoc =
|
15
|
-
apiDocMap?.[moduleName] || apiDocMap?.[`${moduleName}-${lang}`];
|
17
|
+
apiDocMap?.[moduleName] || apiDocMap?.[`${moduleName}-${lang}`] || '';
|
16
18
|
return (
|
17
19
|
<ReactMarkdown
|
18
20
|
remarkPlugins={[[remarkGfm]]}
|