@powerhousedao/shared 6.2.3-dev.9 → 6.2.3-dev.91
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/dist/action-id-DON1WCeY.d.ts +19 -0
- package/dist/action-id-DON1WCeY.d.ts.map +1 -0
- package/dist/analytics/index.d.ts +4 -4
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/analytics/index.js +25 -24
- package/dist/analytics/index.js.map +1 -1
- package/dist/clis/args/access-token.d.mts +15 -2
- package/dist/clis/args/access-token.d.mts.map +1 -0
- package/dist/clis/args/access-token.mjs +21 -1
- package/dist/clis/args/access-token.mjs.map +1 -0
- package/dist/clis/args/common-BpLj4peE.d.mts +186 -0
- package/dist/clis/args/common-BpLj4peE.d.mts.map +1 -0
- package/dist/clis/args/{common-CcYbXrBx.mjs → common-CBLen_yt.mjs} +58 -12
- package/dist/clis/args/common-CBLen_yt.mjs.map +1 -0
- package/dist/clis/args/common.d.mts +3 -2
- package/dist/clis/args/common.mjs +1 -1
- package/dist/clis/args/connect.d.mts +449 -2
- package/dist/clis/args/connect.d.mts.map +1 -0
- package/dist/clis/args/connect.mjs +202 -1
- package/dist/clis/args/connect.mjs.map +1 -0
- package/dist/clis/args/{generate-CA916Fvj.mjs → generate-a36SaAn4.mjs} +40 -2
- package/dist/clis/args/generate-a36SaAn4.mjs.map +1 -0
- package/dist/clis/args/generate.d.mts +102 -2
- package/dist/clis/args/generate.d.mts.map +1 -0
- package/dist/clis/args/generate.mjs +1 -1
- package/dist/clis/args/help-Cgh3krcq.d.mts +239 -0
- package/dist/clis/args/help-Cgh3krcq.d.mts.map +1 -0
- package/dist/clis/args/{help-Bqbgbalu.mjs → help-DnOa5Gr-.mjs} +67 -16
- package/dist/clis/args/help-DnOa5Gr-.mjs.map +1 -0
- package/dist/clis/args/help.d.mts +3 -2
- package/dist/clis/args/help.mjs +15 -1
- package/dist/clis/args/host.d.mts +23 -0
- package/dist/clis/args/host.d.mts.map +1 -0
- package/dist/clis/args/host.mjs +35 -0
- package/dist/clis/args/host.mjs.map +1 -0
- package/dist/clis/args/index.d.mts +23 -19
- package/dist/clis/args/index.mjs +22 -19
- package/dist/clis/args/init.d.mts +54 -2
- package/dist/clis/args/init.d.mts.map +1 -0
- package/dist/clis/args/init.mjs +71 -1
- package/dist/clis/args/init.mjs.map +1 -0
- package/dist/clis/args/inspect.d.mts +12 -2
- package/dist/clis/args/inspect.d.mts.map +1 -0
- package/dist/clis/args/inspect.mjs +14 -1
- package/dist/clis/args/inspect.mjs.map +1 -0
- package/dist/clis/args/install.d.mts +36 -2
- package/dist/clis/args/install.d.mts.map +1 -0
- package/dist/clis/args/install.mjs +31 -1
- package/dist/clis/args/install.mjs.map +1 -0
- package/dist/clis/args/keyframes.d.mts +25 -0
- package/dist/clis/args/keyframes.d.mts.map +1 -0
- package/dist/clis/args/keyframes.mjs +42 -0
- package/dist/clis/args/keyframes.mjs.map +1 -0
- package/dist/clis/args/list.d.mts +9 -2
- package/dist/clis/args/list.d.mts.map +1 -0
- package/dist/clis/args/list.mjs +6 -1
- package/dist/clis/args/list.mjs.map +1 -0
- package/dist/clis/args/login.d.mts +24 -2
- package/dist/clis/args/login.d.mts.map +1 -0
- package/dist/clis/args/login.mjs +39 -1
- package/dist/clis/args/login.mjs.map +1 -0
- package/dist/clis/args/mcp.d.mts +15 -0
- package/dist/clis/args/mcp.d.mts.map +1 -0
- package/dist/clis/args/mcp.mjs +22 -0
- package/dist/clis/args/mcp.mjs.map +1 -0
- package/dist/clis/args/migrate.d.mts +18 -2
- package/dist/clis/args/migrate.d.mts.map +1 -0
- package/dist/clis/args/migrate.mjs +27 -1
- package/dist/clis/args/migrate.mjs.map +1 -0
- package/dist/clis/args/publish.d.mts +15 -2
- package/dist/clis/args/publish.d.mts.map +1 -0
- package/dist/clis/args/publish.mjs +18 -1
- package/dist/clis/args/publish.mjs.map +1 -0
- package/dist/clis/args/registry.d.mts +16 -2
- package/dist/clis/args/registry.d.mts.map +1 -0
- package/dist/clis/args/registry.mjs +22 -1
- package/dist/clis/args/registry.mjs.map +1 -0
- package/dist/clis/args/run.d.mts +18 -0
- package/dist/clis/args/run.d.mts.map +1 -0
- package/dist/clis/args/run.mjs +28 -0
- package/dist/clis/args/run.mjs.map +1 -0
- package/dist/clis/args/service-IZ0Aq58z.d.mts +27 -0
- package/dist/clis/args/service-IZ0Aq58z.d.mts.map +1 -0
- package/dist/clis/args/service.d.mts +3 -2
- package/dist/clis/args/service.mjs +10 -1
- package/dist/clis/args/service.mjs.map +1 -0
- package/dist/clis/args/switchboard.d.mts +69 -2
- package/dist/clis/args/switchboard.d.mts.map +1 -0
- package/dist/clis/args/switchboard.mjs +84 -1
- package/dist/clis/args/switchboard.mjs.map +1 -0
- package/dist/clis/args/uninstall.d.mts +27 -2
- package/dist/clis/args/uninstall.d.mts.map +1 -0
- package/dist/clis/args/uninstall.mjs +15 -1
- package/dist/clis/args/uninstall.mjs.map +1 -0
- package/dist/clis/args/unpublish.d.mts +21 -2
- package/dist/clis/args/unpublish.d.mts.map +1 -0
- package/dist/clis/args/unpublish.mjs +29 -1
- package/dist/clis/args/unpublish.mjs.map +1 -0
- package/dist/clis/args/{vetra-b4KUu1Ax.mjs → vetra-DlAEC_Mv.mjs} +18 -2
- package/dist/clis/args/vetra-DlAEC_Mv.mjs.map +1 -0
- package/dist/clis/args/vetra.d.mts +113 -2
- package/dist/clis/args/vetra.d.mts.map +1 -0
- package/dist/clis/args/vetra.mjs +1 -1
- package/dist/clis/build-config-BM1RL4u_.mjs +309 -0
- package/dist/clis/build-config-BM1RL4u_.mjs.map +1 -0
- package/dist/clis/build-config.d.mts +71 -10616
- package/dist/clis/build-config.d.mts.map +1 -1
- package/dist/clis/build-config.mjs +2 -93
- package/dist/clis/build-pieces.d.mts +160 -0
- package/dist/clis/build-pieces.d.mts.map +1 -0
- package/dist/clis/build-pieces.mjs +549 -0
- package/dist/clis/build-pieces.mjs.map +1 -0
- package/dist/clis/command-names.d.mts +6 -2
- package/dist/clis/command-names.d.mts.map +1 -1
- package/dist/clis/command-names.mjs +9 -1
- package/dist/clis/command-names.mjs.map +1 -1
- package/dist/clis/constants.d.mts +3 -475
- package/dist/clis/constants.mjs +79 -21
- package/dist/clis/constants.mjs.map +1 -1
- package/dist/clis/definition-sources.d.mts +48 -0
- package/dist/clis/definition-sources.d.mts.map +1 -0
- package/dist/clis/definition-sources.mjs +89 -0
- package/dist/clis/definition-sources.mjs.map +1 -0
- package/dist/clis/definition-types-CiUH8dqg.d.mts +18 -0
- package/dist/clis/definition-types-CiUH8dqg.d.mts.map +1 -0
- package/dist/clis/feature-flags.d.mts +17 -0
- package/dist/clis/feature-flags.d.mts.map +1 -0
- package/dist/clis/feature-flags.mjs +21 -0
- package/dist/clis/feature-flags.mjs.map +1 -0
- package/dist/clis/index-DnZYG-8g.d.mts +11154 -0
- package/dist/clis/index-DnZYG-8g.d.mts.map +1 -0
- package/dist/clis/index.d.mts +3744 -1952
- package/dist/clis/index.d.mts.map +1 -1
- package/dist/clis/index.mjs +1362 -856
- package/dist/clis/index.mjs.map +1 -1
- package/dist/clis/package-style.d.mts +32 -0
- package/dist/clis/package-style.d.mts.map +1 -0
- package/dist/clis/package-style.mjs +102 -0
- package/dist/clis/package-style.mjs.map +1 -0
- package/dist/clis/ph-dir.d.mts +26 -0
- package/dist/clis/ph-dir.d.mts.map +1 -0
- package/dist/clis/ph-dir.mjs +37 -0
- package/dist/clis/ph-dir.mjs.map +1 -0
- package/dist/clis/project-env.d.mts +10 -4
- package/dist/clis/project-env.d.mts.map +1 -1
- package/dist/clis/project-env.mjs +16 -1
- package/dist/clis/project-env.mjs.map +1 -1
- package/dist/clis/project-ports.d.mts +5 -5
- package/dist/clis/project-ports.d.mts.map +1 -1
- package/dist/clis/project-ports.mjs +1 -1
- package/dist/clis/project-ports.mjs.map +1 -1
- package/dist/clis/rolldown-runtime-B4iAMlE-.mjs +35 -0
- package/dist/clis/services/telemetry.d.mts +7 -7
- package/dist/clis/services/telemetry.d.mts.map +1 -1
- package/dist/clis/services/telemetry.mjs.map +1 -1
- package/dist/clis/types-DNeGTpnB.d.mts +2493 -0
- package/dist/clis/types-DNeGTpnB.d.mts.map +1 -0
- package/dist/clis/utils.d.mts +4 -4
- package/dist/clis/utils.d.mts.map +1 -1
- package/dist/clis/utils.mjs.map +1 -1
- package/dist/{config-loader-B845Hidf.js → config-loader-B7SqNz8z.js} +50 -12
- package/dist/config-loader-B7SqNz8z.js.map +1 -0
- package/dist/connect/app-shell.d.ts +48 -0
- package/dist/connect/app-shell.d.ts.map +1 -0
- package/dist/connect/app-shell.js +90 -0
- package/dist/connect/app-shell.js.map +1 -0
- package/dist/connect/config-loader.d.ts +21 -8
- package/dist/connect/config-loader.d.ts.map +1 -1
- package/dist/connect/config-loader.js +2 -2
- package/dist/connect/connect-config-schema.d.ts +3 -0
- package/dist/connect/connect-config-schema.js +485 -0
- package/dist/connect/connect-config-schema.js.map +1 -0
- package/dist/connect/image-ref.d.ts +32 -0
- package/dist/connect/image-ref.d.ts.map +1 -0
- package/dist/connect/image-ref.js +80 -0
- package/dist/connect/image-ref.js.map +1 -0
- package/dist/connect/index.d.ts +226 -643
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +443 -507
- package/dist/connect/index.js.map +1 -1
- package/dist/connect/json-adapter.d.ts +3 -4
- package/dist/connect/json-adapter.d.ts.map +1 -1
- package/dist/connect/json-adapter.js.map +1 -1
- package/dist/connect/origin-placeholder.d.ts +52 -0
- package/dist/connect/origin-placeholder.d.ts.map +1 -0
- package/dist/connect/origin-placeholder.js +101 -0
- package/dist/connect/origin-placeholder.js.map +1 -0
- package/dist/connect-config-schema-UFEAoO5W.d.ts +1864 -0
- package/dist/connect-config-schema-UFEAoO5W.d.ts.map +1 -0
- package/dist/constants-5UFY_rXh.d.ts +9 -0
- package/dist/constants-5UFY_rXh.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -2
- package/dist/constants.js +22 -6
- package/dist/constants.js.map +1 -1
- package/dist/document-drive/index.d.ts +103 -101
- package/dist/document-drive/index.d.ts.map +1 -1
- package/dist/document-drive/index.js +41 -32
- package/dist/document-drive/index.js.map +1 -1
- package/dist/document-model/action-id.d.ts +3 -0
- package/dist/document-model/action-id.js +59 -0
- package/dist/document-model/action-id.js.map +1 -0
- package/dist/document-model/dispatch.d.ts +25 -0
- package/dist/document-model/dispatch.d.ts.map +1 -0
- package/dist/document-model/dispatch.js +0 -0
- package/dist/document-model/errors.d.ts +3 -0
- package/dist/document-model/errors.js +214 -0
- package/dist/document-model/errors.js.map +1 -0
- package/dist/document-model/index.d.ts +6 -4
- package/dist/document-model/index.js +7 -5144
- package/dist/document-model/mock.d.ts +2 -3
- package/dist/document-model/mock.d.ts.map +1 -1
- package/dist/document-model/mock.js +2 -1
- package/dist/document-model/mock.js.map +1 -1
- package/dist/document-model/utils.d.ts +4 -2
- package/dist/document-model/utils.js +3 -2
- package/dist/document-model/version.d.ts +3 -0
- package/dist/document-model/version.js +8 -0
- package/dist/document-model/version.js.map +1 -0
- package/dist/document-model-TCCW8aMC.js +5795 -0
- package/dist/document-model-TCCW8aMC.js.map +1 -0
- package/dist/host-tokens/index.d.ts +3 -0
- package/dist/host-tokens/index.js +2 -0
- package/dist/host-tokens-DOeyxqLi.js +322 -0
- package/dist/host-tokens-DOeyxqLi.js.map +1 -0
- package/dist/index-D58WVj_E.d.ts +246 -0
- package/dist/index-D58WVj_E.d.ts.map +1 -0
- package/dist/index-DD0XMv4t.d.ts +36 -0
- package/dist/index-DD0XMv4t.d.ts.map +1 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js.map +1 -1
- package/dist/processors/index.d.ts +3 -2
- package/dist/processors/index.js +180 -67
- package/dist/processors/index.js.map +1 -1
- package/dist/processors/testing.d.ts +22 -0
- package/dist/processors/testing.d.ts.map +1 -0
- package/dist/processors/testing.js +77 -0
- package/dist/processors/testing.js.map +1 -0
- package/dist/purge-CbAV5DVh.js +631 -0
- package/dist/purge-CbAV5DVh.js.map +1 -0
- package/dist/registry/index.d.ts +15 -15
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +64 -12
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest-slim.d.ts +4 -3
- package/dist/registry/manifest-slim.d.ts.map +1 -1
- package/dist/registry/manifest-slim.js +22 -2
- package/dist/registry/manifest-slim.js.map +1 -1
- package/dist/registry/updates.d.ts +3 -3
- package/dist/registry/updates.d.ts.map +1 -1
- package/dist/registry/updates.js.map +1 -1
- package/dist/registry/urls.d.ts +2 -2
- package/dist/registry/urls.d.ts.map +1 -1
- package/dist/registry/urls.js.map +1 -1
- package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/{types-C1in4fl3.d.ts → types-Bsp8VL2y.d.ts} +2 -2
- package/dist/types-Bsp8VL2y.d.ts.map +1 -0
- package/dist/{types-DDpRvBK_.d.ts → types-Btd9TO_L.d.ts} +39 -43
- package/dist/types-Btd9TO_L.d.ts.map +1 -0
- package/dist/types-Dp2OWq1-.d.ts +5710 -0
- package/dist/types-Dp2OWq1-.d.ts.map +1 -0
- package/dist/{utils-aaTmfxFW.js → utils-DiV32YIj.js} +53 -3
- package/dist/utils-DiV32YIj.js.map +1 -0
- package/dist/utils-MrLmLEVr.js +78 -0
- package/dist/utils-MrLmLEVr.js.map +1 -0
- package/dist/version-BxLITo9P.d.ts +6 -0
- package/dist/version-BxLITo9P.d.ts.map +1 -0
- package/package.json +38 -7
- package/dist/clis/args/access-token--9H57y8J.d.mts +0 -18
- package/dist/clis/args/access-token--9H57y8J.d.mts.map +0 -1
- package/dist/clis/args/access-token-To5LaIfL.mjs +0 -22
- package/dist/clis/args/access-token-To5LaIfL.mjs.map +0 -1
- package/dist/clis/args/common-CcYbXrBx.mjs.map +0 -1
- package/dist/clis/args/common-Dsf1vpHV.d.mts +0 -183
- package/dist/clis/args/common-Dsf1vpHV.d.mts.map +0 -1
- package/dist/clis/args/connect-BVVvCmL9.mjs +0 -198
- package/dist/clis/args/connect-BVVvCmL9.mjs.map +0 -1
- package/dist/clis/args/connect-DetTnI8g.d.mts +0 -443
- package/dist/clis/args/connect-DetTnI8g.d.mts.map +0 -1
- package/dist/clis/args/generate-CA916Fvj.mjs.map +0 -1
- package/dist/clis/args/generate-DnV-bfXt.d.mts +0 -87
- package/dist/clis/args/generate-DnV-bfXt.d.mts.map +0 -1
- package/dist/clis/args/help-Bqbgbalu.mjs.map +0 -1
- package/dist/clis/args/help-CjAsudUn.d.mts +0 -193
- package/dist/clis/args/help-CjAsudUn.d.mts.map +0 -1
- package/dist/clis/args/init-CUXyfquF.d.mts +0 -55
- package/dist/clis/args/init-CUXyfquF.d.mts.map +0 -1
- package/dist/clis/args/init-rz9Ei7nq.mjs +0 -67
- package/dist/clis/args/init-rz9Ei7nq.mjs.map +0 -1
- package/dist/clis/args/inspect-DtZeoA5c.d.mts +0 -15
- package/dist/clis/args/inspect-DtZeoA5c.d.mts.map +0 -1
- package/dist/clis/args/inspect-tckH8mSw.mjs +0 -15
- package/dist/clis/args/inspect-tckH8mSw.mjs.map +0 -1
- package/dist/clis/args/install-CkP8zcHb.d.mts +0 -40
- package/dist/clis/args/install-CkP8zcHb.d.mts.map +0 -1
- package/dist/clis/args/install-Sz2DlCHh.mjs +0 -32
- package/dist/clis/args/install-Sz2DlCHh.mjs.map +0 -1
- package/dist/clis/args/list-BGf8s_gj.d.mts +0 -12
- package/dist/clis/args/list-BGf8s_gj.d.mts.map +0 -1
- package/dist/clis/args/list-DM2d6f1m.mjs +0 -7
- package/dist/clis/args/list-DM2d6f1m.mjs.map +0 -1
- package/dist/clis/args/login-DNsHwvqk.d.mts +0 -27
- package/dist/clis/args/login-DNsHwvqk.d.mts.map +0 -1
- package/dist/clis/args/login-DiKT5Jfu.mjs +0 -40
- package/dist/clis/args/login-DiKT5Jfu.mjs.map +0 -1
- package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs +0 -1013
- package/dist/clis/args/magic-string.es-h_0HDQBQ.mjs.map +0 -1
- package/dist/clis/args/migrate-CG_gWc4k.mjs +0 -29
- package/dist/clis/args/migrate-CG_gWc4k.mjs.map +0 -1
- package/dist/clis/args/migrate-sixkWhxm.d.mts +0 -21
- package/dist/clis/args/migrate-sixkWhxm.d.mts.map +0 -1
- package/dist/clis/args/publish-DDZYsUfV.mjs +0 -19
- package/dist/clis/args/publish-DDZYsUfV.mjs.map +0 -1
- package/dist/clis/args/publish-Dqe5DUst.d.mts +0 -18
- package/dist/clis/args/publish-Dqe5DUst.d.mts.map +0 -1
- package/dist/clis/args/registry-C_OVFQmI.mjs +0 -23
- package/dist/clis/args/registry-C_OVFQmI.mjs.map +0 -1
- package/dist/clis/args/registry-C_RfTsKB.d.mts +0 -19
- package/dist/clis/args/registry-C_RfTsKB.d.mts.map +0 -1
- package/dist/clis/args/service-CHOOr0Gg.mjs +0 -11
- package/dist/clis/args/service-CHOOr0Gg.mjs.map +0 -1
- package/dist/clis/args/service-DhIkf8-O.d.mts +0 -22
- package/dist/clis/args/service-DhIkf8-O.d.mts.map +0 -1
- package/dist/clis/args/switchboard-BlPaq2at.d.mts +0 -72
- package/dist/clis/args/switchboard-BlPaq2at.d.mts.map +0 -1
- package/dist/clis/args/switchboard-Dsp7nosi.mjs +0 -85
- package/dist/clis/args/switchboard-Dsp7nosi.mjs.map +0 -1
- package/dist/clis/args/uninstall-BpA3YYbw.d.mts +0 -31
- package/dist/clis/args/uninstall-BpA3YYbw.d.mts.map +0 -1
- package/dist/clis/args/uninstall-CTwTX0u_.mjs +0 -16
- package/dist/clis/args/uninstall-CTwTX0u_.mjs.map +0 -1
- package/dist/clis/args/unpublish-BPMkGEg5.mjs +0 -30
- package/dist/clis/args/unpublish-BPMkGEg5.mjs.map +0 -1
- package/dist/clis/args/unpublish-CvwaIimG.d.mts +0 -24
- package/dist/clis/args/unpublish-CvwaIimG.d.mts.map +0 -1
- package/dist/clis/args/vetra-DLQ6lhLl.d.mts +0 -113
- package/dist/clis/args/vetra-DLQ6lhLl.d.mts.map +0 -1
- package/dist/clis/args/vetra-b4KUu1Ax.mjs.map +0 -1
- package/dist/clis/args/vetra-ports.test.d.mts +0 -1
- package/dist/clis/args/vetra-ports.test.mjs +0 -13249
- package/dist/clis/args/vetra-ports.test.mjs.map +0 -1
- package/dist/clis/build-config.mjs.map +0 -1
- package/dist/clis/constants.d.mts.map +0 -1
- package/dist/config-loader-B845Hidf.js.map +0 -1
- package/dist/constants-BP_gjn8g.d.ts +0 -8
- package/dist/constants-BP_gjn8g.d.ts.map +0 -1
- package/dist/document-model/index.js.map +0 -1
- package/dist/index-C_iVZe7f.d.ts +0 -7
- package/dist/index-C_iVZe7f.d.ts.map +0 -1
- package/dist/index-DP3QgHTq.d.ts +0 -836
- package/dist/index-DP3QgHTq.d.ts.map +0 -1
- package/dist/types-BIoOWpOT.d.ts +0 -3172
- package/dist/types-BIoOWpOT.d.ts.map +0 -1
- package/dist/types-C1in4fl3.d.ts.map +0 -1
- package/dist/types-DDpRvBK_.d.ts.map +0 -1
- package/dist/utils-DP122OSS.d.ts +0 -18
- package/dist/utils-DP122OSS.d.ts.map +0 -1
- package/dist/utils-aaTmfxFW.js.map +0 -1
package/dist/connect/index.js
CHANGED
|
@@ -1,6 +1,173 @@
|
|
|
1
|
-
import { i as
|
|
1
|
+
import { a as DEFAULT_CONNECT_CONFIG, i as workflowsSettingConflict, n as deepMerge, o as buildRuntimeConfig, r as resolveSourceConnect, t as ConfigLoader } from "../config-loader-B7SqNz8z.js";
|
|
2
2
|
import { JsonConfigAdapter } from "./json-adapter.js";
|
|
3
|
-
import {
|
|
3
|
+
import { connectAiSchema, connectAppSchema, connectBackgroundLayerSchema, connectBackgroundLayersSchema, connectBackgroundSchema, connectBrandingSchema, connectCollectionSchema, connectCompositionEntrySchema, connectConfigSchema, connectConfigSchemaWith, connectDefaultDriveLocalSchema, connectDefaultDriveRemoteSchema, connectDefaultDriveSchema, connectDrivePreserveStrategySchema, connectDriveSectionSchema, connectDriveSectionsSchema, connectDrivesSchema, connectEdgesSchema, connectExplorerIconsSchema, connectHomeSchema, connectImageRefSchema, connectInstanceSchema, connectLengthSchema, connectLoaderSchema, connectOpenPanelSchema, connectPackagesSchema, connectPwaCacheStrategySchema, connectPwaFileHandlerSchema, connectPwaIconSchema, connectPwaManifestSchema, connectPwaRuntimeCachingSchema, connectPwaSchema, connectPwaUrlPatternSchema, connectReactorClientModeSchema, connectReactorFeatureFlagsSchema, connectReactorSchema, connectRemoteBackendSchema, connectRenownAdaptersSchema, connectRenownPrivyAdapterSchema, connectRenownRainbowAdapterSchema, connectRenownSchema, connectRouterSettingsSchema, connectRuntimeConfigSchema, connectRuntimeDefaultDriveRemoteSchema, connectRuntimeDefaultDriveSchema, connectRuntimeDrivesSchema, connectRuntimeInstanceSchema, connectRuntimePwaManifestSchema, connectRuntimePwaSchema, connectSchemedColorSchema, connectSchemedImageSchema, connectSentrySchema, declaredConnectConfigSchema } from "./connect-config-schema.js";
|
|
4
|
+
import { toJSONSchema, z } from "zod";
|
|
5
|
+
import { satisfies, validRange } from "semver";
|
|
6
|
+
//#region connect/background.ts
|
|
7
|
+
const EDGES = [
|
|
8
|
+
"top",
|
|
9
|
+
"right",
|
|
10
|
+
"bottom",
|
|
11
|
+
"left"
|
|
12
|
+
];
|
|
13
|
+
/** A single image is one layer pinned to the bottom-right corner. */
|
|
14
|
+
function normalizeBackground(background) {
|
|
15
|
+
if (!background) return null;
|
|
16
|
+
if (typeof background === "string") return { layers: [{
|
|
17
|
+
src: background,
|
|
18
|
+
position: {
|
|
19
|
+
bottom: 0,
|
|
20
|
+
right: 0
|
|
21
|
+
}
|
|
22
|
+
}] };
|
|
23
|
+
return background;
|
|
24
|
+
}
|
|
25
|
+
/** The light image and, when it differs, the dark one. */
|
|
26
|
+
function imageVariants(src) {
|
|
27
|
+
if (typeof src === "string") return { light: src };
|
|
28
|
+
return src.dark && src.dark !== src.light ? {
|
|
29
|
+
light: src.light,
|
|
30
|
+
dark: src.dark
|
|
31
|
+
} : { light: src.light };
|
|
32
|
+
}
|
|
33
|
+
/** The light colour and, when it differs, the dark one. */
|
|
34
|
+
function colorVariants(color) {
|
|
35
|
+
if (!color) return null;
|
|
36
|
+
if (typeof color === "string") return { light: color };
|
|
37
|
+
return color.dark && color.dark !== color.light ? {
|
|
38
|
+
light: color.light,
|
|
39
|
+
dark: color.dark
|
|
40
|
+
} : { light: color.light };
|
|
41
|
+
}
|
|
42
|
+
/** A number is px; a string is a CSS length as written. */
|
|
43
|
+
function cssLength(length) {
|
|
44
|
+
return typeof length === "number" ? `${length}px` : length.trim();
|
|
45
|
+
}
|
|
46
|
+
const FADE_DIRECTION = {
|
|
47
|
+
top: "to bottom",
|
|
48
|
+
right: "to left",
|
|
49
|
+
bottom: "to top",
|
|
50
|
+
left: "to right"
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The CSS declarations (kebab-case) that place one layer inside a
|
|
54
|
+
* `position: relative` pane. The pane's content must come after the layers
|
|
55
|
+
* in the DOM (or carry a z-index) to paint above them.
|
|
56
|
+
*/
|
|
57
|
+
function layerDeclarations(layer) {
|
|
58
|
+
const out = {
|
|
59
|
+
position: "absolute",
|
|
60
|
+
"pointer-events": "none",
|
|
61
|
+
"object-fit": "contain"
|
|
62
|
+
};
|
|
63
|
+
const position = layer.position ?? {};
|
|
64
|
+
for (const edge of EDGES) {
|
|
65
|
+
const value = position[edge];
|
|
66
|
+
if (value !== void 0 && value !== null) out[edge] = cssLength(value);
|
|
67
|
+
}
|
|
68
|
+
const centreX = !("left" in out) && !("right" in out);
|
|
69
|
+
const centreY = !("top" in out) && !("bottom" in out);
|
|
70
|
+
if (centreX) out.left = "50%";
|
|
71
|
+
if (centreY) out.top = "50%";
|
|
72
|
+
if (centreX || centreY) out.transform = `translate(${centreX ? "-50%" : "0"}, ${centreY ? "-50%" : "0"})`;
|
|
73
|
+
for (const [key, property] of [
|
|
74
|
+
["width", "width"],
|
|
75
|
+
["height", "height"],
|
|
76
|
+
["minWidth", "min-width"],
|
|
77
|
+
["minHeight", "min-height"],
|
|
78
|
+
["maxWidth", "max-width"],
|
|
79
|
+
["maxHeight", "max-height"]
|
|
80
|
+
]) {
|
|
81
|
+
const value = layer[key];
|
|
82
|
+
if (value !== void 0 && value !== null) out[property] = cssLength(value);
|
|
83
|
+
}
|
|
84
|
+
if (layer.opacity !== void 0 && layer.opacity !== null) out.opacity = String(layer.opacity);
|
|
85
|
+
const fades = [];
|
|
86
|
+
for (const edge of EDGES) {
|
|
87
|
+
const depth = layer.fade?.[edge];
|
|
88
|
+
if (depth === void 0 || depth === null) continue;
|
|
89
|
+
fades.push(`linear-gradient(${FADE_DIRECTION[edge]}, transparent, #000 ${cssLength(depth)})`);
|
|
90
|
+
}
|
|
91
|
+
if (fades.length > 0) {
|
|
92
|
+
out["mask-image"] = fades.join(", ");
|
|
93
|
+
if (fades.length > 1) out["mask-composite"] = "intersect";
|
|
94
|
+
}
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
/** The declarations as one `style` attribute's text. */
|
|
98
|
+
function layerStyleText(layer) {
|
|
99
|
+
return Object.entries(layerDeclarations(layer)).map(([property, value]) => `${property}: ${value}`).join("; ");
|
|
100
|
+
}
|
|
101
|
+
/** The same declarations with the camelCase keys React's `style` takes. */
|
|
102
|
+
function layerStyle(layer) {
|
|
103
|
+
return Object.fromEntries(Object.entries(layerDeclarations(layer)).map(([property, value]) => [property.replace(/-([a-z])/g, (_, c) => c.toUpperCase()), value]));
|
|
104
|
+
}
|
|
105
|
+
function edgesConflict(edges) {
|
|
106
|
+
if (!edges) return null;
|
|
107
|
+
const set = (edge) => edges[edge] !== void 0 && edges[edge] !== null;
|
|
108
|
+
if (set("top") && set("bottom")) return "set top or bottom, not both";
|
|
109
|
+
if (set("left") && set("right")) return "set left or right, not both";
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
/** What is wrong with a background, one message per problem; empty when it
|
|
113
|
+
* is usable. `at` names the field in the messages. */
|
|
114
|
+
function validateBackground(background, at = "background") {
|
|
115
|
+
const problems = [];
|
|
116
|
+
(normalizeBackground(background)?.layers ?? []).forEach((layer, index) => {
|
|
117
|
+
const where = `${at}.layers[${index}]`;
|
|
118
|
+
if (!(typeof layer.src === "string" ? layer.src : layer.src.light)) problems.push(`${where}.src: an image is required`);
|
|
119
|
+
const conflict = edgesConflict(layer.position);
|
|
120
|
+
if (conflict) problems.push(`${where}.position: ${conflict}`);
|
|
121
|
+
if (layer.opacity !== void 0 && layer.opacity !== null && !(layer.opacity >= 0 && layer.opacity <= 1)) problems.push(`${where}.opacity: must be between 0 and 1`);
|
|
122
|
+
});
|
|
123
|
+
return problems;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* The background with every image reference mapped (resolved to a data URI,
|
|
127
|
+
* rebased to another directory, …). A layer whose light image maps to
|
|
128
|
+
* undefined is dropped; a dark image that does falls back to the light one.
|
|
129
|
+
*/
|
|
130
|
+
function mapBackgroundImages(background, map) {
|
|
131
|
+
const layers = [];
|
|
132
|
+
for (const layer of background.layers) {
|
|
133
|
+
const variants = imageVariants(layer.src);
|
|
134
|
+
const light = map(variants.light);
|
|
135
|
+
if (!light) continue;
|
|
136
|
+
const dark = variants.dark ? map(variants.dark) : void 0;
|
|
137
|
+
layers.push({
|
|
138
|
+
...layer,
|
|
139
|
+
src: dark ? {
|
|
140
|
+
light,
|
|
141
|
+
dark
|
|
142
|
+
} : light
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
...background,
|
|
147
|
+
layers
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region connect/dynamic-base.ts
|
|
152
|
+
/**
|
|
153
|
+
* The base a dynamic-base Connect build is compiled against. The build emits
|
|
154
|
+
* this literal wherever a base-relative URL would go, and the serving layer
|
|
155
|
+
* (the dynamic-base vite plugin at build time, the connect proxy at serve
|
|
156
|
+
* time) rewrites it to the base the app is actually deployed under.
|
|
157
|
+
*
|
|
158
|
+
* It lives here, in the browser-safe shared package, rather than in
|
|
159
|
+
* `@powerhousedao/builder-tools`, because both the node-only build toolchain
|
|
160
|
+
* and Connect's own browser code need it. Importing builder-tools from app
|
|
161
|
+
* code pulls the whole build toolchain (and its node-only `read-pkg`
|
|
162
|
+
* dependency) into the browser graph.
|
|
163
|
+
*/
|
|
164
|
+
const DYNAMIC_BASE_PLACEHOLDER = "/__PH_DYNAMIC_BASE__/";
|
|
165
|
+
const PLACEHOLDER_TOKEN = /\/__PH_DYNAMIC_BASE__\//;
|
|
166
|
+
/** Swaps a build-time placeholder in `url` for `runtimeBase`; URLs without one pass through. */
|
|
167
|
+
function resolveDynamicBaseUrl(url, runtimeBase) {
|
|
168
|
+
return url.replace(PLACEHOLDER_TOKEN, runtimeBase);
|
|
169
|
+
}
|
|
170
|
+
//#endregion
|
|
4
171
|
//#region connect/env-config.ts
|
|
5
172
|
/**
|
|
6
173
|
* Coerces string values to boolean.
|
|
@@ -14,10 +181,26 @@ const booleanString = z.union([z.boolean(), z.enum(["true", "false"])]).transfor
|
|
|
14
181
|
* Build-time configuration schema
|
|
15
182
|
*/
|
|
16
183
|
const buildEnvSchema = z.object({
|
|
184
|
+
/**
|
|
185
|
+
* Comma-separated list of package names to load
|
|
186
|
+
* @example "package1,package2"
|
|
187
|
+
*/
|
|
17
188
|
PH_PACKAGES: z.string().optional(),
|
|
189
|
+
/**
|
|
190
|
+
* Path to local package to load during development
|
|
191
|
+
*/
|
|
18
192
|
PH_LOCAL_PACKAGE: z.string().optional(),
|
|
193
|
+
/**
|
|
194
|
+
* Sentry authentication token for uploading source maps
|
|
195
|
+
*/
|
|
19
196
|
PH_SENTRY_AUTH_TOKEN: z.string().optional(),
|
|
197
|
+
/**
|
|
198
|
+
* Sentry organization slug
|
|
199
|
+
*/
|
|
20
200
|
PH_SENTRY_ORG: z.string().optional(),
|
|
201
|
+
/**
|
|
202
|
+
* Sentry project slug
|
|
203
|
+
*/
|
|
21
204
|
PH_SENTRY_PROJECT: z.string().optional()
|
|
22
205
|
});
|
|
23
206
|
/**
|
|
@@ -30,7 +213,14 @@ const buildEnvSchema = z.object({
|
|
|
30
213
|
* credentials, analytics processor toggles, etc.
|
|
31
214
|
*/
|
|
32
215
|
const appConfigSchema = z.object({
|
|
216
|
+
/**
|
|
217
|
+
* Application version number (build metadata stamp)
|
|
218
|
+
* @default "unknown"
|
|
219
|
+
*/
|
|
33
220
|
PH_CONNECT_VERSION: z.string().default("unknown"),
|
|
221
|
+
/**
|
|
222
|
+
* CLI version number (build metadata stamp)
|
|
223
|
+
*/
|
|
34
224
|
PH_CONNECT_CLI_VERSION: z.string().optional()
|
|
35
225
|
});
|
|
36
226
|
/**
|
|
@@ -39,17 +229,43 @@ const appConfigSchema = z.object({
|
|
|
39
229
|
* schema and stay env-driven.
|
|
40
230
|
*/
|
|
41
231
|
const processorsConfigSchema = z.object({
|
|
232
|
+
/**
|
|
233
|
+
* Enable diff analytics tracking
|
|
234
|
+
* @default false
|
|
235
|
+
*/
|
|
42
236
|
PH_CONNECT_DIFF_ANALYTICS_ENABLED: booleanString.default(false),
|
|
237
|
+
/**
|
|
238
|
+
* Enable drive analytics tracking
|
|
239
|
+
* @default true
|
|
240
|
+
*/
|
|
43
241
|
PH_CONNECT_DRIVE_ANALYTICS_ENABLED: booleanString.default(true),
|
|
242
|
+
/**
|
|
243
|
+
* Enable external analytics processors
|
|
244
|
+
* @default true
|
|
245
|
+
*/
|
|
44
246
|
PH_CONNECT_EXTERNAL_ANALYTICS_PROCESSORS_ENABLED: booleanString.default(true)
|
|
45
247
|
});
|
|
46
248
|
/**
|
|
47
249
|
* OpenPanel analytics configuration schema
|
|
48
250
|
*/
|
|
49
251
|
const openPanelConfigSchema = z.object({
|
|
252
|
+
/**
|
|
253
|
+
* OpenPanel client ID. When unset, the OpenPanel subsystem is a no-op.
|
|
254
|
+
*/
|
|
50
255
|
PH_CONNECT_OPENPANEL_CLIENT_ID: z.string().optional(),
|
|
256
|
+
/**
|
|
257
|
+
* OpenPanel API URL override. Defaults to the OpenPanel cloud when unset.
|
|
258
|
+
*/
|
|
51
259
|
PH_CONNECT_OPENPANEL_API_URL: z.string().optional(),
|
|
260
|
+
/**
|
|
261
|
+
* Track UI events via the useOpenPanel() hook
|
|
262
|
+
* @default true
|
|
263
|
+
*/
|
|
52
264
|
PH_CONNECT_OPENPANEL_TRACK_UI_EVENTS: booleanString.default(true),
|
|
265
|
+
/**
|
|
266
|
+
* Track document operations via the OpenPanel processor
|
|
267
|
+
* @default true
|
|
268
|
+
*/
|
|
53
269
|
PH_CONNECT_OPENPANEL_TRACK_OPERATIONS: booleanString.default(true)
|
|
54
270
|
});
|
|
55
271
|
/**
|
|
@@ -108,7 +324,7 @@ function mergeEnvSources(options, keys, schema) {
|
|
|
108
324
|
* @returns Validated and typed environment configuration
|
|
109
325
|
*/
|
|
110
326
|
function loadConnectEnv(options = {}) {
|
|
111
|
-
const merged = mergeEnvSources(options, new Set([...Object.keys(buildEnvSchema.shape), ...Object.keys(runtimeEnvSchema.shape)]), connectEnvSchema);
|
|
327
|
+
const merged = mergeEnvSources(options, /* @__PURE__ */ new Set([...Object.keys(buildEnvSchema.shape), ...Object.keys(runtimeEnvSchema.shape)]), connectEnvSchema);
|
|
112
328
|
return connectEnvSchema.parse(merged);
|
|
113
329
|
}
|
|
114
330
|
/**
|
|
@@ -207,9 +423,15 @@ const ROOT_STORAGE_NAMESPACE = "reactor";
|
|
|
207
423
|
function getStorageNamespace(basePath) {
|
|
208
424
|
const normalized = normalizeBasePath(basePath);
|
|
209
425
|
if (normalized === "/") return ROOT_STORAGE_NAMESPACE;
|
|
210
|
-
|
|
426
|
+
const slug = normalized.slice(1, -1).toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
427
|
+
return `${ROOT_STORAGE_NAMESPACE}--${slug || "default"}`;
|
|
211
428
|
}
|
|
212
429
|
//#endregion
|
|
430
|
+
//#region connect/layers.ts
|
|
431
|
+
/** Connect's cascade layers, Tailwind's `properties` first: package CSS goes in
|
|
432
|
+
* external-packages, above Connect's reset and below its utilities. */
|
|
433
|
+
const CONNECT_LAYER_ORDER = "@layer properties, theme, base, components, external-packages, utilities;";
|
|
434
|
+
//#endregion
|
|
213
435
|
//#region connect/pwa-config.ts
|
|
214
436
|
const MANIFEST_SCALAR_KEYS = [
|
|
215
437
|
"name",
|
|
@@ -222,7 +444,7 @@ const MANIFEST_SCALAR_KEYS = [
|
|
|
222
444
|
"scope",
|
|
223
445
|
"launch_handler"
|
|
224
446
|
];
|
|
225
|
-
const ADDITIVE_MANIFEST_KEYS = new Set([
|
|
447
|
+
const ADDITIVE_MANIFEST_KEYS = /* @__PURE__ */ new Set([
|
|
226
448
|
"icons",
|
|
227
449
|
"file_handlers",
|
|
228
450
|
"categories"
|
|
@@ -370,6 +592,17 @@ function mergePwaConfig(packageContributions, projectConfig, onWarn = () => {})
|
|
|
370
592
|
function toRegExpOrString(pattern) {
|
|
371
593
|
return typeof pattern === "string" ? pattern : new RegExp(pattern.source, pattern.flags);
|
|
372
594
|
}
|
|
595
|
+
const FILE_PATH = /\.(?!html?$)[a-z0-9]+$/i;
|
|
596
|
+
/**
|
|
597
|
+
* Whether the service worker answers a navigation to `pathname` with the app
|
|
598
|
+
* shell. A request for a file, one with an extension or one of the project's
|
|
599
|
+
* static files (`staticFiles`, relative to `scopePath`), gets the file instead.
|
|
600
|
+
*/
|
|
601
|
+
function isAppShellNavigation(pathname, scopePath, staticFiles) {
|
|
602
|
+
if (FILE_PATH.test(pathname)) return false;
|
|
603
|
+
const path = pathname.startsWith(scopePath) ? pathname.slice(scopePath.length) : pathname;
|
|
604
|
+
return !staticFiles.includes(path.replace(/^\/+/, ""));
|
|
605
|
+
}
|
|
373
606
|
//#endregion
|
|
374
607
|
//#region connect/pwa-manifest.ts
|
|
375
608
|
/**
|
|
@@ -459,511 +692,214 @@ const powerhousePackageSchema = {
|
|
|
459
692
|
}
|
|
460
693
|
}
|
|
461
694
|
};
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
695
|
+
/** Emits a zod schema as a draft-07 fragment: input shape, no `$schema`. */
|
|
696
|
+
function emitJsonSchemaFragment(schema) {
|
|
697
|
+
const { $schema: _, ...fragment } = toJSONSchema(schema, {
|
|
698
|
+
target: "draft-7",
|
|
699
|
+
io: "input",
|
|
700
|
+
unrepresentable: "throw"
|
|
701
|
+
});
|
|
702
|
+
return fragment;
|
|
703
|
+
}
|
|
704
|
+
/** `schema` or null, keeping its description on the outer node. */
|
|
705
|
+
function orNull(schema) {
|
|
706
|
+
const nullable = schema.nullable();
|
|
707
|
+
return schema.description ? nullable.describe(schema.description) : nullable;
|
|
708
|
+
}
|
|
709
|
+
/** One image of a decorated pane. */
|
|
710
|
+
const phBackgroundLayerSchema = /* @__PURE__ */ emitJsonSchemaFragment(connectBackgroundLayerSchema);
|
|
711
|
+
/** A pane's background: layers over a page colour, or one image. */
|
|
712
|
+
const phBackgroundSchema = /* @__PURE__ */ emitJsonSchemaFragment(/* @__PURE__ */ orNull(connectBackgroundSchema));
|
|
713
|
+
/** The drive explorer's icons (the generic plugin's). */
|
|
714
|
+
const phConnectExplorerIconsSchema = /* @__PURE__ */ emitJsonSchemaFragment(/* @__PURE__ */ orNull(connectExplorerIconsSchema));
|
|
715
|
+
/** `connect.branding`. */
|
|
716
|
+
const phConnectBrandingSchema = /* @__PURE__ */ emitJsonSchemaFragment(connectBrandingSchema);
|
|
717
|
+
/** `connect.home`. */
|
|
718
|
+
const phConnectHomeSchema = /* @__PURE__ */ emitJsonSchemaFragment(connectHomeSchema);
|
|
719
|
+
/** The authored `connect` block, as validated by Ajv. */
|
|
720
|
+
const phConnectRuntimeConfigSchema = /* @__PURE__ */ emitJsonSchemaFragment(connectConfigSchema);
|
|
721
|
+
//#endregion
|
|
722
|
+
//#region connect/shared-deps.ts
|
|
723
|
+
/**
|
|
724
|
+
* The dependency set Connect and loaded packages share via the import map.
|
|
725
|
+
* `@powerhousedao/connect` is deliberately absent: it is the Connect app, not
|
|
726
|
+
* vendored (a host with routes compiles its files), so its exports are for a
|
|
727
|
+
* host's own routes and layout. Packages share `@powerhousedao/connect-core`.
|
|
728
|
+
*/
|
|
729
|
+
const SHARED_DEPS = [
|
|
730
|
+
{
|
|
731
|
+
specifier: "document-model",
|
|
732
|
+
package: "document-model"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
specifier: "@powerhousedao/document-engineering",
|
|
736
|
+
package: "@powerhousedao/document-engineering"
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
specifier: "@powerhousedao/shared",
|
|
740
|
+
package: "@powerhousedao/shared"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
specifier: "@powerhousedao/shared/registry/urls",
|
|
744
|
+
package: "@powerhousedao/shared"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
specifier: "@powerhousedao/design-system/connect",
|
|
748
|
+
package: "@powerhousedao/design-system"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
specifier: "@powerhousedao/reactor-browser",
|
|
752
|
+
package: "@powerhousedao/reactor-browser"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
specifier: "zod",
|
|
756
|
+
package: "zod"
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
specifier: "@powerhousedao/connect-core",
|
|
760
|
+
package: "@powerhousedao/connect-core"
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
specifier: "@tanstack/react-router",
|
|
764
|
+
package: "@tanstack/react-router"
|
|
482
765
|
}
|
|
483
|
-
|
|
484
|
-
const
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
766
|
+
];
|
|
767
|
+
const SHARED_DEP_SPECIFIERS = SHARED_DEPS.map((d) => d.specifier);
|
|
768
|
+
/**
|
|
769
|
+
* The `@powerhousedao/shared` subpaths the production vendor bundles. The
|
|
770
|
+
* bare root is deliberately absent: its type barrel references node-only
|
|
771
|
+
* modules (`clis/`), which the current vite/rolldown cannot bundle for the
|
|
772
|
+
* browser — vendoring the root fails the build (a pre-existing latent
|
|
773
|
+
* issue). A package that imports the bare root is simply not shared; it
|
|
774
|
+
* bundles its own copy.
|
|
775
|
+
*/
|
|
776
|
+
const SHARED_SUBPATHS = [
|
|
777
|
+
"connect",
|
|
778
|
+
"document-model",
|
|
779
|
+
"processors",
|
|
780
|
+
"document-drive",
|
|
781
|
+
"registry",
|
|
782
|
+
"registry/urls",
|
|
783
|
+
"registry/manifest-slim"
|
|
784
|
+
];
|
|
785
|
+
/**
|
|
786
|
+
* The specifiers a package build may safely externalize onto the host's
|
|
787
|
+
* import map — i.e. the ones the vendor actually publishes an entry for.
|
|
788
|
+
*
|
|
789
|
+
* `@powerhousedao/shared` is narrowed to SHARED_SUBPATHS rather than taken as
|
|
790
|
+
* a prefix: the bare root is never vendored (see SHARED_SUBPATHS), and
|
|
791
|
+
* neither are its other subpaths (`analytics`, `constants`, `clis`, ...).
|
|
792
|
+
* Externalizing those would leave a bare specifier in the package's output
|
|
793
|
+
* that nothing in the import map resolves, so the package would fail to load
|
|
794
|
+
* at runtime instead of simply bundling its own copy.
|
|
795
|
+
*/
|
|
796
|
+
const EXTERNALIZABLE_SHARED_SPECIFIERS = [.../* @__PURE__ */ new Set([...SHARED_DEP_SPECIFIERS.filter((s) => s !== "@powerhousedao/shared"), ...SHARED_SUBPATHS.map((s) => `@powerhousedao/shared/${s}`)])];
|
|
797
|
+
/** Split a specifier into its package name and subpath ("" for a root). */
|
|
798
|
+
function parseDepSpec(spec) {
|
|
799
|
+
if (spec.startsWith("@")) {
|
|
800
|
+
const parts = spec.split("/");
|
|
801
|
+
return {
|
|
802
|
+
pkg: parts.slice(0, 2).join("/"),
|
|
803
|
+
sub: parts.slice(2).join("/")
|
|
804
|
+
};
|
|
511
805
|
}
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
"info",
|
|
543
|
-
"warn",
|
|
544
|
-
"error"
|
|
545
|
-
],
|
|
546
|
-
description: "Log level applied by Connect's logger at boot. Affects browser-side output only.",
|
|
547
|
-
default: "info"
|
|
548
|
-
},
|
|
549
|
-
basePath: {
|
|
550
|
-
type: "string",
|
|
551
|
-
description: "Base path Connect is mounted under (e.g. '/connect' for subpath deploys). Normalised at runtime to start and end with '/'. Defaults to the build-time BASE_URL.",
|
|
552
|
-
default: "/"
|
|
553
|
-
},
|
|
554
|
-
offline: {
|
|
555
|
-
type: "boolean",
|
|
556
|
-
description: "When true (default), the build emits a precaching service worker so Connect's app shell works offline, and the SPA registers it at boot. Set false to opt this deployment out: no service worker is built, the SPA skips registration, and any previously-installed worker is unregistered.",
|
|
557
|
-
default: true
|
|
558
|
-
},
|
|
559
|
-
studioMode: {
|
|
560
|
-
type: "boolean",
|
|
561
|
-
description: "Studio mode. Enables builder-only capabilities: Connect loads the vetra package and exposes DocumentModel (and vetra spec types) as creatable documents. Forced on by `ph vetra` / `ph connect studio`; false by default.",
|
|
562
|
-
default: false
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
},
|
|
566
|
-
ai: {
|
|
567
|
-
type: "object",
|
|
568
|
-
additionalProperties: false,
|
|
569
|
-
description: "AI assistant (chat) behaviour.",
|
|
570
|
-
properties: { assistantEnabled: {
|
|
571
|
-
type: "boolean",
|
|
572
|
-
description: "When true, Connect mounts the in-browser AI assistant (bottom-right chat FAB that talks to a user-configured OpenAI-compatible endpoint and acts on the reactor). Disabled by default.",
|
|
573
|
-
default: false
|
|
574
|
-
} }
|
|
575
|
-
},
|
|
576
|
-
packages: {
|
|
577
|
-
type: "object",
|
|
578
|
-
additionalProperties: false,
|
|
579
|
-
description: "Runtime behaviour for the Connect package manager (separate from top-level `packages[]`, which lists which packages to load).",
|
|
580
|
-
properties: {
|
|
581
|
-
externalEnabled: {
|
|
582
|
-
type: "boolean",
|
|
583
|
-
description: "When false, Connect refuses to load any package that wasn't bundled at build time. Affirmative replacement for the legacy PH_CONNECT_EXTERNAL_PACKAGES_DISABLED env var.",
|
|
584
|
-
default: true
|
|
585
|
-
},
|
|
586
|
-
liveReload: {
|
|
587
|
-
type: "boolean",
|
|
588
|
-
description: "When true, Connect subscribes to the static-mode `/__packages` SSE channel so live publishes flow into the running tab without a page reload. Only works under hosting that serves this channel (e.g. ph-clint static mode).",
|
|
589
|
-
default: false
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
},
|
|
593
|
-
drives: {
|
|
594
|
-
type: "object",
|
|
595
|
-
additionalProperties: false,
|
|
596
|
-
description: "Default-drive and add-drive UI behaviour.",
|
|
597
|
-
properties: {
|
|
598
|
-
allowAddDrive: {
|
|
599
|
-
type: "boolean",
|
|
600
|
-
description: "When false, the SPA hides the 'add drive' affordance entirely (top-level). Per-section overrides live in `sections.{remote,local}.allowAdd`.",
|
|
601
|
-
default: true
|
|
602
|
-
},
|
|
603
|
-
defaultDrives: {
|
|
604
|
-
type: "array",
|
|
605
|
-
description: "Drives the SPA auto-connects to on first load. Each entry is either a remote drive (a URL, with optional name/icon overrides) or a local drive (created locally on first boot, with a stable id and optional name/icon/app).",
|
|
606
|
-
default: [],
|
|
607
|
-
items: { oneOf: [{
|
|
608
|
-
type: "object",
|
|
609
|
-
additionalProperties: false,
|
|
610
|
-
required: ["url"],
|
|
611
|
-
properties: {
|
|
612
|
-
url: { type: "string" },
|
|
613
|
-
name: { type: ["string", "null"] },
|
|
614
|
-
icon: { type: ["string", "null"] }
|
|
615
|
-
}
|
|
616
|
-
}, {
|
|
617
|
-
type: "object",
|
|
618
|
-
additionalProperties: false,
|
|
619
|
-
required: ["local", "id"],
|
|
620
|
-
properties: {
|
|
621
|
-
local: {
|
|
622
|
-
const: true,
|
|
623
|
-
description: "Discriminator: this entry is a local drive created on first boot."
|
|
624
|
-
},
|
|
625
|
-
id: {
|
|
626
|
-
type: "string",
|
|
627
|
-
description: "Stable drive id. The drive is created with this id on first boot and is not re-created on later boots."
|
|
628
|
-
},
|
|
629
|
-
name: { type: ["string", "null"] },
|
|
630
|
-
icon: { type: ["string", "null"] },
|
|
631
|
-
app: {
|
|
632
|
-
type: "string",
|
|
633
|
-
description: "Drive app (preferred editor) to open on the drive."
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
}] }
|
|
637
|
-
},
|
|
638
|
-
preserveStrategy: {
|
|
639
|
-
type: "string",
|
|
640
|
-
enum: ["preserve-all", "preserve-by-url-and-detach"],
|
|
641
|
-
description: "Strategy applied when defaultDrives change between deploys. 'preserve-all' keeps user-added drives untouched; 'preserve-by-url-and-detach' detaches removed default drives. No schema default — opt-in only."
|
|
642
|
-
},
|
|
643
|
-
sections: {
|
|
644
|
-
type: "object",
|
|
645
|
-
additionalProperties: false,
|
|
646
|
-
description: "Per-section visibility and affordance toggles. `remote` covers what was historically split into 'public' + 'cloud'; `local` is browser-local drives.",
|
|
647
|
-
properties: {
|
|
648
|
-
remote: driveSectionSchema,
|
|
649
|
-
local: driveSectionSchema
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
},
|
|
654
|
-
renown: {
|
|
655
|
-
type: "object",
|
|
656
|
-
additionalProperties: false,
|
|
657
|
-
description: "Renown identity / authentication coordinates.",
|
|
658
|
-
properties: {
|
|
659
|
-
url: {
|
|
660
|
-
type: "string",
|
|
661
|
-
description: "Renown auth service URL.",
|
|
662
|
-
default: "https://www.renown.id"
|
|
663
|
-
},
|
|
664
|
-
networkId: {
|
|
665
|
-
type: "string",
|
|
666
|
-
description: "CAIP-2 network namespace (e.g. 'eip155').",
|
|
667
|
-
default: "eip155"
|
|
668
|
-
},
|
|
669
|
-
chainId: {
|
|
670
|
-
type: "number",
|
|
671
|
-
description: "CAIP-2 chain reference within the network namespace.",
|
|
672
|
-
default: 1
|
|
673
|
-
},
|
|
674
|
-
namespace: {
|
|
675
|
-
type: "string",
|
|
676
|
-
description: "Renown localStorage namespace; share it across Connects to share login."
|
|
677
|
-
},
|
|
678
|
-
switchboardUrl: {
|
|
679
|
-
type: "string",
|
|
680
|
-
description: "Switchboard GraphQL URL. When set, Connect enables in-page (no-redirect) Renown sign-in; otherwise it falls back to the redirect flow via `url`."
|
|
681
|
-
},
|
|
682
|
-
adapters: {
|
|
683
|
-
type: "object",
|
|
684
|
-
additionalProperties: false,
|
|
685
|
-
description: "Per-adapter wallet config for in-page auth. Presence of an adapter key enables it; omit or leave empty for redirect-only behaviour.",
|
|
686
|
-
properties: {
|
|
687
|
-
rainbow: {
|
|
688
|
-
type: "object",
|
|
689
|
-
additionalProperties: false,
|
|
690
|
-
description: "wagmi + RainbowKit external-wallet adapter config.",
|
|
691
|
-
properties: {
|
|
692
|
-
walletConnectProjectId: {
|
|
693
|
-
type: "string",
|
|
694
|
-
description: "WalletConnect project id; required for this adapter to function."
|
|
695
|
-
},
|
|
696
|
-
infuraProjectId: {
|
|
697
|
-
type: "string",
|
|
698
|
-
description: "Optional Infura project id used to build RPC transports."
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
},
|
|
702
|
-
privy: {
|
|
703
|
-
type: "object",
|
|
704
|
-
additionalProperties: false,
|
|
705
|
-
description: "Privy embedded/social adapter config.",
|
|
706
|
-
properties: {
|
|
707
|
-
appId: {
|
|
708
|
-
type: "string",
|
|
709
|
-
description: "Privy application id; required for this adapter to function."
|
|
710
|
-
},
|
|
711
|
-
clientId: {
|
|
712
|
-
type: "string",
|
|
713
|
-
description: "Optional Privy client id."
|
|
714
|
-
},
|
|
715
|
-
methods: {
|
|
716
|
-
type: "array",
|
|
717
|
-
description: "Login methods this adapter offers; default per adapter when omitted.",
|
|
718
|
-
items: { type: "string" }
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
}
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
sentry: {
|
|
727
|
-
type: "object",
|
|
728
|
-
additionalProperties: false,
|
|
729
|
-
description: "Sentry error-tracking coordinates. Set `dsn` to enable Sentry; leave `dsn` null to disable. The Sentry release tag stays build-time (stamped via Vite's `define` from WORKSPACE_VERSION) so it always matches the sourcemaps uploaded by CI.",
|
|
730
|
-
properties: {
|
|
731
|
-
dsn: {
|
|
732
|
-
type: ["string", "null"],
|
|
733
|
-
description: "Sentry DSN URL. `null` disables Sentry entirely; the SPA never loads the Sentry SDK chunk.",
|
|
734
|
-
default: null
|
|
735
|
-
},
|
|
736
|
-
env: {
|
|
737
|
-
type: "string",
|
|
738
|
-
description: "Sentry environment label, surfaced as the `environment` tag on every event.",
|
|
739
|
-
default: "dev"
|
|
740
|
-
},
|
|
741
|
-
tracing: {
|
|
742
|
-
type: "boolean",
|
|
743
|
-
description: "Enable Sentry performance tracing.",
|
|
744
|
-
default: false
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
},
|
|
748
|
-
instance: {
|
|
749
|
-
type: "object",
|
|
750
|
-
additionalProperties: false,
|
|
751
|
-
required: ["namespace", "reactorWorker"],
|
|
752
|
-
description: "Per-instance identity. Lets one origin host multiple isolated Connect instances, each with its own storage + SharedWorker namespace.",
|
|
753
|
-
properties: {
|
|
754
|
-
namespace: {
|
|
755
|
-
type: ["string", "null"],
|
|
756
|
-
description: "Explicit storage/SharedWorker namespace for this instance. `null` derives it from the base path (and, later, the configured endpoint), so root deployments stay byte-identical.",
|
|
757
|
-
default: null
|
|
758
|
-
},
|
|
759
|
-
reactorWorker: {
|
|
760
|
-
type: "boolean",
|
|
761
|
-
description: "Host the reactor in a shared worker instead of on the main thread. Off by default; the main-thread reactor stays the proven path until cutover is verified.",
|
|
762
|
-
default: false
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
},
|
|
766
|
-
reactor: {
|
|
767
|
-
type: "object",
|
|
768
|
-
additionalProperties: false,
|
|
769
|
-
description: "Settings for the reactor Connect runs in the browser, on the main thread or in the shared worker alike.",
|
|
770
|
-
properties: { featureFlags: {
|
|
771
|
-
type: "object",
|
|
772
|
-
additionalProperties: false,
|
|
773
|
-
description: "Enforcement flags. Each implies its predecessors, and the reactor refuses to boot on a set that names a later flag without an earlier one. These are consensus settings: a Connect syncing with a fleet must carry the same flags the fleet does, or the two reach different replay outcomes for the same history and diverge.",
|
|
774
|
-
properties: {
|
|
775
|
-
documentDecisions: {
|
|
776
|
-
type: "boolean",
|
|
777
|
-
description: "Decide writes from the document stream rather than the document meta cache, so a backdated deletion denies the operations that sort after it.",
|
|
778
|
-
default: false
|
|
779
|
-
},
|
|
780
|
-
authEnforcement: {
|
|
781
|
-
type: "boolean",
|
|
782
|
-
description: "Enforce the auth scope's policy at admission, replay, and read. Requires documentDecisions.",
|
|
783
|
-
default: false
|
|
784
|
-
},
|
|
785
|
-
authGroups: {
|
|
786
|
-
type: "boolean",
|
|
787
|
-
description: "Let `{ group }` principals match against the rosters of the group documents a policy names. Requires authEnforcement.",
|
|
788
|
-
default: false
|
|
789
|
-
},
|
|
790
|
-
authConditions: {
|
|
791
|
-
type: "boolean",
|
|
792
|
-
description: "Evaluate `where` and `match` conditions on grants. Requires authGroups. Do not enable on a fleet `preflight:auth` reports as crossing a reducer version.",
|
|
793
|
-
default: false
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
} }
|
|
797
|
-
},
|
|
798
|
-
pwa: {
|
|
799
|
-
type: "object",
|
|
800
|
-
additionalProperties: false,
|
|
801
|
-
description: "Progressive-web-app / service-worker overrides, layered on Connect's built-in PWA defaults at build time. Scalar fields deep-merge (this layer wins); the array members (icons, file_handlers, globs, runtimeCaching and denylist patterns) are additive; maximumFileSizeToCacheInBytes takes the max across contributors. (categories is not set here — it is derived from the manifest's category field.) Only applied when connect.app.offline is true.",
|
|
802
|
-
properties: {
|
|
803
|
-
manifest: {
|
|
804
|
-
type: "object",
|
|
805
|
-
additionalProperties: false,
|
|
806
|
-
description: "Web-app-manifest field overrides.",
|
|
807
|
-
properties: {
|
|
808
|
-
name: { type: "string" },
|
|
809
|
-
short_name: { type: "string" },
|
|
810
|
-
description: { type: "string" },
|
|
811
|
-
theme_color: { type: "string" },
|
|
812
|
-
background_color: { type: "string" },
|
|
813
|
-
display: {
|
|
814
|
-
type: "string",
|
|
815
|
-
enum: [
|
|
816
|
-
"fullscreen",
|
|
817
|
-
"standalone",
|
|
818
|
-
"minimal-ui",
|
|
819
|
-
"browser"
|
|
820
|
-
]
|
|
821
|
-
},
|
|
822
|
-
start_url: { type: "string" },
|
|
823
|
-
scope: { type: "string" },
|
|
824
|
-
icons: {
|
|
825
|
-
type: "array",
|
|
826
|
-
description: "Icons appended to the built-in set and de-duplicated by (src, sizes, purpose).",
|
|
827
|
-
items: pwaIconSchema
|
|
828
|
-
},
|
|
829
|
-
file_handlers: {
|
|
830
|
-
type: "array",
|
|
831
|
-
description: "File associations appended after Connect's built-in .phd/.phdm handler and de-duplicated on the whole entry. Entries only declare accepted types; there is no action field, because opening the files requires Connect's own runtime handling, so every handler opens at the app root.",
|
|
832
|
-
items: {
|
|
833
|
-
type: "object",
|
|
834
|
-
additionalProperties: false,
|
|
835
|
-
required: ["accept"],
|
|
836
|
-
properties: {
|
|
837
|
-
accept: {
|
|
838
|
-
type: "object",
|
|
839
|
-
description: "MIME type → file extensions. Each extension must start with '.'; browsers ignore entries without it.",
|
|
840
|
-
additionalProperties: {
|
|
841
|
-
type: "array",
|
|
842
|
-
items: {
|
|
843
|
-
type: "string",
|
|
844
|
-
pattern: "^\\."
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
},
|
|
848
|
-
icons: {
|
|
849
|
-
type: "array",
|
|
850
|
-
description: "OS-level file-type icons.",
|
|
851
|
-
items: pwaIconSchema
|
|
852
|
-
},
|
|
853
|
-
launch_type: {
|
|
854
|
-
type: "string",
|
|
855
|
-
enum: ["single-client", "multiple-clients"]
|
|
856
|
-
}
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
},
|
|
860
|
-
launch_handler: {
|
|
861
|
-
type: "object",
|
|
862
|
-
additionalProperties: false,
|
|
863
|
-
required: ["client_mode"],
|
|
864
|
-
description: "How the OS launches the app for handled files/links. Connect defaults to focus-existing.",
|
|
865
|
-
properties: { client_mode: {
|
|
866
|
-
type: "string",
|
|
867
|
-
enum: [
|
|
868
|
-
"auto",
|
|
869
|
-
"focus-existing",
|
|
870
|
-
"navigate-existing",
|
|
871
|
-
"navigate-new"
|
|
872
|
-
]
|
|
873
|
-
} }
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
},
|
|
877
|
-
globPatterns: {
|
|
878
|
-
type: "array",
|
|
879
|
-
items: { type: "string" },
|
|
880
|
-
description: "Extra Workbox precache globs, unioned with the built-ins."
|
|
881
|
-
},
|
|
882
|
-
globIgnores: {
|
|
883
|
-
type: "array",
|
|
884
|
-
items: { type: "string" },
|
|
885
|
-
description: "Extra precache ignore globs, unioned with the built-ins."
|
|
886
|
-
},
|
|
887
|
-
maximumFileSizeToCacheInBytes: {
|
|
888
|
-
type: "number",
|
|
889
|
-
description: "Raise the precache file-size ceiling. The max across all contributors wins, so no contributor can shrink another's limit."
|
|
890
|
-
},
|
|
891
|
-
runtimeCaching: {
|
|
892
|
-
type: "array",
|
|
893
|
-
description: "Runtime-caching rules appended after the built-in rules. Workbox is first-match-wins, so these cannot override a built-in rule matching the same URL.",
|
|
894
|
-
items: {
|
|
895
|
-
type: "object",
|
|
896
|
-
additionalProperties: false,
|
|
897
|
-
required: ["urlPattern", "handler"],
|
|
898
|
-
properties: {
|
|
899
|
-
urlPattern: pwaUrlPatternSchema,
|
|
900
|
-
handler: {
|
|
901
|
-
type: "string",
|
|
902
|
-
enum: [
|
|
903
|
-
"CacheFirst",
|
|
904
|
-
"CacheOnly",
|
|
905
|
-
"NetworkFirst",
|
|
906
|
-
"NetworkOnly",
|
|
907
|
-
"StaleWhileRevalidate"
|
|
908
|
-
]
|
|
909
|
-
},
|
|
910
|
-
method: {
|
|
911
|
-
type: "string",
|
|
912
|
-
enum: [
|
|
913
|
-
"GET",
|
|
914
|
-
"POST",
|
|
915
|
-
"PUT",
|
|
916
|
-
"DELETE",
|
|
917
|
-
"HEAD",
|
|
918
|
-
"PATCH"
|
|
919
|
-
]
|
|
920
|
-
},
|
|
921
|
-
options: {
|
|
922
|
-
type: "object",
|
|
923
|
-
additionalProperties: false,
|
|
924
|
-
properties: {
|
|
925
|
-
cacheName: { type: "string" },
|
|
926
|
-
networkTimeoutSeconds: {
|
|
927
|
-
type: "number",
|
|
928
|
-
description: "Seconds a NetworkFirst rule waits for the network before falling back to the cache."
|
|
929
|
-
},
|
|
930
|
-
expiration: {
|
|
931
|
-
type: "object",
|
|
932
|
-
additionalProperties: false,
|
|
933
|
-
properties: {
|
|
934
|
-
maxEntries: { type: "number" },
|
|
935
|
-
maxAgeSeconds: { type: "number" }
|
|
936
|
-
}
|
|
937
|
-
},
|
|
938
|
-
cacheableResponse: {
|
|
939
|
-
type: "object",
|
|
940
|
-
additionalProperties: false,
|
|
941
|
-
properties: {
|
|
942
|
-
statuses: {
|
|
943
|
-
type: "array",
|
|
944
|
-
items: { type: "number" }
|
|
945
|
-
},
|
|
946
|
-
headers: {
|
|
947
|
-
type: "object",
|
|
948
|
-
additionalProperties: { type: "string" }
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
},
|
|
957
|
-
navigateFallbackDenylist: {
|
|
958
|
-
type: "array",
|
|
959
|
-
description: "Extra SPA navigate-fallback denylist patterns, unioned with the built-ins.",
|
|
960
|
-
items: pwaUrlPatternSchema
|
|
961
|
-
}
|
|
962
|
-
}
|
|
963
|
-
}
|
|
806
|
+
const i = spec.indexOf("/");
|
|
807
|
+
return i === -1 ? {
|
|
808
|
+
pkg: spec,
|
|
809
|
+
sub: ""
|
|
810
|
+
} : {
|
|
811
|
+
pkg: spec.slice(0, i),
|
|
812
|
+
sub: spec.slice(i + 1)
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
function isSharedSpecifier(spec, specs) {
|
|
816
|
+
return specs.some((s) => spec === s || spec.startsWith(s + "/"));
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Return the import/export specifiers in `source` that are a shared
|
|
820
|
+
* specifier (or a subpath of one), sorted. Heuristic: only statement
|
|
821
|
+
* positions are scanned (`from "x"`, `import "x"`, `import("x")`;
|
|
822
|
+
* `export … from "x"` is covered by the `from` pattern), so import-like
|
|
823
|
+
* text inside comments or strings can be reported too. That errs toward
|
|
824
|
+
* over-reporting, which is the safe direction for the advisory build
|
|
825
|
+
* warning.
|
|
826
|
+
*/
|
|
827
|
+
function findSharedImports(source, specs = SHARED_DEP_SPECIFIERS) {
|
|
828
|
+
const found = /* @__PURE__ */ new Set();
|
|
829
|
+
for (const re of [
|
|
830
|
+
/\bfrom\s+["']([^"'\\]+)["']/g,
|
|
831
|
+
/\bimport\s+["']([^"'\\]+)["']/g,
|
|
832
|
+
/\bimport\s*\(\s*["']([^"'\\]+)["']\s*\)/g
|
|
833
|
+
]) for (const m of source.matchAll(re)) {
|
|
834
|
+
const spec = m[1];
|
|
835
|
+
if (isSharedSpecifier(spec, specs)) found.add(spec);
|
|
964
836
|
}
|
|
965
|
-
|
|
837
|
+
return [...found].sort();
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Rewrite a package source for blob import in a worker context (import maps
|
|
841
|
+
* don't apply there): shared specifiers become their mapped URLs, and
|
|
842
|
+
* relative (`./`, `../`) specifiers become absolute against `sourceUrl`
|
|
843
|
+
* (a blob URL has no directory to resolve against). `#` subpath imports are
|
|
844
|
+
* deliberately left alone: they resolve via the package's own
|
|
845
|
+
* `package.json` "imports" field, which the rewrite cannot reproduce.
|
|
846
|
+
* Returns the input unchanged when nothing matched.
|
|
847
|
+
*/
|
|
848
|
+
function rewritePackageSource(source, sourceUrl, imports) {
|
|
849
|
+
if (!Object.keys(imports).length) return source;
|
|
850
|
+
const base = new URL(sourceUrl);
|
|
851
|
+
const map = (spec) => {
|
|
852
|
+
const mapped = imports[spec];
|
|
853
|
+
if (mapped) return mapped;
|
|
854
|
+
if (spec.startsWith("./") || spec.startsWith("../")) return new URL(spec, base).href;
|
|
855
|
+
return null;
|
|
856
|
+
};
|
|
857
|
+
let out = source;
|
|
858
|
+
for (const re of [
|
|
859
|
+
/\bfrom\s+(["'])([^"'\\]+)\1/g,
|
|
860
|
+
/\bimport\s+(["'])([^"'\\]+)\1/g,
|
|
861
|
+
/\bimport\s*\(\s*(["'])([^"'\\]+)\1\s*\)/g
|
|
862
|
+
]) out = out.replace(re, (match, quote, spec) => {
|
|
863
|
+
const mapped = map(spec);
|
|
864
|
+
return mapped ? match.replace(`${quote}${spec}${quote}`, `${quote}${mapped}${quote}`) : match;
|
|
865
|
+
});
|
|
866
|
+
return out;
|
|
867
|
+
}
|
|
868
|
+
/**
|
|
869
|
+
* Compare a package's declared ranges against the host's version table.
|
|
870
|
+
* `hostVersions` defines the checked set (only deps present in it are
|
|
871
|
+
* checked). `*`, non-semver protocols (workspace:, file:, git:, npm:, URLs)
|
|
872
|
+
* and unparseable ranges never mismatch.
|
|
873
|
+
*/
|
|
874
|
+
function checkSharedDeps(pkgJson, hostVersions) {
|
|
875
|
+
const out = [];
|
|
876
|
+
const entries = [...Object.entries(pkgJson.dependencies ?? {}), ...Object.entries(pkgJson.peerDependencies ?? {})];
|
|
877
|
+
for (const [dep, range] of entries) {
|
|
878
|
+
const provided = hostVersions[dep];
|
|
879
|
+
if (provided === void 0 || typeof range !== "string") continue;
|
|
880
|
+
if (range === "*" || /^[a-z]+:/i.test(range)) continue;
|
|
881
|
+
if (!validRange(range)) continue;
|
|
882
|
+
if (!satisfies(provided, range, { includePrerelease: true })) out.push({
|
|
883
|
+
package: dep,
|
|
884
|
+
required: range,
|
|
885
|
+
provided
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
return out;
|
|
889
|
+
}
|
|
890
|
+
function formatSharedDepWarnings(mismatches) {
|
|
891
|
+
return mismatches.map((m) => `${m.package}: requires ${m.required}, Connect provides ${m.provided}`);
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Stable filename for a local package's worker model bundle under
|
|
895
|
+
* `__reactor_worker__/packages/`. Shared by the tab (URL computation via the
|
|
896
|
+
* manifest) and the production prebuild (emitted entry names), so the two can
|
|
897
|
+
* never drift. Scoped names flatten (`@scope/name` -> `scope__name`).
|
|
898
|
+
*/
|
|
899
|
+
function workerPackageFileName(packageName) {
|
|
900
|
+
return `${packageName.replace(/^@/, "").replace(/[^\w.-]+/g, "__")}.js`;
|
|
901
|
+
}
|
|
966
902
|
//#endregion
|
|
967
|
-
export { ConfigLoader, DEFAULT_CONNECT_CONFIG, JsonConfigAdapter, PWA_FILE_HANDLER_ACTION, PWA_IDB_KEY, PWA_IDB_NAME, PWA_IDB_STORE, PWA_IDB_VERSION, ROOT_STORAGE_NAMESPACE, buildRuntimeConfig, connectEnvSchema, dedupeFileHandlers, dedupeIcons, deepMerge, getStorageNamespace, loadConnectEnv, loadRuntimeEnv, mergeManifest, mergePwaConfig, normalizeBasePath, phConnectRuntimeConfigSchema, powerhousePackageSchema, runtimeEnvSchema, setConnectEnv, toRegExpOrString, unionStrings, withInferredCategory };
|
|
903
|
+
export { CONNECT_LAYER_ORDER, ConfigLoader, DEFAULT_CONNECT_CONFIG, DYNAMIC_BASE_PLACEHOLDER, EDGES, EXTERNALIZABLE_SHARED_SPECIFIERS, JsonConfigAdapter, PWA_FILE_HANDLER_ACTION, PWA_IDB_KEY, PWA_IDB_NAME, PWA_IDB_STORE, PWA_IDB_VERSION, ROOT_STORAGE_NAMESPACE, SHARED_DEPS, SHARED_DEP_SPECIFIERS, SHARED_SUBPATHS, buildRuntimeConfig, checkSharedDeps, colorVariants, connectAiSchema, connectAppSchema, connectBackgroundLayerSchema, connectBackgroundLayersSchema, connectBackgroundSchema, connectBrandingSchema, connectCollectionSchema, connectCompositionEntrySchema, connectConfigSchema, connectConfigSchemaWith, connectDefaultDriveLocalSchema, connectDefaultDriveRemoteSchema, connectDefaultDriveSchema, connectDrivePreserveStrategySchema, connectDriveSectionSchema, connectDriveSectionsSchema, connectDrivesSchema, connectEdgesSchema, connectEnvSchema, connectExplorerIconsSchema, connectHomeSchema, connectImageRefSchema, connectInstanceSchema, connectLengthSchema, connectLoaderSchema, connectOpenPanelSchema, connectPackagesSchema, connectPwaCacheStrategySchema, connectPwaFileHandlerSchema, connectPwaIconSchema, connectPwaManifestSchema, connectPwaRuntimeCachingSchema, connectPwaSchema, connectPwaUrlPatternSchema, connectReactorClientModeSchema, connectReactorFeatureFlagsSchema, connectReactorSchema, connectRemoteBackendSchema, connectRenownAdaptersSchema, connectRenownPrivyAdapterSchema, connectRenownRainbowAdapterSchema, connectRenownSchema, connectRouterSettingsSchema, connectRuntimeConfigSchema, connectRuntimeDefaultDriveRemoteSchema, connectRuntimeDefaultDriveSchema, connectRuntimeDrivesSchema, connectRuntimeInstanceSchema, connectRuntimePwaManifestSchema, connectRuntimePwaSchema, connectSchemedColorSchema, connectSchemedImageSchema, connectSentrySchema, cssLength, declaredConnectConfigSchema, dedupeFileHandlers, dedupeIcons, deepMerge, emitJsonSchemaFragment, findSharedImports, formatSharedDepWarnings, getStorageNamespace, imageVariants, isAppShellNavigation, layerDeclarations, layerStyle, layerStyleText, loadConnectEnv, loadRuntimeEnv, mapBackgroundImages, mergeManifest, mergePwaConfig, normalizeBackground, normalizeBasePath, parseDepSpec, phBackgroundLayerSchema, phBackgroundSchema, phConnectBrandingSchema, phConnectExplorerIconsSchema, phConnectHomeSchema, phConnectRuntimeConfigSchema, powerhousePackageSchema, resolveDynamicBaseUrl, resolveSourceConnect, rewritePackageSource, runtimeEnvSchema, setConnectEnv, toRegExpOrString, unionStrings, validateBackground, withInferredCategory, workerPackageFileName, workflowsSettingConflict };
|
|
968
904
|
|
|
969
905
|
//# sourceMappingURL=index.js.map
|