@rspress/plugin-api-docgen 2.0.0-alpha.8 → 2.0.0-beta.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/index.js +5 -3
- package/package.json +13 -13
- package/static/global-components/API.tsx +11 -8
package/dist/index.js
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __webpack_modules__ = {
|
3
3
|
documentation: function(module) {
|
4
|
-
module.exports = import("documentation")
|
4
|
+
module.exports = import("documentation").then(function(module) {
|
5
|
+
return module;
|
6
|
+
});
|
5
7
|
}
|
6
8
|
};
|
7
9
|
var __webpack_module_cache__ = {};
|
@@ -132,7 +134,7 @@ var __webpack_exports__ = {};
|
|
132
134
|
...parseToolOptions.documentation
|
133
135
|
});
|
134
136
|
const apiDoc = await documentation.formats.md(documentationRes, {
|
135
|
-
noReferenceLinks: (null
|
137
|
+
noReferenceLinks: (null == (_parseToolOptions_documentation = parseToolOptions.documentation) ? void 0 : _parseToolOptions_documentation.noReferenceLinks) ?? true
|
136
138
|
});
|
137
139
|
apiDocMap[key] = apiDoc;
|
138
140
|
} else {
|
@@ -266,7 +268,7 @@ var __webpack_exports__ = {};
|
|
266
268
|
},
|
267
269
|
async beforeBuild (config, isProd) {
|
268
270
|
var _config_themeConfig_locales, _config_themeConfig, _config_locales;
|
269
|
-
const languages = ((null
|
271
|
+
const languages = ((null == (_config_themeConfig = config.themeConfig) ? void 0 : null == (_config_themeConfig_locales = _config_themeConfig.locales) ? void 0 : _config_themeConfig_locales.map((locale)=>locale.lang)) || (null == (_config_locales = config.locales) ? void 0 : _config_locales.map((locale)=>locale.lang)) || []).filter((lang)=>[
|
270
272
|
'zh',
|
271
273
|
'en',
|
272
274
|
'ru'
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@rspress/plugin-api-docgen",
|
3
|
-
"version": "2.0.0-
|
3
|
+
"version": "2.0.0-beta.0",
|
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": {
|
@@ -21,26 +21,26 @@
|
|
21
21
|
"chokidar": "^3.6.0",
|
22
22
|
"documentation": "14.0.3",
|
23
23
|
"react-docgen-typescript": "2.2.2",
|
24
|
-
"react-markdown": "
|
25
|
-
"remark-gfm": "
|
26
|
-
"@rspress/shared": "2.0.0-
|
24
|
+
"react-markdown": "^10.1.0",
|
25
|
+
"remark-gfm": "^4.0.1",
|
26
|
+
"@rspress/shared": "2.0.0-beta.0"
|
27
27
|
},
|
28
28
|
"devDependencies": {
|
29
|
-
"@microsoft/api-extractor": "^7.52.
|
30
|
-
"@rslib/core": "0.6.
|
31
|
-
"@types/mdast": "^
|
29
|
+
"@microsoft/api-extractor": "^7.52.4",
|
30
|
+
"@rslib/core": "0.6.5",
|
31
|
+
"@types/mdast": "^4.0.4",
|
32
32
|
"@types/node": "^18.11.17",
|
33
33
|
"@types/react": "^18.3.20",
|
34
|
-
"@types/react-dom": "^18.3.
|
35
|
-
"react": "^
|
36
|
-
"react-dom": "^
|
34
|
+
"@types/react-dom": "^18.3.6",
|
35
|
+
"react": "^19.1.0",
|
36
|
+
"react-dom": "^19.1.0",
|
37
37
|
"react-router-dom": "^6.29.0",
|
38
38
|
"typescript": "^5.8.2",
|
39
|
-
"unified": "^
|
40
|
-
"unist-util-visit": "^
|
39
|
+
"unified": "^11.0.5",
|
40
|
+
"unist-util-visit": "^5.0.0"
|
41
41
|
},
|
42
42
|
"peerDependencies": {
|
43
|
-
"@rspress/core": "^2.0.0-
|
43
|
+
"@rspress/core": "^2.0.0-beta.0",
|
44
44
|
"react": ">=17.0.0",
|
45
45
|
"react-router-dom": "^6.8.1",
|
46
46
|
"typescript": "^5.8.2"
|
@@ -16,13 +16,16 @@ export default (props: { moduleName: string }) => {
|
|
16
16
|
const apiDoc =
|
17
17
|
apiDocMap?.[moduleName] || apiDocMap?.[`${moduleName}-${lang}`] || '';
|
18
18
|
return (
|
19
|
-
<
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
19
|
+
<div className="rspress-plugin-api-docgen">
|
20
|
+
<ReactMarkdown
|
21
|
+
remarkPlugins={[[remarkGfm]]}
|
22
|
+
components={
|
23
|
+
getCustomMDXComponent() as Record<string, React.ElementType>
|
24
|
+
}
|
25
|
+
skipHtml={true}
|
26
|
+
>
|
27
|
+
{apiDoc}
|
28
|
+
</ReactMarkdown>
|
29
|
+
</div>
|
27
30
|
);
|
28
31
|
};
|