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,36 +1,34 @@
1
1
  import type { Config } from '#api/config/index'
2
+ import { Content } from '#api/content/$'
3
+ import { createNavbar } from '#api/content/navbar'
2
4
  import type { NavbarDataRegistry } from '#api/vite/data/navbar'
3
5
  import { polenVirtual } from '#api/vite/vi'
4
6
  import type { Vite } from '#dep/vite/index'
5
7
  import { reportDiagnostics } from '#lib/file-router/diagnostic-reporter'
6
8
  import { FileRouter } from '#lib/file-router/index'
7
- import { Tree } from '#lib/tree/index'
8
- import { debug } from '#singletons/debug'
9
+ import { debugPolen } from '#singletons/debug'
9
10
  import { superjson } from '#singletons/superjson'
10
11
  import mdx from '@mdx-js/rollup'
11
12
  import rehypeShiki from '@shikijs/rehype'
12
- import { Path, Str } from '@wollybeard/kit'
13
+ import { Arr, Cache, Path, Str } from '@wollybeard/kit'
14
+ import remarkFrontmatter from 'remark-frontmatter'
13
15
  import remarkGfm from 'remark-gfm'
14
16
 
15
- const _debug = debug.sub(`vite-plugin-pages`)
17
+ const debug = debugPolen.sub(`vite-plugin-pages`)
16
18
 
17
- export const viProjectPages = polenVirtual([`project`, `pages.jsx`], { allowPluginProcessing: true })
18
- export const viProjectPagesData = polenVirtual([`project`, `data`, 'pages.jsonsuper'], { allowPluginProcessing: true })
19
+ export const viProjectRoutes = polenVirtual([`project`, `routes.jsx`], { allowPluginProcessing: true })
20
+ export const viProjectPagesCatalog = polenVirtual([`project`, `data`, 'pages-catalog.jsonsuper'], {
21
+ allowPluginProcessing: true,
22
+ })
19
23
 
20
- export interface PagesTreePluginOptions {
24
+ export interface Options {
21
25
  config: Config.Config
22
26
  navbarData?: NavbarDataRegistry
23
- onPagesChange?: (pages: FileRouter.ScanResult) => void
24
- onTreeChange?: (tree: FileRouter.RouteTreeNode) => void
25
27
  }
26
28
 
27
- export interface ProjectDataPages {
28
- sidebarIndex: SidebarIndex
29
- pagesScanResult: FileRouter.ScanResult
30
- }
31
-
32
- export interface SidebarIndex {
33
- [pathExpression: string]: FileRouter.Sidebar.Sidebar
29
+ export interface ProjectPagesCatalog {
30
+ sidebarIndex: Content.SidebarIndex
31
+ pages: Content.Page[]
34
32
  }
35
33
 
36
34
  /**
@@ -39,77 +37,53 @@ export interface SidebarIndex {
39
37
  export const Pages = ({
40
38
  config,
41
39
  navbarData,
42
- onPagesChange,
43
- onTreeChange,
44
- }: PagesTreePluginOptions): Vite.Plugin[] => {
45
- let currentPagesData: FileRouter.ScanResult | null = null
46
- let currentTreeData: FileRouter.RouteTreeNode | null = null
47
-
48
- // State management
49
- let pagesCache: FileRouter.ScanResult | null = null
50
- let treeCache: FileRouter.RouteTreeNode | null = null
51
-
52
- // Helper functions
53
- const scanPages = async () => {
54
- if (!pagesCache) {
55
- _debug(`Scanning pages - cache is null, loading fresh data`)
56
- pagesCache = await FileRouter.scan({
57
- dir: config.paths.project.absolute.pages,
58
- glob: `**/*.{md,mdx}`,
59
- })
60
- _debug(`Found ${String(pagesCache.routes.length)} pages`)
61
- } else {
62
- _debug(`Using cached pages`)
40
+ }: Options): Vite.Plugin[] => {
41
+ const scanPages = Cache.memoize(debug.trace(async function scanPages() {
42
+ const result = await Content.scan({
43
+ dir: config.paths.project.absolute.pages,
44
+ glob: `**/*.{md,mdx}`,
45
+ })
46
+ return result
47
+ }))
48
+
49
+ const invalidateVirtualModules = (server: Vite.ViteDevServer) => {
50
+ const routesModule = server.moduleGraph.getModuleById(viProjectRoutes.id)
51
+ if (routesModule) {
52
+ server.moduleGraph.invalidateModule(routesModule)
53
+ debug(`Invalidated routes virtual module`)
63
54
  }
64
- return pagesCache
65
- }
66
55
 
67
- const scanTree = async () => {
68
- if (!treeCache) {
69
- _debug(`Scanning tree - cache is null, loading fresh data`)
70
- const result = await FileRouter.scanTree({
71
- dir: config.paths.project.absolute.pages,
72
- glob: `**/*.{md,mdx}`,
73
- })
74
- treeCache = result.routeTree
75
- _debug(`Built route tree`)
76
- } else {
77
- _debug(`Using cached tree`)
56
+ const catalogModule = server.moduleGraph.getModuleById(viProjectPagesCatalog.id)
57
+ if (catalogModule) {
58
+ server.moduleGraph.invalidateModule(catalogModule)
59
+ debug(`Invalidated pages catalog virtual module`)
78
60
  }
79
- return treeCache
80
- }
81
-
82
- const clearCache = () => {
83
- _debug(`Clearing pages and tree cache`)
84
- pagesCache = null
85
- treeCache = null
86
61
  }
87
62
 
88
- const isPageFile = (file: string) => {
89
- return (file.endsWith(`.md`) || file.endsWith(`.mdx`))
90
- && file.includes(config.paths.project.absolute.pages)
91
- }
92
-
93
- const generatePagesModule = (pagesScanResult: FileRouter.ScanResult): string => {
63
+ const generateRoutesModule = (pages: Content.Page[]): string => {
94
64
  const $ = {
95
- pages: `pages`,
65
+ routes: `routes`,
96
66
  }
97
67
 
98
68
  const s = Str.Builder()
99
- s`export const ${$.pages} = []`
69
+ s`export const ${$.routes} = []`
100
70
 
101
71
  // Generate imports and route objects
102
- for (const route of pagesScanResult.routes) {
72
+ for (const { route, metadata } of pages) {
103
73
  const filePathExp = Path.format(route.file.path.absolute)
104
74
  const pathExp = FileRouter.routeToPathExpression(route)
105
- const ident = Str.Case.camel(`page ` + Str.titlizeSlug(pathExp))
75
+ const $$ = {
76
+ ...$,
77
+ Component: Str.Case.camel(`page ` + Str.titlizeSlug(pathExp)),
78
+ }
106
79
 
107
80
  s`
108
- import ${ident} from '${filePathExp}'
81
+ import ${$$.Component} from '${filePathExp}'
109
82
 
110
- ${$.pages}.push({
83
+ ${$$.routes}.push({
111
84
  path: '${pathExp}',
112
- Component: ${ident}
85
+ Component: ${$$.Component},
86
+ metadata: ${JSON.stringify(metadata)}
113
87
  })
114
88
  `
115
89
  }
@@ -123,7 +97,11 @@ export const Pages = ({
123
97
  enforce: `pre` as const,
124
98
  ...mdx({
125
99
  jsxImportSource: `polen/react`,
126
- remarkPlugins: [remarkGfm],
100
+ remarkPlugins: [
101
+ // Parse frontmatter blocks so they're removed from content
102
+ remarkFrontmatter,
103
+ remarkGfm,
104
+ ],
127
105
  rehypePlugins: [
128
106
  [
129
107
  rehypeShiki,
@@ -150,66 +128,77 @@ export const Pages = ({
150
128
  // Dev server configuration
151
129
  configureServer(server) {
152
130
  // Add pages directory to watcher
153
- _debug(`configureServer: watch pages directory`, config.paths.project.absolute.pages)
131
+ debug(`configureServer: watch pages directory`, config.paths.project.absolute.pages)
154
132
  server.watcher.add(config.paths.project.absolute.pages)
155
- },
156
133
 
157
- // Hot update handling
158
- async handleHotUpdate({ file, server, modules }) {
159
- _debug(`handleHotUpdate`, file)
160
- if (!isPageFile(file)) return
134
+ // Handle file additions and deletions
135
+ const handleFileStructureChange = async (file: string, event: 'add' | 'unlink') => {
136
+ if (!Content.isPageFile(file, config.paths.project.absolute.pages)) return
161
137
 
162
- _debug(`Page file changed:`, file)
138
+ debug(`Page file ${event === 'add' ? 'added' : 'deleted'}:`, file)
163
139
 
164
- // Check if this is a content-only change to an existing page
165
- const oldPages = pagesCache
140
+ // Clear cache and rescan
141
+ scanPages.clear()
142
+ const newScanResult = await scanPages()
166
143
 
167
- // Clear cache and rescan
168
- clearCache()
169
- const newPages = await scanPages()
170
- currentPagesData = newPages
171
-
172
- // Check if page structure changed (added/removed pages)
173
- const structureChanged = !oldPages
174
- || oldPages.routes.length !== newPages.routes.length
175
- || !oldPages.routes.every((oldRoute, i) =>
176
- oldRoute.file.path.absolute === newPages.routes[i]?.file.path.absolute
177
- )
178
-
179
- if (structureChanged) {
180
- _debug(`Page structure changed, triggering full reload`)
181
-
182
- // Invalidate virtual module
183
- const mod = server.moduleGraph.getModuleById(viProjectPages.id)
184
- if (mod) {
185
- server.moduleGraph.invalidateModule(mod)
186
- _debug(`Invalidated pages virtual module`)
187
- }
144
+ // Invalidate virtual modules
145
+ invalidateVirtualModules(server)
188
146
 
189
- // Notify about changes
190
- if (onPagesChange) {
191
- reportDiagnostics(newPages.diagnostics)
192
- onPagesChange(newPages)
193
- }
147
+ // Report any diagnostics
148
+ reportDiagnostics(newScanResult.diagnostics)
194
149
 
195
- if (onTreeChange) {
196
- const tree = await scanTree()
197
- onTreeChange(tree)
198
- currentTreeData = tree
199
- }
150
+ // Trigger full reload to ensure routes are updated
151
+ server.ws.send({ type: 'full-reload' })
152
+ }
153
+
154
+ server.watcher.on('add', (file) => handleFileStructureChange(file, 'add'))
155
+ server.watcher.on('unlink', (file) => handleFileStructureChange(file, 'unlink'))
156
+ },
200
157
 
201
- // Trigger full reload for structure changes
202
- server.ws.send({ type: `full-reload` })
203
- return []
204
- } else {
205
- _debug(`Page content changed, allowing HMR`)
158
+ // Hot update handling for existing files
159
+ async handleHotUpdate({ file, server, modules }) {
160
+ debug(`handleHotUpdate`, file)
161
+ if (!Content.isPageFile(file, config.paths.project.absolute.pages)) return
162
+
163
+ debug(`Page file changed:`, file)
164
+
165
+ // Get current pages before clearing cache
166
+ const oldPages = await scanPages()
167
+
168
+ // Clear cache and rescan
169
+ scanPages.clear()
170
+ const newScanResult = await scanPages()
171
+
172
+ // Check if the visible pages list changed. This can happen when:
173
+ // - A page's frontmatter `hidden` field changes (true <-> false)
174
+ // - A page's frontmatter affects its route (though we don't support this yet)
175
+ // If only the content changed (not frontmatter), we can use fast HMR.
176
+ const pageStructureChanged = !oldPages || !Arr.equalShallowly(
177
+ oldPages.list.map(p => Path.format(p.route.file.path.absolute)),
178
+ newScanResult.list.map(p => Path.format(p.route.file.path.absolute)),
179
+ )
180
+
181
+ if (!pageStructureChanged) {
182
+ debug(`Page content changed, allowing HMR`)
206
183
  // Let default HMR handle the MDX file change
207
184
  return modules
208
185
  }
186
+
187
+ //
188
+ // ━━ Manual Invalidation
189
+ //
190
+
191
+ debug(`Page structure changed, triggering full reload`)
192
+
193
+ // Invalidate virtual modules and trigger reload
194
+ invalidateVirtualModules(server)
195
+ reportDiagnostics(newScanResult.diagnostics)
196
+ server.ws.send({ type: `full-reload` })
197
+ return []
209
198
  },
210
199
  resolveId(id) {
211
- if (id === viProjectPagesData.id) {
212
- return viProjectPagesData.resolved
200
+ if (id === viProjectPagesCatalog.id) {
201
+ return viProjectPagesCatalog.resolved
213
202
  }
214
203
  },
215
204
  load: {
@@ -217,26 +206,14 @@ export const Pages = ({
217
206
  // id: viProjectPagesData.resolved,
218
207
  // },
219
208
  async handler(id) {
220
- if (id !== viProjectPagesData.resolved) return
221
- _debug(`viProjectDataPages`)
222
-
223
- // Get pages data from the pages plugin or load initially
224
- if (!currentPagesData) {
225
- _debug(`loadingPagesDataInitially`)
226
- currentPagesData = await FileRouter.scan({
227
- dir: config.paths.project.absolute.pages,
228
- glob: `**/*.{md,mdx}`,
229
- })
230
- // Report any diagnostics from initial scan
231
- reportDiagnostics(currentPagesData.diagnostics)
232
- }
233
- if (!currentTreeData) {
234
- _debug(`loadingTreeDataInitially`)
235
- currentTreeData = await getRouteTree(config)
236
- }
237
- const pagesScanResult = currentPagesData
238
- const routeTree = currentTreeData
239
- _debug(`usingPageRoutesFromPagesPlugin`, pagesScanResult.routes.length)
209
+ if (id !== viProjectPagesCatalog.resolved) return
210
+ debug(`viProjectPagesCatalog`)
211
+
212
+ const scanResult = await scanPages()
213
+
214
+ // Report any diagnostics
215
+ reportDiagnostics(scanResult.diagnostics)
216
+ debug(`Found ${String(scanResult.list.length)} visible pages`)
240
217
 
241
218
  //
242
219
  // ━━ Build Navbar
@@ -247,78 +224,36 @@ export const Pages = ({
247
224
  const navbarPages = navbarData.get('pages')
248
225
  navbarPages.length = 0 // Clear existing
249
226
 
250
- // Process first-level children as navigation items
251
- for (const child of routeTree.children) {
252
- if (child.value.type === 'directory') {
253
- // Check if this directory has an index file
254
- const hasIndex = child.children.some(c => c.value.type === 'file' && c.value.name === 'index')
255
-
256
- if (hasIndex) {
257
- const pathExp = FileRouter.pathToExpression([child.value.name])
258
- const title = Str.titlizeSlug(child.value.name)
259
- navbarPages.push({
260
- // IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
261
- // Without the leading slash, React Router treats paths as relative, which causes
262
- // hydration mismatches between SSR (where base path is prepended) and client
263
- // (where basename is configured). This ensures consistent behavior.
264
- pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
265
- title,
266
- })
267
- }
268
- } else if (child.value.type === 'file' && child.value.name !== 'index') {
269
- const pathExp = FileRouter.pathToExpression([child.value.name])
270
- const title = Str.titlizeSlug(child.value.name)
271
- navbarPages.push({
272
- // IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
273
- // Without the leading slash, React Router treats paths as relative, which causes
274
- // hydration mismatches between SSR (where base path is prepended) and client
275
- // (where basename is configured). This ensures consistent behavior.
276
- pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
277
- title,
278
- })
279
- }
280
- }
227
+ const navbarItems = createNavbar(scanResult.list)
228
+ navbarPages.push(...navbarItems)
281
229
  }
282
230
 
283
231
  //
284
232
  // ━━ Build Sidebar
285
233
  //
286
234
 
287
- const sidebarIndex: SidebarIndex = {}
288
-
289
- // Build sidebar for each top-level directory
290
- for (const child of routeTree.children) {
291
- if (child.value.type === 'directory') {
292
- const pathExp = `/${child.value.name}`
293
- // Create a subtree starting from this directory
294
- const subtree = Tree.node(child.value, child.children)
295
- // Pass the directory name as base path so paths are built correctly
296
- const sidebar = FileRouter.Sidebar.buildFromTree(subtree, [child.value.name])
297
- _debug(`Built sidebar for ${pathExp}:`, sidebar)
298
- sidebarIndex[pathExp] = sidebar
299
- }
300
- }
235
+ const sidebarIndex = Content.buildSidebarIndex(scanResult)
301
236
 
302
237
  //
303
238
  // ━━ Put It All together
304
239
  //
305
240
 
306
- const projectDataPages: ProjectDataPages = {
241
+ const projectPagesCatalog: ProjectPagesCatalog = {
307
242
  sidebarIndex,
308
- pagesScanResult: pagesScanResult,
243
+ pages: scanResult.list,
309
244
  }
310
245
 
311
246
  // Return just the JSON string - let the JSON plugin handle the transformation
312
- return superjson.stringify(projectDataPages)
247
+ return superjson.stringify(projectPagesCatalog)
313
248
  },
314
249
  },
315
250
  },
316
- // Plugin 4: Virtual Module for Pages Routes
251
+ // Plugin 3: Virtual Module for React Router Routes
317
252
  {
318
- name: 'polen:pages:routes',
253
+ name: 'polen:routes',
319
254
  resolveId(id) {
320
- if (id === viProjectPages.id) {
321
- return viProjectPages.resolved
255
+ if (id === viProjectRoutes.id) {
256
+ return viProjectRoutes.resolved
322
257
  }
323
258
  },
324
259
  load: {
@@ -326,19 +261,17 @@ export const Pages = ({
326
261
  // id: viProjectPages.resolved,
327
262
  // },
328
263
  handler: async (id) => {
329
- if (id !== viProjectPages.resolved) return
264
+ if (id !== viProjectRoutes.resolved) return
330
265
 
331
- _debug(`Loading viProjectPages virtual module`)
266
+ debug(`Loading viProjectRoutes virtual module`)
332
267
 
333
- // Ensure we have pages data
334
- if (!currentPagesData) {
335
- currentPagesData = await scanPages()
336
- reportDiagnostics(currentPagesData.diagnostics)
337
- }
268
+ const scanResult = await scanPages()
269
+ reportDiagnostics(scanResult.diagnostics)
270
+ const code = generateRoutesModule(scanResult.list)
338
271
 
339
272
  // Generate the module code
340
273
  return {
341
- code: generatePagesModule(currentPagesData),
274
+ code,
342
275
  moduleType: 'js',
343
276
  }
344
277
  },
@@ -346,12 +279,3 @@ export const Pages = ({
346
279
  },
347
280
  ]
348
281
  }
349
-
350
- // Helper to get tree
351
- export const getRouteTree = async (config: Config.Config): Promise<FileRouter.RouteTreeNode> => {
352
- const result = await FileRouter.scanTree({
353
- dir: config.paths.project.absolute.pages,
354
- glob: `**/*.{md,mdx}`,
355
- })
356
- return result.routeTree
357
- }
@@ -3,7 +3,7 @@ import { reportError } from '#api/server/report-error'
3
3
  import type { Hono } from '#dep/hono/index'
4
4
  import type { Vite } from '#dep/vite/index'
5
5
  import { ResponseInternalServerError } from '#lib/kit-temp'
6
- import { debug } from '#singletons/debug'
6
+ import { debugPolen } from '#singletons/debug'
7
7
  import * as HonoNodeServer from '@hono/node-server'
8
8
  import { Err } from '@wollybeard/kit'
9
9
 
@@ -16,11 +16,11 @@ interface AppServerModule {
16
16
  export const Serve = (
17
17
  config: Config.Config,
18
18
  ): Vite.PluginOption => {
19
- const _debug = debug.sub(`serve`)
19
+ const debug = debugPolen.sub(`serve`)
20
20
  let appPromise: Promise<App | Error>
21
21
 
22
22
  const reloadApp = async ({ server }: { server: Vite.ViteDevServer }): Promise<App | Error> => {
23
- _debug('reloadApp')
23
+ debug('reloadApp')
24
24
  return server.ssrLoadModule(config.paths.framework.template.server.app)
25
25
  .then(module => module as AppServerModule)
26
26
  .then(module => module.app)
@@ -55,12 +55,12 @@ export const Serve = (
55
55
  }
56
56
  },
57
57
  handleHotUpdate({ server }) {
58
- _debug('handleHotUpdate')
58
+ debug('handleHotUpdate')
59
59
  // Reload app server immediately in the background
60
60
  appPromise = reloadApp({ server })
61
61
  },
62
62
  async configureServer(server) {
63
- _debug('configureServer')
63
+ debug('configureServer')
64
64
  // Initial load
65
65
  appPromise = reloadApp({ server })
66
66
 
@@ -1,7 +1,7 @@
1
1
  import type { Vite } from '#dep/vite/index'
2
2
  import { type ImportEvent, isSpecifierFromPackage } from '#lib/kit-temp'
3
3
  import { packagePaths } from '#package-paths'
4
- import { debug } from '#singletons/debug'
4
+ import { debugPolen } from '#singletons/debug'
5
5
  import type * as Module from 'node:module'
6
6
  import { fileURLToPath } from 'node:url'
7
7
 
@@ -18,7 +18,7 @@ export function initialize(data: SelfContainedModeHooksData) {
18
18
  export const resolve: Module.ResolveHook = async (specifier, context, nextResolve) => {
19
19
  if (!data_) throw new Error(`Self-contained mode not initialized`)
20
20
 
21
- const _debug = debug.sub(`node-module-hooks`)
21
+ const debug = debugPolen.sub(`node-module-hooks`)
22
22
 
23
23
  const from: ImportEvent = {
24
24
  specifier,
@@ -32,7 +32,7 @@ export const resolve: Module.ResolveHook = async (specifier, context, nextResolv
32
32
  importerPathExpOrFileUrlExp: from.context.parentURL,
33
33
  })
34
34
  ) {
35
- _debug(`resolve check`, { specifier, context })
35
+ debug(`resolve check`, { specifier, context })
36
36
 
37
37
  const to: ImportEvent = {
38
38
  specifier: from.specifier,
@@ -43,7 +43,7 @@ export const resolve: Module.ResolveHook = async (specifier, context, nextResolv
43
43
  },
44
44
  }
45
45
 
46
- _debug(`resolve`, { from, to })
46
+ debug(`resolve`, { from, to })
47
47
 
48
48
  await nextResolve(to.specifier, to.context)
49
49
  }
@@ -66,7 +66,7 @@ export const checkIsSelfImportFromProject = (input: {
66
66
  }
67
67
 
68
68
  export const VitePluginSelfContainedMode = ({ projectDirPathExp }: { projectDirPathExp: string }): Vite.Plugin => {
69
- const d = debug.sub(`vite-plugin:self-contained-import`)
69
+ const d = debugPolen.sub(`vite-plugin:self-contained-import`)
70
70
 
71
71
  return {
72
72
  name: `polen:self-contained-import`,
@@ -0,0 +1,43 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Arr, Cli, Path, Str } from '@wollybeard/kit'
4
+ import $ from 'ansis'
5
+ import console from 'console'
6
+
7
+ const commandsDir = import.meta.dirname
8
+ const thisModuleName = Path.parse(import.meta.filename).name
9
+ const cliName = `polen static`
10
+
11
+ const h2 = (str: string) => {
12
+ return $.bold.black.bgWhiteBright(` ${str.toUpperCase()} `)
13
+ }
14
+
15
+ const code = (str: string) => {
16
+ if (!$.isSupported()) return `\`${str}\``
17
+ return $.magenta(str)
18
+ }
19
+
20
+ const s = Str.Builder()
21
+ const allCommands = await Cli.discoverCommandPointers(commandsDir)
22
+ const commands = allCommands.filter(_ => _.name !== thisModuleName)
23
+
24
+ s``
25
+ s`${$.bold.redBright`POLEN 🌺`} ${$.dim(`static commands`)}`
26
+ s`Manage static builds and deployments.`
27
+ s``
28
+ s``
29
+ s`${h2(`commands`)}`
30
+ s``
31
+
32
+ if (Arr.isEmpty(commands)) {
33
+ s`No commands available yet.`
34
+ } else {
35
+ commands.forEach(command => {
36
+ s`${$.dim`$ ${cliName}`} ${$.cyanBright(command.name)}`
37
+ })
38
+ }
39
+ s``
40
+ s`${$.dim`Get help for a command with ${code(`polen static <command> --help`)}`}`
41
+ s``
42
+
43
+ console.log(Str.indent(String(s)))
@@ -0,0 +1,37 @@
1
+ /* eslint-disable */
2
+ // @ts-nocheck
3
+ import { Api } from '#api/index'
4
+ import { Task } from '#lib/task'
5
+ import { Command } from '@molt/command'
6
+ import { Err, Path } from '@wollybeard/kit'
7
+ import { z } from 'zod'
8
+
9
+ const args = Command.create()
10
+ .parameter(
11
+ `source`,
12
+ z.string().describe('Path to the Polen build directory to rebase'),
13
+ )
14
+ .parameter(
15
+ `newBasePath`,
16
+ z.string().describe('New base path for the build (e.g., /new-path/)'),
17
+ )
18
+ .parameter(
19
+ `--target -t`,
20
+ z.string().optional().describe('Target directory for copy mode (if not provided, mutate in place)'),
21
+ )
22
+ .parse()
23
+
24
+ const plan: Api.Static.RebasePlan = args.target
25
+ ? {
26
+ changeMode: 'copy',
27
+ sourcePath: args.source,
28
+ targetPath: args.target,
29
+ newBasePath: args.newBasePath,
30
+ }
31
+ : {
32
+ changeMode: 'mutate',
33
+ sourcePath: args.source,
34
+ newBasePath: args.newBasePath,
35
+ }
36
+
37
+ await Task.runAndExit(Api.Static.rebase, plan)
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Cli, Path } from '@wollybeard/kit'
4
+
5
+ const commandsDir = Path.join(import.meta.dirname, 'static')
6
+ await Cli.dispatch(commandsDir)
@@ -0,0 +1 @@
1
+ export * from '#template/components/content/$$'