markshelf 0.1.5 → 0.2.2

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 (180) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/app-path-routes-manifest.json +1 -0
  3. package/.next/standalone/.next/build-manifest.json +3 -3
  4. package/.next/standalone/.next/prerender-manifest.json +3 -3
  5. package/.next/standalone/.next/required-server-files.json +20 -20
  6. package/.next/standalone/.next/routes-manifest.json +6 -0
  7. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  16. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  17. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  18. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  20. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next/standalone/.next/server/app/api/asset/route/app-paths-manifest.json +3 -0
  24. package/.next/standalone/.next/server/app/api/asset/route/build-manifest.json +9 -0
  25. package/.next/standalone/.next/server/app/api/asset/route/server-reference-manifest.json +4 -0
  26. package/.next/standalone/.next/server/app/api/asset/route.js +7 -0
  27. package/.next/standalone/.next/server/app/api/asset/route.js.map +5 -0
  28. package/.next/standalone/.next/server/app/api/asset/route.js.nft.json +1 -0
  29. package/.next/standalone/.next/server/app/api/asset/route_client-reference-manifest.js +3 -0
  30. package/.next/standalone/.next/server/app/api/diff/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/file/route.js.nft.json +1 -1
  32. package/.next/standalone/.next/server/app/api/graph/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/history/route.js.nft.json +1 -1
  34. package/.next/standalone/.next/server/app/api/search/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/timeline/route.js.nft.json +1 -1
  36. package/.next/standalone/.next/server/app/api/tree/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/index.html +1 -1
  38. package/.next/standalone/.next/server/app/index.rsc +3 -3
  39. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  40. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  41. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  42. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  43. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  44. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  45. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  46. package/.next/standalone/.next/server/app-paths-manifest.json +1 -0
  47. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-_k816._.js +1 -1
  48. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01e7zo7._.js +1 -1
  49. package/.next/standalone/.next/server/chunks/[root-of-the-server]__04mxfkc._.js +3 -0
  50. package/.next/standalone/.next/server/chunks/[root-of-the-server]__053gm34._.js +1 -1
  51. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d.-s5p._.js +1 -1
  52. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nr71d2._.js +1 -1
  53. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rwylex._.js +1 -1
  54. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13vatcq._.js +1 -1
  55. package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_asset_route_actions_03nkw38.js +3 -0
  56. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__05ar4zx._.js +1 -1
  57. package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__09qrkq5._.js +1 -1
  58. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__11e9~iq._.js → [root-of-the-server]__0u7hi3-._.js} +2 -2
  59. package/.next/standalone/.next/server/chunks/ssr/{node_modules_08z1b9i._.js → node_modules_035nqw0._.js} +1 -1
  60. package/.next/standalone/.next/server/chunks/ssr/{node_modules_0u-.0s2._.js → node_modules_0_lpyzd._.js} +1 -1
  61. package/.next/standalone/.next/server/chunks/ssr/{node_modules_0vqo_80._.js → node_modules_0d0g.gp._.js} +1 -1
  62. package/.next/standalone/.next/server/chunks/ssr/{node_modules_0~k33bz._.js → node_modules_0m258l0._.js} +1 -1
  63. package/.next/standalone/.next/server/chunks/ssr/{node_modules_10a06qi._.js → node_modules_0sxu8tl._.js} +1 -1
  64. package/.next/standalone/.next/server/chunks/ssr/{node_modules_0xmn29o._.js → node_modules_0ub-k6d._.js} +1 -1
  65. package/.next/standalone/.next/server/chunks/ssr/{node_modules_0f-9xhq._.js → node_modules_0uebmgu._.js} +1 -1
  66. package/.next/standalone/.next/server/chunks/ssr/{node_modules_02chd8n._.js → node_modules_0~vmgv6._.js} +1 -1
  67. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  68. package/.next/standalone/.next/server/pages/404.html +1 -1
  69. package/.next/standalone/.next/server/pages/500.html +1 -1
  70. package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
  71. package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
  72. package/.next/standalone/.next/static/chunks/0.9a.v2u8pdez.css +1 -0
  73. package/.next/standalone/.next/static/chunks/{0wy.nfhujao0b.js → 10.v6fb-ptj.a.js} +3 -3
  74. package/.next/standalone/Dockerfile +54 -0
  75. package/.next/standalone/LICENSE +21 -0
  76. package/.next/standalone/README.md +71 -21
  77. package/.next/standalone/RELEASING.md +56 -0
  78. package/.next/standalone/docker/README.md +65 -0
  79. package/.next/standalone/docker-entrypoint.sh +40 -0
  80. package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/README.md +6 -1
  81. package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.2-Dockerfile.md +18 -0
  82. package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.3-basePath.md +11 -0
  83. package/.next/standalone/docs//344/273/225/346/247/230/SPEC1-CLI/SPEC1.4-/347/222/260/345/242/203/345/244/211/346/225/260.md +14 -0
  84. 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.3-/343/203/252/343/203/263/343/202/257/350/247/243/346/236/220.md +32 -0
  85. 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 +10 -1
  86. 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.3-TableOfContents.md +11 -0
  87. 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.4-DetailPanel/343/202/277/343/203/226.md +13 -0
  88. 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.5-Markdown/343/203/254/343/203/263/343/203/200/343/203/252/343/203/263/343/202/260.md +22 -0
  89. 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.6-SearchBar.md +15 -0
  90. 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.7-/343/203/221/343/203/215/343/203/253/343/203/252/343/202/265/343/202/244/343/202/266/343/203/274.md +11 -0
  91. 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.8-/347/224/273/345/203/217/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274.md +11 -0
  92. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/README.md +12 -0
  93. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.1-tree.md +23 -0
  94. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.2-file.md +14 -0
  95. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.3-search.md +23 -0
  96. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.4-watch.md +17 -0
  97. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.5-history.md +22 -0
  98. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.6-timeline.md +26 -0
  99. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.7-diff.md +13 -0
  100. package/.next/standalone/docs//344/273/225/346/247/230/SPEC4-API/SPEC4.8-asset.md +22 -0
  101. package/.next/standalone/docs//344/273/225/346/247/230/SPEC5-/346/260/270/347/266/232/345/214/226/README.md +8 -0
  102. package/.next/standalone/docs//344/273/225/346/247/230/SPEC5-/346/260/270/347/266/232/345/214/226/SPEC5.1-localStorage.md +20 -0
  103. package/.next/standalone/docs//344/273/225/346/247/230/SPEC5-/346/260/270/347/266/232/345/214/226/SPEC5.2-URL/343/202/257/343/202/250/343/203/252.md +17 -0
  104. 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 -1
  105. 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.2-Docker/350/265/267/345/213/225.md +14 -0
  106. 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.3-BASE_PATH/351/205/215/344/277/241.md +10 -0
  107. 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 +2 -0
  108. 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.3-/347/233/256/346/254/241.md +10 -0
  109. 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.4-/343/203/221/343/203/215/343/203/253/343/203/252/343/202/265/343/202/244/343/202/266/343/203/274.md +10 -0
  110. 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.5-/343/202/277/343/203/226/343/202/267/343/202/271/343/203/206/343/203/240.md +10 -0
  111. 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.6-/347/224/273/345/203/217/343/203/227/343/203/254/343/203/223/343/203/245/343/203/274.md +10 -0
  112. 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 +1 -1
  113. 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.2-/345/205/261/346/234/211/345/217/257/350/203/275URL.md +10 -0
  114. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ5-/343/203/225/343/202/241/343/202/244/343/203/253/346/244/234/347/264/242/README.md +3 -0
  115. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ5-/343/203/225/343/202/241/343/202/244/343/203/253/346/244/234/347/264/242/REQ5.1-/343/203/225/343/202/241/343/202/244/343/203/253/345/220/215/346/244/234/347/264/242.md +11 -0
  116. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ6-/343/203/225/343/202/241/343/202/244/343/203/253/347/233/243/350/246/226/README.md +3 -0
  117. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ6-/343/203/225/343/202/241/343/202/244/343/203/253/347/233/243/350/246/226/REQ6.1-SSE/345/244/211/346/233/264/351/200/232/347/237/245.md +10 -0
  118. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/README.md +3 -0
  119. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/REQ7.1-/343/203/225/343/202/241/343/202/244/343/203/253/345/244/211/346/233/264/345/261/245/346/255/264.md +10 -0
  120. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/REQ7.2-/343/202/277/343/202/244/343/203/240/343/203/251/343/202/244/343/203/263.md +10 -0
  121. package/.next/standalone/docs//350/246/201/344/273/266/345/256/232/347/276/251/REQ7-/345/244/211/346/233/264/345/261/245/346/255/264/REQ7.3-diff/350/241/250/347/244/272.md +10 -0
  122. 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.4-/344/277/235/345/255/230/345/215/263/345/217/215/346/230/240.md +9 -0
  123. 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.5-/345/205/261/346/234/211/345/217/257/350/203/275URL.md +9 -0
  124. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R4-/345/244/211/346/233/264/345/261/245/346/255/264/343/201/256/346/212/212/346/217/241/R4.1-/345/244/211/346/233/264/345/206/205/345/256/271/343/201/256/350/277/275/350/267/241.md +9 -0
  125. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R4-/345/244/211/346/233/264/345/261/245/346/255/264/343/201/256/346/212/212/346/217/241/R4.2-/345/275/261/351/237/277/347/257/204/345/233/262/343/201/256/344/277/257/347/236/260.md +9 -0
  126. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R4-/345/244/211/346/233/264/345/261/245/346/255/264/343/201/256/346/212/212/346/217/241/README.md +7 -0
  127. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R5-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/346/216/242/347/264/242/346/200/247/R5.1-/343/203/225/343/202/241/343/202/244/343/203/253/345/220/215/346/244/234/347/264/242.md +9 -0
  128. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R5-/343/203/211/343/202/255/343/203/245/343/203/241/343/203/263/343/203/210/346/216/242/347/264/242/346/200/247/README.md +7 -0
  129. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R6-/343/203/207/343/203/227/343/203/255/343/202/244/346/237/224/350/273/237/346/200/247/R6.1-Docker/351/205/215/344/277/241.md +9 -0
  130. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R6-/343/203/207/343/203/227/343/203/255/343/202/244/346/237/224/350/273/237/346/200/247/R6.2-/343/202/265/343/203/226/343/203/221/343/202/271/351/205/215/344/277/241.md +9 -0
  131. package/.next/standalone/docs//350/246/201/346/261/202/345/256/232/347/276/251/R6-/343/203/207/343/203/227/343/203/255/343/202/244/346/237/224/350/273/237/346/200/247/README.md +7 -0
  132. package/.next/standalone/next.config.ts +7 -0
  133. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/README.md +46 -0
  134. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  135. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/index.js +1 -0
  136. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  137. package/.next/standalone/node_modules/@img/sharp-libvips-linux-x64/package.json +42 -0
  138. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/README.md +46 -0
  139. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/glib-2.0/include/glibconfig.h +221 -0
  140. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  141. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  142. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  143. package/.next/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  144. package/.next/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  145. package/.next/standalone/node_modules/@img/{sharp-win32-x64 → sharp-linux-x64}/package.json +46 -39
  146. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  147. package/.next/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  148. package/.next/standalone/package-lock.json +2 -2
  149. package/.next/standalone/package.json +23 -1
  150. package/.next/standalone/scripts/docker-run.mjs +34 -0
  151. package/.next/standalone/server.js +1 -1
  152. package/.next/standalone/src/app/api/asset/route.ts +40 -0
  153. package/.next/standalone/src/app/page.tsx +31 -1
  154. package/.next/standalone/src/components/DetailPanel.tsx +2 -1
  155. package/.next/standalone/src/components/DiffView.tsx +2 -1
  156. package/.next/standalone/src/components/HistoryPanel.tsx +2 -1
  157. package/.next/standalone/src/components/LinkGraph.tsx +13 -1
  158. package/.next/standalone/src/components/Markdown.tsx +68 -3
  159. package/.next/standalone/src/components/PreviewPopup.tsx +2 -1
  160. package/.next/standalone/src/components/SearchBar.tsx +2 -1
  161. package/.next/standalone/src/components/TimelinePanel.tsx +2 -1
  162. package/.next/standalone/src/lib/basePath.ts +8 -0
  163. package/.next/standalone/src/lib/docs.ts +12 -0
  164. package/.next/standalone/src/lib/useRefreshTick.ts +2 -1
  165. package/.next/static/chunks/0.9a.v2u8pdez.css +1 -0
  166. package/.next/static/chunks/{0wy.nfhujao0b.js → 10.v6fb-ptj.a.js} +3 -3
  167. package/LICENSE +21 -0
  168. package/README.md +71 -21
  169. package/package.json +23 -1
  170. package/.next/standalone/.next/static/chunks/0b42--.p9znhl.css +0 -1
  171. package/.next/standalone/node_modules/@img/sharp-win32-x64/lib/sharp-win32-x64.node +0 -0
  172. package/.next/standalone/tsconfig.tsbuildinfo +0 -1
  173. package/.next/static/chunks/0b42--.p9znhl.css +0 -1
  174. /package/.next/standalone/.next/static/{pOQs5i4GMjDH6W5XDSjRs → 03Y0Qmra9pQhnypCdj6Wp}/_buildManifest.js +0 -0
  175. /package/.next/standalone/.next/static/{pOQs5i4GMjDH6W5XDSjRs → 03Y0Qmra9pQhnypCdj6Wp}/_clientMiddlewareManifest.js +0 -0
  176. /package/.next/standalone/.next/static/{pOQs5i4GMjDH6W5XDSjRs → 03Y0Qmra9pQhnypCdj6Wp}/_ssgManifest.js +0 -0
  177. /package/.next/standalone/node_modules/@img/{sharp-win32-x64 → sharp-libvips-linux-x64}/versions.json +0 -0
  178. /package/.next/static/{pOQs5i4GMjDH6W5XDSjRs → 03Y0Qmra9pQhnypCdj6Wp}/_buildManifest.js +0 -0
  179. /package/.next/static/{pOQs5i4GMjDH6W5XDSjRs → 03Y0Qmra9pQhnypCdj6Wp}/_clientMiddlewareManifest.js +0 -0
  180. /package/.next/static/{pOQs5i4GMjDH6W5XDSjRs → 03Y0Qmra9pQhnypCdj6Wp}/_ssgManifest.js +0 -0
@@ -1,39 +1,46 @@
1
- {
2
- "name": "@img/sharp-win32-x64",
3
- "version": "0.34.5",
4
- "description": "Prebuilt sharp for use with Windows x64",
5
- "author": "Lovell Fuller <npm@lovell.info>",
6
- "homepage": "https://sharp.pixelplumbing.com",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/lovell/sharp.git",
10
- "directory": "npm/win32-x64"
11
- },
12
- "license": "Apache-2.0 AND LGPL-3.0-or-later",
13
- "funding": {
14
- "url": "https://opencollective.com/libvips"
15
- },
16
- "preferUnplugged": true,
17
- "files": [
18
- "lib",
19
- "versions.json"
20
- ],
21
- "publishConfig": {
22
- "access": "public"
23
- },
24
- "type": "commonjs",
25
- "exports": {
26
- "./sharp.node": "./lib/sharp-win32-x64.node",
27
- "./package": "./package.json",
28
- "./versions": "./versions.json"
29
- },
30
- "engines": {
31
- "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
32
- },
33
- "os": [
34
- "win32"
35
- ],
36
- "cpu": [
37
- "x64"
38
- ]
39
- }
1
+ {
2
+ "name": "@img/sharp-linux-x64",
3
+ "version": "0.34.5",
4
+ "description": "Prebuilt sharp for use with Linux (glibc) x64",
5
+ "author": "Lovell Fuller <npm@lovell.info>",
6
+ "homepage": "https://sharp.pixelplumbing.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/lovell/sharp.git",
10
+ "directory": "npm/linux-x64"
11
+ },
12
+ "license": "Apache-2.0",
13
+ "funding": {
14
+ "url": "https://opencollective.com/libvips"
15
+ },
16
+ "preferUnplugged": true,
17
+ "optionalDependencies": {
18
+ "@img/sharp-libvips-linux-x64": "1.2.4"
19
+ },
20
+ "files": [
21
+ "lib"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "type": "commonjs",
27
+ "exports": {
28
+ "./sharp.node": "./lib/sharp-linux-x64.node",
29
+ "./package": "./package.json"
30
+ },
31
+ "engines": {
32
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
33
+ },
34
+ "config": {
35
+ "glibc": ">=2.26"
36
+ },
37
+ "os": [
38
+ "linux"
39
+ ],
40
+ "libc": [
41
+ "glibc"
42
+ ],
43
+ "cpu": [
44
+ "x64"
45
+ ]
46
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "@img/sharp-linuxmusl-x64",
3
+ "version": "0.34.5",
4
+ "description": "Prebuilt sharp for use with Linux (musl) x64",
5
+ "author": "Lovell Fuller <npm@lovell.info>",
6
+ "homepage": "https://sharp.pixelplumbing.com",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/lovell/sharp.git",
10
+ "directory": "npm/linuxmusl-x64"
11
+ },
12
+ "license": "Apache-2.0",
13
+ "funding": {
14
+ "url": "https://opencollective.com/libvips"
15
+ },
16
+ "preferUnplugged": true,
17
+ "optionalDependencies": {
18
+ "@img/sharp-libvips-linuxmusl-x64": "1.2.4"
19
+ },
20
+ "files": [
21
+ "lib"
22
+ ],
23
+ "publishConfig": {
24
+ "access": "public"
25
+ },
26
+ "type": "commonjs",
27
+ "exports": {
28
+ "./sharp.node": "./lib/sharp-linuxmusl-x64.node",
29
+ "./package": "./package.json"
30
+ },
31
+ "engines": {
32
+ "node": "^18.17.0 || ^20.3.0 || >=21.0.0"
33
+ },
34
+ "config": {
35
+ "musl": ">=1.2.2"
36
+ },
37
+ "os": [
38
+ "linux"
39
+ ],
40
+ "libc": [
41
+ "musl"
42
+ ],
43
+ "cpu": [
44
+ "x64"
45
+ ]
46
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "markshelf",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "markshelf",
9
- "version": "0.1.0",
9
+ "version": "0.2.2",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@tailwindcss/typography": "^0.5.19",
@@ -1,8 +1,28 @@
1
1
  {
2
2
  "name": "markshelf",
3
- "version": "0.1.5",
3
+ "version": "0.2.2",
4
4
  "description": "Structured markdown viewer for git repositories",
5
5
  "license": "MIT",
6
+ "author": "sksp.work",
7
+ "homepage": "https://github.com/skspwork/markshelf#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/skspwork/markshelf.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/skspwork/markshelf/issues"
14
+ },
15
+ "keywords": [
16
+ "markdown",
17
+ "viewer",
18
+ "docs",
19
+ "documentation",
20
+ "git",
21
+ "nextjs",
22
+ "graph",
23
+ "knowledge-base",
24
+ "oss"
25
+ ],
6
26
  "bin": {
7
27
  "markshelf": "./bin/cli.mjs"
8
28
  },
@@ -16,6 +36,8 @@
16
36
  "dev": "next dev --hostname 0.0.0.0",
17
37
  "build": "next build && node scripts/pack-static.mjs",
18
38
  "start": "next start",
39
+ "docker:build": "docker build -t markshelf-base .",
40
+ "docker:run": "node scripts/docker-run.mjs",
19
41
  "prepublishOnly": "npm run build"
20
42
  },
21
43
  "dependencies": {
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ // Cross-platform wrapper for `docker run` so $PWD / %cd% differences don't bite us.
3
+ //
4
+ // 規約: コマンドは git リポジトリのルートで叩く。
5
+ // - .git が docs の親にある構成 (例: repo/.git + repo/docs/) → そのまま起動、デフォルトで docs/ を読む
6
+ // - docs 自身がリポジトリの構成 (docsRepo/.git + docsRepo/*.md) → MARKSHELF_DOCS=. を渡す
7
+ // - docs フォルダ名が異なる/ネストしている場合は MARKSHELF_DOCS にリポジトリルートからの相対パスを渡す
8
+ // 履歴・タイムライン両方が機能するために、コンテナへは .git を含むリポジトリ全体を読み取り専用でマウントする。
9
+ import { spawn } from "node:child_process";
10
+ import path from "node:path";
11
+
12
+ const repoRoot = path.resolve(process.cwd());
13
+ const docsRel = (process.env.MARKSHELF_DOCS || "docs").replace(/\\/g, "/");
14
+ const containerDocsRoot = path.posix.join("/workspace", docsRel);
15
+
16
+ const args = [
17
+ "run",
18
+ "--rm",
19
+ "-p",
20
+ "3000:3000",
21
+ "-v",
22
+ `${repoRoot}:/workspace:ro`,
23
+ "-e",
24
+ `MARKSHELF_ROOT=${containerDocsRoot}`,
25
+ ...process.argv.slice(2),
26
+ "markshelf-base",
27
+ ];
28
+
29
+ const child = spawn("docker", args, { stdio: "inherit" });
30
+ child.on("exit", (code) => process.exit(code ?? 1));
31
+ child.on("error", (err) => {
32
+ console.error("[docker-run] failed to spawn docker:", err.message);
33
+ process.exit(1);
34
+ });
@@ -9,7 +9,7 @@ const currentPort = parseInt(process.env.PORT, 10) || 3000
9
9
  const hostname = process.env.HOSTNAME || '0.0.0.0'
10
10
 
11
11
  let keepAliveTimeout = parseInt(process.env.KEEP_ALIVE_TIMEOUT, 10)
12
- const nextConfig = {"env":{},"webpack":null,"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":false,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"C:\\sksp\\mark-shelf","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":false,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"partialFallbacks":false,"dynamicOnHover":false,"varyParams":false,"prefetchInlining":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":7,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","turbopack":{"root":"C:\\sksp\\mark-shelf"},"distDirRoot":".next"}
12
+ const nextConfig = {"env":{},"webpack":null,"typescript":{"ignoreBuildErrors":false},"typedRoutes":false,"distDir":"./.next","cleanDistDir":true,"assetPrefix":"","cacheMaxMemorySize":52428800,"configOrigin":"next.config.ts","useFileSystemPublicRoutes":true,"generateEtags":true,"pageExtensions":["tsx","ts","jsx","js"],"poweredByHeader":true,"compress":true,"images":{"deviceSizes":[640,750,828,1080,1200,1920,2048,3840],"imageSizes":[32,48,64,96,128,256,384],"path":"/_next/image","loader":"default","loaderFile":"","domains":[],"disableStaticImages":false,"minimumCacheTTL":14400,"formats":["image/webp"],"maximumRedirects":3,"maximumResponseBody":50000000,"dangerouslyAllowLocalIP":false,"dangerouslyAllowSVG":false,"contentSecurityPolicy":"script-src 'none'; frame-src 'none'; sandbox;","contentDispositionType":"attachment","localPatterns":[{"pathname":"**","search":""}],"remotePatterns":[],"qualities":[75],"unoptimized":false,"customCacheHandler":false},"devIndicators":{"position":"bottom-left"},"onDemandEntries":{"maxInactiveAge":60000,"pagesBufferLength":5},"basePath":"","sassOptions":{},"trailingSlash":false,"i18n":null,"productionBrowserSourceMaps":false,"excludeDefaultMomentLocales":true,"reactProductionProfiling":false,"reactStrictMode":null,"reactMaxHeadersLength":6000,"httpAgentOptions":{"keepAlive":true},"logging":{"serverFunctions":true,"browserToTerminal":"warn"},"compiler":{},"expireTime":31536000,"staticPageGenerationTimeout":60,"output":"standalone","modularizeImports":{"@mui/icons-material":{"transform":"@mui/icons-material/{{member}}"},"lodash":{"transform":"lodash/{{member}}"}},"outputFileTracingRoot":"/home/runner/work/markshelf/markshelf","cacheComponents":false,"cacheLife":{"default":{"stale":300,"revalidate":900,"expire":4294967294},"seconds":{"stale":30,"revalidate":1,"expire":60},"minutes":{"stale":300,"revalidate":60,"expire":3600},"hours":{"stale":300,"revalidate":3600,"expire":86400},"days":{"stale":300,"revalidate":86400,"expire":604800},"weeks":{"stale":300,"revalidate":604800,"expire":2592000},"max":{"stale":300,"revalidate":2592000,"expire":31536000}},"cacheHandlers":{},"experimental":{"appNewScrollHandler":false,"useSkewCookie":false,"cssChunking":true,"multiZoneDraftMode":false,"appNavFailHandling":false,"prerenderEarlyExit":true,"serverMinification":true,"linkNoTouchStart":false,"caseSensitiveRoutes":false,"cachedNavigations":false,"partialFallbacks":false,"dynamicOnHover":false,"varyParams":false,"prefetchInlining":false,"preloadEntriesOnStart":true,"clientRouterFilter":true,"clientRouterFilterRedirects":false,"fetchCacheKeyPrefix":"","proxyPrefetch":"flexible","optimisticClientCache":true,"manualClientBasePath":false,"cpus":3,"memoryBasedWorkersCount":false,"imgOptConcurrency":null,"imgOptTimeoutInSeconds":7,"imgOptMaxInputPixels":268402689,"imgOptSequentialRead":null,"imgOptSkipMetadata":null,"isrFlushToDisk":true,"workerThreads":false,"optimizeCss":false,"nextScriptWorkers":false,"scrollRestoration":false,"externalDir":false,"disableOptimizedLoading":false,"gzipSize":true,"craCompat":false,"esmExternals":true,"fullySpecified":false,"swcTraceProfiling":false,"forceSwcTransforms":false,"largePageDataBytes":128000,"typedEnv":false,"parallelServerCompiles":false,"parallelServerBuildTraces":false,"ppr":false,"authInterrupts":false,"webpackMemoryOptimizations":false,"optimizeServerReact":true,"strictRouteTypes":false,"viewTransition":false,"removeUncaughtErrorAndRejectionListeners":false,"validateRSCRequestHeaders":false,"staleTimes":{"dynamic":0,"static":300},"reactDebugChannel":true,"serverComponentsHmrCache":true,"staticGenerationMaxConcurrency":8,"staticGenerationMinPagesPerWorker":25,"transitionIndicator":false,"gestureTransition":false,"inlineCss":false,"useCache":false,"globalNotFound":false,"browserDebugInfoInTerminal":"warn","lockDistDir":true,"proxyClientMaxBodySize":10485760,"hideLogsAfterAbort":false,"mcpServer":true,"turbopackFileSystemCacheForDev":true,"turbopackFileSystemCacheForBuild":false,"turbopackInferModuleSideEffects":true,"turbopackPluginRuntimeStrategy":"childProcesses","optimizePackageImports":["lucide-react","date-fns","lodash-es","ramda","antd","react-bootstrap","ahooks","@ant-design/icons","@headlessui/react","@headlessui-float/react","@heroicons/react/20/solid","@heroicons/react/24/solid","@heroicons/react/24/outline","@visx/visx","@tremor/react","rxjs","@mui/material","@mui/icons-material","recharts","react-use","effect","@effect/schema","@effect/platform","@effect/platform-node","@effect/platform-browser","@effect/platform-bun","@effect/sql","@effect/sql-mssql","@effect/sql-mysql2","@effect/sql-pg","@effect/sql-sqlite-node","@effect/sql-sqlite-bun","@effect/sql-sqlite-wasm","@effect/sql-sqlite-react-native","@effect/rpc","@effect/rpc-http","@effect/typeclass","@effect/experimental","@effect/opentelemetry","@material-ui/core","@material-ui/icons","@tabler/icons-react","mui-core","react-icons/ai","react-icons/bi","react-icons/bs","react-icons/cg","react-icons/ci","react-icons/di","react-icons/fa","react-icons/fa6","react-icons/fc","react-icons/fi","react-icons/gi","react-icons/go","react-icons/gr","react-icons/hi","react-icons/hi2","react-icons/im","react-icons/io","react-icons/io5","react-icons/lia","react-icons/lib","react-icons/lu","react-icons/md","react-icons/pi","react-icons/ri","react-icons/rx","react-icons/si","react-icons/sl","react-icons/tb","react-icons/tfi","react-icons/ti","react-icons/vsc","react-icons/wi"],"trustHostHeader":false,"isExperimentalCompile":false},"htmlLimitedBots":"[\\w-]+-Google|Google-[\\w-]+|Chrome-Lighthouse|Slurp|DuckDuckBot|baiduspider|yandex|sogou|bitlybot|tumblr|vkShare|quora link preview|redditbot|ia_archiver|Bingbot|BingPreview|applebot|facebookexternalhit|facebookcatalog|Twitterbot|LinkedInBot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|Yeti|googleweblight","bundlePagesRouterDependencies":false,"configFileName":"next.config.ts","turbopack":{"root":"/home/runner/work/markshelf/markshelf"},"distDirRoot":".next"}
13
13
 
14
14
  process.env.__NEXT_PRIVATE_STANDALONE_CONFIG = JSON.stringify(nextConfig)
15
15
 
@@ -0,0 +1,40 @@
1
+ import { NextRequest, NextResponse } from "next/server";
2
+ import { readAsset } from "@/lib/docs";
3
+
4
+ const MIME: Record<string, string> = {
5
+ ".png": "image/png",
6
+ ".jpg": "image/jpeg",
7
+ ".jpeg": "image/jpeg",
8
+ ".gif": "image/gif",
9
+ ".svg": "image/svg+xml",
10
+ ".webp": "image/webp",
11
+ ".avif": "image/avif",
12
+ ".ico": "image/x-icon",
13
+ ".bmp": "image/bmp",
14
+ };
15
+
16
+ export async function GET(req: NextRequest) {
17
+ const filePath = req.nextUrl.searchParams.get("path");
18
+ if (!filePath) {
19
+ return NextResponse.json({ error: "path required" }, { status: 400 });
20
+ }
21
+
22
+ const dot = filePath.lastIndexOf(".");
23
+ const ext = dot >= 0 ? filePath.slice(dot).toLowerCase() : "";
24
+ const contentType = MIME[ext];
25
+ if (!contentType) {
26
+ return NextResponse.json({ error: "unsupported media type" }, { status: 415 });
27
+ }
28
+
29
+ const data = readAsset(filePath);
30
+ if (!data) {
31
+ return NextResponse.json({ error: "not found" }, { status: 404 });
32
+ }
33
+
34
+ return new NextResponse(new Uint8Array(data), {
35
+ headers: {
36
+ "Content-Type": contentType,
37
+ "Cache-Control": "no-cache",
38
+ },
39
+ });
40
+ }
@@ -6,6 +6,7 @@ import { DetailPanel } from "@/components/DetailPanel";
6
6
  import { SearchBar } from "@/components/SearchBar";
7
7
  import { TimelinePanel } from "@/components/TimelinePanel";
8
8
  import { useRefreshTick } from "@/lib/useRefreshTick";
9
+ import { withBasePath } from "@/lib/basePath";
9
10
  import { Clock } from "lucide-react";
10
11
 
11
12
  interface TreeEntry {
@@ -17,6 +18,14 @@ interface TreeEntry {
17
18
  hasReadme?: boolean;
18
19
  }
19
20
 
21
+ const FILE_QUERY_KEY = "file";
22
+
23
+ function readFileFromUrl(): string | null {
24
+ if (typeof window === "undefined") return null;
25
+ const v = new URL(window.location.href).searchParams.get(FILE_QUERY_KEY);
26
+ return v ? decodeURIComponent(v) : null;
27
+ }
28
+
20
29
  export default function Home() {
21
30
  const [tree, setTree] = useState<TreeEntry[]>([]);
22
31
  const [root, setRoot] = useState<string>("");
@@ -26,6 +35,27 @@ export default function Home() {
26
35
  const [backStack, setBackStack] = useState<string[]>([]);
27
36
  const [forwardStack, setForwardStack] = useState<string[]>([]);
28
37
 
38
+ // Initial hydration from URL (?file=...)
39
+ useEffect(() => {
40
+ const fromUrl = readFileFromUrl();
41
+ if (fromUrl) setSelectedPath(fromUrl);
42
+ }, []);
43
+
44
+ // Keep URL in sync with selectedPath (shareable links)
45
+ useEffect(() => {
46
+ if (typeof window === "undefined") return;
47
+ const url = new URL(window.location.href);
48
+ if (selectedPath) {
49
+ url.searchParams.set(FILE_QUERY_KEY, selectedPath);
50
+ } else {
51
+ url.searchParams.delete(FILE_QUERY_KEY);
52
+ }
53
+ const next = url.pathname + (url.search ? url.search : "") + url.hash;
54
+ if (next !== window.location.pathname + window.location.search + window.location.hash) {
55
+ window.history.replaceState(null, "", next);
56
+ }
57
+ }, [selectedPath]);
58
+
29
59
  const navigateTo = useCallback((path: string | null) => {
30
60
  if (selectedPath && path !== selectedPath) {
31
61
  setBackStack((s) => [...s, selectedPath]);
@@ -55,7 +85,7 @@ export default function Home() {
55
85
  const refreshTick = useRefreshTick();
56
86
 
57
87
  useEffect(() => {
58
- fetch("/api/tree")
88
+ fetch(withBasePath("/api/tree"))
59
89
  .then((r) => r.json())
60
90
  .then((data) => {
61
91
  setTree(data.tree ?? []);
@@ -7,6 +7,7 @@ import { TableOfContents, HeadingInfo } from "./TableOfContents";
7
7
  import { PreviewPopup } from "./PreviewPopup";
8
8
  import { LinkGraph } from "./LinkGraph";
9
9
  import { useRefreshTick } from "@/lib/useRefreshTick";
10
+ import { withBasePath } from "@/lib/basePath";
10
11
  import { FileText, History, Network, ArrowLeft, ArrowRight } from "lucide-react";
11
12
 
12
13
  interface FolderInfo {
@@ -57,7 +58,7 @@ export function DetailPanel({ filePath, fileRefs, folders, onNavigate, onGoBack,
57
58
  }, [filePath]);
58
59
 
59
60
  useEffect(() => {
60
- fetch(`/api/file?path=${encodeURIComponent(filePath)}`)
61
+ fetch(withBasePath(`/api/file?path=${encodeURIComponent(filePath)}`))
61
62
  .then((r) => r.json())
62
63
  .then((data) => setContent(data.content ?? null))
63
64
  .catch(() => setContent(null));
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useEffect, useState } from "react";
4
+ import { withBasePath } from "@/lib/basePath";
4
5
 
5
6
  interface Props {
6
7
  filePath: string;
@@ -12,7 +13,7 @@ export function DiffView({ filePath, hash }: Props) {
12
13
 
13
14
  useEffect(() => {
14
15
  setDiff(null);
15
- fetch(`/api/diff?path=${encodeURIComponent(filePath)}&hash=${hash}`)
16
+ fetch(withBasePath(`/api/diff?path=${encodeURIComponent(filePath)}&hash=${hash}`))
16
17
  .then((r) => r.json())
17
18
  .then((data) => setDiff(data.diff))
18
19
  .catch(() => setDiff("(差分を取得できませんでした)"));
@@ -4,6 +4,7 @@ import { useEffect, useState } from "react";
4
4
  import { GitCommit, ChevronDown, ChevronRight } from "lucide-react";
5
5
  import { DiffView } from "./DiffView";
6
6
  import { useRefreshTick } from "@/lib/useRefreshTick";
7
+ import { withBasePath } from "@/lib/basePath";
7
8
 
8
9
  interface CommitEntry {
9
10
  hash: string;
@@ -26,7 +27,7 @@ export function HistoryPanel({ filePath }: Props) {
26
27
  useEffect(() => {
27
28
  setLoading(true);
28
29
  setExpandedHash(null);
29
- fetch(`/api/history?path=${encodeURIComponent(filePath)}`)
30
+ fetch(withBasePath(`/api/history?path=${encodeURIComponent(filePath)}`))
30
31
  .then((r) => r.json())
31
32
  .then((data) => {
32
33
  setHistory(data);
@@ -3,6 +3,7 @@
3
3
  import { useEffect, useMemo, useRef, useState } from "react";
4
4
  import cytoscape from "cytoscape";
5
5
  import { useRefreshTick } from "@/lib/useRefreshTick";
6
+ import { withBasePath } from "@/lib/basePath";
6
7
  import { Filter } from "lucide-react";
7
8
 
8
9
  interface GraphNode {
@@ -69,6 +70,17 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
69
70
  }
70
71
  }, []);
71
72
 
73
+ useEffect(() => {
74
+ if (folders.length === 0) return;
75
+ const valid = new Set(folders.map((f) => f.path));
76
+ setExcluded((prev) => {
77
+ const next = prev.filter((p) => valid.has(p));
78
+ if (next.length === prev.length) return prev;
79
+ localStorage.setItem(EXCLUDE_KEY, JSON.stringify(next));
80
+ return next;
81
+ });
82
+ }, [folders]);
83
+
72
84
  useEffect(() => {
73
85
  if (!showFilter) return;
74
86
  const onClick = (e: MouseEvent) => {
@@ -124,7 +136,7 @@ export function LinkGraph({ currentPath, folders, onNavigate, onPreviewShow, onP
124
136
  setEmpty(false);
125
137
  setReady(false);
126
138
 
127
- fetch("/api/graph")
139
+ fetch(withBasePath("/api/graph"))
128
140
  .then((r) => r.json())
129
141
  .then((data: { nodes: GraphNode[]; edges: GraphEdge[] }) => {
130
142
  if (cancelled || !containerRef.current) return;
@@ -5,6 +5,7 @@ import ReactMarkdown, { Components } from "react-markdown";
5
5
  import remarkGfm from "remark-gfm";
6
6
  import type { HeadingInfo } from "./TableOfContents";
7
7
  import { MermaidBlock } from "./MermaidBlock";
8
+ import { withBasePath } from "@/lib/basePath";
8
9
 
9
10
  export interface FileRef {
10
11
  displayName: string;
@@ -34,9 +35,25 @@ function slugify(text: string): string {
34
35
  function parseHeadings(markdown: string): HeadingInfo[] {
35
36
  const headings: HeadingInfo[] = [];
36
37
  const seen = new Map<string, number>();
37
- const re = /^(#{1,4})\s+(.+)$/gm;
38
- let m: RegExpExecArray | null;
39
- while ((m = re.exec(markdown)) !== null) {
38
+ const headingRe = /^(#{1,4})\s+(.+)$/;
39
+ const fenceRe = /^[ \t]*(`{3,}|~{3,})/;
40
+ let fence: string | null = null;
41
+ for (const line of markdown.split("\n")) {
42
+ const fenceMatch = fenceRe.exec(line);
43
+ if (fenceMatch) {
44
+ const marker = fenceMatch[1][0];
45
+ if (fence === null) {
46
+ fence = marker;
47
+ continue;
48
+ }
49
+ if (fenceMatch[1].startsWith(fence)) {
50
+ fence = null;
51
+ continue;
52
+ }
53
+ }
54
+ if (fence !== null) continue;
55
+ const m = headingRe.exec(line);
56
+ if (!m) continue;
40
57
  const level = m[1].length;
41
58
  const text = m[2].replace(/[#*_`[\]]/g, "").trim();
42
59
  const base = slugify(text) || "heading";
@@ -147,6 +164,43 @@ export function Markdown({
147
164
  return null;
148
165
  }
149
166
 
167
+ function resolveAssetPath(src: string): string | null {
168
+ const cleanUrl = src.split("#")[0].split("?")[0].trim();
169
+ if (!cleanUrl) return null;
170
+ if (/^[a-z][a-z0-9+.-]*:/i.test(cleanUrl)) return null;
171
+ if (cleanUrl.startsWith("//")) return null;
172
+
173
+ let decoded: string;
174
+ try {
175
+ decoded = decodeURI(cleanUrl);
176
+ } catch {
177
+ decoded = cleanUrl;
178
+ }
179
+
180
+ const currentDir =
181
+ currentPath && currentPath.includes("/")
182
+ ? currentPath.slice(0, currentPath.lastIndexOf("/"))
183
+ : "";
184
+ const joined = decoded.startsWith("/")
185
+ ? decoded.slice(1)
186
+ : currentDir
187
+ ? currentDir + "/" + decoded
188
+ : decoded;
189
+
190
+ const parts = joined.split("/");
191
+ const normalized: string[] = [];
192
+ for (const p of parts) {
193
+ if (p === "" || p === ".") continue;
194
+ if (p === "..") {
195
+ normalized.pop();
196
+ continue;
197
+ }
198
+ normalized.push(p);
199
+ }
200
+ const resolved = normalized.join("/");
201
+ return resolved || null;
202
+ }
203
+
150
204
  function getIdForHeading(text: string): string {
151
205
  const ids = headingIdMap.get(text);
152
206
  if (!ids) return slugify(text) || "heading";
@@ -232,6 +286,17 @@ export function Markdown({
232
286
  }
233
287
  return <a href={href} {...rest}>{linkChildren}</a>;
234
288
  },
289
+ // Images: rewrite relative src to the asset API so files under DOCS_ROOT
290
+ // are reachable; leave absolute, data:, and protocol-relative URLs alone.
291
+ img: ({ src, alt, ...rest }) => {
292
+ if (typeof src !== "string") {
293
+ return <img src={src as string | undefined} alt={alt} {...rest} />;
294
+ }
295
+ const resolved = resolveAssetPath(src);
296
+ if (!resolved) return <img src={src} alt={alt} {...rest} />;
297
+ const apiSrc = withBasePath(`/api/asset?path=${encodeURIComponent(resolved)}`);
298
+ return <img src={apiSrc} alt={alt} {...rest} />;
299
+ },
235
300
  // Inject auto-links into text content
236
301
  p: ({ children: pChildren, ...rest }) => {
237
302
  return <p {...rest}>{processAutolinks(pChildren)}</p>;
@@ -3,6 +3,7 @@
3
3
  import { useEffect, useState, useRef, useCallback } from "react";
4
4
  import { Markdown, FileRef } from "./Markdown";
5
5
  import { useRefreshTick } from "@/lib/useRefreshTick";
6
+ import { withBasePath } from "@/lib/basePath";
6
7
  import { ExternalLink } from "lucide-react";
7
8
 
8
9
  interface Props {
@@ -45,7 +46,7 @@ export function PreviewPopup({ path, position, onNavigate, onMouseEnter, onMouse
45
46
  setContent(null);
46
47
  setNestedPath(null);
47
48
  setNestedPos(null);
48
- fetch(`/api/file?path=${encodeURIComponent(path)}`)
49
+ fetch(withBasePath(`/api/file?path=${encodeURIComponent(path)}`))
49
50
  .then((r) => r.json())
50
51
  .then((data) => setContent(data.content ?? null))
51
52
  .catch(() => setContent(null))
@@ -2,6 +2,7 @@
2
2
 
3
3
  import { useState, useRef, useCallback, useEffect } from "react";
4
4
  import { Search, X } from "lucide-react";
5
+ import { withBasePath } from "@/lib/basePath";
5
6
 
6
7
  interface SearchMatch {
7
8
  line: number;
@@ -34,7 +35,7 @@ export function SearchBar({ onSelect }: Props) {
34
35
  return;
35
36
  }
36
37
  setIsSearching(true);
37
- fetch(`/api/search?q=${encodeURIComponent(q.trim())}`)
38
+ fetch(withBasePath(`/api/search?q=${encodeURIComponent(q.trim())}`))
38
39
  .then((r) => r.json())
39
40
  .then((data) => {
40
41
  setResults(data.results ?? []);
@@ -4,6 +4,7 @@ import { useEffect, useState } from "react";
4
4
  import { GitCommit, FileText, ChevronDown, ChevronRight, X, Clock } from "lucide-react";
5
5
  import { DiffView } from "./DiffView";
6
6
  import { useRefreshTick } from "@/lib/useRefreshTick";
7
+ import { withBasePath } from "@/lib/basePath";
7
8
 
8
9
  interface TimelineEntry {
9
10
  hash: string;
@@ -49,7 +50,7 @@ export function TimelinePanel({ onNavigate, onClose }: Props) {
49
50
 
50
51
  useEffect(() => {
51
52
  setLoading(true);
52
- fetch("/api/timeline")
53
+ fetch(withBasePath("/api/timeline"))
53
54
  .then((r) => r.json())
54
55
  .then((data) => {
55
56
  setEntries(data.entries ?? []);
@@ -0,0 +1,8 @@
1
+ const raw = process.env.NEXT_PUBLIC_BASE_PATH?.trim();
2
+ const basePath =
3
+ raw && raw !== "/" && raw !== "" ? raw.replace(/\/$/, "") : "";
4
+
5
+ export function withBasePath(path: string): string {
6
+ if (!path.startsWith("/")) return path;
7
+ return basePath + path;
8
+ }
@@ -105,6 +105,18 @@ export function readFile(relPath: string): string | null {
105
105
  }
106
106
  }
107
107
 
108
+ export function readAsset(relPath: string): Buffer | null {
109
+ const fullPath = path.resolve(DOCS_ROOT, relPath);
110
+ if (!fullPath.startsWith(path.resolve(DOCS_ROOT))) return null;
111
+ try {
112
+ const stat = fs.statSync(fullPath);
113
+ if (!stat.isFile()) return null;
114
+ return fs.readFileSync(fullPath);
115
+ } catch {
116
+ return null;
117
+ }
118
+ }
119
+
108
120
  export function statFile(relPath: string): number | null {
109
121
  const fullPath = path.resolve(DOCS_ROOT, relPath);
110
122
  if (!fullPath.startsWith(path.resolve(DOCS_ROOT))) return null;
@@ -1,6 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { useEffect, useState } from "react";
4
+ import { withBasePath } from "@/lib/basePath";
4
5
 
5
6
  type Listener = (tick: number) => void;
6
7
 
@@ -17,7 +18,7 @@ function bump() {
17
18
  function ensureConnected() {
18
19
  if (eventSource || typeof window === "undefined") return;
19
20
  try {
20
- eventSource = new EventSource("/api/watch");
21
+ eventSource = new EventSource(withBasePath("/api/watch"));
21
22
  } catch {
22
23
  return;
23
24
  }