eddev 2.0.0-beta.99 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/eddev.js +1 -1
- 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/createGravityFormComponent.d.ts +86 -0
- package/dist/app/lib/integrations/gravityforms/createGravityFormComponent.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/createGravityFormComponent.js +127 -0
- package/dist/app/lib/integrations/gravityforms/field-types.d.ts +137 -0
- package/dist/app/lib/integrations/gravityforms/field-types.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/field-types.js +449 -0
- package/dist/app/lib/integrations/gravityforms/index.d.ts +5 -0
- package/dist/app/lib/integrations/gravityforms/index.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/index.js +4 -0
- package/dist/app/lib/integrations/gravityforms/types.d.ts +64 -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 +75 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.js +397 -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 +102 -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,6 +1,8 @@
|
|
|
1
|
+
import { camelCase, pascalCase } from "change-case-all";
|
|
1
2
|
import { code, imp } from "ts-poet";
|
|
3
|
+
import { ProjectEnvUtils } from "../project/env.js";
|
|
2
4
|
import { FSCodegen } from "../utils/fs-codegen.js";
|
|
3
|
-
import {
|
|
5
|
+
import { getCacheConfig } from "./cache-config.js";
|
|
4
6
|
export function getVinxiFolder(opts) {
|
|
5
7
|
return (opts.mode === "development" ? "dev" : "prod") + (opts.serverless ? "" : "-spa");
|
|
6
8
|
}
|
|
@@ -26,16 +28,18 @@ export function createVinxiCodegen(opts) {
|
|
|
26
28
|
from: project.origin,
|
|
27
29
|
to: opts.endpoint ?? "",
|
|
28
30
|
prefixes: [
|
|
29
|
-
{ prefix: "/wp-content/uploads", replace: project.config?.serverless.uploads === "
|
|
30
|
-
{ prefix: "/wp-content/plugins", replace: project.config?.serverless.plugins === "
|
|
31
|
+
{ prefix: "/wp-content/uploads", replace: project.config?.serverless.uploads === "remote" },
|
|
32
|
+
{ prefix: "/wp-content/plugins", replace: project.config?.serverless.plugins === "remote" },
|
|
31
33
|
],
|
|
32
34
|
},
|
|
33
35
|
rpcBases: (await project.serverRoutes.get()).bases ?? [],
|
|
34
36
|
config: project.config,
|
|
37
|
+
cacheConfig: getCacheConfig(project.origin, project.config),
|
|
35
38
|
};
|
|
36
39
|
return code /* tsx */ `
|
|
37
40
|
import { ServerContext } from "eddev/server"
|
|
38
41
|
import { getManifest } from "vinxi/manifest"
|
|
42
|
+
import { apiConfig } from 'eddev/hooks'
|
|
39
43
|
|
|
40
44
|
ServerContext.setRuntime({
|
|
41
45
|
getManifest
|
|
@@ -45,6 +49,8 @@ export function createVinxiCodegen(opts) {
|
|
|
45
49
|
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
46
50
|
.join(",\n")}
|
|
47
51
|
})
|
|
52
|
+
|
|
53
|
+
apiConfig.apiKey = ${JSON.stringify(ProjectEnvUtils.getSafe("SITE_API_KEY") ?? "")}
|
|
48
54
|
`.toString();
|
|
49
55
|
},
|
|
50
56
|
});
|
|
@@ -84,7 +90,7 @@ export function createVinxiCodegen(opts) {
|
|
|
84
90
|
return code /* tsx */ `
|
|
85
91
|
${opts.serverless ? `import "./react-shim.js"` : ""}
|
|
86
92
|
${opts.serverless ? `import "vinxi/client"` : ""}
|
|
87
|
-
import "
|
|
93
|
+
import "../../${project.cssEntryFile}"
|
|
88
94
|
import "./manifest/admin"
|
|
89
95
|
import "./manifest/blocks"
|
|
90
96
|
import "./manifest/styles"
|
|
@@ -109,7 +115,7 @@ export function createVinxiCodegen(opts) {
|
|
|
109
115
|
* Also ensures that the assets used during SSR are loaded.
|
|
110
116
|
*/
|
|
111
117
|
import "vinxi/client"
|
|
112
|
-
import "
|
|
118
|
+
import "../../${project.cssEntryFile}"
|
|
113
119
|
import "./manifest/blocks"
|
|
114
120
|
import "./manifest/views"
|
|
115
121
|
|
|
@@ -120,6 +126,16 @@ export function createVinxiCodegen(opts) {
|
|
|
120
126
|
import { createAssets } from "@vinxi/react"
|
|
121
127
|
import { devToolsStore } from 'eddev/devtools'
|
|
122
128
|
|
|
129
|
+
${process.env.VERCEL_SKEW_PROTECTION_ENABLED &&
|
|
130
|
+
code /* tsx*/ `
|
|
131
|
+
// Skew protection
|
|
132
|
+
const updateSkewCookie = () => {
|
|
133
|
+
document.cookie = "__vdpl=${process.env.VERCEL_DEPLOYMENT_ID}; expires=" + new Date(Date.now() + 24 * 60 * 60 * 1000).toUTCString() + "; path=/"
|
|
134
|
+
}
|
|
135
|
+
window.onfocus = updateSkewCookie
|
|
136
|
+
updateSkewCookie()
|
|
137
|
+
`}
|
|
138
|
+
|
|
123
139
|
// Set up a dynamic entry which will load the configured tailwind manifest
|
|
124
140
|
devToolsStore.loadTailwindConfig = () => import('./manifest/tailwind-config.js')
|
|
125
141
|
|
|
@@ -132,14 +148,17 @@ export function createVinxiCodegen(opts) {
|
|
|
132
148
|
window.$reactRoot =
|
|
133
149
|
window.$reactRoot ||
|
|
134
150
|
hydrateRoot(
|
|
135
|
-
document.getElementById('
|
|
136
|
-
<SSRClientRoot assets={getAssets()} metaTags={window._PAGE_DATA
|
|
151
|
+
document.getElementById('root')!,
|
|
152
|
+
<React.Suspense><SSRClientRoot assets={getAssets()} metaTags={window._PAGE_DATA?.meta?.head} /></React.Suspense>,
|
|
153
|
+
{
|
|
154
|
+
identifierPrefix: "ed",
|
|
155
|
+
}
|
|
137
156
|
)
|
|
138
157
|
|
|
139
158
|
if (import.meta.hot) {
|
|
140
159
|
import.meta.hot.accept((mod) => {
|
|
141
160
|
if (mod) {
|
|
142
|
-
const app = <SSRClientRoot assets={getAssets()} metaTags={window._PAGE_DATA
|
|
161
|
+
const app = <React.Suspense><SSRClientRoot assets={getAssets()} metaTags={window._PAGE_DATA?.meta?.head} /></React.Suspense>
|
|
143
162
|
window.$reactRoot?.render(app)
|
|
144
163
|
}
|
|
145
164
|
})
|
|
@@ -162,7 +181,7 @@ export function createVinxiCodegen(opts) {
|
|
|
162
181
|
*/
|
|
163
182
|
import "./manifest/blocks"
|
|
164
183
|
import "./manifest/views"
|
|
165
|
-
import "
|
|
184
|
+
import "../../${project.cssEntryFile}"
|
|
166
185
|
import { devToolsStore } from 'eddev/devtools'
|
|
167
186
|
import { createRoot } from "react-dom/client"
|
|
168
187
|
import { SPARoot } from "eddev/_internal/spa-root.js"
|
|
@@ -170,7 +189,7 @@ export function createVinxiCodegen(opts) {
|
|
|
170
189
|
|
|
171
190
|
devToolsStore.loadTailwindConfig = () => import('./manifest/tailwind-config')
|
|
172
191
|
|
|
173
|
-
createRoot(document.getElementById("root")!).render(<SPARoot
|
|
192
|
+
createRoot(document.getElementById("root")!).render(<React.Suspense><SPARoot /></React.Suspense>)
|
|
174
193
|
`;
|
|
175
194
|
}
|
|
176
195
|
},
|
|
@@ -221,75 +240,18 @@ export function createVinxiCodegen(opts) {
|
|
|
221
240
|
export default router.handler
|
|
222
241
|
`,
|
|
223
242
|
});
|
|
224
|
-
// codegen.registerFile({
|
|
225
|
-
// name: "handler.data-api.ts",
|
|
226
|
-
// generate: code/* tsx */ `
|
|
227
|
-
// /// <reference types="vinxi/types/server" />
|
|
228
|
-
// import { createRouter, eventHandler, getRouterParam, getQuery, getWebRequest, getRequestHeaders, getRequestURL } from "vinxi/http"
|
|
229
|
-
// import { serverContext } from "./context.js"
|
|
230
|
-
// const router = createRouter()
|
|
231
|
-
// .get(
|
|
232
|
-
// "/route/",
|
|
233
|
-
// eventHandler(async (event) => {
|
|
234
|
-
// const id = "/"
|
|
235
|
-
// const url = getRequestURL(event);
|
|
236
|
-
// return await serverContext.fetchRouteData({
|
|
237
|
-
// pathname: id,
|
|
238
|
-
// newOrigin: url.origin,
|
|
239
|
-
// })
|
|
240
|
-
// }),
|
|
241
|
-
// )
|
|
242
|
-
// .get(
|
|
243
|
-
// "/route/**:name",
|
|
244
|
-
// eventHandler(async (event) => {
|
|
245
|
-
// const id = "/" + getRouterParam(event, "name")
|
|
246
|
-
// const url = getRequestURL(event);
|
|
247
|
-
// return await serverContext.fetchRouteData({
|
|
248
|
-
// pathname: id,
|
|
249
|
-
// newOrigin: url.origin,
|
|
250
|
-
// })
|
|
251
|
-
// }),
|
|
252
|
-
// )
|
|
253
|
-
// .get(
|
|
254
|
-
// "/query/**:name",
|
|
255
|
-
// eventHandler(async (event) => {
|
|
256
|
-
// const id = "/" + getRouterParam(event, "name")
|
|
257
|
-
// const paramString = getQuery(event).params
|
|
258
|
-
// const params = typeof paramString === "string" && paramString.length ? JSON.parse(paramString) : {}
|
|
259
|
-
// return await serverContext.fetchNamedQuery({
|
|
260
|
-
// name: id,
|
|
261
|
-
// params: params,
|
|
262
|
-
// headers: getRequestHeaders(event),
|
|
263
|
-
// })
|
|
264
|
-
// }),
|
|
265
|
-
// )
|
|
266
|
-
// .post(
|
|
267
|
-
// "/mutation/**:name",
|
|
268
|
-
// eventHandler(async (event) => {
|
|
269
|
-
// const id = "/" + getRouterParam(event, "name")
|
|
270
|
-
// const body = await getWebRequest(event).json()
|
|
271
|
-
// return await serverContext.fetchMutation({
|
|
272
|
-
// name: id,
|
|
273
|
-
// body,
|
|
274
|
-
// headers: getRequestHeaders(event),
|
|
275
|
-
// })
|
|
276
|
-
// }),
|
|
277
|
-
// )
|
|
278
|
-
// export default router.handler
|
|
279
|
-
// `,
|
|
280
|
-
// })
|
|
281
243
|
}
|
|
282
244
|
if (opts.serverless) {
|
|
283
245
|
codegen.registerFile({
|
|
284
246
|
name: "handler.ssr-page.ts",
|
|
285
247
|
generate: code /* tsx */ `
|
|
286
248
|
/// <reference types="vinxi/types/server" />
|
|
287
|
-
import "
|
|
249
|
+
import "../../${project.cssEntryFile}"
|
|
288
250
|
import "./manifest/blocks.js"
|
|
289
251
|
import "./manifest/styles.js"
|
|
290
252
|
import "./manifest/views.js"
|
|
291
253
|
import "./context.js"
|
|
292
|
-
import { proxyWpAdmin, renderPage, ServerContext } from "eddev/server"
|
|
254
|
+
import { proxyWpAdmin, renderPage, renderPageForIndexing, ServerContext } from "eddev/server"
|
|
293
255
|
import {
|
|
294
256
|
createRouter,
|
|
295
257
|
eventHandler,
|
|
@@ -298,11 +260,15 @@ export function createVinxiCodegen(opts) {
|
|
|
298
260
|
getRequestURL,
|
|
299
261
|
getRouterParam,
|
|
300
262
|
getWebRequest,
|
|
263
|
+
getCookie,
|
|
264
|
+
setCookie
|
|
301
265
|
} from "vinxi/http"
|
|
302
266
|
import { handleRPC } from "./rpc.js"
|
|
303
267
|
import { serverContext } from "./context.js"
|
|
304
268
|
import { getManifest } from "vinxi/manifest"
|
|
305
269
|
import { inspect } from "node:util"
|
|
270
|
+
import { withTrailingSlash } from 'ufo'
|
|
271
|
+
import { viewManifestReader, blockManifestReader } from 'eddev/_internal'
|
|
306
272
|
|
|
307
273
|
const router = createRouter()
|
|
308
274
|
.get(
|
|
@@ -311,7 +277,7 @@ export function createVinxiCodegen(opts) {
|
|
|
311
277
|
const id = "/"
|
|
312
278
|
const url = getRequestURL(event)
|
|
313
279
|
|
|
314
|
-
return await serverContext.fetchRouteData({ pathname: id, newOrigin: url.origin })
|
|
280
|
+
return await serverContext.fetchRouteData({ pathname: id, newOrigin: url.origin, bypass: serverContext.shouldBypass(event) })
|
|
315
281
|
}),
|
|
316
282
|
)
|
|
317
283
|
.get(
|
|
@@ -320,18 +286,27 @@ export function createVinxiCodegen(opts) {
|
|
|
320
286
|
const id = "/" + getRouterParam(event, "name")
|
|
321
287
|
const url = getRequestURL(event)
|
|
322
288
|
|
|
323
|
-
return await serverContext.fetchRouteData({ pathname: id, newOrigin: url.origin })
|
|
289
|
+
return await serverContext.fetchRouteData({ pathname: id, newOrigin: url.origin, bypass: serverContext.shouldBypass(event) })
|
|
324
290
|
}),
|
|
325
291
|
)
|
|
326
292
|
.get(
|
|
327
293
|
"/_data/query/**:name",
|
|
328
294
|
eventHandler(async (event) => {
|
|
329
|
-
const
|
|
330
|
-
|
|
295
|
+
const url = getRequestURL(event)
|
|
296
|
+
|
|
297
|
+
const [id, paramString] = event.path.replace("/_data/query", "").split("=", 2)
|
|
331
298
|
|
|
332
|
-
|
|
299
|
+
let params = {}
|
|
300
|
+
try {
|
|
301
|
+
params =
|
|
302
|
+
typeof paramString === "string" && paramString.length
|
|
303
|
+
? JSON.parse(decodeURIComponent(paramString.replace(/\\/$/, "")))
|
|
304
|
+
: {}
|
|
305
|
+
} catch (e) {
|
|
306
|
+
throw new Error("Invalid query parameters")
|
|
307
|
+
}
|
|
333
308
|
|
|
334
|
-
return await serverContext.fetchNamedQuery({ name: id, params: params, headers: getRequestHeaders(event) })
|
|
309
|
+
return await serverContext.fetchNamedQuery({ name: id, newOrigin: url.origin, params: params, headers: getRequestHeaders(event), bypass: serverContext.shouldBypass(event) })
|
|
335
310
|
}),
|
|
336
311
|
)
|
|
337
312
|
.get(
|
|
@@ -342,6 +317,7 @@ export function createVinxiCodegen(opts) {
|
|
|
342
317
|
const input = manifest.inputs[id === 'handler' ? manifest.handler : id]
|
|
343
318
|
const result = {
|
|
344
319
|
...input,
|
|
320
|
+
id,
|
|
345
321
|
assets: await input.assets(),
|
|
346
322
|
}
|
|
347
323
|
const code = inspect(result, { depth: 10 })
|
|
@@ -356,12 +332,61 @@ export function createVinxiCodegen(opts) {
|
|
|
356
332
|
return await serverContext.fetchMutation({ name: id, body, headers: getRequestHeaders(event) })
|
|
357
333
|
}),
|
|
358
334
|
)
|
|
335
|
+
.post(
|
|
336
|
+
"/_data/submit-gf",
|
|
337
|
+
eventHandler(async (event) => {
|
|
338
|
+
const req = getWebRequest(event)
|
|
339
|
+
const headers = new Headers(req.headers)
|
|
340
|
+
headers.delete("content-length")
|
|
341
|
+
headers.delete("host")
|
|
342
|
+
headers.delete("connection")
|
|
343
|
+
headers.delete("pragma")
|
|
344
|
+
return await serverContext.fetchOrigin("/wp-json/ed/v1/gf/submit/", {
|
|
345
|
+
method: "POST",
|
|
346
|
+
headers: headers,
|
|
347
|
+
body: await req.blob(),
|
|
348
|
+
})
|
|
349
|
+
}),
|
|
350
|
+
)
|
|
351
|
+
|
|
352
|
+
const aiRouter = createRouter()
|
|
353
|
+
.get(
|
|
354
|
+
"/_ai/page",
|
|
355
|
+
eventHandler(async (event) => {
|
|
356
|
+
const id = "/"
|
|
357
|
+
const url = getRequestURL(event)
|
|
358
|
+
const page = await renderPageForIndexing({ pathname: id, newOrigin: url.origin, hostname: url.hostname })
|
|
359
|
+
return new Response(page.contents, {
|
|
360
|
+
headers: {
|
|
361
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
362
|
+
"Cache-Control": "no-store",
|
|
363
|
+
},
|
|
364
|
+
})
|
|
365
|
+
}),
|
|
366
|
+
)
|
|
367
|
+
.get(
|
|
368
|
+
"/_ai/page/**:name",
|
|
369
|
+
eventHandler(async (event) => {
|
|
370
|
+
const id = "/" + getRouterParam(event, "name")
|
|
371
|
+
const url = getRequestURL(event)
|
|
372
|
+
|
|
373
|
+
const page = await renderPageForIndexing({ pathname: id, newOrigin: url.origin, hostname: url.hostname })
|
|
374
|
+
return new Response(page.contents, {
|
|
375
|
+
headers: {
|
|
376
|
+
"Content-Type": "text/html; charset=utf-8",
|
|
377
|
+
"Cache-Control": "no-store",
|
|
378
|
+
},
|
|
379
|
+
})
|
|
380
|
+
}),
|
|
381
|
+
)
|
|
359
382
|
|
|
360
383
|
export default eventHandler({
|
|
361
384
|
handler: async (event) => {
|
|
362
385
|
const serverContext = ServerContext.main
|
|
363
386
|
const url = getRequestURL(event)
|
|
364
387
|
|
|
388
|
+
await Promise.allSettled([viewManifestReader.preloadAll(), blockManifestReader.preloadAll()])
|
|
389
|
+
|
|
365
390
|
// RPC
|
|
366
391
|
const isRPC = serverContext.rpcBases.some((base) => url.pathname.startsWith(base))
|
|
367
392
|
if (isRPC) {
|
|
@@ -373,13 +398,38 @@ export function createVinxiCodegen(opts) {
|
|
|
373
398
|
return router.handler(event)
|
|
374
399
|
}
|
|
375
400
|
|
|
401
|
+
// LLM indexing route
|
|
402
|
+
if (url.pathname.startsWith("/_ai/")) {
|
|
403
|
+
return aiRouter.handler(event)
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Outdated build assets
|
|
407
|
+
if (url.pathname.match(/^\\/(_build|_admin)/)) {
|
|
408
|
+
return new Response("", { status: 404 })
|
|
409
|
+
}
|
|
410
|
+
|
|
376
411
|
// Proxy WordPress
|
|
377
412
|
if (url.pathname.includes(".") || url.pathname.startsWith("/graphql") || url.pathname.startsWith("/wp-")) {
|
|
378
413
|
return proxyWpAdmin(event)
|
|
379
414
|
}
|
|
380
415
|
|
|
416
|
+
// Enforce trailing slashes
|
|
417
|
+
if (!url.pathname.endsWith("/")) {
|
|
418
|
+
url.pathname = withTrailingSlash(url.pathname)
|
|
419
|
+
return Response.redirect(url, 301)
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
${process.env.VERCEL_SKEW_PROTECTION_ENABLED &&
|
|
423
|
+
code /* tsx*/ `
|
|
424
|
+
// Skew protection
|
|
425
|
+
setCookie(event, "__vdpl", ${JSON.stringify(process.env.VERCEL_DEPLOYMENT_ID ?? "")}, {
|
|
426
|
+
httpOnly: false,
|
|
427
|
+
path: "/",
|
|
428
|
+
})
|
|
429
|
+
`}
|
|
430
|
+
|
|
381
431
|
// SSR
|
|
382
|
-
return renderPage({ pathname: url.pathname, newOrigin: url.origin })
|
|
432
|
+
return renderPage({ pathname: url.pathname, newOrigin: url.origin, hostname: url.hostname, bypass: serverContext.shouldBypass(event) })
|
|
383
433
|
},
|
|
384
434
|
})
|
|
385
435
|
`,
|
|
@@ -403,19 +453,30 @@ export function createVinxiCodegen(opts) {
|
|
|
403
453
|
name: "manifest/blocks.ts",
|
|
404
454
|
generate: async () => {
|
|
405
455
|
const blockManifest = await project.blocks.get();
|
|
456
|
+
let blockImports = [];
|
|
457
|
+
let blockEntries = [];
|
|
458
|
+
for (const [name, block] of Object.entries(blockManifest.blocks)) {
|
|
459
|
+
if (name.match(/^_[a-z]+$/i))
|
|
460
|
+
continue;
|
|
461
|
+
const importSource = JSON.stringify("../../../" + block.fileName);
|
|
462
|
+
const jsName = pascalCase(name);
|
|
463
|
+
if (block.dynamic) {
|
|
464
|
+
const importStatement = `dynamic(() => import(${importSource}), ${JSON.stringify(block.fileName)})`;
|
|
465
|
+
blockEntries.push(JSON.stringify(block.acfName) + ": " + importStatement);
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
blockImports.push(`import ${jsName} from ${importSource}`);
|
|
469
|
+
blockEntries.push(JSON.stringify(block.acfName) + ": " + jsName);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
406
472
|
return code /* ts */ `
|
|
407
473
|
import { blockManifestReader } from 'eddev/_internal'
|
|
408
474
|
import { dynamic } from 'eddev/dynamic'
|
|
409
475
|
import core from '../../../blocks/_core'
|
|
476
|
+
${blockImports.join("\n")}
|
|
410
477
|
|
|
411
478
|
const manifest = {
|
|
412
|
-
${
|
|
413
|
-
.filter(([name]) => !name.match(/^_[a-z]+$/i))
|
|
414
|
-
.map(([name, block]) => {
|
|
415
|
-
const importStatement = `dynamic(() => import(${JSON.stringify("../../../" + block.fileName)}), ${JSON.stringify(block.fileName)})`;
|
|
416
|
-
return JSON.stringify(block.acfName) + ": " + importStatement;
|
|
417
|
-
})
|
|
418
|
-
.join(",\n")},
|
|
479
|
+
${blockEntries.join(",\n")},
|
|
419
480
|
...core
|
|
420
481
|
}
|
|
421
482
|
|
|
@@ -508,7 +569,7 @@ export function createVinxiCodegen(opts) {
|
|
|
508
569
|
return code `${JSON.stringify(view.slug)}: ${importStatement},\n`;
|
|
509
570
|
})}}
|
|
510
571
|
|
|
511
|
-
viewManifestReader.
|
|
572
|
+
viewManifestReader.set(manifest)
|
|
512
573
|
|
|
513
574
|
export default manifest
|
|
514
575
|
|
|
@@ -612,7 +673,13 @@ export function createVinxiCodegen(opts) {
|
|
|
612
673
|
endpoint: "/",
|
|
613
674
|
req: req,
|
|
614
675
|
router: router,
|
|
615
|
-
createContext
|
|
676
|
+
createContext: async (opts) => {
|
|
677
|
+
return {
|
|
678
|
+
...(await createContext(opts)),
|
|
679
|
+
searchParams: opts.info.url?.searchParams,
|
|
680
|
+
server: serverContext,
|
|
681
|
+
}
|
|
682
|
+
},
|
|
616
683
|
onError: (err) => console.error(err),
|
|
617
684
|
batching: { enabled: false },
|
|
618
685
|
// If a Response object is returned by a route, it will be sent as the response
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-codegen.d.ts","sourceRoot":"","sources":["../../../src/node/graphql/graphql-codegen.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAkB/C,eAAO,MAAM,UAAU,kEAAgE,CAAA;AA4CvF,KAAK,uBAAuB,GAAG;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,qBAAa,gBAAgB;IAiBlB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,uBAAuB;IAjBtC,OAAO,CAAC,eAAe,CAAQ;IAC/B,OAAO,CAAC,WAAW,CAAO;IAC1B,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,oBAAoB,CAAiB;IAC7C,OAAO,CAAC,YAAY,CAAQ;IAE5B,OAAO,CAAC,YAAY,CAAqB;IACzC,OAAO,CAAC,UAAU,CAAgC;IAElD,OAAO,CAAC,cAAc,CAAW;IAEjC,OAAO,CAAC,SAAS,CAAC,CAAgB;IAElC,OAAO,CAAC,UAAU,CAAC,CAAgB;gBAG1B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,uBAAuB;IA8DhC,eAAe,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE;IAkBvE,KAAK;YA8BG,MAAM;IA+CpB,aAAa;IAOP,QAAQ;IAsOd,OAAO,CAAC,mBAAmB;IAuE3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;YA2Ed,UAAU;IAqDlB,iBAAiB;IAkFjB,gBAAgB;IAyCtB;;OAEG;YACW,eAAe;CAQ9B"}
|
|
@@ -17,7 +17,7 @@ import pluginFiles from "./plugins/gql-plugin-files.js";
|
|
|
17
17
|
import pluginNoDuplicates from "./plugins/gql-plugin-no-duplicates.js";
|
|
18
18
|
import pluginQueries from "./plugins/gql-plugin-queries.js";
|
|
19
19
|
import { FSCodegen } from "../utils/fs-codegen.js";
|
|
20
|
-
import { camelCase } from "change-case-all";
|
|
20
|
+
import { camelCase, pascalCase } from "change-case-all";
|
|
21
21
|
export const graphqlLog = createConsole("GraphQL Codegen", "graphql");
|
|
22
22
|
const console = graphqlLog;
|
|
23
23
|
class GraphQLValidationError {
|
|
@@ -103,7 +103,7 @@ export class GraphQLGenerator {
|
|
|
103
103
|
ast.trailingComments ? "\n" + ast.trailingComments : "",
|
|
104
104
|
].join("");
|
|
105
105
|
return {
|
|
106
|
-
name,
|
|
106
|
+
name: name.replace(/\.graphql$/, ".txt"),
|
|
107
107
|
content,
|
|
108
108
|
};
|
|
109
109
|
});
|
|
@@ -247,6 +247,19 @@ export class GraphQLGenerator {
|
|
|
247
247
|
this.writeSchemaFile(schemaResult.schema);
|
|
248
248
|
// Get GraphQL files
|
|
249
249
|
const graphQLFiles = await this.fileLoader.get();
|
|
250
|
+
// Fill in any missing operation names
|
|
251
|
+
for (let [key, entry] of Object.entries(graphQLFiles.blocks)) {
|
|
252
|
+
if (entry.ast) {
|
|
253
|
+
const main = entry.ast.definitions[0];
|
|
254
|
+
if (main?.kind === Kind.OPERATION_DEFINITION && !main.name) {
|
|
255
|
+
// @ts-ignore
|
|
256
|
+
main.name = {
|
|
257
|
+
kind: Kind.NAME,
|
|
258
|
+
value: pascalCase(key.replace(".graphql", "").split(/\//).join("-")),
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
250
263
|
// Validate them against the schema
|
|
251
264
|
const validationErrors = this.validateGraphQLFiles(graphQLFiles, schemaResult.rawSchema);
|
|
252
265
|
if (validationErrors.length > 0) {
|
|
@@ -288,7 +301,7 @@ export class GraphQLGenerator {
|
|
|
288
301
|
this.generateTS("types.graphql.ts", schemaResult.rawSchema, {
|
|
289
302
|
documents: getDocuments(["queries", "views", "blocks", "fragments"]),
|
|
290
303
|
hasDocuments: true,
|
|
291
|
-
banner: `import { ContentBlock } from "eddev/blocks"`,
|
|
304
|
+
banner: [`import { ContentBlock } from "eddev/blocks"`, ...(wp.scalarTypeImports ?? [])].join("\n"),
|
|
292
305
|
footer: Object.keys(wp.scalarTypes)
|
|
293
306
|
.map((name) => `export type ${name.endsWith("Option") ? name : name + "Scalar"} = Scalars["${name}"]["output"]`)
|
|
294
307
|
.join("\n"),
|
|
@@ -334,7 +347,12 @@ export class GraphQLGenerator {
|
|
|
334
347
|
rootDir: this.project.rootDir,
|
|
335
348
|
folderName: "views",
|
|
336
349
|
globalName: "ViewProps",
|
|
337
|
-
additionalTypes: {
|
|
350
|
+
additionalTypes: {
|
|
351
|
+
_error: "ErrorRouteProps",
|
|
352
|
+
},
|
|
353
|
+
banner: `
|
|
354
|
+
import { ErrorRouteProps } from "eddev/routing"
|
|
355
|
+
`,
|
|
338
356
|
},
|
|
339
357
|
}),
|
|
340
358
|
this.generateTS("types.blocks.ts", schemaResult.rawSchema, {
|
|
@@ -352,7 +370,7 @@ export class GraphQLGenerator {
|
|
|
352
370
|
rootDir: this.project.rootDir,
|
|
353
371
|
globalName: "BlockProps",
|
|
354
372
|
folderName: "blocks",
|
|
355
|
-
getType: (importedName, def) => {
|
|
373
|
+
getType: (importedName, def, name) => {
|
|
356
374
|
// const queryKeyVals: any[] = []
|
|
357
375
|
let blockSelection = "";
|
|
358
376
|
let hasOthers = false;
|
|
@@ -374,6 +392,13 @@ export class GraphQLGenerator {
|
|
|
374
392
|
return {};
|
|
375
393
|
return type.join(" & ");
|
|
376
394
|
},
|
|
395
|
+
additionalTypes: Object.fromEntries(Object.entries(blockManifest.blocks).map(([key, block]) => {
|
|
396
|
+
const styleNames = new Set(block.blockStyles
|
|
397
|
+
?.map((s) => s.name)
|
|
398
|
+
.filter(Boolean)
|
|
399
|
+
.map((name) => JSON.stringify(name)) ?? []);
|
|
400
|
+
return [key, styleNames.size > 0 ? `{ "blockStyle": ${[...styleNames].join("|")} }` : null];
|
|
401
|
+
})),
|
|
377
402
|
},
|
|
378
403
|
}),
|
|
379
404
|
this.generateTS("hooks/queries.ts", schemaResult.rawSchema, {
|
|
@@ -416,7 +441,6 @@ export class GraphQLGenerator {
|
|
|
416
441
|
allFragments[node.name.value] = node;
|
|
417
442
|
});
|
|
418
443
|
function findFragments(defs, map = new Map()) {
|
|
419
|
-
// console.log("findFragments", defs.length)
|
|
420
444
|
for (let def of defs) {
|
|
421
445
|
if (def.kind === Kind.FRAGMENT_DEFINITION) {
|
|
422
446
|
map.set(def.name.value, def);
|
|
@@ -473,15 +497,34 @@ export class GraphQLGenerator {
|
|
|
473
497
|
/**
|
|
474
498
|
* Get the optimized files — queries with all fragments included
|
|
475
499
|
*/
|
|
476
|
-
const { queries } = this.getOptimizedQueries(graphQLFiles);
|
|
500
|
+
const { queries, fragments } = this.getOptimizedQueries(graphQLFiles);
|
|
477
501
|
/**
|
|
478
502
|
* Only report the same error once (mostly for preventing repeats of the same fragment errors)
|
|
479
503
|
*/
|
|
480
504
|
const errorsShown = new Map();
|
|
505
|
+
function validateAST(validationAST, path) {
|
|
506
|
+
const errors = validate(schema, validationAST, validationRules);
|
|
507
|
+
if (errors.length > 0) {
|
|
508
|
+
for (let error of errors) {
|
|
509
|
+
if (error.nodes && error.nodes[0]) {
|
|
510
|
+
const node = error.nodes[0];
|
|
511
|
+
if (errorsShown.has(node) && errorsShown.get(node)?.includes(error.message)) {
|
|
512
|
+
continue;
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
errorsShown.set(node, [...(errorsShown.get(node) ?? []), error.message]);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
report.push(new GraphQLValidationError(error.message, path, error.locations?.[0].line || 1, error.locations?.[0].column || 1, error.source?.body || ""));
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
}
|
|
481
522
|
/**
|
|
482
523
|
* Validate everything
|
|
483
524
|
*/
|
|
484
525
|
const report = [];
|
|
526
|
+
// Validate fragments
|
|
527
|
+
// Validate operations
|
|
485
528
|
for (let [groupName, fileMap] of Object.entries(graphQLFiles)) {
|
|
486
529
|
const group = queries[groupName];
|
|
487
530
|
for (let [path, file] of Object.entries(fileMap)) {
|
|
@@ -494,22 +537,7 @@ export class GraphQLGenerator {
|
|
|
494
537
|
if (!validationAST) {
|
|
495
538
|
continue;
|
|
496
539
|
}
|
|
497
|
-
|
|
498
|
-
if (errors.length > 0) {
|
|
499
|
-
for (let error of errors) {
|
|
500
|
-
if (error.nodes && error.nodes[0]) {
|
|
501
|
-
const node = error.nodes[0];
|
|
502
|
-
if (errorsShown.has(node) && errorsShown.get(node)?.includes(error.message)) {
|
|
503
|
-
continue;
|
|
504
|
-
}
|
|
505
|
-
else {
|
|
506
|
-
errorsShown.set(node, [...(errorsShown.get(node) ?? []), error.message]);
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
// console.log(error.nodes?.map((n) => n.kind))
|
|
510
|
-
report.push(new GraphQLValidationError(error.message, path, error.locations?.[0].line || 1, error.locations?.[0].column || 1, error.source?.body || ""));
|
|
511
|
-
}
|
|
512
|
-
}
|
|
540
|
+
validateAST(validationAST, path);
|
|
513
541
|
}
|
|
514
542
|
}
|
|
515
543
|
}
|
|
@@ -538,7 +566,7 @@ export class GraphQLGenerator {
|
|
|
538
566
|
output = await codegen(config);
|
|
539
567
|
}
|
|
540
568
|
catch (err) {
|
|
541
|
-
errors.push(
|
|
569
|
+
errors.push(err);
|
|
542
570
|
}
|
|
543
571
|
if (args.banner) {
|
|
544
572
|
output = args.banner + "\n\n" + output + "\n" + (args.footer ?? "");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-schema-loader.d.ts","sourceRoot":"","sources":["../../../src/node/graphql/graphql-schema-loader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAA2B,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAOpF,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,SAAS,EAAE,aAAa,CAAA;IACxB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,qBAAa,mBAAmB;IAGrB,GAAG,EAAE,MAAM;IACX,MAAM,CAAC,EAAE,MAAM;IAHxB,QAAQ,SAAK;gBAEJ,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,YAAA;IAGxB,OAAO,CAAC,YAAY,CAA0B;IAExC,GAAG,CAAC,WAAW,UAAQ;IAOvB,IAAI;IAgCV,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,aAAa;CA4BtB"}
|
|
@@ -3,12 +3,14 @@ type PluginConfig = {
|
|
|
3
3
|
rootDir: string;
|
|
4
4
|
fallbackType: string;
|
|
5
5
|
globalName: string;
|
|
6
|
-
getType?: (importedName: string, definition: any) => string;
|
|
6
|
+
getType?: (importedName: string, definition: any, name: string) => string;
|
|
7
7
|
additionalTypes: {
|
|
8
8
|
[key: string]: string;
|
|
9
9
|
};
|
|
10
|
+
banner: string;
|
|
10
11
|
};
|
|
11
12
|
declare const _default: {
|
|
12
13
|
plugin: (schema: any, documents: any, config: PluginConfig, info: any) => string;
|
|
13
14
|
};
|
|
14
15
|
export default _default;
|
|
16
|
+
//# sourceMappingURL=gql-plugin-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql-plugin-files.d.ts","sourceRoot":"","sources":["../../../../src/node/graphql/plugins/gql-plugin-files.ts"],"names":[],"mappings":"AAIA,KAAK,YAAY,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;IACzE,eAAe,EAAE;QACf,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KACtB,CAAA;IACD,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;;qBAGkB,GAAG,aAAa,GAAG,UAAU,YAAY,QAAQ,GAAG;;AADvE,wBAkEC"}
|
|
@@ -31,9 +31,9 @@ export default {
|
|
|
31
31
|
filesFound[relative.replace(/\.graphql/, "")] = true;
|
|
32
32
|
if (relative && doc.document.definitions.length) {
|
|
33
33
|
let importedName = doc.document.definitions[0].name.value + "Query";
|
|
34
|
-
let typeName = config.getType?.(importedName, doc.document.definitions[0]) || importedName;
|
|
35
|
-
imports.push(importedName);
|
|
36
34
|
const key = relative.replace(/\.graphql/, "");
|
|
35
|
+
let typeName = config.getType?.(importedName, doc.document.definitions[0], key) || importedName;
|
|
36
|
+
imports.push(importedName);
|
|
37
37
|
items.push(`${JSON.stringify(key)}: ${typeForFile(key, typeName)}`);
|
|
38
38
|
}
|
|
39
39
|
});
|
|
@@ -51,6 +51,7 @@ export default {
|
|
|
51
51
|
*/
|
|
52
52
|
import 'eddev/types.app.public'
|
|
53
53
|
${imports.length > 0 ? code `import { ${imports.sort().join(", ")} } from "./types.graphql"` : ""}
|
|
54
|
+
${config.banner || ""}
|
|
54
55
|
|
|
55
56
|
declare global {
|
|
56
57
|
interface ${config.globalName} {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql-plugin-no-duplicates.d.ts","sourceRoot":"","sources":["../../../../src/node/graphql/plugins/gql-plugin-no-duplicates.ts"],"names":[],"mappings":"AAAA,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;;;uBAIoB,GAAG,aAAa,GAAG,UAAU,YAAY,QAAQ,GAAG;;AAFzE,wBASC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql-plugin-queries.d.ts","sourceRoot":"","sources":["../../../../src/node/graphql/plugins/gql-plugin-queries.ts"],"names":[],"mappings":"AAWA,KAAK,YAAY,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;;qBAKkB,GAAG,aAAa,GAAG,UAAU,YAAY,QAAQ,GAAG;;AADvE,wBA2TC"}
|