polen 0.10.0-next.14 → 0.10.0-next.4

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 (525) hide show
  1. package/README.md +1 -2
  2. package/build/api/builder/builder.js +1 -1
  3. package/build/api/builder/builder.js.map +1 -1
  4. package/build/api/config/load.js +6 -6
  5. package/build/api/config/load.js.map +1 -1
  6. package/build/api/config-resolver/resolve.js +2 -2
  7. package/build/api/config-resolver/resolve.js.map +1 -1
  8. package/build/api/schema/data-sources/schema-directory/schema-directory.js +1 -1
  9. package/build/api/schema/data-sources/schema-directory/schema-directory.js.map +1 -1
  10. package/build/api/vite/plugins/branding/index.js +4 -4
  11. package/build/api/vite/plugins/branding/index.js.map +1 -1
  12. package/build/api/vite/plugins/build.d.ts.map +1 -1
  13. package/build/api/vite/plugins/build.js +4 -12
  14. package/build/api/vite/plugins/build.js.map +1 -1
  15. package/build/api/vite/plugins/core.d.ts +2 -2
  16. package/build/api/vite/plugins/core.d.ts.map +1 -1
  17. package/build/api/vite/plugins/core.js +13 -13
  18. package/build/api/vite/plugins/core.js.map +1 -1
  19. package/build/api/vite/plugins/pages.d.ts +14 -8
  20. package/build/api/vite/plugins/pages.d.ts.map +1 -1
  21. package/build/api/vite/plugins/pages.js +185 -111
  22. package/build/api/vite/plugins/pages.js.map +1 -1
  23. package/build/api/vite/plugins/serve.d.ts.map +1 -1
  24. package/build/api/vite/plugins/serve.js +12 -52
  25. package/build/api/vite/plugins/serve.js.map +1 -1
  26. package/build/cli/_/self-contained-mode.js +5 -5
  27. package/build/cli/_/self-contained-mode.js.map +1 -1
  28. package/build/lib/demos/config-schema.d.ts +20 -20
  29. package/build/lib/file-router/diagnostic-reporter.js +2 -2
  30. package/build/lib/file-router/diagnostic-reporter.js.map +1 -1
  31. package/build/lib/file-router/file-router.d.ts +2 -0
  32. package/build/lib/file-router/file-router.d.ts.map +1 -1
  33. package/build/lib/file-router/file-router.js +2 -0
  34. package/build/lib/file-router/file-router.js.map +1 -1
  35. package/build/lib/file-router/route.d.ts +0 -2
  36. package/build/lib/file-router/route.d.ts.map +1 -1
  37. package/build/lib/file-router/route.js.map +1 -1
  38. package/build/lib/file-router/scan-tree.d.ts +20 -0
  39. package/build/lib/file-router/scan-tree.d.ts.map +1 -0
  40. package/build/lib/file-router/scan-tree.js +158 -0
  41. package/build/lib/file-router/scan-tree.js.map +1 -0
  42. package/build/lib/file-router/scan.d.ts.map +1 -1
  43. package/build/lib/file-router/scan.js +13 -22
  44. package/build/lib/file-router/scan.js.map +1 -1
  45. package/build/lib/file-router/sidebar/index.d.ts +3 -0
  46. package/build/lib/file-router/sidebar/index.d.ts.map +1 -0
  47. package/build/lib/file-router/sidebar/index.js +4 -0
  48. package/build/lib/file-router/sidebar/index.js.map +1 -0
  49. package/build/lib/file-router/sidebar/sidebar-tree.d.ts +9 -0
  50. package/build/lib/file-router/sidebar/sidebar-tree.d.ts.map +1 -0
  51. package/build/lib/file-router/sidebar/sidebar-tree.js +85 -0
  52. package/build/lib/file-router/sidebar/sidebar-tree.js.map +1 -0
  53. package/build/lib/file-router/sidebar/types.d.ts +17 -0
  54. package/build/lib/file-router/sidebar/types.d.ts.map +1 -0
  55. package/build/lib/file-router/sidebar/types.js.map +1 -0
  56. package/build/lib/github-actions/runner.js +2 -2
  57. package/build/lib/github-actions/runner.js.map +1 -1
  58. package/build/lib/github-actions/schemas/context.d.ts +2 -2
  59. package/build/lib/kit-temp.d.ts +0 -103
  60. package/build/lib/kit-temp.d.ts.map +1 -1
  61. package/build/lib/kit-temp.js +3 -239
  62. package/build/lib/kit-temp.js.map +1 -1
  63. package/build/lib/tree/index.d.ts +3 -0
  64. package/build/lib/tree/index.d.ts.map +1 -0
  65. package/build/lib/tree/index.js +2 -0
  66. package/build/lib/tree/index.js.map +1 -0
  67. package/build/lib/tree/tree.d.ts +62 -0
  68. package/build/lib/tree/tree.d.ts.map +1 -0
  69. package/build/lib/tree/tree.js +134 -0
  70. package/build/lib/tree/tree.js.map +1 -0
  71. package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.d.ts +8 -1
  72. package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.d.ts.map +1 -1
  73. package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.js +53 -48
  74. package/build/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.js.map +1 -1
  75. package/build/package-paths.js +3 -3
  76. package/build/package-paths.js.map +1 -1
  77. package/build/sandbox.js +2 -17
  78. package/build/sandbox.js.map +1 -1
  79. package/build/singletons/debug.d.ts +1 -1
  80. package/build/singletons/debug.d.ts.map +1 -1
  81. package/build/singletons/debug.js +1 -1
  82. package/build/singletons/debug.js.map +1 -1
  83. package/build/template/components/ArgumentAnnotation.jsx +16 -0
  84. package/build/template/components/ArgumentAnnotation.jsx.map +1 -0
  85. package/build/template/components/ArgumentList.jsx +16 -0
  86. package/build/template/components/ArgumentList.jsx.map +1 -0
  87. package/build/template/components/ArgumentListAnnotation.jsx +23 -0
  88. package/build/template/components/ArgumentListAnnotation.jsx.map +1 -0
  89. package/build/template/components/Changelog.jsx +68 -0
  90. package/build/template/components/Changelog.jsx.map +1 -0
  91. package/build/template/components/{CodeBlock.js → CodeBlock.jsx} +5 -4
  92. package/build/template/components/{CodeBlock.js.map → CodeBlock.jsx.map} +1 -1
  93. package/build/template/components/DeprecationReason.jsx +10 -0
  94. package/build/template/components/DeprecationReason.jsx.map +1 -0
  95. package/build/template/components/Description.jsx +10 -0
  96. package/build/template/components/Description.jsx.map +1 -0
  97. package/build/template/components/Field.jsx +22 -0
  98. package/build/template/components/Field.jsx.map +1 -0
  99. package/build/template/components/{FieldList.js → FieldList.jsx} +5 -4
  100. package/build/template/components/FieldList.jsx.map +1 -0
  101. package/build/template/components/{FieldListSection.js → FieldListSection.jsx} +6 -4
  102. package/build/template/components/FieldListSection.jsx.map +1 -0
  103. package/build/template/components/Link.d.ts +2 -2
  104. package/build/template/components/Link.d.ts.map +1 -1
  105. package/build/template/components/{Link.js → Link.jsx} +9 -17
  106. package/build/template/components/Link.jsx.map +1 -0
  107. package/build/template/components/Logo.jsx +29 -0
  108. package/build/template/components/Logo.jsx.map +1 -0
  109. package/build/template/components/{Markdown.js → Markdown.jsx} +2 -3
  110. package/build/template/components/Markdown.jsx.map +1 -0
  111. package/build/template/components/MissingSchema.d.ts +1 -1
  112. package/build/template/components/MissingSchema.d.ts.map +1 -1
  113. package/build/template/components/MissingSchema.jsx +4 -0
  114. package/build/template/components/MissingSchema.jsx.map +1 -0
  115. package/build/template/components/NamedType.jsx +17 -0
  116. package/build/template/components/NamedType.jsx.map +1 -0
  117. package/build/template/components/{RadixLink.js → RadixLink.jsx} +1 -1
  118. package/build/template/components/RadixLink.jsx.map +1 -0
  119. package/build/template/components/Texts/{MinorHeading.js → MinorHeading.jsx} +3 -4
  120. package/build/template/components/Texts/MinorHeading.jsx.map +1 -0
  121. package/build/template/components/Texts/texts.js +1 -1
  122. package/build/template/components/Texts/texts.js.map +1 -1
  123. package/build/template/components/{TypeAnnotation.js → TypeAnnotation.jsx} +18 -8
  124. package/build/template/components/TypeAnnotation.jsx.map +1 -0
  125. package/build/template/components/TypeFieldsLinkList.jsx +17 -0
  126. package/build/template/components/TypeFieldsLinkList.jsx.map +1 -0
  127. package/build/template/components/TypeIndex.jsx +27 -0
  128. package/build/template/components/TypeIndex.jsx.map +1 -0
  129. package/build/template/components/graphql/graphql.d.ts +2 -2
  130. package/build/template/components/graphql/graphql.jsx +3 -0
  131. package/build/template/components/graphql/graphql.jsx.map +1 -0
  132. package/build/template/components/graphql/index.d.ts +1 -1
  133. package/build/template/components/graphql/index.js +1 -1
  134. package/build/template/components/graphql/index.js.map +1 -1
  135. package/build/template/components/graphql/{type-kind-icon.js → type-kind-icon.jsx} +2 -3
  136. package/build/template/components/graphql/type-kind-icon.jsx.map +1 -0
  137. package/build/template/components/graphql/type-link.jsx +16 -0
  138. package/build/template/components/graphql/type-link.jsx.map +1 -0
  139. package/build/template/components/sidebar/Sidebar.d.ts +3 -3
  140. package/build/template/components/sidebar/Sidebar.d.ts.map +1 -1
  141. package/build/template/components/sidebar/Sidebar.jsx +15 -0
  142. package/build/template/components/sidebar/Sidebar.jsx.map +1 -0
  143. package/build/template/components/sidebar/SidebarItem.d.ts +3 -3
  144. package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
  145. package/build/template/components/sidebar/{SidebarItem.js → SidebarItem.jsx} +35 -18
  146. package/build/template/components/sidebar/SidebarItem.jsx.map +1 -0
  147. package/build/template/components/sidebar/ToggleButton.d.ts +1 -1
  148. package/build/template/components/sidebar/ToggleButton.d.ts.map +1 -1
  149. package/build/template/components/sidebar/ToggleButton.jsx +6 -0
  150. package/build/template/components/sidebar/ToggleButton.jsx.map +1 -0
  151. package/build/template/entry.client.d.ts +0 -1
  152. package/build/template/entry.client.d.ts.map +1 -1
  153. package/build/template/{entry.client.js → entry.client.jsx} +9 -5
  154. package/build/template/entry.client.jsx.map +1 -0
  155. package/build/template/routes/changelog.d.ts +1 -1
  156. package/build/template/routes/{changelog.js → changelog.jsx} +4 -5
  157. package/build/template/routes/changelog.jsx.map +1 -0
  158. package/build/template/routes/{index.js → index.jsx} +2 -3
  159. package/build/template/routes/index.jsx.map +1 -0
  160. package/build/template/routes/reference.$type.$field.d.ts +1 -1
  161. package/build/template/routes/{reference.$type.$field.js → reference.$type.$field.jsx} +5 -6
  162. package/build/template/routes/reference.$type.$field.jsx.map +1 -0
  163. package/build/template/routes/reference.$type.d.ts +1 -1
  164. package/build/template/routes/{reference.$type.js → reference.$type.jsx} +5 -6
  165. package/build/template/routes/reference.$type.jsx.map +1 -0
  166. package/build/template/routes/reference.d.ts +2 -2
  167. package/build/template/routes/reference.d.ts.map +1 -1
  168. package/build/template/routes/{reference.js → reference.jsx} +12 -7
  169. package/build/template/routes/reference.jsx.map +1 -0
  170. package/build/template/routes/root.d.ts +2 -2
  171. package/build/template/routes/root.d.ts.map +1 -1
  172. package/build/template/routes/root.jsx +188 -0
  173. package/build/template/routes/root.jsx.map +1 -0
  174. package/build/template/routes.jsx +5 -0
  175. package/build/template/routes.jsx.map +1 -0
  176. package/build/template/server/app.d.ts +1 -8
  177. package/build/template/server/app.d.ts.map +1 -1
  178. package/build/template/server/app.js +21 -21
  179. package/build/template/server/app.js.map +1 -1
  180. package/build/template/server/main.js +1 -2
  181. package/build/template/server/main.js.map +1 -1
  182. package/build/template/server/render-page.d.ts +3 -0
  183. package/build/template/server/render-page.d.ts.map +1 -0
  184. package/build/template/server/{create-page-html-response.js → render-page.jsx} +17 -11
  185. package/build/template/server/render-page.jsx.map +1 -0
  186. package/build/template/server/ssg/generate.d.ts.map +1 -1
  187. package/build/template/server/ssg/generate.js +34 -33
  188. package/build/template/server/ssg/generate.js.map +1 -1
  189. package/build/template/server/ssg/get-route-paths.js +1 -1
  190. package/build/template/server/ssg/get-route-paths.js.map +1 -1
  191. package/build/template/server/view.js +1 -1
  192. package/build/template/server/view.js.map +1 -1
  193. package/package.json +9 -66
  194. package/src/api/config/load.ts +5 -5
  195. package/src/api/config-resolver/resolve.ts +2 -2
  196. package/src/api/schema/data-sources/schema-directory/schema-directory.ts +1 -1
  197. package/src/api/singletons/markdown/markdown.test.ts +1 -1
  198. package/src/api/vite/plugins/branding/index.ts +4 -4
  199. package/src/api/vite/plugins/build.ts +89 -97
  200. package/src/api/vite/plugins/core.ts +16 -18
  201. package/src/api/vite/plugins/pages.ts +209 -135
  202. package/src/api/vite/plugins/serve.ts +14 -67
  203. package/src/cli/_/self-contained-mode.ts +5 -5
  204. package/src/lib/deployment/$$.ts +1 -1
  205. package/src/lib/deployment/$.test.ts +3 -3
  206. package/src/lib/deployment/$.ts +1 -1
  207. package/src/lib/file-router/diagnostic-reporter.ts +2 -2
  208. package/src/lib/file-router/file-router.ts +2 -0
  209. package/src/lib/file-router/linter.test.ts +0 -2
  210. package/src/lib/file-router/route.ts +0 -2
  211. package/src/lib/file-router/scan-tree.test.ts +189 -0
  212. package/src/lib/file-router/scan-tree.ts +205 -0
  213. package/src/lib/file-router/scan.ts +14 -26
  214. package/src/lib/file-router/sidebar/index.ts +3 -0
  215. package/src/lib/file-router/sidebar/sidebar-tree.test.ts +123 -0
  216. package/src/lib/file-router/sidebar/sidebar-tree.ts +110 -0
  217. package/src/lib/file-router/sidebar/types.ts +19 -0
  218. package/src/lib/kit-temp.test.ts +7 -19
  219. package/src/lib/kit-temp.ts +5 -307
  220. package/src/lib/task/$.test.ts +3 -3
  221. package/src/lib/tree/index.ts +2 -0
  222. package/src/lib/tree/tree.test.ts +117 -0
  223. package/src/lib/tree/tree.ts +183 -0
  224. package/src/lib/version-history/index.test.ts +4 -12
  225. package/src/lib/vite-plugin-reactive-data/vite-plugin-reactive-data.ts +58 -52
  226. package/src/package-paths.ts +3 -3
  227. package/src/sandbox.ts +1 -20
  228. package/src/singletons/debug.ts +1 -1
  229. package/src/template/components/ArgumentAnnotation.tsx +1 -1
  230. package/src/template/components/ArgumentList.tsx +1 -1
  231. package/src/template/components/ArgumentListAnnotation.tsx +2 -2
  232. package/src/template/components/DeprecationReason.tsx +1 -1
  233. package/src/template/components/Description.tsx +1 -1
  234. package/src/template/components/Field.tsx +4 -4
  235. package/src/template/components/FieldList.tsx +1 -1
  236. package/src/template/components/FieldListSection.tsx +1 -1
  237. package/src/template/components/Link.tsx +14 -22
  238. package/src/template/components/NamedType.tsx +2 -2
  239. package/src/template/components/TypeAnnotation.tsx +1 -1
  240. package/src/template/components/TypeFieldsLinkList.tsx +1 -1
  241. package/src/template/components/TypeIndex.tsx +1 -1
  242. package/src/template/components/graphql/graphql.tsx +2 -2
  243. package/src/template/components/graphql/index.ts +1 -1
  244. package/src/template/components/graphql/type-link.tsx +2 -2
  245. package/src/template/components/sidebar/Sidebar.tsx +2 -2
  246. package/src/template/components/sidebar/SidebarItem.tsx +14 -14
  247. package/src/template/entry.client.tsx +5 -2
  248. package/src/template/routes/changelog.tsx +1 -1
  249. package/src/template/routes/reference.$type.$field.tsx +3 -3
  250. package/src/template/routes/reference.$type.tsx +3 -3
  251. package/src/template/routes/reference.tsx +10 -6
  252. package/src/template/routes/root.tsx +108 -112
  253. package/src/template/routes.tsx +1 -1
  254. package/src/template/server/app.ts +23 -33
  255. package/src/template/server/main.ts +1 -2
  256. package/src/template/server/{create-page-html-response.ts → render-page.tsx} +16 -19
  257. package/src/template/server/ssg/generate.ts +72 -68
  258. package/src/template/server/ssg/get-route-paths.ts +1 -1
  259. package/src/template/server/view.ts +1 -1
  260. package/src/template/styles/code-block.css +0 -32
  261. package/build/api/content/$$.d.ts +0 -7
  262. package/build/api/content/$$.d.ts.map +0 -1
  263. package/build/api/content/$$.js +0 -7
  264. package/build/api/content/$$.js.map +0 -1
  265. package/build/api/content/$.d.ts +0 -2
  266. package/build/api/content/$.d.ts.map +0 -1
  267. package/build/api/content/$.js +0 -2
  268. package/build/api/content/$.js.map +0 -1
  269. package/build/api/content/metadata.d.ts +0 -10
  270. package/build/api/content/metadata.d.ts.map +0 -1
  271. package/build/api/content/metadata.js +0 -9
  272. package/build/api/content/metadata.js.map +0 -1
  273. package/build/api/content/navbar.d.ts +0 -10
  274. package/build/api/content/navbar.d.ts.map +0 -1
  275. package/build/api/content/navbar.js +0 -45
  276. package/build/api/content/navbar.js.map +0 -1
  277. package/build/api/content/page.d.ts +0 -11
  278. package/build/api/content/page.d.ts.map +0 -1
  279. package/build/api/content/page.js +0 -2
  280. package/build/api/content/page.js.map +0 -1
  281. package/build/api/content/scan.d.ts +0 -19
  282. package/build/api/content/scan.d.ts.map +0 -1
  283. package/build/api/content/scan.js +0 -90
  284. package/build/api/content/scan.js.map +0 -1
  285. package/build/api/content/sidebar.d.ts +0 -104
  286. package/build/api/content/sidebar.d.ts.map +0 -1
  287. package/build/api/content/sidebar.js +0 -166
  288. package/build/api/content/sidebar.js.map +0 -1
  289. package/build/api/content/utils.d.ts +0 -5
  290. package/build/api/content/utils.d.ts.map +0 -1
  291. package/build/api/content/utils.js +0 -8
  292. package/build/api/content/utils.js.map +0 -1
  293. package/build/exports/components.d.ts +0 -5
  294. package/build/exports/components.d.ts.map +0 -1
  295. package/build/exports/components.js +0 -5
  296. package/build/exports/components.js.map +0 -1
  297. package/build/lib/graphql-document/$$.d.ts +0 -5
  298. package/build/lib/graphql-document/$$.d.ts.map +0 -1
  299. package/build/lib/graphql-document/$$.js +0 -5
  300. package/build/lib/graphql-document/$$.js.map +0 -1
  301. package/build/lib/graphql-document/$.d.ts +0 -2
  302. package/build/lib/graphql-document/$.d.ts.map +0 -1
  303. package/build/lib/graphql-document/$.js +0 -2
  304. package/build/lib/graphql-document/$.js.map +0 -1
  305. package/build/lib/graphql-document/analysis.d.ts +0 -44
  306. package/build/lib/graphql-document/analysis.d.ts.map +0 -1
  307. package/build/lib/graphql-document/analysis.js +0 -361
  308. package/build/lib/graphql-document/analysis.js.map +0 -1
  309. package/build/lib/graphql-document/components/CopyButton.d.ts +0 -19
  310. package/build/lib/graphql-document/components/CopyButton.d.ts.map +0 -1
  311. package/build/lib/graphql-document/components/CopyButton.js +0 -43
  312. package/build/lib/graphql-document/components/CopyButton.js.map +0 -1
  313. package/build/lib/graphql-document/components/GraphQLDocument.d.ts +0 -38
  314. package/build/lib/graphql-document/components/GraphQLDocument.d.ts.map +0 -1
  315. package/build/lib/graphql-document/components/GraphQLDocument.js +0 -142
  316. package/build/lib/graphql-document/components/GraphQLDocument.js.map +0 -1
  317. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts +0 -7
  318. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.d.ts.map +0 -1
  319. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js +0 -45
  320. package/build/lib/graphql-document/components/GraphQLDocumentWithSchema.js.map +0 -1
  321. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts +0 -33
  322. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.d.ts.map +0 -1
  323. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js +0 -48
  324. package/build/lib/graphql-document/components/GraphQLIdentifierPopover.js.map +0 -1
  325. package/build/lib/graphql-document/components/IdentifierLink.d.ts +0 -39
  326. package/build/lib/graphql-document/components/IdentifierLink.d.ts.map +0 -1
  327. package/build/lib/graphql-document/components/IdentifierLink.js +0 -75
  328. package/build/lib/graphql-document/components/IdentifierLink.js.map +0 -1
  329. package/build/lib/graphql-document/components/graphql-document-styles.d.ts +0 -5
  330. package/build/lib/graphql-document/components/graphql-document-styles.d.ts.map +0 -1
  331. package/build/lib/graphql-document/components/graphql-document-styles.js +0 -167
  332. package/build/lib/graphql-document/components/graphql-document-styles.js.map +0 -1
  333. package/build/lib/graphql-document/components/index.d.ts +0 -6
  334. package/build/lib/graphql-document/components/index.d.ts.map +0 -1
  335. package/build/lib/graphql-document/components/index.js +0 -6
  336. package/build/lib/graphql-document/components/index.js.map +0 -1
  337. package/build/lib/graphql-document/example.d.ts +0 -25
  338. package/build/lib/graphql-document/example.d.ts.map +0 -1
  339. package/build/lib/graphql-document/example.js +0 -140
  340. package/build/lib/graphql-document/example.js.map +0 -1
  341. package/build/lib/graphql-document/graphql-document.d.ts +0 -35
  342. package/build/lib/graphql-document/graphql-document.d.ts.map +0 -1
  343. package/build/lib/graphql-document/graphql-document.js +0 -36
  344. package/build/lib/graphql-document/graphql-document.js.map +0 -1
  345. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts +0 -43
  346. package/build/lib/graphql-document/hooks/use-tooltip-state.d.ts.map +0 -1
  347. package/build/lib/graphql-document/hooks/use-tooltip-state.js +0 -132
  348. package/build/lib/graphql-document/hooks/use-tooltip-state.js.map +0 -1
  349. package/build/lib/graphql-document/positioning-simple.d.ts +0 -63
  350. package/build/lib/graphql-document/positioning-simple.d.ts.map +0 -1
  351. package/build/lib/graphql-document/positioning-simple.js +0 -185
  352. package/build/lib/graphql-document/positioning-simple.js.map +0 -1
  353. package/build/lib/graphql-document/schema-context.d.ts +0 -8
  354. package/build/lib/graphql-document/schema-context.d.ts.map +0 -1
  355. package/build/lib/graphql-document/schema-context.js +0 -11
  356. package/build/lib/graphql-document/schema-context.js.map +0 -1
  357. package/build/lib/graphql-document/schema-integration-example.d.ts +0 -27
  358. package/build/lib/graphql-document/schema-integration-example.d.ts.map +0 -1
  359. package/build/lib/graphql-document/schema-integration-example.js +0 -297
  360. package/build/lib/graphql-document/schema-integration-example.js.map +0 -1
  361. package/build/lib/graphql-document/schema-integration.d.ts +0 -135
  362. package/build/lib/graphql-document/schema-integration.d.ts.map +0 -1
  363. package/build/lib/graphql-document/schema-integration.js +0 -328
  364. package/build/lib/graphql-document/schema-integration.js.map +0 -1
  365. package/build/lib/graphql-document/types.d.ts +0 -117
  366. package/build/lib/graphql-document/types.d.ts.map +0 -1
  367. package/build/lib/graphql-document/types.js.map +0 -1
  368. package/build/template/components/ArgumentAnnotation.js +0 -10
  369. package/build/template/components/ArgumentAnnotation.js.map +0 -1
  370. package/build/template/components/ArgumentList.js +0 -9
  371. package/build/template/components/ArgumentList.js.map +0 -1
  372. package/build/template/components/ArgumentListAnnotation.js +0 -15
  373. package/build/template/components/ArgumentListAnnotation.js.map +0 -1
  374. package/build/template/components/Changelog.js +0 -44
  375. package/build/template/components/Changelog.js.map +0 -1
  376. package/build/template/components/CodeBlockEnhancer.d.ts +0 -2
  377. package/build/template/components/CodeBlockEnhancer.d.ts.map +0 -1
  378. package/build/template/components/CodeBlockEnhancer.js +0 -175
  379. package/build/template/components/CodeBlockEnhancer.js.map +0 -1
  380. package/build/template/components/DeprecationReason.js +0 -9
  381. package/build/template/components/DeprecationReason.js.map +0 -1
  382. package/build/template/components/Description.js +0 -9
  383. package/build/template/components/Description.js.map +0 -1
  384. package/build/template/components/Field.js +0 -14
  385. package/build/template/components/Field.js.map +0 -1
  386. package/build/template/components/FieldList.js.map +0 -1
  387. package/build/template/components/FieldListSection.js.map +0 -1
  388. package/build/template/components/HamburgerMenu.d.ts +0 -9
  389. package/build/template/components/HamburgerMenu.d.ts.map +0 -1
  390. package/build/template/components/HamburgerMenu.js +0 -30
  391. package/build/template/components/HamburgerMenu.js.map +0 -1
  392. package/build/template/components/Link.js.map +0 -1
  393. package/build/template/components/Logo.js +0 -20
  394. package/build/template/components/Logo.js.map +0 -1
  395. package/build/template/components/MDXComponents.d.ts +0 -11
  396. package/build/template/components/MDXComponents.d.ts.map +0 -1
  397. package/build/template/components/MDXComponents.js +0 -70
  398. package/build/template/components/MDXComponents.js.map +0 -1
  399. package/build/template/components/Markdown.js.map +0 -1
  400. package/build/template/components/MissingSchema.js +0 -5
  401. package/build/template/components/MissingSchema.js.map +0 -1
  402. package/build/template/components/NamedType.js +0 -12
  403. package/build/template/components/NamedType.js.map +0 -1
  404. package/build/template/components/NotFound.d.ts +0 -2
  405. package/build/template/components/NotFound.d.ts.map +0 -1
  406. package/build/template/components/NotFound.js +0 -7
  407. package/build/template/components/NotFound.js.map +0 -1
  408. package/build/template/components/RadixLink.js.map +0 -1
  409. package/build/template/components/TestComponent.d.ts +0 -5
  410. package/build/template/components/TestComponent.d.ts.map +0 -1
  411. package/build/template/components/TestComponent.js +0 -7
  412. package/build/template/components/TestComponent.js.map +0 -1
  413. package/build/template/components/Texts/MinorHeading.js.map +0 -1
  414. package/build/template/components/ThemeToggle.d.ts +0 -3
  415. package/build/template/components/ThemeToggle.d.ts.map +0 -1
  416. package/build/template/components/ThemeToggle.js +0 -9
  417. package/build/template/components/ThemeToggle.js.map +0 -1
  418. package/build/template/components/TypeAnnotation.js.map +0 -1
  419. package/build/template/components/TypeFieldsLinkList.js +0 -9
  420. package/build/template/components/TypeFieldsLinkList.js.map +0 -1
  421. package/build/template/components/TypeIndex.js +0 -17
  422. package/build/template/components/TypeIndex.js.map +0 -1
  423. package/build/template/components/content/$$.d.ts +0 -3
  424. package/build/template/components/content/$$.d.ts.map +0 -1
  425. package/build/template/components/content/$$.js +0 -3
  426. package/build/template/components/content/$$.js.map +0 -1
  427. package/build/template/components/content/GraphQLDocumentWithSchema.d.ts +0 -8
  428. package/build/template/components/content/GraphQLDocumentWithSchema.d.ts.map +0 -1
  429. package/build/template/components/content/GraphQLDocumentWithSchema.js +0 -13
  430. package/build/template/components/content/GraphQLDocumentWithSchema.js.map +0 -1
  431. package/build/template/components/content/GraphQLDocumentWrapper.d.ts +0 -7
  432. package/build/template/components/content/GraphQLDocumentWrapper.d.ts.map +0 -1
  433. package/build/template/components/content/GraphQLDocumentWrapper.js +0 -63
  434. package/build/template/components/content/GraphQLDocumentWrapper.js.map +0 -1
  435. package/build/template/components/graphql/graphql.js +0 -3
  436. package/build/template/components/graphql/graphql.js.map +0 -1
  437. package/build/template/components/graphql/type-kind-icon.js.map +0 -1
  438. package/build/template/components/graphql/type-link.js +0 -11
  439. package/build/template/components/graphql/type-link.js.map +0 -1
  440. package/build/template/components/sidebar/Sidebar.js +0 -11
  441. package/build/template/components/sidebar/Sidebar.js.map +0 -1
  442. package/build/template/components/sidebar/SidebarItem.js.map +0 -1
  443. package/build/template/components/sidebar/ToggleButton.js +0 -5
  444. package/build/template/components/sidebar/ToggleButton.js.map +0 -1
  445. package/build/template/contexts/ThemeContext.d.ts +0 -12
  446. package/build/template/contexts/ThemeContext.d.ts.map +0 -1
  447. package/build/template/contexts/ThemeContext.js +0 -40
  448. package/build/template/contexts/ThemeContext.js.map +0 -1
  449. package/build/template/entry.client.js.map +0 -1
  450. package/build/template/hooks/useClientOnly.d.ts +0 -9
  451. package/build/template/hooks/useClientOnly.d.ts.map +0 -1
  452. package/build/template/hooks/useClientOnly.js +0 -16
  453. package/build/template/hooks/useClientOnly.js.map +0 -1
  454. package/build/template/routes/changelog.js.map +0 -1
  455. package/build/template/routes/index.js.map +0 -1
  456. package/build/template/routes/reference.$type.$field.js.map +0 -1
  457. package/build/template/routes/reference.$type.js.map +0 -1
  458. package/build/template/routes/reference.js.map +0 -1
  459. package/build/template/routes/root.js +0 -138
  460. package/build/template/routes/root.js.map +0 -1
  461. package/build/template/routes.js +0 -5
  462. package/build/template/routes.js.map +0 -1
  463. package/build/template/server/create-page-html-response.d.ts +0 -7
  464. package/build/template/server/create-page-html-response.d.ts.map +0 -1
  465. package/build/template/server/create-page-html-response.js.map +0 -1
  466. package/build/template/server/middleware/page.d.ts +0 -4
  467. package/build/template/server/middleware/page.d.ts.map +0 -1
  468. package/build/template/server/middleware/page.js +0 -15
  469. package/build/template/server/middleware/page.js.map +0 -1
  470. package/build/template/server/middleware/unsupported-assets.d.ts +0 -10
  471. package/build/template/server/middleware/unsupported-assets.d.ts.map +0 -1
  472. package/build/template/server/middleware/unsupported-assets.js +0 -21
  473. package/build/template/server/middleware/unsupported-assets.js.map +0 -1
  474. package/build/template/styles/code-block.css +0 -218
  475. package/src/api/content/$$.ts +0 -6
  476. package/src/api/content/$.test.ts +0 -72
  477. package/src/api/content/$.ts +0 -1
  478. package/src/api/content/metadata.ts +0 -11
  479. package/src/api/content/navbar.test.ts +0 -55
  480. package/src/api/content/navbar.ts +0 -61
  481. package/src/api/content/page.ts +0 -12
  482. package/src/api/content/scan.ts +0 -117
  483. package/src/api/content/sidebar.test.ts +0 -297
  484. package/src/api/content/sidebar.ts +0 -283
  485. package/src/api/content/utils.ts +0 -7
  486. package/src/exports/components.ts +0 -4
  487. package/src/lib/graphql-document/$$.ts +0 -4
  488. package/src/lib/graphql-document/$.test.ts +0 -132
  489. package/src/lib/graphql-document/$.ts +0 -1
  490. package/src/lib/graphql-document/README.md +0 -102
  491. package/src/lib/graphql-document/analysis.ts +0 -415
  492. package/src/lib/graphql-document/components/CopyButton.tsx +0 -76
  493. package/src/lib/graphql-document/components/GraphQLDocument.tsx +0 -262
  494. package/src/lib/graphql-document/components/GraphQLDocument.unit.test.ts +0 -188
  495. package/src/lib/graphql-document/components/GraphQLDocumentWithSchema.tsx +0 -70
  496. package/src/lib/graphql-document/components/GraphQLIdentifierPopover.tsx +0 -197
  497. package/src/lib/graphql-document/components/IdentifierLink.tsx +0 -160
  498. package/src/lib/graphql-document/components/graphql-document-styles.ts +0 -167
  499. package/src/lib/graphql-document/components/index.ts +0 -5
  500. package/src/lib/graphql-document/demo.md +0 -155
  501. package/src/lib/graphql-document/example.ts +0 -163
  502. package/src/lib/graphql-document/graphql-document.ts +0 -37
  503. package/src/lib/graphql-document/hooks/use-tooltip-state.test.ts +0 -76
  504. package/src/lib/graphql-document/hooks/use-tooltip-state.ts +0 -191
  505. package/src/lib/graphql-document/positioning-simple.test.ts +0 -248
  506. package/src/lib/graphql-document/positioning-simple.ts +0 -260
  507. package/src/lib/graphql-document/schema-context.tsx +0 -20
  508. package/src/lib/graphql-document/schema-integration-example.ts +0 -341
  509. package/src/lib/graphql-document/schema-integration.test.ts +0 -365
  510. package/src/lib/graphql-document/schema-integration.ts +0 -497
  511. package/src/lib/graphql-document/types.ts +0 -129
  512. package/src/template/components/CodeBlockEnhancer.tsx +0 -192
  513. package/src/template/components/HamburgerMenu.tsx +0 -96
  514. package/src/template/components/MDXComponents.tsx +0 -101
  515. package/src/template/components/NotFound.tsx +0 -28
  516. package/src/template/components/TestComponent.tsx +0 -6
  517. package/src/template/components/ThemeToggle.tsx +0 -21
  518. package/src/template/components/content/$$.ts +0 -2
  519. package/src/template/components/content/GraphQLDocumentWithSchema.tsx +0 -13
  520. package/src/template/components/content/GraphQLDocumentWrapper.tsx +0 -89
  521. package/src/template/contexts/ThemeContext.tsx +0 -60
  522. package/src/template/hooks/useClientOnly.ts +0 -21
  523. package/src/template/server/middleware/page.ts +0 -19
  524. package/src/template/server/middleware/unsupported-assets.ts +0 -25
  525. /package/build/lib/{graphql-document → file-router/sidebar}/types.js +0 -0
@@ -1,64 +1,81 @@
1
- import { Content } from '#api/content/$';
2
- import { createNavbar } from '#api/content/navbar';
3
1
  import { polenVirtual } from '#api/vite/vi';
4
2
  import { reportDiagnostics } from '#lib/file-router/diagnostic-reporter';
5
3
  import { FileRouter } from '#lib/file-router/index';
6
- import { debugPolen } from '#singletons/debug';
4
+ import { Tree } from '#lib/tree/index';
5
+ import { debug } from '#singletons/debug';
7
6
  import { superjson } from '#singletons/superjson';
8
7
  import mdx from '@mdx-js/rollup';
9
8
  import rehypeShiki from '@shikijs/rehype';
10
- import { Arr, Cache, Path, Str } from '@wollybeard/kit';
11
- import remarkFrontmatter from 'remark-frontmatter';
9
+ import { Path, Str } from '@wollybeard/kit';
12
10
  import remarkGfm from 'remark-gfm';
13
- const debug = debugPolen.sub(`vite-pages`);
14
- export const viProjectRoutes = polenVirtual([`project`, `routes.jsx`], { allowPluginProcessing: true });
15
- export const viProjectPagesCatalog = polenVirtual([`project`, `data`, 'pages-catalog.jsonsuper'], {
16
- allowPluginProcessing: true,
17
- });
11
+ const _debug = debug.sub(`vite-plugin-pages`);
12
+ export const viProjectPages = polenVirtual([`project`, `pages.jsx`], { allowPluginProcessing: true });
13
+ export const viProjectPagesData = polenVirtual([`project`, `data`, 'pages.jsonsuper'], { allowPluginProcessing: true });
18
14
  /**
19
15
  * Pages plugin with tree support
20
16
  */
21
- export const Pages = ({ config, navbarData, }) => {
22
- const scanPages = Cache.memoize(debug.trace(async function scanPages() {
23
- const result = await Content.scan({
24
- dir: config.paths.project.absolute.pages,
25
- glob: `**/*.{md,mdx}`,
26
- });
27
- return result;
28
- }));
29
- const invalidateVirtualModules = (server) => {
30
- const routesModule = server.moduleGraph.getModuleById(viProjectRoutes.id);
31
- if (routesModule) {
32
- server.moduleGraph.invalidateModule(routesModule);
33
- debug(`Invalidated routes virtual module`);
17
+ export const Pages = ({ config, navbarData, onPagesChange, onTreeChange, }) => {
18
+ let currentPagesData = null;
19
+ let currentTreeData = null;
20
+ // State management
21
+ let pagesCache = null;
22
+ let treeCache = null;
23
+ // Helper functions
24
+ const scanPages = async () => {
25
+ if (!pagesCache) {
26
+ _debug(`Scanning pages - cache is null, loading fresh data`);
27
+ pagesCache = await FileRouter.scan({
28
+ dir: config.paths.project.absolute.pages,
29
+ glob: `**/*.{md,mdx}`,
30
+ });
31
+ _debug(`Found ${String(pagesCache.routes.length)} pages`);
34
32
  }
35
- const catalogModule = server.moduleGraph.getModuleById(viProjectPagesCatalog.id);
36
- if (catalogModule) {
37
- server.moduleGraph.invalidateModule(catalogModule);
38
- debug(`Invalidated pages catalog virtual module`);
33
+ else {
34
+ _debug(`Using cached pages`);
39
35
  }
36
+ return pagesCache;
40
37
  };
41
- const generateRoutesModule = (pages) => {
38
+ const scanTree = async () => {
39
+ if (!treeCache) {
40
+ _debug(`Scanning tree - cache is null, loading fresh data`);
41
+ const result = await FileRouter.scanTree({
42
+ dir: config.paths.project.absolute.pages,
43
+ glob: `**/*.{md,mdx}`,
44
+ });
45
+ treeCache = result.routeTree;
46
+ _debug(`Built route tree`);
47
+ }
48
+ else {
49
+ _debug(`Using cached tree`);
50
+ }
51
+ return treeCache;
52
+ };
53
+ const clearCache = () => {
54
+ _debug(`Clearing pages and tree cache`);
55
+ pagesCache = null;
56
+ treeCache = null;
57
+ };
58
+ const isPageFile = (file) => {
59
+ return (file.endsWith(`.md`) || file.endsWith(`.mdx`))
60
+ && file.includes(config.paths.project.absolute.pages);
61
+ };
62
+ const generatePagesModule = (pagesScanResult) => {
42
63
  const $ = {
43
- routes: `routes`,
64
+ pages: `pages`,
44
65
  };
45
66
  const s = Str.Builder();
46
- s `export const ${$.routes} = []`;
67
+ s `export const ${$.pages} = []`;
47
68
  // Generate imports and route objects
48
- for (const { route, metadata } of pages) {
69
+ for (const route of pagesScanResult.routes) {
49
70
  const filePathExp = Path.format(route.file.path.absolute);
50
71
  const pathExp = FileRouter.routeToPathExpression(route);
51
- const $$ = {
52
- ...$,
53
- Component: Str.Case.camel(`page ` + Str.titlizeSlug(pathExp)),
54
- };
72
+ const ident = Str.Case.camel(`page ` + Str.titlizeSlug(pathExp));
55
73
  s `
56
- import ${$$.Component} from '${filePathExp}'
74
+ import ${ident} from '${filePathExp}'
57
75
 
58
- ${$$.routes}.push({
76
+ ${$.pages}.push({
59
77
  path: '${pathExp}',
60
- Component: ${$$.Component},
61
- metadata: ${JSON.stringify(metadata)}
78
+ Component: ${ident}
62
79
  })
63
80
  `;
64
81
  }
@@ -70,11 +87,7 @@ export const Pages = ({ config, navbarData, }) => {
70
87
  enforce: `pre`,
71
88
  ...mdx({
72
89
  jsxImportSource: `polen/react`,
73
- remarkPlugins: [
74
- // Parse frontmatter blocks so they're removed from content
75
- remarkFrontmatter,
76
- remarkGfm,
77
- ],
90
+ remarkPlugins: [remarkGfm],
78
91
  rehypePlugins: [
79
92
  [
80
93
  rehypeShiki,
@@ -83,7 +96,7 @@ export const Pages = ({ config, navbarData, }) => {
83
96
  light: `github-light`,
84
97
  dark: `tokyo-night`,
85
98
  },
86
- defaultColor: 'light',
99
+ defaultColor: false,
87
100
  cssVariablePrefix: `--shiki-`,
88
101
  transformers: [
89
102
  // Line numbers will be handled via CSS
@@ -99,60 +112,56 @@ export const Pages = ({ config, navbarData, }) => {
99
112
  // Dev server configuration
100
113
  configureServer(server) {
101
114
  // Add pages directory to watcher
102
- debug(`configureServer: watch pages directory`, config.paths.project.absolute.pages);
115
+ _debug(`configureServer: watch pages directory`, config.paths.project.absolute.pages);
103
116
  server.watcher.add(config.paths.project.absolute.pages);
104
- // Handle file additions and deletions
105
- const handleFileStructureChange = async (file, event) => {
106
- if (!Content.isPageFile(file, config.paths.project.absolute.pages))
107
- return;
108
- debug(`Page file ${event === 'add' ? 'added' : 'deleted'}:`, file);
109
- // Clear cache and rescan
110
- scanPages.clear();
111
- const newScanResult = await scanPages();
112
- // Invalidate virtual modules
113
- invalidateVirtualModules(server);
114
- // Report any diagnostics
115
- reportDiagnostics(newScanResult.diagnostics);
116
- // Trigger full reload to ensure routes are updated
117
- server.ws.send({ type: 'full-reload' });
118
- };
119
- server.watcher.on('add', (file) => handleFileStructureChange(file, 'add'));
120
- server.watcher.on('unlink', (file) => handleFileStructureChange(file, 'unlink'));
121
117
  },
122
- // Hot update handling for existing files
118
+ // Hot update handling
123
119
  async handleHotUpdate({ file, server, modules }) {
124
- debug(`handleHotUpdate`, file);
125
- if (!Content.isPageFile(file, config.paths.project.absolute.pages))
120
+ _debug(`handleHotUpdate`, file);
121
+ if (!isPageFile(file))
126
122
  return;
127
- debug(`Page file changed:`, file);
128
- // Get current pages before clearing cache
129
- const oldPages = await scanPages();
123
+ _debug(`Page file changed:`, file);
124
+ // Check if this is a content-only change to an existing page
125
+ const oldPages = pagesCache;
130
126
  // Clear cache and rescan
131
- scanPages.clear();
132
- const newScanResult = await scanPages();
133
- // Check if the visible pages list changed. This can happen when:
134
- // - A page's frontmatter `hidden` field changes (true <-> false)
135
- // - A page's frontmatter affects its route (though we don't support this yet)
136
- // If only the content changed (not frontmatter), we can use fast HMR.
137
- const pageStructureChanged = !oldPages || !Arr.equalShallowly(oldPages.list.map(p => Path.format(p.route.file.path.absolute)), newScanResult.list.map(p => Path.format(p.route.file.path.absolute)));
138
- if (!pageStructureChanged) {
139
- debug(`Page content changed, allowing HMR`);
127
+ clearCache();
128
+ const newPages = await scanPages();
129
+ currentPagesData = newPages;
130
+ // Check if page structure changed (added/removed pages)
131
+ const structureChanged = !oldPages
132
+ || oldPages.routes.length !== newPages.routes.length
133
+ || !oldPages.routes.every((oldRoute, i) => oldRoute.file.path.absolute === newPages.routes[i]?.file.path.absolute);
134
+ if (structureChanged) {
135
+ _debug(`Page structure changed, triggering full reload`);
136
+ // Invalidate virtual module
137
+ const mod = server.moduleGraph.getModuleById(viProjectPages.id);
138
+ if (mod) {
139
+ server.moduleGraph.invalidateModule(mod);
140
+ _debug(`Invalidated pages virtual module`);
141
+ }
142
+ // Notify about changes
143
+ if (onPagesChange) {
144
+ reportDiagnostics(newPages.diagnostics);
145
+ onPagesChange(newPages);
146
+ }
147
+ if (onTreeChange) {
148
+ const tree = await scanTree();
149
+ onTreeChange(tree);
150
+ currentTreeData = tree;
151
+ }
152
+ // Trigger full reload for structure changes
153
+ server.ws.send({ type: `full-reload` });
154
+ return [];
155
+ }
156
+ else {
157
+ _debug(`Page content changed, allowing HMR`);
140
158
  // Let default HMR handle the MDX file change
141
159
  return modules;
142
160
  }
143
- //
144
- // ━━ Manual Invalidation
145
- //
146
- debug(`Page structure changed, triggering full reload`);
147
- // Invalidate virtual modules and trigger reload
148
- invalidateVirtualModules(server);
149
- reportDiagnostics(newScanResult.diagnostics);
150
- server.ws.send({ type: `full-reload` });
151
- return [];
152
161
  },
153
162
  resolveId(id) {
154
- if (id === viProjectPagesCatalog.id) {
155
- return viProjectPagesCatalog.resolved;
163
+ if (id === viProjectPagesData.id) {
164
+ return viProjectPagesData.resolved;
156
165
  }
157
166
  },
158
167
  load: {
@@ -160,44 +169,99 @@ export const Pages = ({ config, navbarData, }) => {
160
169
  // id: viProjectPagesData.resolved,
161
170
  // },
162
171
  async handler(id) {
163
- if (id !== viProjectPagesCatalog.resolved)
172
+ if (id !== viProjectPagesData.resolved)
164
173
  return;
165
- debug(`hook load`);
166
- const scanResult = await scanPages();
167
- reportDiagnostics(scanResult.diagnostics);
168
- debug(`found visible`, { count: scanResult.list.length });
174
+ _debug(`viProjectDataPages`);
175
+ // Get pages data from the pages plugin or load initially
176
+ if (!currentPagesData) {
177
+ _debug(`loadingPagesDataInitially`);
178
+ currentPagesData = await FileRouter.scan({
179
+ dir: config.paths.project.absolute.pages,
180
+ glob: `**/*.{md,mdx}`,
181
+ });
182
+ // Report any diagnostics from initial scan
183
+ reportDiagnostics(currentPagesData.diagnostics);
184
+ }
185
+ if (!currentTreeData) {
186
+ _debug(`loadingTreeDataInitially`);
187
+ currentTreeData = await getRouteTree(config);
188
+ }
189
+ const pagesScanResult = currentPagesData;
190
+ const routeTree = currentTreeData;
191
+ _debug(`usingPageRoutesFromPagesPlugin`, pagesScanResult.routes.length);
169
192
  //
170
193
  // ━━ Build Navbar
171
194
  //
195
+ // Update navbar if provided
172
196
  if (navbarData) {
173
197
  const navbarPages = navbarData.get('pages');
174
198
  navbarPages.length = 0; // Clear existing
175
- const data = createNavbar(scanResult.list);
176
- debug('update navbar', data);
177
- navbarPages.push(...data);
199
+ // Process first-level children as navigation items
200
+ for (const child of routeTree.children) {
201
+ if (child.value.type === 'directory') {
202
+ // Check if this directory has an index file
203
+ const hasIndex = child.children.some(c => c.value.type === 'file' && c.value.name === 'index');
204
+ if (hasIndex) {
205
+ const pathExp = FileRouter.pathToExpression([child.value.name]);
206
+ const title = Str.titlizeSlug(child.value.name);
207
+ navbarPages.push({
208
+ // IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
209
+ // Without the leading slash, React Router treats paths as relative, which causes
210
+ // hydration mismatches between SSR (where base path is prepended) and client
211
+ // (where basename is configured). This ensures consistent behavior.
212
+ pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
213
+ title,
214
+ });
215
+ }
216
+ }
217
+ else if (child.value.type === 'file' && child.value.name !== 'index') {
218
+ const pathExp = FileRouter.pathToExpression([child.value.name]);
219
+ const title = Str.titlizeSlug(child.value.name);
220
+ navbarPages.push({
221
+ // IMPORTANT: Always ensure paths start with '/' for React Router compatibility.
222
+ // Without the leading slash, React Router treats paths as relative, which causes
223
+ // hydration mismatches between SSR (where base path is prepended) and client
224
+ // (where basename is configured). This ensures consistent behavior.
225
+ pathExp: pathExp.startsWith('/') ? pathExp : '/' + pathExp,
226
+ title,
227
+ });
228
+ }
229
+ }
178
230
  }
179
231
  //
180
232
  // ━━ Build Sidebar
181
233
  //
182
- const sidebarIndex = Content.buildSidebarIndex(scanResult);
234
+ const sidebarIndex = {};
235
+ // Build sidebar for each top-level directory
236
+ for (const child of routeTree.children) {
237
+ if (child.value.type === 'directory') {
238
+ const pathExp = `/${child.value.name}`;
239
+ // Create a subtree starting from this directory
240
+ const subtree = Tree.node(child.value, child.children);
241
+ // Pass the directory name as base path so paths are built correctly
242
+ const sidebar = FileRouter.Sidebar.buildFromTree(subtree, [child.value.name]);
243
+ _debug(`Built sidebar for ${pathExp}:`, sidebar);
244
+ sidebarIndex[pathExp] = sidebar;
245
+ }
246
+ }
183
247
  //
184
248
  // ━━ Put It All together
185
249
  //
186
- const projectPagesCatalog = {
250
+ const projectDataPages = {
187
251
  sidebarIndex,
188
- pages: scanResult.list,
252
+ pagesScanResult: pagesScanResult,
189
253
  };
190
254
  // Return just the JSON string - let the JSON plugin handle the transformation
191
- return superjson.stringify(projectPagesCatalog);
255
+ return superjson.stringify(projectDataPages);
192
256
  },
193
257
  },
194
258
  },
195
- // Plugin 3: Virtual Module for React Router Routes
259
+ // Plugin 4: Virtual Module for Pages Routes
196
260
  {
197
- name: 'polen:routes',
261
+ name: 'polen:pages:routes',
198
262
  resolveId(id) {
199
- if (id === viProjectRoutes.id) {
200
- return viProjectRoutes.resolved;
263
+ if (id === viProjectPages.id) {
264
+ return viProjectPages.resolved;
201
265
  }
202
266
  },
203
267
  load: {
@@ -205,15 +269,17 @@ export const Pages = ({ config, navbarData, }) => {
205
269
  // id: viProjectPages.resolved,
206
270
  // },
207
271
  handler: async (id) => {
208
- if (id !== viProjectRoutes.resolved)
272
+ if (id !== viProjectPages.resolved)
209
273
  return;
210
- debug(`Loading viProjectRoutes virtual module`);
211
- const scanResult = await scanPages();
212
- reportDiagnostics(scanResult.diagnostics);
213
- const code = generateRoutesModule(scanResult.list);
274
+ _debug(`Loading viProjectPages virtual module`);
275
+ // Ensure we have pages data
276
+ if (!currentPagesData) {
277
+ currentPagesData = await scanPages();
278
+ reportDiagnostics(currentPagesData.diagnostics);
279
+ }
214
280
  // Generate the module code
215
281
  return {
216
- code,
282
+ code: generatePagesModule(currentPagesData),
217
283
  moduleType: 'js',
218
284
  };
219
285
  },
@@ -221,4 +287,12 @@ export const Pages = ({ config, navbarData, }) => {
221
287
  },
222
288
  ];
223
289
  };
290
+ // Helper to get tree
291
+ export const getRouteTree = async (config) => {
292
+ const result = await FileRouter.scanTree({
293
+ dir: config.paths.project.absolute.pages,
294
+ glob: `**/*.{md,mdx}`,
295
+ });
296
+ return result.routeTree;
297
+ };
224
298
  //# sourceMappingURL=pages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pages.js","sourceRoot":"","sources":["../../../../src/api/vite/plugins/pages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,E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KACpB,IAAI,CAAC,YAwHP,CAAA"}
1
+ {"version":3,"file":"serve.d.ts","sourceRoot":"","sources":["../../../../src/api/vite/plugins/serve.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAG/C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAY3C,eAAO,MAAM,KAAK,GAChB,QAAQ,MAAM,CAAC,MAAM,KACpB,IAAI,CAAC,YAyEP,CAAA"}
@@ -1,55 +1,16 @@
1
1
  import { reportError } from '#api/server/report-error';
2
- import { Hono } from '#dep/hono/index';
3
2
  import { ResponseInternalServerError } from '#lib/kit-temp';
4
- import { debugPolen } from '#singletons/debug';
3
+ import { debug } from '#singletons/debug';
5
4
  import * as HonoNodeServer from '@hono/node-server';
6
- import { Err, Obj } from '@wollybeard/kit';
5
+ import { Err } from '@wollybeard/kit';
7
6
  export const Serve = (config) => {
8
- const debug = debugPolen.sub(`serve`);
9
- debug('construct');
10
- const appModulePath = config.paths.framework.template.server.app;
7
+ const _debug = debug.sub(`serve`);
11
8
  let appPromise;
12
- const isNeedAppLoadOrReload = (server) => {
13
- const appModule = server.moduleGraph.getModuleById(appModulePath);
14
- if (!appModule)
15
- return true; // Not loaded yet
16
- // Check if the module or any of its dependencies are invalidated
17
- const checkInvalidated = (mod, visited = new Set()) => {
18
- console.log(Obj.pick(mod, ['ssrInvalidationState', 'invalidationState', 'lastInvalidationTimestamp']));
19
- // if (!mod.id || visited.has(mod.id)) return false
20
- // visited.add(mod.id)
21
- // // Check if this module is invalidated
22
- // if (mod.transformResult === null) return true
23
- // // Check all imported modules recursively
24
- // for (const imported of mod.importedModules) {
25
- // if (checkInvalidated(imported, visited)) return true
26
- // }
27
- return false;
28
- };
29
- return checkInvalidated(appModule);
30
- };
31
- const reloadApp = async (server) => {
32
- debug('reloadApp');
9
+ const reloadApp = async ({ server }) => {
10
+ _debug('reloadApp');
33
11
  return server.ssrLoadModule(config.paths.framework.template.server.app)
34
12
  .then(module => module)
35
- .then(module => {
36
- return module.createApp({
37
- hooks: {
38
- transformHtml: [
39
- // Inject entry client script for development
40
- (html, _ctx) => {
41
- const entryClientPath = config.paths.framework.template.client.entrypoint;
42
- const entryClientScript = `<script type="module" src="${entryClientPath}"></script>`;
43
- return html.replace('</body>', `${entryClientScript}</body>`);
44
- },
45
- // Apply Vite's transformations
46
- async (html, ctx) => {
47
- return await server.transformIndexHtml(ctx.req.url, html);
48
- },
49
- ],
50
- },
51
- });
52
- })
13
+ .then(module => module.app)
53
14
  .catch(async (error) => {
54
15
  if (Err.is(error)) {
55
16
  // ━ Clean Stack Trace
@@ -80,14 +41,14 @@ export const Serve = (config) => {
80
41
  };
81
42
  },
82
43
  handleHotUpdate({ server }) {
83
- debug('handleHotUpdate');
44
+ _debug('handleHotUpdate');
84
45
  // Reload app server immediately in the background
85
- appPromise = reloadApp(server);
46
+ appPromise = reloadApp({ server });
86
47
  },
87
48
  async configureServer(server) {
88
- debug('configureServer');
49
+ _debug('configureServer');
89
50
  // Initial load
90
- appPromise = reloadApp(server);
51
+ appPromise = reloadApp({ server });
91
52
  return () => {
92
53
  // Remove index.html serving middleware.
93
54
  server.middlewares.stack.splice(
@@ -95,8 +56,6 @@ export const Serve = (config) => {
95
56
  server.middlewares.stack.findIndex(m => m.handle.name === `viteHtmlFallbackMiddleware`), 1);
96
57
  // Add middleware that runs our entry server
97
58
  server.middlewares.use((req, res, ___next) => {
98
- debug('request');
99
- // isNeedAppLoadOrReload(server)
100
59
  void HonoNodeServer.getRequestListener(async (request) => {
101
60
  // Always await the current app promise
102
61
  const app = await appPromise;
@@ -104,7 +63,8 @@ export const Serve = (config) => {
104
63
  // Err.log(app)
105
64
  return ResponseInternalServerError();
106
65
  }
107
- return await app.fetch(request);
66
+ const response = await app.fetch(request, { viteDevServer: server });
67
+ return response;
108
68
  })(req, res);
109
69
  });
110
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"serve.js","sourceRo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C,kBAAkB,CAAC,KAAK,EAAC,OAAO,EAAC,EAAE;wBACrD,uCAAuC;wBACvC,MAAM,GAAG,GAAG,MAAM,UAAU,CAAA;wBAC5B,IAAI,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;4BAChB,eAAe;4BACf,OAAO,2BAA2B,EAAE,CAAA;wBACtC,CAAC;wBACD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAA;wBACpE,OAAO,QAAQ,CAAA;oBACjB,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;gBACd,CAAC,CAAC,CAAA;YACJ,CAAC,CAAA;QACH,CAAC;KACF,CAAA;AACH,CAAC,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { isSpecifierFromPackage } from '#lib/kit-temp';
2
2
  import { packagePaths } from '#package-paths';
3
- import { debugPolen } from '#singletons/debug';
3
+ import { debug } from '#singletons/debug';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  let data_ = undefined;
6
6
  export function initialize(data) {
@@ -9,7 +9,7 @@ export function initialize(data) {
9
9
  export const resolve = async (specifier, context, nextResolve) => {
10
10
  if (!data_)
11
11
  throw new Error(`Self-contained mode not initialized`);
12
- const debug = debugPolen.sub(`node-module-hooks`);
12
+ const _debug = debug.sub(`node-module-hooks`);
13
13
  const from = {
14
14
  specifier,
15
15
  context,
@@ -19,7 +19,7 @@ export const resolve = async (specifier, context, nextResolve) => {
19
19
  specifier,
20
20
  importerPathExpOrFileUrlExp: from.context.parentURL,
21
21
  })) {
22
- debug(`resolve check`, { specifier, context });
22
+ _debug(`resolve check`, { specifier, context });
23
23
  const to = {
24
24
  specifier: from.specifier,
25
25
  context: {
@@ -28,7 +28,7 @@ export const resolve = async (specifier, context, nextResolve) => {
28
28
  importAttributes: from.context.importAttributes,
29
29
  },
30
30
  };
31
- debug(`resolve`, { from, to });
31
+ _debug(`resolve`, { from, to });
32
32
  await nextResolve(to.specifier, to.context);
33
33
  }
34
34
  return nextResolve(specifier, context);
@@ -41,7 +41,7 @@ export const checkIsSelfImportFromProject = (input) => {
41
41
  return isImporterTheProject && isImportMe;
42
42
  };
43
43
  export const VitePluginSelfContainedMode = ({ projectDirPathExp }) => {
44
- const d = debugPolen.sub(`vite-plugin:self-contained-import`);
44
+ const d = debug.sub(`vite-plugin:self-contained-import`);
45
45
  return {
46
46
  name: `polen:self-contained-import`,
47
47
  resolveId(id, importer) {
@@ -1 +1 @@
1
- {"version":3,"file":"self-contained-mode.js","sourceRoot":"","sources":["../../../src/cli/_/self-contained-mode.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,sBAAsB,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAMxC,IAAI,KAAK,GAA2C,SAAS,CAAA;AAE7D,MAAM,UAAU,UAAU,CAAC,IAAgC;IACzD,KAAK,GAAG,IAAI,CAAA;AACd,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAuB,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE;IACnF,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;IAElE,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAA;IAEjD,MAAM,IAAI,GAAgB;QACxB,SAAS;QACT,OAAO;KACR,CAAA;IAED,IACE,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,4BAA4B,CAAC;QACrD,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;QAC1C,SAAS;QACT,2BAA2B,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS;KACpD,CAAC,EACF,CAAC;QACD,KA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