eddev 2.0.0-beta.99 → 2.1.0
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 +1 -0
- package/dist/app/entry/HydrationOverlay.d.ts.map +1 -0
- package/dist/app/entry/MetaTags.d.ts +1 -0
- package/dist/app/entry/MetaTags.d.ts.map +1 -0
- package/dist/app/entry/MetaTags.js +18 -3
- package/dist/app/entry/boot-admin.d.ts +1 -0
- package/dist/app/entry/boot-admin.d.ts.map +1 -0
- package/dist/app/entry/boot-admin.js +0 -1
- package/dist/app/entry/hydration-script.d.ts +1 -0
- package/dist/app/entry/hydration-script.d.ts.map +1 -0
- package/dist/app/entry/spa-root.d.ts +1 -0
- package/dist/app/entry/spa-root.d.ts.map +1 -0
- package/dist/app/entry/spa-root.js +1 -2
- package/dist/app/entry/ssr-root-client.d.ts +1 -0
- package/dist/app/entry/ssr-root-client.d.ts.map +1 -0
- package/dist/app/entry/ssr-root-client.js +3 -2
- package/dist/app/entry/ssr-root.d.ts +3 -0
- package/dist/app/entry/ssr-root.d.ts.map +1 -0
- package/dist/app/entry/ssr-root.js +3 -3
- 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 +1 -0
- package/dist/app/lib/admin/index.d.ts.map +1 -0
- 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 +2 -0
- 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 +7 -2
- package/dist/app/lib/blocks/BlockPropMutator.d.ts +33 -0
- package/dist/app/lib/blocks/BlockPropMutator.d.ts.map +1 -0
- package/dist/app/lib/blocks/BlockPropMutator.js +20 -0
- 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 +14 -1
- package/dist/app/lib/blocks/EditableText.d.ts +30 -5
- package/dist/app/lib/blocks/EditableText.d.ts.map +1 -0
- package/dist/app/lib/blocks/EditableText.js +34 -5
- package/dist/app/lib/blocks/InnerBlocks.d.ts +11 -6
- package/dist/app/lib/blocks/InnerBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/InnerBlocks.js +67 -27
- 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 +45 -0
- package/dist/app/lib/blocks/block-utils.d.ts +1 -0
- package/dist/app/lib/blocks/block-utils.d.ts.map +1 -0
- package/dist/app/lib/blocks/block-utils.js +18 -1
- 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/EditingContext.d.ts +2 -0
- package/dist/app/lib/blocks/editor/EditingContext.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditingContext.js +31 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts +1 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.js +43 -9
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts +1 -4
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorSupport.js +23 -9
- 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 +64 -7
- package/dist/app/lib/blocks/editor/editor-config.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/editor-config.js +28 -73
- 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 +152 -27
- package/dist/app/lib/blocks/editor/root-blocks.d.ts +1 -0
- package/dist/app/lib/blocks/editor/root-blocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts +12 -1
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/usePostEditor.js +38 -13
- package/dist/app/lib/blocks/index.d.ts +8 -5
- package/dist/app/lib/blocks/index.d.ts.map +1 -0
- package/dist/app/lib/blocks/index.js +8 -5
- package/dist/app/lib/blocks/inline-editing.d.ts +16 -1
- package/dist/app/lib/blocks/inline-editing.d.ts.map +1 -0
- package/dist/app/lib/blocks/inline-editing.js +14 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/app/lib/devtools/components/GridIndicator.d.ts +1 -0
- package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/GridIndicator.js +1 -1
- package/dist/app/lib/devtools/dev-tools-store.d.ts +1 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts +1 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +1358 -313
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts.map +1 -0
- package/dist/app/lib/devtools/index.d.ts +1 -0
- package/dist/app/lib/devtools/index.d.ts.map +1 -0
- package/dist/app/lib/devtools/loader.d.ts +2 -1
- package/dist/app/lib/devtools/loader.d.ts.map +1 -0
- package/dist/app/lib/devtools/loader.js +4 -3
- 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 +2 -1
- package/dist/app/lib/devtools/useQueryDebug.d.ts.map +1 -0
- package/dist/app/lib/dynamic/dynamic.d.ts +1 -0
- package/dist/app/lib/dynamic/dynamic.d.ts.map +1 -0
- package/dist/app/lib/dynamic/index.d.ts +1 -0
- package/dist/app/lib/dynamic/index.d.ts.map +1 -0
- package/dist/app/lib/hooks/index.d.ts +2 -1
- package/dist/app/lib/hooks/index.d.ts.map +1 -0
- package/dist/app/lib/hooks/index.js +1 -1
- package/dist/app/lib/hooks/{queryUtils.d.ts → query-hooks.d.ts} +8 -2
- package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -0
- package/dist/app/lib/hooks/{queryUtils.js → query-hooks.js} +43 -11
- 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 +11 -0
- package/dist/app/lib/hooks/useRPC.d.ts +1 -0
- package/dist/app/lib/hooks/useRPC.d.ts.map +1 -0
- package/dist/app/lib/hooks/useRPC.js +0 -1
- 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 +298 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts +1 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts.map +1 -0
- package/dist/app/lib/internal/index.d.ts +1 -0
- package/dist/app/lib/internal/index.d.ts.map +1 -0
- package/dist/app/lib/internal/internal-store.d.ts +1 -0
- package/dist/app/lib/internal/internal-store.d.ts.map +1 -0
- package/dist/app/lib/internal/read-admin-manifest.d.ts +1 -0
- package/dist/app/lib/internal/read-admin-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-block-manifest.d.ts +2 -0
- package/dist/app/lib/internal/read-block-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-block-manifest.js +7 -0
- package/dist/app/lib/internal/read-view-manifest.d.ts +7 -4
- package/dist/app/lib/internal/read-view-manifest.d.ts.map +1 -0
- package/dist/app/lib/internal/read-view-manifest.js +18 -0
- package/dist/app/lib/legacy-stitches/createStitches.d.ts +8 -7
- package/dist/app/lib/legacy-stitches/createStitches.d.ts.map +1 -0
- package/dist/app/lib/legacy-stitches/index.d.ts +1 -0
- package/dist/app/lib/legacy-stitches/index.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BackButton.d.ts +1 -0
- package/dist/app/lib/routing/components/BackButton.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BrowserRouter.d.ts +7 -1
- package/dist/app/lib/routing/components/BrowserRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BrowserRouter.js +85 -14
- 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 +3 -3
- package/dist/app/lib/routing/components/Link.d.ts +21 -2
- package/dist/app/lib/routing/components/Link.d.ts.map +1 -0
- package/dist/app/lib/routing/components/Link.js +52 -23
- 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 +1 -0
- package/dist/app/lib/routing/components/RouteRenderer.d.ts.map +1 -0
- package/dist/app/lib/routing/components/RouteRenderer.js +14 -1
- package/dist/app/lib/routing/components/SSRRouter.d.ts +3 -0
- package/dist/app/lib/routing/components/SSRRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/components/SSRRouter.js +2 -0
- 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/context.d.ts +1 -0
- package/dist/app/lib/routing/context.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/{useIsSSR.d.ts → useHydrating.d.ts} +7 -0
- package/dist/app/lib/routing/hooks/useHydrating.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/{useIsSSR.js → useHydrating.js} +13 -3
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRestorableState.js +7 -2
- package/dist/app/lib/routing/hooks/useRoute.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRoute.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouter.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouterEvents.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouterState.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useRouterState.d.ts.map +1 -0
- 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 +75 -15
- package/dist/app/lib/routing/index.d.ts +4 -1
- package/dist/app/lib/routing/index.d.ts.map +1 -0
- package/dist/app/lib/routing/index.js +3 -1
- package/dist/app/lib/routing/loader.d.ts +1 -0
- package/dist/app/lib/routing/loader.d.ts.map +1 -0
- package/dist/app/lib/routing/loader.js +1 -1
- package/dist/app/lib/routing/types.d.ts +40 -6
- package/dist/app/lib/routing/types.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.d.ts +2 -0
- package/dist/app/lib/routing/utils.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.js +5 -1
- package/dist/app/lib/runtime/apiConfig.d.ts +5 -0
- package/dist/app/lib/runtime/apiConfig.d.ts.map +1 -0
- package/dist/app/lib/runtime/errorHandling.d.ts +1 -0
- package/dist/app/lib/runtime/errorHandling.d.ts.map +1 -0
- package/dist/app/lib/runtime/index.d.ts +1 -0
- package/dist/app/lib/runtime/index.d.ts.map +1 -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 +1 -0
- package/dist/app/lib/views/index.d.ts.map +1 -0
- package/dist/app/server/index.d.ts +4 -3
- package/dist/app/server/index.d.ts.map +1 -0
- package/dist/app/server/index.js +3 -3
- package/dist/app/server/proxy-wp-admin.d.ts +1 -0
- package/dist/app/server/proxy-wp-admin.d.ts.map +1 -0
- package/dist/app/server/proxy-wp-admin.js +23 -9
- 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 +102 -0
- package/dist/app/server/render-ssr-page.d.ts +17 -6
- package/dist/app/server/render-ssr-page.d.ts.map +1 -0
- package/dist/app/server/render-ssr-page.js +120 -35
- package/dist/app/server/rpc.d.ts +18 -41
- package/dist/app/server/rpc.d.ts.map +1 -0
- package/dist/app/server/server-context.d.ts +14 -3
- package/dist/app/server/server-context.d.ts.map +1 -0
- package/dist/app/server/server-context.js +204 -21
- 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 +1 -0
- package/dist/app/server/utils/headers.d.ts.map +1 -0
- package/dist/app/server/utils/replace-host.d.ts +1 -0
- package/dist/app/server/utils/replace-host.d.ts.map +1 -0
- package/dist/app/server/utils/swr-cache.d.ts +1 -0
- package/dist/app/server/utils/swr-cache.d.ts.map +1 -0
- package/dist/app/utils/APIProvider.d.ts +1 -0
- package/dist/app/utils/APIProvider.d.ts.map +1 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts +1 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/ErrorMessage.d.ts +1 -0
- package/dist/app/utils/ErrorMessage.d.ts.map +1 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts +2 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/RouteErrorBoundary.js +3 -0
- package/dist/app/utils/asset-capture.d.ts +1 -0
- package/dist/app/utils/asset-capture.d.ts.map +1 -0
- package/dist/app/utils/hydration-debugger.d.ts +1 -0
- package/dist/app/utils/hydration-debugger.d.ts.map +1 -0
- package/dist/app/utils/query-client.d.ts +1 -0
- package/dist/app/utils/query-client.d.ts.map +1 -0
- 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 +1 -0
- package/dist/app/utils/trpc-client.d.ts.map +1 -0
- package/dist/app/utils/trpc-client.js +1 -1
- 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 +1 -0
- package/dist/node/cli/cli-worker.d.ts.map +1 -0
- package/dist/node/cli/cli-worker.js +1 -0
- 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 +100 -11
- package/dist/node/cli/display/CLIApp.d.ts +1 -0
- package/dist/node/cli/display/CLIApp.d.ts.map +1 -0
- 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/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 +1 -0
- 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 +1 -0
- 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 +1 -0
- 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 +1 -0
- package/dist/node/cli/display/tools/cli-tools.d.ts.map +1 -0
- package/dist/node/cli/display/util/colors.d.ts +1 -0
- 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 +1 -0
- package/dist/node/compiler/build-vinxi.d.ts.map +1 -0
- package/dist/node/compiler/build-vinxi.js +1 -0
- package/dist/node/compiler/bundler.admin.d.ts +1 -0
- package/dist/node/compiler/bundler.admin.d.ts.map +1 -0
- package/dist/node/compiler/bundler.frontend.d.ts +2 -0
- package/dist/node/compiler/bundler.frontend.d.ts.map +1 -0
- package/dist/node/compiler/bundler.frontend.js +25 -11
- package/dist/node/compiler/cache-config.d.ts +3 -0
- package/dist/node/compiler/cache-config.d.ts.map +1 -0
- package/dist/node/compiler/cache-config.js +16 -0
- package/dist/node/compiler/dev-server.d.ts +4 -1
- package/dist/node/compiler/dev-server.d.ts.map +1 -0
- package/dist/node/compiler/dev-server.js +26 -13
- package/dist/node/compiler/get-vite-config.d.ts +11 -1
- package/dist/node/compiler/get-vite-config.d.ts.map +1 -0
- package/dist/node/compiler/get-vite-config.js +164 -36
- package/dist/node/compiler/vinxi-app.d.ts +1 -0
- package/dist/node/compiler/vinxi-app.d.ts.map +1 -0
- package/dist/node/compiler/vinxi-app.js +56 -39
- package/dist/node/compiler/vinxi-codegen.d.ts +1 -0
- package/dist/node/compiler/vinxi-codegen.d.ts.map +1 -0
- package/dist/node/compiler/vinxi-codegen.js +152 -85
- package/dist/node/graphql/graphql-codegen.d.ts +1 -0
- package/dist/node/graphql/graphql-codegen.d.ts.map +1 -0
- package/dist/node/graphql/graphql-codegen.js +52 -24
- package/dist/node/graphql/graphql-schema-loader.d.ts +1 -0
- package/dist/node/graphql/graphql-schema-loader.d.ts.map +1 -0
- 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 +1 -1
- package/dist/node/graphql/query-files-loader.d.ts +1 -0
- package/dist/node/graphql/query-files-loader.d.ts.map +1 -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 +112 -7
- package/dist/node/project/config.d.ts.map +1 -0
- package/dist/node/project/config.js +54 -24
- 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 +1 -0
- package/dist/node/project/env.d.ts.map +1 -0
- 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 +7 -2
- 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 +1 -0
- package/dist/node/project/manifest/manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/routes-manifest.d.ts +1 -0
- package/dist/node/project/manifest/routes-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/routes-manifest.js +1 -1
- 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/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 +4 -0
- package/dist/node/project/project.d.ts.map +1 -0
- package/dist/node/project/project.js +24 -1
- package/dist/node/project/wp-info.d.ts +2 -0
- package/dist/node/project/wp-info.d.ts.map +1 -0
- 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 +33 -6
- package/dist/node/types/block-type.d.ts.map +1 -0
- package/dist/node/types/block-type.js +3 -1
- package/dist/node/types/view-type.d.ts +1 -0
- package/dist/node/types/view-type.d.ts.map +1 -0
- package/dist/node/utils/fetch-wp.d.ts +1 -0
- package/dist/node/utils/fetch-wp.d.ts.map +1 -0
- package/dist/node/utils/fetch-wp.js +4 -3
- package/dist/node/utils/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 +2 -0
- package/dist/node/utils/fs-codegen.d.ts.map +1 -0
- package/dist/node/utils/fs-codegen.js +8 -1
- package/dist/node/utils/fs.d.ts +24 -16
- package/dist/node/utils/fs.d.ts.map +1 -0
- package/dist/node/utils/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/highlight-code.d.ts +1 -0
- package/dist/node/utils/highlight-code.d.ts.map +1 -0
- package/dist/node/utils/is-deploying.d.ts +1 -0
- package/dist/node/utils/is-deploying.d.ts.map +1 -0
- 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 +5 -0
- package/dist/node/utils/self-signed-cert.d.ts.map +1 -0
- package/dist/node/utils/self-signed-cert.js +28 -4
- package/dist/node/utils/stateful-log.d.ts +1 -0
- package/dist/node/utils/stateful-log.d.ts.map +1 -0
- package/dist/node/utils/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 +1 -0
- package/dist/node/utils/watch-file-tree.d.ts.map +1 -0
- package/package.json +34 -24
- package/tsconfig.app.json +8 -3
- package/tsconfig.node.json +1 -0
- package/types.env.d.ts +3 -0
- package/types.meta.d.ts +449 -136
- package/dist/app/server/defineRouter.d.ts +0 -2
- package/dist/app/server/defineRouter.js +0 -4
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { parseURL, stringifyParsedURL, withQuery, withTrailingSlash } from "ufo";
|
|
2
|
+
import { getCookie, getHeader } from "vinxi/http";
|
|
2
3
|
import { fetchWP } from "../../node/utils/fetch-wp.js";
|
|
3
4
|
import { filterHeader } from "./utils/headers.js";
|
|
4
5
|
import { createUrlReplacer } from "./utils/replace-host.js";
|
|
5
6
|
import { pageCache, queryCache, swr } from "./utils/swr-cache.js";
|
|
7
|
+
import { QueryMonitor } from "../utils/query-monitor.js";
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
import { inspect } from "node:util";
|
|
6
10
|
const PROXY_RESPONSE_HEADERS = ["content-type", "set-cookie", /^x-/, "cache-control", /woocommerce/, "location"];
|
|
7
11
|
const PROXY_REQUEST_HEADERS = [
|
|
8
12
|
"content-type",
|
|
@@ -23,12 +27,14 @@ export class ServerContext {
|
|
|
23
27
|
_urlReplacer;
|
|
24
28
|
rpcBases = [];
|
|
25
29
|
config;
|
|
30
|
+
cacheConfig;
|
|
26
31
|
static main;
|
|
27
32
|
constructor(conf) {
|
|
28
33
|
this.dev = conf.dev;
|
|
29
34
|
this.origin = conf.origin;
|
|
30
35
|
this.rpcBases = conf.rpcBases ?? [];
|
|
31
36
|
this.config = conf.config;
|
|
37
|
+
this.cacheConfig = conf.cacheConfig;
|
|
32
38
|
if (conf.replaceUrls) {
|
|
33
39
|
this._urlReplacer = createUrlReplacer(conf.replaceUrls);
|
|
34
40
|
}
|
|
@@ -55,13 +61,11 @@ export class ServerContext {
|
|
|
55
61
|
}
|
|
56
62
|
async fetchOrigin(url, opts) {
|
|
57
63
|
url = this.getOriginUrl(url);
|
|
64
|
+
const fetchOps = { ...opts };
|
|
65
|
+
delete fetchOps.replaceUrls;
|
|
66
|
+
delete fetchOps.newOrigin;
|
|
58
67
|
const response = await fetchWP(url, {
|
|
59
|
-
...
|
|
60
|
-
headers: {
|
|
61
|
-
"Content-Type": "application/json",
|
|
62
|
-
Accept: "application/json",
|
|
63
|
-
...opts?.headers,
|
|
64
|
-
},
|
|
68
|
+
...fetchOps,
|
|
65
69
|
});
|
|
66
70
|
if (!response.ok) {
|
|
67
71
|
return response;
|
|
@@ -82,19 +86,102 @@ export class ServerContext {
|
|
|
82
86
|
headers,
|
|
83
87
|
});
|
|
84
88
|
}
|
|
89
|
+
debugLogQueryMonitor(kind, uri, monitor) {
|
|
90
|
+
if (!QueryMonitor.hasLogEntries(monitor))
|
|
91
|
+
return;
|
|
92
|
+
let indentLevel = 2;
|
|
93
|
+
const finalOutput = [];
|
|
94
|
+
let label = "";
|
|
95
|
+
if (kind === "props") {
|
|
96
|
+
label = "While fetching props for route '" + uri + "'";
|
|
97
|
+
}
|
|
98
|
+
else if (kind === "query") {
|
|
99
|
+
label = "While querying " + uri + " via REST API";
|
|
100
|
+
}
|
|
101
|
+
else if (kind === "mutation") {
|
|
102
|
+
label = "While mutating " + uri + " via REST API";
|
|
103
|
+
}
|
|
104
|
+
else if (kind === "app") {
|
|
105
|
+
label = "While fetching app data";
|
|
106
|
+
}
|
|
107
|
+
finalOutput.push(chalk.whiteBright("➜ " + label));
|
|
108
|
+
function printEntry(entry) {
|
|
109
|
+
finalOutput.push(indent(indentLevel, chalk.whiteBright("➜ " + entry.file) + " " + chalk.gray(entry.label ? `(${entry.label})` : "")));
|
|
110
|
+
indentLevel += 2;
|
|
111
|
+
if (entry.log && entry.log.length) {
|
|
112
|
+
for (let item of entry.log) {
|
|
113
|
+
let output = "";
|
|
114
|
+
let prefix = "";
|
|
115
|
+
let message = item.message;
|
|
116
|
+
let stack = [];
|
|
117
|
+
if (item.type === "php_error") {
|
|
118
|
+
prefix = chalk.red("PHP Error:");
|
|
119
|
+
}
|
|
120
|
+
else if (item.type === "php_warning") {
|
|
121
|
+
prefix = chalk.yellow("PHP Warning:");
|
|
122
|
+
}
|
|
123
|
+
else if (item.type === "php_notice") {
|
|
124
|
+
prefix = chalk.yellow("PHP Notice:");
|
|
125
|
+
}
|
|
126
|
+
else if (item.type === "GRAPHQL_DEBUG") {
|
|
127
|
+
prefix = chalk.cyan("debug:");
|
|
128
|
+
}
|
|
129
|
+
else if (item.type === "error" && item.extensions?.category === "user") {
|
|
130
|
+
prefix = chalk.red("UserError:");
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
prefix = chalk.gray((item.type || "Log") + ":");
|
|
134
|
+
}
|
|
135
|
+
if (typeof message !== "string") {
|
|
136
|
+
message = inspect(message, { depth: 4 });
|
|
137
|
+
}
|
|
138
|
+
if (item.debugMessage) {
|
|
139
|
+
message += "\n" + chalk.gray(item.debugMessage);
|
|
140
|
+
}
|
|
141
|
+
output += prefix + " " + message;
|
|
142
|
+
if (item.path) {
|
|
143
|
+
stack.push(chalk.gray(" at path " + JSON.stringify(item.path)));
|
|
144
|
+
}
|
|
145
|
+
if (item.file) {
|
|
146
|
+
stack.push(chalk.gray(`at ${chalk.white(item.file)} line ${item.line || "??"}`));
|
|
147
|
+
}
|
|
148
|
+
if (item.stack?.length) {
|
|
149
|
+
stack.push(item.stack
|
|
150
|
+
.filter((line) => {
|
|
151
|
+
return line !== item.file + ":" + item.line;
|
|
152
|
+
})
|
|
153
|
+
.slice(0, 4)
|
|
154
|
+
.map((line) => " " + chalk.gray(line))
|
|
155
|
+
.join("\n"));
|
|
156
|
+
}
|
|
157
|
+
if (stack.length > 0) {
|
|
158
|
+
output += indent(2, "\n" + stack.join("\n"));
|
|
159
|
+
}
|
|
160
|
+
finalOutput.push(indent(indentLevel, "➜ " + output));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
for (let child of entry.children ?? []) {
|
|
164
|
+
printEntry(child);
|
|
165
|
+
}
|
|
166
|
+
indentLevel -= 2;
|
|
167
|
+
}
|
|
168
|
+
for (let entry of monitor) {
|
|
169
|
+
printEntry(entry);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
85
172
|
async fetchRouteData(req) {
|
|
86
173
|
/**
|
|
87
174
|
* Calculcate the cache key.
|
|
88
175
|
* For route data, the cache key is the pathname.
|
|
89
176
|
* TODO: Potential support for Vercel draft mode.
|
|
90
177
|
*/
|
|
91
|
-
let cacheKey = "fetchRouteData:" + req.pathname;
|
|
178
|
+
let cacheKey = "fetchRouteData:" + withTrailingSlash(req.pathname.toLowerCase());
|
|
92
179
|
const result = await swr({
|
|
93
180
|
key: cacheKey,
|
|
94
181
|
cache: pageCache,
|
|
95
|
-
forceFresh: this.dev,
|
|
182
|
+
forceFresh: this.dev || req.bypass,
|
|
183
|
+
staleWhileRevalidate: 10000,
|
|
96
184
|
getFreshValue: async (ctx) => {
|
|
97
|
-
ctx.metadata.createdTime;
|
|
98
185
|
const fetchUrl = withQuery(withTrailingSlash(req.pathname), {
|
|
99
186
|
_props: "1",
|
|
100
187
|
_ssr: "1",
|
|
@@ -111,30 +198,66 @@ export class ServerContext {
|
|
|
111
198
|
redirect: "manual",
|
|
112
199
|
});
|
|
113
200
|
const preferredCacheDuration = parseInt(result.headers.get("x-ed-cache-duration") ?? "");
|
|
114
|
-
if (
|
|
201
|
+
if (this.cacheConfig.serverless.isr) {
|
|
202
|
+
ctx.metadata.ttl = 5000;
|
|
203
|
+
}
|
|
204
|
+
else if (isFinite(preferredCacheDuration)) {
|
|
115
205
|
ctx.metadata.ttl = preferredCacheDuration * 1000;
|
|
116
206
|
}
|
|
117
207
|
let resultStatus = result.status;
|
|
118
208
|
let resultHeaders = new Headers(result.headers);
|
|
119
209
|
let resultData = {};
|
|
120
210
|
// Special case for redirects
|
|
121
|
-
if (result.headers.
|
|
211
|
+
if (result.headers.has("location")) {
|
|
122
212
|
let location = result.headers.get("location");
|
|
123
213
|
let status = result.status;
|
|
124
214
|
if (this.replaceUrls) {
|
|
125
215
|
location = this.replaceUrls(location);
|
|
126
216
|
}
|
|
127
|
-
resultHeaders.delete("location");
|
|
128
217
|
return {
|
|
129
218
|
status: 200,
|
|
130
|
-
headers:
|
|
219
|
+
headers: new Headers({
|
|
220
|
+
"Content-Type": "application/json",
|
|
221
|
+
}),
|
|
131
222
|
data: JSON.stringify({ redirect: location, status: status }),
|
|
132
223
|
};
|
|
133
224
|
}
|
|
134
|
-
|
|
225
|
+
try {
|
|
226
|
+
resultData = await result.json();
|
|
227
|
+
}
|
|
228
|
+
catch (err) {
|
|
229
|
+
console.error(`Invalid JSON response from '${fetchUrl}'. An error page will be displayed.`);
|
|
230
|
+
ctx.metadata.ttl = 0;
|
|
231
|
+
return {
|
|
232
|
+
status: 500,
|
|
233
|
+
headers: resultHeaders,
|
|
234
|
+
data: JSON.stringify({
|
|
235
|
+
view: "_error",
|
|
236
|
+
viewData: {
|
|
237
|
+
data: {
|
|
238
|
+
statusCode: 500,
|
|
239
|
+
title: "Internal Server Error",
|
|
240
|
+
userMessage: "An internal server error occurred.",
|
|
241
|
+
report: {
|
|
242
|
+
details: "A JSON parsing error occurred while fetching route data.",
|
|
243
|
+
message: err.message,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
}),
|
|
248
|
+
};
|
|
249
|
+
}
|
|
135
250
|
if (resultData && typeof resultData === "object") {
|
|
136
251
|
resultData.__generated = new Date().toISOString();
|
|
137
252
|
}
|
|
253
|
+
if (resultData.queryMonitor) {
|
|
254
|
+
this.debugLogQueryMonitor("props", req.pathname, resultData.queryMonitor);
|
|
255
|
+
}
|
|
256
|
+
// if (isFinite(preferredCacheDuration)) {
|
|
257
|
+
// const maxAge = isFinite(preferredCacheDuration) ? preferredCacheDuration * 1000 : undefined
|
|
258
|
+
// resultHeaders.set("Cache-Control", `max-age=0, s-maxage=${maxAge}, stale-while-revalidate`)
|
|
259
|
+
// }
|
|
260
|
+
resultHeaders.set("X-Ed-Fetched-At", new Date().toUTCString());
|
|
138
261
|
return {
|
|
139
262
|
status: resultStatus,
|
|
140
263
|
headers: resultHeaders,
|
|
@@ -142,19 +265,25 @@ export class ServerContext {
|
|
|
142
265
|
};
|
|
143
266
|
},
|
|
144
267
|
});
|
|
268
|
+
if (this.cacheConfig.serverless.isr) {
|
|
269
|
+
result.headers.delete("cache-control");
|
|
270
|
+
}
|
|
145
271
|
return new Response(result.data, {
|
|
146
272
|
status: result.status,
|
|
147
273
|
headers: result.headers,
|
|
148
274
|
});
|
|
149
275
|
}
|
|
150
|
-
async fetchAppData() {
|
|
276
|
+
async fetchAppData(args) {
|
|
151
277
|
const data = await swr({
|
|
152
278
|
key: "fetchAppData",
|
|
153
279
|
cache: pageCache,
|
|
280
|
+
forceFresh: this.dev || args.bypass,
|
|
281
|
+
staleWhileRevalidate: 10000,
|
|
154
282
|
getFreshValue: async (ctx) => {
|
|
155
283
|
const response = await this.fetchOrigin("/_appdata", {
|
|
156
284
|
cache: "no-cache",
|
|
157
285
|
replaceUrls: true,
|
|
286
|
+
newOrigin: args.newOrigin,
|
|
158
287
|
headers: {
|
|
159
288
|
"Content-Type": "application/json",
|
|
160
289
|
Accept: "application/json",
|
|
@@ -165,10 +294,16 @@ export class ServerContext {
|
|
|
165
294
|
if (isFinite(preferredCacheDuration)) {
|
|
166
295
|
ctx.metadata.ttl = preferredCacheDuration * 1000;
|
|
167
296
|
}
|
|
297
|
+
// In ISR mode, set a super short TTL to avoid caching, but preventing constant revalidation
|
|
298
|
+
if (this.cacheConfig.serverless.isr) {
|
|
299
|
+
ctx.metadata.ttl = 5000;
|
|
300
|
+
}
|
|
301
|
+
if (result.queryMonitor) {
|
|
302
|
+
this.debugLogQueryMonitor("app", "", result.queryMonitor);
|
|
303
|
+
}
|
|
168
304
|
result.__generated = new Date().toISOString();
|
|
169
305
|
return result;
|
|
170
306
|
},
|
|
171
|
-
forceFresh: this.dev,
|
|
172
307
|
});
|
|
173
308
|
return data;
|
|
174
309
|
}
|
|
@@ -184,7 +319,7 @@ export class ServerContext {
|
|
|
184
319
|
return headers;
|
|
185
320
|
}
|
|
186
321
|
async fetchNamedQuery(req) {
|
|
187
|
-
const url = `/wp-json/ed/v1/query/${req.name}?params=${encodeURIComponent(JSON.stringify(req.params))}`;
|
|
322
|
+
const url = `/wp-json/ed/v1/query/${req.name.replace(/^\//, "")}?params=${encodeURIComponent(JSON.stringify(req.params))}`;
|
|
188
323
|
const key = `fetchNamedQuery:${req.name}:${JSON.stringify(req.params)}`;
|
|
189
324
|
const fetch = async () => {
|
|
190
325
|
const result = await this.fetchOrigin(url, {
|
|
@@ -203,6 +338,10 @@ export class ServerContext {
|
|
|
203
338
|
if (resultData && typeof resultData === "object") {
|
|
204
339
|
resultData.__generated = new Date().toISOString();
|
|
205
340
|
}
|
|
341
|
+
resultHeaders.set("X-Ed-Rendered-At", new Date().toUTCString());
|
|
342
|
+
if (resultData.queryMonitor) {
|
|
343
|
+
this.debugLogQueryMonitor("query", req.name, resultData.queryMonitor);
|
|
344
|
+
}
|
|
206
345
|
return {
|
|
207
346
|
status: resultStatus,
|
|
208
347
|
headers: resultHeaders,
|
|
@@ -218,21 +357,28 @@ export class ServerContext {
|
|
|
218
357
|
: await swr({
|
|
219
358
|
key,
|
|
220
359
|
cache: queryCache,
|
|
221
|
-
forceFresh: this.dev,
|
|
360
|
+
forceFresh: this.dev || req.bypass,
|
|
361
|
+
staleWhileRevalidate: 10000,
|
|
222
362
|
getFreshValue: async (ctx) => {
|
|
223
363
|
const result = await fetch();
|
|
224
364
|
ctx.metadata.ttl = result.cacheTime;
|
|
365
|
+
if (this.cacheConfig.serverless.isr) {
|
|
366
|
+
ctx.metadata.ttl = 5000;
|
|
367
|
+
}
|
|
225
368
|
return result;
|
|
226
369
|
},
|
|
227
370
|
});
|
|
371
|
+
if (this.cacheConfig.serverless.isr) {
|
|
372
|
+
result.headers.delete("cache-control");
|
|
373
|
+
}
|
|
228
374
|
return new Response(result.data, {
|
|
229
375
|
status: result.status,
|
|
230
376
|
headers: result.headers,
|
|
231
377
|
});
|
|
232
378
|
}
|
|
233
379
|
async fetchMutation(req) {
|
|
234
|
-
const url = `/wp-json/ed/v1/mutation/${req.name}`;
|
|
235
|
-
|
|
380
|
+
const url = `/wp-json/ed/v1/mutation/${req.name.replace(/^\//, "")}`;
|
|
381
|
+
const response = await this.fetchOrigin(url, {
|
|
236
382
|
method: "POST",
|
|
237
383
|
cache: "no-cache",
|
|
238
384
|
replaceUrls: true,
|
|
@@ -243,6 +389,16 @@ export class ServerContext {
|
|
|
243
389
|
},
|
|
244
390
|
body: JSON.stringify(req.body),
|
|
245
391
|
});
|
|
392
|
+
return new Response(response.body, {
|
|
393
|
+
status: response.status,
|
|
394
|
+
statusText: response.statusText,
|
|
395
|
+
headers: new Headers({
|
|
396
|
+
"Content-Type": "application/json",
|
|
397
|
+
// Do not cache mutation responses
|
|
398
|
+
"Cache-Control": "max-age=0, max-s-age=0",
|
|
399
|
+
"X-Ed-Rendered-At": new Date().toUTCString(),
|
|
400
|
+
}),
|
|
401
|
+
});
|
|
246
402
|
}
|
|
247
403
|
get allowedCorsOrigins() {
|
|
248
404
|
let result = [];
|
|
@@ -252,10 +408,23 @@ export class ServerContext {
|
|
|
252
408
|
result = result.filter((origin) => origin !== "*");
|
|
253
409
|
}
|
|
254
410
|
if (this.config.serverless.cors?.origins) {
|
|
255
|
-
result.push(...this.config.serverless.cors.origins);
|
|
411
|
+
result.push(...this.config.serverless.cors.origins.map((origin) => origin.replace(/(https?:\/\/|\/$)/, "")));
|
|
256
412
|
}
|
|
257
413
|
return result;
|
|
258
414
|
}
|
|
415
|
+
shouldBypass(event) {
|
|
416
|
+
const bypassToken = process.env.VERCEL_BYPASS_TOKEN;
|
|
417
|
+
if (!bypassToken)
|
|
418
|
+
return false;
|
|
419
|
+
const cookieName = "__prerender_bypass";
|
|
420
|
+
if (getCookie(event, cookieName) === bypassToken) {
|
|
421
|
+
return true;
|
|
422
|
+
}
|
|
423
|
+
if (getHeader(event, "x-prerender-revalidate") === bypassToken) {
|
|
424
|
+
return true;
|
|
425
|
+
}
|
|
426
|
+
return false;
|
|
427
|
+
}
|
|
259
428
|
getCorsOrigin(originHeader) {
|
|
260
429
|
const parsed = parseURL(originHeader);
|
|
261
430
|
if (this.allowedCorsOrigins.includes(parsed.host)) {
|
|
@@ -281,3 +450,17 @@ export class ServerContext {
|
|
|
281
450
|
return {};
|
|
282
451
|
}
|
|
283
452
|
}
|
|
453
|
+
function indent(count, str) {
|
|
454
|
+
const indent = " ".repeat(count);
|
|
455
|
+
return str
|
|
456
|
+
.split("\n")
|
|
457
|
+
.map((line) => indent + line)
|
|
458
|
+
.join("\n");
|
|
459
|
+
}
|
|
460
|
+
function indentAllButFirst(count, str) {
|
|
461
|
+
const indent = " ".repeat(count);
|
|
462
|
+
return str
|
|
463
|
+
.split("\n")
|
|
464
|
+
.map((line, i) => (i === 0 ? line : indent + line))
|
|
465
|
+
.join("\n");
|
|
466
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-custom-config.d.ts","sourceRoot":"","sources":["../../../src/app/server/server-custom-config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,EAAE,CAAA;AAE7B,wBAAgB,kBAAkB,SAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function defineServerConfig() { }
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { EDConfig } from "../../../node/project/config";
|
|
2
|
+
import { RouteMetaTag, TrackerTags } from "../../lib/routing";
|
|
3
|
+
declare const CSP_KEYS: readonly ["childSrc", "connectSrc", "defaultSrc", "fencedFrameSrc", "fontSrc", "frameSrc", "imgSrc", "manifestSrc", "mediaSrc", "objectSrc", "scriptSrc", "scriptSrcElem", "scriptSrcAttr", "styleSrc", "styleSrcElem", "styleSrcAttr", "workerSrc", "baseUri", "formAction", "frameAncestors", "reportTo", "requireTrustedTypesFor", "trustedTypes", "upgradeInsecureRequests"];
|
|
4
|
+
export type CSPKey = (typeof CSP_KEYS)[number];
|
|
5
|
+
export type CSPParams = Record<CSPKey, Set<string>>;
|
|
6
|
+
export type ContentSecurityPolicyRequestContext = {
|
|
7
|
+
url: string;
|
|
8
|
+
type: "page";
|
|
9
|
+
tags: RouteMetaTag[];
|
|
10
|
+
};
|
|
11
|
+
export declare class SecureHeaderBuilder {
|
|
12
|
+
protected csp: CSPParams;
|
|
13
|
+
protected headers: Headers;
|
|
14
|
+
private cspEnabled;
|
|
15
|
+
private autodetectCspOrigins;
|
|
16
|
+
private useNonce;
|
|
17
|
+
private commonCspOrigins;
|
|
18
|
+
readonly nonce: string | undefined;
|
|
19
|
+
constructor(config: EDConfig);
|
|
20
|
+
addTrackingTags(tags: TrackerTags): TrackerTags;
|
|
21
|
+
addMetaTags(tags: RouteMetaTag[]): RouteMetaTag[];
|
|
22
|
+
getHeaders(): Headers;
|
|
23
|
+
getCSPHeaderValue(): string | undefined;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=content-security.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-security.d.ts","sourceRoot":"","sources":["../../../../src/app/server/utils/content-security.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAG7D,QAAA,MAAM,QAAQ,kXAyBJ,CAAA;AAEV,MAAM,MAAM,MAAM,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAA;AAE9C,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAA;AAEnD,MAAM,MAAM,mCAAmC,GAAG;IAChD,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,YAAY,EAAE,CAAA;CACrB,CAAA;AAED,qBAAa,mBAAmB;IAC9B,SAAS,CAAC,GAAG,EAAE,SAAS,CAAA;IACxB,SAAS,CAAC,OAAO,EAAE,OAAO,CAAgB;IAE1C,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,oBAAoB,CAAO;IACnC,OAAO,CAAC,QAAQ,CAAQ;IACxB,OAAO,CAAC,gBAAgB,CAAe;IAEvC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;gBAEtB,MAAM,EAAE,QAAQ;IAgC5B,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;IAkB/C,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE;IAkBhC,UAAU,IAAI,OAAO;IAWrB,iBAAiB,IAAI,MAAM,GAAG,SAAS;CAexC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import buildCsp from "content-security-policy-builder";
|
|
2
|
+
const CSP_KEYS = [
|
|
3
|
+
"childSrc",
|
|
4
|
+
"connectSrc",
|
|
5
|
+
"defaultSrc",
|
|
6
|
+
"fencedFrameSrc",
|
|
7
|
+
"fontSrc",
|
|
8
|
+
"frameSrc",
|
|
9
|
+
"imgSrc",
|
|
10
|
+
"manifestSrc",
|
|
11
|
+
"mediaSrc",
|
|
12
|
+
"objectSrc",
|
|
13
|
+
"scriptSrc",
|
|
14
|
+
"scriptSrcElem",
|
|
15
|
+
"scriptSrcAttr",
|
|
16
|
+
"styleSrc",
|
|
17
|
+
"styleSrcElem",
|
|
18
|
+
"styleSrcAttr",
|
|
19
|
+
"workerSrc",
|
|
20
|
+
"baseUri",
|
|
21
|
+
"formAction",
|
|
22
|
+
"frameAncestors",
|
|
23
|
+
"reportTo",
|
|
24
|
+
"requireTrustedTypesFor",
|
|
25
|
+
"trustedTypes",
|
|
26
|
+
"upgradeInsecureRequests",
|
|
27
|
+
];
|
|
28
|
+
export class SecureHeaderBuilder {
|
|
29
|
+
csp;
|
|
30
|
+
headers = new Headers();
|
|
31
|
+
cspEnabled = false;
|
|
32
|
+
autodetectCspOrigins = true;
|
|
33
|
+
useNonce = false;
|
|
34
|
+
commonCspOrigins = [];
|
|
35
|
+
nonce;
|
|
36
|
+
constructor(config) {
|
|
37
|
+
this.cspEnabled = config.serverless.csp.enabled;
|
|
38
|
+
this.autodetectCspOrigins = config.serverless.csp.autoDetect;
|
|
39
|
+
this.useNonce = config.serverless.csp.nonce;
|
|
40
|
+
this.commonCspOrigins = config.serverless.csp.commonOrigins ?? [];
|
|
41
|
+
if (this.useNonce) {
|
|
42
|
+
this.nonce = crypto.randomUUID();
|
|
43
|
+
}
|
|
44
|
+
// Default CSP header parameters
|
|
45
|
+
this.csp = {};
|
|
46
|
+
for (let key of CSP_KEYS) {
|
|
47
|
+
const defaults = [];
|
|
48
|
+
if (key.match(/Src$/i)) {
|
|
49
|
+
defaults.push("'self'");
|
|
50
|
+
if (this.commonCspOrigins.length) {
|
|
51
|
+
defaults.push(...this.commonCspOrigins);
|
|
52
|
+
}
|
|
53
|
+
if (config.serverless.csp.values) {
|
|
54
|
+
const value = config.serverless.csp.values[key];
|
|
55
|
+
if (value) {
|
|
56
|
+
defaults.push(...value);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (this.useNonce && !defaults.includes("'unsafe-inline'")) {
|
|
60
|
+
defaults.push(`'nonce-${this.nonce}'`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
this.csp[key] = new Set(defaults);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
addTrackingTags(tags) {
|
|
67
|
+
if (!this.autodetectCspOrigins || !this.cspEnabled)
|
|
68
|
+
return tags;
|
|
69
|
+
const handle = (value) => {
|
|
70
|
+
if (value) {
|
|
71
|
+
return value.replaceAll(/<(script|style)/g, (tag) => {
|
|
72
|
+
return tag + ` nonce="${this.nonce}"`;
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
head: handle(tags.head),
|
|
78
|
+
body: handle(tags.body),
|
|
79
|
+
footer: handle(tags.footer),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
addMetaTags(tags) {
|
|
83
|
+
if (!this.autodetectCspOrigins || !this.cspEnabled)
|
|
84
|
+
return tags;
|
|
85
|
+
return tags.map((tag) => {
|
|
86
|
+
if (this.nonce) {
|
|
87
|
+
if (tag.tagName === "script" || tag.tagName === "style") {
|
|
88
|
+
return {
|
|
89
|
+
...tag,
|
|
90
|
+
attributes: {
|
|
91
|
+
...tag.attributes,
|
|
92
|
+
nonce: this.nonce,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return tag;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
getHeaders() {
|
|
101
|
+
const result = new Headers(this.headers);
|
|
102
|
+
const cspHeaderValue = this.getCSPHeaderValue();
|
|
103
|
+
if (cspHeaderValue) {
|
|
104
|
+
result.set("Content-Security-Policy", cspHeaderValue);
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
getCSPHeaderValue() {
|
|
109
|
+
if (!this.cspEnabled)
|
|
110
|
+
return undefined;
|
|
111
|
+
const directives = [];
|
|
112
|
+
for (let key of CSP_KEYS) {
|
|
113
|
+
if (this.csp[key].size > 0) {
|
|
114
|
+
directives.push([key, Array.from(this.csp[key])]);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (directives.length) {
|
|
118
|
+
return buildCsp({
|
|
119
|
+
directives: Object.fromEntries(directives),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headers.d.ts","sourceRoot":"","sources":["../../../../src/app/server/utils/headers.ts"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,WAOrE;AAED,eAAO,MAAM,eAAe;;CAE3B,CAAA;AAYD,wBAAgB,cAAc,CAAC,UAAU,EAAE,OAAO,0BAOjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replace-host.d.ts","sourceRoot":"","sources":["../../../../src/app/server/utils/replace-host.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,0FAA0F;IAC1F,QAAQ,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,CAAA;CACjD,CAAA;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,eAAe,IAI7C,MAAM,MAAM,EAAE,YAAY,MAAM,YAiEzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swr-cache.d.ts","sourceRoot":"","sources":["../../../../src/app/server/utils/swr-cache.ts"],"names":[],"mappings":"AACA,OAAO,EAAyB,KAAK,EAAY,gBAAgB,EAAmB,MAAM,qBAAqB,CAAA;AAuB/G,eAAO,MAAM,SAAS,YAAgB,CAAA;AACtC,eAAO,MAAM,UAAU,YAAgB,CAAA;AAEvC,wBAAgB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,cAO/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APIProvider.d.ts","sourceRoot":"","sources":["../../../src/app/utils/APIProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGzC,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,2CAEvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/app/utils/BlockErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAG5E,UAAU,KAAK;IACb,KAAK,EAAE,YAAY,CAAA;IACnB,YAAY,EAAE,aAAa,CAAA;IAC3B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,qBAAa,kBAAmB,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACtD,KAAK,EAAE,KAAK,CAElB;WAEa,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAKpD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAWpD,MAAM;CAmBd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorMessage.d.ts","sourceRoot":"","sources":["../../../src/app/utils/ErrorMessage.tsx"],"names":[],"mappings":"AAAA,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,EAAE,KAAK,2CAkB5C"}
|
|
@@ -3,6 +3,7 @@ import { RouteState } from "../lib/routing/types.js";
|
|
|
3
3
|
interface Props {
|
|
4
4
|
route: RouteState;
|
|
5
5
|
children: ReactNode;
|
|
6
|
+
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
6
7
|
}
|
|
7
8
|
interface State {
|
|
8
9
|
hasError: boolean;
|
|
@@ -16,3 +17,4 @@ export declare class RouteErrorBoundary extends Component<Props, State> {
|
|
|
16
17
|
render(): ReactNode;
|
|
17
18
|
}
|
|
18
19
|
export {};
|
|
20
|
+
//# sourceMappingURL=RouteErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteErrorBoundary.d.ts","sourceRoot":"","sources":["../../../src/app/utils/RouteErrorBoundary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAMpD,UAAU,KAAK;IACb,KAAK,EAAE,UAAU,CAAA;IACjB,QAAQ,EAAE,SAAS,CAAA;IACnB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,KAAK,IAAI,CAAA;CACvD;AAED,UAAU,KAAK;IACb,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,SAAS,CAAC,EAAE,SAAS,CAAA;CACtB;AAED,qBAAa,kBAAmB,SAAQ,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC;IACtD,KAAK,EAAE,KAAK,CAElB;WAEa,wBAAwB,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK;IAKpD,iBAAiB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS;IAcpD,MAAM;CAmBd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asset-capture.d.ts","sourceRoot":"","sources":["../../../src/app/utils/asset-capture.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,sCAAwC,CAAA;AAExE,eAAO,MAAM,eAAe,mBAE3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hydration-debugger.d.ts","sourceRoot":"","sources":["../../../src/app/utils/hydration-debugger.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,KAAK,CAAA;IACZ,IAAI,EAAE,GAAG,CAAA;CACV,CAAA;AAED,eAAO,MAAM,cAAc;;YAEX,sBAAsB,EAAE;cAC5B;QAAE,KAAK,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE;CAMrC,CAAA"}
|
|
@@ -2,3 +2,4 @@ import { QueryClient } from "@tanstack/react-query";
|
|
|
2
2
|
import { PropsWithChildren } from "react";
|
|
3
3
|
export declare function getQueryClient(): QueryClient;
|
|
4
4
|
export declare function QueryProvider(props: PropsWithChildren<{}>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
//# sourceMappingURL=query-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-client.d.ts","sourceRoot":"","sources":["../../../src/app/utils/query-client.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAGzC,wBAAgB,cAAc,gBAc7B;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,CAAC,EAAE,CAAC,2CAEzD"}
|