@rspress/plugin-typedoc 2.0.0-beta.16 → 2.0.0-beta.17

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/es/index.js +0 -21
  2. package/package.json +4 -4
package/dist/es/index.js CHANGED
@@ -52,7 +52,6 @@ async function patchGeneratedApiDocs(absoluteApiDir) {
52
52
  function pluginTypeDoc(options) {
53
53
  let docRoot;
54
54
  const { entryPoints = [], outDir = API_DIR } = options;
55
- const apiPageRoute = `/${outDir.replace(/(^\/)|(\/$)/, '')}/`;
56
55
  return {
57
56
  name: '@rspress/plugin-typedoc',
58
57
  async config (config) {
@@ -84,26 +83,6 @@ function pluginTypeDoc(options) {
84
83
  const absoluteApiDir = path.join(docRoot, outDir);
85
84
  await app.generateDocs(project, absoluteApiDir);
86
85
  await patchGeneratedApiDocs(absoluteApiDir);
87
- config.themeConfig = config.themeConfig || {};
88
- config.themeConfig.nav = config.themeConfig.nav || [];
89
- const { nav } = config.themeConfig;
90
- function isApiAlreadyInNav(navList) {
91
- return navList.some((item)=>{
92
- if ('link' in item && 'string' == typeof item.link && item.link.startsWith(apiPageRoute.slice(0, apiPageRoute.length - 1))) return true;
93
- return false;
94
- });
95
- }
96
- if (Array.isArray(nav)) {
97
- if (!isApiAlreadyInNav(nav)) nav.push({
98
- text: 'API',
99
- link: apiPageRoute
100
- });
101
- } else if ('default' in nav) {
102
- if (!isApiAlreadyInNav(nav.default)) nav.default.push({
103
- text: 'API',
104
- link: apiPageRoute
105
- });
106
- }
107
86
  }
108
87
  return config;
109
88
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-typedoc",
3
- "version": "2.0.0-beta.16",
3
+ "version": "2.0.0-beta.17",
4
4
  "description": "A plugin for rspress to integrate typedoc",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -30,11 +30,11 @@
30
30
  "dependencies": {
31
31
  "typedoc": "0.24.8",
32
32
  "typedoc-plugin-markdown": "3.17.1",
33
- "@rspress/shared": "2.0.0-beta.16"
33
+ "@rspress/shared": "2.0.0-beta.17"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@microsoft/api-extractor": "^7.52.8",
37
- "@rslib/core": "0.10.0",
37
+ "@rslib/core": "0.10.2",
38
38
  "@types/node": "^22.8.1",
39
39
  "@types/react": "^19.1.8",
40
40
  "@types/react-dom": "^19.1.6",
@@ -44,7 +44,7 @@
44
44
  "@rspress/config": "1.0.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "rspress": "^2.0.0-beta.16"
47
+ "rspress": "^2.0.0-beta.17"
48
48
  },
49
49
  "engines": {
50
50
  "node": ">=18.0.0"