@powerhousedao/connect 6.2.3-dev.66 → 6.2.3-dev.67

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 (248) hide show
  1. package/CUSTOMIZING.md +77 -0
  2. package/README.md +18 -91
  3. package/RUNTIME-CONFIG.md +472 -0
  4. package/dist/{AddDriveModal-D_3jDwjp.js → AddDriveModal-BjgmiHJr.js} +6 -6
  5. package/dist/AddDriveModal-BjgmiHJr.js.map +1 -0
  6. package/dist/{ClearStorageModal-zZ8XzwmR.js → ClearStorageModal-_03VgDb5.js} +6 -6
  7. package/dist/ClearStorageModal-_03VgDb5.js.map +1 -0
  8. package/dist/{ConfirmDocumentUpgradeModal-CrU2Z1CL.js → ConfirmDocumentUpgradeModal-CoixS60F.js} +5 -5
  9. package/dist/ConfirmDocumentUpgradeModal-CoixS60F.js.map +1 -0
  10. package/dist/{CookiesPolicyModal-DQwsgDI9.js → CookiesPolicyModal-BpFjYc7T.js} +4 -4
  11. package/dist/{CookiesPolicyModal-DQwsgDI9.js.map → CookiesPolicyModal-BpFjYc7T.js.map} +1 -1
  12. package/dist/{CreateDocumentModal-Cf1APibL.js → CreateDocumentModal-B-cXzeOA.js} +10 -10
  13. package/dist/CreateDocumentModal-B-cXzeOA.js.map +1 -0
  14. package/dist/{DebugSettingsModal-DIc5C2lI.js → DebugSettingsModal-CGScJ_r2.js} +8 -8
  15. package/dist/DebugSettingsModal-CGScJ_r2.js.map +1 -0
  16. package/dist/{DeleteDriveModal-lE9eCBua.js → DeleteDriveModal-1pAIayG_.js} +5 -5
  17. package/dist/DeleteDriveModal-1pAIayG_.js.map +1 -0
  18. package/dist/{DeleteItemModal-BFgcGsm3.js → DeleteItemModal-BUpqmFxS.js} +5 -5
  19. package/dist/DeleteItemModal-BUpqmFxS.js.map +1 -0
  20. package/dist/{DisclaimerModal-CF6JkIIu.js → DisclaimerModal-TIJXRYLF.js} +5 -5
  21. package/dist/DisclaimerModal-TIJXRYLF.js.map +1 -0
  22. package/dist/{DocumentVersionUnsupportedModal-Cm9Jb9W7.js → DocumentVersionUnsupportedModal-DH9Zzsyw.js} +5 -5
  23. package/dist/DocumentVersionUnsupportedModal-DH9Zzsyw.js.map +1 -0
  24. package/dist/{DownloadDocumentWithErrorsModal-CShKhfEQ.js → DownloadDocumentWithErrorsModal-Beh-xw8B.js} +5 -5
  25. package/dist/DownloadDocumentWithErrorsModal-Beh-xw8B.js.map +1 -0
  26. package/dist/{DriveAuthRequiredModal-CMwPUyZf.js → DriveAuthRequiredModal-XTcoJKvj.js} +6 -6
  27. package/dist/DriveAuthRequiredModal-XTcoJKvj.js.map +1 -0
  28. package/dist/{DriveSettingsModal-BSImj4BH.js → DriveSettingsModal-DZKawN7w.js} +5 -5
  29. package/dist/DriveSettingsModal-DZKawN7w.js.map +1 -0
  30. package/dist/{InspectorModal-Dr8-gj6u.js → InspectorModal-DA_TGmM6.js} +16 -16
  31. package/dist/InspectorModal-DA_TGmM6.js.map +1 -0
  32. package/dist/{LoginModal-DT_05uva.js → LoginModal-O06ZvWFI.js} +6 -6
  33. package/dist/LoginModal-O06ZvWFI.js.map +1 -0
  34. package/dist/{OpenFileDocumentsModal-X9GnX2Bk.js → OpenFileDocumentsModal-BNHD0vg9.js} +6 -6
  35. package/dist/OpenFileDocumentsModal-BNHD0vg9.js.map +1 -0
  36. package/dist/{UpgradeDriveModal-DvM-PNWe.js → UpgradeDriveModal-CCWKp5yn.js} +5 -5
  37. package/dist/UpgradeDriveModal-CCWKp5yn.js.map +1 -0
  38. package/dist/{app-loader-DrViXipO.js → app-loader-CEN_4I3I.js} +149 -196
  39. package/dist/app-loader-CEN_4I3I.js.map +1 -0
  40. package/dist/app-loader-Cj2p8L1I.js +4 -0
  41. package/dist/{app-skeleton-gzg8cRzm.js → app-skeleton-BFjvlTWd.js} +11 -11
  42. package/dist/app-skeleton-BFjvlTWd.js.map +1 -0
  43. package/dist/{app-skeleton-DYLZ7npI.js → app-skeleton-DFg65Rxa.js} +3 -3
  44. package/dist/{boot-CC_DgQKX.js → boot-JTGLJtmJ.js} +6 -6
  45. package/dist/boot-JTGLJtmJ.js.map +1 -0
  46. package/dist/{build-info-DMrToXJe.js → build-info-DkY9PU7c.js} +5 -5
  47. package/dist/{build-info-DMrToXJe.js.map → build-info-DkY9PU7c.js.map} +1 -1
  48. package/dist/{components-CjF9XjxP.js → components-2wvJ3_Ho.js} +11 -10
  49. package/dist/{components-CjF9XjxP.js.map → components-2wvJ3_Ho.js.map} +1 -1
  50. package/dist/{connect.config-uZF-gnvV.js → connect.config-D1pGNmaF.js} +4 -4
  51. package/dist/connect.config-D1pGNmaF.js.map +1 -0
  52. package/dist/{connection-state-C_477Kr_.js → connection-state-B6fleM37.js} +6 -6
  53. package/dist/connection-state-B6fleM37.js.map +1 -0
  54. package/dist/{cookie-banner-HPgyuHM5.js → cookie-banner-CAvd3PC3.js} +6 -6
  55. package/dist/{cookie-banner-HPgyuHM5.js.map → cookie-banner-CAvd3PC3.js.map} +1 -1
  56. package/dist/document-editor-container-BnEjlmaN.js +307 -0
  57. package/dist/document-editor-container-BnEjlmaN.js.map +1 -0
  58. package/dist/document-editor-container-kgS38mkb.js +4 -0
  59. package/dist/error-boundary-BsUBww61.js +155 -0
  60. package/dist/error-boundary-BsUBww61.js.map +1 -0
  61. package/dist/generic.d.ts +116 -0
  62. package/dist/generic.d.ts.map +1 -0
  63. package/dist/generic.js +31 -0
  64. package/dist/generic.js.map +1 -0
  65. package/dist/{i18n-CTgT1HG-.js → i18n-D9WYPgk9.js} +4 -4
  66. package/dist/{i18n-CTgT1HG-.js.map → i18n-D9WYPgk9.js.map} +1 -1
  67. package/dist/index-B4g8swZG.d.ts +4 -0
  68. package/dist/layout-BOX6fL5v.js +5 -0
  69. package/dist/layout.d.ts +2 -28
  70. package/dist/layout.js +4 -6
  71. package/dist/{load--K_UgzUy.js → load-CCCHqC0d.js} +11 -11
  72. package/dist/{load--K_UgzUy.js.map → load-CCCHqC0d.js.map} +1 -1
  73. package/dist/load-runtime-config-Dhy-b5wT.js +14 -0
  74. package/dist/load-runtime-config-Dhy-b5wT.js.map +1 -0
  75. package/dist/main.js +2 -2
  76. package/dist/{open-file-uploads-BcyWmUZn.js → open-file-uploads-B5pr1sA2.js} +4 -4
  77. package/dist/{open-file-uploads-BcyWmUZn.js.map → open-file-uploads-B5pr1sA2.js.map} +1 -1
  78. package/dist/{package-manager-BkFRzovd.js → package-manager-x_fK8Hzm.js} +92 -60
  79. package/dist/package-manager-x_fK8Hzm.js.map +1 -0
  80. package/dist/{pglite-seed-BsEPByVM.js → pglite-seed-eGzXMld2.js} +4 -4
  81. package/dist/{pglite-seed-BsEPByVM.js.map → pglite-seed-eGzXMld2.js.map} +1 -1
  82. package/dist/{plugin-host--lBWChr9.js → plugins-B9VBgzio.js} +75 -83
  83. package/dist/plugins-B9VBgzio.js.map +1 -0
  84. package/dist/{preferences-store-DANUajdg.js → preferences-store-CSqauT9V.js} +5 -5
  85. package/dist/preferences-store-CSqauT9V.js.map +1 -0
  86. package/dist/prerender.d.ts +38 -0
  87. package/dist/prerender.d.ts.map +1 -0
  88. package/dist/prerender.js +177 -0
  89. package/dist/prerender.js.map +1 -0
  90. package/dist/{prerendered-shell-DxCUDEXL.js → prerendered-shell-peKE7AqI.js} +10 -4
  91. package/dist/prerendered-shell-peKE7AqI.js.map +1 -0
  92. package/dist/{reactor-5nod7BfF.js → reactor-BmI-D8O-.js} +25 -156
  93. package/dist/reactor-BmI-D8O-.js.map +1 -0
  94. package/dist/{registerServiceWorker-CkVxA2KC.js → registerServiceWorker-APlHkrmH.js} +4 -4
  95. package/dist/{registerServiceWorker-CkVxA2KC.js.map → registerServiceWorker-APlHkrmH.js.map} +1 -1
  96. package/dist/root-B1Pq9x6S.js +24 -0
  97. package/dist/root-B1Pq9x6S.js.map +1 -0
  98. package/dist/route-tree.d.ts +147 -156
  99. package/dist/route-tree.d.ts.map +1 -1
  100. package/dist/route-tree.js +93 -169
  101. package/dist/route-tree.js.map +1 -1
  102. package/dist/route-views-BF0p-4Fi.js +60 -0
  103. package/dist/route-views-BF0p-4Fi.js.map +1 -0
  104. package/dist/route-views-CTARvT5N.js +55 -0
  105. package/dist/route-views-CTARvT5N.js.map +1 -0
  106. package/dist/route-views-D8I-1PWU.js +4 -0
  107. package/dist/route-views.d.ts +7 -0
  108. package/dist/route-views.d.ts.map +1 -0
  109. package/dist/route-views.js +4 -0
  110. package/dist/router-BguOMBUh.js +4 -0
  111. package/dist/router-L9X9U-97.js +46 -0
  112. package/dist/router-L9X9U-97.js.map +1 -0
  113. package/dist/router.d.ts +1 -3
  114. package/dist/router.js +3 -7
  115. package/dist/sentry-Cuc_Nbba.js +22 -0
  116. package/dist/sentry-Cuc_Nbba.js.map +1 -0
  117. package/dist/{settings-DkLhRfEI.js → settings-DjQfTrBe.js} +488 -22
  118. package/dist/settings-DjQfTrBe.js.map +1 -0
  119. package/dist/settings-tabs-iTlo2pYz.js +365 -0
  120. package/dist/settings-tabs-iTlo2pYz.js.map +1 -0
  121. package/dist/shell-core-head.html +2 -0
  122. package/dist/shell-core.html +1 -0
  123. package/dist/shell-head.html +2 -1
  124. package/dist/shell-plugins.json +1 -0
  125. package/dist/shell.html +1 -1
  126. package/dist/start-connect.d.ts +5 -9
  127. package/dist/start-connect.d.ts.map +1 -1
  128. package/dist/start-connect.js +5 -6
  129. package/dist/start-connect.js.map +1 -1
  130. package/dist/style.css +3127 -4014
  131. package/dist/ui-b6sMhi5V.js +66 -0
  132. package/dist/ui-b6sMhi5V.js.map +1 -0
  133. package/dist/{use-renown-login-BzOSQETV.js → use-renown-login-dPpDOYq5.js} +4 -4
  134. package/dist/use-renown-login-dPpDOYq5.js.map +1 -0
  135. package/docs/customizing/data-and-navigation.md +177 -0
  136. package/docs/customizing/hosts-and-plugins.md +65 -0
  137. package/docs/customizing/layout.md +149 -0
  138. package/docs/customizing/modals.md +78 -0
  139. package/docs/customizing/overrides.md +113 -0
  140. package/docs/customizing/packages.md +38 -0
  141. package/docs/customizing/pages.md +136 -0
  142. package/docs/customizing/styles-and-branding.md +41 -0
  143. package/docs/customizing/types-and-troubleshooting.md +44 -0
  144. package/package.json +41 -18
  145. package/scripts/prerender-shell.ts +35 -84
  146. package/skills/customize-connect/SKILL.md +74 -0
  147. package/src/route-tree.ts +3 -0
  148. package/src/routeTree.gen.ts +134 -192
  149. package/src/router/index.ts +2 -51
  150. package/src/router/register.ts +1 -1
  151. package/src/routes/__root.tsx +8 -24
  152. package/src/routes/_app/$.tsx +13 -0
  153. package/src/routes/_app/d/$driveSlug/{-$nodeSlug}.tsx +13 -0
  154. package/src/routes/_app/d/$driveSlug.tsx +13 -0
  155. package/src/routes/_app/index.tsx +13 -0
  156. package/src/routes/_app/settings/appearance.tsx +13 -0
  157. package/src/routes/_app/settings/packages.tsx +13 -0
  158. package/src/routes/_app/settings.tsx +13 -0
  159. package/src/routes/_app.tsx +13 -0
  160. package/style.css +5 -22
  161. package/tailwind.css +12 -0
  162. package/dist/AddDriveModal-D_3jDwjp.js.map +0 -1
  163. package/dist/ClearStorageModal-zZ8XzwmR.js.map +0 -1
  164. package/dist/ConfirmDocumentUpgradeModal-CrU2Z1CL.js.map +0 -1
  165. package/dist/CreateDocumentModal-Cf1APibL.js.map +0 -1
  166. package/dist/DebugSettingsModal-DIc5C2lI.js.map +0 -1
  167. package/dist/DeleteDriveModal-lE9eCBua.js.map +0 -1
  168. package/dist/DeleteItemModal-BFgcGsm3.js.map +0 -1
  169. package/dist/DisclaimerModal-CF6JkIIu.js.map +0 -1
  170. package/dist/DocumentVersionUnsupportedModal-Cm9Jb9W7.js.map +0 -1
  171. package/dist/DownloadDocumentWithErrorsModal-CShKhfEQ.js.map +0 -1
  172. package/dist/DriveAuthRequiredModal-CMwPUyZf.js.map +0 -1
  173. package/dist/DriveSettingsModal-BSImj4BH.js.map +0 -1
  174. package/dist/InspectorModal-Dr8-gj6u.js.map +0 -1
  175. package/dist/LoginModal-DT_05uva.js.map +0 -1
  176. package/dist/MissingPackageModal-DtISKgub.js +0 -49
  177. package/dist/MissingPackageModal-DtISKgub.js.map +0 -1
  178. package/dist/OpenFileDocumentsModal-X9GnX2Bk.js.map +0 -1
  179. package/dist/UpgradeDriveModal-DvM-PNWe.js.map +0 -1
  180. package/dist/app-layout-BIq-ZW-6.js +0 -394
  181. package/dist/app-layout-BIq-ZW-6.js.map +0 -1
  182. package/dist/app-loader-CWAH-WxW.js +0 -4
  183. package/dist/app-loader-DrViXipO.js.map +0 -1
  184. package/dist/app-skeleton-gzg8cRzm.js.map +0 -1
  185. package/dist/boot-CC_DgQKX.js.map +0 -1
  186. package/dist/connect-router-KmNBGS0G.js +0 -434
  187. package/dist/connect-router-KmNBGS0G.js.map +0 -1
  188. package/dist/connect.config-uZF-gnvV.js.map +0 -1
  189. package/dist/connection-state-C_477Kr_.js.map +0 -1
  190. package/dist/index-UrZFqSgm.d.ts +0 -166
  191. package/dist/index-UrZFqSgm.d.ts.map +0 -1
  192. package/dist/layout.d.ts.map +0 -1
  193. package/dist/multi-reactor-fSKpLBjT.js +0 -220
  194. package/dist/multi-reactor-fSKpLBjT.js.map +0 -1
  195. package/dist/package-manager-BkFRzovd.js.map +0 -1
  196. package/dist/plugin-host--lBWChr9.js.map +0 -1
  197. package/dist/preferences-store-DANUajdg.js.map +0 -1
  198. package/dist/prerendered-shell-DxCUDEXL.js.map +0 -1
  199. package/dist/reactor-5nod7BfF.js.map +0 -1
  200. package/dist/route-components-BkztQruF.js +0 -148
  201. package/dist/route-components-BkztQruF.js.map +0 -1
  202. package/dist/router-8RIbbf6v.js +0 -4
  203. package/dist/router-C37yATTD.js +0 -604
  204. package/dist/router-C37yATTD.js.map +0 -1
  205. package/dist/runtime-config-DdN1Frg7.js +0 -34
  206. package/dist/runtime-config-DdN1Frg7.js.map +0 -1
  207. package/dist/runtime-flag-B8IYhkz-.js +0 -4
  208. package/dist/runtime-flag-CT5OKujT.js +0 -45
  209. package/dist/runtime-flag-CT5OKujT.js.map +0 -1
  210. package/dist/sentry-CJb7--mu.js +0 -18
  211. package/dist/sentry-CJb7--mu.js.map +0 -1
  212. package/dist/settings-CjvK8OKA.js +0 -91
  213. package/dist/settings-CjvK8OKA.js.map +0 -1
  214. package/dist/settings-DkLhRfEI.js.map +0 -1
  215. package/dist/sidebar-BXf8OEwm.d.ts +0 -34
  216. package/dist/sidebar-BXf8OEwm.d.ts.map +0 -1
  217. package/dist/sidebar-lAVFRsni.js +0 -31
  218. package/dist/sidebar-lAVFRsni.js.map +0 -1
  219. package/dist/use-renown-login-BzOSQETV.js.map +0 -1
  220. package/dist/useIsEmbedded-BWJ0qb7w.js +0 -26
  221. package/dist/useIsEmbedded-BWJ0qb7w.js.map +0 -1
  222. package/dist/useRegistryPackages-BqIWwXV-.js +0 -452
  223. package/dist/useRegistryPackages-BqIWwXV-.js.map +0 -1
  224. package/scripts/critical-css.ts +0 -243
  225. package/src/router/connect-router.ts +0 -170
  226. package/src/router/drive-route-loader.ts +0 -116
  227. package/src/router/navigation.ts +0 -230
  228. package/src/router/perf-marks.test.tsx +0 -98
  229. package/src/router/perf-marks.ts +0 -97
  230. package/src/router/route-components.tsx +0 -98
  231. package/src/router/route-tree.ts +0 -88
  232. package/src/router/scroll.ts +0 -69
  233. package/src/router/search.ts +0 -66
  234. package/src/router/settings.ts +0 -120
  235. package/src/router/sidebar.ts +0 -55
  236. package/src/router/titles.test.ts +0 -24
  237. package/src/router/titles.ts +0 -33
  238. package/src/routes/core/_app/$.tsx +0 -13
  239. package/src/routes/core/_app/_content/d/$driveSlug/{-$nodeSlug}.tsx +0 -52
  240. package/src/routes/core/_app/_content/index.tsx +0 -3
  241. package/src/routes/core/_app/_content.tsx +0 -9
  242. package/src/routes/core/_app/settings/about.tsx +0 -20
  243. package/src/routes/core/_app/settings/ai-assistant.tsx +0 -20
  244. package/src/routes/core/_app/settings/danger-zone.tsx +0 -21
  245. package/src/routes/core/_app/settings/default-editors.tsx +0 -20
  246. package/src/routes/core/_app/settings/package-manager.tsx +0 -20
  247. package/src/routes/core/_app/settings.tsx +0 -35
  248. package/src/routes/core/_app.tsx +0 -10
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: customize-connect
3
+ description: Customize Powerhouse Connect from a project scaffolded by `ph init`. Covers adding pages, sidebar links and settings tabs; replacing the sidebar, the layout or Connect's own routes (home, drive view, settings, 404); restyling modals and the loading screen; theming with Tailwind; naming and branding per host; and offering routes from a package. Use when a task changes what Connect shows around documents and editors, not the document models or editors themselves.
4
+ ---
5
+
6
+ # Customize Connect
7
+
8
+ Connect is the Powerhouse web app that shows drives, documents and their editors. A project changes it through its config, route files, `style.css`, hosts and packages. Find the task's row below, then read the guide it links to before writing code.
9
+
10
+ | Change | Where | Guide |
11
+ | --- | --- | --- |
12
+ | App name, drives, Renown, registry, feature flags | `powerhouse.config.json`, `connect.*` (no code) | [RUNTIME-CONFIG.md](../../RUNTIME-CONFIG.md) |
13
+ | Pages, sidebar links, settings tabs, page titles | File routes in `hosts/connect/routes/` | [pages.md](../../docs/customizing/pages.md) |
14
+ | Sidebar, layout, loading screen | `hosts/connect/routes/_app.tsx` | [layout.md](../../docs/customizing/layout.md) |
15
+ | Home, drive view, open document, settings page, 404 | A route file at Connect's route path | [overrides.md](../../docs/customizing/overrides.md) |
16
+ | Loading data, search params, links from editors | Route `loader`, `validateSearch`; `@powerhousedao/reactor-browser` | [data-and-navigation.md](../../docs/customizing/data-and-navigation.md) |
17
+ | Modals | `staticData.modals`, `staticData.modalFrame` | [modals.md](../../docs/customizing/modals.md) |
18
+ | Colours, fonts, CSS; app name and favicon per host | `style.css`; `connect.branding` | [styles-and-branding.md](../../docs/customizing/styles-and-branding.md) |
19
+ | Several Connects with different routes, config or plugins | `hosts/<name>/host.js` | [hosts-and-plugins.md](../../docs/customizing/hosts-and-plugins.md) |
20
+ | Routes that ship with a package to other Connects | The package's `hosts/connect/routes/` | [packages.md](../../docs/customizing/packages.md) |
21
+ | Type errors, a symptom, upgrading an older project | | [types-and-troubleshooting.md](../../docs/customizing/types-and-troubleshooting.md) |
22
+
23
+ These paths are relative to this file, inside `node_modules/@powerhousedao/connect/`.
24
+
25
+ ## How it fits together
26
+
27
+ - Connect routes with [TanStack Router](https://tanstack.com/router) file routes. The project's `hosts/connect/routes/` folder joins Connect's own routes in one router. `ph vetra`, `ph connect studio`, `ph connect build` and `ph build` all mount it.
28
+ - A file in `_app/` renders inside Connect's layout, with the sidebar. Its route id starts with `/_app` but its URL does not: `_app/inventory.tsx` is `createFileRoute("/_app/inventory")` at `/inventory`. Any other file is a full page.
29
+ - A route describes itself through `staticData`: `nav` lists it in the sidebar, `settings` makes it a settings tab, `sidebar` hides or collapses the sidebar, `modals` and `modalFrame` restyle modals.
30
+ - Connect's routes come from `@powerhousedao/connect-core`. Each route file exports `options`, everything but the component. A project file at the same path spreads `options` and sets its own `component`.
31
+ - The generic plugin (`@powerhousedao/connect/plugins/generic`) draws Connect's sidebar, home, drive views and settings tabs. Without it, core's plain views show. A project's route files win over both.
32
+ - `@powerhousedao/connect/layout` exports core's layout parts. `@powerhousedao/connect/generic` adds the generic plugin's parts (`AppLayout`, `ConnectSidebar`, `OpenDocument`, `genericSettingsTabs`).
33
+
34
+ ## A first page
35
+
36
+ ```tsx
37
+ // hosts/connect/routes/_app/inventory.tsx
38
+ import { useDrives } from "@powerhousedao/reactor-browser";
39
+ import { createFileRoute } from "@tanstack/react-router";
40
+ import { Box } from "lucide-react";
41
+
42
+ export const Route = createFileRoute("/_app/inventory")({
43
+ staticData: { nav: { label: "Inventory", icon: Box, order: 10 } },
44
+ component: Inventory,
45
+ });
46
+
47
+ function Inventory() {
48
+ const drives = useDrives();
49
+ return <div className="p-6">{drives?.length ?? 0} drives</div>;
50
+ }
51
+ ```
52
+
53
+ ## Rules that break builds
54
+
55
+ - **Router version.** Add `@tanstack/react-router` to the project at exactly the version in `node_modules/@powerhousedao/connect/package.json`. The project's routes and Connect share one router.
56
+ - **Route ids match the file.** `createFileRoute("...")` takes the file's id, `/_app/...` for files in `_app/`. A route outside `_app/` at the URL of one of Connect's fails the build.
57
+ - **Spread `options` when overriding** (`import { options } from "@powerhousedao/connect/routes/_app/..."`). Without them the route loses its loader, search params and title. The generic settings tabs have no route files: spread `genericSettingsTabs["<tab>"]` from `@powerhousedao/connect/generic` instead.
58
+ - **Navigate through the router.** Use `Link`, `useNavigate` or `useLinkProps`. A plain `href` reloads the whole app, so keep it for external links.
59
+ - **One Tailwind build.** `style.css` imports `@powerhousedao/connect/tailwind.css`, never `@powerhousedao/connect/style.css` or a package's compiled CSS.
60
+ - **The loading screen renders in Node.** `ph connect build` renders the layout and `_app`'s `pendingComponent` at build time, with no drives. Code on that path must not touch `window` while rendering, and must handle `useDrives()` being `undefined`.
61
+ - **Package routes can't import `@powerhousedao/connect`.** Routes a package offers to other Connects import from `@powerhousedao/connect-core`, `@tanstack/react-router` and `@powerhousedao/reactor-browser` only.
62
+ - **Don't edit generated files.** `.ph/connect-routes.gen.ts` is regenerated from the routes folder.
63
+
64
+ ## Check your work
65
+
66
+ 1. Run Vetra (`ph vetra`) or `ph connect studio`, and open the route's URL. Restart it after creating the routes folder for the first time, because the folder is detected at startup.
67
+ 2. Run `ph build`. It generates `.ph/connect-routes.gen.ts` and type-checks the routes. Unknown route ids in `createFileRoute`, `Link` or `useNavigate` mean the tree is stale or the tsconfig lacks the `route-tree` paths; see [types-and-troubleshooting.md](../../docs/customizing/types-and-troubleshooting.md).
68
+ 3. When the layout or `_app`'s `pendingComponent` changed, run `ph connect build`. It prerenders the loading screen and fails on code that touches `window` while rendering.
69
+
70
+ ## Reading Connect's source
71
+
72
+ - `node_modules/@powerhousedao/connect/src/routes/`: Connect's route files, the paths a project overrides.
73
+ - `node_modules/@powerhousedao/connect-core/src/router/`: `staticData` types, the router context, search params and titles.
74
+ - `node_modules/@powerhousedao/connect-core/src/routes/`: each core route's `options` and core's views.
@@ -0,0 +1,3 @@
1
+ // Connect's route tree: core's routes with Connect's views. A project build with
2
+ // its own routes aliases `@powerhousedao/connect/route-tree` to its generated tree instead.
3
+ export * from "./routeTree.gen.js";
@@ -9,108 +9,84 @@
9
9
  // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10
10
 
11
11
  import { Route as rootRouteImport } from "./routes/__root.js";
12
- import { Route as coreAppRouteImport } from "./routes/core/_app.js";
13
- import { Route as SplatRouteImport } from "./routes/core/_app/$.js";
14
- import { Route as ContentRouteImport } from "./routes/core/_app/_content.js";
15
- import { Route as SettingsRouteImport } from "./routes/core/_app/settings.js";
16
- import { Route as ContentIndexRouteImport } from "./routes/core/_app/_content/index.js";
17
- import { Route as SettingsAboutRouteImport } from "./routes/core/_app/settings/about.js";
18
- import { Route as SettingsAiAssistantRouteImport } from "./routes/core/_app/settings/ai-assistant.js";
19
- import { Route as SettingsDangerZoneRouteImport } from "./routes/core/_app/settings/danger-zone.js";
20
- import { Route as SettingsDefaultEditorsRouteImport } from "./routes/core/_app/settings/default-editors.js";
21
- import { Route as SettingsPackageManagerRouteImport } from "./routes/core/_app/settings/package-manager.js";
22
- import { Route as ContentDDriveSlugChar123NodeSlugChar125RouteImport } from "./routes/core/_app/_content/d/$driveSlug/{-$nodeSlug}.js";
23
-
24
- const coreAppRoute = coreAppRouteImport.update({
12
+ import { Route as AppRouteImport } from "./routes/_app.js";
13
+ import { Route as AppIndexRouteImport } from "./routes/_app/index.js";
14
+ import { Route as AppSplatRouteImport } from "./routes/_app/$.js";
15
+ import { Route as AppSettingsRouteImport } from "./routes/_app/settings.js";
16
+ import { Route as AppDDriveSlugRouteImport } from "./routes/_app/d/$driveSlug.js";
17
+ import { Route as AppSettingsAppearanceRouteImport } from "./routes/_app/settings/appearance.js";
18
+ import { Route as AppSettingsPackagesRouteImport } from "./routes/_app/settings/packages.js";
19
+ import { Route as AppDDriveSlugChar123NodeSlugChar125RouteImport } from "./routes/_app/d/$driveSlug/{-$nodeSlug}.js";
20
+
21
+ const AppRoute = AppRouteImport.update({
25
22
  id: "/_app",
26
23
  getParentRoute: () => rootRouteImport,
27
24
  } as any);
28
- const SplatRoute = SplatRouteImport.update({
25
+ const AppIndexRoute = AppIndexRouteImport.update({
26
+ id: "/",
27
+ path: "/",
28
+ getParentRoute: () => AppRoute,
29
+ } as any);
30
+ const AppSplatRoute = AppSplatRouteImport.update({
29
31
  id: "/$",
30
32
  path: "/$",
31
- getParentRoute: () => coreAppRoute,
32
- } as any);
33
- const ContentRoute = ContentRouteImport.update({
34
- id: "/_content",
35
- getParentRoute: () => coreAppRoute,
33
+ getParentRoute: () => AppRoute,
36
34
  } as any);
37
- const SettingsRoute = SettingsRouteImport.update({
35
+ const AppSettingsRoute = AppSettingsRouteImport.update({
38
36
  id: "/settings",
39
37
  path: "/settings",
40
- getParentRoute: () => coreAppRoute,
41
- } as any);
42
- const ContentIndexRoute = ContentIndexRouteImport.update({
43
- id: "/",
44
- path: "/",
45
- getParentRoute: () => ContentRoute,
46
- } as any);
47
- const SettingsAboutRoute = SettingsAboutRouteImport.update({
48
- id: "/about",
49
- path: "/about",
50
- getParentRoute: () => SettingsRoute,
38
+ getParentRoute: () => AppRoute,
51
39
  } as any);
52
- const SettingsAiAssistantRoute = SettingsAiAssistantRouteImport.update({
53
- id: "/ai-assistant",
54
- path: "/ai-assistant",
55
- getParentRoute: () => SettingsRoute,
40
+ const AppDDriveSlugRoute = AppDDriveSlugRouteImport.update({
41
+ id: "/d/$driveSlug",
42
+ path: "/d/$driveSlug",
43
+ getParentRoute: () => AppRoute,
56
44
  } as any);
57
- const SettingsDangerZoneRoute = SettingsDangerZoneRouteImport.update({
58
- id: "/danger-zone",
59
- path: "/danger-zone",
60
- getParentRoute: () => SettingsRoute,
45
+ const AppSettingsAppearanceRoute = AppSettingsAppearanceRouteImport.update({
46
+ id: "/appearance",
47
+ path: "/appearance",
48
+ getParentRoute: () => AppSettingsRoute,
61
49
  } as any);
62
- const SettingsDefaultEditorsRoute = SettingsDefaultEditorsRouteImport.update({
63
- id: "/default-editors",
64
- path: "/default-editors",
65
- getParentRoute: () => SettingsRoute,
50
+ const AppSettingsPackagesRoute = AppSettingsPackagesRouteImport.update({
51
+ id: "/packages",
52
+ path: "/packages",
53
+ getParentRoute: () => AppSettingsRoute,
66
54
  } as any);
67
- const SettingsPackageManagerRoute = SettingsPackageManagerRouteImport.update({
68
- id: "/package-manager",
69
- path: "/package-manager",
70
- getParentRoute: () => SettingsRoute,
71
- } as any);
72
- const ContentDDriveSlugChar123NodeSlugChar125Route =
73
- ContentDDriveSlugChar123NodeSlugChar125RouteImport.update({
74
- id: "/d/$driveSlug/{-$nodeSlug}",
75
- path: "/d/$driveSlug/{-$nodeSlug}",
76
- getParentRoute: () => ContentRoute,
55
+ const AppDDriveSlugChar123NodeSlugChar125Route =
56
+ AppDDriveSlugChar123NodeSlugChar125RouteImport.update({
57
+ id: "/{-$nodeSlug}",
58
+ path: "/{-$nodeSlug}",
59
+ getParentRoute: () => AppDDriveSlugRoute,
77
60
  } as any);
78
61
 
79
62
  export interface FileRoutesByFullPath {
80
- "/": typeof ContentIndexRoute;
81
- "/$": typeof SplatRoute;
82
- "/settings": typeof SettingsRouteWithChildren;
83
- "/settings/about": typeof SettingsAboutRoute;
84
- "/settings/ai-assistant": typeof SettingsAiAssistantRoute;
85
- "/settings/danger-zone": typeof SettingsDangerZoneRoute;
86
- "/settings/default-editors": typeof SettingsDefaultEditorsRoute;
87
- "/settings/package-manager": typeof SettingsPackageManagerRoute;
88
- "/d/$driveSlug/{-$nodeSlug}": typeof ContentDDriveSlugChar123NodeSlugChar125Route;
63
+ "/": typeof AppIndexRoute;
64
+ "/$": typeof AppSplatRoute;
65
+ "/settings": typeof AppSettingsRouteWithChildren;
66
+ "/d/$driveSlug": typeof AppDDriveSlugRouteWithChildren;
67
+ "/settings/appearance": typeof AppSettingsAppearanceRoute;
68
+ "/settings/packages": typeof AppSettingsPackagesRoute;
69
+ "/d/$driveSlug/{-$nodeSlug}": typeof AppDDriveSlugChar123NodeSlugChar125Route;
89
70
  }
90
71
  export interface FileRoutesByTo {
91
- "/": typeof ContentIndexRoute;
92
- "/$": typeof SplatRoute;
93
- "/settings": typeof SettingsRouteWithChildren;
94
- "/settings/about": typeof SettingsAboutRoute;
95
- "/settings/ai-assistant": typeof SettingsAiAssistantRoute;
96
- "/settings/danger-zone": typeof SettingsDangerZoneRoute;
97
- "/settings/default-editors": typeof SettingsDefaultEditorsRoute;
98
- "/settings/package-manager": typeof SettingsPackageManagerRoute;
99
- "/d/$driveSlug/{-$nodeSlug}": typeof ContentDDriveSlugChar123NodeSlugChar125Route;
72
+ "/$": typeof AppSplatRoute;
73
+ "/settings": typeof AppSettingsRouteWithChildren;
74
+ "/": typeof AppIndexRoute;
75
+ "/d/$driveSlug": typeof AppDDriveSlugRouteWithChildren;
76
+ "/settings/appearance": typeof AppSettingsAppearanceRoute;
77
+ "/settings/packages": typeof AppSettingsPackagesRoute;
78
+ "/d/$driveSlug/{-$nodeSlug}": typeof AppDDriveSlugChar123NodeSlugChar125Route;
100
79
  }
101
80
  export interface FileRoutesById {
102
81
  __root__: typeof rootRouteImport;
103
- "/_app": typeof coreAppRouteWithChildren;
104
- "/_app/$": typeof SplatRoute;
105
- "/_app/_content": typeof ContentRouteWithChildren;
106
- "/_app/settings": typeof SettingsRouteWithChildren;
107
- "/_app/settings/about": typeof SettingsAboutRoute;
108
- "/_app/settings/ai-assistant": typeof SettingsAiAssistantRoute;
109
- "/_app/settings/danger-zone": typeof SettingsDangerZoneRoute;
110
- "/_app/settings/default-editors": typeof SettingsDefaultEditorsRoute;
111
- "/_app/settings/package-manager": typeof SettingsPackageManagerRoute;
112
- "/_app/_content/": typeof ContentIndexRoute;
113
- "/_app/_content/d/$driveSlug/{-$nodeSlug}": typeof ContentDDriveSlugChar123NodeSlugChar125Route;
82
+ "/_app": typeof AppRouteWithChildren;
83
+ "/_app/$": typeof AppSplatRoute;
84
+ "/_app/settings": typeof AppSettingsRouteWithChildren;
85
+ "/_app/": typeof AppIndexRoute;
86
+ "/_app/d/$driveSlug": typeof AppDDriveSlugRouteWithChildren;
87
+ "/_app/settings/appearance": typeof AppSettingsAppearanceRoute;
88
+ "/_app/settings/packages": typeof AppSettingsPackagesRoute;
89
+ "/_app/d/$driveSlug/{-$nodeSlug}": typeof AppDDriveSlugChar123NodeSlugChar125Route;
114
90
  }
115
91
  export interface FileRouteTypes {
116
92
  fileRoutesByFullPath: FileRoutesByFullPath;
@@ -118,40 +94,33 @@ export interface FileRouteTypes {
118
94
  | "/"
119
95
  | "/$"
120
96
  | "/settings"
121
- | "/settings/about"
122
- | "/settings/ai-assistant"
123
- | "/settings/danger-zone"
124
- | "/settings/default-editors"
125
- | "/settings/package-manager"
97
+ | "/d/$driveSlug"
98
+ | "/settings/appearance"
99
+ | "/settings/packages"
126
100
  | "/d/$driveSlug/{-$nodeSlug}";
127
101
  fileRoutesByTo: FileRoutesByTo;
128
102
  to:
129
- | "/"
130
103
  | "/$"
131
104
  | "/settings"
132
- | "/settings/about"
133
- | "/settings/ai-assistant"
134
- | "/settings/danger-zone"
135
- | "/settings/default-editors"
136
- | "/settings/package-manager"
105
+ | "/"
106
+ | "/d/$driveSlug"
107
+ | "/settings/appearance"
108
+ | "/settings/packages"
137
109
  | "/d/$driveSlug/{-$nodeSlug}";
138
110
  id:
139
111
  | "__root__"
140
112
  | "/_app"
141
113
  | "/_app/$"
142
- | "/_app/_content"
143
114
  | "/_app/settings"
144
- | "/_app/settings/about"
145
- | "/_app/settings/ai-assistant"
146
- | "/_app/settings/danger-zone"
147
- | "/_app/settings/default-editors"
148
- | "/_app/settings/package-manager"
149
- | "/_app/_content/"
150
- | "/_app/_content/d/$driveSlug/{-$nodeSlug}";
115
+ | "/_app/"
116
+ | "/_app/d/$driveSlug"
117
+ | "/_app/settings/appearance"
118
+ | "/_app/settings/packages"
119
+ | "/_app/d/$driveSlug/{-$nodeSlug}";
151
120
  fileRoutesById: FileRoutesById;
152
121
  }
153
122
  export interface RootRouteChildren {
154
- coreAppRoute: typeof coreAppRouteWithChildren;
123
+ AppRoute: typeof AppRouteWithChildren;
155
124
  }
156
125
 
157
126
  declare module "@tanstack/react-router" {
@@ -160,133 +129,106 @@ declare module "@tanstack/react-router" {
160
129
  id: "/_app";
161
130
  path: "";
162
131
  fullPath: "/";
163
- preLoaderRoute: typeof coreAppRouteImport;
132
+ preLoaderRoute: typeof AppRouteImport;
164
133
  parentRoute: typeof rootRouteImport;
165
134
  };
135
+ "/_app/": {
136
+ id: "/_app/";
137
+ path: "/";
138
+ fullPath: "/";
139
+ preLoaderRoute: typeof AppIndexRouteImport;
140
+ parentRoute: typeof AppRoute;
141
+ };
166
142
  "/_app/$": {
167
143
  id: "/_app/$";
168
144
  path: "/$";
169
145
  fullPath: "/$";
170
- preLoaderRoute: typeof SplatRouteImport;
171
- parentRoute: typeof coreAppRoute;
172
- };
173
- "/_app/_content": {
174
- id: "/_app/_content";
175
- path: "";
176
- fullPath: "/";
177
- preLoaderRoute: typeof ContentRouteImport;
178
- parentRoute: typeof coreAppRoute;
146
+ preLoaderRoute: typeof AppSplatRouteImport;
147
+ parentRoute: typeof AppRoute;
179
148
  };
180
149
  "/_app/settings": {
181
150
  id: "/_app/settings";
182
151
  path: "/settings";
183
152
  fullPath: "/settings";
184
- preLoaderRoute: typeof SettingsRouteImport;
185
- parentRoute: typeof coreAppRoute;
153
+ preLoaderRoute: typeof AppSettingsRouteImport;
154
+ parentRoute: typeof AppRoute;
186
155
  };
187
- "/_app/_content/": {
188
- id: "/_app/_content/";
189
- path: "/";
190
- fullPath: "/";
191
- preLoaderRoute: typeof ContentIndexRouteImport;
192
- parentRoute: typeof ContentRoute;
193
- };
194
- "/_app/settings/about": {
195
- id: "/_app/settings/about";
196
- path: "/about";
197
- fullPath: "/settings/about";
198
- preLoaderRoute: typeof SettingsAboutRouteImport;
199
- parentRoute: typeof SettingsRoute;
156
+ "/_app/d/$driveSlug": {
157
+ id: "/_app/d/$driveSlug";
158
+ path: "/d/$driveSlug";
159
+ fullPath: "/d/$driveSlug";
160
+ preLoaderRoute: typeof AppDDriveSlugRouteImport;
161
+ parentRoute: typeof AppRoute;
200
162
  };
201
- "/_app/settings/ai-assistant": {
202
- id: "/_app/settings/ai-assistant";
203
- path: "/ai-assistant";
204
- fullPath: "/settings/ai-assistant";
205
- preLoaderRoute: typeof SettingsAiAssistantRouteImport;
206
- parentRoute: typeof SettingsRoute;
163
+ "/_app/settings/appearance": {
164
+ id: "/_app/settings/appearance";
165
+ path: "/appearance";
166
+ fullPath: "/settings/appearance";
167
+ preLoaderRoute: typeof AppSettingsAppearanceRouteImport;
168
+ parentRoute: typeof AppSettingsRoute;
207
169
  };
208
- "/_app/settings/danger-zone": {
209
- id: "/_app/settings/danger-zone";
210
- path: "/danger-zone";
211
- fullPath: "/settings/danger-zone";
212
- preLoaderRoute: typeof SettingsDangerZoneRouteImport;
213
- parentRoute: typeof SettingsRoute;
170
+ "/_app/settings/packages": {
171
+ id: "/_app/settings/packages";
172
+ path: "/packages";
173
+ fullPath: "/settings/packages";
174
+ preLoaderRoute: typeof AppSettingsPackagesRouteImport;
175
+ parentRoute: typeof AppSettingsRoute;
214
176
  };
215
- "/_app/settings/default-editors": {
216
- id: "/_app/settings/default-editors";
217
- path: "/default-editors";
218
- fullPath: "/settings/default-editors";
219
- preLoaderRoute: typeof SettingsDefaultEditorsRouteImport;
220
- parentRoute: typeof SettingsRoute;
221
- };
222
- "/_app/settings/package-manager": {
223
- id: "/_app/settings/package-manager";
224
- path: "/package-manager";
225
- fullPath: "/settings/package-manager";
226
- preLoaderRoute: typeof SettingsPackageManagerRouteImport;
227
- parentRoute: typeof SettingsRoute;
228
- };
229
- "/_app/_content/d/$driveSlug/{-$nodeSlug}": {
230
- id: "/_app/_content/d/$driveSlug/{-$nodeSlug}";
231
- path: "/d/$driveSlug/{-$nodeSlug}";
177
+ "/_app/d/$driveSlug/{-$nodeSlug}": {
178
+ id: "/_app/d/$driveSlug/{-$nodeSlug}";
179
+ path: "/{-$nodeSlug}";
232
180
  fullPath: "/d/$driveSlug/{-$nodeSlug}";
233
- preLoaderRoute: typeof ContentDDriveSlugChar123NodeSlugChar125RouteImport;
234
- parentRoute: typeof ContentRoute;
181
+ preLoaderRoute: typeof AppDDriveSlugChar123NodeSlugChar125RouteImport;
182
+ parentRoute: typeof AppDDriveSlugRoute;
235
183
  };
236
184
  }
237
185
  }
238
186
 
239
- interface ContentRouteChildren {
240
- ContentIndexRoute: typeof ContentIndexRoute;
241
- ContentDDriveSlugChar123NodeSlugChar125Route: typeof ContentDDriveSlugChar123NodeSlugChar125Route;
187
+ interface AppSettingsRouteChildren {
188
+ AppSettingsAppearanceRoute: typeof AppSettingsAppearanceRoute;
189
+ AppSettingsPackagesRoute: typeof AppSettingsPackagesRoute;
242
190
  }
243
191
 
244
- const ContentRouteChildren: ContentRouteChildren = {
245
- ContentIndexRoute: ContentIndexRoute,
246
- ContentDDriveSlugChar123NodeSlugChar125Route:
247
- ContentDDriveSlugChar123NodeSlugChar125Route,
192
+ const AppSettingsRouteChildren: AppSettingsRouteChildren = {
193
+ AppSettingsAppearanceRoute: AppSettingsAppearanceRoute,
194
+ AppSettingsPackagesRoute: AppSettingsPackagesRoute,
248
195
  };
249
196
 
250
- const ContentRouteWithChildren =
251
- ContentRoute._addFileChildren(ContentRouteChildren);
197
+ const AppSettingsRouteWithChildren = AppSettingsRoute._addFileChildren(
198
+ AppSettingsRouteChildren,
199
+ );
252
200
 
253
- interface SettingsRouteChildren {
254
- SettingsAboutRoute: typeof SettingsAboutRoute;
255
- SettingsAiAssistantRoute: typeof SettingsAiAssistantRoute;
256
- SettingsDangerZoneRoute: typeof SettingsDangerZoneRoute;
257
- SettingsDefaultEditorsRoute: typeof SettingsDefaultEditorsRoute;
258
- SettingsPackageManagerRoute: typeof SettingsPackageManagerRoute;
201
+ interface AppDDriveSlugRouteChildren {
202
+ AppDDriveSlugChar123NodeSlugChar125Route: typeof AppDDriveSlugChar123NodeSlugChar125Route;
259
203
  }
260
204
 
261
- const SettingsRouteChildren: SettingsRouteChildren = {
262
- SettingsAboutRoute: SettingsAboutRoute,
263
- SettingsAiAssistantRoute: SettingsAiAssistantRoute,
264
- SettingsDangerZoneRoute: SettingsDangerZoneRoute,
265
- SettingsDefaultEditorsRoute: SettingsDefaultEditorsRoute,
266
- SettingsPackageManagerRoute: SettingsPackageManagerRoute,
205
+ const AppDDriveSlugRouteChildren: AppDDriveSlugRouteChildren = {
206
+ AppDDriveSlugChar123NodeSlugChar125Route:
207
+ AppDDriveSlugChar123NodeSlugChar125Route,
267
208
  };
268
209
 
269
- const SettingsRouteWithChildren = SettingsRoute._addFileChildren(
270
- SettingsRouteChildren,
210
+ const AppDDriveSlugRouteWithChildren = AppDDriveSlugRoute._addFileChildren(
211
+ AppDDriveSlugRouteChildren,
271
212
  );
272
213
 
273
- interface coreAppRouteChildren {
274
- SplatRoute: typeof SplatRoute;
275
- ContentRoute: typeof ContentRouteWithChildren;
276
- SettingsRoute: typeof SettingsRouteWithChildren;
214
+ interface AppRouteChildren {
215
+ AppSplatRoute: typeof AppSplatRoute;
216
+ AppSettingsRoute: typeof AppSettingsRouteWithChildren;
217
+ AppIndexRoute: typeof AppIndexRoute;
218
+ AppDDriveSlugRoute: typeof AppDDriveSlugRouteWithChildren;
277
219
  }
278
220
 
279
- const coreAppRouteChildren: coreAppRouteChildren = {
280
- SplatRoute: SplatRoute,
281
- ContentRoute: ContentRouteWithChildren,
282
- SettingsRoute: SettingsRouteWithChildren,
221
+ const AppRouteChildren: AppRouteChildren = {
222
+ AppSplatRoute: AppSplatRoute,
223
+ AppSettingsRoute: AppSettingsRouteWithChildren,
224
+ AppIndexRoute: AppIndexRoute,
225
+ AppDDriveSlugRoute: AppDDriveSlugRouteWithChildren,
283
226
  };
284
227
 
285
- const coreAppRouteWithChildren =
286
- coreAppRoute._addFileChildren(coreAppRouteChildren);
228
+ const AppRouteWithChildren = AppRoute._addFileChildren(AppRouteChildren);
287
229
 
288
230
  const rootRouteChildren: RootRouteChildren = {
289
- coreAppRoute: coreAppRouteWithChildren,
231
+ AppRoute: AppRouteWithChildren,
290
232
  };
291
233
  export const routeTree = rootRouteImport
292
234
  ._addFileChildren(rootRouteChildren)
@@ -1,51 +1,2 @@
1
- // Connect's router, without the app: safe to import where the app doesn't boot.
2
- export {
3
- bindConnectRouter,
4
- CONTENT_VIEW_ID,
5
- createConnectRouter,
6
- } from "./connect-router.js";
7
- export type {
8
- ConnectRouter,
9
- ConnectRouterBundle,
10
- ConnectRouterFor,
11
- ConnectRouterOptions,
12
- } from "./connect-router.js";
13
- export { loadDriveRoute } from "./drive-route-loader.js";
14
- export type {
15
- ConnectRouterContext,
16
- DriveRouteData,
17
- DriveRouteParams,
18
- } from "./drive-route-loader.js";
19
- export { createConnectNavigation } from "./navigation.js";
20
- export {
21
- addConnectRoutes,
22
- connectRoutes,
23
- createConnectRouteTree,
24
- DRIVE_PENDING_MS,
25
- APP_ROUTE_ID,
26
- HOME_ROUTE_ID,
27
- } from "./route-tree.js";
28
- export type {
29
- ConnectRootRoute,
30
- ConnectRouteComponents,
31
- ConnectRoutes,
32
- ConnectRouteTree,
33
- } from "./route-tree.js";
34
- export {
35
- connectSearchMiddlewares,
36
- FEATURE_FLAG_PARAM_PREFIX,
37
- GLOBAL_SEARCH_PARAMS,
38
- parseConnectSearch,
39
- stringifyConnectSearch,
40
- } from "./search.js";
41
- export type { ConnectSearch } from "./search.js";
42
- export type { CoreSettingsTabId } from "./route-components.js";
43
- export { navRoutes, useNavRoutes, useSidebarMode } from "./sidebar.js";
44
- export type { ConnectNavItem, NavRouteEntry, SidebarMode } from "./sidebar.js";
45
- export {
46
- SETTINGS_ROUTE_ID,
47
- settingsTabs,
48
- settingsTitle,
49
- useSettingsTabs,
50
- } from "./settings.js";
51
- export type { ConnectSettingsTab, SettingsTabEntry } from "./settings.js";
1
+ // Connect's router is core's; this path stays for projects and the generated tree.
2
+ export * from "@powerhousedao/connect-core/router";
@@ -1,6 +1,6 @@
1
1
  // Connect's own router type. Nothing imports this file, so it stays out of the
2
2
  // declarations projects see; their generated tree registers their router.
3
- import type { ConnectRouter } from "./connect-router.js";
3
+ import type { ConnectRouter } from "@powerhousedao/connect-core/router";
4
4
 
5
5
  declare module "@tanstack/react-router" {
6
6
  interface Register {
@@ -1,28 +1,12 @@
1
+ import { options } from "@powerhousedao/connect-core/routes/__root";
2
+ import type { ConnectRouterContext } from "@powerhousedao/connect-core/router";
3
+ import { ConnectRoot } from "@powerhousedao/connect/route-views";
1
4
  import { createRootRouteWithContext } from "@tanstack/react-router";
2
- // Types by package name, so a project's declarations can name them.
3
- import type { ConnectRouterContext } from "@powerhousedao/connect/router";
4
- import { RootView } from "../router/route-components.js";
5
- import {
6
- connectSearchMiddlewares,
7
- validateConnectSearch,
8
- } from "../router/search.js";
9
- import { appTitle, notFoundTitle } from "../router/titles.js";
10
5
 
6
+ export { options };
7
+
8
+ // Core's search and title; Connect's page, with or without the generic plugin.
11
9
  export const Route = createRootRouteWithContext<ConnectRouterContext>()({
12
- // Passes every param through; only the global ones outlive a navigation.
13
- // Inline type: project declaration emit can't name this module's types.
14
- validateSearch: (search: Record<string, unknown>) =>
15
- validateConnectSearch(search) as Record<string, string | undefined>,
16
- search: { middlewares: connectSearchMiddlewares },
17
- // Child routes' titles replace this one; a notFound() skips the heads below it.
18
- head: ({ match, matches }) => ({
19
- meta: [
20
- {
21
- title: matches.some((m) => m.status === "notFound")
22
- ? notFoundTitle(match.context.appName)
23
- : appTitle(match.context.appName),
24
- },
25
- ],
26
- }),
27
- component: RootView,
10
+ ...options,
11
+ component: ConnectRoot,
28
12
  });
@@ -0,0 +1,13 @@
1
+ import { options } from "@powerhousedao/connect-core/routes/_app/$";
2
+ import { coreView } from "@powerhousedao/connect-core/router";
3
+ import { createFileRoute } from "@tanstack/react-router";
4
+
5
+ export { options };
6
+
7
+ // Core's not-found page, inside the layout.
8
+ export const Route = createFileRoute("/_app/$")({
9
+ ...options,
10
+ // Connect's routes stay in the main chunk when a project build splits its routes.
11
+ codeSplitGroupings: [],
12
+ component: coreView("NotFoundPage"),
13
+ });
@@ -0,0 +1,13 @@
1
+ import { options } from "@powerhousedao/connect-core/routes/_app/d/$driveSlug/{-$nodeSlug}";
2
+ import { coreView } from "@powerhousedao/connect-core/router";
3
+ import { createFileRoute } from "@tanstack/react-router";
4
+
5
+ export { options };
6
+
7
+ // Core's document view; the generic plugin's editor replaces it.
8
+ export const Route = createFileRoute("/_app/d/$driveSlug/{-$nodeSlug}")({
9
+ ...options,
10
+ // Connect's routes stay in the main chunk when a project build splits its routes.
11
+ codeSplitGroupings: [],
12
+ component: coreView("NodeView"),
13
+ });
@@ -0,0 +1,13 @@
1
+ import { options } from "@powerhousedao/connect-core/routes/_app/d/$driveSlug";
2
+ import { coreView } from "@powerhousedao/connect-core/router";
3
+ import { createFileRoute } from "@tanstack/react-router";
4
+
5
+ export { options };
6
+
7
+ // Core's directory listing; the generic plugin's drive app replaces it.
8
+ export const Route = createFileRoute("/_app/d/$driveSlug")({
9
+ ...options,
10
+ // Connect's routes stay in the main chunk when a project build splits its routes.
11
+ codeSplitGroupings: [],
12
+ component: coreView("DriveLayout"),
13
+ });