@softistx/alxia-react-router 0.0.0-stage → 0.83.1
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/LICENSE +21 -0
- package/README.md +2085 -2
- package/dist/api-keys/api-keys.d.ts +93 -0
- package/dist/api-keys/api-keys.d.ts.map +1 -0
- package/dist/api-keys/index.d.ts +9 -0
- package/dist/api-keys/index.d.ts.map +1 -0
- package/dist/api-keys/index.js +66 -0
- package/dist/api-keys/index.js.map +10 -0
- package/dist/assets.d.ts +14 -0
- package/dist/assets.d.ts.map +1 -0
- package/dist/chunks/index-0786n4qe.js +25 -0
- package/dist/chunks/index-0786n4qe.js.map +10 -0
- package/dist/chunks/index-1nw5yeek.js +169 -0
- package/dist/chunks/index-1nw5yeek.js.map +11 -0
- package/dist/chunks/index-59vhfj6n.js +10 -0
- package/dist/chunks/index-59vhfj6n.js.map +10 -0
- package/dist/chunks/index-5gqcpyyg.js +34 -0
- package/dist/chunks/index-5gqcpyyg.js.map +10 -0
- package/dist/chunks/index-6jf7zpxz.js +119 -0
- package/dist/chunks/index-6jf7zpxz.js.map +11 -0
- package/dist/chunks/index-8as4j8m3.js +340 -0
- package/dist/chunks/index-8as4j8m3.js.map +16 -0
- package/dist/chunks/index-9xv2a8et.js +108 -0
- package/dist/chunks/index-9xv2a8et.js.map +11 -0
- package/dist/chunks/index-ajtvyq35.js +16 -0
- package/dist/chunks/index-ajtvyq35.js.map +10 -0
- package/dist/chunks/index-c55hxgr5.js +124 -0
- package/dist/chunks/index-c55hxgr5.js.map +14 -0
- package/dist/chunks/index-d42p3mdp.js +19 -0
- package/dist/chunks/index-d42p3mdp.js.map +10 -0
- package/dist/chunks/index-gac44rs5.js +42 -0
- package/dist/chunks/index-gac44rs5.js.map +11 -0
- package/dist/chunks/index-j4ktpcke.js +62 -0
- package/dist/chunks/index-j4ktpcke.js.map +10 -0
- package/dist/chunks/index-mscfme4r.js +12 -0
- package/dist/chunks/index-mscfme4r.js.map +10 -0
- package/dist/chunks/index-pghmb2dm.js +30 -0
- package/dist/chunks/index-pghmb2dm.js.map +10 -0
- package/dist/chunks/index-rfr02vg4.js +40 -0
- package/dist/chunks/index-rfr02vg4.js.map +10 -0
- package/dist/chunks/index-sfhshxqz.js +31 -0
- package/dist/chunks/index-sfhshxqz.js.map +10 -0
- package/dist/chunks/index-skwypsjz.js +357 -0
- package/dist/chunks/index-skwypsjz.js.map +12 -0
- package/dist/chunks/index-sxh06ged.js +118 -0
- package/dist/chunks/index-sxh06ged.js.map +11 -0
- package/dist/chunks/index-t2ph23wk.js +96 -0
- package/dist/chunks/index-t2ph23wk.js.map +13 -0
- package/dist/chunks/index-thyabr5n.js +19 -0
- package/dist/chunks/index-thyabr5n.js.map +10 -0
- package/dist/chunks/index-tx36swjx.js +134 -0
- package/dist/chunks/index-tx36swjx.js.map +11 -0
- package/dist/chunks/index-v2z5k640.js +54 -0
- package/dist/chunks/index-v2z5k640.js.map +11 -0
- package/dist/chunks/index-vr82typq.js +23 -0
- package/dist/chunks/index-vr82typq.js.map +11 -0
- package/dist/chunks/index-whj6h5eg.js +9 -0
- package/dist/chunks/index-whj6h5eg.js.map +10 -0
- package/dist/chunks/index-wyypkfdv.js +130 -0
- package/dist/chunks/index-wyypkfdv.js.map +13 -0
- package/dist/chunks/index-xd5aqy3g.js +90 -0
- package/dist/chunks/index-xd5aqy3g.js.map +10 -0
- package/dist/chunks/index-zdbqzcjp.js +97 -0
- package/dist/chunks/index-zdbqzcjp.js.map +12 -0
- package/dist/chunks/index-zyg8amjc.js +23 -0
- package/dist/chunks/index-zyg8amjc.js.map +10 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +215 -0
- package/dist/cli/index.js.map +13 -0
- package/dist/cli/main.d.ts +13 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/reveal.d.ts +18 -0
- package/dist/cli/reveal.d.ts.map +1 -0
- package/dist/cli/template.d.ts +8 -0
- package/dist/cli/template.d.ts.map +1 -0
- package/dist/context.d.ts +104 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/document/index.d.ts +11 -0
- package/dist/document/index.d.ts.map +1 -0
- package/dist/document/index.js +19 -0
- package/dist/document/index.js.map +9 -0
- package/dist/document/inline-script.d.ts +27 -0
- package/dist/document/inline-script.d.ts.map +1 -0
- package/dist/document/language-store.d.ts +8 -0
- package/dist/document/language-store.d.ts.map +1 -0
- package/dist/document/nonce.d.ts +34 -0
- package/dist/document/nonce.d.ts.map +1 -0
- package/dist/document/page-language.d.ts +39 -0
- package/dist/document/page-language.d.ts.map +1 -0
- package/dist/document/text-direction.d.ts +10 -0
- package/dist/document/text-direction.d.ts.map +1 -0
- package/dist/entry/abort.d.ts +21 -0
- package/dist/entry/abort.d.ts.map +1 -0
- package/dist/entry/create-entry.d.ts +41 -0
- package/dist/entry/create-entry.d.ts.map +1 -0
- package/dist/entry/index.d.ts +8 -0
- package/dist/entry/index.d.ts.map +1 -0
- package/dist/entry/index.js +154 -0
- package/dist/entry/index.js.map +13 -0
- package/dist/entry/root-data.d.ts +27 -0
- package/dist/entry/root-data.d.ts.map +1 -0
- package/dist/entry/whole-page.d.ts +10 -0
- package/dist/entry/whole-page.d.ts.map +1 -0
- package/dist/errors/api-error.d.ts +117 -0
- package/dist/errors/api-error.d.ts.map +1 -0
- package/dist/errors/api-errors.d.ts +122 -0
- package/dist/errors/api-errors.d.ts.map +1 -0
- package/dist/errors/call-failure.d.ts +45 -0
- package/dist/errors/call-failure.d.ts.map +1 -0
- package/dist/errors/catalogue-check.d.ts +24 -0
- package/dist/errors/catalogue-check.d.ts.map +1 -0
- package/dist/errors/catalogue-read.d.ts +33 -0
- package/dist/errors/catalogue-read.d.ts.map +1 -0
- package/dist/errors/catalogue.d.ts +59 -0
- package/dist/errors/catalogue.d.ts.map +1 -0
- package/dist/errors/code-resolver.d.ts +44 -0
- package/dist/errors/code-resolver.d.ts.map +1 -0
- package/dist/errors/cross-site.d.ts +8 -0
- package/dist/errors/cross-site.d.ts.map +1 -0
- package/dist/errors/describe-refusal.d.ts +6 -0
- package/dist/errors/describe-refusal.d.ts.map +1 -0
- package/dist/errors/describe.d.ts +3 -0
- package/dist/errors/describe.d.ts.map +1 -0
- package/dist/errors/fetcher-result.d.ts +33 -0
- package/dist/errors/fetcher-result.d.ts.map +1 -0
- package/dist/errors/field-placement.d.ts +12 -0
- package/dist/errors/field-placement.d.ts.map +1 -0
- package/dist/errors/form-errors.d.ts +8 -0
- package/dist/errors/form-errors.d.ts.map +1 -0
- package/dist/errors/form-refusal.d.ts +25 -0
- package/dist/errors/form-refusal.d.ts.map +1 -0
- package/dist/errors/index.d.ts +21 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +588 -0
- package/dist/errors/index.js.map +26 -0
- package/dist/errors/json-actions.d.ts +38 -0
- package/dist/errors/json-actions.d.ts.map +1 -0
- package/dist/errors/log.d.ts +8 -0
- package/dist/errors/log.d.ts.map +1 -0
- package/dist/errors/message-values.d.ts +11 -0
- package/dist/errors/message-values.d.ts.map +1 -0
- package/dist/errors/messages.d.ts +63 -0
- package/dist/errors/messages.d.ts.map +1 -0
- package/dist/errors/page-path.d.ts +9 -0
- package/dist/errors/page-path.d.ts.map +1 -0
- package/dist/errors/problem-error.d.ts +50 -0
- package/dist/errors/problem-error.d.ts.map +1 -0
- package/dist/errors/provider.d.ts +20 -0
- package/dist/errors/provider.d.ts.map +1 -0
- package/dist/errors/request-id.d.ts +5 -0
- package/dist/errors/request-id.d.ts.map +1 -0
- package/dist/errors/route-error.d.ts +33 -0
- package/dist/errors/route-error.d.ts.map +1 -0
- package/dist/errors/route-refusal.d.ts +20 -0
- package/dist/errors/route-refusal.d.ts.map +1 -0
- package/dist/errors/same-site.d.ts +49 -0
- package/dist/errors/same-site.d.ts.map +1 -0
- package/dist/errors/section-action.d.ts +46 -0
- package/dist/errors/section-action.d.ts.map +1 -0
- package/dist/errors/standard-schema.d.ts +34 -0
- package/dist/errors/standard-schema.d.ts.map +1 -0
- package/dist/errors/submit-form.d.ts +16 -0
- package/dist/errors/submit-form.d.ts.map +1 -0
- package/dist/errors/upstream-headers.d.ts +18 -0
- package/dist/errors/upstream-headers.d.ts.map +1 -0
- package/dist/errors/use-json-fetcher.d.ts +18 -0
- package/dist/errors/use-json-fetcher.d.ts.map +1 -0
- package/dist/fetcher/auth-refusal.d.ts +29 -0
- package/dist/fetcher/auth-refusal.d.ts.map +1 -0
- package/dist/fetcher/index.d.ts +20 -0
- package/dist/fetcher/index.d.ts.map +1 -0
- package/dist/fetcher/index.js +392 -0
- package/dist/fetcher/index.js.map +21 -0
- package/dist/fetcher/section-form.d.ts +24 -0
- package/dist/fetcher/section-form.d.ts.map +1 -0
- package/dist/fetcher/section-reload.d.ts +17 -0
- package/dist/fetcher/section-reload.d.ts.map +1 -0
- package/dist/fetcher/section-save.d.ts +29 -0
- package/dist/fetcher/section-save.d.ts.map +1 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts +57 -0
- package/dist/fetcher/use-debounced-fetcher.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-answer.d.ts +16 -0
- package/dist/fetcher/use-fetcher-answer.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-done.d.ts +15 -0
- package/dist/fetcher/use-fetcher-done.d.ts.map +1 -0
- package/dist/fetcher/use-fetcher-promise.d.ts +48 -0
- package/dist/fetcher/use-fetcher-promise.d.ts.map +1 -0
- package/dist/fetcher/use-form-refusal.d.ts +20 -0
- package/dist/fetcher/use-form-refusal.d.ts.map +1 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts +20 -0
- package/dist/fetcher/use-revalidate-on-focus.d.ts.map +1 -0
- package/dist/fetcher/use-row-save.d.ts +32 -0
- package/dist/fetcher/use-row-save.d.ts.map +1 -0
- package/dist/fetcher/use-section-save.d.ts +46 -0
- package/dist/fetcher/use-section-save.d.ts.map +1 -0
- package/dist/fetcher/use-visible-interval.d.ts +24 -0
- package/dist/fetcher/use-visible-interval.d.ts.map +1 -0
- package/dist/fetcher/use-visible-revalidation.d.ts +10 -0
- package/dist/fetcher/use-visible-revalidation.d.ts.map +1 -0
- package/dist/health.d.ts +21 -0
- package/dist/health.d.ts.map +1 -0
- package/dist/help/check/check.d.ts +35 -0
- package/dist/help/check/check.d.ts.map +1 -0
- package/dist/help/check/index.d.ts +8 -0
- package/dist/help/check/index.d.ts.map +1 -0
- package/dist/help/check/index.js +17 -0
- package/dist/help/check/index.js.map +9 -0
- package/dist/help/check/routes.d.ts +22 -0
- package/dist/help/check/routes.d.ts.map +1 -0
- package/dist/help/guide.d.ts +33 -0
- package/dist/help/guide.d.ts.map +1 -0
- package/dist/help/index.d.ts +16 -0
- package/dist/help/index.d.ts.map +1 -0
- package/dist/help/index.js +192 -0
- package/dist/help/index.js.map +14 -0
- package/dist/help/load.d.ts +39 -0
- package/dist/help/load.d.ts.map +1 -0
- package/dist/help/panel.d.ts +69 -0
- package/dist/help/panel.d.ts.map +1 -0
- package/dist/help/parse-flow.d.ts +27 -0
- package/dist/help/parse-flow.d.ts.map +1 -0
- package/dist/help/react.d.ts +12 -0
- package/dist/help/react.d.ts.map +1 -0
- package/dist/help/resolve.d.ts +24 -0
- package/dist/help/resolve.d.ts.map +1 -0
- package/dist/help/types.d.ts +50 -0
- package/dist/help/types.d.ts.map +1 -0
- package/dist/help/yaml.d.ts +18 -0
- package/dist/help/yaml.d.ts.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +14 -0
- package/dist/link/index.d.ts +7 -0
- package/dist/link/index.d.ts.map +1 -0
- package/dist/link/index.js +16 -0
- package/dist/link/index.js.map +10 -0
- package/dist/link/router-link.d.ts +27 -0
- package/dist/link/router-link.d.ts.map +1 -0
- package/dist/lists/connection-page.d.ts +50 -0
- package/dist/lists/connection-page.d.ts.map +1 -0
- package/dist/lists/index.d.ts +13 -0
- package/dist/lists/index.d.ts.map +1 -0
- package/dist/lists/index.js +205 -0
- package/dist/lists/index.js.map +15 -0
- package/dist/lists/newest-first.d.ts +5 -0
- package/dist/lists/newest-first.d.ts.map +1 -0
- package/dist/lists/nodes-of.d.ts +21 -0
- package/dist/lists/nodes-of.d.ts.map +1 -0
- package/dist/lists/or-failed.d.ts +19 -0
- package/dist/lists/or-failed.d.ts.map +1 -0
- package/dist/lists/use-paged-rows.d.ts +40 -0
- package/dist/lists/use-paged-rows.d.ts.map +1 -0
- package/dist/lists/use-same-route-loading.d.ts +8 -0
- package/dist/lists/use-same-route-loading.d.ts.map +1 -0
- package/dist/lists/use-search-change.d.ts +20 -0
- package/dist/lists/use-search-change.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +8 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +105 -0
- package/dist/mcp/index.js.map +11 -0
- package/dist/mcp/mcp-relay.d.ts +58 -0
- package/dist/mcp/mcp-relay.d.ts.map +1 -0
- package/dist/mcp/relay.d.ts +38 -0
- package/dist/mcp/relay.d.ts.map +1 -0
- package/dist/media/client/error.d.ts +29 -0
- package/dist/media/client/error.d.ts.map +1 -0
- package/dist/media/client/index.d.ts +8 -0
- package/dist/media/client/index.d.ts.map +1 -0
- package/dist/media/client/index.js +133 -0
- package/dist/media/client/index.js.map +11 -0
- package/dist/media/client/upload.d.ts +32 -0
- package/dist/media/client/upload.d.ts.map +1 -0
- package/dist/media/forward.d.ts +14 -0
- package/dist/media/forward.d.ts.map +1 -0
- package/dist/media/headers.d.ts +11 -0
- package/dist/media/headers.d.ts.map +1 -0
- package/dist/media/index.d.ts +9 -0
- package/dist/media/index.d.ts.map +1 -0
- package/dist/media/index.js +396 -0
- package/dist/media/index.js.map +16 -0
- package/dist/media/options.d.ts +114 -0
- package/dist/media/options.d.ts.map +1 -0
- package/dist/media/path.d.ts +12 -0
- package/dist/media/path.d.ts.map +1 -0
- package/dist/media/read.d.ts +11 -0
- package/dist/media/read.d.ts.map +1 -0
- package/dist/media/refusal.d.ts +11 -0
- package/dist/media/refusal.d.ts.map +1 -0
- package/dist/media/respond.d.ts +8 -0
- package/dist/media/respond.d.ts.map +1 -0
- package/dist/media/write.d.ts +13 -0
- package/dist/media/write.d.ts.map +1 -0
- package/dist/navigation/index.d.ts +9 -0
- package/dist/navigation/index.d.ts.map +1 -0
- package/dist/navigation/index.js +48 -0
- package/dist/navigation/index.js.map +11 -0
- package/dist/navigation/use-focus-on-navigate.d.ts +16 -0
- package/dist/navigation/use-focus-on-navigate.d.ts.map +1 -0
- package/dist/navigation/use-route-transition.d.ts +19 -0
- package/dist/navigation/use-route-transition.d.ts.map +1 -0
- package/dist/nonce.d.ts +16 -0
- package/dist/nonce.d.ts.map +1 -0
- package/dist/oauth/answer.d.ts +33 -0
- package/dist/oauth/answer.d.ts.map +1 -0
- package/dist/oauth/binding.d.ts +43 -0
- package/dist/oauth/binding.d.ts.map +1 -0
- package/dist/oauth/consent.d.ts +134 -0
- package/dist/oauth/consent.d.ts.map +1 -0
- package/dist/oauth/grants.d.ts +88 -0
- package/dist/oauth/grants.d.ts.map +1 -0
- package/dist/oauth/index.d.ts +16 -0
- package/dist/oauth/index.d.ts.map +1 -0
- package/dist/oauth/index.js +207 -0
- package/dist/oauth/index.js.map +12 -0
- package/dist/oauth/model.d.ts +13 -0
- package/dist/oauth/model.d.ts.map +1 -0
- package/dist/oauth/react/index.d.ts +7 -0
- package/dist/oauth/react/index.d.ts.map +1 -0
- package/dist/oauth/react/index.js +99 -0
- package/dist/oauth/react/index.js.map +10 -0
- package/dist/oauth/react/use-consent.d.ts +52 -0
- package/dist/oauth/react/use-consent.d.ts.map +1 -0
- package/dist/oidc/dpop.d.ts +80 -0
- package/dist/oidc/dpop.d.ts.map +1 -0
- package/dist/oidc/errors.d.ts +16 -0
- package/dist/oidc/errors.d.ts.map +1 -0
- package/dist/oidc/flow.d.ts +59 -0
- package/dist/oidc/flow.d.ts.map +1 -0
- package/dist/oidc/index.d.ts +11 -0
- package/dist/oidc/index.d.ts.map +1 -0
- package/dist/oidc/index.js +742 -0
- package/dist/oidc/index.js.map +15 -0
- package/dist/oidc/oidc.d.ts +132 -0
- package/dist/oidc/oidc.d.ts.map +1 -0
- package/dist/oidc/revoke.d.ts +28 -0
- package/dist/oidc/revoke.d.ts.map +1 -0
- package/dist/oidc/seal.d.ts +20 -0
- package/dist/oidc/seal.d.ts.map +1 -0
- package/dist/pwa/build/build-worker.d.ts +41 -0
- package/dist/pwa/build/build-worker.d.ts.map +1 -0
- package/dist/pwa/build/index.d.ts +9 -0
- package/dist/pwa/build/index.d.ts.map +1 -0
- package/dist/pwa/build/index.js +9 -0
- package/dist/pwa/build/index.js.map +9 -0
- package/dist/pwa/build/precache.d.ts +17 -0
- package/dist/pwa/build/precache.d.ts.map +1 -0
- package/dist/pwa/index.d.ts +16 -0
- package/dist/pwa/index.d.ts.map +1 -0
- package/dist/pwa/index.js +110 -0
- package/dist/pwa/index.js.map +12 -0
- package/dist/pwa/model/caching.d.ts +46 -0
- package/dist/pwa/model/caching.d.ts.map +1 -0
- package/dist/pwa/model/clear-app-caches.d.ts +9 -0
- package/dist/pwa/model/clear-app-caches.d.ts.map +1 -0
- package/dist/pwa/model/font-precache.d.ts +15 -0
- package/dist/pwa/model/font-precache.d.ts.map +1 -0
- package/dist/pwa/model/manifest.d.ts +80 -0
- package/dist/pwa/model/manifest.d.ts.map +1 -0
- package/dist/pwa/model/precache-list.d.ts +40 -0
- package/dist/pwa/model/precache-list.d.ts.map +1 -0
- package/dist/pwa/model/registration.d.ts +39 -0
- package/dist/pwa/model/registration.d.ts.map +1 -0
- package/dist/pwa/model/start-service-worker.d.ts +24 -0
- package/dist/pwa/model/start-service-worker.d.ts.map +1 -0
- package/dist/pwa/model/storable.d.ts +8 -0
- package/dist/pwa/model/storable.d.ts.map +1 -0
- package/dist/pwa/model/theme-color.d.ts +20 -0
- package/dist/pwa/model/theme-color.d.ts.map +1 -0
- package/dist/pwa/model/update-notice.d.ts +38 -0
- package/dist/pwa/model/update-notice.d.ts.map +1 -0
- package/dist/pwa/model/worker-contract.d.ts +61 -0
- package/dist/pwa/model/worker-contract.d.ts.map +1 -0
- package/dist/pwa/react/index.d.ts +9 -0
- package/dist/pwa/react/index.d.ts.map +1 -0
- package/dist/pwa/react/index.js +75 -0
- package/dist/pwa/react/index.js.map +13 -0
- package/dist/pwa/react/use-online.d.ts +6 -0
- package/dist/pwa/react/use-online.d.ts.map +1 -0
- package/dist/pwa/react/use-service-worker.d.ts +33 -0
- package/dist/pwa/react/use-service-worker.d.ts.map +1 -0
- package/dist/pwa/react/use-update-notice.d.ts +14 -0
- package/dist/pwa/react/use-update-notice.d.ts.map +1 -0
- package/dist/pwa/server/index.d.ts +7 -0
- package/dist/pwa/server/index.d.ts.map +1 -0
- package/dist/pwa/server/index.js +18 -0
- package/dist/pwa/server/index.js.map +10 -0
- package/dist/pwa/server/no-cache.d.ts +22 -0
- package/dist/pwa/server/no-cache.d.ts.map +1 -0
- package/dist/pwa/worker/index.d.ts +9 -0
- package/dist/pwa/worker/index.d.ts.map +1 -0
- package/dist/pwa/worker/index.js +144 -0
- package/dist/pwa/worker/index.js.map +12 -0
- package/dist/pwa/worker/injected.d.ts +15 -0
- package/dist/pwa/worker/injected.d.ts.map +1 -0
- package/dist/pwa/worker/plan.d.ts +65 -0
- package/dist/pwa/worker/plan.d.ts.map +1 -0
- package/dist/pwa/worker/scope.d.ts +18 -0
- package/dist/pwa/worker/scope.d.ts.map +1 -0
- package/dist/pwa/worker/start-worker.d.ts +17 -0
- package/dist/pwa/worker/start-worker.d.ts.map +1 -0
- package/dist/react-router.d.ts +68 -0
- package/dist/react-router.d.ts.map +1 -0
- package/dist/server.d.ts +127 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/session/codes.d.ts +9 -0
- package/dist/session/codes.d.ts.map +1 -0
- package/dist/session/cookies.d.ts +128 -0
- package/dist/session/cookies.d.ts.map +1 -0
- package/dist/session/flow-types.d.ts +235 -0
- package/dist/session/flow-types.d.ts.map +1 -0
- package/dist/session/guard.d.ts +10 -0
- package/dist/session/guard.d.ts.map +1 -0
- package/dist/session/index.d.ts +22 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +1090 -0
- package/dist/session/index.js.map +27 -0
- package/dist/session/land.d.ts +28 -0
- package/dist/session/land.d.ts.map +1 -0
- package/dist/session/link-json.d.ts +22 -0
- package/dist/session/link-json.d.ts.map +1 -0
- package/dist/session/link-land.d.ts +20 -0
- package/dist/session/link-land.d.ts.map +1 -0
- package/dist/session/link-token.d.ts +24 -0
- package/dist/session/link-token.d.ts.map +1 -0
- package/dist/session/link-types.d.ts +142 -0
- package/dist/session/link-types.d.ts.map +1 -0
- package/dist/session/links.d.ts +14 -0
- package/dist/session/links.d.ts.map +1 -0
- package/dist/session/model/index.d.ts +8 -0
- package/dist/session/model/index.d.ts.map +1 -0
- package/dist/session/model/index.js +35 -0
- package/dist/session/model/index.js.map +9 -0
- package/dist/session/model/link-post.d.ts +35 -0
- package/dist/session/model/link-post.d.ts.map +1 -0
- package/dist/session/model/paths.d.ts +24 -0
- package/dist/session/model/paths.d.ts.map +1 -0
- package/dist/session/model/safe-next.d.ts +15 -0
- package/dist/session/model/safe-next.d.ts.map +1 -0
- package/dist/session/model/second-factor.d.ts +16 -0
- package/dist/session/model/second-factor.d.ts.map +1 -0
- package/dist/session/model/site-path.d.ts +10 -0
- package/dist/session/model/site-path.d.ts.map +1 -0
- package/dist/session/model/step-up-answers.d.ts +45 -0
- package/dist/session/model/step-up-answers.d.ts.map +1 -0
- package/dist/session/model/step-up-props.d.ts +22 -0
- package/dist/session/model/step-up-props.d.ts.map +1 -0
- package/dist/session/model/step-up.d.ts +48 -0
- package/dist/session/model/step-up.d.ts.map +1 -0
- package/dist/session/react/index.d.ts +13 -0
- package/dist/session/react/index.d.ts.map +1 -0
- package/dist/session/react/index.js +196 -0
- package/dist/session/react/index.js.map +14 -0
- package/dist/session/react/step-up/answers.d.ts +9 -0
- package/dist/session/react/step-up/answers.d.ts.map +1 -0
- package/dist/session/react/step-up/dialog-props.d.ts +27 -0
- package/dist/session/react/step-up/dialog-props.d.ts.map +1 -0
- package/dist/session/react/step-up/index.d.ts +7 -0
- package/dist/session/react/step-up/index.d.ts.map +1 -0
- package/dist/session/react/step-up/pending-runs.d.ts +21 -0
- package/dist/session/react/step-up/pending-runs.d.ts.map +1 -0
- package/dist/session/react/step-up/phase.d.ts +8 -0
- package/dist/session/react/step-up/phase.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts +59 -0
- package/dist/session/react/step-up/use-step-up-replay.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts +70 -0
- package/dist/session/react/step-up/use-step-up-runner.d.ts.map +1 -0
- package/dist/session/react/step-up/use-step-up.d.ts +51 -0
- package/dist/session/react/step-up/use-step-up.d.ts.map +1 -0
- package/dist/session/react/use-code-field.d.ts +37 -0
- package/dist/session/react/use-code-field.d.ts.map +1 -0
- package/dist/session/react/use-link-fragment.d.ts +22 -0
- package/dist/session/react/use-link-fragment.d.ts.map +1 -0
- package/dist/session/react/use-link-param.d.ts +26 -0
- package/dist/session/react/use-link-param.d.ts.map +1 -0
- package/dist/session/react/use-link-post.d.ts +39 -0
- package/dist/session/react/use-link-post.d.ts.map +1 -0
- package/dist/session/react/use-sign-out.d.ts +46 -0
- package/dist/session/react/use-sign-out.d.ts.map +1 -0
- package/dist/session/second-factor.d.ts +22 -0
- package/dist/session/second-factor.d.ts.map +1 -0
- package/dist/session/serialize.d.ts +42 -0
- package/dist/session/serialize.d.ts.map +1 -0
- package/dist/session/sign-in.d.ts +19 -0
- package/dist/session/sign-in.d.ts.map +1 -0
- package/dist/session/signed.d.ts +44 -0
- package/dist/session/signed.d.ts.map +1 -0
- package/dist/session/social-flow.d.ts +22 -0
- package/dist/session/social-flow.d.ts.map +1 -0
- package/dist/session/social-land.d.ts +31 -0
- package/dist/session/social-land.d.ts.map +1 -0
- package/dist/session/social-types.d.ts +136 -0
- package/dist/session/social-types.d.ts.map +1 -0
- package/dist/session/social.d.ts +32 -0
- package/dist/session/social.d.ts.map +1 -0
- package/dist/session/step-up-codes.d.ts +9 -0
- package/dist/session/step-up-codes.d.ts.map +1 -0
- package/dist/session/step-up-signed-out.d.ts +21 -0
- package/dist/session/step-up-signed-out.d.ts.map +1 -0
- package/dist/session/step-up-types.d.ts +127 -0
- package/dist/session/step-up-types.d.ts.map +1 -0
- package/dist/session/step-up.d.ts +17 -0
- package/dist/session/step-up.d.ts.map +1 -0
- package/dist/session/step.d.ts +22 -0
- package/dist/session/step.d.ts.map +1 -0
- package/dist/session/throttle.d.ts +73 -0
- package/dist/session/throttle.d.ts.map +1 -0
- package/dist/session/timed-wait.d.ts +4 -0
- package/dist/session/timed-wait.d.ts.map +1 -0
- package/dist/session/viewer.d.ts +34 -0
- package/dist/session/viewer.d.ts.map +1 -0
- package/dist/subscription/documents.d.ts +3 -0
- package/dist/subscription/documents.d.ts.map +1 -0
- package/dist/subscription/index.d.ts +7 -0
- package/dist/subscription/index.d.ts.map +1 -0
- package/dist/subscription/index.js +359 -0
- package/dist/subscription/index.js.map +14 -0
- package/dist/subscription/proxy.d.ts +54 -0
- package/dist/subscription/proxy.d.ts.map +1 -0
- package/dist/subscription/react/backoff.d.ts +8 -0
- package/dist/subscription/react/backoff.d.ts.map +1 -0
- package/dist/subscription/react/classify.d.ts +15 -0
- package/dist/subscription/react/classify.d.ts.map +1 -0
- package/dist/subscription/react/controller.d.ts +40 -0
- package/dist/subscription/react/controller.d.ts.map +1 -0
- package/dist/subscription/react/fake-timers.d.ts +8 -0
- package/dist/subscription/react/fake-timers.d.ts.map +1 -0
- package/dist/subscription/react/index.d.ts +15 -0
- package/dist/subscription/react/index.d.ts.map +1 -0
- package/dist/subscription/react/index.js +227 -0
- package/dist/subscription/react/index.js.map +17 -0
- package/dist/subscription/react/reconnect.d.ts +9 -0
- package/dist/subscription/react/reconnect.d.ts.map +1 -0
- package/dist/subscription/react/scheduler.d.ts +13 -0
- package/dist/subscription/react/scheduler.d.ts.map +1 -0
- package/dist/subscription/react/timers.d.ts +7 -0
- package/dist/subscription/react/timers.d.ts.map +1 -0
- package/dist/subscription/react/use-live-subscription.d.ts +36 -0
- package/dist/subscription/react/use-live-subscription.d.ts.map +1 -0
- package/dist/subscription/react/versions.d.ts +6 -0
- package/dist/subscription/react/versions.d.ts.map +1 -0
- package/dist/subscription/read.d.ts +17 -0
- package/dist/subscription/read.d.ts.map +1 -0
- package/dist/subscription/refusal.d.ts +11 -0
- package/dist/subscription/refusal.d.ts.map +1 -0
- package/dist/subscription/relay.d.ts +16 -0
- package/dist/subscription/relay.d.ts.map +1 -0
- package/dist/vite/bun.d.ts +21 -0
- package/dist/vite/bun.d.ts.map +1 -0
- package/dist/vite/bundle.d.ts +33 -0
- package/dist/vite/bundle.d.ts.map +1 -0
- package/dist/vite/compress.d.ts +18 -0
- package/dist/vite/compress.d.ts.map +1 -0
- package/dist/vite/config.d.ts +33 -0
- package/dist/vite/config.d.ts.map +1 -0
- package/dist/vite/dev.d.ts +28 -0
- package/dist/vite/dev.d.ts.map +1 -0
- package/dist/vite/entry.d.ts +20 -0
- package/dist/vite/entry.d.ts.map +1 -0
- package/dist/vite/hosts.d.ts +16 -0
- package/dist/vite/hosts.d.ts.map +1 -0
- package/dist/vite/index.d.ts +68 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +635 -0
- package/dist/vite/index.js.map +22 -0
- package/dist/vite/inline.d.ts +18 -0
- package/dist/vite/inline.d.ts.map +1 -0
- package/dist/vite/node.d.ts +16 -0
- package/dist/vite/node.d.ts.map +1 -0
- package/dist/vite/preview.d.ts +8 -0
- package/dist/vite/preview.d.ts.map +1 -0
- package/dist/vite/runtime.d.ts +8 -0
- package/dist/vite/runtime.d.ts.map +1 -0
- package/dist/vite/socket.d.ts +75 -0
- package/dist/vite/socket.d.ts.map +1 -0
- package/dist/vite/worker.d.ts +16 -0
- package/dist/vite/worker.d.ts.map +1 -0
- package/dist/with-alxia.d.ts +36 -0
- package/dist/with-alxia.d.ts.map +1 -0
- package/docs/README.md +42 -0
- package/docs/guide/api-keys.md +216 -0
- package/docs/guide/beside-the-pages.md +201 -0
- package/docs/guide/csp-nonce.md +166 -0
- package/docs/guide/customising-the-server.md +324 -0
- package/docs/guide/deploying.md +102 -0
- package/docs/guide/document.md +334 -0
- package/docs/guide/errors.md +1147 -0
- package/docs/guide/fetcher.md +355 -0
- package/docs/guide/getting-started.md +112 -0
- package/docs/guide/help.md +325 -0
- package/docs/guide/how-it-works.md +274 -0
- package/docs/guide/link.md +32 -0
- package/docs/guide/lists.md +225 -0
- package/docs/guide/mcp.md +173 -0
- package/docs/guide/media.md +273 -0
- package/docs/guide/navigation.md +52 -0
- package/docs/guide/oauth.md +342 -0
- package/docs/guide/oidc.md +262 -0
- package/docs/guide/openapi.md +51 -0
- package/docs/guide/pwa.md +670 -0
- package/docs/guide/session.md +2105 -0
- package/docs/guide/subscriptions.md +211 -0
- package/docs/guide/testing.md +42 -0
- package/docs/guide/typing-the-loaders.md +311 -0
- package/docs/guide.md +82 -0
- package/docs/roadmap.md +474 -0
- package/docs/troubleshooting.md +3837 -0
- package/package.json +301 -5
|
@@ -0,0 +1,635 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NAME,
|
|
3
|
+
PASS_THROUGH,
|
|
4
|
+
serverEntry
|
|
5
|
+
} from "../chunks/index-sfhshxqz.js";
|
|
6
|
+
import {
|
|
7
|
+
buildWorker2
|
|
8
|
+
} from "../chunks/index-6jf7zpxz.js";
|
|
9
|
+
|
|
10
|
+
// src/vite/index.ts
|
|
11
|
+
import { join as join4, relative as relative3 } from "node:path";
|
|
12
|
+
|
|
13
|
+
// src/vite/bun.ts
|
|
14
|
+
import { builtinModules } from "node:module";
|
|
15
|
+
var BUN_CONDITION = "bun";
|
|
16
|
+
var VITE_BUILTINS = [
|
|
17
|
+
...builtinModules.filter((id) => !id.includes(":")),
|
|
18
|
+
/^node:/,
|
|
19
|
+
/^bun:/
|
|
20
|
+
];
|
|
21
|
+
var VITE_CONDITIONS = ["module", "node", "development|production"];
|
|
22
|
+
var VITE_EXTERNAL_CONDITIONS = ["node", "module-sync"];
|
|
23
|
+
var BUN_BUILTINS = [BUN_CONDITION, /^bun:/];
|
|
24
|
+
function adding(present, fallback, wanted) {
|
|
25
|
+
const list = present ?? fallback;
|
|
26
|
+
const has = (item) => list.some((other) => typeof item === "string" ? other === item : other instanceof RegExp && other.source === item.source);
|
|
27
|
+
return [
|
|
28
|
+
...present === undefined ? fallback : [],
|
|
29
|
+
...wanted.filter((item) => !has(item))
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
function bunEnvironment(options) {
|
|
33
|
+
const resolve = options.resolve ?? {};
|
|
34
|
+
const added = {
|
|
35
|
+
resolve: {
|
|
36
|
+
conditions: adding(resolve.conditions, VITE_CONDITIONS, [BUN_CONDITION]),
|
|
37
|
+
externalConditions: adding(resolve.externalConditions, VITE_EXTERNAL_CONDITIONS, [BUN_CONDITION]),
|
|
38
|
+
builtins: adding(resolve.builtins, VITE_BUILTINS, BUN_BUILTINS)
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
if (options.build?.target === undefined) {
|
|
42
|
+
added.build = { target: "esnext" };
|
|
43
|
+
}
|
|
44
|
+
return added;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// src/vite/bundle.ts
|
|
48
|
+
function bundledEnvironment(options) {
|
|
49
|
+
if (options.resolve?.external === true)
|
|
50
|
+
return;
|
|
51
|
+
return { resolve: { noExternal: true } };
|
|
52
|
+
}
|
|
53
|
+
function ssrEnvironment(options, command) {
|
|
54
|
+
const added = bunEnvironment(options);
|
|
55
|
+
const bundled = command === "build" ? bundledEnvironment(options) : undefined;
|
|
56
|
+
if (bundled === undefined)
|
|
57
|
+
return added;
|
|
58
|
+
return { ...added, resolve: { ...added.resolve, ...bundled.resolve } };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// src/vite/compress.ts
|
|
62
|
+
import { readdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
63
|
+
import { extname, join } from "node:path";
|
|
64
|
+
import { promisify } from "node:util";
|
|
65
|
+
import { brotliCompress, constants, gzip } from "node:zlib";
|
|
66
|
+
var brotli = promisify(brotliCompress);
|
|
67
|
+
var deflate = promisify(gzip);
|
|
68
|
+
var COMPRESSIBLE = new Set([
|
|
69
|
+
".js",
|
|
70
|
+
".mjs",
|
|
71
|
+
".cjs",
|
|
72
|
+
".css",
|
|
73
|
+
".html",
|
|
74
|
+
".htm",
|
|
75
|
+
".svg",
|
|
76
|
+
".json",
|
|
77
|
+
".map",
|
|
78
|
+
".txt",
|
|
79
|
+
".xml",
|
|
80
|
+
".webmanifest",
|
|
81
|
+
".wasm",
|
|
82
|
+
".ico",
|
|
83
|
+
".ttf",
|
|
84
|
+
".otf",
|
|
85
|
+
".eot"
|
|
86
|
+
]);
|
|
87
|
+
async function* walk(dir) {
|
|
88
|
+
for (const entry of await readdir(dir, { withFileTypes: true })) {
|
|
89
|
+
const path = join(dir, entry.name);
|
|
90
|
+
if (entry.isDirectory())
|
|
91
|
+
yield* walk(path);
|
|
92
|
+
else if (entry.isFile())
|
|
93
|
+
yield path;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function precompressClient(client, options = {}) {
|
|
97
|
+
const minSize = options.minSize ?? 1024;
|
|
98
|
+
let files = 0;
|
|
99
|
+
let bytes = 0;
|
|
100
|
+
let brotliBytes = 0;
|
|
101
|
+
for await (const path of walk(client)) {
|
|
102
|
+
if (!COMPRESSIBLE.has(extname(path).toLowerCase()))
|
|
103
|
+
continue;
|
|
104
|
+
const body = await readFile(path);
|
|
105
|
+
if (body.length < minSize)
|
|
106
|
+
continue;
|
|
107
|
+
const [br, gz] = await Promise.all([
|
|
108
|
+
brotli(body, {
|
|
109
|
+
params: {
|
|
110
|
+
[constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MAX_QUALITY,
|
|
111
|
+
[constants.BROTLI_PARAM_SIZE_HINT]: body.length
|
|
112
|
+
}
|
|
113
|
+
}),
|
|
114
|
+
deflate(body, { level: 9 })
|
|
115
|
+
]);
|
|
116
|
+
let written = false;
|
|
117
|
+
for (const [extension, copy] of [
|
|
118
|
+
["br", br],
|
|
119
|
+
["gz", gz]
|
|
120
|
+
]) {
|
|
121
|
+
if (copy.length < body.length) {
|
|
122
|
+
await writeFile(`${path}.${extension}`, copy);
|
|
123
|
+
written = true;
|
|
124
|
+
} else {
|
|
125
|
+
await rm(`${path}.${extension}`, { force: true });
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (!written)
|
|
129
|
+
continue;
|
|
130
|
+
files += 1;
|
|
131
|
+
bytes += body.length;
|
|
132
|
+
brotliBytes += Math.min(br.length, body.length);
|
|
133
|
+
}
|
|
134
|
+
return { files, bytes, brotliBytes };
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// src/vite/config.ts
|
|
138
|
+
import { existsSync } from "node:fs";
|
|
139
|
+
import { dirname, isAbsolute, join as join2, relative, resolve } from "node:path";
|
|
140
|
+
var SERVER = "virtual:alxia-react-router/server";
|
|
141
|
+
var DEFAULT = `${SERVER}-default`;
|
|
142
|
+
function contextOf(config) {
|
|
143
|
+
const context = config.__reactRouterPluginContext;
|
|
144
|
+
if (context === undefined) {
|
|
145
|
+
throw new Error(`${NAME}: React Router's Vite plugin is not in this config. Add reactRouter() from @react-router/dev/vite beside alxia() in vite.config.ts.`);
|
|
146
|
+
}
|
|
147
|
+
return context.reactRouterConfig;
|
|
148
|
+
}
|
|
149
|
+
function isChildCompiler(config) {
|
|
150
|
+
return config.__reactRouterPluginContext === undefined && config.cacheDir.endsWith(".vite-child-compiler");
|
|
151
|
+
}
|
|
152
|
+
function serverFile(entry, config) {
|
|
153
|
+
if (entry !== undefined) {
|
|
154
|
+
const file = isAbsolute(entry) ? entry : resolve(config.root, entry);
|
|
155
|
+
if (!existsSync(file)) {
|
|
156
|
+
throw new Error(`${NAME}: the entry ${entry} does not exist. Create it, or leave entry out to use app/server.ts, or the default server without it.`);
|
|
157
|
+
}
|
|
158
|
+
return file;
|
|
159
|
+
}
|
|
160
|
+
const file = join2(contextOf(config).appDirectory, "server.ts");
|
|
161
|
+
return existsSync(file) ? file : undefined;
|
|
162
|
+
}
|
|
163
|
+
function serverBuildPath(config) {
|
|
164
|
+
const rr = contextOf(config);
|
|
165
|
+
const outDir = resolve(config.root, config.environments["ssr"]?.build.outDir ?? join2(rr.buildDirectory, "server"));
|
|
166
|
+
return join2(outDir, rr.serverBuildFile);
|
|
167
|
+
}
|
|
168
|
+
function clientPath(config) {
|
|
169
|
+
const built = dirname(serverBuildPath(config));
|
|
170
|
+
const path = relative(built, join2(contextOf(config).buildDirectory, "client"));
|
|
171
|
+
return path.startsWith(".") ? path : `./${path}`;
|
|
172
|
+
}
|
|
173
|
+
function serverBuildOptions(rolldown) {
|
|
174
|
+
return rolldown ? {
|
|
175
|
+
rolldownOptions: {
|
|
176
|
+
input: SERVER,
|
|
177
|
+
output: { codeSplitting: false }
|
|
178
|
+
}
|
|
179
|
+
} : {
|
|
180
|
+
rollupOptions: {
|
|
181
|
+
input: SERVER,
|
|
182
|
+
output: { inlineDynamicImports: true }
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// src/vite/node.ts
|
|
188
|
+
import { Readable } from "node:stream";
|
|
189
|
+
function toRequest(req, res) {
|
|
190
|
+
const secure = req.socket.encrypted === true;
|
|
191
|
+
const url = new URL(req.originalUrl ?? req.url ?? "/", `${secure ? "https" : "http"}://${req.headers.host ?? "localhost"}`);
|
|
192
|
+
const headers = new Headers;
|
|
193
|
+
const raw = req.rawHeaders;
|
|
194
|
+
for (let i = 0;i + 1 < raw.length; i += 2) {
|
|
195
|
+
const name = raw[i];
|
|
196
|
+
if (!name.startsWith(":"))
|
|
197
|
+
headers.append(name, raw[i + 1]);
|
|
198
|
+
}
|
|
199
|
+
const controller = new AbortController;
|
|
200
|
+
res.once("close", () => {
|
|
201
|
+
if (!res.writableFinished)
|
|
202
|
+
controller.abort();
|
|
203
|
+
});
|
|
204
|
+
const method = req.method ?? "GET";
|
|
205
|
+
const init = {
|
|
206
|
+
method,
|
|
207
|
+
headers,
|
|
208
|
+
signal: controller.signal
|
|
209
|
+
};
|
|
210
|
+
if (method !== "GET" && method !== "HEAD") {
|
|
211
|
+
init.body = Readable.toWeb(req);
|
|
212
|
+
init.duplex = "half";
|
|
213
|
+
}
|
|
214
|
+
return new Request(url, init);
|
|
215
|
+
}
|
|
216
|
+
async function send(res, response) {
|
|
217
|
+
res.statusCode = response.status;
|
|
218
|
+
if (response.statusText !== "")
|
|
219
|
+
res.statusMessage = response.statusText;
|
|
220
|
+
for (const [name, value] of response.headers) {
|
|
221
|
+
if (name !== "set-cookie")
|
|
222
|
+
res.setHeader(name, value);
|
|
223
|
+
}
|
|
224
|
+
const cookies = response.headers.getSetCookie();
|
|
225
|
+
if (cookies.length > 0)
|
|
226
|
+
res.setHeader("set-cookie", cookies);
|
|
227
|
+
if (response.body === null) {
|
|
228
|
+
res.end();
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
res.flushHeaders();
|
|
232
|
+
const reader = response.body.getReader();
|
|
233
|
+
const cancel = () => void reader.cancel().catch(() => {});
|
|
234
|
+
res.once("close", cancel);
|
|
235
|
+
try {
|
|
236
|
+
for (;; ) {
|
|
237
|
+
const { done, value } = await reader.read();
|
|
238
|
+
if (done)
|
|
239
|
+
break;
|
|
240
|
+
if (res.destroyed)
|
|
241
|
+
return;
|
|
242
|
+
if (!res.write(value)) {
|
|
243
|
+
await new Promise((resolve) => {
|
|
244
|
+
const go = () => {
|
|
245
|
+
res.off("drain", go);
|
|
246
|
+
res.off("close", go);
|
|
247
|
+
resolve();
|
|
248
|
+
};
|
|
249
|
+
res.on("drain", go);
|
|
250
|
+
res.on("close", go);
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
res.end();
|
|
255
|
+
} finally {
|
|
256
|
+
res.off("close", cancel);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// src/vite/socket.ts
|
|
261
|
+
import { connect } from "node:net";
|
|
262
|
+
var VITE = new Set(["vite-hmr", "vite-ping"]);
|
|
263
|
+
function isVites(req) {
|
|
264
|
+
const protocols = req.headers["sec-websocket-protocol"];
|
|
265
|
+
if (protocols === undefined)
|
|
266
|
+
return false;
|
|
267
|
+
return protocols.split(",").some((protocol) => VITE.has(protocol.trim()));
|
|
268
|
+
}
|
|
269
|
+
function isProxied(url, proxy) {
|
|
270
|
+
for (const [context, entry] of Object.entries(proxy ?? {})) {
|
|
271
|
+
const matches = context.startsWith("^") && new RegExp(context).test(url) || url.startsWith(context);
|
|
272
|
+
if (!matches)
|
|
273
|
+
continue;
|
|
274
|
+
const options = typeof entry === "string" ? { target: entry } : entry;
|
|
275
|
+
const target = String(options.target ?? "");
|
|
276
|
+
if (options.ws === true || target.startsWith("ws:") || target.startsWith("wss:")) {
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
function head(req) {
|
|
283
|
+
const lines = [`${req.method ?? "GET"} ${req.url ?? "/"} HTTP/1.1`];
|
|
284
|
+
const raw = req.rawHeaders;
|
|
285
|
+
for (let i = 0;i + 1 < raw.length; i += 2) {
|
|
286
|
+
lines.push(`${raw[i]}: ${raw[i + 1]}`);
|
|
287
|
+
}
|
|
288
|
+
return `${lines.join(`\r
|
|
289
|
+
`)}\r
|
|
290
|
+
\r
|
|
291
|
+
`;
|
|
292
|
+
}
|
|
293
|
+
function sideFor(sides, app) {
|
|
294
|
+
if (sides.current?.app === app)
|
|
295
|
+
return sides.current.side;
|
|
296
|
+
const side = Bun.serve({
|
|
297
|
+
port: 0,
|
|
298
|
+
hostname: "127.0.0.1",
|
|
299
|
+
fetch: (request, bun) => app.fetch(request, bun),
|
|
300
|
+
websocket: app.websocket
|
|
301
|
+
});
|
|
302
|
+
const old = sides.current?.side;
|
|
303
|
+
if (old !== undefined) {
|
|
304
|
+
sides.retired.add(old);
|
|
305
|
+
old.stop().then(() => sides.retired.delete(old));
|
|
306
|
+
}
|
|
307
|
+
sides.current = { app, side };
|
|
308
|
+
return side;
|
|
309
|
+
}
|
|
310
|
+
function closeAll(sides) {
|
|
311
|
+
for (const side of [...sides.retired, sides.current?.side]) {
|
|
312
|
+
side?.stop(true);
|
|
313
|
+
}
|
|
314
|
+
sides.current = undefined;
|
|
315
|
+
sides.retired.clear();
|
|
316
|
+
}
|
|
317
|
+
function relay(req, socket, bytes, port) {
|
|
318
|
+
const upstream = connect(port, "127.0.0.1", () => {
|
|
319
|
+
upstream.write(head(req));
|
|
320
|
+
if (bytes.length > 0)
|
|
321
|
+
upstream.write(bytes);
|
|
322
|
+
upstream.pipe(socket);
|
|
323
|
+
socket.pipe(upstream);
|
|
324
|
+
});
|
|
325
|
+
upstream.on("error", () => socket.destroy());
|
|
326
|
+
upstream.on("close", () => socket.destroy());
|
|
327
|
+
socket.on("close", () => upstream.destroy());
|
|
328
|
+
}
|
|
329
|
+
function refuse(bridge, socket, error) {
|
|
330
|
+
if (error instanceof Error)
|
|
331
|
+
bridge.fix?.(error);
|
|
332
|
+
bridge.logger.error(`${NAME}: a WebSocket upgrade failed: ${error instanceof Error ? error.stack ?? error.message : String(error)}`);
|
|
333
|
+
if (socket.writable) {
|
|
334
|
+
socket.end(`HTTP/1.1 500 Internal Server Error\r
|
|
335
|
+
Connection: close\r
|
|
336
|
+
Content-Length: 0\r
|
|
337
|
+
\r
|
|
338
|
+
`);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
function bridgeSockets(http, bridge) {
|
|
342
|
+
if (http === null)
|
|
343
|
+
return () => {
|
|
344
|
+
return;
|
|
345
|
+
};
|
|
346
|
+
const sides = { current: undefined, retired: new Set };
|
|
347
|
+
let closed = false;
|
|
348
|
+
http.on("upgrade", (req, socket, bytes) => {
|
|
349
|
+
if (isVites(req) || isProxied(req.url ?? "/", bridge.proxy))
|
|
350
|
+
return;
|
|
351
|
+
socket.on("error", () => socket.destroy());
|
|
352
|
+
bridge.load().then((app) => {
|
|
353
|
+
if (socket.destroyed)
|
|
354
|
+
return;
|
|
355
|
+
relay(req, socket, bytes, sideFor(sides, app).port);
|
|
356
|
+
}).catch((error) => refuse(bridge, socket, error));
|
|
357
|
+
});
|
|
358
|
+
http.once("close", () => {
|
|
359
|
+
closed = true;
|
|
360
|
+
closeAll(sides);
|
|
361
|
+
});
|
|
362
|
+
return (app) => closed ? undefined : sideFor(sides, app);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// src/vite/dev.ts
|
|
366
|
+
async function loadApp(server, entry) {
|
|
367
|
+
const runner = server.environments.ssr?.runner;
|
|
368
|
+
if (typeof runner?.import !== "function") {
|
|
369
|
+
throw new Error(`${NAME}: Vite's ssr environment does not run modules in this process, so the server cannot be loaded.`);
|
|
370
|
+
}
|
|
371
|
+
const id = serverFile(entry, server.config) === undefined ? DEFAULT : SERVER;
|
|
372
|
+
const module = await runner.import(id);
|
|
373
|
+
return module.default;
|
|
374
|
+
}
|
|
375
|
+
async function serveFromEntry(server, entry, sideOf, req, res) {
|
|
376
|
+
const app = await loadApp(server, entry);
|
|
377
|
+
await send(res, await app.fetch(toRequest(req, res), sideOf(app)));
|
|
378
|
+
}
|
|
379
|
+
function serveDev(server, entry) {
|
|
380
|
+
const sideOf = bridgeSockets(server.httpServer, {
|
|
381
|
+
proxy: server.config.server.proxy,
|
|
382
|
+
load: () => loadApp(server, entry),
|
|
383
|
+
logger: server.config.logger,
|
|
384
|
+
fix: (error) => server.ssrFixStacktrace(error)
|
|
385
|
+
});
|
|
386
|
+
return () => {
|
|
387
|
+
server.middlewares.use((req, res, next) => {
|
|
388
|
+
serveFromEntry(server, entry, sideOf, req, res).catch((error) => {
|
|
389
|
+
if (error instanceof Error)
|
|
390
|
+
server.ssrFixStacktrace(error);
|
|
391
|
+
next(error);
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// src/vite/hosts.ts
|
|
398
|
+
function parseHosts(value) {
|
|
399
|
+
if (value === undefined)
|
|
400
|
+
return [];
|
|
401
|
+
return value.split(",").map((host) => host.trim()).filter((host) => host !== "");
|
|
402
|
+
}
|
|
403
|
+
function wantedHosts(option, env) {
|
|
404
|
+
const all = [...option ?? [], ...parseHosts(env)].map((host) => host.trim()).filter((host) => host !== "");
|
|
405
|
+
return [...new Set(all)];
|
|
406
|
+
}
|
|
407
|
+
function hostsToAdd(existing, wanted) {
|
|
408
|
+
if (existing === true || wanted.length === 0)
|
|
409
|
+
return;
|
|
410
|
+
const have = new Set(existing ?? []);
|
|
411
|
+
const added = wanted.filter((host) => !have.has(host));
|
|
412
|
+
return added.length === 0 ? undefined : added;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// src/vite/inline.ts
|
|
416
|
+
import { fileURLToPath } from "node:url";
|
|
417
|
+
var INLINED = new Set([
|
|
418
|
+
"@softistx/alxia-react-router/entry",
|
|
419
|
+
"@softistx/alxia-react-router/document"
|
|
420
|
+
]);
|
|
421
|
+
function inlineAliases() {
|
|
422
|
+
return {
|
|
423
|
+
resolve: {
|
|
424
|
+
alias: [...INLINED].map((id) => ({ find: id, replacement: id }))
|
|
425
|
+
}
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
function inlinedFile(id) {
|
|
429
|
+
if (!INLINED.has(id))
|
|
430
|
+
return;
|
|
431
|
+
try {
|
|
432
|
+
return fileURLToPath(import.meta.resolve(id));
|
|
433
|
+
} catch {
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// src/vite/preview.ts
|
|
439
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
440
|
+
import { relative as relative2 } from "node:path";
|
|
441
|
+
import { pathToFileURL } from "node:url";
|
|
442
|
+
async function load(file, label) {
|
|
443
|
+
if (!existsSync2(file)) {
|
|
444
|
+
throw new Error(`${NAME}: ${label} does not exist. Run react-router build before vite preview.`);
|
|
445
|
+
}
|
|
446
|
+
const module = await import(pathToFileURL(file).href);
|
|
447
|
+
if (typeof module.default?.fetch !== "function") {
|
|
448
|
+
throw new Error(`${NAME}: ${label} is not alxia's server: its default export has no fetch. Build it with alxia() in vite.config.ts's plugins, then run vite preview again.`);
|
|
449
|
+
}
|
|
450
|
+
return module.default;
|
|
451
|
+
}
|
|
452
|
+
function servePreview(server) {
|
|
453
|
+
const file = serverBuildPath(server.config);
|
|
454
|
+
const label = relative2(server.config.root, file);
|
|
455
|
+
let app;
|
|
456
|
+
const current = () => {
|
|
457
|
+
app ??= load(file, label);
|
|
458
|
+
return app;
|
|
459
|
+
};
|
|
460
|
+
const sideOf = bridgeSockets(server.httpServer, {
|
|
461
|
+
proxy: server.config.preview.proxy,
|
|
462
|
+
load: () => current().catch((error) => {
|
|
463
|
+
app = undefined;
|
|
464
|
+
throw error;
|
|
465
|
+
}),
|
|
466
|
+
logger: server.config.logger
|
|
467
|
+
});
|
|
468
|
+
server.middlewares.use((req, res, next) => {
|
|
469
|
+
current().then(async (loaded) => {
|
|
470
|
+
try {
|
|
471
|
+
const side = sideOf(loaded);
|
|
472
|
+
await send(res, await loaded.fetch(toRequest(req, res), side));
|
|
473
|
+
} catch (error) {
|
|
474
|
+
if (res.headersSent)
|
|
475
|
+
res.destroy(error);
|
|
476
|
+
else
|
|
477
|
+
next(error);
|
|
478
|
+
}
|
|
479
|
+
}, (error) => {
|
|
480
|
+
app = undefined;
|
|
481
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
482
|
+
server.config.logger.error(message);
|
|
483
|
+
res.statusCode = 500;
|
|
484
|
+
res.setHeader("content-type", "text/plain; charset=utf-8");
|
|
485
|
+
res.end(message);
|
|
486
|
+
});
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// src/vite/runtime.ts
|
|
491
|
+
function requireBun(command, hint = `bun --bun ${command}`, onBun = globalThis.Bun !== undefined, reason = "and alxia's server runs on Bun") {
|
|
492
|
+
if (onBun)
|
|
493
|
+
return;
|
|
494
|
+
throw new Error(`${NAME}: ${command} is running on Node, ${reason}. Add a bunfig.toml beside package.json with "[run]" and "bun = true", so bun run starts it on Bun, or run it as ${hint}.`);
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
// src/vite/worker.ts
|
|
498
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
499
|
+
import { basename, isAbsolute as isAbsolute2, join as join3, resolve as resolve2 } from "node:path";
|
|
500
|
+
function workerFile(option, config) {
|
|
501
|
+
if (option === false)
|
|
502
|
+
return;
|
|
503
|
+
const named = typeof option === "string" ? option : option?.file;
|
|
504
|
+
if (named !== undefined) {
|
|
505
|
+
const file = isAbsolute2(named) ? named : resolve2(config.root, named);
|
|
506
|
+
if (!existsSync3(file)) {
|
|
507
|
+
throw new Error(`${NAME}: the worker ${named} does not exist. Create it, or leave worker out to build app/service-worker.ts when it exists.`);
|
|
508
|
+
}
|
|
509
|
+
return file;
|
|
510
|
+
}
|
|
511
|
+
const file = join3(contextOf(config).appDirectory, "service-worker.ts");
|
|
512
|
+
return existsSync3(file) ? file : undefined;
|
|
513
|
+
}
|
|
514
|
+
var MB = (bytes) => (bytes / 1024 / 1024).toFixed(2);
|
|
515
|
+
var KB = (bytes) => (bytes / 1024).toFixed(1);
|
|
516
|
+
async function buildAppWorker(config, option) {
|
|
517
|
+
const file = workerFile(option, config);
|
|
518
|
+
if (file === undefined)
|
|
519
|
+
return;
|
|
520
|
+
requireBun("react-router build with a service worker", "bun --bun react-router build", undefined, "and the worker is bundled by Bun.build");
|
|
521
|
+
const rest = typeof option === "object" ? option : {};
|
|
522
|
+
const built = await buildWorker2({
|
|
523
|
+
...rest,
|
|
524
|
+
file,
|
|
525
|
+
root: config.root,
|
|
526
|
+
client: join3(contextOf(config).buildDirectory, "client")
|
|
527
|
+
}).catch((error) => {
|
|
528
|
+
throw new Error(`${NAME}: ${error.message}`, { cause: error });
|
|
529
|
+
});
|
|
530
|
+
config.logger.info(`✓ ${basename(built.file)}: ${built.precache.length} files precached (${MB(built.precacheBytes)} MB), worker ${KB(built.bytes)} kB`);
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
// src/vite/index.ts
|
|
534
|
+
var RESOLVED_SERVER = `\x00${SERVER}`;
|
|
535
|
+
var RESOLVED_DEFAULT = `\x00${DEFAULT}`;
|
|
536
|
+
function servesApp(resolved) {
|
|
537
|
+
if (isChildCompiler(resolved))
|
|
538
|
+
return false;
|
|
539
|
+
const rr = contextOf(resolved);
|
|
540
|
+
if (rr.ssr && rr.serverBundles !== undefined) {
|
|
541
|
+
throw new Error(`${NAME}: serverBundles splits React Router's server build in several, and alxia serves one. Remove serverBundles from react-router.config.ts.`);
|
|
542
|
+
}
|
|
543
|
+
return rr.ssr;
|
|
544
|
+
}
|
|
545
|
+
function alxia(options = {}) {
|
|
546
|
+
let config;
|
|
547
|
+
let enabled = true;
|
|
548
|
+
return {
|
|
549
|
+
name: NAME,
|
|
550
|
+
enforce: "pre",
|
|
551
|
+
config(userConfig, env) {
|
|
552
|
+
const wanted = wantedHosts(options.allowedHosts, process.env["DEV_ALLOWED_HOSTS"]);
|
|
553
|
+
const server = hostsToAdd(userConfig.server?.allowedHosts, wanted);
|
|
554
|
+
const own = userConfig.preview?.allowedHosts;
|
|
555
|
+
const inherited = userConfig.server?.allowedHosts;
|
|
556
|
+
const preview = wanted.length > 0 && own === undefined && inherited !== undefined && inherited !== true ? hostsToAdd(undefined, [...inherited, ...wanted]) : hostsToAdd(own ?? inherited, wanted);
|
|
557
|
+
const hosts = {
|
|
558
|
+
...server === undefined ? {} : { server: { allowedHosts: server } },
|
|
559
|
+
...preview === undefined ? {} : { preview: { allowedHosts: preview } }
|
|
560
|
+
};
|
|
561
|
+
if (env.command === "serve") {
|
|
562
|
+
return { ...hosts, ...inlineAliases() };
|
|
563
|
+
}
|
|
564
|
+
if (env.command !== "build")
|
|
565
|
+
return;
|
|
566
|
+
const meta = this.meta;
|
|
567
|
+
const bundler = serverBuildOptions(meta.rolldownVersion !== undefined);
|
|
568
|
+
return { environments: { ssr: { build: bundler } } };
|
|
569
|
+
},
|
|
570
|
+
configEnvironment(name, options, env) {
|
|
571
|
+
if (name !== "ssr" || env.isSsrTargetWebworker === true)
|
|
572
|
+
return;
|
|
573
|
+
return ssrEnvironment(options, env.command);
|
|
574
|
+
},
|
|
575
|
+
configResolved(resolved) {
|
|
576
|
+
config = resolved;
|
|
577
|
+
enabled = servesApp(resolved);
|
|
578
|
+
},
|
|
579
|
+
resolveId(id) {
|
|
580
|
+
if (id === SERVER)
|
|
581
|
+
return RESOLVED_SERVER;
|
|
582
|
+
if (id === DEFAULT)
|
|
583
|
+
return RESOLVED_DEFAULT;
|
|
584
|
+
if (this.environment?.name === "ssr")
|
|
585
|
+
return inlinedFile(id);
|
|
586
|
+
return;
|
|
587
|
+
},
|
|
588
|
+
load(id) {
|
|
589
|
+
if (id !== RESOLVED_SERVER && id !== RESOLVED_DEFAULT)
|
|
590
|
+
return;
|
|
591
|
+
if (config === undefined)
|
|
592
|
+
return;
|
|
593
|
+
if (!enabled)
|
|
594
|
+
return PASS_THROUGH;
|
|
595
|
+
const dev = config.command === "serve";
|
|
596
|
+
const file = id === RESOLVED_DEFAULT ? undefined : serverFile(options.entry, config);
|
|
597
|
+
return serverEntry({
|
|
598
|
+
file,
|
|
599
|
+
label: file === undefined ? "" : relative3(config.root, file),
|
|
600
|
+
dev,
|
|
601
|
+
client: dev ? undefined : clientPath(config)
|
|
602
|
+
});
|
|
603
|
+
},
|
|
604
|
+
buildApp: {
|
|
605
|
+
order: "post",
|
|
606
|
+
async handler() {
|
|
607
|
+
if (config === undefined)
|
|
608
|
+
return;
|
|
609
|
+
await buildAppWorker(config, options.worker);
|
|
610
|
+
if (!enabled || options.precompress === false)
|
|
611
|
+
return;
|
|
612
|
+
const done = await precompressClient(join4(contextOf(config).buildDirectory, "client"), options.precompress);
|
|
613
|
+
config.logger.info(`✓ ${done.files} client files precompressed (${(done.bytes / 1024).toFixed(0)} kB → ${(done.brotliBytes / 1024).toFixed(0)} kB brotli)`);
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
configureServer(server) {
|
|
617
|
+
if (!enabled)
|
|
618
|
+
return;
|
|
619
|
+
requireBun("react-router dev");
|
|
620
|
+
return serveDev(server, options.entry);
|
|
621
|
+
},
|
|
622
|
+
configurePreviewServer(server) {
|
|
623
|
+
if (!enabled)
|
|
624
|
+
return;
|
|
625
|
+
requireBun("vite preview, or a react-router build that prerenders,", "bun --bun vite preview or bun --bun react-router build");
|
|
626
|
+
servePreview(server);
|
|
627
|
+
}
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
export {
|
|
631
|
+
alxia
|
|
632
|
+
};
|
|
633
|
+
|
|
634
|
+
//# debugId=E2AC6F2E68B3381964756E2164756E21
|
|
635
|
+
//# sourceMappingURL=index.js.map
|