polen 0.9.1-next.1 → 0.10.0-next.10

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 (481) hide show
  1. package/README.md +49 -364
  2. package/build/api/api.d.ts +1 -0
  3. package/build/api/api.d.ts.map +1 -1
  4. package/build/api/api.js +1 -0
  5. package/build/api/api.js.map +1 -1
  6. package/build/api/config/configurator.d.ts +9 -1
  7. package/build/api/config/configurator.d.ts.map +1 -1
  8. package/build/api/config/configurator.js +18 -6
  9. package/build/api/config/configurator.js.map +1 -1
  10. package/build/api/config/load.js +5 -5
  11. package/build/api/config/load.js.map +1 -1
  12. package/build/api/config-resolver/resolve.js +2 -2
  13. package/build/api/config-resolver/resolve.js.map +1 -1
  14. package/build/api/content/$$.d.ts +7 -0
  15. package/build/api/content/$$.d.ts.map +1 -0
  16. package/build/api/content/$$.js +7 -0
  17. package/build/api/content/$$.js.map +1 -0
  18. package/build/api/content/$.d.ts +2 -0
  19. package/build/api/content/$.d.ts.map +1 -0
  20. package/build/api/content/$.js +2 -0
  21. package/build/api/content/$.js.map +1 -0
  22. package/build/api/content/metadata.d.ts +10 -0
  23. package/build/api/content/metadata.d.ts.map +1 -0
  24. package/build/api/content/metadata.js +9 -0
  25. package/build/api/content/metadata.js.map +1 -0
  26. package/build/api/content/navbar.d.ts +10 -0
  27. package/build/api/content/navbar.d.ts.map +1 -0
  28. package/build/api/content/navbar.js +45 -0
  29. package/build/api/content/navbar.js.map +1 -0
  30. package/build/api/content/page.d.ts +11 -0
  31. package/build/api/content/page.d.ts.map +1 -0
  32. package/build/api/content/page.js +2 -0
  33. package/build/api/content/page.js.map +1 -0
  34. package/build/api/content/scan.d.ts +19 -0
  35. package/build/api/content/scan.d.ts.map +1 -0
  36. package/build/api/content/scan.js +90 -0
  37. package/build/api/content/scan.js.map +1 -0
  38. package/build/api/content/sidebar.d.ts +104 -0
  39. package/build/api/content/sidebar.d.ts.map +1 -0
  40. package/build/api/content/sidebar.js +166 -0
  41. package/build/api/content/sidebar.js.map +1 -0
  42. package/build/api/content/utils.d.ts +5 -0
  43. package/build/api/content/utils.d.ts.map +1 -0
  44. package/build/api/content/utils.js +8 -0
  45. package/build/api/content/utils.js.map +1 -0
  46. package/build/api/schema/data-sources/schema-directory/schema-directory.d.ts.map +1 -1
  47. package/build/api/schema/data-sources/schema-directory/schema-directory.js +3 -2
  48. package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
  49. package/build/api/static/index.d.ts +2 -0
  50. package/build/api/static/index.d.ts.map +1 -0
  51. package/build/api/static/index.js +2 -0
  52. package/build/api/static/index.js.map +1 -0
  53. package/build/api/static/manifest.d.ts +18 -0
  54. package/build/api/static/manifest.d.ts.map +1 -0
  55. package/build/api/static/manifest.js +13 -0
  56. package/build/api/static/manifest.js.map +1 -0
  57. package/build/api/static/rebase.d.ts +14 -0
  58. package/build/api/static/rebase.d.ts.map +1 -0
  59. package/build/api/static/rebase.js +110 -0
  60. package/build/api/static/rebase.js.map +1 -0
  61. package/build/api/static/static.d.ts +3 -0
  62. package/build/api/static/static.d.ts.map +1 -0
  63. package/build/api/static/static.js +3 -0
  64. package/build/api/static/static.js.map +1 -0
  65. package/build/api/vite/plugins/branding/index.d.ts +4 -0
  66. package/build/api/vite/plugins/branding/index.d.ts.map +1 -0
  67. package/build/api/vite/plugins/branding/index.js +80 -0
  68. package/build/api/vite/plugins/branding/index.js.map +1 -0
  69. package/build/api/vite/plugins/build.d.ts.map +1 -1
  70. package/build/api/vite/plugins/build.js +22 -1
  71. package/build/api/vite/plugins/build.js.map +1 -1
  72. package/build/api/vite/plugins/core.d.ts +2 -2
  73. package/build/api/vite/plugins/core.d.ts.map +1 -1
  74. package/build/api/vite/plugins/core.js +4 -5
  75. package/build/api/vite/plugins/core.js.map +1 -1
  76. package/build/api/vite/plugins/main.d.ts.map +1 -1
  77. package/build/api/vite/plugins/main.js +2 -1
  78. package/build/api/vite/plugins/main.js.map +1 -1
  79. package/build/api/vite/plugins/pages.d.ts +8 -14
  80. package/build/api/vite/plugins/pages.d.ts.map +1 -1
  81. package/build/api/vite/plugins/pages.js +110 -183
  82. package/build/api/vite/plugins/pages.js.map +1 -1
  83. package/build/api/vite/plugins/serve.js +5 -5
  84. package/build/api/vite/plugins/serve.js.map +1 -1
  85. package/build/cli/_/self-contained-mode.js +5 -5
  86. package/build/cli/_/self-contained-mode.js.map +1 -1
  87. package/build/cli/commands/static/$default.d.ts +3 -0
  88. package/build/cli/commands/static/$default.d.ts.map +1 -0
  89. package/build/cli/commands/static/$default.js +38 -0
  90. package/build/cli/commands/static/$default.js.map +1 -0
  91. package/build/cli/commands/static/rebase.d.ts +2 -0
  92. package/build/cli/commands/static/rebase.d.ts.map +1 -0
  93. package/build/cli/commands/static/rebase.js +26 -0
  94. package/build/cli/commands/static/rebase.js.map +1 -0
  95. package/build/cli/commands/static.d.ts +3 -0
  96. package/build/cli/commands/static.d.ts.map +1 -0
  97. package/build/cli/commands/static.js +5 -0
  98. package/build/cli/commands/static.js.map +1 -0
  99. package/build/exports/components.d.ts +2 -0
  100. package/build/exports/components.d.ts.map +1 -0
  101. package/build/exports/components.js +2 -0
  102. package/build/exports/components.js.map +1 -0
  103. package/build/lib/demos/builder.d.ts +83 -0
  104. package/build/lib/demos/builder.d.ts.map +1 -0
  105. package/build/lib/demos/builder.js +237 -0
  106. package/build/lib/demos/builder.js.map +1 -0
  107. package/build/lib/demos/config-schema.d.ts +243 -0
  108. package/build/lib/demos/config-schema.d.ts.map +1 -0
  109. package/build/lib/demos/config-schema.js +52 -0
  110. package/build/lib/demos/config-schema.js.map +1 -0
  111. package/build/lib/demos/config.d.ts +40 -0
  112. package/build/lib/demos/config.d.ts.map +1 -0
  113. package/build/lib/demos/config.js +180 -0
  114. package/build/lib/demos/config.js.map +1 -0
  115. package/build/lib/demos/index.d.ts +9 -0
  116. package/build/lib/demos/index.d.ts.map +1 -0
  117. package/build/lib/demos/index.js +8 -0
  118. package/build/lib/demos/index.js.map +1 -0
  119. package/build/lib/demos/ui/components.d.ts +33 -0
  120. package/build/lib/demos/ui/components.d.ts.map +1 -0
  121. package/build/lib/demos/ui/components.js +699 -0
  122. package/build/lib/demos/ui/components.js.map +1 -0
  123. package/build/lib/demos/ui/data-collector.d.ts +88 -0
  124. package/build/lib/demos/ui/data-collector.d.ts.map +1 -0
  125. package/build/lib/demos/ui/data-collector.js +174 -0
  126. package/build/lib/demos/ui/data-collector.js.map +1 -0
  127. package/build/lib/demos/ui/landing-page-cli.d.ts +3 -0
  128. package/build/lib/demos/ui/landing-page-cli.d.ts.map +1 -0
  129. package/build/lib/demos/ui/landing-page-cli.js +21 -0
  130. package/build/lib/demos/ui/landing-page-cli.js.map +1 -0
  131. package/build/lib/demos/ui/landing-page.d.ts +32 -0
  132. package/build/lib/demos/ui/landing-page.d.ts.map +1 -0
  133. package/build/lib/demos/ui/landing-page.js +83 -0
  134. package/build/lib/demos/ui/landing-page.js.map +1 -0
  135. package/build/lib/demos/ui/page-renderer.d.ts +26 -0
  136. package/build/lib/demos/ui/page-renderer.d.ts.map +1 -0
  137. package/build/lib/demos/ui/page-renderer.js +104 -0
  138. package/build/lib/demos/ui/page-renderer.js.map +1 -0
  139. package/build/lib/demos/utils.d.ts +14 -0
  140. package/build/lib/demos/utils.d.ts.map +1 -0
  141. package/build/lib/demos/utils.js +37 -0
  142. package/build/lib/demos/utils.js.map +1 -0
  143. package/build/lib/deployment/$$.d.ts +3 -0
  144. package/build/lib/deployment/$$.d.ts.map +1 -0
  145. package/build/lib/deployment/$$.js +3 -0
  146. package/build/lib/deployment/$$.js.map +1 -0
  147. package/build/lib/deployment/$.d.ts +2 -0
  148. package/build/lib/deployment/$.d.ts.map +1 -0
  149. package/build/lib/deployment/$.js +2 -0
  150. package/build/lib/deployment/$.js.map +1 -0
  151. package/build/lib/deployment/metadata.d.ts +32 -0
  152. package/build/lib/deployment/metadata.d.ts.map +1 -0
  153. package/build/lib/deployment/metadata.js +37 -0
  154. package/build/lib/deployment/metadata.js.map +1 -0
  155. package/build/lib/deployment/path-manager.d.ts +41 -0
  156. package/build/lib/deployment/path-manager.d.ts.map +1 -0
  157. package/build/lib/deployment/path-manager.js +157 -0
  158. package/build/lib/deployment/path-manager.js.map +1 -0
  159. package/build/lib/file-router/file-router.d.ts +0 -2
  160. package/build/lib/file-router/file-router.d.ts.map +1 -1
  161. package/build/lib/file-router/file-router.js +0 -2
  162. package/build/lib/file-router/file-router.js.map +1 -1
  163. package/build/lib/file-router/route.d.ts +2 -0
  164. package/build/lib/file-router/route.d.ts.map +1 -1
  165. package/build/lib/file-router/route.js.map +1 -1
  166. package/build/lib/file-router/scan.d.ts.map +1 -1
  167. package/build/lib/file-router/scan.js +22 -13
  168. package/build/lib/file-router/scan.js.map +1 -1
  169. package/build/lib/github-actions/git-controller.d.ts +50 -0
  170. package/build/lib/github-actions/git-controller.d.ts.map +1 -0
  171. package/build/lib/github-actions/git-controller.js +90 -0
  172. package/build/lib/github-actions/git-controller.js.map +1 -0
  173. package/build/lib/github-actions/github-actions.d.ts +7 -0
  174. package/build/lib/github-actions/github-actions.d.ts.map +1 -0
  175. package/build/lib/github-actions/github-actions.js +7 -0
  176. package/build/lib/github-actions/github-actions.js.map +1 -0
  177. package/build/lib/github-actions/index.d.ts +2 -0
  178. package/build/lib/github-actions/index.d.ts.map +1 -0
  179. package/build/lib/github-actions/index.js +2 -0
  180. package/build/lib/github-actions/index.js.map +1 -0
  181. package/build/lib/github-actions/lib/get-pr-deployments.d.ts +12 -0
  182. package/build/lib/github-actions/lib/get-pr-deployments.d.ts.map +1 -0
  183. package/build/lib/github-actions/lib/get-pr-deployments.js +51 -0
  184. package/build/lib/github-actions/lib/get-pr-deployments.js.map +1 -0
  185. package/build/lib/github-actions/pr-controller.d.ts +39 -0
  186. package/build/lib/github-actions/pr-controller.d.ts.map +1 -0
  187. package/build/lib/github-actions/pr-controller.js +122 -0
  188. package/build/lib/github-actions/pr-controller.js.map +1 -0
  189. package/build/lib/github-actions/run-step-cli.d.ts +9 -0
  190. package/build/lib/github-actions/run-step-cli.d.ts.map +1 -0
  191. package/build/lib/github-actions/run-step-cli.js +71 -0
  192. package/build/lib/github-actions/run-step-cli.js.map +1 -0
  193. package/build/lib/github-actions/runner.d.ts +17 -0
  194. package/build/lib/github-actions/runner.d.ts.map +1 -0
  195. package/build/lib/github-actions/runner.js +195 -0
  196. package/build/lib/github-actions/runner.js.map +1 -0
  197. package/build/lib/github-actions/schemas/context.d.ts +933 -0
  198. package/build/lib/github-actions/schemas/context.d.ts.map +1 -0
  199. package/build/lib/github-actions/schemas/context.js +407 -0
  200. package/build/lib/github-actions/schemas/context.js.map +1 -0
  201. package/build/lib/github-actions/schemas/index.d.ts +5 -0
  202. package/build/lib/github-actions/schemas/index.d.ts.map +1 -0
  203. package/build/lib/github-actions/schemas/index.js +5 -0
  204. package/build/lib/github-actions/schemas/index.js.map +1 -0
  205. package/build/lib/github-actions/search-module.d.ts +38 -0
  206. package/build/lib/github-actions/search-module.d.ts.map +1 -0
  207. package/build/lib/github-actions/search-module.js +40 -0
  208. package/build/lib/github-actions/search-module.js.map +1 -0
  209. package/build/lib/github-actions/step.d.ts +163 -0
  210. package/build/lib/github-actions/step.d.ts.map +1 -0
  211. package/build/lib/github-actions/step.js +121 -0
  212. package/build/lib/github-actions/step.js.map +1 -0
  213. package/build/lib/helpers.d.ts.map +1 -1
  214. package/build/lib/helpers.js +5 -3
  215. package/build/lib/helpers.js.map +1 -1
  216. package/build/lib/kit-temp.d.ts +54 -0
  217. package/build/lib/kit-temp.d.ts.map +1 -1
  218. package/build/lib/kit-temp.js +82 -14
  219. package/build/lib/kit-temp.js.map +1 -1
  220. package/build/lib/kit-temp.test-d.d.ts +2 -0
  221. package/build/lib/kit-temp.test-d.d.ts.map +1 -0
  222. package/build/lib/kit-temp.test-d.js +75 -0
  223. package/build/lib/kit-temp.test-d.js.map +1 -0
  224. package/build/lib/mask/$$.d.ts +3 -0
  225. package/build/lib/mask/$$.d.ts.map +1 -0
  226. package/build/lib/mask/$$.js +3 -0
  227. package/build/lib/mask/$$.js.map +1 -0
  228. package/build/lib/mask/$.d.ts +2 -0
  229. package/build/lib/mask/$.d.ts.map +1 -0
  230. package/build/lib/mask/$.js +2 -0
  231. package/build/lib/mask/$.js.map +1 -0
  232. package/build/lib/mask/apply.d.ts +86 -0
  233. package/build/lib/mask/apply.d.ts.map +1 -0
  234. package/build/lib/mask/apply.js +86 -0
  235. package/build/lib/mask/apply.js.map +1 -0
  236. package/build/lib/mask/mask.d.ts +124 -0
  237. package/build/lib/mask/mask.d.ts.map +1 -0
  238. package/build/lib/mask/mask.js +137 -0
  239. package/build/lib/mask/mask.js.map +1 -0
  240. package/build/lib/mask/mask.test-d.d.ts +2 -0
  241. package/build/lib/mask/mask.test-d.d.ts.map +1 -0
  242. package/build/lib/mask/mask.test-d.js +102 -0
  243. package/build/lib/mask/mask.test-d.js.map +1 -0
  244. package/build/lib/mutation-type.d.ts +18 -0
  245. package/build/lib/mutation-type.d.ts.map +1 -0
  246. package/build/lib/mutation-type.js +16 -0
  247. package/build/lib/mutation-type.js.map +1 -0
  248. package/build/lib/task/$$.d.ts +3 -0
  249. package/build/lib/task/$$.d.ts.map +1 -0
  250. package/build/lib/task/$$.js +3 -0
  251. package/build/lib/task/$$.js.map +1 -0
  252. package/build/lib/task/$.d.ts +2 -0
  253. package/build/lib/task/$.d.ts.map +1 -0
  254. package/build/lib/task/$.js +2 -0
  255. package/build/lib/task/$.js.map +1 -0
  256. package/build/lib/task/report.d.ts +28 -0
  257. package/build/lib/task/report.d.ts.map +1 -0
  258. package/build/lib/task/report.js +33 -0
  259. package/build/lib/task/report.js.map +1 -0
  260. package/build/lib/task/task.d.ts +44 -0
  261. package/build/lib/task/task.d.ts.map +1 -0
  262. package/build/lib/task/task.js +63 -0
  263. package/build/lib/task/task.js.map +1 -0
  264. package/build/lib/version-history/index.d.ts +3 -0
  265. package/build/lib/version-history/index.d.ts.map +1 -0
  266. package/build/lib/version-history/index.js +2 -0
  267. package/build/lib/version-history/index.js.map +1 -0
  268. package/build/lib/version-history/types.d.ts +64 -0
  269. package/build/lib/version-history/types.d.ts.map +1 -0
  270. package/build/lib/version-history/types.js +5 -0
  271. package/build/lib/version-history/types.js.map +1 -0
  272. package/build/lib/version-history/version-history.d.ts +85 -0
  273. package/build/lib/version-history/version-history.d.ts.map +1 -0
  274. package/build/lib/version-history/version-history.js +248 -0
  275. package/build/lib/version-history/version-history.js.map +1 -0
  276. package/build/lib/vite-virtual/debug.d.ts +1 -1
  277. package/build/lib/vite-virtual/debug.d.ts.map +1 -1
  278. package/build/lib/vite-virtual/debug.js +1 -1
  279. package/build/lib/vite-virtual/debug.js.map +1 -1
  280. package/build/project-data.d.ts +0 -1
  281. package/build/project-data.d.ts.map +1 -1
  282. package/build/sandbox.d.ts +2 -0
  283. package/build/sandbox.d.ts.map +1 -0
  284. package/build/sandbox.js +18 -0
  285. package/build/sandbox.js.map +1 -0
  286. package/build/singletons/debug.d.ts +2 -2
  287. package/build/singletons/debug.d.ts.map +1 -1
  288. package/build/singletons/debug.js +2 -2
  289. package/build/singletons/debug.js.map +1 -1
  290. package/build/template/components/HamburgerMenu.d.ts +9 -0
  291. package/build/template/components/HamburgerMenu.d.ts.map +1 -0
  292. package/build/template/components/HamburgerMenu.jsx +53 -0
  293. package/build/template/components/HamburgerMenu.jsx.map +1 -0
  294. package/build/template/components/Link.jsx +1 -1
  295. package/build/template/components/Logo.d.ts +9 -0
  296. package/build/template/components/Logo.d.ts.map +1 -0
  297. package/build/template/components/Logo.jsx +29 -0
  298. package/build/template/components/Logo.jsx.map +1 -0
  299. package/build/template/components/NotFound.d.ts +2 -0
  300. package/build/template/components/NotFound.d.ts.map +1 -0
  301. package/build/template/components/NotFound.jsx +26 -0
  302. package/build/template/components/NotFound.jsx.map +1 -0
  303. package/build/template/components/ThemeToggle.d.ts +3 -0
  304. package/build/template/components/ThemeToggle.d.ts.map +1 -0
  305. package/build/template/components/ThemeToggle.jsx +10 -0
  306. package/build/template/components/ThemeToggle.jsx.map +1 -0
  307. package/build/template/components/content/$$.d.ts +2 -0
  308. package/build/template/components/content/$$.d.ts.map +1 -0
  309. package/build/template/components/content/$$.js +2 -0
  310. package/build/template/components/content/$$.js.map +1 -0
  311. package/build/template/components/sidebar/Sidebar.d.ts +2 -2
  312. package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
  313. package/build/template/components/sidebar/SidebarItem.d.ts +3 -3
  314. package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
  315. package/build/template/components/sidebar/SidebarItem.jsx +1 -1
  316. package/build/template/components/sidebar/SidebarItem.jsx.map +1 -1
  317. package/build/template/contexts/ThemeContext.d.ts +12 -0
  318. package/build/template/contexts/ThemeContext.d.ts.map +1 -0
  319. package/build/template/contexts/ThemeContext.jsx +41 -0
  320. package/build/template/contexts/ThemeContext.jsx.map +1 -0
  321. package/build/template/routes/root.d.ts.map +1 -1
  322. package/build/template/routes/root.jsx +66 -53
  323. package/build/template/routes/root.jsx.map +1 -1
  324. package/build/template/server/app.d.ts.map +1 -1
  325. package/build/template/server/app.js +2 -21
  326. package/build/template/server/app.js.map +1 -1
  327. package/package.json +42 -28
  328. package/src/api/api.ts +1 -0
  329. package/src/api/config/configurator.ts +28 -6
  330. package/src/api/config/load.ts +5 -5
  331. package/src/api/config-resolver/resolve.ts +2 -2
  332. package/src/api/content/$$.ts +6 -0
  333. package/src/api/content/$.test.ts +72 -0
  334. package/src/api/content/$.ts +1 -0
  335. package/src/api/content/metadata.ts +11 -0
  336. package/src/api/content/navbar.test.ts +55 -0
  337. package/src/api/content/navbar.ts +61 -0
  338. package/src/api/content/page.ts +12 -0
  339. package/src/api/content/scan.ts +117 -0
  340. package/src/api/content/sidebar.test.ts +297 -0
  341. package/src/api/content/sidebar.ts +283 -0
  342. package/src/api/content/utils.ts +7 -0
  343. package/src/api/schema/data-sources/schema-directory/schema-directory.ts +3 -2
  344. package/src/api/singletons/markdown/markdown.test.ts +1 -1
  345. package/src/api/static/index.ts +1 -0
  346. package/src/api/static/manifest.test.ts +106 -0
  347. package/src/api/static/manifest.ts +16 -0
  348. package/src/api/static/rebase.test.ts +229 -0
  349. package/src/api/static/rebase.ts +140 -0
  350. package/src/api/static/static.ts +2 -0
  351. package/src/api/utils/asset-url/asset-url.test.ts +4 -4
  352. package/src/api/vite/plugins/branding/index.ts +108 -0
  353. package/src/api/vite/plugins/build.ts +25 -1
  354. package/src/api/vite/plugins/core.ts +6 -7
  355. package/src/api/vite/plugins/main.ts +2 -0
  356. package/src/api/vite/plugins/pages.ts +131 -207
  357. package/src/api/vite/plugins/serve.ts +5 -5
  358. package/src/cli/_/self-contained-mode.ts +5 -5
  359. package/src/cli/commands/static/$default.ts +43 -0
  360. package/src/cli/commands/static/rebase.ts +37 -0
  361. package/src/cli/commands/static.ts +6 -0
  362. package/src/exports/components.ts +1 -0
  363. package/src/lib/demos/builder.ts +298 -0
  364. package/src/lib/demos/config-schema.ts +56 -0
  365. package/src/lib/demos/config.test.ts +193 -0
  366. package/src/lib/demos/config.ts +205 -0
  367. package/src/lib/demos/index.ts +9 -0
  368. package/src/lib/demos/ui/components.ts +739 -0
  369. package/src/lib/demos/ui/data-collector.ts +246 -0
  370. package/src/lib/demos/ui/landing-page-cli.ts +23 -0
  371. package/src/lib/demos/ui/landing-page.ts +126 -0
  372. package/src/lib/demos/ui/page-renderer.ts +124 -0
  373. package/src/lib/demos/utils.ts +43 -0
  374. package/src/lib/deployment/$$.ts +2 -0
  375. package/src/lib/deployment/$.test.ts +53 -0
  376. package/src/lib/deployment/$.ts +1 -0
  377. package/src/lib/deployment/metadata.ts +40 -0
  378. package/src/lib/deployment/path-manager.ts +186 -0
  379. package/src/lib/file-router/file-router.ts +0 -2
  380. package/src/lib/file-router/linter.test.ts +2 -0
  381. package/src/lib/file-router/route.ts +2 -0
  382. package/src/lib/file-router/scan.ts +26 -14
  383. package/src/lib/github-actions/git-controller.ts +151 -0
  384. package/src/lib/github-actions/github-actions.ts +6 -0
  385. package/src/lib/github-actions/index.ts +1 -0
  386. package/src/lib/github-actions/lib/get-pr-deployments.ts +76 -0
  387. package/src/lib/github-actions/pr-controller.test.ts +172 -0
  388. package/src/lib/github-actions/pr-controller.ts +183 -0
  389. package/src/lib/github-actions/run-step-cli.ts +84 -0
  390. package/src/lib/github-actions/runner.test.ts +192 -0
  391. package/src/lib/github-actions/runner.ts +226 -0
  392. package/src/lib/github-actions/schemas/context.ts +424 -0
  393. package/src/lib/github-actions/schemas/index.ts +5 -0
  394. package/src/lib/github-actions/search-module.test.ts +110 -0
  395. package/src/lib/github-actions/search-module.ts +76 -0
  396. package/src/lib/github-actions/step.test.ts +149 -0
  397. package/src/lib/github-actions/step.ts +232 -0
  398. package/src/lib/helpers.ts +4 -3
  399. package/src/lib/kit-temp.test-d.ts +115 -0
  400. package/src/lib/kit-temp.test.ts +127 -0
  401. package/src/lib/kit-temp.ts +128 -14
  402. package/src/lib/mask/$$.ts +2 -0
  403. package/src/lib/mask/$.test.ts +248 -0
  404. package/src/lib/mask/$.ts +1 -0
  405. package/src/lib/mask/apply.ts +134 -0
  406. package/src/lib/mask/mask.test-d.ts +144 -0
  407. package/src/lib/mask/mask.ts +244 -0
  408. package/src/lib/mutation-type.ts +20 -0
  409. package/src/lib/shiki/shiki.test.ts +1 -1
  410. package/src/lib/task/$$.ts +2 -0
  411. package/src/lib/task/$.test.ts +209 -0
  412. package/src/lib/task/$.ts +1 -0
  413. package/src/lib/task/report.ts +72 -0
  414. package/src/lib/task/task.ts +112 -0
  415. package/src/lib/version-history/index.test.ts +196 -0
  416. package/src/lib/version-history/index.ts +4 -0
  417. package/src/lib/version-history/types.ts +68 -0
  418. package/src/lib/version-history/version-history.ts +293 -0
  419. package/src/lib/vite-virtual/debug.ts +1 -1
  420. package/src/project-data.ts +0 -1
  421. package/src/sandbox.ts +20 -0
  422. package/src/singletons/debug.ts +2 -2
  423. package/src/template/components/HamburgerMenu.tsx +96 -0
  424. package/src/template/components/Link.tsx +1 -1
  425. package/src/template/components/Logo.tsx +46 -0
  426. package/src/template/components/NotFound.tsx +28 -0
  427. package/src/template/components/ThemeToggle.tsx +21 -0
  428. package/src/template/components/content/$$.ts +1 -0
  429. package/src/template/components/sidebar/Sidebar.tsx +2 -2
  430. package/src/template/components/sidebar/SidebarItem.tsx +8 -8
  431. package/src/template/contexts/ThemeContext.tsx +60 -0
  432. package/src/template/routes/root.tsx +85 -74
  433. package/src/template/server/app.ts +2 -27
  434. package/build/lib/debug/debug.d.ts +0 -13
  435. package/build/lib/debug/debug.d.ts.map +0 -1
  436. package/build/lib/debug/debug.js +0 -86
  437. package/build/lib/debug/debug.js.map +0 -1
  438. package/build/lib/debug/environment-variable.d.ts +0 -6
  439. package/build/lib/debug/environment-variable.d.ts.map +0 -1
  440. package/build/lib/debug/environment-variable.js +0 -48
  441. package/build/lib/debug/environment-variable.js.map +0 -1
  442. package/build/lib/debug/index.d.ts +0 -2
  443. package/build/lib/debug/index.d.ts.map +0 -1
  444. package/build/lib/debug/index.js +0 -2
  445. package/build/lib/debug/index.js.map +0 -1
  446. package/build/lib/file-router/scan-tree.d.ts +0 -20
  447. package/build/lib/file-router/scan-tree.d.ts.map +0 -1
  448. package/build/lib/file-router/scan-tree.js +0 -158
  449. package/build/lib/file-router/scan-tree.js.map +0 -1
  450. package/build/lib/file-router/sidebar/index.d.ts +0 -3
  451. package/build/lib/file-router/sidebar/index.d.ts.map +0 -1
  452. package/build/lib/file-router/sidebar/index.js +0 -4
  453. package/build/lib/file-router/sidebar/index.js.map +0 -1
  454. package/build/lib/file-router/sidebar/sidebar-tree.d.ts +0 -9
  455. package/build/lib/file-router/sidebar/sidebar-tree.d.ts.map +0 -1
  456. package/build/lib/file-router/sidebar/sidebar-tree.js +0 -85
  457. package/build/lib/file-router/sidebar/sidebar-tree.js.map +0 -1
  458. package/build/lib/file-router/sidebar/types.d.ts +0 -17
  459. package/build/lib/file-router/sidebar/types.d.ts.map +0 -1
  460. package/build/lib/file-router/sidebar/types.js +0 -2
  461. package/build/lib/file-router/sidebar/types.js.map +0 -1
  462. package/build/lib/tree/index.d.ts +0 -3
  463. package/build/lib/tree/index.d.ts.map +0 -1
  464. package/build/lib/tree/index.js +0 -2
  465. package/build/lib/tree/index.js.map +0 -1
  466. package/build/lib/tree/tree.d.ts +0 -62
  467. package/build/lib/tree/tree.d.ts.map +0 -1
  468. package/build/lib/tree/tree.js +0 -134
  469. package/build/lib/tree/tree.js.map +0 -1
  470. package/src/lib/debug/debug.ts +0 -120
  471. package/src/lib/debug/environment-variable.ts +0 -56
  472. package/src/lib/debug/index.ts +0 -1
  473. package/src/lib/file-router/scan-tree.test.ts +0 -189
  474. package/src/lib/file-router/scan-tree.ts +0 -205
  475. package/src/lib/file-router/sidebar/index.ts +0 -3
  476. package/src/lib/file-router/sidebar/sidebar-tree.test.ts +0 -123
  477. package/src/lib/file-router/sidebar/sidebar-tree.ts +0 -110
  478. package/src/lib/file-router/sidebar/types.ts +0 -19
  479. package/src/lib/tree/index.ts +0 -2
  480. package/src/lib/tree/tree.test.ts +0 -117
  481. package/src/lib/tree/tree.ts +0 -183
@@ -1,134 +0,0 @@
1
- /**
2
- * Generic tree data structure and utilities
3
- */
4
- /**
5
- * Create a new tree node
6
- */
7
- export const node = (value, children = []) => ({
8
- value,
9
- children,
10
- });
11
- /**
12
- * Map over a tree, transforming each node's value
13
- */
14
- export const map = (tree, mapper, depth = 0, path = []) => {
15
- const newPath = [...path, tree.value];
16
- return {
17
- value: mapper(tree.value, depth, path),
18
- children: tree.children.map(child => map(child, mapper, depth + 1, newPath)),
19
- };
20
- };
21
- /**
22
- * Visit each node in the tree (depth-first)
23
- */
24
- export const visit = (tree, visitor, depth = 0, path = []) => {
25
- visitor(tree, depth, path);
26
- const newPath = [...path, tree.value];
27
- tree.children.forEach(child => visit(child, visitor, depth + 1, newPath));
28
- };
29
- /**
30
- * Find a node in the tree
31
- */
32
- export const find = (tree, predicate, depth = 0, path = []) => {
33
- if (predicate(tree.value, depth, path)) {
34
- return tree;
35
- }
36
- const newPath = [...path, tree.value];
37
- for (const child of tree.children) {
38
- const found = find(child, predicate, depth + 1, newPath);
39
- if (found)
40
- return found;
41
- }
42
- return undefined;
43
- };
44
- /**
45
- * Filter tree nodes (keeps structure, removes non-matching nodes)
46
- */
47
- export const filter = (tree, predicate, depth = 0, path = []) => {
48
- const newPath = [...path, tree.value];
49
- const filteredChildren = tree.children
50
- .map(child => filter(child, predicate, depth + 1, newPath))
51
- .filter((child) => child !== undefined);
52
- // Keep node if it matches or has matching children
53
- if (predicate(tree.value, depth, path) || filteredChildren.length > 0) {
54
- return {
55
- value: tree.value,
56
- children: filteredChildren,
57
- };
58
- }
59
- return undefined;
60
- };
61
- /**
62
- * Sort a tree's children at each level
63
- */
64
- export const sort = (tree, compareFn) => ({
65
- value: tree.value,
66
- children: tree.children
67
- .map(child => sort(child, compareFn))
68
- .sort((a, b) => compareFn(a.value, b.value)),
69
- });
70
- /**
71
- * Flatten a tree into an array (depth-first)
72
- */
73
- export const flatten = (tree) => {
74
- const result = [tree.value];
75
- tree.children.forEach(child => {
76
- result.push(...flatten(child));
77
- });
78
- return result;
79
- };
80
- /**
81
- * Get the depth of the tree
82
- */
83
- export const depth = (tree) => {
84
- if (tree.children.length === 0)
85
- return 0;
86
- return 1 + Math.max(...tree.children.map(depth));
87
- };
88
- /**
89
- * Count total nodes in the tree
90
- */
91
- export const count = (tree) => {
92
- return 1 + tree.children.reduce((sum, child) => sum + count(child), 0);
93
- };
94
- /**
95
- * Check if a node is a leaf (has no children)
96
- */
97
- export const isLeaf = (node) => {
98
- return node.children.length === 0;
99
- };
100
- /**
101
- * Get all leaf nodes
102
- */
103
- export const leaves = (tree) => {
104
- if (isLeaf(tree))
105
- return [tree];
106
- return tree.children.flatMap(leaves);
107
- };
108
- /**
109
- * Build a tree from a flat list with parent references
110
- */
111
- export const fromList = (items, rootId) => {
112
- const itemMap = new Map(items.map(item => [item.id, item]));
113
- const roots = [];
114
- const nodeMap = new Map();
115
- // Create all nodes
116
- items.forEach(item => {
117
- nodeMap.set(item.id, node(item));
118
- });
119
- // Build hierarchy
120
- items.forEach(item => {
121
- const itemNode = nodeMap.get(item.id);
122
- if (item.parentId === rootId) {
123
- roots.push(itemNode);
124
- }
125
- else if (item.parentId) {
126
- const parent = nodeMap.get(item.parentId);
127
- if (parent) {
128
- parent.children.push(itemNode);
129
- }
130
- }
131
- });
132
- return roots;
133
- };
134
- //# sourceMappingURL=tree.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tree.js","sourceRoot":"","sources":["../../../src/lib/tree/tree.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAI,KAAQ,EAAE,WAA0B,EAAE,EAAe,EAAE,CAAC,CAAC;IAC/E,KAAK;IACL,QAAQ;CACT,CAAC,CAAA;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,CACjB,IAAiB,EACjB,MAAwB,EACxB,KAAK,GAAG,CAAC,EACT,OAAY,EAAE,EACD,EAAE;IACf,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAA;IACrC,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC;QACtC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;KAC7E,CAAA;AACH,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CACnB,IAAiB,EACjB,OAAuB,EACvB,KAAK,GAAG,CAAC,EACT,OAAY,EAAE,EACR,EAAE;IACR,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAA;IAC1B,MAAM,OA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AC,CAAA;IAEF,kBAAkB;IAClB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAE,CAAA;QACtC,IAAI,IAAI,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACtB,CAAC;aAAM,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACzC,IAAI,MAAM,EAAE,CAAC;gBACX,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YAChC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
@@ -1,120 +0,0 @@
1
- import { Arr, Str } from '@wollybeard/kit'
2
- import { colorize } from 'consola/utils'
3
- import { inspect } from 'node:util'
4
- import { calcIsEnabledFromEnv } from './environment-variable.ts'
5
-
6
- type DebugParameters = [event: string, payload?: unknown]
7
-
8
- export interface Debug {
9
- (...args: DebugParameters): void
10
- toggle: (isEnabled: boolean) => void
11
- sub: (subNamespace: string | string[]) => Debug
12
- }
13
-
14
- interface State {
15
- isEnabled: boolean
16
- }
17
-
18
- // todo:
19
- // const Option = {
20
- // else:
21
- // <alternative>(alternative: alternative) => <value>(value: value): value extends undefined ? alternative : value => {
22
- // if (value === undefined || value === null) {
23
- // return alternative as any
24
- // }
25
- // return value as any
26
- // },
27
- // }
28
-
29
- // const namespaceToString = (namespace: string[] = []): string => {
30
- // return formatNamespaceSegment(namespace.join(`_`))
31
- // // todo:
32
- // // const x = Option.else([] as string[])
33
- // // const y = x(namespace)
34
- // // const z = Fn.pipe(
35
- // // namespace,
36
- // // x,
37
- // // // Option.else([]),
38
- // // // (_) => Array.is(_) ? _ : [],
39
- // // // Str.joinWith(`_`),
40
- // // // Str.Case.upper,
41
- // // )
42
- // }
43
-
44
- const formatNamespaceSegment = (segment: string): string => {
45
- return Str.Case.snake(segment).toUpperCase()
46
- }
47
-
48
- export const create = (namespaceInput?: string | string[], initialState?: State): Debug => {
49
- const namespace = Arr.sure(namespaceInput ?? [])
50
- const isDebugEnabledFromEnv = calcIsEnabledFromEnv(process.env, namespace)
51
-
52
- const state: State = initialState ?? {
53
- isEnabled: isDebugEnabledFromEnv,
54
- }
55
-
56
- const debug: Debug = (...args) => {
57
- const isPayloadPassed = args.length === 2
58
- const [event, payload] = args
59
-
60
- if (state.isEnabled) {
61
- // If a payload is an array then default depth to 1 so that we see its _contents_
62
- const isPayloadArray = Array.isArray(payload)
63
- const depthBoost = isPayloadArray ? 1 : 0
64
- const defaultDepth = 3
65
- const debugDepth = parseNumberOr(process.env[`DEBUG_DEPTH`], defaultDepth) + depthBoost
66
- const isPayloadDisabled = debugDepth < 0
67
-
68
- const payloadRendered = isPayloadPassed && !isPayloadDisabled
69
- ? inspect(payload, {
70
- colors: true,
71
- depth: debugDepth,
72
- // compact: true,
73
- maxStringLength: 1000,
74
- })
75
- : ``
76
-
77
- const formatNamespaceSegmentAnsi = (segment: string): string => {
78
- return colorize(`bold`, colorize(`bgYellowBright`, ` ` + formatNamespaceSegment(segment) + ` `))
79
- }
80
-
81
- const namespaceRendered = namespace.map(formatNamespaceSegmentAnsi).join(` `)
82
- const eventRendered = colorize(
83
- `bold`,
84
- colorize(
85
- `bgMagentaBright`,
86
- ` ` + formatNamespaceSegment(event) + ` `,
87
- ),
88
- )
89
- const prefixRendered = `${namespaceRendered} ${eventRendered}`
90
-
91
- console.debug(prefixRendered, payloadRendered)
92
- }
93
- }
94
-
95
- debug.toggle = (isEnabled: boolean) => {
96
- state.isEnabled = isEnabled
97
- }
98
-
99
- debug.sub = (subNamespace: string | string[]) => {
100
- const s = Arr.sure(subNamespace)
101
- const stateCopy = structuredClone(state)
102
- return create([...namespace, ...s], stateCopy)
103
- }
104
-
105
- return debug
106
- }
107
-
108
- const parseNumberOr = (str: string | undefined, defaultValue: number): number => {
109
- if (str === ``) return defaultValue
110
-
111
- const parsed = Number(str)
112
- if (Number.isNaN(parsed)) {
113
- return defaultValue
114
- }
115
- return parsed
116
- }
117
-
118
- // initialize root debug
119
-
120
- export const debugGlobal = create()
@@ -1,56 +0,0 @@
1
- import { Arr, Language } from '@wollybeard/kit'
2
-
3
- export const enVarName = `DEBUG`
4
-
5
- export const deliminator = `,`
6
- export const wildcard = `*`
7
- export const enVarEnabledValuesStatic = [`true`, wildcard, `1`]
8
-
9
- export const calcIsEnabledFromEnv = (
10
- enVars: Record<string, unknown>,
11
- namespace?: string[],
12
- ): boolean => {
13
- const namespace_ = namespace?.map(_ => _.toLowerCase())
14
-
15
- const includeFilters = typeof enVars[enVarName] === `string`
16
- ? enVars[enVarName]
17
- .trim()
18
- .toLowerCase()
19
- .split(deliminator)
20
- .map(patternExpression => {
21
- return patternExpression
22
- .trim()
23
- .split(`:`)
24
- .map(_ => _.trim())
25
- })
26
- : undefined
27
-
28
- if (!includeFilters) return false
29
-
30
- if (includeFilters.length === 0) return false
31
-
32
- // If any is like * then it means "enable everything"
33
- if (
34
- includeFilters.some(includeFilter => {
35
- if (includeFilter.length === 1 && enVarEnabledValuesStatic.includes(includeFilter[0]!)) return true
36
- })
37
- ) return true
38
-
39
- // At this point, if there is no namespace (e.g. root), then we cannot match anything
40
- if (!namespace_) return false
41
-
42
- for (const includeFilter of includeFilters) {
43
- if (Arr.getLast(includeFilter) !== wildcard) {
44
- return includeFilter.join() === namespace_.join()
45
- }
46
-
47
- let i = 0
48
- for (const segment of includeFilter) {
49
- if (segment === wildcard) return true
50
- if (segment !== namespace_[i]) return false
51
- i++
52
- }
53
- }
54
-
55
- Language.never()
56
- }
@@ -1 +0,0 @@
1
- export * as Debug from './debug.ts'
@@ -1,189 +0,0 @@
1
- import { Tree } from '#lib/tree/index'
2
- import { describe, expect, test } from 'vitest'
3
- import type { RouteTreeNode } from './scan-tree.ts'
4
-
5
- // Helper to create a mock route tree structure for testing
6
- const mockRouteTree = (structure: Record<string, any>): RouteTreeNode => {
7
- const sortNodes = (nodes: RouteTreeNode[]): RouteTreeNode[] => {
8
- return nodes.sort((a, b) => {
9
- // If both have orders, sort by order
10
- if (a.value.order !== undefined && b.value.order !== undefined) {
11
- return a.value.order - b.value.order
12
- }
13
- // If only one has order, it comes first
14
- if (a.value.order !== undefined) return -1
15
- if (b.value.order !== undefined) return 1
16
- // Otherwise sort alphabetically
17
- return a.value.name.localeCompare(b.value.name)
18
- })
19
- }
20
-
21
- const buildNode = (name: string, value: any): RouteTreeNode => {
22
- const parsed = name.match(/^(?<order>\d+)[_-](?<name>.+)$/)
23
- const nodeName = parsed?.groups?.[`name`] ?? name
24
- const order = parsed?.groups?.[`order`] ? parseInt(parsed.groups[`order`], 10) : undefined
25
-
26
- if (typeof value === 'object' && !value.isFile) {
27
- // Directory node
28
- const children = Object.entries(value).map(([childName, childValue]) => buildNode(childName, childValue))
29
- return Tree.node(
30
- { name: nodeName, order, type: 'directory' },
31
- sortNodes(children),
32
- )
33
- } else {
34
- // File node - strip extension (but keep 'index' as is)
35
- const nameWithoutExtension = nodeName.replace(/\.(md|mdx)$/, '')
36
- return Tree.node({ name: nameWithoutExtension, order, type: 'file', route: value })
37
- }
38
- }
39
-
40
- const children = Object.entries(structure).map(([name, value]) => buildNode(name, value))
41
- return Tree.node(
42
- { name: 'root', type: 'directory' },
43
- sortNodes(children),
44
- )
45
- }
46
-
47
- describe('scan-tree structure', () => {
48
- test('builds tree from flat file structure', () => {
49
- const tree = mockRouteTree({
50
- 'getting-started.md': { isFile: true },
51
- 'guide': {
52
- 'introduction.md': { isFile: true },
53
- 'basics.md': { isFile: true },
54
- },
55
- 'api': {
56
- 'reference.md': { isFile: true },
57
- },
58
- })
59
-
60
- expect(tree.value.name).toBe('root')
61
- expect(tree.children).toHaveLength(3)
62
-
63
- const guide = tree.children.find(c => c.value.name === 'guide')
64
- expect(guide).toBeDefined()
65
- expect(guide!.children).toHaveLength(2)
66
- })
67
-
68
- test('handles numbered prefixes on files', () => {
69
- const tree = mockRouteTree({
70
- '10_getting-started.md': { isFile: true },
71
- '20_configuration.md': { isFile: true },
72
- '30_advanced.md': { isFile: true },
73
- })
74
-
75
- const children = tree.children
76
- expect(children[0]!.value).toMatchObject({ name: 'getting-started', order: 10 })
77
- expect(children[1]!.value).toMatchObject({ name: 'configuration', order: 20 })
78
- expect(children[2]!.value).toMatchObject({ name: 'advanced', order: 30 })
79
- })
80
-
81
- test('handles numbered prefixes on directories', () => {
82
- const tree = mockRouteTree({
83
- '10_guide': {
84
- 'intro.md': { isFile: true },
85
- },
86
- '20_api': {
87
- 'reference.md': { isFile: true },
88
- },
89
- '05_quickstart': {
90
- 'index.md': { isFile: true },
91
- },
92
- })
93
-
94
- const children = tree.children
95
- expect(children[0]!.value).toMatchObject({ name: 'quickstart', order: 5 })
96
- expect(children[1]!.value).toMatchObject({ name: 'guide', order: 10 })
97
- expect(children[2]!.value).toMatchObject({ name: 'api', order: 20 })
98
- })
99
-
100
- test('handles mixed numbered and non-numbered items', () => {
101
- const tree = mockRouteTree({
102
- '10_guide': {
103
- 'intro.md': { isFile: true },
104
- },
105
- 'troubleshooting': {
106
- 'common.md': { isFile: true },
107
- },
108
- '05_quickstart': {
109
- 'index.md': { isFile: true },
110
- },
111
- 'api': {
112
- 'reference.md': { isFile: true },
113
- },
114
- })
115
-
116
- // After sorting: numbered items first (5, 10), then alphabetical (api, troubleshooting)
117
- const childNames = tree.children.map(c => c.value.name)
118
- expect(childNames).toEqual(['quickstart', 'guide', 'api', 'troubleshooting'])
119
- })
120
-
121
- test('handles nested numbered prefixes', () => {
122
- const tree = mockRouteTree({
123
- '10_guide': {
124
- '10_getting-started.md': { isFile: true },
125
- '20_basics.md': { isFile: true },
126
- 'troubleshooting.md': { isFile: true },
127
- '05_prerequisites.md': { isFile: true },
128
- },
129
- })
130
-
131
- const guide = tree.children[0]!
132
- expect(guide.value.name).toBe('guide')
133
-
134
- const guideChildNames = guide.children.map(c => c.value.name)
135
- expect(guideChildNames).toEqual(['prerequisites', 'getting-started', 'basics', 'troubleshooting'])
136
- })
137
-
138
- test('handles index files', () => {
139
- const tree = mockRouteTree({
140
- 'guide': {
141
- 'index.md': { isFile: true },
142
- 'intro.md': { isFile: true },
143
- },
144
- })
145
-
146
- const guide = tree.children[0]!
147
- expect(guide.children).toHaveLength(2)
148
- expect(guide.children.map(c => c.value.name)).toContain('index')
149
- expect(guide.children.map(c => c.value.name)).toContain('intro')
150
- })
151
-
152
- test('creates directory nodes with correct type', () => {
153
- const tree = mockRouteTree({
154
- '10_guide': {
155
- 'intro.md': { isFile: true },
156
- },
157
- 'api-reference.md': { isFile: true },
158
- })
159
-
160
- expect(tree.value.type).toBe('directory')
161
-
162
- const guide = tree.children.find(c => c.value.name === 'guide')
163
- expect(guide?.value.type).toBe('directory')
164
- expect(guide?.value.order).toBe(10)
165
-
166
- const apiRef = tree.children.find(c => c.value.name === 'api-reference')
167
- expect(apiRef?.value.type).toBe('file')
168
- })
169
-
170
- test('handles file collisions with same order number - last wins', () => {
171
- // This test simulates what would happen if the scanner processes files in order
172
- // The mock doesn't actually test the scanner logic but documents expected behavior
173
- const tree = mockRouteTree({
174
- '10_about.md': { isFile: true, processedFirst: true },
175
- '10-about.md': { isFile: true, processedLast: true }, // Same order, same logical name
176
- })
177
-
178
- // In the real scanner, only one 'about' node would exist
179
- // The test structure above would result in duplicate nodes in our mock
180
- // Document the expected behavior: last processed file should win
181
- const aboutNodes = tree.children.filter(c => c.value.name === 'about')
182
-
183
- // Note: This mock creates duplicates; real scanner would replace
184
- expect(aboutNodes.length).toBeGreaterThan(0)
185
-
186
- // Document that when orders are equal, last file processed wins
187
- // This aligns with the linter message about "file processed later is being kept"
188
- })
189
- })