eddev 2.0.0-beta.2 → 2.0.0-beta.200
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/css/editor-styles.css +4 -0
- package/dist/app/entry/HydrationOverlay.d.ts +2 -0
- package/dist/app/entry/HydrationOverlay.d.ts.map +1 -0
- package/dist/app/entry/HydrationOverlay.js +2 -0
- package/dist/app/entry/MetaTags.d.ts +8 -0
- package/dist/app/entry/MetaTags.d.ts.map +1 -0
- package/dist/app/entry/MetaTags.js +30 -0
- package/dist/app/entry/boot-admin.d.ts +2 -0
- package/dist/app/entry/boot-admin.d.ts.map +1 -0
- package/dist/app/entry/boot-admin.js +12 -0
- package/dist/app/entry/hydration-script.d.ts +2 -0
- package/dist/app/entry/hydration-script.d.ts.map +1 -0
- package/dist/app/entry/hydration-script.js +18 -0
- package/dist/app/entry/spa-root.d.ts +2 -0
- package/dist/app/entry/spa-root.d.ts.map +1 -0
- package/dist/app/entry/spa-root.js +7 -0
- package/dist/app/entry/ssr-root-client.d.ts +7 -0
- package/dist/app/entry/ssr-root-client.d.ts.map +1 -0
- package/dist/app/entry/ssr-root-client.js +21 -0
- package/dist/app/entry/ssr-root.d.ts +11 -0
- package/dist/app/entry/ssr-root.d.ts.map +1 -0
- package/dist/app/entry/ssr-root.js +22 -0
- package/dist/app/lib/admin/defineField.d.ts +1 -0
- package/dist/app/lib/admin/defineField.d.ts.map +1 -0
- package/dist/app/lib/admin/defineWidget.d.ts +1 -0
- package/dist/app/lib/admin/defineWidget.d.ts.map +1 -0
- package/dist/app/lib/admin/index.d.ts +3 -2
- package/dist/app/lib/admin/index.d.ts.map +1 -0
- package/dist/app/lib/admin/index.js +2 -2
- package/dist/app/lib/admin/installFieldTypes.d.ts +1 -0
- package/dist/app/lib/admin/installFieldTypes.d.ts.map +1 -0
- package/dist/app/lib/admin/installFieldTypes.js +3 -1
- package/dist/app/lib/admin/runWidgets.d.ts +1 -0
- package/dist/app/lib/admin/runWidgets.d.ts.map +1 -0
- package/dist/app/lib/admin/runWidgets.js +8 -3
- package/dist/app/lib/blocks/ContentBlocks.d.ts +7 -4
- package/dist/app/lib/blocks/ContentBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/ContentBlocks.js +19 -6
- package/dist/app/lib/blocks/EditableText.d.ts +31 -6
- package/dist/app/lib/blocks/EditableText.d.ts.map +1 -0
- package/dist/app/lib/blocks/EditableText.js +36 -7
- package/dist/app/lib/blocks/InnerBlocks.d.ts +23 -8
- package/dist/app/lib/blocks/InnerBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/InnerBlocks.js +76 -28
- package/dist/app/lib/blocks/SlotBlocks.d.ts +8 -0
- package/dist/app/lib/blocks/SlotBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/SlotBlocks.js +46 -0
- package/dist/app/lib/blocks/block-utils.d.ts +3 -2
- package/dist/app/lib/blocks/block-utils.d.ts.map +1 -0
- package/dist/app/lib/blocks/block-utils.js +4 -2
- package/dist/app/lib/blocks/builtin-blocks.d.ts +2 -0
- package/dist/app/lib/blocks/builtin-blocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/builtin-blocks.js +55 -0
- package/dist/app/lib/blocks/defineBlock.d.ts +4 -0
- package/dist/app/lib/blocks/defineBlock.d.ts.map +1 -0
- package/dist/app/lib/blocks/defineBlock.js +9 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts +8 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.js +164 -0
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts +1 -0
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorSupport.js +19 -12
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +1 -0
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/block-templates.d.ts +8 -1
- package/dist/app/lib/blocks/editor/block-templates.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/block-templates.js +71 -2
- package/dist/app/lib/blocks/editor/blocks-by-tag.d.ts +1 -0
- package/dist/app/lib/blocks/editor/blocks-by-tag.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/controls.d.ts +1 -0
- package/dist/app/lib/blocks/editor/controls.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/create-block.d.ts +10 -0
- package/dist/app/lib/blocks/editor/create-block.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/create-block.js +13 -0
- package/dist/app/lib/blocks/editor/editor-config.d.ts +78 -9
- package/dist/app/lib/blocks/editor/editor-config.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/editor-config.js +29 -62
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts +4 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.js +130 -25
- package/dist/app/lib/blocks/editor/root-blocks.d.ts +7 -0
- package/dist/app/lib/blocks/editor/root-blocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/root-blocks.js +30 -0
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts +13 -2
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/usePostEditor.js +28 -13
- package/dist/app/lib/blocks/index.d.ts +12 -9
- package/dist/app/lib/blocks/index.d.ts.map +1 -0
- package/dist/app/lib/blocks/index.js +11 -9
- package/dist/app/lib/blocks/inline-editing.d.ts +11 -1
- package/dist/app/lib/blocks/inline-editing.d.ts.map +1 -0
- package/dist/app/lib/blocks/inline-editing.js +15 -5
- package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts +1 -0
- package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/BreakpointIndicator.js +7 -5
- package/dist/app/lib/devtools/components/DevUI.d.ts +1 -0
- package/dist/app/lib/devtools/components/DevUI.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/DevUI.js +4 -3
- package/dist/app/lib/devtools/components/GridIndicator.d.ts +2 -0
- package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/GridIndicator.js +29 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts +10 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts.map +1 -0
- package/dist/app/lib/devtools/dev-tools-store.js +8 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts +2 -1
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/usePersistState.js +11 -2
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +2311 -1267
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/useTailwind.js +6 -3
- package/dist/app/lib/devtools/index.d.ts +2 -0
- package/dist/app/lib/devtools/index.d.ts.map +1 -0
- package/dist/app/lib/devtools/index.js +1 -1
- package/dist/app/lib/devtools/loader.d.ts +1 -0
- package/dist/app/lib/devtools/loader.d.ts.map +1 -0
- package/dist/app/lib/devtools/loader.js +8 -7
- package/dist/app/lib/devtools/tailwind.config.d.ts +1 -0
- package/dist/app/lib/devtools/tailwind.config.d.ts.map +1 -0
- package/dist/app/lib/devtools/useQueryDebug.d.ts +8 -1
- package/dist/app/lib/devtools/useQueryDebug.d.ts.map +1 -0
- package/dist/app/lib/devtools/useQueryDebug.js +5 -8
- package/dist/app/lib/dynamic/dynamic.d.ts +2 -1
- package/dist/app/lib/dynamic/dynamic.d.ts.map +1 -0
- package/dist/app/lib/dynamic/dynamic.js +5 -1
- package/dist/app/lib/dynamic/index.d.ts +2 -1
- package/dist/app/lib/dynamic/index.d.ts.map +1 -0
- package/dist/app/lib/dynamic/index.js +1 -1
- package/dist/app/lib/hooks/index.d.ts +5 -5
- package/dist/app/lib/hooks/index.d.ts.map +1 -0
- package/dist/app/lib/hooks/index.js +4 -5
- package/dist/app/lib/hooks/{queryUtils.d.ts → query-hooks.d.ts} +46 -4
- package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -0
- package/dist/app/lib/hooks/{queryUtils.js → query-hooks.js} +99 -40
- package/dist/app/lib/hooks/useAppData.d.ts +1 -0
- package/dist/app/lib/hooks/useAppData.d.ts.map +1 -0
- package/dist/app/lib/hooks/useAppData.js +12 -1
- package/dist/app/lib/hooks/useRPC.d.ts +1 -4
- package/dist/app/lib/hooks/useRPC.d.ts.map +1 -0
- package/dist/app/lib/hooks/useRPC.js +0 -8
- package/dist/app/lib/integrations/gravityforms/index.d.ts +3 -0
- package/dist/app/lib/integrations/gravityforms/index.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/index.js +2 -0
- package/dist/app/lib/integrations/gravityforms/types.d.ts +145 -0
- package/dist/app/lib/integrations/gravityforms/types.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/types.js +1 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts +31 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.js +295 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts +18 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts.map +1 -0
- package/dist/app/lib/internal/finalize-rpc.js +3 -0
- package/dist/app/lib/internal/index.d.ts +6 -4
- package/dist/app/lib/internal/index.d.ts.map +1 -0
- package/dist/app/lib/internal/index.js +5 -4
- package/dist/app/lib/internal/internal-store.d.ts +1 -2
- package/dist/app/lib/internal/internal-store.d.ts.map +1 -0
- package/dist/app/lib/internal/internal-store.js +1 -3
- package/dist/app/lib/internal/read-admin-manifest.d.ts +2 -1
- package/dist/app/lib/internal/read-admin-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-block-manifest.d.ts +1 -0
- package/dist/app/lib/internal/read-block-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-view-manifest.d.ts +1 -0
- package/dist/app/lib/internal/read-view-manifest.d.ts.map +1 -0
- package/dist/app/lib/legacy-stitches/createStitches.d.ts +22 -21
- package/dist/app/lib/legacy-stitches/createStitches.d.ts.map +1 -0
- package/dist/app/lib/legacy-stitches/createStitches.js +1 -1
- package/dist/app/lib/legacy-stitches/index.d.ts +2 -1
- package/dist/app/lib/legacy-stitches/index.d.ts.map +1 -0
- package/dist/app/lib/legacy-stitches/index.js +1 -1
- package/dist/app/lib/routing/components/BackButton.d.ts +50 -0
- package/dist/app/lib/routing/components/BackButton.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BackButton.js +47 -0
- package/dist/app/lib/routing/components/BrowserRouter.d.ts +10 -1
- package/dist/app/lib/routing/components/BrowserRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BrowserRouter.js +138 -23
- package/dist/app/lib/routing/components/ClientOnly.d.ts +1 -0
- package/dist/app/lib/routing/components/ClientOnly.d.ts.map +1 -0
- package/dist/app/lib/routing/components/ClientOnly.js +2 -2
- package/dist/app/lib/routing/components/Link.d.ts +19 -2
- package/dist/app/lib/routing/components/Link.d.ts.map +1 -0
- package/dist/app/lib/routing/components/Link.js +47 -27
- package/dist/app/lib/routing/components/NativeLinkHandler.d.ts +10 -0
- package/dist/app/lib/routing/components/NativeLinkHandler.d.ts.map +1 -0
- package/dist/app/lib/routing/components/NativeLinkHandler.js +23 -0
- package/dist/app/lib/routing/components/RouteRenderer.d.ts +2 -1
- package/dist/app/lib/routing/components/RouteRenderer.d.ts.map +1 -0
- package/dist/app/lib/routing/components/RouteRenderer.js +20 -6
- package/dist/app/lib/routing/components/SSRRouter.d.ts +5 -2
- package/dist/app/lib/routing/components/SSRRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/components/SSRRouter.js +7 -6
- package/dist/app/lib/routing/components/ScrollRestoration.d.ts +1 -0
- package/dist/app/lib/routing/components/ScrollRestoration.d.ts.map +1 -0
- package/dist/app/lib/routing/components/ScrollRestoration.js +5 -2
- package/dist/app/lib/routing/context.d.ts +9 -5
- package/dist/app/lib/routing/context.d.ts.map +1 -0
- package/dist/app/lib/routing/context.js +13 -96
- package/dist/app/lib/routing/hooks/useIsSSR.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useIsSSR.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts +3 -1
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRestorableState.js +2 -1
- package/dist/app/lib/routing/hooks/useRoute.d.ts +17 -1
- package/dist/app/lib/routing/hooks/useRoute.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRoute.js +22 -1
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +6 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +2 -1
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.js +1 -1
- package/dist/app/lib/routing/hooks/useRouter.d.ts +2 -1
- package/dist/app/lib/routing/hooks/useRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouter.js +1 -1
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +2 -1
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouterEvents.js +1 -1
- package/dist/app/lib/routing/hooks/useRouterState.d.ts +2 -1
- package/dist/app/lib/routing/hooks/useRouterState.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouterState.js +1 -1
- package/dist/app/lib/routing/hooks/useSearchParams.d.ts +78 -6
- package/dist/app/lib/routing/hooks/useSearchParams.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useSearchParams.js +77 -17
- package/dist/app/lib/routing/index.d.ts +16 -13
- package/dist/app/lib/routing/index.d.ts.map +1 -0
- package/dist/app/lib/routing/index.js +15 -13
- package/dist/app/lib/routing/loader.d.ts +3 -2
- package/dist/app/lib/routing/loader.d.ts.map +1 -0
- package/dist/app/lib/routing/loader.js +26 -15
- package/dist/app/lib/routing/types.d.ts +62 -14
- package/dist/app/lib/routing/types.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.d.ts +7 -2
- package/dist/app/lib/routing/utils.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.js +41 -4
- package/dist/app/lib/{hooks → runtime}/apiConfig.d.ts +11 -2
- package/dist/app/lib/runtime/apiConfig.d.ts.map +1 -0
- package/dist/app/lib/runtime/apiConfig.js +6 -0
- package/dist/app/lib/runtime/errorHandling.d.ts +40 -0
- package/dist/app/lib/runtime/errorHandling.d.ts.map +1 -0
- package/dist/app/lib/runtime/errorHandling.js +6 -0
- package/dist/app/lib/runtime/index.d.ts +3 -0
- package/dist/app/lib/runtime/index.d.ts.map +1 -0
- package/dist/app/lib/runtime/index.js +2 -0
- package/dist/app/lib/views/defineView.d.ts +2 -1
- package/dist/app/lib/views/defineView.d.ts.map +1 -0
- package/dist/app/lib/views/index.d.ts +2 -1
- package/dist/app/lib/views/index.d.ts.map +1 -0
- package/dist/app/lib/views/index.js +1 -1
- package/dist/app/server/index.d.ts +6 -0
- package/dist/app/server/index.d.ts.map +1 -0
- package/dist/app/server/index.js +5 -0
- package/dist/app/server/proxy-wp-admin.d.ts +3 -0
- package/dist/app/server/proxy-wp-admin.d.ts.map +1 -0
- package/dist/app/server/proxy-wp-admin.js +138 -0
- package/dist/app/server/render-ai-page.d.ts +13 -0
- package/dist/app/server/render-ai-page.d.ts.map +1 -0
- package/dist/app/server/render-ai-page.js +100 -0
- package/dist/app/server/render-ssr-page.d.ts +31 -0
- package/dist/app/server/render-ssr-page.d.ts.map +1 -0
- package/dist/app/server/render-ssr-page.js +237 -0
- package/dist/app/server/rpc.d.ts +52 -0
- package/dist/app/server/rpc.d.ts.map +1 -0
- package/dist/app/server/rpc.js +18 -0
- package/dist/app/server/server-context.d.ts +75 -0
- package/dist/app/server/server-context.d.ts.map +1 -0
- package/dist/app/server/server-context.js +417 -0
- package/dist/app/server/server-custom-config.d.ts +3 -0
- package/dist/app/server/server-custom-config.d.ts.map +1 -0
- package/dist/app/server/server-custom-config.js +1 -0
- package/dist/app/server/utils/content-security.d.ts +26 -0
- package/dist/app/server/utils/content-security.d.ts.map +1 -0
- package/dist/app/server/utils/content-security.js +124 -0
- package/dist/app/server/utils/headers.d.ts +2 -0
- package/dist/app/server/utils/headers.d.ts.map +1 -0
- package/dist/app/server/utils/headers.js +17 -0
- package/dist/app/server/utils/replace-host.d.ts +7 -4
- package/dist/app/server/utils/replace-host.d.ts.map +1 -0
- package/dist/app/server/utils/replace-host.js +66 -11
- package/dist/app/server/utils/swr-cache.d.ts +5 -0
- package/dist/app/server/utils/swr-cache.d.ts.map +1 -0
- package/dist/app/server/utils/swr-cache.js +31 -0
- package/dist/app/utils/APIProvider.d.ts +3 -0
- package/dist/app/utils/APIProvider.d.ts.map +1 -0
- package/dist/app/utils/APIProvider.js +5 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts +20 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/BlockErrorBoundary.js +38 -0
- package/dist/app/utils/ErrorMessage.d.ts +6 -0
- package/dist/app/utils/ErrorMessage.d.ts.map +1 -0
- package/dist/app/utils/ErrorMessage.js +14 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts +20 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/RouteErrorBoundary.js +41 -0
- package/dist/app/utils/asset-capture.d.ts +3 -0
- package/dist/app/utils/asset-capture.d.ts.map +1 -0
- package/dist/app/utils/asset-capture.js +5 -0
- package/dist/app/utils/hydration-debugger.d.ts +14 -0
- package/dist/app/utils/hydration-debugger.d.ts.map +1 -0
- package/dist/app/utils/hydration-debugger.js +11 -0
- package/dist/app/utils/query-client.d.ts +3 -0
- package/dist/app/utils/query-client.d.ts.map +1 -0
- package/dist/app/utils/query-client.js +5 -1
- package/dist/app/utils/query-monitor.d.ts +27 -0
- package/dist/app/utils/query-monitor.d.ts.map +1 -0
- package/dist/app/utils/query-monitor.js +7 -0
- package/dist/app/utils/trpc-client.d.ts +3 -0
- package/dist/app/utils/trpc-client.d.ts.map +1 -0
- package/dist/app/utils/trpc-client.js +39 -0
- package/dist/app/utils/wp.d.ts +11 -10
- package/dist/app/utils/wp.d.ts.map +1 -0
- package/dist/node/cli/cli-mode.d.ts +1 -0
- package/dist/node/cli/cli-mode.d.ts.map +1 -0
- package/dist/node/cli/cli-worker.d.ts +2 -1
- package/dist/node/cli/cli-worker.d.ts.map +1 -0
- package/dist/node/cli/cli-worker.js +12 -3
- package/dist/node/cli/cli.d.ts +1 -0
- package/dist/node/cli/cli.d.ts.map +1 -0
- package/dist/node/cli/cli.js +195 -11
- package/dist/node/cli/display/CLIApp.d.ts +2 -1
- package/dist/node/cli/display/CLIApp.d.ts.map +1 -0
- package/dist/node/cli/display/CLIApp.js +4 -7
- package/dist/node/cli/display/boot-cli-app.d.ts +1 -0
- package/dist/node/cli/display/boot-cli-app.d.ts.map +1 -0
- package/dist/node/cli/display/boot-cli-app.js +1 -1
- package/dist/node/cli/display/components/Fullscreen.d.ts +1 -0
- package/dist/node/cli/display/components/Fullscreen.d.ts.map +1 -0
- package/dist/node/cli/display/components/LogEntries.d.ts +2 -1
- package/dist/node/cli/display/components/LogEntries.d.ts.map +1 -0
- package/dist/node/cli/display/components/MenuItem.d.ts +1 -0
- package/dist/node/cli/display/components/MenuItem.d.ts.map +1 -0
- package/dist/node/cli/display/components/TextInput.d.ts +1 -0
- package/dist/node/cli/display/components/TextInput.d.ts.map +1 -0
- package/dist/node/cli/display/hooks/useManifest.d.ts +1 -0
- package/dist/node/cli/display/hooks/useManifest.d.ts.map +1 -0
- package/dist/node/cli/display/hooks/useStatefulLog.d.ts +2 -1
- package/dist/node/cli/display/hooks/useStatefulLog.d.ts.map +1 -0
- package/dist/node/cli/display/tools/BlockList.d.ts +1 -0
- package/dist/node/cli/display/tools/BlockList.d.ts.map +1 -0
- package/dist/node/cli/display/tools/CreateBlock.d.ts +2 -1
- package/dist/node/cli/display/tools/CreateBlock.d.ts.map +1 -0
- package/dist/node/cli/display/tools/cli-tool-list.d.ts +1 -0
- package/dist/node/cli/display/tools/cli-tool-list.d.ts.map +1 -0
- package/dist/node/cli/display/tools/cli-tools.d.ts +2 -11
- package/dist/node/cli/display/tools/cli-tools.d.ts.map +1 -0
- package/dist/node/cli/display/tools/cli-tools.js +9 -9
- package/dist/node/cli/display/util/colors.d.ts +3 -2
- package/dist/node/cli/display/util/colors.d.ts.map +1 -0
- package/dist/node/cli/version.d.ts +2 -1
- package/dist/node/cli/version.d.ts.map +1 -0
- package/dist/node/cli/version.js +1 -1
- package/dist/node/compiler/build-vinxi.d.ts +9 -0
- package/dist/node/compiler/build-vinxi.d.ts.map +1 -0
- package/dist/node/compiler/build-vinxi.js +38 -0
- package/dist/node/compiler/bundler.admin.d.ts +3 -2
- package/dist/node/compiler/bundler.admin.d.ts.map +1 -0
- package/dist/node/compiler/bundler.admin.js +4 -4
- package/dist/node/compiler/bundler.frontend.d.ts +3 -1
- package/dist/node/compiler/bundler.frontend.d.ts.map +1 -0
- package/dist/node/compiler/bundler.frontend.js +29 -15
- package/dist/node/compiler/dev-server.d.ts +19 -0
- package/dist/node/compiler/dev-server.d.ts.map +1 -0
- package/dist/node/compiler/dev-server.js +113 -0
- package/dist/node/compiler/get-vite-config.d.ts +30 -0
- package/dist/node/compiler/get-vite-config.d.ts.map +1 -0
- package/dist/node/compiler/get-vite-config.js +332 -0
- package/dist/node/compiler/vinxi-app.d.ts +23 -0
- package/dist/node/compiler/vinxi-app.d.ts.map +1 -0
- package/dist/node/compiler/vinxi-app.js +230 -0
- package/dist/node/compiler/vinxi-codegen.d.ts +13 -0
- package/dist/node/compiler/vinxi-codegen.d.ts.map +1 -0
- package/dist/node/compiler/vinxi-codegen.js +731 -0
- package/dist/node/graphql/graphql-codegen.d.ts +13 -2
- package/dist/node/graphql/graphql-codegen.d.ts.map +1 -0
- package/dist/node/graphql/graphql-codegen.js +242 -40
- package/dist/node/graphql/graphql-schema-loader.d.ts +3 -1
- package/dist/node/graphql/graphql-schema-loader.d.ts.map +1 -0
- package/dist/node/graphql/graphql-schema-loader.js +5 -19
- package/dist/node/graphql/plugins/gql-plugin-files.d.ts +3 -1
- package/dist/node/graphql/plugins/gql-plugin-files.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-files.js +3 -2
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts +1 -0
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.d.ts +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.js +2 -2
- package/dist/node/graphql/query-files-loader.d.ts +4 -0
- package/dist/node/graphql/query-files-loader.d.ts.map +1 -0
- package/dist/node/graphql/query-files-loader.js +5 -0
- package/dist/node/graphql/wp-info-query.d.ts +1 -0
- package/dist/node/graphql/wp-info-query.d.ts.map +1 -0
- package/dist/node/project/config.d.ts +207 -73
- package/dist/node/project/config.d.ts.map +1 -0
- package/dist/node/project/config.js +95 -21
- package/dist/node/project/eddev-build-file.d.ts +1 -0
- package/dist/node/project/eddev-build-file.d.ts.map +1 -0
- package/dist/node/project/eddev-build-file.js +4 -2
- package/dist/node/project/env.d.ts +6 -1
- package/dist/node/project/env.d.ts.map +1 -0
- package/dist/node/project/env.js +2 -1
- package/dist/node/project/favicons.d.ts +1 -0
- package/dist/node/project/favicons.d.ts.map +1 -0
- package/dist/node/project/manifest/block-manifest.d.ts +1 -0
- package/dist/node/project/manifest/block-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/block-manifest.js +8 -4
- package/dist/node/project/manifest/field-manifest.d.ts +1 -0
- package/dist/node/project/manifest/field-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/manifest.d.ts +3 -1
- package/dist/node/project/manifest/manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/manifest.js +15 -11
- package/dist/node/project/manifest/routes-manifest.d.ts +21 -0
- package/dist/node/project/manifest/routes-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/routes-manifest.js +74 -0
- package/dist/node/project/manifest/view-manifest.d.ts +1 -0
- package/dist/node/project/manifest/view-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/view-manifest.js +2 -2
- package/dist/node/project/manifest/widget-manifest.d.ts +1 -0
- package/dist/node/project/manifest/widget-manifest.d.ts.map +1 -0
- package/dist/node/project/project.d.ts +15 -2
- package/dist/node/project/project.d.ts.map +1 -0
- package/dist/node/project/project.js +73 -21
- package/dist/node/project/wp-info.d.ts +3 -0
- package/dist/node/project/wp-info.d.ts.map +1 -0
- package/dist/node/project/wp-info.js +13 -3
- package/dist/node/storybook/index.d.ts +3 -0
- package/dist/node/storybook/index.d.ts.map +1 -0
- package/dist/node/storybook/index.js +13 -0
- package/dist/node/types/block-type.d.ts +57 -25
- package/dist/node/types/block-type.d.ts.map +1 -0
- package/dist/node/types/block-type.js +4 -1
- package/dist/node/types/view-type.d.ts +8 -7
- package/dist/node/types/view-type.d.ts.map +1 -0
- package/dist/node/types/view-type.js +3 -4
- package/dist/node/utils/fetch-wp.d.ts +2 -0
- package/dist/node/utils/fetch-wp.d.ts.map +1 -0
- package/dist/node/utils/fetch-wp.js +28 -0
- package/dist/node/utils/{formatZodError.d.ts → format-zod-error.d.ts} +1 -0
- package/dist/node/utils/format-zod-error.d.ts.map +1 -0
- package/dist/node/utils/fs-codegen.d.ts +44 -0
- package/dist/node/utils/fs-codegen.d.ts.map +1 -0
- package/dist/node/utils/fs-codegen.js +105 -0
- package/dist/node/utils/fs.d.ts +5 -0
- package/dist/node/utils/fs.d.ts.map +1 -0
- package/dist/node/utils/fs.js +2 -0
- package/dist/node/utils/{getRepoInfo.d.ts → get-repo-info.d.ts} +1 -0
- package/dist/node/utils/get-repo-info.d.ts.map +1 -0
- package/dist/node/utils/helpers.d.ts +1 -0
- package/dist/node/utils/helpers.d.ts.map +1 -0
- package/dist/node/utils/{highlightCode.d.ts → highlight-code.d.ts} +1 -0
- package/dist/node/utils/highlight-code.d.ts.map +1 -0
- package/dist/node/utils/{isDeploying.d.ts → is-deploying.d.ts} +1 -0
- package/dist/node/utils/is-deploying.d.ts.map +1 -0
- package/dist/node/utils/{isDeploying.js → is-deploying.js} +1 -1
- package/dist/node/utils/report-builder.d.ts +7 -6
- package/dist/node/utils/report-builder.d.ts.map +1 -0
- package/dist/node/utils/self-signed-cert.d.ts +9 -0
- package/dist/node/utils/self-signed-cert.d.ts.map +1 -0
- package/dist/node/utils/{selfSignedCert.js → self-signed-cert.js} +29 -5
- package/dist/node/utils/{statefulLog.d.ts → stateful-log.d.ts} +1 -0
- package/dist/node/utils/stateful-log.d.ts.map +1 -0
- package/dist/node/utils/{statefulLog.js → stateful-log.js} +3 -1
- package/dist/node/utils/{export-extractor.d.ts → ts-export-extractor.d.ts} +1 -0
- package/dist/node/utils/ts-export-extractor.d.ts.map +1 -0
- package/dist/node/utils/watch-file-tree.d.ts +26 -0
- package/dist/node/utils/watch-file-tree.d.ts.map +1 -0
- package/dist/node/utils/{watchFileTree.js → watch-file-tree.js} +12 -5
- package/package.json +62 -47
- package/tsconfig.app.json +8 -3
- package/tsconfig.node.json +1 -0
- package/types.app.d.ts +4 -2
- package/types.app.internal.d.ts +2 -2
- package/types.meta.d.ts +449 -136
- package/types.node.d.ts +3 -3
- package/dist/app/entry/Root.d.ts +0 -1
- package/dist/app/entry/Root.js +0 -9
- package/dist/app/entry/main.admin.d.ts +0 -3
- package/dist/app/entry/main.admin.js +0 -10
- package/dist/app/entry/main.frontend.spa.d.ts +0 -3
- package/dist/app/entry/main.frontend.spa.js +0 -13
- package/dist/app/entry/main.frontend.ssr.d.ts +0 -21
- package/dist/app/entry/main.frontend.ssr.js +0 -79
- package/dist/app/entry/main.serverless.dev.d.ts +0 -4
- package/dist/app/entry/main.serverless.dev.js +0 -21
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +0 -15
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +0 -35
- package/dist/app/lib/hooks/apiConfig.js +0 -4
- package/dist/app/lib/hooks/usePageLoad.d.ts +0 -6
- package/dist/app/lib/hooks/usePageLoad.js +0 -5
- package/dist/app/server/create-api-builtin-hono.d.ts +0 -8
- package/dist/app/server/create-api-builtin-hono.js +0 -80
- package/dist/app/server/create-ssr-hono.d.ts +0 -18
- package/dist/app/server/create-ssr-hono.js +0 -104
- package/dist/app/server/utils/index.html.d.ts +0 -2
- package/dist/app/server/utils/index.html.js +0 -14
- package/dist/node/compiler/index.html.d.ts +0 -2
- package/dist/node/compiler/index.html.js +0 -15
- package/dist/node/compiler/serverless.dev.d.ts +0 -16
- package/dist/node/compiler/serverless.dev.js +0 -215
- package/dist/node/compiler/vite/get-vite-config.d.ts +0 -13
- package/dist/node/compiler/vite/get-vite-config.js +0 -315
- package/dist/node/compiler/vite/plugin-admin.d.ts +0 -4
- package/dist/node/compiler/vite/plugin-admin.js +0 -67
- package/dist/node/compiler/vite/plugin-blocks.d.ts +0 -4
- package/dist/node/compiler/vite/plugin-blocks.js +0 -73
- package/dist/node/compiler/vite/plugin-entry.d.ts +0 -6
- package/dist/node/compiler/vite/plugin-entry.js +0 -16
- package/dist/node/compiler/vite/plugin-resolved-tailwind.d.ts +0 -4
- package/dist/node/compiler/vite/plugin-resolved-tailwind.js +0 -29
- package/dist/node/compiler/vite/plugin-theme.d.ts +0 -4
- package/dist/node/compiler/vite/plugin-theme.js +0 -40
- package/dist/node/compiler/vite/plugin-views.d.ts +0 -4
- package/dist/node/compiler/vite/plugin-views.js +0 -51
- package/dist/node/utils/console.d.ts +0 -21
- package/dist/node/utils/console.js +0 -28
- package/dist/node/utils/selfSignedCert.d.ts +0 -4
- package/dist/node/utils/unsafe-fetch.d.ts +0 -2
- package/dist/node/utils/unsafe-fetch.js +0 -19
- package/dist/node/utils/watchFileTree.d.ts +0 -11
- package/tsup.config.ts +0 -40
- package/types.manifests.d.ts +0 -22
- /package/dist/node/utils/{formatZodError.js → format-zod-error.js} +0 -0
- /package/dist/node/utils/{getRepoInfo.js → get-repo-info.js} +0 -0
- /package/dist/node/utils/{highlightCode.js → highlight-code.js} +0 -0
- /package/dist/node/utils/{export-extractor.js → ts-export-extractor.js} +0 -0
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "@manifest/blocks";
|
|
2
|
-
import "@manifest/views";
|
|
3
|
-
import type { RouteData } from "../lib/routing/types";
|
|
4
|
-
import { UrlReplacerConf } from "../server/utils/replace-host";
|
|
5
|
-
export declare function patchConsole(c: any): void;
|
|
6
|
-
export declare function setFetchImpl(opts: any): void;
|
|
7
|
-
export declare function setPropsPreprocessor(func: any): void;
|
|
8
|
-
export declare function getPageData(): RouteData;
|
|
9
|
-
export declare function getCollectedOutput(): {
|
|
10
|
-
head: string;
|
|
11
|
-
foot: string;
|
|
12
|
-
};
|
|
13
|
-
export declare const getHonoAPI: (args: {
|
|
14
|
-
fetchImpl: any;
|
|
15
|
-
replaceUrls: UrlReplacerConf;
|
|
16
|
-
}) => import("hono").Hono<import("hono").Env, {}, "/">;
|
|
17
|
-
export declare const getHonoSSR: (args: {
|
|
18
|
-
indexTransformer: (html: string) => Promise<string>;
|
|
19
|
-
fetchImpl: any;
|
|
20
|
-
replaceUrls: UrlReplacerConf;
|
|
21
|
-
}) => import("hono").Hono<import("hono").Env, {}, "/">;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@manifest/blocks";
|
|
3
|
-
import { getCssText } from "@manifest/theme";
|
|
4
|
-
import "@manifest/views";
|
|
5
|
-
import { QueryClientProvider } from "@tanstack/react-query";
|
|
6
|
-
import { SSRRouter } from "../lib/routing/components/SSRRouter";
|
|
7
|
-
import { RouteLoader } from "../lib/routing/loader";
|
|
8
|
-
import { createHonoStdAPI } from "../server/create-api-builtin-hono";
|
|
9
|
-
import { createSSRHono } from "../server/create-ssr-hono";
|
|
10
|
-
import indexHtml from "../server/utils/index.html";
|
|
11
|
-
import { getQueryClient } from "../utils/query-client";
|
|
12
|
-
import { normalizeRoute } from "../lib/routing/utils";
|
|
13
|
-
import { createUrlReplacer } from "../server/utils/replace-host";
|
|
14
|
-
let initialData;
|
|
15
|
-
export function patchConsole(c) {
|
|
16
|
-
console.log = (...args) => c.log(...args);
|
|
17
|
-
console.info = (...args) => c.info(...args);
|
|
18
|
-
console.warn = (...args) => c.warn(...args);
|
|
19
|
-
console.error = (...args) => c.warn(...args);
|
|
20
|
-
}
|
|
21
|
-
export function setFetchImpl(opts) {
|
|
22
|
-
// routeLoader4().setFetchImpl(opts)
|
|
23
|
-
}
|
|
24
|
-
export function setPropsPreprocessor(func) {
|
|
25
|
-
// routeLoader4().setPropsPreprocessor(func)
|
|
26
|
-
}
|
|
27
|
-
export function getPageData() {
|
|
28
|
-
return initialData;
|
|
29
|
-
}
|
|
30
|
-
export function getCollectedOutput() {
|
|
31
|
-
const result = { head: "", foot: "" };
|
|
32
|
-
if (getCssText) {
|
|
33
|
-
result.head = `<style id="stitches">${getCssText()}</style>`;
|
|
34
|
-
}
|
|
35
|
-
return result;
|
|
36
|
-
}
|
|
37
|
-
export const getHonoAPI = (args) => {
|
|
38
|
-
return createHonoStdAPI({
|
|
39
|
-
fetch: args.fetchImpl,
|
|
40
|
-
replaceUrls: args.replaceUrls,
|
|
41
|
-
});
|
|
42
|
-
};
|
|
43
|
-
export const getHonoSSR = (args) => {
|
|
44
|
-
const replaceUrls = args.replaceUrls ? createUrlReplacer(args.replaceUrls) : null;
|
|
45
|
-
return createSSRHono({
|
|
46
|
-
render: async function render({ pathname }) {
|
|
47
|
-
const loader = new RouteLoader();
|
|
48
|
-
if (replaceUrls) {
|
|
49
|
-
loader.setPropsPreprocessor(replaceUrls);
|
|
50
|
-
}
|
|
51
|
-
loader.setFetchImpl(args.fetchImpl);
|
|
52
|
-
initialData = await loader.loadRouteData(pathname, true);
|
|
53
|
-
loader.setAppData(initialData.appData.data);
|
|
54
|
-
return {
|
|
55
|
-
jsx: (_jsx(QueryClientProvider, { client: getQueryClient(), children: _jsx(SSRRouter, { loader: loader, route: normalizeRoute({
|
|
56
|
-
id: "initial",
|
|
57
|
-
component: loader.getRouteComponent(initialData.view),
|
|
58
|
-
pathname: pathname,
|
|
59
|
-
hash: "",
|
|
60
|
-
key: "",
|
|
61
|
-
props: initialData.viewData.data,
|
|
62
|
-
view: initialData.view,
|
|
63
|
-
query: {},
|
|
64
|
-
search: "",
|
|
65
|
-
}) }) })),
|
|
66
|
-
getCollectedOutput() {
|
|
67
|
-
const result = { head: "", foot: "" };
|
|
68
|
-
if (getCssText) {
|
|
69
|
-
result.head = `<style id="stitches">${getCssText()}</style>`;
|
|
70
|
-
}
|
|
71
|
-
return result;
|
|
72
|
-
},
|
|
73
|
-
indexTemplate: args.indexTransformer ? await args.indexTransformer(indexHtml) : indexHtml,
|
|
74
|
-
data: initialData,
|
|
75
|
-
};
|
|
76
|
-
},
|
|
77
|
-
manifest: {},
|
|
78
|
-
});
|
|
79
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@manifest/blocks";
|
|
3
|
-
import "@manifest/views";
|
|
4
|
-
import "@manifest/admin";
|
|
5
|
-
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
6
|
-
import { Root } from "./Root";
|
|
7
|
-
import bootAdmin from "./main.admin";
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
if (!window.wp)
|
|
10
|
-
window.wp = {};
|
|
11
|
-
export default function boot() {
|
|
12
|
-
if (env.admin) {
|
|
13
|
-
bootAdmin();
|
|
14
|
-
}
|
|
15
|
-
else if (env.serverless) {
|
|
16
|
-
hydrateRoot(document.getElementById("root"), _jsx(Root, {}));
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
createRoot(document.getElementById("root")).render(_jsx(Root, {}));
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Component, ErrorInfo, ReactNode } from "react";
|
|
2
|
-
interface Props {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
}
|
|
5
|
-
interface State {
|
|
6
|
-
hasError: boolean;
|
|
7
|
-
error?: Error;
|
|
8
|
-
}
|
|
9
|
-
export declare class ErrorBoundaryFrontend extends Component<Props, State> {
|
|
10
|
-
state: State;
|
|
11
|
-
static getDerivedStateFromError(err: Error): State;
|
|
12
|
-
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
13
|
-
render(): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Component } from "react";
|
|
3
|
-
export class ErrorBoundaryFrontend extends Component {
|
|
4
|
-
state = {
|
|
5
|
-
hasError: false,
|
|
6
|
-
};
|
|
7
|
-
static getDerivedStateFromError(err) {
|
|
8
|
-
// Update state so the next render will show the fallback UI.
|
|
9
|
-
return { hasError: true, error: err };
|
|
10
|
-
}
|
|
11
|
-
componentDidCatch(error, errorInfo) {
|
|
12
|
-
console.error("Uncaught error:", error, errorInfo);
|
|
13
|
-
}
|
|
14
|
-
render() {
|
|
15
|
-
if (this.state.hasError) {
|
|
16
|
-
const err = this.state.error;
|
|
17
|
-
if (env.dev) {
|
|
18
|
-
return (_jsx("pre", { style: {
|
|
19
|
-
backgroundColor: "#fafafa",
|
|
20
|
-
fontSize: "12px",
|
|
21
|
-
color: "#d92a0b",
|
|
22
|
-
border: "2px solid #d92a0b",
|
|
23
|
-
borderRadius: "4px",
|
|
24
|
-
padding: "8px",
|
|
25
|
-
overflowX: "auto",
|
|
26
|
-
fontFamily: '"Roboto Mono", Menlo, monospace',
|
|
27
|
-
}, children: err.stack }));
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return this.props.children;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
|
-
import { UrlReplacerConf } from "./utils/replace-host";
|
|
3
|
-
type Conf = {
|
|
4
|
-
fetch: typeof fetch;
|
|
5
|
-
replaceUrls?: UrlReplacerConf;
|
|
6
|
-
};
|
|
7
|
-
export declare function createHonoStdAPI(conf: Conf): Hono<import("hono").Env, {}, "/">;
|
|
8
|
-
export {};
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
|
-
import { joinURL, withQuery } from "ufo";
|
|
3
|
-
import { BRANDED_HEADERS, filterHeader } from "./utils/headers";
|
|
4
|
-
import { createUrlReplacer } from "./utils/replace-host";
|
|
5
|
-
let standardFetch = fetch;
|
|
6
|
-
const PROXY_RESPONSE_HEADERS = ["content-type", "set-cookie", /^x-/, "cache-control", ...Object.keys(BRANDED_HEADERS)];
|
|
7
|
-
function extractHeaders(rawHeaders) {
|
|
8
|
-
const headers = {};
|
|
9
|
-
rawHeaders.forEach((value, key) => {
|
|
10
|
-
headers[key] = value;
|
|
11
|
-
});
|
|
12
|
-
return headers;
|
|
13
|
-
}
|
|
14
|
-
export function createHonoStdAPI(conf) {
|
|
15
|
-
const fetch = conf.fetch ?? standardFetch;
|
|
16
|
-
const replaceUrls = conf.replaceUrls ? createUrlReplacer(conf.replaceUrls) : undefined;
|
|
17
|
-
const app = new Hono();
|
|
18
|
-
app.get("/api/rest/query/:name{.+}", async (c) => {
|
|
19
|
-
const name = c.req.param("name");
|
|
20
|
-
const paramString = c.req.query("params");
|
|
21
|
-
const fetchUrl = withQuery(joinURL(env.origin ?? "", `/wp-json/ed/v1/query/${name}`), { params: paramString });
|
|
22
|
-
const response = await fetch(fetchUrl, {
|
|
23
|
-
referrer: c.req.raw.referrer,
|
|
24
|
-
cache: "no-cache",
|
|
25
|
-
headers: {
|
|
26
|
-
"Content-Type": "application/json",
|
|
27
|
-
Accept: "application/json",
|
|
28
|
-
...extractHeaders(c.req.raw.headers),
|
|
29
|
-
// Authorization: c.req.header("Authorization") ?? "",
|
|
30
|
-
// Cookie: c.req.header("Cookie") ?? "",
|
|
31
|
-
// ...c.req.raw.headers,
|
|
32
|
-
},
|
|
33
|
-
});
|
|
34
|
-
c.status(response.status);
|
|
35
|
-
response.headers.forEach((value, key) => {
|
|
36
|
-
if (filterHeader(key, PROXY_RESPONSE_HEADERS)) {
|
|
37
|
-
c.header(key, value);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
Object.entries(BRANDED_HEADERS).forEach(([key, value]) => c.header(key, value));
|
|
41
|
-
let text = await response.text();
|
|
42
|
-
if (replaceUrls) {
|
|
43
|
-
text = replaceUrls(text);
|
|
44
|
-
}
|
|
45
|
-
return c.body(text);
|
|
46
|
-
});
|
|
47
|
-
app.post("/api/rest/mutation/:name{.+}", async (c) => {
|
|
48
|
-
const name = c.req.param("name");
|
|
49
|
-
const fetchUrl = joinURL(env.origin ?? "", `/wp-json/ed/v1/mutation/${name}`);
|
|
50
|
-
const response = await fetch(fetchUrl, {
|
|
51
|
-
method: "POST",
|
|
52
|
-
referrer: c.req.raw.referrer,
|
|
53
|
-
cache: "no-cache",
|
|
54
|
-
headers: {
|
|
55
|
-
"Content-Type": "application/json",
|
|
56
|
-
Accept: "application/json",
|
|
57
|
-
...extractHeaders(c.req.raw.headers),
|
|
58
|
-
// Authorization: c.req.header("Authorization") ?? "",
|
|
59
|
-
// Cookie: c.req.header("Cookie") ?? "",
|
|
60
|
-
},
|
|
61
|
-
body: JSON.stringify({
|
|
62
|
-
name: name,
|
|
63
|
-
...(await c.req.json()),
|
|
64
|
-
}),
|
|
65
|
-
});
|
|
66
|
-
c.status(response.status);
|
|
67
|
-
response.headers.forEach((value, key) => {
|
|
68
|
-
if (filterHeader(key, PROXY_RESPONSE_HEADERS)) {
|
|
69
|
-
c.header(key, value);
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.entries(BRANDED_HEADERS).forEach(([key, value]) => c.header(key, value));
|
|
73
|
-
let text = await response.text();
|
|
74
|
-
if (replaceUrls) {
|
|
75
|
-
text = replaceUrls(text);
|
|
76
|
-
}
|
|
77
|
-
return c.body(text);
|
|
78
|
-
});
|
|
79
|
-
return app;
|
|
80
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
|
-
import { ReactElement } from "react";
|
|
3
|
-
type Conf = {
|
|
4
|
-
render: (args: {
|
|
5
|
-
pathname: string;
|
|
6
|
-
}) => Promise<{
|
|
7
|
-
jsx: ReactElement;
|
|
8
|
-
getCollectedOutput(): {
|
|
9
|
-
head: string;
|
|
10
|
-
foot: string;
|
|
11
|
-
};
|
|
12
|
-
indexTemplate: string;
|
|
13
|
-
data: any;
|
|
14
|
-
}>;
|
|
15
|
-
manifest: any;
|
|
16
|
-
};
|
|
17
|
-
export declare function createSSRHono(conf: Conf): Hono<import("hono").Env, {}, "/">;
|
|
18
|
-
export {};
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
|
-
import ReactDOMServer from "react-dom/server";
|
|
3
|
-
import { stream } from "hono/streaming";
|
|
4
|
-
export function createSSRHono(conf) {
|
|
5
|
-
const app = new Hono();
|
|
6
|
-
app.get("*", async (c) => {
|
|
7
|
-
const isPropsRequest = c.req.query("_props");
|
|
8
|
-
const result = await conf.render({ pathname: c.req.path });
|
|
9
|
-
let didError = false;
|
|
10
|
-
async function propsResponse() {
|
|
11
|
-
c.status(200);
|
|
12
|
-
c.header("Content-Type", "application/json");
|
|
13
|
-
return c.json(result.data);
|
|
14
|
-
}
|
|
15
|
-
const getTemplateParts = () => {
|
|
16
|
-
const collected = result.getCollectedOutput();
|
|
17
|
-
let [head, foot] = result.indexTemplate.split("<!--ssr-outlet-->");
|
|
18
|
-
head = head.replace("<!--ssr-meta-->", collected.head);
|
|
19
|
-
const dataPayload = `\n<script type="text/javascript">window._PAGE_DATA = ${JSON.stringify(result.data, null, 2)}</script>\n`;
|
|
20
|
-
foot = foot.replace("<!--ssr-meta-->", dataPayload + collected.foot);
|
|
21
|
-
return [head, foot];
|
|
22
|
-
};
|
|
23
|
-
// For Web Stream environments, and when react-dom/server exports renderToReadableStream for Node.js
|
|
24
|
-
// (Even though Node 20+ supports Web Streams, ReactDOM doesn't yet export it for Node)
|
|
25
|
-
if (ReactDOMServer.renderToReadableStream) {
|
|
26
|
-
const reactStream = await ReactDOMServer.renderToReadableStream(result.jsx, {
|
|
27
|
-
onError: (err) => {
|
|
28
|
-
didError = true;
|
|
29
|
-
console.warn("Failed to server-render React frontend");
|
|
30
|
-
console.error(err);
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
await reactStream.allReady;
|
|
34
|
-
if (isPropsRequest) {
|
|
35
|
-
return propsResponse();
|
|
36
|
-
}
|
|
37
|
-
const [head, foot] = getTemplateParts();
|
|
38
|
-
return stream(c, async (stream) => {
|
|
39
|
-
await stream.write(head);
|
|
40
|
-
await stream.pipe(reactStream);
|
|
41
|
-
await stream.write(foot);
|
|
42
|
-
stream.close();
|
|
43
|
-
});
|
|
44
|
-
// const result = await stream.getReader().read()
|
|
45
|
-
// const result = { value: "test" }
|
|
46
|
-
// return finalize(result.value)
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return new Promise((resolve, reject) => {
|
|
50
|
-
const reactStream = ReactDOMServer.renderToPipeableStream(result.jsx, {
|
|
51
|
-
onError: (err) => {
|
|
52
|
-
didError = true;
|
|
53
|
-
console.warn("Failed to server-render React frontend");
|
|
54
|
-
console.error(err);
|
|
55
|
-
// setModuleCollector(() => {})
|
|
56
|
-
},
|
|
57
|
-
onShellError: (err) => {
|
|
58
|
-
console.warn("Shell");
|
|
59
|
-
console.error(err);
|
|
60
|
-
},
|
|
61
|
-
onAllReady: async () => {
|
|
62
|
-
if (isPropsRequest) {
|
|
63
|
-
resolve(propsResponse());
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
c.status(200);
|
|
67
|
-
c.header("Content-Type", "text/html");
|
|
68
|
-
resolve(stream(c, async (stream) => {
|
|
69
|
-
const [head, foot] = getTemplateParts();
|
|
70
|
-
stream.write(head);
|
|
71
|
-
reactStream.pipe({
|
|
72
|
-
write(chunk) {
|
|
73
|
-
stream.write(chunk);
|
|
74
|
-
},
|
|
75
|
-
close() {
|
|
76
|
-
// stream.close()
|
|
77
|
-
},
|
|
78
|
-
destroy() { },
|
|
79
|
-
on(event, cb) { },
|
|
80
|
-
async end() {
|
|
81
|
-
stream.write(foot);
|
|
82
|
-
stream.close();
|
|
83
|
-
},
|
|
84
|
-
});
|
|
85
|
-
}));
|
|
86
|
-
// reac.pipe(new WritableStream((chunk) => {
|
|
87
|
-
// chunk
|
|
88
|
-
// }))
|
|
89
|
-
// resolve(stream())
|
|
90
|
-
// const collected = getCollectedOutput()
|
|
91
|
-
// res.status(200).set({ "Content-Type": "text/html" })
|
|
92
|
-
// res.write(htmlParts[0].replace("<!--ssr-meta-->", collected.head ?? ""))
|
|
93
|
-
// stream.pipe(res)
|
|
94
|
-
// res.write(htmlParts[1].replace("<!--ssr-meta-->", collected.footer ?? ""))
|
|
95
|
-
// res.end()
|
|
96
|
-
}
|
|
97
|
-
// setModuleCollector(() => {})
|
|
98
|
-
},
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
return app;
|
|
104
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <!--ssr-meta-->\n </head>\n <body>\n <div id=\"root\"><!--ssr-outlet--></div>\n <!--ssr-meta-->\n <script type=\"module\" src=\"/_boot.js\"></script>\n </body>\n</html>";
|
|
2
|
-
export default _default;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default `<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<!--ssr-meta-->
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
<div id="root"><!--ssr-outlet--></div>
|
|
11
|
-
<!--ssr-meta-->
|
|
12
|
-
<script type="module" src="/_boot.js"></script>
|
|
13
|
-
</body>
|
|
14
|
-
</html>`;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <link rel=\"stylesheet\" href=\"/views/index.css\" />\n <!--ssr-meta-->\n </head>\n <body>\n <div id=\"root\"><!--ssr-outlet--></div>\n <!--ssr-meta-->\n <script type=\"module\" src=\"/_boot.js\"></script>\n </body>\n</html>";
|
|
2
|
-
export default _default;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export default `<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<link rel="stylesheet" href="/views/index.css" />
|
|
8
|
-
<!--ssr-meta-->
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="root"><!--ssr-outlet--></div>
|
|
12
|
-
<!--ssr-meta-->
|
|
13
|
-
<script type="module" src="/_boot.js"></script>
|
|
14
|
-
</body>
|
|
15
|
-
</html>`;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Project } from "../project/project.js";
|
|
2
|
-
export type ServerlessDevStatus = {
|
|
3
|
-
serverlessUrl: string;
|
|
4
|
-
wordpressUrl: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const serverlessLog: import("../utils/statefulLog.js").StatefulLog<ServerlessDevStatus>;
|
|
7
|
-
type Options = {
|
|
8
|
-
mode: "development" | "production";
|
|
9
|
-
};
|
|
10
|
-
export declare class ServerlessDevServer {
|
|
11
|
-
project: Project;
|
|
12
|
-
opts: Options;
|
|
13
|
-
constructor(project: Project, opts: Options);
|
|
14
|
-
start(): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
export {};
|