@powerhousedao/connect 6.2.3-dev.66 → 6.2.3-dev.68
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.
- package/CUSTOMIZING.md +77 -0
- package/README.md +18 -91
- package/RUNTIME-CONFIG.md +472 -0
- package/dist/{AddDriveModal-D_3jDwjp.js → AddDriveModal-BjgmiHJr.js} +6 -6
- package/dist/AddDriveModal-BjgmiHJr.js.map +1 -0
- package/dist/{ClearStorageModal-zZ8XzwmR.js → ClearStorageModal-Dm8fXUtB.js} +6 -6
- package/dist/ClearStorageModal-Dm8fXUtB.js.map +1 -0
- package/dist/{ConfirmDocumentUpgradeModal-CrU2Z1CL.js → ConfirmDocumentUpgradeModal-CoixS60F.js} +5 -5
- package/dist/ConfirmDocumentUpgradeModal-CoixS60F.js.map +1 -0
- package/dist/{CookiesPolicyModal-DQwsgDI9.js → CookiesPolicyModal-BpFjYc7T.js} +4 -4
- package/dist/{CookiesPolicyModal-DQwsgDI9.js.map → CookiesPolicyModal-BpFjYc7T.js.map} +1 -1
- package/dist/{CreateDocumentModal-Cf1APibL.js → CreateDocumentModal-B-cXzeOA.js} +10 -10
- package/dist/CreateDocumentModal-B-cXzeOA.js.map +1 -0
- package/dist/{DebugSettingsModal-DIc5C2lI.js → DebugSettingsModal-D2n1zf1j.js} +8 -8
- package/dist/DebugSettingsModal-D2n1zf1j.js.map +1 -0
- package/dist/{DeleteDriveModal-lE9eCBua.js → DeleteDriveModal-1pAIayG_.js} +5 -5
- package/dist/DeleteDriveModal-1pAIayG_.js.map +1 -0
- package/dist/{DeleteItemModal-BFgcGsm3.js → DeleteItemModal-BUpqmFxS.js} +5 -5
- package/dist/DeleteItemModal-BUpqmFxS.js.map +1 -0
- package/dist/{DisclaimerModal-CF6JkIIu.js → DisclaimerModal-TIJXRYLF.js} +5 -5
- package/dist/DisclaimerModal-TIJXRYLF.js.map +1 -0
- package/dist/{DocumentVersionUnsupportedModal-Cm9Jb9W7.js → DocumentVersionUnsupportedModal-DH9Zzsyw.js} +5 -5
- package/dist/DocumentVersionUnsupportedModal-DH9Zzsyw.js.map +1 -0
- package/dist/{DownloadDocumentWithErrorsModal-CShKhfEQ.js → DownloadDocumentWithErrorsModal-Beh-xw8B.js} +5 -5
- package/dist/DownloadDocumentWithErrorsModal-Beh-xw8B.js.map +1 -0
- package/dist/{DriveAuthRequiredModal-CMwPUyZf.js → DriveAuthRequiredModal-XTcoJKvj.js} +6 -6
- package/dist/DriveAuthRequiredModal-XTcoJKvj.js.map +1 -0
- package/dist/{DriveSettingsModal-BSImj4BH.js → DriveSettingsModal-DZKawN7w.js} +5 -5
- package/dist/DriveSettingsModal-DZKawN7w.js.map +1 -0
- package/dist/{InspectorModal-Dr8-gj6u.js → InspectorModal-Zuv-MhXn.js} +16 -16
- package/dist/InspectorModal-Zuv-MhXn.js.map +1 -0
- package/dist/{LoginModal-DT_05uva.js → LoginModal-O06ZvWFI.js} +6 -6
- package/dist/LoginModal-O06ZvWFI.js.map +1 -0
- package/dist/{OpenFileDocumentsModal-X9GnX2Bk.js → OpenFileDocumentsModal-BNHD0vg9.js} +6 -6
- package/dist/OpenFileDocumentsModal-BNHD0vg9.js.map +1 -0
- package/dist/{UpgradeDriveModal-DvM-PNWe.js → UpgradeDriveModal-CCWKp5yn.js} +5 -5
- package/dist/UpgradeDriveModal-CCWKp5yn.js.map +1 -0
- package/dist/app-loader-DDh_8DF4.js +4 -0
- package/dist/{app-loader-DrViXipO.js → app-loader-Jc7RPPdf.js} +149 -196
- package/dist/app-loader-Jc7RPPdf.js.map +1 -0
- package/dist/{app-skeleton-gzg8cRzm.js → app-skeleton-BFjvlTWd.js} +11 -11
- package/dist/app-skeleton-BFjvlTWd.js.map +1 -0
- package/dist/{app-skeleton-DYLZ7npI.js → app-skeleton-DFg65Rxa.js} +3 -3
- package/dist/{boot-CC_DgQKX.js → boot-CvNYaPVX.js} +6 -6
- package/dist/boot-CvNYaPVX.js.map +1 -0
- package/dist/{build-info-DMrToXJe.js → build-info-D1EoCSh4.js} +5 -5
- package/dist/{build-info-DMrToXJe.js.map → build-info-D1EoCSh4.js.map} +1 -1
- package/dist/{components-CjF9XjxP.js → components-B1iKyGVL.js} +11 -10
- package/dist/{components-CjF9XjxP.js.map → components-B1iKyGVL.js.map} +1 -1
- package/dist/{connect.config-uZF-gnvV.js → connect.config-D1pGNmaF.js} +4 -4
- package/dist/connect.config-D1pGNmaF.js.map +1 -0
- package/dist/{connection-state-C_477Kr_.js → connection-state-B6fleM37.js} +6 -6
- package/dist/connection-state-B6fleM37.js.map +1 -0
- package/dist/{cookie-banner-HPgyuHM5.js → cookie-banner-CAvd3PC3.js} +6 -6
- package/dist/{cookie-banner-HPgyuHM5.js.map → cookie-banner-CAvd3PC3.js.map} +1 -1
- package/dist/document-editor-container-BnEjlmaN.js +307 -0
- package/dist/document-editor-container-BnEjlmaN.js.map +1 -0
- package/dist/document-editor-container-kgS38mkb.js +4 -0
- package/dist/error-boundary-BsUBww61.js +155 -0
- package/dist/error-boundary-BsUBww61.js.map +1 -0
- package/dist/generic.d.ts +116 -0
- package/dist/generic.d.ts.map +1 -0
- package/dist/generic.js +31 -0
- package/dist/generic.js.map +1 -0
- package/dist/{i18n-CTgT1HG-.js → i18n-D9WYPgk9.js} +4 -4
- package/dist/{i18n-CTgT1HG-.js.map → i18n-D9WYPgk9.js.map} +1 -1
- package/dist/index-B4g8swZG.d.ts +4 -0
- package/dist/layout-BOX6fL5v.js +5 -0
- package/dist/layout.d.ts +2 -28
- package/dist/layout.js +4 -6
- package/dist/load-runtime-config-DBnKV0Lk.js +14 -0
- package/dist/load-runtime-config-DBnKV0Lk.js.map +1 -0
- package/dist/{load--K_UgzUy.js → load-v3HkhMUC.js} +11 -11
- package/dist/{load--K_UgzUy.js.map → load-v3HkhMUC.js.map} +1 -1
- package/dist/main.js +2 -2
- package/dist/{open-file-uploads-BcyWmUZn.js → open-file-uploads-B5pr1sA2.js} +4 -4
- package/dist/{open-file-uploads-BcyWmUZn.js.map → open-file-uploads-B5pr1sA2.js.map} +1 -1
- package/dist/{package-manager-BkFRzovd.js → package-manager-x_fK8Hzm.js} +92 -60
- package/dist/package-manager-x_fK8Hzm.js.map +1 -0
- package/dist/{pglite-seed-BsEPByVM.js → pglite-seed-eGzXMld2.js} +4 -4
- package/dist/{pglite-seed-BsEPByVM.js.map → pglite-seed-eGzXMld2.js.map} +1 -1
- package/dist/{plugin-host--lBWChr9.js → plugins--nrQ3PK_.js} +75 -83
- package/dist/plugins--nrQ3PK_.js.map +1 -0
- package/dist/{preferences-store-DANUajdg.js → preferences-store-CSqauT9V.js} +5 -5
- package/dist/preferences-store-CSqauT9V.js.map +1 -0
- package/dist/prerender.d.ts +38 -0
- package/dist/prerender.d.ts.map +1 -0
- package/dist/prerender.js +177 -0
- package/dist/prerender.js.map +1 -0
- package/dist/{prerendered-shell-DxCUDEXL.js → prerendered-shell-peKE7AqI.js} +10 -4
- package/dist/prerendered-shell-peKE7AqI.js.map +1 -0
- package/dist/{reactor-5nod7BfF.js → reactor-CiqT6V1j.js} +25 -156
- package/dist/reactor-CiqT6V1j.js.map +1 -0
- package/dist/{registerServiceWorker-CkVxA2KC.js → registerServiceWorker-APlHkrmH.js} +4 -4
- package/dist/{registerServiceWorker-CkVxA2KC.js.map → registerServiceWorker-APlHkrmH.js.map} +1 -1
- package/dist/root-B1Pq9x6S.js +24 -0
- package/dist/root-B1Pq9x6S.js.map +1 -0
- package/dist/route-tree.d.ts +147 -156
- package/dist/route-tree.d.ts.map +1 -1
- package/dist/route-tree.js +93 -169
- package/dist/route-tree.js.map +1 -1
- package/dist/route-views-BF0p-4Fi.js +60 -0
- package/dist/route-views-BF0p-4Fi.js.map +1 -0
- package/dist/route-views-CTARvT5N.js +55 -0
- package/dist/route-views-CTARvT5N.js.map +1 -0
- package/dist/route-views-D8I-1PWU.js +4 -0
- package/dist/route-views.d.ts +7 -0
- package/dist/route-views.d.ts.map +1 -0
- package/dist/route-views.js +4 -0
- package/dist/router-BguOMBUh.js +4 -0
- package/dist/router-L9X9U-97.js +46 -0
- package/dist/router-L9X9U-97.js.map +1 -0
- package/dist/router.d.ts +1 -3
- package/dist/router.js +3 -7
- package/dist/sentry-Cuc_Nbba.js +22 -0
- package/dist/sentry-Cuc_Nbba.js.map +1 -0
- package/dist/{settings-DkLhRfEI.js → settings-gMoXPPnn.js} +488 -22
- package/dist/settings-gMoXPPnn.js.map +1 -0
- package/dist/settings-tabs-DBwSlWx8.js +365 -0
- package/dist/settings-tabs-DBwSlWx8.js.map +1 -0
- package/dist/shell-core-head.html +2 -0
- package/dist/shell-core.html +1 -0
- package/dist/shell-head.html +2 -1
- package/dist/shell-plugins.json +1 -0
- package/dist/shell.html +1 -1
- package/dist/start-connect.d.ts +5 -9
- package/dist/start-connect.d.ts.map +1 -1
- package/dist/start-connect.js +5 -6
- package/dist/start-connect.js.map +1 -1
- package/dist/style.css +3127 -4014
- package/dist/ui-g3mVHWI7.js +66 -0
- package/dist/ui-g3mVHWI7.js.map +1 -0
- package/dist/{use-renown-login-BzOSQETV.js → use-renown-login-dPpDOYq5.js} +4 -4
- package/dist/use-renown-login-dPpDOYq5.js.map +1 -0
- package/docs/customizing/data-and-navigation.md +177 -0
- package/docs/customizing/hosts-and-plugins.md +65 -0
- package/docs/customizing/layout.md +149 -0
- package/docs/customizing/modals.md +78 -0
- package/docs/customizing/overrides.md +113 -0
- package/docs/customizing/packages.md +38 -0
- package/docs/customizing/pages.md +136 -0
- package/docs/customizing/styles-and-branding.md +41 -0
- package/docs/customizing/types-and-troubleshooting.md +44 -0
- package/package.json +41 -18
- package/scripts/prerender-shell.ts +35 -84
- package/skills/customize-connect/SKILL.md +74 -0
- package/src/route-tree.ts +3 -0
- package/src/routeTree.gen.ts +134 -192
- package/src/router/index.ts +2 -51
- package/src/router/register.ts +1 -1
- package/src/routes/__root.tsx +8 -24
- package/src/routes/_app/$.tsx +13 -0
- package/src/routes/_app/d/$driveSlug/{-$nodeSlug}.tsx +13 -0
- package/src/routes/_app/d/$driveSlug.tsx +13 -0
- package/src/routes/_app/index.tsx +13 -0
- package/src/routes/_app/settings/appearance.tsx +13 -0
- package/src/routes/_app/settings/packages.tsx +13 -0
- package/src/routes/_app/settings.tsx +13 -0
- package/src/routes/_app.tsx +13 -0
- package/style.css +5 -22
- package/tailwind.css +12 -0
- package/dist/AddDriveModal-D_3jDwjp.js.map +0 -1
- package/dist/ClearStorageModal-zZ8XzwmR.js.map +0 -1
- package/dist/ConfirmDocumentUpgradeModal-CrU2Z1CL.js.map +0 -1
- package/dist/CreateDocumentModal-Cf1APibL.js.map +0 -1
- package/dist/DebugSettingsModal-DIc5C2lI.js.map +0 -1
- package/dist/DeleteDriveModal-lE9eCBua.js.map +0 -1
- package/dist/DeleteItemModal-BFgcGsm3.js.map +0 -1
- package/dist/DisclaimerModal-CF6JkIIu.js.map +0 -1
- package/dist/DocumentVersionUnsupportedModal-Cm9Jb9W7.js.map +0 -1
- package/dist/DownloadDocumentWithErrorsModal-CShKhfEQ.js.map +0 -1
- package/dist/DriveAuthRequiredModal-CMwPUyZf.js.map +0 -1
- package/dist/DriveSettingsModal-BSImj4BH.js.map +0 -1
- package/dist/InspectorModal-Dr8-gj6u.js.map +0 -1
- package/dist/LoginModal-DT_05uva.js.map +0 -1
- package/dist/MissingPackageModal-DtISKgub.js +0 -49
- package/dist/MissingPackageModal-DtISKgub.js.map +0 -1
- package/dist/OpenFileDocumentsModal-X9GnX2Bk.js.map +0 -1
- package/dist/UpgradeDriveModal-DvM-PNWe.js.map +0 -1
- package/dist/app-layout-BIq-ZW-6.js +0 -394
- package/dist/app-layout-BIq-ZW-6.js.map +0 -1
- package/dist/app-loader-CWAH-WxW.js +0 -4
- package/dist/app-loader-DrViXipO.js.map +0 -1
- package/dist/app-skeleton-gzg8cRzm.js.map +0 -1
- package/dist/boot-CC_DgQKX.js.map +0 -1
- package/dist/connect-router-KmNBGS0G.js +0 -434
- package/dist/connect-router-KmNBGS0G.js.map +0 -1
- package/dist/connect.config-uZF-gnvV.js.map +0 -1
- package/dist/connection-state-C_477Kr_.js.map +0 -1
- package/dist/index-UrZFqSgm.d.ts +0 -166
- package/dist/index-UrZFqSgm.d.ts.map +0 -1
- package/dist/layout.d.ts.map +0 -1
- package/dist/multi-reactor-fSKpLBjT.js +0 -220
- package/dist/multi-reactor-fSKpLBjT.js.map +0 -1
- package/dist/package-manager-BkFRzovd.js.map +0 -1
- package/dist/plugin-host--lBWChr9.js.map +0 -1
- package/dist/preferences-store-DANUajdg.js.map +0 -1
- package/dist/prerendered-shell-DxCUDEXL.js.map +0 -1
- package/dist/reactor-5nod7BfF.js.map +0 -1
- package/dist/route-components-BkztQruF.js +0 -148
- package/dist/route-components-BkztQruF.js.map +0 -1
- package/dist/router-8RIbbf6v.js +0 -4
- package/dist/router-C37yATTD.js +0 -604
- package/dist/router-C37yATTD.js.map +0 -1
- package/dist/runtime-config-DdN1Frg7.js +0 -34
- package/dist/runtime-config-DdN1Frg7.js.map +0 -1
- package/dist/runtime-flag-B8IYhkz-.js +0 -4
- package/dist/runtime-flag-CT5OKujT.js +0 -45
- package/dist/runtime-flag-CT5OKujT.js.map +0 -1
- package/dist/sentry-CJb7--mu.js +0 -18
- package/dist/sentry-CJb7--mu.js.map +0 -1
- package/dist/settings-CjvK8OKA.js +0 -91
- package/dist/settings-CjvK8OKA.js.map +0 -1
- package/dist/settings-DkLhRfEI.js.map +0 -1
- package/dist/sidebar-BXf8OEwm.d.ts +0 -34
- package/dist/sidebar-BXf8OEwm.d.ts.map +0 -1
- package/dist/sidebar-lAVFRsni.js +0 -31
- package/dist/sidebar-lAVFRsni.js.map +0 -1
- package/dist/use-renown-login-BzOSQETV.js.map +0 -1
- package/dist/useIsEmbedded-BWJ0qb7w.js +0 -26
- package/dist/useIsEmbedded-BWJ0qb7w.js.map +0 -1
- package/dist/useRegistryPackages-BqIWwXV-.js +0 -452
- package/dist/useRegistryPackages-BqIWwXV-.js.map +0 -1
- package/scripts/critical-css.ts +0 -243
- package/src/router/connect-router.ts +0 -170
- package/src/router/drive-route-loader.ts +0 -116
- package/src/router/navigation.ts +0 -230
- package/src/router/perf-marks.test.tsx +0 -98
- package/src/router/perf-marks.ts +0 -97
- package/src/router/route-components.tsx +0 -98
- package/src/router/route-tree.ts +0 -88
- package/src/router/scroll.ts +0 -69
- package/src/router/search.ts +0 -66
- package/src/router/settings.ts +0 -120
- package/src/router/sidebar.ts +0 -55
- package/src/router/titles.test.ts +0 -24
- package/src/router/titles.ts +0 -33
- package/src/routes/core/_app/$.tsx +0 -13
- package/src/routes/core/_app/_content/d/$driveSlug/{-$nodeSlug}.tsx +0 -52
- package/src/routes/core/_app/_content/index.tsx +0 -3
- package/src/routes/core/_app/_content.tsx +0 -9
- package/src/routes/core/_app/settings/about.tsx +0 -20
- package/src/routes/core/_app/settings/ai-assistant.tsx +0 -20
- package/src/routes/core/_app/settings/danger-zone.tsx +0 -21
- package/src/routes/core/_app/settings/default-editors.tsx +0 -20
- package/src/routes/core/_app/settings/package-manager.tsx +0 -20
- package/src/routes/core/_app/settings.tsx +0 -35
- 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.
|
package/src/routeTree.gen.ts
CHANGED
|
@@ -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
|
|
13
|
-
import { Route as
|
|
14
|
-
import { Route as
|
|
15
|
-
import { Route as
|
|
16
|
-
import { Route as
|
|
17
|
-
import { Route as
|
|
18
|
-
import { Route as
|
|
19
|
-
import { Route as
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
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: () =>
|
|
32
|
-
} as any);
|
|
33
|
-
const ContentRoute = ContentRouteImport.update({
|
|
34
|
-
id: "/_content",
|
|
35
|
-
getParentRoute: () => coreAppRoute,
|
|
33
|
+
getParentRoute: () => AppRoute,
|
|
36
34
|
} as any);
|
|
37
|
-
const
|
|
35
|
+
const AppSettingsRoute = AppSettingsRouteImport.update({
|
|
38
36
|
id: "/settings",
|
|
39
37
|
path: "/settings",
|
|
40
|
-
getParentRoute: () =>
|
|
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
|
|
53
|
-
id: "/
|
|
54
|
-
path: "/
|
|
55
|
-
getParentRoute: () =>
|
|
40
|
+
const AppDDriveSlugRoute = AppDDriveSlugRouteImport.update({
|
|
41
|
+
id: "/d/$driveSlug",
|
|
42
|
+
path: "/d/$driveSlug",
|
|
43
|
+
getParentRoute: () => AppRoute,
|
|
56
44
|
} as any);
|
|
57
|
-
const
|
|
58
|
-
id: "/
|
|
59
|
-
path: "/
|
|
60
|
-
getParentRoute: () =>
|
|
45
|
+
const AppSettingsAppearanceRoute = AppSettingsAppearanceRouteImport.update({
|
|
46
|
+
id: "/appearance",
|
|
47
|
+
path: "/appearance",
|
|
48
|
+
getParentRoute: () => AppSettingsRoute,
|
|
61
49
|
} as any);
|
|
62
|
-
const
|
|
63
|
-
id: "/
|
|
64
|
-
path: "/
|
|
65
|
-
getParentRoute: () =>
|
|
50
|
+
const AppSettingsPackagesRoute = AppSettingsPackagesRouteImport.update({
|
|
51
|
+
id: "/packages",
|
|
52
|
+
path: "/packages",
|
|
53
|
+
getParentRoute: () => AppSettingsRoute,
|
|
66
54
|
} as any);
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
|
81
|
-
"/$": typeof
|
|
82
|
-
"/settings": typeof
|
|
83
|
-
"/
|
|
84
|
-
"/settings/
|
|
85
|
-
"/settings/
|
|
86
|
-
"/
|
|
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
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"/
|
|
94
|
-
"/
|
|
95
|
-
"/settings/
|
|
96
|
-
"/settings/
|
|
97
|
-
"/
|
|
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
|
|
104
|
-
"/_app/$": typeof
|
|
105
|
-
"/_app/
|
|
106
|
-
"/_app/
|
|
107
|
-
"/_app/
|
|
108
|
-
"/_app/settings/
|
|
109
|
-
"/_app/settings/
|
|
110
|
-
"/_app/
|
|
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
|
-
| "/
|
|
122
|
-
| "/settings/
|
|
123
|
-
| "/settings/
|
|
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
|
-
| "/
|
|
133
|
-
| "/
|
|
134
|
-
| "/settings/
|
|
135
|
-
| "/settings/
|
|
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/
|
|
145
|
-
| "/_app/
|
|
146
|
-
| "/_app/settings/
|
|
147
|
-
| "/_app/settings/
|
|
148
|
-
| "/_app/
|
|
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
|
-
|
|
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
|
|
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
|
|
171
|
-
parentRoute: typeof
|
|
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
|
|
185
|
-
parentRoute: typeof
|
|
153
|
+
preLoaderRoute: typeof AppSettingsRouteImport;
|
|
154
|
+
parentRoute: typeof AppRoute;
|
|
186
155
|
};
|
|
187
|
-
"/_app/
|
|
188
|
-
id: "/_app/
|
|
189
|
-
path: "/";
|
|
190
|
-
fullPath: "/";
|
|
191
|
-
preLoaderRoute: typeof
|
|
192
|
-
parentRoute: typeof
|
|
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/
|
|
202
|
-
id: "/_app/settings/
|
|
203
|
-
path: "/
|
|
204
|
-
fullPath: "/settings/
|
|
205
|
-
preLoaderRoute: typeof
|
|
206
|
-
parentRoute: typeof
|
|
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/
|
|
209
|
-
id: "/_app/settings/
|
|
210
|
-
path: "/
|
|
211
|
-
fullPath: "/settings/
|
|
212
|
-
preLoaderRoute: typeof
|
|
213
|
-
parentRoute: typeof
|
|
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/
|
|
216
|
-
id: "/_app/
|
|
217
|
-
path: "/
|
|
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
|
|
234
|
-
parentRoute: typeof
|
|
181
|
+
preLoaderRoute: typeof AppDDriveSlugChar123NodeSlugChar125RouteImport;
|
|
182
|
+
parentRoute: typeof AppDDriveSlugRoute;
|
|
235
183
|
};
|
|
236
184
|
}
|
|
237
185
|
}
|
|
238
186
|
|
|
239
|
-
interface
|
|
240
|
-
|
|
241
|
-
|
|
187
|
+
interface AppSettingsRouteChildren {
|
|
188
|
+
AppSettingsAppearanceRoute: typeof AppSettingsAppearanceRoute;
|
|
189
|
+
AppSettingsPackagesRoute: typeof AppSettingsPackagesRoute;
|
|
242
190
|
}
|
|
243
191
|
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
ContentDDriveSlugChar123NodeSlugChar125Route,
|
|
192
|
+
const AppSettingsRouteChildren: AppSettingsRouteChildren = {
|
|
193
|
+
AppSettingsAppearanceRoute: AppSettingsAppearanceRoute,
|
|
194
|
+
AppSettingsPackagesRoute: AppSettingsPackagesRoute,
|
|
248
195
|
};
|
|
249
196
|
|
|
250
|
-
const
|
|
251
|
-
|
|
197
|
+
const AppSettingsRouteWithChildren = AppSettingsRoute._addFileChildren(
|
|
198
|
+
AppSettingsRouteChildren,
|
|
199
|
+
);
|
|
252
200
|
|
|
253
|
-
interface
|
|
254
|
-
|
|
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
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
SettingsDangerZoneRoute: SettingsDangerZoneRoute,
|
|
265
|
-
SettingsDefaultEditorsRoute: SettingsDefaultEditorsRoute,
|
|
266
|
-
SettingsPackageManagerRoute: SettingsPackageManagerRoute,
|
|
205
|
+
const AppDDriveSlugRouteChildren: AppDDriveSlugRouteChildren = {
|
|
206
|
+
AppDDriveSlugChar123NodeSlugChar125Route:
|
|
207
|
+
AppDDriveSlugChar123NodeSlugChar125Route,
|
|
267
208
|
};
|
|
268
209
|
|
|
269
|
-
const
|
|
270
|
-
|
|
210
|
+
const AppDDriveSlugRouteWithChildren = AppDDriveSlugRoute._addFileChildren(
|
|
211
|
+
AppDDriveSlugRouteChildren,
|
|
271
212
|
);
|
|
272
213
|
|
|
273
|
-
interface
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
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
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
221
|
+
const AppRouteChildren: AppRouteChildren = {
|
|
222
|
+
AppSplatRoute: AppSplatRoute,
|
|
223
|
+
AppSettingsRoute: AppSettingsRouteWithChildren,
|
|
224
|
+
AppIndexRoute: AppIndexRoute,
|
|
225
|
+
AppDDriveSlugRoute: AppDDriveSlugRouteWithChildren,
|
|
283
226
|
};
|
|
284
227
|
|
|
285
|
-
const
|
|
286
|
-
coreAppRoute._addFileChildren(coreAppRouteChildren);
|
|
228
|
+
const AppRouteWithChildren = AppRoute._addFileChildren(AppRouteChildren);
|
|
287
229
|
|
|
288
230
|
const rootRouteChildren: RootRouteChildren = {
|
|
289
|
-
|
|
231
|
+
AppRoute: AppRouteWithChildren,
|
|
290
232
|
};
|
|
291
233
|
export const routeTree = rootRouteImport
|
|
292
234
|
._addFileChildren(rootRouteChildren)
|
package/src/router/index.ts
CHANGED
|
@@ -1,51 +1,2 @@
|
|
|
1
|
-
// Connect's router
|
|
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";
|
package/src/router/register.ts
CHANGED
|
@@ -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 "
|
|
3
|
+
import type { ConnectRouter } from "@powerhousedao/connect-core/router";
|
|
4
4
|
|
|
5
5
|
declare module "@tanstack/react-router" {
|
|
6
6
|
interface Register {
|
package/src/routes/__root.tsx
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
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
|
+
});
|