@rspress/plugin-typedoc 1.39.3 → 1.40.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/es/index.mjs CHANGED
@@ -4,7 +4,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_typedoc_plugin_markdown__ from "typedoc-pl
4
4
  import * as __WEBPACK_EXTERNAL_MODULE__rspress_shared_fs_extra__ from "@rspress/shared/fs-extra";
5
5
  const API_DIR = 'api';
6
6
  async function patchLinks(outputDir) {
7
- const normlizeLinksInFile = async (filePath)=>{
7
+ const normalizeLinksInFile = async (filePath)=>{
8
8
  const content = await __WEBPACK_EXTERNAL_MODULE__rspress_shared_fs_extra__["default"].readFile(filePath, 'utf-8');
9
9
  const newContent = content.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, p1, p2)=>{
10
10
  if ([
@@ -23,7 +23,7 @@ async function patchLinks(outputDir) {
23
23
  const file = files[index];
24
24
  const filePath = filePaths[index];
25
25
  if (stat.isDirectory()) return traverse(filePath);
26
- if (stat.isFile() && /\.mdx?/.test(file)) return normlizeLinksInFile(filePath);
26
+ if (stat.isFile() && /\.mdx?/.test(file)) return normalizeLinksInFile(filePath);
27
27
  }));
28
28
  };
29
29
  await traverse(outputDir);
package/dist/lib/index.js CHANGED
@@ -49,7 +49,7 @@ const API_DIR = 'api';
49
49
  const fs_extra_namespaceObject = require("@rspress/shared/fs-extra");
50
50
  var fs_extra_default = /*#__PURE__*/ __webpack_require__.n(fs_extra_namespaceObject);
51
51
  async function patchLinks(outputDir) {
52
- const normlizeLinksInFile = async (filePath)=>{
52
+ const normalizeLinksInFile = async (filePath)=>{
53
53
  const content = await fs_extra_default().readFile(filePath, 'utf-8');
54
54
  const newContent = content.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (_match, p1, p2)=>{
55
55
  if ([
@@ -68,7 +68,7 @@ async function patchLinks(outputDir) {
68
68
  const file = files[index];
69
69
  const filePath = filePaths[index];
70
70
  if (stat.isDirectory()) return traverse(filePath);
71
- if (stat.isFile() && /\.mdx?/.test(file)) return normlizeLinksInFile(filePath);
71
+ if (stat.isFile() && /\.mdx?/.test(file)) return normalizeLinksInFile(filePath);
72
72
  }));
73
73
  };
74
74
  await traverse(outputDir);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspress/plugin-typedoc",
3
- "version": "1.39.3",
3
+ "version": "1.40.0",
4
4
  "description": "A plugin for rspress to integrate typedoc",
5
5
  "bugs": "https://github.com/web-infra-dev/rspress/issues",
6
6
  "repository": {
@@ -9,17 +9,28 @@
9
9
  "directory": "packages/plugin-typedoc"
10
10
  },
11
11
  "license": "MIT",
12
- "jsnext:source": "./src/index.ts",
13
- "types": "./dist/types/index.d.ts",
12
+ "sideEffects": [
13
+ "*.css",
14
+ "*.less",
15
+ "*.sass",
16
+ "*.scss"
17
+ ],
14
18
  "main": "./dist/lib/index.js",
15
19
  "module": "./dist/es/index.js",
16
- "engines": {
17
- "node": ">=14.17.6"
20
+ "types": "./dist/types/index.d.ts",
21
+ "files": [
22
+ "dist",
23
+ "src"
24
+ ],
25
+ "dependencies": {
26
+ "typedoc": "0.24.8",
27
+ "typedoc-plugin-markdown": "3.17.1",
28
+ "@rspress/shared": "1.40.0"
18
29
  },
19
30
  "devDependencies": {
20
- "@microsoft/api-extractor": "^7.48.1",
21
- "@modern-js/tsconfig": "2.63.3",
22
- "@rslib/core": "0.1.5",
31
+ "@microsoft/api-extractor": "^7.49.1",
32
+ "@modern-js/tsconfig": "2.63.6",
33
+ "@rslib/core": "0.2.2",
23
34
  "@types/node": "^18.11.17",
24
35
  "@types/react": "^18.3.18",
25
36
  "@types/react-dom": "^18.3.5",
@@ -28,31 +39,20 @@
28
39
  "vitest": "2.1.8"
29
40
  },
30
41
  "peerDependencies": {
31
- "rspress": "^1.39.3"
42
+ "rspress": "^1.40.0"
43
+ },
44
+ "engines": {
45
+ "node": ">=14.17.6"
32
46
  },
33
- "sideEffects": [
34
- "*.css",
35
- "*.less",
36
- "*.sass",
37
- "*.scss"
38
- ],
39
- "files": [
40
- "dist",
41
- "src"
42
- ],
43
47
  "publishConfig": {
44
48
  "access": "public",
45
49
  "provenance": true,
46
50
  "registry": "https://registry.npmjs.org/"
47
51
  },
48
- "dependencies": {
49
- "typedoc": "0.24.8",
50
- "typedoc-plugin-markdown": "3.17.1",
51
- "@rspress/shared": "1.39.3"
52
- },
52
+ "jsnext:source": "./src/index.ts",
53
53
  "scripts": {
54
- "dev": "rslib build -w",
55
54
  "build": "rslib build",
55
+ "dev": "rslib build -w",
56
56
  "reset": "rimraf ./**/node_modules",
57
57
  "test": "vitest run --passWithNoTests"
58
58
  }
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
- import { Application, TSConfigReader } from 'typedoc';
3
2
  import type { NavItem, RspressPlugin } from '@rspress/shared';
3
+ import { Application, TSConfigReader } from 'typedoc';
4
4
  import { load } from 'typedoc-plugin-markdown';
5
5
  import { API_DIR } from './constants';
6
6
  import { patchGeneratedApiDocs } from './patch';
package/src/patch.ts CHANGED
@@ -1,5 +1,5 @@
1
- import fs from '@rspress/shared/fs-extra';
2
1
  import path from 'node:path';
2
+ import fs from '@rspress/shared/fs-extra';
3
3
 
4
4
  async function patchLinks(outputDir: string) {
5
5
  // Patch links in markdown files
@@ -7,7 +7,7 @@ async function patchLinks(outputDir: string) {
7
7
  // replace
8
8
  // 1. [foo](bar) -> [foo](./bar)
9
9
  // 2. [foo](./bar) -> [foo](./bar) no change
10
- const normlizeLinksInFile = async (filePath: string) => {
10
+ const normalizeLinksInFile = async (filePath: string) => {
11
11
  const content = await fs.readFile(filePath, 'utf-8');
12
12
  // 1. [foo](bar) -> [foo](./bar)
13
13
  const newContent = content.replace(
@@ -36,7 +36,7 @@ async function patchLinks(outputDir: string) {
36
36
  return traverse(filePath);
37
37
  }
38
38
  if (stat.isFile() && /\.mdx?/.test(file)) {
39
- return normlizeLinksInFile(filePath);
39
+ return normalizeLinksInFile(filePath);
40
40
  }
41
41
  }),
42
42
  );