markshelf 0.1.4 → 0.1.5
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/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +1 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -3
- package/.next/standalone/.next/routes-manifest.json +6 -0
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/diff/route.js +3 -2
- package/.next/standalone/.next/server/app/api/diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/file/route.js +3 -2
- package/.next/standalone/.next/server/app/api/file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/graph/route.js +3 -2
- package/.next/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/history/route.js +3 -2
- package/.next/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/search/route.js +3 -2
- package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/timeline/route.js +3 -2
- package/.next/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/tree/route.js +3 -2
- package/.next/standalone/.next/server/app/api/tree/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/watch/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/watch/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/watch/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/watch/route.js +6 -0
- package/.next/standalone/.next/server/app/api/watch/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/watch/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/watch/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/favicon.ico/route.js +2 -1
- package/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +1 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-_k816._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__04otwp7._.js → [root-of-the-server]__01e7zo7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0zoyna0._.js → [root-of-the-server]__053gm34._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0_gt~a4._.js → [root-of-the-server]__0d.-s5p._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0i.wyss._.js +6 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0qnrcw7._.js → [root-of-the-server]__0nr71d2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0op9af~._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__01cq2u6._.js → [root-of-the-server]__0rwylex._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0yvq0sd._.js → [root-of-the-server]__13vatcq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_watch_route_actions_0go0kk3.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules_next_04~_e52._.js +13 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05ar4zx._.js +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09qrkq5._.js +5 -5
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0serya4._.js → [root-of-the-server]__11e9~iq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_10cz306._.js → node_modules_02chd8n._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0eva9q1._.js → node_modules_08z1b9i._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_05e-8m3._.js → node_modules_0f-9xhq._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_06r3o30._.js → node_modules_0u-.0s2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_09.cbx4._.js → node_modules_0vqo_80._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_11wp0ye._.js → node_modules_0xmn29o._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0ic-wja._.js → node_modules_0~k33bz._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules_0w2-q.z._.js → node_modules_10a06qi._.js} +1 -1
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/0b42--.p9znhl.css +1 -0
- package/.next/standalone/.next/static/chunks/0wy.nfhujao0b.js +11 -0
- package/.next/standalone/docs//344/273/225/346/247/230/README.md +9 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/README.md +3 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.1-bin-cli.md +14 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC2-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273/README.md +3 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC2-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273/SPEC2.1-graph-api.md +16 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC2-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273/SPEC2.2-breadthfirst-layout.md +10 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/README.md +3 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.1-PreviewPopup.md +10 -0
- package/.next/standalone/docs//344/273/225/346/247/230/SPEC3-UI/343/202/263/343/203/263/343/203/235/343/203/274/343/203/215/343/203/263/343/203/210/SPEC3.2-TreeView.md +10 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/Cytoscape.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/Markdown.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/Nextjs.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/breadthfirst.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/npx.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206/standalone.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206//343/203/204/343/203/252/343/203/274/343/203/223/343/203/245/343/203/274.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206//343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/203/235/343/203/203/343/203/227/343/202/242/343/203/203/343/203/227.md +5 -0
- package/.next/standalone/docs//347/224/250/350/252/236/351/233/206//343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225.md +5 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/README.md +9 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ1-/343/203/223/343/203/245/343/203/274/343/202/242/350/265/267/345/213/225/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ1-/343/203/223/343/203/245/343/203/274/343/202/242/350/265/267/345/213/225/REQ1.1-npx/350/265/267/345/213/225.md +13 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/REQ2.1-/343/202/260/343/203/251/343/203/225/346/217/217/347/224/273.md +11 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/REQ2.2-/351/232/216/345/261/244/345/210/207/346/233/277.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ2-/343/203/252/343/203/263/343/202/257/343/202/260/343/203/251/343/203/225/REQ2.3-/343/203/225/343/202/251/343/203/253/343/203/200/351/231/244/345/244/226.md +10 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.1-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/203/235/343/203/203/343/203/227/343/202/242/343/203/203/343/203/227.md +15 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ3-/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274/343/201/250/343/203/204/343/203/252/343/203/274/REQ3.2-/343/203/204/343/203/252/343/203/274/343/203/223/343/203/245/343/203/274.md +14 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ4-/343/203/212/343/203/223/343/202/262/343/203/274/343/202/267/343/203/247/343/203/263/README.md +3 -0
- package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ4-/343/203/212/343/203/223/343/202/262/343/203/274/343/202/267/343/203/247/343/203/263/REQ4.1-/346/210/273/343/202/213/351/200/262/343/202/200.md +10 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.1-/347/213/254/347/253/213/343/203/223/343/203/245/343/203/274/343/202/242.md +11 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.2-/345/244/247/347/224/273/351/235/242/350/241/250/347/244/272.md +11 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/R1.3-/343/203/212/343/203/223/343/202/262/343/203/274/343/202/267/343/203/247/343/203/263/345/261/245/346/255/264.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R1-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/262/350/246/247/346/200/247/README.md +7 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R2-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/242/344/277/202/343/201/256/345/217/257/350/246/226/345/214/226/R2.1-/344/276/235/345/255/230/351/226/242/344/277/202/343/201/256/346/212/212/346/217/241.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R2-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/242/344/277/202/343/201/256/345/217/257/350/246/226/345/214/226/R2.2-/345/217/202/347/205/247/345/205/203/343/201/256/346/212/212/346/217/241.md +9 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R2-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/351/226/242/344/277/202/343/201/256/345/217/257/350/246/226/345/214/226/README.md +8 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R3-/343/202/252/343/203/263/343/203/234/343/203/274/343/203/207/343/202/243/343/203/263/343/202/260/346/224/257/346/217/264/R3.1-/347/224/250/350/252/236/343/201/256/345/215/263/346/231/202/347/242/272/350/252/215.md +11 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R3-/343/202/252/343/203/263/343/203/234/343/203/274/343/203/207/343/202/243/343/203/263/343/202/260/346/224/257/346/217/264/README.md +7 -0
- package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/README.md +9 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/src/app/api/watch/route.ts +89 -0
- package/.next/standalone/src/app/page.tsx +41 -8
- package/.next/standalone/src/components/DetailPanel.tsx +38 -6
- package/.next/standalone/src/components/HistoryPanel.tsx +3 -1
- package/.next/standalone/src/components/LinkGraph.tsx +179 -9
- package/.next/standalone/src/components/Markdown.tsx +60 -5
- package/.next/standalone/src/components/PreviewPopup.tsx +4 -2
- package/.next/standalone/src/components/TimelinePanel.tsx +3 -1
- package/.next/standalone/src/components/TreeView.tsx +36 -9
- package/.next/standalone/src/lib/links.ts +98 -25
- package/.next/standalone/src/lib/useRefreshTick.ts +43 -0
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/.next/static/chunks/0b42--.p9znhl.css +1 -0
- package/.next/static/chunks/0wy.nfhujao0b.js +11 -0
- package/package.json +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0j8-xkl._.js +0 -13
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0owpp0l._.js +0 -3
- package/.next/standalone/.next/static/chunks/04x.fjh8sw0s1.css +0 -1
- package/.next/standalone/.next/static/chunks/0z_707.y37o2..js +0 -11
- package/.next/standalone/AGENTS.md +0 -5
- package/.next/standalone/CLAUDE.md +0 -1
- package/.next/standalone/markshelf-0.1.0.tgz +0 -0
- package/.next/standalone/markshelf-0.1.2.tgz +0 -0
- package/.next/static/chunks/04x.fjh8sw0s1.css +0 -1
- package/.next/static/chunks/0z_707.y37o2..js +0 -11
- /package/.next/standalone/.next/static/{JkyieJgBB2eU8MtnlBGvG → pOQs5i4GMjDH6W5XDSjRs}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{JkyieJgBB2eU8MtnlBGvG → pOQs5i4GMjDH6W5XDSjRs}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{JkyieJgBB2eU8MtnlBGvG → pOQs5i4GMjDH6W5XDSjRs}/_ssgManifest.js +0 -0
- /package/.next/static/{JkyieJgBB2eU8MtnlBGvG → pOQs5i4GMjDH6W5XDSjRs}/_buildManifest.js +0 -0
- /package/.next/static/{JkyieJgBB2eU8MtnlBGvG → pOQs5i4GMjDH6W5XDSjRs}/_clientMiddlewareManifest.js +0 -0
- /package/.next/static/{JkyieJgBB2eU8MtnlBGvG → pOQs5i4GMjDH6W5XDSjRs}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# SPEC1.1: bin/cli.mjs
|
|
2
|
+
|
|
3
|
+
[REQ1.1 — npx 起動](../../../要件定義/REQ1-ビューア起動/REQ1.1-npx起動.md) の実装。
|
|
4
|
+
|
|
5
|
+
## 設計
|
|
6
|
+
|
|
7
|
+
- `package.json` の `bin` フィールドに `markshelf: ./bin/cli.mjs` を登録する
|
|
8
|
+
- `bin/cli.mjs` は Next.js の standalone ビルド成果物を起動する
|
|
9
|
+
- 現在の作業ディレクトリ (cwd) をドキュメントルートとして扱う
|
|
10
|
+
- 起動ポートは空きポートを自動検出、標準出力にアクセス URL を表示する
|
|
11
|
+
|
|
12
|
+
## 関連
|
|
13
|
+
|
|
14
|
+
- npx
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# SPEC2.1: graph API
|
|
2
|
+
|
|
3
|
+
[REQ2.1 — グラフ描画](../../../要件定義/REQ2-リンクグラフ/REQ2.1-グラフ描画.md) のためのバックエンド API。
|
|
4
|
+
|
|
5
|
+
## 設計
|
|
6
|
+
|
|
7
|
+
- エンドポイント: `GET /api/graph`
|
|
8
|
+
- 全 Markdown ファイルを走査し、ノードとエッジを返す
|
|
9
|
+
- レスポンス
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"nodes": [{ "id": "path/to/file.md", "label": "file" }],
|
|
13
|
+
"edges": [{ "source": "a.md", "target": "b.md" }]
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
- フロントは選択中ドキュメントを中心に絞り込んで描画する
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# SPEC2.2: breadthfirst レイアウト
|
|
2
|
+
|
|
3
|
+
[REQ2.1](../../../要件定義/REQ2-リンクグラフ/REQ2.1-グラフ描画.md) と [REQ2.2 — 階層切替](../../../要件定義/REQ2-リンクグラフ/REQ2.2-階層切替.md) の描画仕様。
|
|
4
|
+
|
|
5
|
+
## 設計
|
|
6
|
+
|
|
7
|
+
- Cytoscape の breadthfirst レイアウトを `directed: true` で使用
|
|
8
|
+
- roots は「入次数 0 のノード」を選定し、これにより上から下への流れに統一
|
|
9
|
+
- 無向 BFS で選択中ノードからの深さを制限して表示ノードを絞り込む
|
|
10
|
+
- 表示階層選択値は `localStorage['markshelf:linkGraphDepth']` に保存
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# SPEC3.1: PreviewPopup
|
|
2
|
+
|
|
3
|
+
[REQ3.1 — プレビューポップアップ](../../../要件定義/REQ3-プレビューとツリー/REQ3.1-プレビューポップアップ.md) の実装。
|
|
4
|
+
|
|
5
|
+
## 設計
|
|
6
|
+
|
|
7
|
+
- `<PreviewPopup>` コンポーネントとして実装 (`src/components/PreviewPopup.tsx`)
|
|
8
|
+
- ホバー対象のリンク要素近傍に絶対配置
|
|
9
|
+
- 表示遅延 (debounce) を入れ、意図しない表示を抑制
|
|
10
|
+
- Markdown レンダラーを再利用し、本文と同じスタイルで表示
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# 要件定義
|
|
2
|
+
|
|
3
|
+
[要求](../要求定義/README.md) を満たすために、システムが「何をすべきか」を記述するレイヤ。
|
|
4
|
+
|
|
5
|
+
## 書き方
|
|
6
|
+
|
|
7
|
+
- 各要件は `REQ{番号}-{テーマ}/README.md` で定義し、より細かい粒度は `REQ{番号}.{サブ番号}-*.md` に分ける
|
|
8
|
+
- 対応する[要求](../要求定義/README.md)へのリンクを本文の冒頭に張る(親フォルダの README だけでなく、子ファイル `REQ*.{サブ番号}-*.md` にも張ること)
|
|
9
|
+
- 下位の[仕様](../仕様/README.md)へのリンクは張らない(リンクグラフが双方向に濁るため、参照は仕様側から上向きに張る)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# REQ2.1: グラフ描画
|
|
2
|
+
|
|
3
|
+
[R2.1 — 依存関係の把握](../../要求定義/R2-ドキュメント関係の可視化/R2.1-依存関係の把握.md) と [R2.2 — 参照元の把握](../../要求定義/R2-ドキュメント関係の可視化/R2.2-参照元の把握.md) を満たすため、現在選択中のドキュメントとその関係にあるドキュメントを有向グラフで表示する。
|
|
4
|
+
|
|
5
|
+
## 要件
|
|
6
|
+
|
|
7
|
+
- 選択中ドキュメントを強調表示する
|
|
8
|
+
- 参照元が下、参照先が上になるよう矢印が上向きに配置される(breadthfirst レイアウトの Y 反転)
|
|
9
|
+
- 矢印はマークダウンリンク記法 `[label](url)` の解決結果と、本文中の自動リンクマッチの両方から生成する(URL パス内のフォルダ名は無視する)
|
|
10
|
+
- ノードにカーソルを合わせると、本文中のリンクと同じプレビューポップアップがその場で表示される(選択中ノード自身も対象)
|
|
11
|
+
- ノードをクリックするとそのドキュメントに遷移する(リンクタブはそのまま維持)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# REQ2.2: 階層切替
|
|
2
|
+
|
|
3
|
+
[R2.1 — 依存関係の把握](../../要求定義/R2-ドキュメント関係の可視化/R2.1-依存関係の把握.md) と [R2.2 — 参照元の把握](../../要求定義/R2-ドキュメント関係の可視化/R2.2-参照元の把握.md) における「深い依存も辿れる」要求を満たすため、リンクグラフで表示する連結範囲を選択中ノードからの深さで切り替えできる。
|
|
4
|
+
|
|
5
|
+
## 要件
|
|
6
|
+
|
|
7
|
+
- 1階層/2階層/3階層/全階層を切り替えられる
|
|
8
|
+
- 選択状態はブラウザのローカルストレージに保存し、再読込しても保持される
|
|
9
|
+
- 切替は即時反映される
|
|
10
|
+
- ユーザーが操作した拡大率はローカルストレージに保持し、ファイル切替・再読込後も同じ拡大率で表示される(未保存時のみ全体が収まるように初期フィット)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# REQ2.3: フォルダ除外フィルタ
|
|
2
|
+
|
|
3
|
+
[R2.1 — 依存関係の把握](../../要求定義/R2-ドキュメント関係の可視化/R2.1-依存関係の把握.md) と [R2.2 — 参照元の把握](../../要求定義/R2-ドキュメント関係の可視化/R2.2-参照元の把握.md) をノイズなく満たすため、用語集など「どこからも頻繁に参照されるフォルダ」をグラフ表示から除外できるようにする。
|
|
4
|
+
|
|
5
|
+
## 要件
|
|
6
|
+
|
|
7
|
+
- 除外対象フォルダをチェックボックス式の UI で選択できる
|
|
8
|
+
- 除外設定はローカルストレージに保存し、再読込後も保持される
|
|
9
|
+
- 除外フォルダ配下のノードとその関連エッジは、グラフから表示対象外になる
|
|
10
|
+
- ただし、現在表示中のファイル自身が除外フォルダ配下の場合は、そのビューに限りフィルタを無効化する(グラフが空になる事故を防止)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# REQ3.1: プレビューポップアップ
|
|
2
|
+
|
|
3
|
+
[R3.1 — 用語の即時確認](../../要求定義/R3-オンボーディング支援/R3.1-用語の即時確認.md) を満たすため、本文中のリンクにカーソルを合わせるとリンク先ドキュメントの内容をその場でポップアップ表示する。
|
|
4
|
+
|
|
5
|
+
## 要件
|
|
6
|
+
|
|
7
|
+
- クリック前に内容を確認できる
|
|
8
|
+
- 本文の読みを妨げない位置・大きさで出す。画面幅が狭い環境でもノードや本文を覆い隠さないよう、ビューポート幅・高さに応じて自動的に縮小される
|
|
9
|
+
- 即座に消える(離脱・スクロール時)
|
|
10
|
+
- 本文中の自動リンク(ファイル名の部分一致)と、明示的に書かれたマークダウンリンク `[label](url)` のどちらもポップアップ対象とする。マークダウンリンクはクリック時にアプリ内のナビゲーションで動作し、外部 URL にならない
|
|
11
|
+
- ポップアップ内のリンクをクリックした際は、リンクタブからの導線であっても内容タブに切り替えてから遷移する
|
|
12
|
+
|
|
13
|
+
## 関連用語
|
|
14
|
+
|
|
15
|
+
- プレビューポップアップ
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# REQ3.2: ツリービュー
|
|
2
|
+
|
|
3
|
+
[R1.2 — 大画面表示](../../要求定義/R1-ドキュメント閲覧性/R1.2-大画面表示.md) を満たすため、リポジトリ内のフォルダ/Markdown ファイルをツリー状に表示する。
|
|
4
|
+
|
|
5
|
+
## 要件
|
|
6
|
+
|
|
7
|
+
- フォルダを展開/折りたためる
|
|
8
|
+
- 折りたたみ状態はローカルストレージに保存され、再読込後も維持される。保存状態が無い初回起動時のみ、トップレベルの README 付きフォルダを展開したデフォルト状態で開始する
|
|
9
|
+
- 選択中ファイルの祖先フォルダは自動的に展開され、選択中ノードが視界に収まる
|
|
10
|
+
- 選択中ノードを視覚的に強調する
|
|
11
|
+
|
|
12
|
+
## 関連用語
|
|
13
|
+
|
|
14
|
+
- ツリービュー
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# REQ4.1: 戻る/進む
|
|
2
|
+
|
|
3
|
+
[R1.3 — ナビゲーション履歴](../../要求定義/R1-ドキュメント閲覧性/R1.3-ナビゲーション履歴.md) を満たすため、ドキュメントヘッダ部に戻る/進むボタンを置き、ブラウザの履歴操作と同等の挙動を提供する。
|
|
4
|
+
|
|
5
|
+
## 要件
|
|
6
|
+
|
|
7
|
+
- 直前に見ていたドキュメントが存在する場合のみ、戻るボタンを表示する
|
|
8
|
+
- 戻った後に前方履歴が存在する場合のみ、進むボタンを表示する
|
|
9
|
+
- リンク等で新規にナビゲートしたタイミングで前方履歴はクリアされる(ブラウザと同じ挙動)
|
|
10
|
+
- 戻る/進むでのファイル切替は、リンククリックと同じ扱いでタブ状態・プレビュー状態もクリーンにする
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import type { NextRequest } from "next/server";
|
|
3
|
+
|
|
4
|
+
const DOCS_ROOT = process.env.MARKSHELF_ROOT || process.cwd();
|
|
5
|
+
const IGNORE_PATTERNS = [
|
|
6
|
+
/(^|\/)node_modules(\/|$)/,
|
|
7
|
+
/(^|\/)\.git(\/|$)/,
|
|
8
|
+
/(^|\/)\.next(\/|$)/,
|
|
9
|
+
/(^|\/)dist(\/|$)/,
|
|
10
|
+
/(^|\/)\.turbo(\/|$)/,
|
|
11
|
+
];
|
|
12
|
+
|
|
13
|
+
function isIgnored(rel: string): boolean {
|
|
14
|
+
if (rel.startsWith(".")) return true;
|
|
15
|
+
return IGNORE_PATTERNS.some((p) => p.test(rel));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function GET(request: NextRequest) {
|
|
19
|
+
const encoder = new TextEncoder();
|
|
20
|
+
let watcher: fs.FSWatcher | null = null;
|
|
21
|
+
let keepAlive: ReturnType<typeof setInterval> | null = null;
|
|
22
|
+
let closed = false;
|
|
23
|
+
|
|
24
|
+
const cleanup = () => {
|
|
25
|
+
if (closed) return;
|
|
26
|
+
closed = true;
|
|
27
|
+
try {
|
|
28
|
+
watcher?.close();
|
|
29
|
+
} catch {
|
|
30
|
+
/* ignore */
|
|
31
|
+
}
|
|
32
|
+
if (keepAlive) clearInterval(keepAlive);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
request.signal.addEventListener("abort", cleanup);
|
|
36
|
+
|
|
37
|
+
const stream = new ReadableStream({
|
|
38
|
+
start(controller) {
|
|
39
|
+
const send = (event: string, data: object) => {
|
|
40
|
+
if (closed) return;
|
|
41
|
+
try {
|
|
42
|
+
controller.enqueue(
|
|
43
|
+
encoder.encode(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`),
|
|
44
|
+
);
|
|
45
|
+
} catch {
|
|
46
|
+
cleanup();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
send("connected", { root: DOCS_ROOT });
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
watcher = fs.watch(
|
|
54
|
+
DOCS_ROOT,
|
|
55
|
+
{ recursive: true, persistent: false },
|
|
56
|
+
(_eventType, filename) => {
|
|
57
|
+
if (!filename) return;
|
|
58
|
+
const rel = String(filename).replace(/\\/g, "/");
|
|
59
|
+
if (isIgnored(rel)) return;
|
|
60
|
+
send("change", { path: rel });
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
} catch (e) {
|
|
64
|
+
send("error", { message: String(e) });
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
keepAlive = setInterval(() => {
|
|
68
|
+
if (closed) return;
|
|
69
|
+
try {
|
|
70
|
+
controller.enqueue(encoder.encode(": keepalive\n\n"));
|
|
71
|
+
} catch {
|
|
72
|
+
cleanup();
|
|
73
|
+
}
|
|
74
|
+
}, 30000);
|
|
75
|
+
},
|
|
76
|
+
cancel() {
|
|
77
|
+
cleanup();
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
return new Response(stream, {
|
|
82
|
+
headers: {
|
|
83
|
+
"Content-Type": "text/event-stream; charset=utf-8",
|
|
84
|
+
"Cache-Control": "no-cache, no-transform",
|
|
85
|
+
Connection: "keep-alive",
|
|
86
|
+
"X-Accel-Buffering": "no",
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { useEffect, useState, useCallback, useMemo
|
|
3
|
+
import { useEffect, useState, useCallback, useMemo } from "react";
|
|
4
4
|
import { TreeView } from "@/components/TreeView";
|
|
5
5
|
import { DetailPanel } from "@/components/DetailPanel";
|
|
6
6
|
import { SearchBar } from "@/components/SearchBar";
|
|
7
7
|
import { TimelinePanel } from "@/components/TimelinePanel";
|
|
8
|
+
import { useRefreshTick } from "@/lib/useRefreshTick";
|
|
8
9
|
import { Clock } from "lucide-react";
|
|
9
10
|
|
|
10
11
|
interface TreeEntry {
|
|
@@ -22,21 +23,36 @@ export default function Home() {
|
|
|
22
23
|
const [selectedPath, setSelectedPath] = useState<string | null>(null);
|
|
23
24
|
const [treeWidth, setTreeWidth] = useState(260);
|
|
24
25
|
const [showTimeline, setShowTimeline] = useState(false);
|
|
25
|
-
const
|
|
26
|
+
const [backStack, setBackStack] = useState<string[]>([]);
|
|
27
|
+
const [forwardStack, setForwardStack] = useState<string[]>([]);
|
|
26
28
|
|
|
27
29
|
const navigateTo = useCallback((path: string | null) => {
|
|
28
30
|
if (selectedPath && path !== selectedPath) {
|
|
29
|
-
|
|
31
|
+
setBackStack((s) => [...s, selectedPath]);
|
|
32
|
+
setForwardStack([]);
|
|
30
33
|
}
|
|
31
34
|
setSelectedPath(path);
|
|
32
35
|
}, [selectedPath]);
|
|
33
36
|
|
|
34
37
|
const goBack = useCallback(() => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
if (backStack.length === 0) return;
|
|
39
|
+
const prev = backStack[backStack.length - 1];
|
|
40
|
+
if (selectedPath) setForwardStack((s) => [...s, selectedPath]);
|
|
41
|
+
setBackStack((s) => s.slice(0, -1));
|
|
42
|
+
setSelectedPath(prev);
|
|
43
|
+
}, [backStack, selectedPath]);
|
|
44
|
+
|
|
45
|
+
const goForward = useCallback(() => {
|
|
46
|
+
if (forwardStack.length === 0) return;
|
|
47
|
+
const next = forwardStack[forwardStack.length - 1];
|
|
48
|
+
if (selectedPath) setBackStack((s) => [...s, selectedPath]);
|
|
49
|
+
setForwardStack((s) => s.slice(0, -1));
|
|
50
|
+
setSelectedPath(next);
|
|
51
|
+
}, [forwardStack, selectedPath]);
|
|
38
52
|
|
|
39
|
-
const canGoBack =
|
|
53
|
+
const canGoBack = backStack.length > 0;
|
|
54
|
+
const canGoForward = forwardStack.length > 0;
|
|
55
|
+
const refreshTick = useRefreshTick();
|
|
40
56
|
|
|
41
57
|
useEffect(() => {
|
|
42
58
|
fetch("/api/tree")
|
|
@@ -45,7 +61,7 @@ export default function Home() {
|
|
|
45
61
|
setTree(data.tree ?? []);
|
|
46
62
|
setRoot(data.root ?? "");
|
|
47
63
|
});
|
|
48
|
-
}, []);
|
|
64
|
+
}, [refreshTick]);
|
|
49
65
|
|
|
50
66
|
useEffect(() => {
|
|
51
67
|
const saved = localStorage.getItem("markshelf:treeWidth");
|
|
@@ -71,6 +87,20 @@ export default function Home() {
|
|
|
71
87
|
return flatten(tree);
|
|
72
88
|
}, [tree]);
|
|
73
89
|
|
|
90
|
+
const folders = useMemo(() => {
|
|
91
|
+
const result: { path: string; displayName: string; depth: number }[] = [];
|
|
92
|
+
function walk(entries: TreeEntry[], depth: number) {
|
|
93
|
+
for (const e of entries) {
|
|
94
|
+
if (e.type === "folder") {
|
|
95
|
+
result.push({ path: e.path, displayName: e.displayName, depth });
|
|
96
|
+
if (e.children) walk(e.children, depth + 1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
walk(tree, 0);
|
|
101
|
+
return result;
|
|
102
|
+
}, [tree]);
|
|
103
|
+
|
|
74
104
|
const startResize = useCallback((e: React.MouseEvent) => {
|
|
75
105
|
e.preventDefault();
|
|
76
106
|
document.body.style.userSelect = "none";
|
|
@@ -140,9 +170,12 @@ export default function Home() {
|
|
|
140
170
|
<DetailPanel
|
|
141
171
|
filePath={selectedPath}
|
|
142
172
|
fileRefs={fileRefs}
|
|
173
|
+
folders={folders}
|
|
143
174
|
onNavigate={navigateTo}
|
|
144
175
|
onGoBack={goBack}
|
|
176
|
+
onGoForward={goForward}
|
|
145
177
|
canGoBack={canGoBack}
|
|
178
|
+
canGoForward={canGoForward}
|
|
146
179
|
/>
|
|
147
180
|
) : (
|
|
148
181
|
<div className="p-6 text-[var(--text-muted)] text-sm flex items-center justify-center h-full">
|