livemark 0.10.5 → 0.11.1

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 (448) hide show
  1. package/build/actions/changelog/build.d.ts +22 -0
  2. package/build/actions/changelog/build.js +198 -0
  3. package/build/actions/config/load.d.ts +12 -0
  4. package/build/actions/config/load.js +41 -0
  5. package/build/actions/config/load.unit.js +39 -0
  6. package/build/actions/target/build.d.ts +29 -0
  7. package/build/actions/target/build.js +87 -0
  8. package/build/commands/build.js +15 -0
  9. package/{target → build}/commands/escape.d.ts +1 -1
  10. package/build/commands/escape.js +62 -0
  11. package/build/commands/preview.js +19 -0
  12. package/build/commands/start.js +20 -0
  13. package/build/components/Breadcrumbs.js +14 -0
  14. package/build/components/Layout.js +66 -0
  15. package/build/components/SidebarArticles.js +46 -0
  16. package/build/components/SidebarLinks.js +27 -0
  17. package/build/components/SidebarSections.js +37 -0
  18. package/build/components/SiteTitle.js +13 -0
  19. package/build/content/article.js +55 -0
  20. package/build/content/tag.js +31 -0
  21. package/build/content-collections.js +218 -0
  22. package/{target → build}/models/config.d.ts +17 -1
  23. package/build/models/config.js +38 -0
  24. package/build/plugins/vite-livemark.d.ts +12 -0
  25. package/build/plugins/vite-livemark.js +165 -0
  26. package/build/routes/__root.js +68 -0
  27. package/build/settings.d.ts +9 -0
  28. package/build/settings.js +25 -0
  29. package/build/vite.config.js +30 -0
  30. package/package.json +9 -7
  31. package/source/actions/changelog/build.ts +26 -9
  32. package/source/actions/config/load.ts +21 -6
  33. package/source/actions/config/load.unit.ts +19 -2
  34. package/source/actions/target/build.ts +89 -0
  35. package/source/commands/build.ts +1 -0
  36. package/source/commands/escape.ts +18 -11
  37. package/source/commands/preview.ts +1 -0
  38. package/source/commands/start.ts +1 -0
  39. package/source/components/Breadcrumbs.tsx +2 -1
  40. package/source/components/Layout.tsx +3 -2
  41. package/source/components/SidebarArticles.tsx +2 -1
  42. package/source/components/SidebarLinks.tsx +2 -1
  43. package/source/components/SidebarSections.tsx +2 -1
  44. package/source/components/SiteTitle.tsx +5 -10
  45. package/source/content/article.ts +2 -1
  46. package/source/content/tag.ts +2 -1
  47. package/source/content-collections.ts +1 -1
  48. package/source/env.d.ts +2 -2
  49. package/source/models/config.ts +22 -1
  50. package/source/plugins/vite-livemark.ts +168 -94
  51. package/source/routeTree.gen.ts +86 -0
  52. package/source/routes/__root.tsx +7 -9
  53. package/source/settings.ts +13 -2
  54. package/source/vite.config.ts +4 -78
  55. package/target/actions/changelog/build.d.ts +0 -15
  56. package/target/actions/changelog/build.js +0 -187
  57. package/target/actions/config/load.d.ts +0 -5
  58. package/target/actions/config/load.js +0 -25
  59. package/target/actions/config/load.unit.js +0 -25
  60. package/target/commands/build.js +0 -14
  61. package/target/commands/escape.js +0 -56
  62. package/target/commands/preview.js +0 -18
  63. package/target/commands/start.js +0 -19
  64. package/target/components/Breadcrumbs.js +0 -13
  65. package/target/components/Layout.js +0 -65
  66. package/target/components/SidebarArticles.js +0 -45
  67. package/target/components/SidebarLinks.js +0 -26
  68. package/target/components/SidebarSections.js +0 -36
  69. package/target/components/SiteTitle.js +0 -12
  70. package/target/content/article.js +0 -54
  71. package/target/content/tag.js +0 -30
  72. package/target/content-collections.js +0 -218
  73. package/target/models/config.js +0 -34
  74. package/target/plugins/vite-livemark.d.ts +0 -18
  75. package/target/plugins/vite-livemark.js +0 -111
  76. package/target/routes/__root.js +0 -69
  77. package/target/settings.d.ts +0 -5
  78. package/target/settings.js +0 -15
  79. package/target/vite.config.js +0 -89
  80. package/{target → build}/actions/changelog/build.unit.d.ts +0 -0
  81. package/{target → build}/actions/changelog/build.unit.js +0 -0
  82. package/{target → build}/actions/config/define.d.ts +0 -0
  83. package/{target → build}/actions/config/define.js +0 -0
  84. package/{target → build}/actions/config/define.unit.d.ts +0 -0
  85. package/{target → build}/actions/config/define.unit.js +0 -0
  86. package/{target → build}/actions/config/load.unit.d.ts +0 -0
  87. package/{target → build}/client.d.ts +0 -0
  88. package/{target → build}/client.js +0 -0
  89. package/{target → build}/commands/build.d.ts +0 -0
  90. package/{target → build}/commands/preview.d.ts +0 -0
  91. package/{target → build}/commands/start.d.ts +0 -0
  92. package/{target → build}/components/Abbr.d.ts +0 -0
  93. package/{target → build}/components/Abbr.js +0 -0
  94. package/{target → build}/components/AnsiCode.d.ts +0 -0
  95. package/{target → build}/components/AnsiCode.js +0 -0
  96. package/{target → build}/components/Article.d.ts +0 -0
  97. package/{target → build}/components/Article.js +0 -0
  98. package/{target → build}/components/BackToTop.d.ts +0 -0
  99. package/{target → build}/components/BackToTop.js +0 -0
  100. package/{target → build}/components/Banner.d.ts +0 -0
  101. package/{target → build}/components/Banner.js +0 -0
  102. package/{target → build}/components/BlogIndex.d.ts +0 -0
  103. package/{target → build}/components/BlogIndex.js +0 -0
  104. package/{target → build}/components/Breadcrumbs.d.ts +0 -0
  105. package/{target → build}/components/Callout.d.ts +0 -0
  106. package/{target → build}/components/Callout.js +0 -0
  107. package/{target → build}/components/Card.d.ts +0 -0
  108. package/{target → build}/components/Card.js +0 -0
  109. package/{target → build}/components/Cards.d.ts +0 -0
  110. package/{target → build}/components/Cards.js +0 -0
  111. package/{target → build}/components/ChangelogIndex.d.ts +0 -0
  112. package/{target → build}/components/ChangelogIndex.js +0 -0
  113. package/{target → build}/components/CodeBlock.d.ts +0 -0
  114. package/{target → build}/components/CodeBlock.js +0 -0
  115. package/{target → build}/components/CodeTabs.d.ts +0 -0
  116. package/{target → build}/components/CodeTabs.js +0 -0
  117. package/{target → build}/components/Column.d.ts +0 -0
  118. package/{target → build}/components/Column.js +0 -0
  119. package/{target → build}/components/Columns.d.ts +0 -0
  120. package/{target → build}/components/Columns.js +0 -0
  121. package/{target → build}/components/Content.d.ts +0 -0
  122. package/{target → build}/components/Content.js +0 -0
  123. package/{target → build}/components/ContentTab.d.ts +0 -0
  124. package/{target → build}/components/ContentTab.js +0 -0
  125. package/{target → build}/components/ContentTabs.d.ts +0 -0
  126. package/{target → build}/components/ContentTabs.js +0 -0
  127. package/{target → build}/components/DefaultCatchBoundary.d.ts +0 -0
  128. package/{target → build}/components/DefaultCatchBoundary.js +0 -0
  129. package/{target → build}/components/DefinitionList.d.ts +0 -0
  130. package/{target → build}/components/DefinitionList.js +0 -0
  131. package/{target → build}/components/Details.d.ts +0 -0
  132. package/{target → build}/components/Details.js +0 -0
  133. package/{target → build}/components/FileTree.d.ts +0 -0
  134. package/{target → build}/components/FileTree.js +0 -0
  135. package/{target → build}/components/Footer.d.ts +0 -0
  136. package/{target → build}/components/Footer.js +0 -0
  137. package/{target → build}/components/FootnoteRef.d.ts +0 -0
  138. package/{target → build}/components/FootnoteRef.js +0 -0
  139. package/{target → build}/components/Heading.d.ts +0 -0
  140. package/{target → build}/components/Heading.js +0 -0
  141. package/{target → build}/components/InlineBadge.d.ts +0 -0
  142. package/{target → build}/components/InlineBadge.js +0 -0
  143. package/{target → build}/components/InlineIcon.d.ts +0 -0
  144. package/{target → build}/components/InlineIcon.js +0 -0
  145. package/{target → build}/components/InlineToc.d.ts +0 -0
  146. package/{target → build}/components/InlineToc.js +0 -0
  147. package/{target → build}/components/Layout.d.ts +0 -0
  148. package/{target → build}/components/LinkButton.d.ts +0 -0
  149. package/{target → build}/components/LinkButton.js +0 -0
  150. package/{target → build}/components/Mermaid.d.ts +0 -0
  151. package/{target → build}/components/Mermaid.js +0 -0
  152. package/{target → build}/components/MermaidRenderer.d.ts +0 -0
  153. package/{target → build}/components/MermaidRenderer.js +0 -0
  154. package/{target → build}/components/NotFound.d.ts +0 -0
  155. package/{target → build}/components/NotFound.js +0 -0
  156. package/{target → build}/components/PackageTabs.d.ts +0 -0
  157. package/{target → build}/components/PackageTabs.js +0 -0
  158. package/{target → build}/components/PageToolbar.d.ts +0 -0
  159. package/{target → build}/components/PageToolbar.js +0 -0
  160. package/{target → build}/components/PrevNext.d.ts +0 -0
  161. package/{target → build}/components/PrevNext.js +0 -0
  162. package/{target → build}/components/Search.d.ts +0 -0
  163. package/{target → build}/components/Search.js +0 -0
  164. package/{target → build}/components/SearchDialog.d.ts +0 -0
  165. package/{target → build}/components/SearchDialog.js +0 -0
  166. package/{target → build}/components/Section.d.ts +0 -0
  167. package/{target → build}/components/Section.js +0 -0
  168. package/{target → build}/components/SectionHeader.d.ts +0 -0
  169. package/{target → build}/components/SectionHeader.js +0 -0
  170. package/{target → build}/components/Sidebar.d.ts +0 -0
  171. package/{target → build}/components/Sidebar.js +0 -0
  172. package/{target → build}/components/SidebarArticles.d.ts +0 -0
  173. package/{target → build}/components/SidebarLinks.d.ts +0 -0
  174. package/{target → build}/components/SidebarPosts.d.ts +0 -0
  175. package/{target → build}/components/SidebarPosts.js +0 -0
  176. package/{target → build}/components/SidebarReleases.d.ts +0 -0
  177. package/{target → build}/components/SidebarReleases.js +0 -0
  178. package/{target → build}/components/SidebarSections.d.ts +0 -0
  179. package/{target → build}/components/SiteTitle.d.ts +0 -0
  180. package/{target → build}/components/SortableTable.d.ts +0 -0
  181. package/{target → build}/components/SortableTable.js +0 -0
  182. package/{target → build}/components/SoundCloud.d.ts +0 -0
  183. package/{target → build}/components/SoundCloud.js +0 -0
  184. package/{target → build}/components/TagIndex.d.ts +0 -0
  185. package/{target → build}/components/TagIndex.js +0 -0
  186. package/{target → build}/components/Theme.d.ts +0 -0
  187. package/{target → build}/components/Theme.js +0 -0
  188. package/{target → build}/components/Toc.d.ts +0 -0
  189. package/{target → build}/components/Toc.js +0 -0
  190. package/{target → build}/components/YouTube.d.ts +0 -0
  191. package/{target → build}/components/YouTube.js +0 -0
  192. package/{target → build}/components/ZoomImage.d.ts +0 -0
  193. package/{target → build}/components/ZoomImage.js +0 -0
  194. package/{target → build}/content/article.d.ts +5 -5
  195. /package/{target → build}/content/tag.d.ts +0 -0
  196. /package/{target → build}/content-collections.d.ts +0 -0
  197. /package/{target → build}/elements/accordion.d.ts +0 -0
  198. /package/{target → build}/elements/accordion.js +0 -0
  199. /package/{target → build}/elements/alert-dialog.d.ts +0 -0
  200. /package/{target → build}/elements/alert-dialog.js +0 -0
  201. /package/{target → build}/elements/alert.d.ts +0 -0
  202. /package/{target → build}/elements/alert.js +0 -0
  203. /package/{target → build}/elements/aspect-ratio.d.ts +0 -0
  204. /package/{target → build}/elements/aspect-ratio.js +0 -0
  205. /package/{target → build}/elements/avatar.d.ts +0 -0
  206. /package/{target → build}/elements/avatar.js +0 -0
  207. /package/{target → build}/elements/badge.d.ts +0 -0
  208. /package/{target → build}/elements/badge.js +0 -0
  209. /package/{target → build}/elements/breadcrumb.d.ts +0 -0
  210. /package/{target → build}/elements/breadcrumb.js +0 -0
  211. /package/{target → build}/elements/button-group.d.ts +0 -0
  212. /package/{target → build}/elements/button-group.js +0 -0
  213. /package/{target → build}/elements/button.d.ts +0 -0
  214. /package/{target → build}/elements/button.js +0 -0
  215. /package/{target → build}/elements/calendar.d.ts +0 -0
  216. /package/{target → build}/elements/calendar.js +0 -0
  217. /package/{target → build}/elements/card.d.ts +0 -0
  218. /package/{target → build}/elements/card.js +0 -0
  219. /package/{target → build}/elements/carousel.d.ts +0 -0
  220. /package/{target → build}/elements/carousel.js +0 -0
  221. /package/{target → build}/elements/chart.d.ts +0 -0
  222. /package/{target → build}/elements/chart.js +0 -0
  223. /package/{target → build}/elements/checkbox.d.ts +0 -0
  224. /package/{target → build}/elements/checkbox.js +0 -0
  225. /package/{target → build}/elements/collapsible.d.ts +0 -0
  226. /package/{target → build}/elements/collapsible.js +0 -0
  227. /package/{target → build}/elements/command.d.ts +0 -0
  228. /package/{target → build}/elements/command.js +0 -0
  229. /package/{target → build}/elements/context-menu.d.ts +0 -0
  230. /package/{target → build}/elements/context-menu.js +0 -0
  231. /package/{target → build}/elements/dialog.d.ts +0 -0
  232. /package/{target → build}/elements/dialog.js +0 -0
  233. /package/{target → build}/elements/direction.d.ts +0 -0
  234. /package/{target → build}/elements/direction.js +0 -0
  235. /package/{target → build}/elements/drawer.d.ts +0 -0
  236. /package/{target → build}/elements/drawer.js +0 -0
  237. /package/{target → build}/elements/dropdown-menu.d.ts +0 -0
  238. /package/{target → build}/elements/dropdown-menu.js +0 -0
  239. /package/{target → build}/elements/empty.d.ts +0 -0
  240. /package/{target → build}/elements/empty.js +0 -0
  241. /package/{target → build}/elements/field.d.ts +0 -0
  242. /package/{target → build}/elements/field.js +0 -0
  243. /package/{target → build}/elements/hover-card.d.ts +0 -0
  244. /package/{target → build}/elements/hover-card.js +0 -0
  245. /package/{target → build}/elements/input-group.d.ts +0 -0
  246. /package/{target → build}/elements/input-group.js +0 -0
  247. /package/{target → build}/elements/input-otp.d.ts +0 -0
  248. /package/{target → build}/elements/input-otp.js +0 -0
  249. /package/{target → build}/elements/input.d.ts +0 -0
  250. /package/{target → build}/elements/input.js +0 -0
  251. /package/{target → build}/elements/item.d.ts +0 -0
  252. /package/{target → build}/elements/item.js +0 -0
  253. /package/{target → build}/elements/kbd.d.ts +0 -0
  254. /package/{target → build}/elements/kbd.js +0 -0
  255. /package/{target → build}/elements/label.d.ts +0 -0
  256. /package/{target → build}/elements/label.js +0 -0
  257. /package/{target → build}/elements/menubar.d.ts +0 -0
  258. /package/{target → build}/elements/menubar.js +0 -0
  259. /package/{target → build}/elements/native-select.d.ts +0 -0
  260. /package/{target → build}/elements/native-select.js +0 -0
  261. /package/{target → build}/elements/navigation-menu.d.ts +0 -0
  262. /package/{target → build}/elements/navigation-menu.js +0 -0
  263. /package/{target → build}/elements/pagination.d.ts +0 -0
  264. /package/{target → build}/elements/pagination.js +0 -0
  265. /package/{target → build}/elements/popover.d.ts +0 -0
  266. /package/{target → build}/elements/popover.js +0 -0
  267. /package/{target → build}/elements/progress.d.ts +0 -0
  268. /package/{target → build}/elements/progress.js +0 -0
  269. /package/{target → build}/elements/radio-group.d.ts +0 -0
  270. /package/{target → build}/elements/radio-group.js +0 -0
  271. /package/{target → build}/elements/resizable.d.ts +0 -0
  272. /package/{target → build}/elements/resizable.js +0 -0
  273. /package/{target → build}/elements/scroll-area.d.ts +0 -0
  274. /package/{target → build}/elements/scroll-area.js +0 -0
  275. /package/{target → build}/elements/select.d.ts +0 -0
  276. /package/{target → build}/elements/select.js +0 -0
  277. /package/{target → build}/elements/separator.d.ts +0 -0
  278. /package/{target → build}/elements/separator.js +0 -0
  279. /package/{target → build}/elements/sheet.d.ts +0 -0
  280. /package/{target → build}/elements/sheet.js +0 -0
  281. /package/{target → build}/elements/sidebar.d.ts +0 -0
  282. /package/{target → build}/elements/sidebar.js +0 -0
  283. /package/{target → build}/elements/skeleton.d.ts +0 -0
  284. /package/{target → build}/elements/skeleton.js +0 -0
  285. /package/{target → build}/elements/slider.d.ts +0 -0
  286. /package/{target → build}/elements/slider.js +0 -0
  287. /package/{target → build}/elements/sonner.d.ts +0 -0
  288. /package/{target → build}/elements/sonner.js +0 -0
  289. /package/{target → build}/elements/spinner.d.ts +0 -0
  290. /package/{target → build}/elements/spinner.js +0 -0
  291. /package/{target → build}/elements/switch.d.ts +0 -0
  292. /package/{target → build}/elements/switch.js +0 -0
  293. /package/{target → build}/elements/table.d.ts +0 -0
  294. /package/{target → build}/elements/table.js +0 -0
  295. /package/{target → build}/elements/tabs.d.ts +0 -0
  296. /package/{target → build}/elements/tabs.js +0 -0
  297. /package/{target → build}/elements/textarea.d.ts +0 -0
  298. /package/{target → build}/elements/textarea.js +0 -0
  299. /package/{target → build}/elements/toggle-group.d.ts +0 -0
  300. /package/{target → build}/elements/toggle-group.js +0 -0
  301. /package/{target → build}/elements/toggle.d.ts +0 -0
  302. /package/{target → build}/elements/toggle.js +0 -0
  303. /package/{target → build}/elements/tooltip.d.ts +0 -0
  304. /package/{target → build}/elements/tooltip.js +0 -0
  305. /package/{target → build}/entrypoints/main.d.ts +0 -0
  306. /package/{target → build}/entrypoints/main.js +0 -0
  307. /package/{target → build}/helpers/article-icon.d.ts +0 -0
  308. /package/{target → build}/helpers/article-icon.js +0 -0
  309. /package/{target → build}/helpers/article.d.ts +0 -0
  310. /package/{target → build}/helpers/article.js +0 -0
  311. /package/{target → build}/helpers/changelog-source.d.ts +0 -0
  312. /package/{target → build}/helpers/changelog-source.js +0 -0
  313. /package/{target → build}/helpers/changelog-source.unit.d.ts +0 -0
  314. /package/{target → build}/helpers/changelog-source.unit.js +0 -0
  315. /package/{target → build}/helpers/dynamic-icon-resolver.d.ts +0 -0
  316. /package/{target → build}/helpers/dynamic-icon-resolver.js +0 -0
  317. /package/{target → build}/helpers/dynamic-icon.d.ts +0 -0
  318. /package/{target → build}/helpers/dynamic-icon.js +0 -0
  319. /package/{target → build}/helpers/favicon.d.ts +0 -0
  320. /package/{target → build}/helpers/favicon.js +0 -0
  321. /package/{target → build}/helpers/model.d.ts +0 -0
  322. /package/{target → build}/helpers/model.js +0 -0
  323. /package/{target → build}/helpers/program.d.ts +0 -0
  324. /package/{target → build}/helpers/program.js +0 -0
  325. /package/{target → build}/helpers/resolve-asset-path.d.ts +0 -0
  326. /package/{target → build}/helpers/resolve-asset-path.js +0 -0
  327. /package/{target → build}/helpers/resolve-includes.d.ts +0 -0
  328. /package/{target → build}/helpers/resolve-includes.js +0 -0
  329. /package/{target → build}/helpers/resolve-includes.unit.d.ts +0 -0
  330. /package/{target → build}/helpers/resolve-includes.unit.js +0 -0
  331. /package/{target → build}/helpers/search-text.d.ts +0 -0
  332. /package/{target → build}/helpers/search-text.js +0 -0
  333. /package/{target → build}/helpers/section.d.ts +0 -0
  334. /package/{target → build}/helpers/section.js +0 -0
  335. /package/{target → build}/helpers/section.unit.d.ts +0 -0
  336. /package/{target → build}/helpers/section.unit.js +0 -0
  337. /package/{target → build}/helpers/theme.d.ts +0 -0
  338. /package/{target → build}/helpers/theme.js +0 -0
  339. /package/{target → build}/helpers/toc-context.d.ts +0 -0
  340. /package/{target → build}/helpers/toc-context.js +0 -0
  341. /package/{target → build}/helpers/toc.d.ts +0 -0
  342. /package/{target → build}/helpers/toc.js +0 -0
  343. /package/{target → build}/helpers/toc.unit.d.ts +0 -0
  344. /package/{target → build}/helpers/toc.unit.js +0 -0
  345. /package/{target → build}/hooks/in-view.d.ts +0 -0
  346. /package/{target → build}/hooks/in-view.js +0 -0
  347. /package/{target → build}/hooks/media.d.ts +0 -0
  348. /package/{target → build}/hooks/media.js +0 -0
  349. /package/{target → build}/index.d.ts +0 -0
  350. /package/{target → build}/index.js +0 -0
  351. /package/{target → build}/models/article.d.ts +0 -0
  352. /package/{target → build}/models/article.js +0 -0
  353. /package/{target → build}/models/link.d.ts +0 -0
  354. /package/{target → build}/models/link.js +0 -0
  355. /package/{target → build}/models/patch.d.ts +0 -0
  356. /package/{target → build}/models/patch.js +0 -0
  357. /package/{target → build}/models/section.d.ts +0 -0
  358. /package/{target → build}/models/section.js +0 -0
  359. /package/{target → build}/models/theme.d.ts +0 -0
  360. /package/{target → build}/models/theme.js +0 -0
  361. /package/{target → build}/models/toc.d.ts +0 -0
  362. /package/{target → build}/models/toc.js +0 -0
  363. /package/{target → build}/plugins/rehype-inline-code.d.ts +0 -0
  364. /package/{target → build}/plugins/rehype-inline-code.js +0 -0
  365. /package/{target → build}/plugins/rehype-task-list-a11y.d.ts +0 -0
  366. /package/{target → build}/plugins/rehype-task-list-a11y.js +0 -0
  367. /package/{target → build}/plugins/remark-abbr.d.ts +0 -0
  368. /package/{target → build}/plugins/remark-abbr.js +0 -0
  369. /package/{target → build}/plugins/remark-abbr.unit.d.ts +0 -0
  370. /package/{target → build}/plugins/remark-abbr.unit.js +0 -0
  371. /package/{target → build}/plugins/remark-ansi.d.ts +0 -0
  372. /package/{target → build}/plugins/remark-ansi.js +0 -0
  373. /package/{target → build}/plugins/remark-ansi.unit.d.ts +0 -0
  374. /package/{target → build}/plugins/remark-ansi.unit.js +0 -0
  375. /package/{target → build}/plugins/remark-badge.d.ts +0 -0
  376. /package/{target → build}/plugins/remark-badge.js +0 -0
  377. /package/{target → build}/plugins/remark-badge.unit.d.ts +0 -0
  378. /package/{target → build}/plugins/remark-badge.unit.js +0 -0
  379. /package/{target → build}/plugins/remark-button.d.ts +0 -0
  380. /package/{target → build}/plugins/remark-button.js +0 -0
  381. /package/{target → build}/plugins/remark-button.unit.d.ts +0 -0
  382. /package/{target → build}/plugins/remark-button.unit.js +0 -0
  383. /package/{target → build}/plugins/remark-callout.d.ts +0 -0
  384. /package/{target → build}/plugins/remark-callout.js +0 -0
  385. /package/{target → build}/plugins/remark-card.d.ts +0 -0
  386. /package/{target → build}/plugins/remark-card.js +0 -0
  387. /package/{target → build}/plugins/remark-code-tabs.d.ts +0 -0
  388. /package/{target → build}/plugins/remark-code-tabs.js +0 -0
  389. /package/{target → build}/plugins/remark-columns.d.ts +0 -0
  390. /package/{target → build}/plugins/remark-columns.js +0 -0
  391. /package/{target → build}/plugins/remark-custom-heading-id.d.ts +0 -0
  392. /package/{target → build}/plugins/remark-custom-heading-id.js +0 -0
  393. /package/{target → build}/plugins/remark-custom-heading-id.unit.d.ts +0 -0
  394. /package/{target → build}/plugins/remark-custom-heading-id.unit.js +0 -0
  395. /package/{target → build}/plugins/remark-deflist.d.ts +0 -0
  396. /package/{target → build}/plugins/remark-deflist.js +0 -0
  397. /package/{target → build}/plugins/remark-details.d.ts +0 -0
  398. /package/{target → build}/plugins/remark-details.js +0 -0
  399. /package/{target → build}/plugins/remark-filetree.d.ts +0 -0
  400. /package/{target → build}/plugins/remark-filetree.js +0 -0
  401. /package/{target → build}/plugins/remark-filetree.unit.d.ts +0 -0
  402. /package/{target → build}/plugins/remark-filetree.unit.js +0 -0
  403. /package/{target → build}/plugins/remark-github-callout.d.ts +0 -0
  404. /package/{target → build}/plugins/remark-github-callout.js +0 -0
  405. /package/{target → build}/plugins/remark-icon.d.ts +0 -0
  406. /package/{target → build}/plugins/remark-icon.js +0 -0
  407. /package/{target → build}/plugins/remark-image.d.ts +0 -0
  408. /package/{target → build}/plugins/remark-image.js +0 -0
  409. /package/{target → build}/plugins/remark-media.d.ts +0 -0
  410. /package/{target → build}/plugins/remark-media.js +0 -0
  411. /package/{target → build}/plugins/remark-media.unit.d.ts +0 -0
  412. /package/{target → build}/plugins/remark-media.unit.js +0 -0
  413. /package/{target → build}/plugins/remark-mermaid.d.ts +0 -0
  414. /package/{target → build}/plugins/remark-mermaid.js +0 -0
  415. /package/{target → build}/plugins/remark-npm.d.ts +0 -0
  416. /package/{target → build}/plugins/remark-npm.js +0 -0
  417. /package/{target → build}/plugins/remark-passthrough-directive.d.ts +0 -0
  418. /package/{target → build}/plugins/remark-passthrough-directive.js +0 -0
  419. /package/{target → build}/plugins/remark-steps.d.ts +0 -0
  420. /package/{target → build}/plugins/remark-steps.js +0 -0
  421. /package/{target → build}/plugins/remark-steps.unit.d.ts +0 -0
  422. /package/{target → build}/plugins/remark-steps.unit.js +0 -0
  423. /package/{target → build}/plugins/remark-tab.d.ts +0 -0
  424. /package/{target → build}/plugins/remark-tab.js +0 -0
  425. /package/{target → build}/plugins/remark-tab.unit.d.ts +0 -0
  426. /package/{target → build}/plugins/remark-tab.unit.js +0 -0
  427. /package/{target → build}/plugins/remark-toc.d.ts +0 -0
  428. /package/{target → build}/plugins/remark-toc.js +0 -0
  429. /package/{target → build}/plugins/remark-toc.unit.d.ts +0 -0
  430. /package/{target → build}/plugins/remark-toc.unit.js +0 -0
  431. /package/{target → build}/plugins/shiki-icon.d.ts +0 -0
  432. /package/{target → build}/plugins/shiki-icon.js +0 -0
  433. /package/{target → build}/plugins/shiki-line-highlight.d.ts +0 -0
  434. /package/{target → build}/plugins/shiki-line-highlight.js +0 -0
  435. /package/{target → build}/program.d.ts +0 -0
  436. /package/{target → build}/program.js +0 -0
  437. /package/{target → build}/routeTree.gen.d.ts +0 -0
  438. /package/{target → build}/routeTree.gen.js +0 -0
  439. /package/{target → build}/router.d.ts +0 -0
  440. /package/{target → build}/router.js +0 -0
  441. /package/{target → build}/routes/$.d.ts +0 -0
  442. /package/{target → build}/routes/$.js +0 -0
  443. /package/{target → build}/routes/__root.d.ts +0 -0
  444. /package/{target → build}/server.d.ts +0 -0
  445. /package/{target → build}/server.js +0 -0
  446. /package/{target → build}/utils/style.d.ts +0 -0
  447. /package/{target → build}/utils/style.js +0 -0
  448. /package/{target → build}/vite.config.d.ts +0 -0
@@ -1,20 +1,15 @@
1
+ import { config } from "livemark:virtual"
1
2
  import defaultLogo from "../assets/logo.svg"
2
3
 
3
4
  /** Renders the site logo, title, and description in the sidebar header */
4
5
  export function SiteTitle() {
5
- const logo = import.meta.env.CONFIG.logo ?? defaultLogo
6
+ const logo = config.logo ?? defaultLogo
6
7
  return (
7
8
  <div className="flex items-end gap-2.5 text-sm">
8
- <img
9
- src={logo}
10
- alt={import.meta.env.CONFIG.title}
11
- className="size-6.5 mb-1.25"
12
- />
9
+ <img src={logo} alt={config.title} className="size-6.5 mb-1.25" />
13
10
  <div className="flex flex-col gap-0.5 leading-none">
14
- <span className="font-semibold">{import.meta.env.CONFIG.title}</span>
15
- <span className="text-xs opacity-80">
16
- {import.meta.env.CONFIG.description}
17
- </span>
11
+ <span className="font-semibold">{config.title}</span>
12
+ <span className="text-xs opacity-80">{config.description}</span>
18
13
  </div>
19
14
  </div>
20
15
  )
@@ -1,3 +1,4 @@
1
+ import { config } from "livemark:virtual"
1
2
  import { allArticles } from "content-collections"
2
3
  import type { ArticleGroup } from "../models/article.ts"
3
4
  import {
@@ -39,7 +40,7 @@ function orderKey(order?: number) {
39
40
  return order
40
41
  }
41
42
 
42
- const configSections = import.meta.env.CONFIG.sections
43
+ const configSections = config.sections
43
44
 
44
45
  /** Per-section article groups, keyed by section prefix */
45
46
  export const sectionArticleGroups = new Map<string, ArticleGroup[]>()
@@ -1,6 +1,7 @@
1
+ import { config } from "livemark:virtual"
1
2
  import { sectionFlatArticles, sortedArticles } from "./article.ts"
2
3
 
3
- const configSections = import.meta.env.CONFIG.sections
4
+ const configSections = config.sections
4
5
 
5
6
  /** Per-section tag → article paths mapping. Articles sorted by date descending. */
6
7
  export const sectionTags = new Map<string, Map<string, string[]>>()
@@ -64,7 +64,7 @@ const configInclude = Array.isArray(config.include)
64
64
  ? config.include
65
65
  : [config.include]
66
66
  const include = changelogSections.length
67
- ? [...configInclude, cacheIncludeGlob()]
67
+ ? [...configInclude, cacheIncludeGlob(config)]
68
68
  : configInclude
69
69
 
70
70
  const userExclude = config.exclude
package/source/env.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- interface ImportMetaEnv {
2
- readonly CONFIG: import("./models/config.ts").WebsiteConfig
1
+ declare module "livemark:virtual" {
2
+ export const config: import("./models/config.ts").WebsiteConfig
3
3
  }
4
4
 
5
5
  declare module "content-collections" {
@@ -1,13 +1,26 @@
1
1
  import { z } from "zod"
2
+ import type { ConfigEnv, UserConfig as ViteUserConfig } from "vite"
2
3
  import { Link } from "./link.ts"
3
4
  import { Patch } from "./patch.ts"
4
5
  import { Section } from "./section.ts"
5
6
  import { CodeThemeDark, CodeThemeLight } from "./theme.ts"
6
7
 
8
+ /** Escape hatch for arbitrary Vite config — accepts either a config
9
+ * object (simple overrides) or a function form (`(env) => config`,
10
+ * matching Vite's own `defineConfig`). Merged on top of livemark's
11
+ * defaults via `mergeConfig`, so plugin arrays concatenate, defines
12
+ * merge, etc. Use this for deployment-target tweaks (e.g. CF Workers
13
+ * via `environments.ssr.resolve.conditions: ["workerd", ...]`). */
14
+ export type ViteOverride =
15
+ | ViteUserConfig
16
+ | ((env: ConfigEnv) => ViteUserConfig | Promise<ViteUserConfig>)
17
+
7
18
  /**
8
19
  * User-provided configuration for Livemark.
9
20
  */
10
- export type UserConfig = z.infer<typeof UserConfig>
21
+ export type UserConfig = Omit<z.infer<typeof UserConfig>, "vite"> & {
22
+ vite?: ViteOverride
23
+ }
11
24
  export const UserConfig = z.object({
12
25
  site: z.string().optional(),
13
26
  favicon: z.string().optional(),
@@ -21,6 +34,10 @@ export const UserConfig = z.object({
21
34
  links: z.array(Link).optional(),
22
35
  sections: z.array(Section).optional(),
23
36
  patches: z.array(Patch).optional(),
37
+ // Stored as `unknown` in the schema (zod can't type a Vite UserConfig
38
+ // or a function returning one meaningfully); the public TypeScript
39
+ // surface above lifts it back to ViteOverride for editor support.
40
+ vite: z.unknown().optional(),
24
41
  })
25
42
 
26
43
  /** Website configuration injected at build time via Vite define */
@@ -46,6 +63,10 @@ export const SystemConfig = z.object({
46
63
 
47
64
  /**
48
65
  * Fully resolved Livemark configuration.
66
+ *
67
+ * `vite` stays `unknown` here because that's what the runtime schema
68
+ * produces — consumer-facing typing happens via {@link UserConfig} so
69
+ * `defineConfig` shows the right shape in editors.
49
70
  */
50
71
  export type Config = z.infer<typeof Config>
51
72
  export const Config = UserConfig.merge(SystemConfig)
@@ -1,119 +1,193 @@
1
- import { existsSync } from "node:fs"
2
- import { join } from "node:path"
3
- import type { Plugin } from "vite"
1
+ import { cpSync, existsSync, rmSync } from "node:fs"
2
+ import { join, sep } from "node:path"
3
+ import type {
4
+ ConfigEnv,
5
+ Plugin,
6
+ UserConfig as ViteUserConfig,
7
+ ViteDevServer,
8
+ } from "vite"
9
+ import { mergeConfig } from "vite"
10
+ import { buildTarget } from "../actions/target/build.ts"
11
+ import type { Config } from "../models/config.ts"
12
+ import { WebsiteConfig } from "../models/config.ts"
13
+ import { ESCAPABLE_FILES, ESCAPABLE_FOLDERS } from "../settings.ts"
4
14
 
5
15
  export interface LivemarkOptions {
6
- defaultsRoot: string
7
- overridesRoot: string
8
- subdirs: string[]
9
- configPath: string
16
+ config: Config
10
17
  }
11
18
 
12
- /** Match bare specifiers (`react`, `@scope/pkg`, `react/jsx-runtime`) but
13
- * not relative (`./foo`), absolute (`/foo`), URL, or virtual (`\0...`)
14
- * paths. */
15
- const BARE_SPECIFIER_RE = /^(@[^/]+\/)?[a-z0-9_][^?#]*$/i
19
+ const SOURCE_DIR = join(import.meta.dirname, "..")
16
20
 
17
- /** Livemark dev/build integration:
18
- * - Anchors every bare-specifier resolution at livemark's own location so
19
- * the entire build pipeline runs inside livemark's package boundary,
20
- * regardless of which file (consumer override, transitive package,
21
- * livemark source) issues the import. Removes pnpm-isolation hazards
22
- * without forcing peerDependencies on the consumer.
23
- * - Redirects imports that land in `<defaultsRoot>/<subdir>/` to the matching
24
- * user file under `<overridesRoot>/<subdir>/` when it exists.
25
- * - Watches `livemark.config.ts` and `.livemark/**` so edits, additions and
26
- * deletions trigger the right reload without manual restart. */
21
+ /** Single virtual module exposing livemark's runtime values to consumer
22
+ * override files via named exports:
23
+ *
24
+ * import { config } from "livemark:virtual"
25
+ *
26
+ * Currently exports `config` (validated `WebsiteConfig`); future
27
+ * additions (e.g. `articles`, `sections`) land here as new named
28
+ * exports without consumers changing their import statements.
29
+ *
30
+ * The `\0` prefix on the resolved id is Vite's convention to signal
31
+ * "this is a virtual module — no other plugin should try to resolve
32
+ * or load it from disk". */
33
+ const VIRTUAL_ID = "livemark:virtual"
34
+ const VIRTUAL_RESOLVED_ID = `\0${VIRTUAL_ID}`
35
+
36
+ /** Owns the per-consumer `targets/<hash>/` mount: synthesizes it via
37
+ * `buildTarget()`, returns the Vite config that anchors there, and
38
+ * watches the consumer's `.livemark/` (plus livemark's `source/` in
39
+ * dev) for changes that need to be re-copied into the target. The
40
+ * override mechanism is pure file-system (full copies) — no resolveId
41
+ * redirection, no realpath surprises. */
27
42
  export function livemark(opts: LivemarkOptions): Plugin {
28
- const EXT_RE = /\.(tsx|ts|jsx|js|css)(\?|$)/
29
- const livemarkAnchor = join(opts.defaultsRoot, "index.ts")
43
+ const overridesRoot = join(opts.config.root, ".livemark")
44
+ let targetDir = ""
30
45
  return {
31
46
  name: "livemark",
32
47
  enforce: "pre",
33
- async resolveId(id, importer, options) {
34
- // Encapsulation bridge: if the importer can resolve `id` itself
35
- // (its own subtree has the right version), use that — preserves
36
- // version isolation between transitive packages (e.g. recharts and
37
- // mermaid both pulling different d3 majors). Only when the importer
38
- // *can't* resolve do we fall back to livemark's own location, which
39
- // covers React, the @tanstack/react-* cluster, and anything else
40
- // that lives only inside livemark's tree but gets requested from a
41
- // file that doesn't declare it (consumer overrides, foreign
42
- // packages compiled by TanStack's transforms, etc.).
43
- if (BARE_SPECIFIER_RE.test(id)) {
44
- const fromImporter = importer
45
- ? await this.resolve(id, importer, {
46
- ...options,
47
- skipSelf: true,
48
- })
49
- : null
50
- if (fromImporter) return fromImporter
51
- const fromLivemark = await this.resolve(id, livemarkAnchor, {
52
- ...options,
53
- skipSelf: true,
54
- })
55
- if (fromLivemark) return fromLivemark
56
- }
57
-
58
- if (!importer || !EXT_RE.test(id)) return null
59
- const resolved = await this.resolve(id, importer, {
60
- ...options,
61
- skipSelf: true,
62
- })
63
- if (!resolved) return null
64
- const queryIdx = resolved.id.indexOf("?")
65
- const path =
66
- queryIdx === -1 ? resolved.id : resolved.id.slice(0, queryIdx)
67
- const query = queryIdx === -1 ? "" : resolved.id.slice(queryIdx)
68
- for (const subdir of opts.subdirs) {
69
- const defaultsSubdir = `${join(opts.defaultsRoot, subdir)}/`
70
- if (!path.startsWith(defaultsSubdir)) continue
71
- const rel = path.slice(defaultsSubdir.length)
72
- const userPath = join(opts.overridesRoot, subdir, rel)
73
- if (existsSync(userPath)) return userPath + query
74
- return null
48
+ async config(_, env) {
49
+ targetDir = buildTarget(opts.config.configPath)
50
+ const base: ViteUserConfig = {
51
+ root: targetDir,
52
+ // outDir lives outside the target root (in the consumer's
53
+ // .livemark/) so the consumer can find their deployable output
54
+ // without digging into node_modules. Vite's default refusal to
55
+ // empty out-of-root directories doesn't apply here because the
56
+ // target/ root is livemark's, not the consumer's.
57
+ build: { outDir: join(overridesRoot, "build"), emptyOutDir: true },
58
+ resolve: { dedupe: ["react", "react-dom"] },
75
59
  }
60
+ const override = await resolveViteOverride(opts.config.vite, env)
61
+ return override ? mergeConfig(base, override) : base
62
+ },
63
+ resolveId(id) {
64
+ if (id === VIRTUAL_ID) return VIRTUAL_RESOLVED_ID
76
65
  return null
77
66
  },
67
+ load(id) {
68
+ if (id !== VIRTUAL_RESOLVED_ID) return null
69
+ const config = WebsiteConfig.parse(opts.config)
70
+ return `export const config = ${JSON.stringify(config)}`
71
+ },
78
72
  configureServer(server) {
79
- server.watcher.add(opts.configPath)
80
- server.watcher.add(join(opts.overridesRoot, "**/*"))
73
+ server.watcher.add(opts.config.configPath)
74
+ server.watcher.add(join(overridesRoot, "**", "*"))
75
+ server.watcher.add(join(SOURCE_DIR, "**", "*"))
81
76
 
82
- const overrideRoots = opts.subdirs.map(
83
- subdir => `${join(opts.overridesRoot, subdir)}/`,
84
- )
85
- const routesRoot = `${join(opts.overridesRoot, "routes")}/`
77
+ server.watcher.on("change", file => onChange(file, "change"))
78
+ server.watcher.on("add", file => onChange(file, "add"))
79
+ server.watcher.on("unlink", file => onChange(file, "unlink"))
86
80
 
87
- const onChange = (file: string) => {
88
- if (file === opts.configPath) {
81
+ function onChange(file: string, kind: "change" | "add" | "unlink") {
82
+ if (file === opts.config.configPath) {
89
83
  server.restart()
90
84
  return
91
85
  }
92
-
93
- if (file.startsWith(routesRoot)) {
94
- server.restart()
86
+ const overlayHit = matchOverlay(file, overridesRoot)
87
+ if (overlayHit) {
88
+ syncOverlay(overlayHit, kind, targetDir, overridesRoot)
89
+ if (kind !== "change") fullReload(server)
95
90
  return
96
91
  }
97
-
98
- for (let i = 0; i < opts.subdirs.length; i++) {
99
- const root = overrideRoots[i]
100
- if (!root || !file.startsWith(root)) continue
101
- const rel = file.slice(root.length)
102
- const subdir = opts.subdirs[i]
103
- if (!subdir) continue
104
- const defaultPath = join(opts.defaultsRoot, subdir, rel)
105
- const mod = server.moduleGraph.getModuleById(defaultPath)
106
- if (mod) server.moduleGraph.invalidateModule(mod)
107
- server.ws.send({ type: "full-reload" })
108
- return
92
+ const sourceHit = matchSource(file)
93
+ if (sourceHit) {
94
+ syncSource(sourceHit, kind, targetDir, overridesRoot)
95
+ if (kind !== "change") fullReload(server)
109
96
  }
110
97
  }
111
-
112
- server.watcher.on("add", onChange)
113
- server.watcher.on("unlink", onChange)
114
- server.watcher.on("change", file => {
115
- if (file === opts.configPath) server.restart()
116
- })
117
98
  },
118
99
  }
119
100
  }
101
+
102
+ interface Hit {
103
+ rel: string
104
+ category: "folder" | "file" | null
105
+ }
106
+
107
+ function matchOverlay(file: string, overridesRoot: string): Hit | null {
108
+ const prefix = `${overridesRoot}${sep}`
109
+ if (!file.startsWith(prefix)) return null
110
+ const rel = file.slice(prefix.length)
111
+ return { rel, category: classify(rel) }
112
+ }
113
+
114
+ function matchSource(file: string): Hit | null {
115
+ const prefix = `${SOURCE_DIR}${sep}`
116
+ if (!file.startsWith(prefix)) return null
117
+ // Skip the targets/ output dir itself (sibling of source/) and any
118
+ // `.gen.ts` files that downstream tools regenerate inside the target.
119
+ const rel = file.slice(prefix.length)
120
+ if (rel === "" || rel.includes("routeTree.gen.ts")) return null
121
+ return { rel, category: classify(rel) }
122
+ }
123
+
124
+ function classify(rel: string): "folder" | "file" | null {
125
+ const [head] = rel.split(sep)
126
+ if (head && ESCAPABLE_FOLDERS.includes(head)) return "folder"
127
+ if (ESCAPABLE_FILES.includes(rel)) return "file"
128
+ // Non-escapable source files still need to flow into target during
129
+ // livemark's own dev — the user is editing the canonical source.
130
+ return null
131
+ }
132
+
133
+ function syncOverlay(
134
+ hit: Hit,
135
+ kind: "change" | "add" | "unlink",
136
+ targetDir: string,
137
+ overridesRoot: string,
138
+ ) {
139
+ if (!hit.category) return
140
+ const dest = join(targetDir, hit.rel)
141
+ const source = join(SOURCE_DIR, hit.rel)
142
+ if (kind === "unlink") {
143
+ rmSync(dest, { force: true, recursive: true })
144
+ if (existsSync(source))
145
+ cpSync(source, dest, { recursive: true, force: true })
146
+ return
147
+ }
148
+ const overlay = join(overridesRoot, hit.rel)
149
+ if (existsSync(overlay))
150
+ cpSync(overlay, dest, { recursive: true, force: true })
151
+ }
152
+
153
+ function syncSource(
154
+ hit: Hit,
155
+ kind: "change" | "add" | "unlink",
156
+ targetDir: string,
157
+ overridesRoot: string,
158
+ ) {
159
+ // If the consumer has an overlay for this file (and it's escapable),
160
+ // the overlay wins — ignore source changes.
161
+ if (hit.category && existsSync(join(overridesRoot, hit.rel))) return
162
+ const dest = join(targetDir, hit.rel)
163
+ const source = join(SOURCE_DIR, hit.rel)
164
+ if (kind === "unlink") {
165
+ rmSync(dest, { force: true, recursive: true })
166
+ return
167
+ }
168
+ if (existsSync(source)) cpSync(source, dest, { recursive: true, force: true })
169
+ }
170
+
171
+ function fullReload(server: ViteDevServer) {
172
+ server.ws.send({ type: "full-reload" })
173
+ }
174
+
175
+ /** Resolve livemark.config.ts's `vite` field — either a config object
176
+ * or a function `(env) => config` (matching Vite's own `defineConfig`).
177
+ * Schema stores it as `unknown`; typing for the consumer's editor
178
+ * lives on {@link ViteOverride}. */
179
+ async function resolveViteOverride(
180
+ vite: unknown,
181
+ env: ConfigEnv,
182
+ ): Promise<Record<string, unknown> | null> {
183
+ if (!vite) return null
184
+ if (typeof vite === "function") {
185
+ const result = await Reflect.apply(vite, undefined, [env])
186
+ return isObject(result) ? result : null
187
+ }
188
+ return isObject(vite) ? vite : null
189
+ }
190
+
191
+ function isObject(v: unknown): v is Record<string, unknown> {
192
+ return v !== null && typeof v === "object"
193
+ }
@@ -0,0 +1,86 @@
1
+ /* eslint-disable */
2
+
3
+ // @ts-nocheck
4
+
5
+ // noinspection JSUnusedGlobalSymbols
6
+
7
+ // This file was automatically generated by TanStack Router.
8
+ // You should NOT make any changes in this file as it will be overwritten.
9
+ // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10
+
11
+ import { Route as rootRouteImport } from './routes/__root'
12
+ import { Route as splatRouteImport } from './routes/$'
13
+ import { Route as IndexRouteImport } from './../.livemark/routes/index'
14
+
15
+ const splatRoute = splatRouteImport.update({
16
+ id: '/$',
17
+ path: '/$',
18
+ getParentRoute: () => rootRouteImport,
19
+ } as any)
20
+ const IndexRoute = IndexRouteImport.update({
21
+ id: '/',
22
+ path: '/',
23
+ getParentRoute: () => rootRouteImport,
24
+ } as any)
25
+
26
+ export interface FileRoutesByFullPath {
27
+ '/': typeof IndexRoute
28
+ '/$': typeof splatRoute
29
+ }
30
+ export interface FileRoutesByTo {
31
+ '/': typeof IndexRoute
32
+ '/$': typeof splatRoute
33
+ }
34
+ export interface FileRoutesById {
35
+ __root__: typeof rootRouteImport
36
+ '/': typeof IndexRoute
37
+ '/$': typeof splatRoute
38
+ }
39
+ export interface FileRouteTypes {
40
+ fileRoutesByFullPath: FileRoutesByFullPath
41
+ fullPaths: '/' | '/$'
42
+ fileRoutesByTo: FileRoutesByTo
43
+ to: '/' | '/$'
44
+ id: '__root__' | '/' | '/$'
45
+ fileRoutesById: FileRoutesById
46
+ }
47
+ export interface RootRouteChildren {
48
+ IndexRoute: typeof IndexRoute
49
+ splatRoute: typeof splatRoute
50
+ }
51
+
52
+ declare module '@tanstack/react-router' {
53
+ interface FileRoutesByPath {
54
+ '/$': {
55
+ id: '/$'
56
+ path: '/$'
57
+ fullPath: '/$'
58
+ preLoaderRoute: typeof splatRouteImport
59
+ parentRoute: typeof rootRouteImport
60
+ }
61
+ '/': {
62
+ id: '/'
63
+ path: '/'
64
+ fullPath: '/'
65
+ preLoaderRoute: typeof IndexRouteImport
66
+ parentRoute: typeof rootRouteImport
67
+ }
68
+ }
69
+ }
70
+
71
+ const rootRouteChildren: RootRouteChildren = {
72
+ IndexRoute: IndexRoute,
73
+ splatRoute: splatRoute,
74
+ }
75
+ export const routeTree = rootRouteImport
76
+ ._addFileChildren(rootRouteChildren)
77
+ ._addFileTypes<FileRouteTypes>()
78
+
79
+ import type { getRouter } from './router.tsx'
80
+ import type { createStart } from '@tanstack/react-start'
81
+ declare module '@tanstack/react-start' {
82
+ interface Register {
83
+ ssr: true
84
+ router: Awaited<ReturnType<typeof getRouter>>
85
+ }
86
+ }
@@ -1,3 +1,4 @@
1
+ import { config } from "livemark:virtual"
1
2
  import { TanStackDevtools } from "@tanstack/react-devtools"
2
3
  import { ReactQueryDevtoolsPanel } from "@tanstack/react-query-devtools"
3
4
  import {
@@ -19,21 +20,18 @@ import generalCss from "../styles/general.css?url"
19
20
 
20
21
  export const Route = createRootRoute({
21
22
  head: () => {
22
- const favicon =
23
- import.meta.env.CONFIG.favicon ??
24
- import.meta.env.CONFIG.logo ??
25
- defaultFavicon
23
+ const favicon = config.favicon ?? config.logo ?? defaultFavicon
26
24
  return {
27
25
  meta: [
28
26
  { charSet: "utf-8" },
29
- { title: import.meta.env.CONFIG.title },
30
- { name: "description", content: import.meta.env.CONFIG.description },
31
- { property: "og:title", content: import.meta.env.CONFIG.title },
27
+ { title: config.title },
28
+ { name: "description", content: config.description },
29
+ { property: "og:title", content: config.title },
32
30
  {
33
31
  property: "og:description",
34
- content: import.meta.env.CONFIG.description,
32
+ content: config.description,
35
33
  },
36
- { property: "og:site_name", content: import.meta.env.CONFIG.title },
34
+ { property: "og:site_name", content: config.title },
37
35
  { property: "og:type", content: "website" },
38
36
  {
39
37
  name: "viewport",
@@ -1,8 +1,19 @@
1
- /** Sub-directories of `website/` that participate in the override mechanism. */
2
- export const OVERRIDE_SUBDIRS: readonly string[] = [
1
+ /** Subdirs of source/ where consumer files in `.livemark/<folder>/` are
2
+ * merged per-file into the runtime mount, with `.livemark` winning on
3
+ * conflict. */
4
+ export const ESCAPABLE_FOLDERS: readonly string[] = [
3
5
  "components",
4
6
  "elements",
5
7
  "styles",
8
+ "routes",
9
+ "public",
10
+ ]
11
+
12
+ /** Top-level source files that `.livemark/<file>` can replace atomically. */
13
+ export const ESCAPABLE_FILES: readonly string[] = [
14
+ "client.tsx",
15
+ "server.ts",
16
+ "router.tsx",
6
17
  ]
7
18
 
8
19
  /** Glob patterns auto-excluded from content scanning when the consumer's
@@ -1,103 +1,29 @@
1
- import { existsSync, mkdirSync, writeFileSync } from "node:fs"
2
- import { join, relative } from "node:path"
3
1
  import contentCollections from "@content-collections/vite"
4
2
  import tailwind from "@tailwindcss/vite"
5
3
  import { devtools } from "@tanstack/devtools-vite"
6
4
  import { tanstackStart } from "@tanstack/react-start/plugin/vite"
7
- import {
8
- physical,
9
- rootRoute,
10
- route,
11
- type VirtualRouteNode,
12
- } from "@tanstack/virtual-file-routes"
13
5
  import react from "@vitejs/plugin-react"
14
6
  import { defineConfig } from "vite"
15
7
  import svgr from "vite-plugin-svgr"
16
8
  import { loadConfig } from "./actions/config/load.ts"
17
- import { WebsiteConfig } from "./models/config.ts"
18
- import { OVERRIDE_SUBDIRS } from "./settings.ts"
19
9
  import { livemark } from "./plugins/vite-livemark.ts"
20
10
 
21
11
  const config = await loadConfig()
22
- const sourceDir = import.meta.dirname
23
- const sourceRelative = relative(config.root, sourceDir)
24
- const overridesRoot = join(config.root, ".livemark")
25
-
26
- // Seed `.livemark/.gitignore` on first run so Vite's build/cache
27
- // artifacts never get committed by accident. On the same first-run
28
- // trigger, also seed an `.npmrc` when pnpm is in use: pnpm's strict
29
- // isolation hides livemark's transitive deps (react, @tanstack/*) from
30
- // Vite's optimizer, which walks from config.root rather than livemark's
31
- // subtree. The public-hoist-pattern entries make those deps reachable
32
- // from the consumer's top-level node_modules. Skip when the consumer
33
- // already authored their own `.npmrc` — never overwrite user config.
34
- const gitignorePath = join(overridesRoot, ".gitignore")
35
- if (!existsSync(gitignorePath)) {
36
- mkdirSync(overridesRoot, { recursive: true })
37
- writeFileSync(gitignorePath, "/build\n/cache\n")
38
-
39
- const npmrcPath = join(config.root, ".npmrc")
40
- const usingPnpm = existsSync(join(config.root, "pnpm-lock.yaml"))
41
- if (usingPnpm && !existsSync(npmrcPath)) {
42
- writeFileSync(
43
- npmrcPath,
44
- "public-hoist-pattern[]=react\n" +
45
- "public-hoist-pattern[]=react-*\n" +
46
- "public-hoist-pattern[]=@tanstack/*\n",
47
- )
48
- console.log(
49
- "Created .npmrc with hoist patterns for pnpm. Run `pnpm install` to apply.",
50
- )
51
- }
52
- }
53
-
54
- const routeChildren: VirtualRouteNode[] = [route("/$", "$.tsx")]
55
- if (existsSync(join(overridesRoot, "routes"))) {
56
- // physical(dir) resolves `dir` relative to the routes directory
57
- // (`srcDirectory/routes`). A hardcoded "../../.livemark/routes" only
58
- // works when source/ sits one level under config.root — it lands at
59
- // node_modules/.livemark/routes once livemark is installed. Compute
60
- // the path dynamically from the consumer's actual layout.
61
- const routesDir = join(sourceDir, "routes")
62
- routeChildren.push(
63
- physical(relative(routesDir, join(overridesRoot, "routes"))),
64
- )
65
- }
66
12
 
67
13
  export default defineConfig({
68
- root: config.root,
69
- publicDir: join(config.root, ".livemark", "public"),
70
- build: { outDir: ".livemark/build" },
71
- define: {
72
- "import.meta.env.CONFIG": JSON.stringify(WebsiteConfig.parse(config)),
73
- },
74
- // peerDependencies guarantee one canonical react/react-dom in the pnpm
75
- // store. dedupe collapses any transitive resolutions to that copy.
76
- resolve: {
77
- dedupe: ["react", "react-dom"],
78
- },
79
14
  plugins: [
80
- livemark({
81
- defaultsRoot: sourceDir,
82
- overridesRoot,
83
- subdirs: [...OVERRIDE_SUBDIRS],
84
- configPath: config.configPath,
85
- }),
15
+ livemark({ config }),
86
16
  devtools(),
87
17
  tailwind(),
88
- contentCollections({
89
- configPath: join(sourceRelative, "content-collections.ts"),
90
- }),
18
+ contentCollections({ configPath: "content-collections.ts" }),
91
19
  tanstackStart({
92
- srcDirectory: sourceRelative,
20
+ srcDirectory: ".",
93
21
  pages: [{ path: "/" }],
94
22
  prerender: { enabled: true, crawlLinks: true },
95
23
  sitemap: config.site
96
24
  ? { enabled: true, host: config.site }
97
25
  : { enabled: false },
98
- router: {
99
- virtualRouteConfig: rootRoute("__root.tsx", routeChildren),
100
- },
26
+ router: { generatedRouteTree: "routeTree.gen.ts" },
101
27
  }),
102
28
  react(),
103
29
  svgr(),