Commit 8044e39
fix(search): 改用 fumadocs-core/mdx-plugins 公开导出的 StructuredData,删本地副本
上一版在 lib/search-index.ts 维护了 PageStructuredData 本地副本,理由是 fumadocs-core 的 StructuredData
"没 export"。复查 node_modules 发现 fumadocs-core@15.7.13 的 dist/mdx-plugins/index.d.ts 有:
export { ..., S as StructuredData, ... } from '../remark-structure-...';
package.json 里 './mdx-plugins' 也是公开 exports 入口,就是典型的公开 API。
直接 import 上游类型,删掉本地 PageStructuredData,消除跟 fumadocs 升级 drift 的风险。
PageDataShape 内部字段全部换成上游 StructuredData,和 AdvancedIndex.structuredData 结构一致。1 parent acb3d7a commit 8044e39
1 file changed
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
2 | 5 | | |
3 | 6 | | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | 10 | | |
18 | 11 | | |
19 | 12 | | |
20 | 13 | | |
21 | 14 | | |
22 | | - | |
23 | | - | |
| 15 | + | |
| 16 | + | |
24 | 17 | | |
25 | 18 | | |
26 | 19 | | |
| |||
32 | 25 | | |
33 | 26 | | |
34 | 27 | | |
35 | | - | |
| 28 | + | |
36 | 29 | | |
37 | 30 | | |
38 | 31 | | |
| |||
0 commit comments