@powerhousedao/connect 6.2.3-dev.7 → 6.2.3-dev.71
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 +80 -0
- package/README.md +28 -0
- package/RUNTIME-CONFIG.md +481 -0
- package/dist/{AddDriveModal-xAw48kdl.js → AddDriveModal-BjgmiHJr.js} +10 -10
- package/dist/AddDriveModal-BjgmiHJr.js.map +1 -0
- package/dist/{ClearStorageModal-Czo-h6OE.js → ClearStorageModal-DxBXLSmH.js} +11 -13
- package/dist/ClearStorageModal-DxBXLSmH.js.map +1 -0
- package/dist/{ConfirmDocumentUpgradeModal-FUOhZsk7.js → ConfirmDocumentUpgradeModal-CoixS60F.js} +9 -8
- package/dist/ConfirmDocumentUpgradeModal-CoixS60F.js.map +1 -0
- package/dist/{CookiesPolicyModal-BpyPPyxS.js → CookiesPolicyModal-BpFjYc7T.js} +5 -5
- package/dist/{CookiesPolicyModal-BpyPPyxS.js.map → CookiesPolicyModal-BpFjYc7T.js.map} +1 -1
- package/dist/{CreateDocumentModal-C45W8J0V.js → CreateDocumentModal-B-cXzeOA.js} +11 -10
- package/dist/CreateDocumentModal-B-cXzeOA.js.map +1 -0
- package/dist/{DebugSettingsModal-BUkre5Ke.js → DebugSettingsModal-D1I-K2Gf.js} +9 -9
- package/dist/DebugSettingsModal-D1I-K2Gf.js.map +1 -0
- package/dist/{DeleteDriveModal-Dug84t1j.js → DeleteDriveModal-1pAIayG_.js} +7 -7
- package/dist/DeleteDriveModal-1pAIayG_.js.map +1 -0
- package/dist/{DeleteItemModal-mMzy3V8o.js → DeleteItemModal-BUpqmFxS.js} +8 -8
- package/dist/DeleteItemModal-BUpqmFxS.js.map +1 -0
- package/dist/{DisclaimerModal-DvpD5dPM.js → DisclaimerModal-TIJXRYLF.js} +7 -7
- package/dist/DisclaimerModal-TIJXRYLF.js.map +1 -0
- package/dist/{DocumentVersionUnsupportedModal-C3Q0V75l.js → DocumentVersionUnsupportedModal-DH9Zzsyw.js} +6 -6
- package/dist/DocumentVersionUnsupportedModal-DH9Zzsyw.js.map +1 -0
- package/dist/{DownloadDocumentWithErrorsModal-IKl0ljQb.js → DownloadDocumentWithErrorsModal-Beh-xw8B.js} +8 -7
- package/dist/DownloadDocumentWithErrorsModal-Beh-xw8B.js.map +1 -0
- package/dist/{DriveAuthRequiredModal-DVK7ZQzO.js → DriveAuthRequiredModal-XTcoJKvj.js} +7 -7
- package/dist/DriveAuthRequiredModal-XTcoJKvj.js.map +1 -0
- package/dist/{DriveSettingsModal-C6-mRQiv.js → DriveSettingsModal-DZKawN7w.js} +6 -6
- package/dist/DriveSettingsModal-DZKawN7w.js.map +1 -0
- package/dist/FloatingTanStackRouterDevtools-CqogiFob-dxj8lrTP.js +2565 -0
- package/dist/FloatingTanStackRouterDevtools-CqogiFob-dxj8lrTP.js.map +1 -0
- package/dist/{InspectorModal-C-dm0iSW.js → InspectorModal-D85U4oKJ.js} +70 -30
- package/dist/InspectorModal-D85U4oKJ.js.map +1 -0
- package/dist/{LoginModal-CybbOm3N.js → LoginModal-O06ZvWFI.js} +8 -8
- package/dist/LoginModal-O06ZvWFI.js.map +1 -0
- package/dist/{OpenFileDocumentsModal-DEcFBZ5I.js → OpenFileDocumentsModal-B9c-CsKT.js} +16 -14
- package/dist/OpenFileDocumentsModal-B9c-CsKT.js.map +1 -0
- package/dist/{UpgradeDriveModal-_8t9slxQ.js → UpgradeDriveModal-CCWKp5yn.js} +7 -7
- package/dist/UpgradeDriveModal-CCWKp5yn.js.map +1 -0
- package/dist/app-loader-D5GEwpML.js +4 -0
- package/dist/app-loader-casiq2T2.js +1253 -0
- package/dist/app-loader-casiq2T2.js.map +1 -0
- package/dist/app-skeleton-BHgmbYld.js +4 -0
- package/dist/app-skeleton-ClRUYLE_.js +121 -0
- package/dist/app-skeleton-ClRUYLE_.js.map +1 -0
- package/dist/boot-CFPdHSqB.js +233 -0
- package/dist/boot-CFPdHSqB.js.map +1 -0
- package/dist/buffer-DNTcuap_.js +66 -0
- package/dist/buffer-DNTcuap_.js.map +1 -0
- package/dist/{build-info-N6D-34wu.js → build-info-Cn2f6llN.js} +10 -6
- package/dist/build-info-Cn2f6llN.js.map +1 -0
- package/dist/components-C4K5xyad.js +121 -0
- package/dist/components-C4K5xyad.js.map +1 -0
- package/dist/{connect.config-DaHDEUrw.js → connect.config-D1pGNmaF.js} +25 -13
- package/dist/connect.config-D1pGNmaF.js.map +1 -0
- package/dist/{connection-state-3w4liC1X.js → connection-state-B6fleM37.js} +20 -9
- package/dist/connection-state-B6fleM37.js.map +1 -0
- package/dist/context-De2EB1AA-Ni0d829Q.js +1759 -0
- package/dist/context-De2EB1AA-Ni0d829Q.js.map +1 -0
- package/dist/{cookie-banner-BH6bIq24.js → cookie-banner-CAvd3PC3.js} +7 -7
- package/dist/{cookie-banner-BH6bIq24.js.map → cookie-banner-CAvd3PC3.js.map} +1 -1
- package/dist/document-editor-container-CGLXOl0t.js +4 -0
- package/dist/document-editor-container-FNIEsf8H.js +310 -0
- package/dist/document-editor-container-FNIEsf8H.js.map +1 -0
- package/dist/drive-icon-BIpd8edR.js +49 -0
- package/dist/drive-icon-BIpd8edR.js.map +1 -0
- package/dist/error-boundary-BsUBww61.js +155 -0
- package/dist/error-boundary-BsUBww61.js.map +1 -0
- package/dist/esm-BDACZntJ.js +148 -0
- package/dist/esm-BDACZntJ.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-CWO0vYVd.js → i18n-D9WYPgk9.js} +4 -4
- package/dist/{i18n-CWO0vYVd.js.map → i18n-D9WYPgk9.js.map} +1 -1
- package/dist/index-NyJPEHvw.d.ts +4 -0
- package/dist/layout-wfvkfP4J.js +5 -0
- package/dist/layout.d.ts +3 -0
- package/dist/layout.js +4 -0
- package/dist/{load-BxUCaDLH.js → load-DcDV9hi4.js} +48 -46
- package/dist/load-DcDV9hi4.js.map +1 -0
- package/dist/load-runtime-config-Deq75NYr.js +14 -0
- package/dist/load-runtime-config-Deq75NYr.js.map +1 -0
- package/dist/main.d.ts +2 -1
- package/dist/main.js +8 -8
- package/dist/main.js.map +1 -1
- package/dist/open-file-uploads-B5pr1sA2.js +183 -0
- package/dist/open-file-uploads-B5pr1sA2.js.map +1 -0
- package/dist/package-manager-CzBsaUUd.js +524 -0
- package/dist/package-manager-CzBsaUUd.js.map +1 -0
- package/dist/{pglite-major-B39aOEiE.js → pglite-major-p4_YefAE.js} +23 -5
- package/dist/pglite-major-p4_YefAE.js.map +1 -0
- package/dist/{pglite-migrate-core-Boxqqx-c.js → pglite-migrate-core-DBlU6HIc.js} +9 -7
- package/dist/pglite-migrate-core-DBlU6HIc.js.map +1 -0
- package/dist/{pglite-seed-BqAUvNFw.js → pglite-seed-eGzXMld2.js} +4 -4
- package/dist/{pglite-seed-BqAUvNFw.js.map → pglite-seed-eGzXMld2.js.map} +1 -1
- package/dist/pglite.worker.d.ts +2 -1
- package/dist/pglite.worker.js +4 -3
- package/dist/pglite.worker.js.map +1 -1
- package/dist/pglite.worker.legacy.d.ts +2 -1
- package/dist/pglite.worker.legacy.js +4 -3
- package/dist/pglite.worker.legacy.js.map +1 -1
- package/dist/plugin-configs.d.ts +242 -0
- package/dist/plugin-configs.d.ts.map +1 -0
- package/dist/plugin-configs.js +26 -0
- package/dist/plugin-configs.js.map +1 -0
- package/dist/plugins-CegSox2x.js +263 -0
- package/dist/plugins-CegSox2x.js.map +1 -0
- package/dist/{preferences-store-_5Cw4_YV.js → preferences-store-CSqauT9V.js} +6 -25
- 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 +181 -0
- package/dist/prerender.js.map +1 -0
- package/dist/prerendered-shell-peKE7AqI.js +51 -0
- package/dist/prerendered-shell-peKE7AqI.js.map +1 -0
- package/dist/{pwa-manifest-link-DIgOSo2Q.js → pwa-manifest-link-DQRJpF0r.js} +3 -3
- package/dist/{pwa-manifest-link-DIgOSo2Q.js.map → pwa-manifest-link-DQRJpF0r.js.map} +1 -1
- package/dist/{reactor-Bg0Y9sdl.js → reactor-BGYR1N7Z.js} +509 -562
- package/dist/reactor-BGYR1N7Z.js.map +1 -0
- package/dist/reactor-chat-LAB-9G3G.js +50 -0
- package/dist/reactor-chat-LAB-9G3G.js.map +1 -0
- package/dist/reactor.worker.d.ts +2 -1
- package/dist/reactor.worker.js +478 -156
- package/dist/reactor.worker.js.map +1 -1
- package/dist/{registerServiceWorker-BSzbNfvz.js → registerServiceWorker-APlHkrmH.js} +5 -5
- package/dist/{registerServiceWorker-BSzbNfvz.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 +2220 -0
- package/dist/route-tree.d.ts.map +1 -0
- package/dist/route-tree.js +135 -0
- package/dist/route-tree.js.map +1 -0
- package/dist/route-views-2aB1ZZPP.js +55 -0
- package/dist/route-views-2aB1ZZPP.js.map +1 -0
- package/dist/route-views-CDVZytw4.js +60 -0
- package/dist/route-views-CDVZytw4.js.map +1 -0
- package/dist/route-views-D_873yb_.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-B0OQvO11.js +4 -0
- package/dist/router-Cu0PH6sh.js +46 -0
- package/dist/router-Cu0PH6sh.js.map +1 -0
- package/dist/router.d.ts +2 -0
- package/dist/router.js +3 -0
- package/dist/sentry-Cuc_Nbba.js +22 -0
- package/dist/sentry-Cuc_Nbba.js.map +1 -0
- package/dist/settings-CFn4TA0g.js +1090 -0
- package/dist/settings-CFn4TA0g.js.map +1 -0
- package/dist/settings-tabs-BC8gAacB.js +410 -0
- package/dist/settings-tabs-BC8gAacB.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 -0
- package/dist/shell-plugins.json +1 -0
- package/dist/shell.html +1 -0
- package/dist/start-connect.d.ts +7 -9
- package/dist/start-connect.d.ts.map +1 -1
- package/dist/start-connect.js +9 -8
- package/dist/start-connect.js.map +1 -1
- package/dist/store-lock-Bi3B9VJD.js +159 -0
- package/dist/store-lock-Bi3B9VJD.js.map +1 -0
- package/dist/style.css +3144 -764
- package/dist/{toast-BXIGd4Eb.js → toast-C6WW-_O-.js} +3 -3
- package/dist/{toast-BXIGd4Eb.js.map → toast-C6WW-_O-.js.map} +1 -1
- package/dist/ui-BOTsJPoc.js +66 -0
- package/dist/ui-BOTsJPoc.js.map +1 -0
- package/dist/{use-renown-login-Cf3va6u_.js → use-renown-login-dPpDOYq5.js} +4 -4
- package/dist/use-renown-login-dPpDOYq5.js.map +1 -0
- package/dist/workflows-C3qEvx1R.js +63 -0
- package/dist/workflows-C3qEvx1R.js.map +1 -0
- package/docs/customizing/data-and-navigation.md +232 -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 +39 -0
- package/docs/customizing/pages.md +136 -0
- package/docs/customizing/styles-and-branding.md +69 -0
- package/docs/customizing/types-and-troubleshooting.md +63 -0
- package/fonts.css +177 -0
- package/package.json +88 -26
- package/scripts/assert-plugin-configs.mjs +47 -0
- package/scripts/prerender-shell.ts +51 -0
- package/skills/customize-connect/SKILL.md +74 -0
- package/src/route-tree.ts +3 -0
- package/src/routeTree.gen.ts +235 -0
- package/src/router/index.ts +2 -0
- package/src/router/register.ts +9 -0
- package/src/routes/__root.tsx +12 -0
- 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 +8 -23
- package/tailwind.css +12 -0
- package/theme.css +5 -0
- package/dist/AddDriveModal-xAw48kdl.js.map +0 -1
- package/dist/ClearStorageModal-Czo-h6OE.js.map +0 -1
- package/dist/ConfirmDocumentUpgradeModal-FUOhZsk7.js.map +0 -1
- package/dist/CreateDocumentModal-C45W8J0V.js.map +0 -1
- package/dist/DebugSettingsModal-BUkre5Ke.js.map +0 -1
- package/dist/DeleteDriveModal-Dug84t1j.js.map +0 -1
- package/dist/DeleteItemModal-mMzy3V8o.js.map +0 -1
- package/dist/DisclaimerModal-DvpD5dPM.js.map +0 -1
- package/dist/DocumentVersionUnsupportedModal-C3Q0V75l.js.map +0 -1
- package/dist/DownloadDocumentWithErrorsModal-IKl0ljQb.js.map +0 -1
- package/dist/DriveAuthRequiredModal-DVK7ZQzO.js.map +0 -1
- package/dist/DriveSettingsModal-C6-mRQiv.js.map +0 -1
- package/dist/InspectorModal-C-dm0iSW.js.map +0 -1
- package/dist/LoginModal-CybbOm3N.js.map +0 -1
- package/dist/MissingPackageModal-nBnExqO0.js +0 -49
- package/dist/MissingPackageModal-nBnExqO0.js.map +0 -1
- package/dist/OpenFileDocumentsModal-DEcFBZ5I.js.map +0 -1
- package/dist/SettingsModal-CRBkw7d0.js +0 -569
- package/dist/SettingsModal-CRBkw7d0.js.map +0 -1
- package/dist/UpgradeDriveModal-_8t9slxQ.js.map +0 -1
- package/dist/app-loader-DkQhle_a.js +0 -4
- package/dist/app-loader-lsCT8EWA.js +0 -2244
- package/dist/app-loader-lsCT8EWA.js.map +0 -1
- package/dist/build-info-N6D-34wu.js.map +0 -1
- package/dist/components-DHzkxxly.js +0 -4
- package/dist/connect.config-DaHDEUrw.js.map +0 -1
- package/dist/connection-state-3w4liC1X.js.map +0 -1
- package/dist/load-BxUCaDLH.js.map +0 -1
- package/dist/pglite-major-B39aOEiE.js.map +0 -1
- package/dist/pglite-migrate-core-Boxqqx-c.js.map +0 -1
- package/dist/preferences-store-_5Cw4_YV.js.map +0 -1
- package/dist/reactor-Bg0Y9sdl.js.map +0 -1
- package/dist/runtime-config-DL3QjcfM.js +0 -24
- package/dist/runtime-config-DL3QjcfM.js.map +0 -1
- package/dist/sentry-QXKgQmr2.js +0 -15
- package/dist/sentry-QXKgQmr2.js.map +0 -1
- package/dist/use-renown-login-Cf3va6u_.js.map +0 -1
- package/dist/useRegistryPackages-BnUcL_nZ.js +0 -390
- package/dist/useRegistryPackages-BnUcL_nZ.js.map +0 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Types, troubleshooting and upgrading
|
|
2
|
+
|
|
3
|
+
## Types
|
|
4
|
+
|
|
5
|
+
The build generates `.ph/connect-routes.gen.ts`: the route tree of Connect's routes and the project's. It registers the router type, so `createFileRoute` ids, `Link`, `useNavigate`, loader data and search params are typed.
|
|
6
|
+
|
|
7
|
+
- `ph connect build`, `ph connect studio`, `ph connect preview` and `ph build` generate it. `ph connect studio` regenerates it as route files change.
|
|
8
|
+
- The project's `tsconfig.json` includes `.ph/connect-routes.gen.ts` and maps both `"@powerhousedao/connect-core/route-tree"` and `"@powerhousedao/connect/route-tree"` to `["./.ph/connect-routes.gen.ts"]` in `paths`. New projects are scaffolded with them. In an older project, add them by hand, and drop `.ph` from `exclude`. Core's router types name the tree by `@powerhousedao/connect-core/route-tree`; without that path they use core's own routes.
|
|
9
|
+
- Until the first build, both specifiers resolve to core's own tree. Project routes show type errors (unknown route ids) until `ph connect build` or `ph connect studio` has run.
|
|
10
|
+
- `ph connect build` type-checks the routes and fails on errors. `--ignore-type-errors` skips the check.
|
|
11
|
+
- `@tanstack/react-router` must be the version Connect uses. The routes and Connect share one router, and its types come from the project's copy.
|
|
12
|
+
|
|
13
|
+
## Troubleshooting
|
|
14
|
+
|
|
15
|
+
| Symptom | Cause |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `Connect could not mount the routes in hosts/connect/routes/` | A route outside `_app/` collides with one of Connect's, or two project files have one path. The message names the files. |
|
|
18
|
+
| A new routes folder is ignored by a running `ph connect studio` | Connect checks for the folder at startup. Restart it. |
|
|
19
|
+
| `createFileRoute("/_app/x")` is a type error | The tree is not generated yet, or the tsconfig lacks the `route-tree` path. See [Types](#types). |
|
|
20
|
+
| A sidebar link reloads the whole app | It is a plain `href`. Navigate through the router; see [Replace the sidebar](./layout.md#replace-the-sidebar). |
|
|
21
|
+
| A `staticData.nav` route is missing from the sidebar | Its path has a param, or it is not in `_app/`, or a replaced layout does not render `SidebarNavItems`/`useNavRoutes`. |
|
|
22
|
+
| A route's search param is gone after navigating | Only global params survive a navigation. Pass the param in `search` on the link. |
|
|
23
|
+
| A loader sees no drive on a deep link | The drive has not arrived yet; see [Load data](./data-and-navigation.md#load-data). |
|
|
24
|
+
| A class has no effect, e.g. `pl-7` next to `px-3` | `style.css` imports a second Tailwind build, such as `@powerhousedao/connect/style.css`. Import `@powerhousedao/connect/tailwind.css` instead, or run `ph migrate`; see [Styles](./styles-and-branding.md#styles). |
|
|
25
|
+
| A package's `dist/style.css` is hundreds of KB, or a host's `@theme` values revert to the defaults once the package loads | The package was built before packages left Connect's CSS out: its stylesheet is a full Tailwind build, whose tokens outrank the host's. Rebuild it with `ph build` and publish it; see [A package's styles](./styles-and-branding.md#a-packages-styles). |
|
|
26
|
+
| A package's token or rule works in its own Connect but not in another | It is in `hosts/connect/style.css`, which `ph build` leaves out. Move what the package's editors and routes need to `style.css`. |
|
|
27
|
+
| A host's token override doesn't reach a package's classes | The page emits only the tokens its own classes use. Override it in `@theme static` in the host's stylesheet; see [Styles](./styles-and-branding.md#styles). |
|
|
28
|
+
| Installing a package re-themes Connect | The package's `style.css` sets Connect's tokens or global rules, which ship in its stylesheet. Move them to its `hosts/connect/style.css`; `ph migrate` warns about them. |
|
|
29
|
+
| `ph build` fails: `./theme.css` is not exported from `@powerhousedao/connect` | The project's `@powerhousedao/connect` is older than `ph-cli`. Update it to the same version. |
|
|
30
|
+
|
|
31
|
+
## Upgrading
|
|
32
|
+
|
|
33
|
+
`ph migrate` updates a project for this version:
|
|
34
|
+
|
|
35
|
+
- `style.css` imports `@powerhousedao/connect/tailwind.css` instead of `@powerhousedao/design-system/theme.css` and `@powerhousedao/connect/style.css`. The project's own rules stay.
|
|
36
|
+
- `tsconfig.json` includes `.ph/connect-routes.gen.ts`, the generated tree that types the project's routes.
|
|
37
|
+
- `style.css` drops the `@import './node_modules/<package>/dist/style.css'` lines that `ph install --local` added. Connect loads a bundled package's stylesheet with its code.
|
|
38
|
+
- `hosts/connect/style.css` holds this Connect's theme; `ph migrate` creates it and warns when `style.css` sets tokens or global rules, which now ship in the package's stylesheet. Move a Connect's theme there by hand.
|
|
39
|
+
- A Tailwind host that imported `@powerhousedao/connect-core/theme.css` for core's classes imports `@powerhousedao/connect-core/tailwind.css`. `theme.css` now holds only core's tokens. `@powerhousedao/connect/tailwind.css` does this already.
|
|
40
|
+
|
|
41
|
+
A package rebuilt with `ph build` ships only its own classes and rules (see [A package's styles](./styles-and-branding.md#a-packages-styles)). Republish packages so the Connects that load them keep one Tailwind build per page.
|
|
42
|
+
|
|
43
|
+
Two `@powerhousedao/reactor-browser` types lost a member, which a project that used them updates by hand:
|
|
44
|
+
|
|
45
|
+
- `PHModal` has no `missingPackage` modal.
|
|
46
|
+
- `PHGlobal` has no `revisionHistoryVisible`. `useRevisionHistoryVisible`, `showRevisionHistory` and `hideRevisionHistory` work as before.
|
|
47
|
+
|
|
48
|
+
Editors receive `document` and `dispatch` as props. For TypeScript users this is breaking:
|
|
49
|
+
|
|
50
|
+
- `EditorModule`'s type parameters are now `<TDocument, TAction, TProps>`. A module typed `EditorModule<{ ...props }>` moves its props to the third parameter.
|
|
51
|
+
- A host that renders an `EditorModule`'s `Component` must pass `document` and `dispatch`, and should wrap it in `EditorDocumentProvider` (see [Render an editor or a drive app yourself](./data-and-navigation.md#render-an-editor-or-a-drive-app-yourself)).
|
|
52
|
+
- An editor whose component takes only its own props must share one with what hosts pass (`documentId`, `context`, `displayToolbar`), or take `EditorProps`.
|
|
53
|
+
- `ph generate` writes editors that read `document` and `dispatch` from props. A package with such an editor needs a Connect with this change: older Connects pass neither prop. Editors that use the `useSelected<Model>Document()` hooks keep working in every Connect.
|
|
54
|
+
|
|
55
|
+
In 6.2.3 dev prereleases only, `RouteSelection` and scoped PH stores (`createScopedPHStore`, `isScopedPHStore`) are gone. Drive apps read the route through `DriveProvider`, editors through `EditorDocumentProvider`, both from `@powerhousedao/reactor-browser`.
|
|
56
|
+
|
|
57
|
+
The generic plugin's UI moved behind the plugin, which a project's routes follow by hand:
|
|
58
|
+
|
|
59
|
+
- `AppLayout`, `ConnectSidebar`, `SidebarDriveItems`, `SidebarNavItems` and `OpenDocument` import from `@powerhousedao/connect/generic`, not `/layout`.
|
|
60
|
+
- `@powerhousedao/connect/route-views` exports only `ConnectRoot`; `Home`, `DriveLayout`, `NodeView`, `DrivePending` and `SettingsPage` import from `/generic`.
|
|
61
|
+
- `generic()`, `genericActive`, `IfPlugin` and `useIsPluginActive` are gone; a plugin's `ui()` provides its views.
|
|
62
|
+
- Connect's About, AI Assistant, Danger Zone, Default Editors and Package Manager tabs are the generic plugin's code routes, so `@powerhousedao/connect/routes/_app/settings/<tab>` no longer exists for them. An override imports the tab's options as `genericSettingsTabs["<tab>"]` from `@powerhousedao/connect/generic` instead; links to these tabs are untyped, so use `useLinkProps({ settings: "<tab>" })`.
|
|
63
|
+
|
package/fonts.css
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/* @fontsource-variable/inter opsz faces, renamed to the "Inter" that packages' themes use. */
|
|
2
|
+
|
|
3
|
+
/* inter-cyrillic-ext-opsz-normal */
|
|
4
|
+
@font-face {
|
|
5
|
+
font-family: "Inter";
|
|
6
|
+
font-style: normal;
|
|
7
|
+
font-display: swap;
|
|
8
|
+
font-weight: 100 900;
|
|
9
|
+
src: url("@fontsource-variable/inter/files/inter-cyrillic-ext-opsz-normal.woff2")
|
|
10
|
+
format("woff2-variations");
|
|
11
|
+
unicode-range:
|
|
12
|
+
U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* inter-cyrillic-opsz-normal */
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: "Inter";
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-display: swap;
|
|
20
|
+
font-weight: 100 900;
|
|
21
|
+
src: url("@fontsource-variable/inter/files/inter-cyrillic-opsz-normal.woff2")
|
|
22
|
+
format("woff2-variations");
|
|
23
|
+
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* inter-greek-ext-opsz-normal */
|
|
27
|
+
@font-face {
|
|
28
|
+
font-family: "Inter";
|
|
29
|
+
font-style: normal;
|
|
30
|
+
font-display: swap;
|
|
31
|
+
font-weight: 100 900;
|
|
32
|
+
src: url("@fontsource-variable/inter/files/inter-greek-ext-opsz-normal.woff2")
|
|
33
|
+
format("woff2-variations");
|
|
34
|
+
unicode-range: U+1F00-1FFF;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* inter-greek-opsz-normal */
|
|
38
|
+
@font-face {
|
|
39
|
+
font-family: "Inter";
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-display: swap;
|
|
42
|
+
font-weight: 100 900;
|
|
43
|
+
src: url("@fontsource-variable/inter/files/inter-greek-opsz-normal.woff2")
|
|
44
|
+
format("woff2-variations");
|
|
45
|
+
unicode-range:
|
|
46
|
+
U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* inter-vietnamese-opsz-normal */
|
|
50
|
+
@font-face {
|
|
51
|
+
font-family: "Inter";
|
|
52
|
+
font-style: normal;
|
|
53
|
+
font-display: swap;
|
|
54
|
+
font-weight: 100 900;
|
|
55
|
+
src: url("@fontsource-variable/inter/files/inter-vietnamese-opsz-normal.woff2")
|
|
56
|
+
format("woff2-variations");
|
|
57
|
+
unicode-range:
|
|
58
|
+
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
|
|
59
|
+
U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329,
|
|
60
|
+
U+1EA0-1EF9, U+20AB;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/* inter-latin-ext-opsz-normal */
|
|
64
|
+
@font-face {
|
|
65
|
+
font-family: "Inter";
|
|
66
|
+
font-style: normal;
|
|
67
|
+
font-display: swap;
|
|
68
|
+
font-weight: 100 900;
|
|
69
|
+
src: url("@fontsource-variable/inter/files/inter-latin-ext-opsz-normal.woff2")
|
|
70
|
+
format("woff2-variations");
|
|
71
|
+
unicode-range:
|
|
72
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
|
|
73
|
+
U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
|
|
74
|
+
U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* inter-latin-opsz-normal */
|
|
78
|
+
@font-face {
|
|
79
|
+
font-family: "Inter";
|
|
80
|
+
font-style: normal;
|
|
81
|
+
font-display: swap;
|
|
82
|
+
font-weight: 100 900;
|
|
83
|
+
src: url("@fontsource-variable/inter/files/inter-latin-opsz-normal.woff2")
|
|
84
|
+
format("woff2-variations");
|
|
85
|
+
unicode-range:
|
|
86
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
|
|
87
|
+
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
|
|
88
|
+
U+2215, U+FEFF, U+FFFD;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/* inter-cyrillic-ext-opsz-italic */
|
|
92
|
+
@font-face {
|
|
93
|
+
font-family: "Inter";
|
|
94
|
+
font-style: italic;
|
|
95
|
+
font-display: swap;
|
|
96
|
+
font-weight: 100 900;
|
|
97
|
+
src: url("@fontsource-variable/inter/files/inter-cyrillic-ext-opsz-italic.woff2")
|
|
98
|
+
format("woff2-variations");
|
|
99
|
+
unicode-range:
|
|
100
|
+
U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* inter-cyrillic-opsz-italic */
|
|
104
|
+
@font-face {
|
|
105
|
+
font-family: "Inter";
|
|
106
|
+
font-style: italic;
|
|
107
|
+
font-display: swap;
|
|
108
|
+
font-weight: 100 900;
|
|
109
|
+
src: url("@fontsource-variable/inter/files/inter-cyrillic-opsz-italic.woff2")
|
|
110
|
+
format("woff2-variations");
|
|
111
|
+
unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/* inter-greek-ext-opsz-italic */
|
|
115
|
+
@font-face {
|
|
116
|
+
font-family: "Inter";
|
|
117
|
+
font-style: italic;
|
|
118
|
+
font-display: swap;
|
|
119
|
+
font-weight: 100 900;
|
|
120
|
+
src: url("@fontsource-variable/inter/files/inter-greek-ext-opsz-italic.woff2")
|
|
121
|
+
format("woff2-variations");
|
|
122
|
+
unicode-range: U+1F00-1FFF;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* inter-greek-opsz-italic */
|
|
126
|
+
@font-face {
|
|
127
|
+
font-family: "Inter";
|
|
128
|
+
font-style: italic;
|
|
129
|
+
font-display: swap;
|
|
130
|
+
font-weight: 100 900;
|
|
131
|
+
src: url("@fontsource-variable/inter/files/inter-greek-opsz-italic.woff2")
|
|
132
|
+
format("woff2-variations");
|
|
133
|
+
unicode-range:
|
|
134
|
+
U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/* inter-vietnamese-opsz-italic */
|
|
138
|
+
@font-face {
|
|
139
|
+
font-family: "Inter";
|
|
140
|
+
font-style: italic;
|
|
141
|
+
font-display: swap;
|
|
142
|
+
font-weight: 100 900;
|
|
143
|
+
src: url("@fontsource-variable/inter/files/inter-vietnamese-opsz-italic.woff2")
|
|
144
|
+
format("woff2-variations");
|
|
145
|
+
unicode-range:
|
|
146
|
+
U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1,
|
|
147
|
+
U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329,
|
|
148
|
+
U+1EA0-1EF9, U+20AB;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* inter-latin-ext-opsz-italic */
|
|
152
|
+
@font-face {
|
|
153
|
+
font-family: "Inter";
|
|
154
|
+
font-style: italic;
|
|
155
|
+
font-display: swap;
|
|
156
|
+
font-weight: 100 900;
|
|
157
|
+
src: url("@fontsource-variable/inter/files/inter-latin-ext-opsz-italic.woff2")
|
|
158
|
+
format("woff2-variations");
|
|
159
|
+
unicode-range:
|
|
160
|
+
U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
|
|
161
|
+
U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
|
|
162
|
+
U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/* inter-latin-opsz-italic */
|
|
166
|
+
@font-face {
|
|
167
|
+
font-family: "Inter";
|
|
168
|
+
font-style: italic;
|
|
169
|
+
font-display: swap;
|
|
170
|
+
font-weight: 100 900;
|
|
171
|
+
src: url("@fontsource-variable/inter/files/inter-latin-opsz-italic.woff2")
|
|
172
|
+
format("woff2-variations");
|
|
173
|
+
unicode-range:
|
|
174
|
+
U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
|
|
175
|
+
U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
|
|
176
|
+
U+2215, U+FEFF, U+FFFD;
|
|
177
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/connect",
|
|
3
3
|
"productName": "Powerhouse-Connect",
|
|
4
|
-
"version": "6.2.3-dev.
|
|
4
|
+
"version": "6.2.3-dev.71",
|
|
5
5
|
"description": "Powerhouse Connect",
|
|
6
6
|
"main": "dist/index.html",
|
|
7
7
|
"type": "module",
|
|
@@ -10,7 +10,18 @@
|
|
|
10
10
|
},
|
|
11
11
|
"files": [
|
|
12
12
|
"dist",
|
|
13
|
+
"skills",
|
|
14
|
+
"docs",
|
|
15
|
+
"CUSTOMIZING.md",
|
|
16
|
+
"RUNTIME-CONFIG.md",
|
|
17
|
+
"src/routes",
|
|
18
|
+
"src/router",
|
|
19
|
+
"src/route-tree.ts",
|
|
20
|
+
"src/routeTree.gen.ts",
|
|
13
21
|
"style.css",
|
|
22
|
+
"tailwind.css",
|
|
23
|
+
"theme.css",
|
|
24
|
+
"fonts.css",
|
|
14
25
|
"nginx.conf",
|
|
15
26
|
"nginx.sh",
|
|
16
27
|
"scripts",
|
|
@@ -30,14 +41,57 @@
|
|
|
30
41
|
"types": "./dist/main.d.ts",
|
|
31
42
|
"import": "./dist/main.js"
|
|
32
43
|
},
|
|
44
|
+
"./router": {
|
|
45
|
+
"source": "./src/router/index.ts",
|
|
46
|
+
"types": "./dist/router.d.ts",
|
|
47
|
+
"import": "./dist/router.js"
|
|
48
|
+
},
|
|
49
|
+
"./layout": {
|
|
50
|
+
"source": "./src/layout/index.ts",
|
|
51
|
+
"types": "./dist/layout.d.ts",
|
|
52
|
+
"import": "./dist/layout.js"
|
|
53
|
+
},
|
|
54
|
+
"./generic": {
|
|
55
|
+
"source": "./src/generic/index.ts",
|
|
56
|
+
"types": "./dist/generic.d.ts",
|
|
57
|
+
"import": "./dist/generic.js"
|
|
58
|
+
},
|
|
59
|
+
"./route-tree": {
|
|
60
|
+
"source": "./src/route-tree.ts",
|
|
61
|
+
"types": "./dist/route-tree.d.ts",
|
|
62
|
+
"import": "./dist/route-tree.js"
|
|
63
|
+
},
|
|
64
|
+
"./prerender": {
|
|
65
|
+
"source": "./src/prerender/shell.tsx",
|
|
66
|
+
"types": "./dist/prerender.d.ts",
|
|
67
|
+
"import": "./dist/prerender.js"
|
|
68
|
+
},
|
|
69
|
+
"./route-views": {
|
|
70
|
+
"source": "./src/route-views/index.ts",
|
|
71
|
+
"types": "./dist/route-views.d.ts",
|
|
72
|
+
"import": "./dist/route-views.js"
|
|
73
|
+
},
|
|
74
|
+
"./plugin-configs": {
|
|
75
|
+
"source": "./src/plugin-configs/index.ts",
|
|
76
|
+
"types": "./dist/plugin-configs.d.ts",
|
|
77
|
+
"import": "./dist/plugin-configs.js",
|
|
78
|
+
"default": "./dist/plugin-configs.js"
|
|
79
|
+
},
|
|
80
|
+
"./routes/*": "./src/routes/*.tsx",
|
|
33
81
|
"./assets/*": "./assets/*",
|
|
34
|
-
"./style.css": "./dist/style.css"
|
|
82
|
+
"./style.css": "./dist/style.css",
|
|
83
|
+
"./tailwind.css": "./tailwind.css",
|
|
84
|
+
"./theme.css": "./theme.css",
|
|
85
|
+
"./fonts.css": "./fonts.css",
|
|
86
|
+
"./package.json": "./package.json"
|
|
35
87
|
},
|
|
36
88
|
"sideEffects": [
|
|
37
89
|
"./dist/main.js",
|
|
38
90
|
"./dist/start-connect.js",
|
|
39
91
|
"./dist/i18n-*.js",
|
|
40
|
-
"./
|
|
92
|
+
"./src/i18n/index.ts",
|
|
93
|
+
"./dist/style.css",
|
|
94
|
+
"./fonts.css"
|
|
41
95
|
],
|
|
42
96
|
"license": "AGPL-3.0-only",
|
|
43
97
|
"author": "powerhouse.inc",
|
|
@@ -52,25 +106,32 @@
|
|
|
52
106
|
"dependencies": {
|
|
53
107
|
"@electric-sql/pglite": "0.3.15",
|
|
54
108
|
"@electric-sql/pglite-tools": "0.2.20",
|
|
109
|
+
"@fontsource-variable/inter": "5.3.0",
|
|
55
110
|
"@openfeature/core": "1.9.1",
|
|
56
111
|
"@openfeature/web-sdk": "1.6.2",
|
|
57
112
|
"@openpanel/web": "^1.4.1",
|
|
58
|
-
"@powerhousedao/config": "6.2.3-dev.
|
|
59
|
-
"@powerhousedao/
|
|
113
|
+
"@powerhousedao/config": "6.2.3-dev.71",
|
|
114
|
+
"@powerhousedao/connect-core": "6.2.3-dev.71",
|
|
115
|
+
"@powerhousedao/design-system": "6.2.3-dev.71",
|
|
60
116
|
"@powerhousedao/document-engineering": "1.40.5",
|
|
61
|
-
"@powerhousedao/
|
|
62
|
-
"@powerhousedao/
|
|
63
|
-
"@powerhousedao/reactor
|
|
64
|
-
"@powerhousedao/reactor-
|
|
65
|
-
"@powerhousedao/reactor-
|
|
66
|
-
"@powerhousedao/
|
|
67
|
-
"@powerhousedao/
|
|
117
|
+
"@powerhousedao/host-core": "6.2.3-dev.71",
|
|
118
|
+
"@powerhousedao/powerhouse-vetra-packages": "6.2.3-dev.71",
|
|
119
|
+
"@powerhousedao/reactor": "6.2.3-dev.71",
|
|
120
|
+
"@powerhousedao/reactor-attachments": "6.2.3-dev.71",
|
|
121
|
+
"@powerhousedao/reactor-browser": "6.2.3-dev.71",
|
|
122
|
+
"@powerhousedao/reactor-mcp": "6.2.3-dev.71",
|
|
123
|
+
"@powerhousedao/reactor-router": "6.2.3-dev.71",
|
|
124
|
+
"@powerhousedao/shared": "6.2.3-dev.71",
|
|
125
|
+
"@powerhousedao/vetra": "6.2.3-dev.71",
|
|
126
|
+
"@powerhousedao/workflow": "6.2.3-dev.71",
|
|
68
127
|
"@privy-io/react-auth": "3.35.0",
|
|
69
128
|
"@rainbow-me/rainbowkit": "^2.2.11",
|
|
70
|
-
"@renown/sdk": "6.2.3-dev.
|
|
129
|
+
"@renown/sdk": "6.2.3-dev.71",
|
|
71
130
|
"@sentry/react": "^10.17.0",
|
|
131
|
+
"@tailwindcss/node": "4.2.2",
|
|
72
132
|
"@tanstack/react-query": "^5.90.2",
|
|
73
|
-
"
|
|
133
|
+
"@tanstack/react-router": "^1.170.41",
|
|
134
|
+
"document-model": "6.2.3-dev.71",
|
|
74
135
|
"i18next": "^25.5.3",
|
|
75
136
|
"kysely": "0.28.16",
|
|
76
137
|
"kysely-pglite-dialect": "1.2.0",
|
|
@@ -80,16 +141,17 @@
|
|
|
80
141
|
"react-error-boundary": "^4.0.11",
|
|
81
142
|
"react-hotkeys-hook": "^4.6.2",
|
|
82
143
|
"react-i18next": "^16.0.0",
|
|
83
|
-
"react-router-dom": "^6.11.2",
|
|
84
144
|
"tailwind-merge": "3.4.0",
|
|
85
145
|
"usehooks-ts": "^3.1.1",
|
|
86
146
|
"wagmi": "2.19.5",
|
|
87
|
-
"zod": "4.
|
|
147
|
+
"zod": "^4.5.4"
|
|
88
148
|
},
|
|
89
149
|
"devDependencies": {
|
|
90
|
-
"cross-env": "10.1.0",
|
|
91
150
|
"@tailwindcss/cli": "4.2.2",
|
|
92
151
|
"@tailwindcss/vite": "4.2.2",
|
|
152
|
+
"@tanstack/react-router-devtools": "1.167.2",
|
|
153
|
+
"@tanstack/router-core": "1.171.34",
|
|
154
|
+
"@tanstack/router-plugin": "1.168.42",
|
|
93
155
|
"@testing-library/dom": "^10.4.0",
|
|
94
156
|
"@testing-library/react": "^16.0.1",
|
|
95
157
|
"@types/bun": "1.3.8",
|
|
@@ -97,15 +159,15 @@
|
|
|
97
159
|
"@types/react": "19.2.14",
|
|
98
160
|
"@types/react-dom": "19.2.3",
|
|
99
161
|
"@types/wicg-file-system-access": "^2023.10.7",
|
|
100
|
-
"@vitejs/plugin-react": "6.
|
|
101
|
-
"
|
|
162
|
+
"@vitejs/plugin-react": "6.1.1",
|
|
163
|
+
"cross-env": "10.1.0",
|
|
102
164
|
"happy-dom": "^20.8.9",
|
|
103
165
|
"react": "19.2.6",
|
|
104
166
|
"react-dom": "19.2.6",
|
|
105
167
|
"tailwindcss": "4.2.2",
|
|
106
|
-
"tsdown": "0.
|
|
107
|
-
"
|
|
108
|
-
"vite
|
|
168
|
+
"tsdown": "0.23.0",
|
|
169
|
+
"typescript": "7.0.2",
|
|
170
|
+
"vite": "8.3.4",
|
|
109
171
|
"vite-tsconfig-paths": "6.1.1"
|
|
110
172
|
},
|
|
111
173
|
"peerDependencies": {
|
|
@@ -114,15 +176,15 @@
|
|
|
114
176
|
},
|
|
115
177
|
"scripts": {
|
|
116
178
|
"tsc": "tsc",
|
|
117
|
-
"lint": "
|
|
179
|
+
"lint": "cd ../.. && oxlint apps/connect",
|
|
118
180
|
"test": "vitest --run",
|
|
119
181
|
"dev": "vite dev",
|
|
120
|
-
"build": "pnpm run build:bundle && pnpm run build:css",
|
|
121
|
-
"build:bundle": "tsdown",
|
|
182
|
+
"build": "pnpm run build:bundle && pnpm run build:css && pnpm run build:shell",
|
|
183
|
+
"build:bundle": "tsdown && node scripts/assert-plugin-configs.mjs",
|
|
122
184
|
"build:css": "pnpm exec tailwindcss -i style.css -o dist/style.css",
|
|
185
|
+
"build:shell": "vite build --config vite.prerender.config.ts --logLevel warn && node scripts/prerender-shell.ts",
|
|
123
186
|
"build:debug": "cross-env PH_DEBUG_BUILD=true vite build",
|
|
124
187
|
"preview": "vite preview",
|
|
125
|
-
"cy:open": "cypress open",
|
|
126
188
|
"docker:build": "docker build -f ./Dockerfile --tag connect-test-dev --build-arg TAG=dev .",
|
|
127
189
|
"docker:run": "docker run -it -p 4000:4000 -v $(realpath ../../../monorepo):/monorepo -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf.template -e PH_CONNECT_BASE_PATH=/develop/powerhouse/connect -e PORT=4000 connect-test-dev"
|
|
128
190
|
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// Fails the build when dist/plugin-configs.js (or any chunk it imports)
|
|
2
|
+
// imports anything beyond its zod-only allowlist: the entry must load in
|
|
3
|
+
// Node (`ph run` validates plugin entry configs with it) and in a browser,
|
|
4
|
+
// so it may not reach React, the DOM app, or a Node built-in.
|
|
5
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const dist = path.join(
|
|
10
|
+
path.dirname(fileURLToPath(import.meta.url)),
|
|
11
|
+
"..",
|
|
12
|
+
"dist",
|
|
13
|
+
);
|
|
14
|
+
const ENTRY = "plugin-configs.js";
|
|
15
|
+
const ALLOWED = new Set([
|
|
16
|
+
"zod",
|
|
17
|
+
"@powerhousedao/shared/connect/connect-config-schema",
|
|
18
|
+
"@powerhousedao/shared/host-tokens",
|
|
19
|
+
]);
|
|
20
|
+
const IMPORT = /(?:\bfrom\s*|\bimport\s*\(?\s*)["']([^"']+)["']/g;
|
|
21
|
+
|
|
22
|
+
const failures = [];
|
|
23
|
+
const seen = new Set();
|
|
24
|
+
const queue = [ENTRY];
|
|
25
|
+
while (queue.length > 0) {
|
|
26
|
+
const file = queue.shift();
|
|
27
|
+
if (seen.has(file)) continue;
|
|
28
|
+
seen.add(file);
|
|
29
|
+
const full = path.join(dist, file);
|
|
30
|
+
if (!existsSync(full)) {
|
|
31
|
+
failures.push(`${file} is missing from dist/`);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
for (const [, specifier] of readFileSync(full, "utf8").matchAll(IMPORT)) {
|
|
35
|
+
if (specifier.startsWith(".")) {
|
|
36
|
+
queue.push(path.posix.join(path.posix.dirname(file), specifier));
|
|
37
|
+
} else if (!ALLOWED.has(specifier)) {
|
|
38
|
+
failures.push(`${file} imports "${specifier}"`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (failures.length > 0) {
|
|
44
|
+
console.error(`${ENTRY} must stay zod-only:\n ${failures.join("\n ")}`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
console.log(`${ENTRY} is zod-only (${seen.size} file(s))`);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Writes dist/shell{,-core}.html (#root's markup), dist/shell{,-core}-head.html (critical CSS + guard) and shell-plugins.json.
|
|
2
|
+
import { mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
import type * as Prerender from "../src/prerender/shell.tsx";
|
|
6
|
+
|
|
7
|
+
process.env.NODE_ENV = "production";
|
|
8
|
+
|
|
9
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
|
+
const prerenderDir = join(root, ".prerender");
|
|
11
|
+
const distDir = join(root, "dist");
|
|
12
|
+
|
|
13
|
+
type ShellVariant = "generic" | "core";
|
|
14
|
+
|
|
15
|
+
const FILE_PREFIX: Record<ShellVariant, string> = {
|
|
16
|
+
generic: "shell",
|
|
17
|
+
core: "shell-core",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const { renderShell, shellMarkup, shellCss, appShell, shellPlugins } =
|
|
21
|
+
(await import(
|
|
22
|
+
pathToFileURL(join(prerenderDir, "shell.js")).href
|
|
23
|
+
)) as typeof Prerender;
|
|
24
|
+
|
|
25
|
+
mkdirSync(distDir, { recursive: true });
|
|
26
|
+
|
|
27
|
+
const plugins = await shellPlugins();
|
|
28
|
+
const variants = ["core", ...Object.keys(plugins)] as ShellVariant[];
|
|
29
|
+
|
|
30
|
+
for (const variant of variants) {
|
|
31
|
+
const name = FILE_PREFIX[variant];
|
|
32
|
+
const markup = shellMarkup(await renderShell(variant));
|
|
33
|
+
// Connect's stylesheet, built for the markup's classes only.
|
|
34
|
+
const css = await shellCss(join(root, "style.css"), markup);
|
|
35
|
+
const shell = appShell(variant, variant, markup, css);
|
|
36
|
+
writeFileSync(join(distDir, `${name}.html`), shell.body);
|
|
37
|
+
writeFileSync(join(distDir, `${name}-head.html`), shell.head);
|
|
38
|
+
console.log(
|
|
39
|
+
`[connect] prerendered the ${variant} app shell: ${markup.length} B markup, ${shell.head.length} B head`,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Each plugin specifier to the shell it picks; core's has none.
|
|
44
|
+
writeFileSync(
|
|
45
|
+
join(distDir, "shell-plugins.json"),
|
|
46
|
+
JSON.stringify(
|
|
47
|
+
Object.fromEntries(
|
|
48
|
+
Object.entries(plugins).map(([variant, module]) => [module, variant]),
|
|
49
|
+
),
|
|
50
|
+
),
|
|
51
|
+
);
|
|
@@ -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.
|