diff --git a/index.html b/index.html index 59ddfa5..5d23bd1 100644 --- a/index.html +++ b/index.html @@ -40,6 +40,8 @@ id="twitter-description" /> + +
diff --git a/package.json b/package.json index d35f15f..8f6a32e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ "test:ui": "vitest --ui", "test:coverage": "vitest --coverage", "test:e2e": "playwright test", - "test:e2e:ui": "playwright test --ui" + "test:e2e:ui": "playwright test --ui", + "check:all": "npm run typecheck && npm run format && npm run lint && npm run build && npm test" }, "dependencies": { "@mantine/core": "^7.17.8", diff --git a/public/vaults/Demo/.obsidian/plugins/metadata-extractor/allExceptMd.json b/public/vaults/Demo/.obsidian/plugins/metadata-extractor/allExceptMd.json index e0b4084..4b61a29 100644 --- a/public/vaults/Demo/.obsidian/plugins/metadata-extractor/allExceptMd.json +++ b/public/vaults/Demo/.obsidian/plugins/metadata-extractor/allExceptMd.json @@ -12,44 +12,59 @@ "name": "FolderA", "relativePath": "FolderA" }, - { - "name": "helenite-docs", - "relativePath": "helenite-docs" - }, { "name": "SubFolder", "relativePath": "FolderA/SubFolder" }, + { + "name": "helenite-docs", + "relativePath": "helenite-docs" + }, { "name": "components", "relativePath": "helenite-docs/components" } ], "nonMdFiles": [ + { + "name": "Get_Started_With_Smallpdf.pdf", + "basename": "Get_Started_With_Smallpdf", + "relativePath": "Attachments/Get_Started_With_Smallpdf.pdf" + }, { "name": "Pasted image 20250902131727.png", "basename": "Pasted image 20250902131727", "relativePath": "Attachments/Pasted image 20250902131727.png" }, - { - "name": "Pasted image 20250902132358.png", - "basename": "Pasted image 20250902132358", - "relativePath": "Attachments/Pasted image 20250902132358.png" - }, { "name": "Pasted image 20250902132222.png", "basename": "Pasted image 20250902132222", "relativePath": "Attachments/Pasted image 20250902132222.png" }, + { + "name": "Pasted image 20250902132358.png", + "basename": "Pasted image 20250902132358", + "relativePath": "Attachments/Pasted image 20250902132358.png" + }, { "name": "Pasted image 20250902132433.png", "basename": "Pasted image 20250902132433", "relativePath": "Attachments/Pasted image 20250902132433.png" }, { - "name": "Get_Started_With_Smallpdf.pdf", - "basename": "Get_Started_With_Smallpdf", - "relativePath": "Attachments/Get_Started_With_Smallpdf.pdf" + "name": "c4611_sample_explain.pdf", + "basename": "c4611_sample_explain", + "relativePath": "Attachments/c4611_sample_explain.pdf" + }, + { + "name": "file_example_MP3_700KB.mp3", + "basename": "file_example_MP3_700KB", + "relativePath": "Attachments/file_example_MP3_700KB.mp3" + }, + { + "name": "file_example_MP4_480_1_5MG.mp4", + "basename": "file_example_MP4_480_1_5MG", + "relativePath": "Attachments/file_example_MP4_480_1_5MG.mp4" }, { "name": "inversed_mt_fuji.png", @@ -62,19 +77,14 @@ "relativePath": "Attachments/yamap_2025-04-02_08_48.gpx" }, { - "name": "c4611_sample_explain.pdf", - "basename": "c4611_sample_explain", - "relativePath": "Attachments/c4611_sample_explain.pdf" - }, - { - "name": "file_example_MP4_480_1_5MG.mp4", - "basename": "file_example_MP4_480_1_5MG", - "relativePath": "Attachments/file_example_MP4_480_1_5MG.mp4" + "name": "东西佘山含地铁绿道.kml", + "basename": "东西佘山含地铁绿道", + "relativePath": "Attachments/东西佘山含地铁绿道.kml" }, { - "name": "file_example_MP3_700KB.mp3", - "basename": "file_example_MP3_700KB", - "relativePath": "Attachments/file_example_MP3_700KB.mp3" + "name": "中西citywalk.kml", + "basename": "中西citywalk", + "relativePath": "Attachments/中西citywalk.kml" }, { "name": "红叶尚湖.gpx", @@ -82,9 +92,9 @@ "relativePath": "Attachments/红叶尚湖.gpx" }, { - "name": "东西佘山含地铁绿道.kml", - "basename": "东西佘山含地铁绿道", - "relativePath": "Attachments/东西佘山含地铁绿道.kml" + "name": "金牛道拦马墙到普安镇.gpx", + "basename": "金牛道拦马墙到普安镇", + "relativePath": "Attachments/金牛道拦马墙到普安镇.gpx" }, { "name": "金牛道拦马墙到普安镇.kml", @@ -92,24 +102,14 @@ "relativePath": "Attachments/金牛道拦马墙到普安镇.kml" }, { - "name": "金牛道拦马墙到普安镇.gpx", - "basename": "金牛道拦马墙到普安镇", - "relativePath": "Attachments/金牛道拦马墙到普安镇.gpx" - }, - { - "name": "中西citywalk.kml", - "basename": "中西citywalk", - "relativePath": "Attachments/中西citywalk.kml" + "name": "BaseExample.base", + "basename": "BaseExample", + "relativePath": "FolderA/BaseExample.base" }, { "name": "Canvas.canvas", "basename": "Canvas", "relativePath": "FolderA/Canvas.canvas" - }, - { - "name": "BaseExample.base", - "basename": "BaseExample", - "relativePath": "FolderA/BaseExample.base" } ] } \ No newline at end of file diff --git a/public/vaults/Demo/.obsidian/plugins/metadata-extractor/metadata.json b/public/vaults/Demo/.obsidian/plugins/metadata-extractor/metadata.json index 2ff12d5..23661e9 100644 --- a/public/vaults/Demo/.obsidian/plugins/metadata-extractor/metadata.json +++ b/public/vaults/Demo/.obsidian/plugins/metadata-extractor/metadata.json @@ -1,22 +1,4 @@ [ - { - "fileName": "devtools", - "relativePath": "devtools.md", - "headings": [ - { - "heading": "Development Tools", - "level": 1 - }, - { - "heading": "Available Tools", - "level": 2 - }, - { - "heading": "Note", - "level": 2 - } - ] - }, { "fileName": "services-architecture", "relativePath": "helenite-docs/services-architecture.md", @@ -305,132 +287,111 @@ ] }, { - "fileName": "cache-README", - "relativePath": "helenite-docs/cache-README.md", + "fileName": "map-and-tracks-analysis", + "relativePath": "helenite-docs/components/map-and-tracks-analysis.md", "headings": [ { - "heading": "Helenite 缓存系统", + "heading": "地图和轨迹系统分析与设计", "level": 1 }, { - "heading": "概述", - "level": 2 - }, - { - "heading": "🎯 设计目标", - "level": 2 - }, - { - "heading": "🏗️ 架构设计", - "level": 2 - }, - { - "heading": "🚀 核心特性", + "heading": "现有 TrackMap 实现分析", "level": 2 }, { - "heading": "1. TypeScript Proxy 动态代理", + "heading": "数据结构", "level": 3 }, { - "heading": "2. 灵活的缓存配置", - "level": 3 + "heading": "TrackData 接口定义", + "level": 4 }, { - "heading": "3. 高性能持久化缓存", + "heading": "数据解析流程", "level": 3 }, { - "heading": "📁 文件结构", - "level": 2 + "heading": "GPX 解析结果", + "level": 4 }, { - "heading": "💻 使用指南", - "level": 2 + "heading": "KML 解析结果", + "level": 4 }, { - "heading": "基础用法", - "level": 3 + "heading": "Footprints 数据源分析", + "level": 2 }, { - "heading": "应用级集成", + "heading": "三个输入源,两种数据类型", "level": 3 }, { - "heading": "自定义服务缓存", + "heading": "两种输出数据类型", "level": 3 }, { - "heading": "🎛️ 配置选项", + "heading": "统一地图组件设计", "level": 2 }, { - "heading": "CacheManager 配置", + "heading": "核心设计理念", "level": 3 }, { - "heading": "方法级缓存配置", + "heading": "统一地图组件", "level": 3 }, { - "heading": "📊 性能数据", - "level": 2 - }, - { - "heading": "缓存统计示例", + "heading": "访问状态区分渲染", "level": 3 }, { - "heading": "🧪 测试覆盖", - "level": 2 + "heading": "样式设计约定", + "level": 4 }, { - "heading": "单元测试 (19个测试)", - "level": 3 + "heading": "自动状态检测策略", + "level": 4 }, { - "heading": "集成测试 (5个测试)", + "heading": "智能化UI逻辑", "level": 3 }, { - "heading": "使用示例测试 (9个测试)", + "heading": "数据处理流程", "level": 3 }, { - "heading": "🎯 最佳实践", + "heading": "使用示例", "level": 2 }, { - "heading": "1. 缓存策略选择", - "level": 3 - }, - { - "heading": "2. 存储管理", - "level": 3 - }, - { - "heading": "3. 缓存预热", + "heading": "单个轨迹地图", "level": 3 }, { - "heading": "4. 监控和调试", + "heading": "足迹地图", "level": 3 }, { - "heading": "🔄 生命周期管理", + "heading": "配置接口", "level": 2 }, { - "heading": "🚨 注意事项", - "level": 2 + "heading": "FootprintsConfig (Markdown语法配置)", + "level": 3 }, { - "heading": "🔮 扩展方向", - "level": 2 - }, + "heading": "Markdown语法示例", + "level": 3 + } + ], + "backlinks": [ { - "heading": "📝 更新日志", - "level": 2 + "fileName": "services-architecture", + "link": "map-and-tracks-analysis", + "relativePath": "helenite-docs/services-architecture.md" } ] }, @@ -532,114 +493,208 @@ ] }, { - "fileName": "map-and-tracks-analysis", - "relativePath": "helenite-docs/components/map-and-tracks-analysis.md", + "fileName": "cache-README", + "relativePath": "helenite-docs/cache-README.md", "headings": [ { - "heading": "地图和轨迹系统分析与设计", + "heading": "Helenite 缓存系统", "level": 1 }, { - "heading": "现有 TrackMap 实现分析", + "heading": "概述", "level": 2 }, { - "heading": "数据结构", - "level": 3 + "heading": "🎯 设计目标", + "level": 2 }, { - "heading": "TrackData 接口定义", - "level": 4 + "heading": "🏗️ 架构设计", + "level": 2 }, { - "heading": "数据解析流程", + "heading": "🚀 核心特性", + "level": 2 + }, + { + "heading": "1. TypeScript Proxy 动态代理", "level": 3 }, { - "heading": "GPX 解析结果", - "level": 4 + "heading": "2. 灵活的缓存配置", + "level": 3 }, { - "heading": "KML 解析结果", - "level": 4 + "heading": "3. 高性能持久化缓存", + "level": 3 }, { - "heading": "Footprints 数据源分析", + "heading": "📁 文件结构", "level": 2 }, { - "heading": "三个输入源,两种数据类型", + "heading": "💻 使用指南", + "level": 2 + }, + { + "heading": "基础用法", "level": 3 }, { - "heading": "两种输出数据类型", + "heading": "应用级集成", "level": 3 }, { - "heading": "统一地图组件设计", + "heading": "自定义服务缓存", + "level": 3 + }, + { + "heading": "🎛️ 配置选项", "level": 2 }, { - "heading": "核心设计理念", + "heading": "CacheManager 配置", "level": 3 }, { - "heading": "统一地图组件", + "heading": "方法级缓存配置", "level": 3 }, { - "heading": "访问状态区分渲染", + "heading": "📊 性能数据", + "level": 2 + }, + { + "heading": "缓存统计示例", "level": 3 }, { - "heading": "样式设计约定", - "level": 4 + "heading": "🧪 测试覆盖", + "level": 2 }, { - "heading": "自动状态检测策略", - "level": 4 + "heading": "单元测试 (19个测试)", + "level": 3 }, { - "heading": "智能化UI逻辑", + "heading": "集成测试 (5个测试)", "level": 3 }, { - "heading": "数据处理流程", + "heading": "使用示例测试 (9个测试)", "level": 3 }, { - "heading": "使用示例", + "heading": "🎯 最佳实践", "level": 2 }, { - "heading": "单个轨迹地图", + "heading": "1. 缓存策略选择", "level": 3 }, { - "heading": "足迹地图", + "heading": "2. 存储管理", "level": 3 }, { - "heading": "配置接口", - "level": 2 + "heading": "3. 缓存预热", + "level": 3 }, { - "heading": "FootprintsConfig (Markdown语法配置)", + "heading": "4. 监控和调试", "level": 3 }, { - "heading": "Markdown语法示例", - "level": 3 + "heading": "🔄 生命周期管理", + "level": 2 + }, + { + "heading": "🚨 注意事项", + "level": 2 + }, + { + "heading": "🔮 扩展方向", + "level": 2 + }, + { + "heading": "📝 更新日志", + "level": 2 + } + ] + }, + { + "fileName": "devtools", + "relativePath": "devtools.md", + "headings": [ + { + "heading": "Development Tools", + "level": 1 + }, + { + "heading": "Available Tools", + "level": 2 + }, + { + "heading": "Note", + "level": 2 + } + ] + }, + { + "fileName": "Welcome", + "relativePath": "Welcome.md", + "links": [ + { + "link": "Usages", + "relativePath": "Usages.md" + }, + { + "link": "Abilities", + "relativePath": "FolderA/SubFolder/Abilities.md" } ], "backlinks": [ { - "fileName": "services-architecture", - "link": "map-and-tracks-analysis", - "relativePath": "helenite-docs/services-architecture.md" + "fileName": "Abilities", + "link": "Welcome", + "relativePath": "FolderA/SubFolder/Abilities.md" + } + ] + }, + { + "fileName": "Usages", + "relativePath": "Usages.md", + "headings": [ + { + "heading": "Configurations", + "level": 2 + }, + { + "heading": "Plugin", + "level": 2 + }, + { + "heading": "TODO", + "level": 2 + } + ], + "backlinks": [ + { + "fileName": "Welcome", + "link": "Usages", + "relativePath": "Welcome.md" + }, + { + "fileName": "Abilities", + "link": "Usages", + "relativePath": "FolderA/SubFolder/Abilities.md" } ] }, + { + "fileName": "linkB", + "relativePath": "FolderA/linkB.md" + }, { "fileName": "TRACK_SYNTAX", "relativePath": "FolderA/TRACK_SYNTAX.md", @@ -755,8 +810,26 @@ ] }, { - "fileName": "linkB", - "relativePath": "FolderA/linkB.md" + "fileName": "Embedded", + "relativePath": "FolderA/SubFolder/Embedded.md", + "headings": [ + { + "heading": "Embedded Media Examples", + "level": 1 + }, + { + "heading": "PDF", + "level": 2 + }, + { + "heading": "MP4", + "level": 2 + }, + { + "heading": "MP3", + "level": 2 + } + ] }, { "fileName": "Abilities", @@ -921,78 +994,5 @@ "relativePath": "Welcome.md" } ] - }, - { - "fileName": "Embedded", - "relativePath": "FolderA/SubFolder/Embedded.md", - "headings": [ - { - "heading": "Embedded Media Examples", - "level": 1 - }, - { - "heading": "PDF", - "level": 2 - }, - { - "heading": "MP4", - "level": 2 - }, - { - "heading": "MP3", - "level": 2 - } - ] - }, - { - "fileName": "Usages", - "relativePath": "Usages.md", - "headings": [ - { - "heading": "Configurations", - "level": 2 - }, - { - "heading": "Plugin", - "level": 2 - }, - { - "heading": "TODO", - "level": 2 - } - ], - "backlinks": [ - { - "fileName": "Abilities", - "link": "Usages", - "relativePath": "FolderA/SubFolder/Abilities.md" - }, - { - "fileName": "Welcome", - "link": "Usages", - "relativePath": "Welcome.md" - } - ] - }, - { - "fileName": "Welcome", - "relativePath": "Welcome.md", - "links": [ - { - "link": "Usages", - "relativePath": "Usages.md" - }, - { - "link": "Abilities", - "relativePath": "FolderA/SubFolder/Abilities.md" - } - ], - "backlinks": [ - { - "fileName": "Abilities", - "link": "Welcome", - "relativePath": "FolderA/SubFolder/Abilities.md" - } - ] } ] \ No newline at end of file diff --git a/public/vaults/Publish/.obsidian/plugins/metadata-extractor/metadata.json b/public/vaults/Publish/.obsidian/plugins/metadata-extractor/metadata.json new file mode 100644 index 0000000..e921c57 --- /dev/null +++ b/public/vaults/Publish/.obsidian/plugins/metadata-extractor/metadata.json @@ -0,0 +1,855 @@ +[ + { + "fileName": "How-to-Implement-obsidian-sharing-space", + "relativePath": "How-to-Implement-obsidian-sharing-space.md", + "tags": [ + "tech" + ], + "frontmatter": { + "test": "TeSt" + }, + "aliases": [ + "How-to-Implement-obsidian-sharing-space" + ], + "headings": [ + { + "heading": "TL; DR", + "level": 2 + }, + { + "heading": "About Sharing", + "level": 2 + }, + { + "heading": "Purpose", + "level": 3 + }, + { + "heading": "Approach", + "level": 3 + }, + { + "heading": "Implementation", + "level": 2 + }, + { + "heading": "Prerequisites", + "level": 3 + }, + { + "heading": "Deployment", + "level": 3 + }, + { + "heading": "OneDrive CLI Client", + "level": 4 + }, + { + "heading": "Obsidian Front-End", + "level": 4 + }, + { + "heading": "Caddy & Cloudflare", + "level": 4 + }, + { + "heading": "Comment Plugin", + "level": 3 + }, + { + "heading": "Issues", + "level": 3 + }, + { + "heading": "太长不看", + "level": 2 + }, + { + "heading": "关于分享", + "level": 2 + }, + { + "heading": "目的", + "level": 3 + }, + { + "heading": "手段", + "level": 3 + }, + { + "heading": "实现", + "level": 2 + }, + { + "heading": "前提条件", + "level": 3 + }, + { + "heading": "部署", + "level": 3 + }, + { + "heading": "OneDrive CLI Client", + "level": 4 + }, + { + "heading": "Obsidian Front-end", + "level": 4 + }, + { + "heading": "Caddy & Cloudflare", + "level": 4 + }, + { + "heading": "评论插件", + "level": 3 + }, + { + "heading": "Issues", + "level": 3 + } + ] + }, + { + "fileName": "Multi-agent-Voyager-Play-Minecraft", + "relativePath": "LLM/Multi-agent-Voyager-Play-Minecraft.md", + "headings": [ + { + "heading": "The Voyager Paradigm: Minecraft as a Testbed for Multi-Agent AI Collaboration", + "level": 1 + }, + { + "heading": "TL; DR", + "level": 2 + }, + { + "heading": "Overview", + "level": 2 + }, + { + "heading": "Prerequisites", + "level": 2 + }, + { + "heading": "Key Path", + "level": 3 + }, + { + "heading": "Auxiliary Path", + "level": 3 + }, + { + "heading": "Learning loop of Voyager", + "level": 2 + }, + { + "heading": "Pseudocode", + "level": 3 + }, + { + "heading": "Outer Loop", + "level": 3 + }, + { + "heading": "Inner Loop (Rollout)", + "level": 3 + }, + { + "heading": "Experiments", + "level": 2 + }, + { + "heading": "Typical successful logs", + "level": 3 + }, + { + "heading": "Discussion", + "level": 2 + }, + { + "heading": "关于 Voyager 控制 Minecraft API 的整理", + "level": 1 + }, + { + "heading": "太长不看", + "level": 2 + }, + { + "heading": "概述", + "level": 2 + }, + { + "heading": "前置知识", + "level": 2 + }, + { + "heading": "关键路径", + "level": 3 + }, + { + "heading": "辅助路径", + "level": 3 + }, + { + "heading": "Voyager 的学习循环", + "level": 2 + }, + { + "heading": "伪代码", + "level": 3 + }, + { + "heading": "外循环", + "level": 3 + }, + { + "heading": "内循环(执行任务)", + "level": 3 + }, + { + "heading": "实验", + "level": 2 + }, + { + "heading": "典型成功 Log", + "level": 3 + }, + { + "heading": "讨论", + "level": 2 + } + ] + }, + { + "fileName": "Contribute-Groupchat-to-Autogen", + "relativePath": "LLM/Contribute-Groupchat-to-Autogen.md", + "headings": [ + { + "heading": "How I Contributed to a 20k+ Stars Open Source Project for the First Time: Assist in Completing the Amazing Graph Feature for GroupChat in MicroSoft/AutoGen", + "level": 1 + }, + { + "heading": "Introduction", + "level": 2 + }, + { + "heading": "Background", + "level": 3 + }, + { + "heading": "Motivation", + "level": 3 + }, + { + "heading": "Contributions", + "level": 2 + }, + { + "heading": "Minimum Verification Test Design", + "level": 3 + }, + { + "heading": "Push for the Merge of PR 857", + "level": 3 + }, + { + "heading": "Application of the FSM Feature", + "level": 2 + }, + { + "heading": "Usage", + "level": 3 + }, + { + "heading": "Discussion", + "level": 2 + }, + { + "heading": "Lessons Learned", + "level": 3 + }, + { + "heading": "Future Works", + "level": 3 + }, + { + "heading": "协助为 20000+ Star 的开源项目 AutoGen 贡献重要特性: 实现基于 FSM 的群聊", + "level": 1 + }, + { + "heading": "引言", + "level": 2 + }, + { + "heading": "背景", + "level": 3 + }, + { + "heading": "动机", + "level": 3 + }, + { + "heading": "贡献过程", + "level": 2 + }, + { + "heading": "最小实验设计", + "level": 3 + }, + { + "heading": "推进 PR #857 的合并", + "level": 3 + }, + { + "heading": "FSM 特性的应用案例", + "level": 2 + }, + { + "heading": "用法", + "level": 3 + }, + { + "heading": "讨论", + "level": 2 + }, + { + "heading": "经验教训", + "level": 3 + }, + { + "heading": "进一步的工作", + "level": 3 + } + ] + }, + { + "fileName": "Welcome", + "relativePath": "Welcome.md", + "tags": [ + "test" + ] + }, + { + "fileName": "阳台植物", + "relativePath": "FunFacts/阳台植物.md", + "headings": [ + { + "heading": "WIP", + "level": 2 + } + ] + }, + { + "fileName": "Visited-Places", + "relativePath": "Trips/Visited-Places.md", + "headings": [ + { + "heading": "China", + "level": 2 + }, + { + "heading": "Japan", + "level": 2 + }, + { + "heading": "北海道 (ほっかいどう)", + "level": 3 + }, + { + "heading": "札幌 (さっぽろ)", + "level": 4 + }, + { + "heading": "函館 (はこだて)", + "level": 4 + }, + { + "heading": "トマム", + "level": 4 + }, + { + "heading": "美瑛 (びえい)", + "level": 4 + }, + { + "heading": "富良野 (ふらの)", + "level": 4 + }, + { + "heading": "洞爺 (とうや)", + "level": 4 + }, + { + "heading": "小樽 (おたる)", + "level": 4 + }, + { + "heading": "登別 (のぼりべつ)", + "level": 4 + }, + { + "heading": "近畿 (きんき)", + "level": 3 + }, + { + "heading": "神戸 (こうべ)", + "level": 4 + }, + { + "heading": "姫路 (ひめじ)", + "level": 4 + }, + { + "heading": "京都 (きょうと)", + "level": 4 + }, + { + "heading": "奈良 (なら)", + "level": 4 + }, + { + "heading": "大阪 (おおさか)", + "level": 4 + }, + { + "heading": "天橋立 (あまのはしだて)", + "level": 4 + }, + { + "heading": "中京圏 (ちゅうきょうけん)", + "level": 3 + }, + { + "heading": "名古屋 (なごや)", + "level": 4 + }, + { + "heading": "甲信地方(こうしんちほう)", + "level": 3 + }, + { + "heading": "富士河口湖町(ふじかわぐちこまち)", + "level": 4 + }, + { + "heading": "北九州", + "level": 3 + } + ], + "links": [ + { + "link": "夏之北海道", + "relativePath": "Trips/Plans/夏之北海道.md" + }, + { + "link": "進撃の近畿", + "relativePath": "Trips/Plans/進撃の近畿.md" + }, + { + "link": "谁说名古屋不好玩", + "relativePath": "Trips/Plans/谁说名古屋不好玩.md" + }, + { + "link": "本应慵懒的河口湖--完美逆富士之旅", + "relativePath": "Trips/Plans/本应慵懒的河口湖--完美逆富士之旅.md" + }, + { + "link": "春岚樱语——北九州初体验", + "relativePath": "Trips/Plans/春岚樱语——北九州初体验.md" + } + ] + }, + { + "fileName": "制作日本旅行攻略一般要点", + "relativePath": "Trips/制作日本旅行攻略一般要点.md", + "headings": [ + { + "heading": "0x00 Preconditions", + "level": 2 + }, + { + "heading": "0.1 自由行 or 跟团", + "level": 3 + }, + { + "heading": "0.2 W/ or W/O旅行攻略", + "level": 3 + }, + { + "heading": "0.3 旅行目标", + "level": 3 + }, + { + "heading": "0x01 旅行攻略基本要素", + "level": 2 + }, + { + "heading": "1.1 机酒", + "level": 3 + }, + { + "heading": "1.2 交通&景点", + "level": 3 + }, + { + "heading": "1.2.1 交通", + "level": 4 + }, + { + "heading": "1.2.2 景点", + "level": 4 + }, + { + "heading": "1.3 必备APP", + "level": 3 + }, + { + "heading": "1.4 通信", + "level": 3 + }, + { + "heading": "1.5 Checklist", + "level": 3 + }, + { + "heading": "0x02 Related Topics", + "level": 2 + }, + { + "heading": "0x03 Acknowledgements", + "level": 2 + }, + { + "heading": "0x04 References", + "level": 2 + } + ], + "backlinks": [ + { + "fileName": "夏之北海道", + "link": "制作日本旅行攻略一般要点", + "relativePath": "Trips/Plans/夏之北海道.md" + }, + { + "fileName": "夏之北海道", + "link": "制作日本旅行攻略一般要点", + "relativePath": "Trips/Plans/夏之北海道.md" + } + ] + }, + { + "fileName": "谁说名古屋不好玩", + "relativePath": "Trips/Plans/谁说名古屋不好玩.md", + "headings": [ + { + "heading": "WIP", + "level": 2 + } + ], + "backlinks": [ + { + "fileName": "Visited-Places", + "link": "谁说名古屋不好玩", + "relativePath": "Trips/Visited-Places.md" + } + ] + }, + { + "fileName": "進撃の近畿", + "relativePath": "Trips/Plans/進撃の近畿.md", + "headings": [ + { + "heading": "0x00 豆知识", + "level": 2 + }, + { + "heading": "0x01 大阪(未完成)", + "level": 2 + }, + { + "heading": "0x02 京都", + "level": 2 + }, + { + "heading": "0x03 奈良", + "level": 2 + }, + { + "heading": "0x04 神户", + "level": 2 + }, + { + "heading": "0x05 姬路", + "level": 2 + }, + { + "heading": "0x06 其它", + "level": 2 + } + ], + "backlinks": [ + { + "fileName": "Visited-Places", + "link": "進撃の近畿", + "relativePath": "Trips/Visited-Places.md" + } + ] + }, + { + "fileName": "春岚樱语——北九州初体验", + "relativePath": "Trips/Plans/春岚樱语——北九州初体验.md", + "tags": [ + "japan", + "travel" + ], + "frontmatter": {}, + "headings": [ + { + "heading": "流水账", + "level": 1 + }, + { + "heading": "前言", + "level": 2 + }, + { + "heading": "3月31日 - 初见福冈", + "level": 2 + }, + { + "heading": "4月1日 - 邂逅别府", + "level": 2 + }, + { + "heading": "4 月 2 日 - 迷雾森林鹤见岳", + "level": 2 + }, + { + "heading": "4 月 3 日 - 别府日出", + "level": 2 + }, + { + "heading": "4 月 4 日 - 熊本城与熊本熊", + "level": 2 + }, + { + "heading": "4 月 5 日 - 福冈樱语", + "level": 2 + }, + { + "heading": "4 月 6 日 意犹未尽", + "level": 2 + }, + { + "heading": "尾声", + "level": 2 + }, + { + "heading": "计划", + "level": 1 + }, + { + "heading": "主体", + "level": 2 + }, + { + "heading": "目标", + "level": 3 + }, + { + "heading": "简单功略", + "level": 3 + }, + { + "heading": "参考", + "level": 4 + }, + { + "heading": "Checklist", + "level": 3 + }, + { + "heading": "回收站", + "level": 2 + }, + { + "heading": "阿苏", + "level": 3 + }, + { + "heading": "门司港(北九州市)", + "level": 3 + }, + { + "heading": "相岛", + "level": 3 + }, + { + "heading": "由布院", + "level": 3 + }, + { + "heading": "太宰府", + "level": 3 + } + ], + "backlinks": [ + { + "fileName": "Visited-Places", + "link": "春岚樱语——北九州初体验", + "relativePath": "Trips/Visited-Places.md" + } + ] + }, + { + "fileName": "本应慵懒的河口湖--完美逆富士之旅", + "relativePath": "Trips/Plans/本应慵懒的河口湖--完美逆富士之旅.md", + "tags": [ + "japan", + "travel" + ], + "frontmatter": {}, + "headings": [ + { + "heading": "流水账", + "level": 1 + }, + { + "heading": "6 月 7 日", + "level": 2 + }, + { + "heading": "6 月 8 日", + "level": 2 + }, + { + "heading": "6 月 9 日", + "level": 2 + }, + { + "heading": "6 月 10 日", + "level": 2 + }, + { + "heading": "计划", + "level": 1 + }, + { + "heading": "预期天气", + "level": 2 + }, + { + "heading": "Day 1", + "level": 2 + }, + { + "heading": "Day 2", + "level": 2 + }, + { + "heading": "Day 3", + "level": 2 + }, + { + "heading": "Day 4", + "level": 2 + }, + { + "heading": "References", + "level": 1 + } + ], + "backlinks": [ + { + "fileName": "Visited-Places", + "link": "本应慵懒的河口湖--完美逆富士之旅", + "relativePath": "Trips/Visited-Places.md" + } + ] + }, + { + "fileName": "夏之北海道", + "relativePath": "Trips/Plans/夏之北海道.md", + "headings": [ + { + "heading": "Preface", + "level": 2 + }, + { + "heading": "Schedule", + "level": 2 + }, + { + "heading": "Day 1 上海-->札幌-->TOMAMU", + "level": 3 + }, + { + "heading": "Day 2 TOMAMU", + "level": 3 + }, + { + "heading": "Day 3~4 札幌", + "level": 3 + }, + { + "heading": "Day 5 札幌-->美瑛-->富良野", + "level": 3 + }, + { + "heading": "Day 6 富良野", + "level": 3 + }, + { + "heading": "Day 7 富良野-->登别", + "level": 3 + }, + { + "heading": "Day 8 登别-->札幌-->东京", + "level": 3 + }, + { + "heading": "Postscript", + "level": 2 + }, + { + "heading": "Acknowledgements", + "level": 2 + } + ], + "links": [ + { + "link": "制作日本旅行攻略一般要点", + "relativePath": "Trips/制作日本旅行攻略一般要点.md" + }, + { + "link": "制作日本旅行攻略一般要点", + "relativePath": "Trips/制作日本旅行攻略一般要点.md" + } + ], + "backlinks": [ + { + "fileName": "Visited-Places", + "link": "夏之北海道", + "relativePath": "Trips/Visited-Places.md" + } + ] + }, + { + "fileName": "Dream-Destinations", + "relativePath": "Trips/Dream-Destinations.md", + "headings": [ + { + "heading": "China", + "level": 2 + }, + { + "heading": "陆羽古道&南浔古镇", + "level": 3 + }, + { + "heading": "Japan", + "level": 2 + } + ] + } +] \ No newline at end of file diff --git a/src/config/vaultConfig.ts b/src/config/vaultConfig.ts index 083e7b3..bb1bc9d 100644 --- a/src/config/vaultConfig.ts +++ b/src/config/vaultConfig.ts @@ -4,9 +4,28 @@ * 整合了原 vaultConfig.ts 的所有功能 */ -// 环境变量和路径配置 -export const VAULTS_ROOT = import.meta.env.VITE_VAULTS_ROOT || '/vaults'; -export const VAULT_SUBDIR = import.meta.env.VITE_VAULT_SUBDIR || 'Demo'; +// 运行时配置优先,构建时配置作为后备 +declare global { + interface Window { + RUNTIME_CONFIG?: { + VAULT_SUBDIR?: string; + VAULTS_ROOT?: string; + }; + } +} + +// 环境变量和路径配置 - 支持运行时覆盖 +// 优先级:环境变量(开发) > 运行时配置(生产) > 默认值 +export const VAULTS_ROOT = + import.meta.env.VITE_VAULTS_ROOT || + (typeof window !== 'undefined' && window.RUNTIME_CONFIG?.VAULTS_ROOT) || + '/vaults'; + +export const VAULT_SUBDIR = + import.meta.env.VITE_VAULT_SUBDIR || + (typeof window !== 'undefined' && window.RUNTIME_CONFIG?.VAULT_SUBDIR) || + 'Demo'; + export const VAULT_PATH = `${VAULTS_ROOT}/${VAULT_SUBDIR}`; // 内部使用的 Obsidian 插件路径 diff --git a/src/hooks/useVaultService.ts b/src/hooks/useVaultService.ts index c204ab7..8442e53 100644 --- a/src/hooks/useVaultService.ts +++ b/src/hooks/useVaultService.ts @@ -5,7 +5,7 @@ */ import { useMemo, useCallback, useEffect } from 'react'; import { useVaultStore } from '../stores/vaultStore.js'; -import { VAULT_CONFIG } from '../config/vaultConfig.js'; +import { VAULT_CONFIG, VAULT_SUBDIR } from '../config/vaultConfig.js'; // 导入所有必需的服务 import { StorageService } from '../services/infra/StorageService.js'; @@ -164,7 +164,7 @@ async function createVaultAPI(): Promise { const cachedStorage = cacheManager.createCachedStorageService(storageService); // console.log('✅ StorageService 创建并缓存完成'); - const metadataService = new MetadataService('Demo'); + const metadataService = new MetadataService(VAULT_SUBDIR); const cachedMetadata = cacheManager.createCachedMetadataService(metadataService); // console.log('✅ MetadataService 创建并缓存完成'); @@ -175,13 +175,13 @@ async function createVaultAPI(): Promise { const graphService = new GraphService(cachedMetadata); const cachedGraph = cacheManager.createCachedGraphService(graphService); - const tagService = new TagService(cachedMetadata, cachedStorage, 'Demo'); + const tagService = new TagService(cachedMetadata, cachedStorage, VAULT_SUBDIR); const cachedTag = cacheManager.createCachedTagService(tagService); const searchService = new SearchService( cachedStorage, cachedMetadata, - 'Demo' // vaultId + VAULT_SUBDIR // vaultId ); const cachedSearch = cacheManager.createCachedSearchService(searchService); @@ -189,10 +189,10 @@ async function createVaultAPI(): Promise { // 暂时不使用缓存包装,直接使用原始服务以调试问题 const cachedFootprints = footprintsService; // cacheManager.createCachedFootprintsService(footprintsService); - const frontMatterService = new FrontMatterService(cachedMetadata, 'Demo'); + const frontMatterService = new FrontMatterService(cachedMetadata, VAULT_SUBDIR); const cachedFrontMatter = cacheManager.createCachedFrontMatterService(frontMatterService); - const exifService = new ExifService(cachedStorage, 'Demo'); + const exifService = new ExifService(cachedStorage, VAULT_SUBDIR); const cachedExif = cacheManager.createCachedExifService(exifService); // console.log('✅ 所有服务创建并缓存完成'); @@ -207,7 +207,7 @@ async function createVaultAPI(): Promise { const hasMetadata = !!metadata && metadata.length > 0; return { - name: 'Demo Vault', + name: `${VAULT_SUBDIR} Vault`, path: VAULT_CONFIG.VAULT_PATH, hasMetadata, supportedFeatures: { @@ -221,7 +221,7 @@ async function createVaultAPI(): Promise { } catch { // console.warn('getVaultInfo 失败,返回默认值:', error); return { - name: 'Demo Vault', + name: `${VAULT_SUBDIR} Vault`, path: VAULT_CONFIG.VAULT_PATH, hasMetadata: false, supportedFeatures: { @@ -544,7 +544,7 @@ async function createVaultAPI(): Promise { const fallbackAPI: VaultAPI = { async getVaultInfo() { return { - name: 'Demo Vault (降级)', + name: `${VAULT_SUBDIR} Vault (降级)`, path: VAULT_CONFIG.VAULT_PATH, hasMetadata: false, supportedFeatures: {