@rspress/plugin-api-docgen 1.43.11 → 1.43.13

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -5
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -60,10 +60,10 @@ var __webpack_exports__ = {};
60
60
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
61
61
  const external_node_path_namespaceObject = require("node:path");
62
62
  var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
63
+ const logger_namespaceObject = require("@rspress/shared/logger");
63
64
  external_node_path_default().join(__dirname, '..');
64
65
  const apiDocMap = {};
65
66
  const shared_namespaceObject = require("@rspress/shared");
66
- const logger_namespaceObject = require("@rspress/shared/logger");
67
67
  const external_chokidar_namespaceObject = require("chokidar");
68
68
  var external_chokidar_default = /*#__PURE__*/ __webpack_require__.n(external_chokidar_namespaceObject);
69
69
  const external_react_docgen_typescript_namespaceObject = require("react-docgen-typescript");
@@ -272,9 +272,7 @@ var __webpack_exports__ = {};
272
272
  },
273
273
  async beforeBuild (config, isProd) {
274
274
  var _config_themeConfig_locales, _config_themeConfig, _config_locales;
275
- const languages = ((null === (_config_themeConfig = config.themeConfig) || void 0 === _config_themeConfig ? void 0 : null === (_config_themeConfig_locales = _config_themeConfig.locales) || void 0 === _config_themeConfig_locales ? void 0 : _config_themeConfig_locales.map((locale)=>locale.lang)) || (null === (_config_locales = config.locales) || void 0 === _config_locales ? void 0 : _config_locales.map((locale)=>locale.lang)) || [
276
- config.lang || 'en'
277
- ]).filter((lang)=>[
275
+ const languages = ((null === (_config_themeConfig = config.themeConfig) || void 0 === _config_themeConfig ? void 0 : null === (_config_themeConfig_locales = _config_themeConfig.locales) || void 0 === _config_themeConfig_locales ? void 0 : _config_themeConfig_locales.map((locale)=>locale.lang)) || (null === (_config_locales = config.locales) || void 0 === _config_locales ? void 0 : _config_locales.map((locale)=>locale.lang)) || []).filter((lang)=>[
278
276
  'zh',
279
277
  'en',
280
278
  'ru'
@@ -298,7 +296,8 @@ var __webpack_exports__ = {};
298
296
  while(null !== matchResult){
299
297
  const matchContent = matchResult[0];
300
298
  const moduleName = matchResult[2] ?? matchResult[5] ?? '';
301
- const apiDoc = apiDocMap[moduleName] ?? apiDocMap[`${moduleName}-${lang}`] ?? '';
299
+ const apiDoc = apiDocMap[moduleName] ?? apiDocMap[`${moduleName}-${lang ? lang : 'en'}`] ?? '';
300
+ if (matchContent && !apiDoc) logger_namespaceObject.logger.warn(`No api doc found for module: ${moduleName} in lang: ${lang ?? 'en'}`);
302
301
  content = content.replace(matchContent, apiDoc);
303
302
  matchResult = new RegExp(apiCompRegExp).exec(content);
304
303
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-api-docgen",
3
- "version": "1.43.11",
3
+ "version": "1.43.13",
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": {
@@ -23,7 +23,7 @@
23
23
  "react-docgen-typescript": "2.2.2",
24
24
  "react-markdown": "8.0.7",
25
25
  "remark-gfm": "3.0.1",
26
- "@rspress/shared": "1.43.11"
26
+ "@rspress/shared": "1.43.13"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@microsoft/api-extractor": "^7.49.2",
@@ -40,7 +40,7 @@
40
40
  "unist-util-visit": "^4.1.2"
41
41
  },
42
42
  "peerDependencies": {
43
- "@rspress/core": "^1.43.11",
43
+ "@rspress/core": "^1.43.13",
44
44
  "react": ">=17.0.0",
45
45
  "react-router-dom": "^6.8.1",
46
46
  "typescript": "^5.5.3"