eddev 2.0.0-beta.21 → 2.0.0-beta.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/editor-styles.css +4 -0
- package/dist/app/entry/HydrationOverlay.d.ts +2 -0
- package/dist/app/entry/HydrationOverlay.d.ts.map +1 -0
- package/dist/app/entry/HydrationOverlay.js +2 -0
- package/dist/app/entry/MetaTags.d.ts +8 -0
- package/dist/app/entry/MetaTags.d.ts.map +1 -0
- package/dist/app/entry/MetaTags.js +30 -0
- package/dist/app/entry/boot-admin.d.ts +1 -0
- package/dist/app/entry/boot-admin.d.ts.map +1 -0
- package/dist/app/entry/boot-admin.js +7 -3
- package/dist/app/entry/hydration-script.d.ts +2 -0
- package/dist/app/entry/hydration-script.d.ts.map +1 -0
- package/dist/app/entry/hydration-script.js +18 -0
- package/dist/app/entry/spa-root.d.ts +1 -0
- package/dist/app/entry/spa-root.d.ts.map +1 -0
- package/dist/app/entry/spa-root.js +3 -5
- package/dist/app/entry/ssr-root-client.d.ts +4 -1
- package/dist/app/entry/ssr-root-client.d.ts.map +1 -0
- package/dist/app/entry/ssr-root-client.js +18 -6
- package/dist/app/entry/ssr-root.d.ts +6 -4
- package/dist/app/entry/ssr-root.d.ts.map +1 -0
- package/dist/app/entry/ssr-root.js +20 -19
- 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/ContentBlocks.d.ts +7 -4
- package/dist/app/lib/blocks/ContentBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/ContentBlocks.js +16 -3
- 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 +21 -6
- package/dist/app/lib/blocks/InnerBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/InnerBlocks.js +73 -25
- package/dist/app/lib/blocks/SlotBlocks.d.ts +8 -0
- package/dist/app/lib/blocks/SlotBlocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/SlotBlocks.js +46 -0
- package/dist/app/lib/blocks/block-utils.d.ts +2 -1
- package/dist/app/lib/blocks/block-utils.d.ts.map +1 -0
- package/dist/app/lib/blocks/block-utils.js +3 -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/EditorHighlights.d.ts +8 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorHighlights.js +164 -0
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts +1 -0
- package/dist/app/lib/blocks/editor/EditorSupport.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/EditorSupport.js +17 -10
- package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +2 -1
- 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 +77 -8
- package/dist/app/lib/blocks/editor/editor-config.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/editor-config.js +29 -62
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts +4 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/installGutenbergHooks.js +126 -21
- package/dist/app/lib/blocks/editor/root-blocks.d.ts +7 -0
- package/dist/app/lib/blocks/editor/root-blocks.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/root-blocks.js +30 -0
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts +12 -1
- package/dist/app/lib/blocks/editor/usePostEditor.d.ts.map +1 -0
- package/dist/app/lib/blocks/editor/usePostEditor.js +28 -13
- package/dist/app/lib/blocks/index.d.ts +8 -5
- package/dist/app/lib/blocks/index.d.ts.map +1 -0
- package/dist/app/lib/blocks/index.js +7 -5
- package/dist/app/lib/blocks/inline-editing.d.ts +10 -0
- package/dist/app/lib/blocks/inline-editing.d.ts.map +1 -0
- package/dist/app/lib/blocks/inline-editing.js +12 -2
- 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 +2 -2
- 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 +3 -2
- package/dist/app/lib/devtools/components/GridIndicator.d.ts +2 -0
- package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +1 -0
- package/dist/app/lib/devtools/components/GridIndicator.js +29 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts +1 -0
- package/dist/app/lib/devtools/dev-tools-store.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts +2 -1
- package/dist/app/lib/devtools/hooks/usePersistState.d.ts.map +1 -0
- package/dist/app/lib/devtools/hooks/usePersistState.js +11 -2
- package/dist/app/lib/devtools/hooks/useTailwind.d.ts +77 -76
- 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 +1 -0
- package/dist/app/lib/devtools/loader.d.ts.map +1 -0
- package/dist/app/lib/devtools/loader.js +6 -5
- package/dist/app/lib/devtools/tailwind.config.d.ts +1 -0
- package/dist/app/lib/devtools/tailwind.config.d.ts.map +1 -0
- package/dist/app/lib/devtools/useQueryDebug.d.ts +8 -1
- package/dist/app/lib/devtools/useQueryDebug.d.ts.map +1 -0
- package/dist/app/lib/devtools/useQueryDebug.js +5 -8
- package/dist/app/lib/dynamic/dynamic.d.ts +2 -1
- package/dist/app/lib/dynamic/dynamic.d.ts.map +1 -0
- package/dist/app/lib/dynamic/dynamic.js +5 -1
- package/dist/app/lib/dynamic/index.d.ts +1 -0
- package/dist/app/lib/dynamic/index.d.ts.map +1 -0
- package/dist/app/lib/hooks/index.d.ts +3 -3
- package/dist/app/lib/hooks/index.d.ts.map +1 -0
- package/dist/app/lib/hooks/index.js +2 -3
- package/dist/app/lib/hooks/{queryUtils.d.ts → query-hooks.d.ts} +42 -3
- package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -0
- package/dist/app/lib/hooks/{queryUtils.js → query-hooks.js} +90 -28
- 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 -4
- package/dist/app/lib/hooks/useRPC.d.ts.map +1 -0
- package/dist/app/lib/hooks/useRPC.js +0 -8
- package/dist/app/lib/integrations/gravityforms/index.d.ts +3 -0
- package/dist/app/lib/integrations/gravityforms/index.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/index.js +2 -0
- package/dist/app/lib/integrations/gravityforms/types.d.ts +145 -0
- package/dist/app/lib/integrations/gravityforms/types.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/types.js +1 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts +31 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts.map +1 -0
- package/dist/app/lib/integrations/gravityforms/useGravityForm.js +295 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts +18 -0
- package/dist/app/lib/internal/finalize-rpc.d.ts.map +1 -0
- package/dist/app/lib/internal/finalize-rpc.js +3 -0
- package/dist/app/lib/internal/index.d.ts +2 -0
- package/dist/app/lib/internal/index.d.ts.map +1 -0
- package/dist/app/lib/internal/index.js +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 +510 -1
- 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 +50 -0
- package/dist/app/lib/routing/components/BackButton.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BackButton.js +47 -0
- package/dist/app/lib/routing/components/BrowserRouter.d.ts +10 -1
- package/dist/app/lib/routing/components/BrowserRouter.d.ts.map +1 -0
- package/dist/app/lib/routing/components/BrowserRouter.js +136 -21
- package/dist/app/lib/routing/components/ClientOnly.d.ts +2 -1
- package/dist/app/lib/routing/components/ClientOnly.d.ts.map +1 -0
- package/dist/app/lib/routing/components/ClientOnly.js +1 -1
- package/dist/app/lib/routing/components/Link.d.ts +19 -2
- package/dist/app/lib/routing/components/Link.d.ts.map +1 -0
- package/dist/app/lib/routing/components/Link.js +43 -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 +17 -3
- 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 +3 -2
- package/dist/app/lib/routing/components/ScrollRestoration.d.ts +1 -0
- package/dist/app/lib/routing/components/ScrollRestoration.d.ts.map +1 -0
- package/dist/app/lib/routing/components/ScrollRestoration.js +4 -1
- package/dist/app/lib/routing/context.d.ts +9 -5
- package/dist/app/lib/routing/context.d.ts.map +1 -0
- package/dist/app/lib/routing/context.js +12 -95
- package/dist/app/lib/routing/hooks/useIsSSR.d.ts +1 -0
- package/dist/app/lib/routing/hooks/useIsSSR.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts +3 -1
- package/dist/app/lib/routing/hooks/useRestorableState.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRoute.d.ts +16 -0
- package/dist/app/lib/routing/hooks/useRoute.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRoute.js +21 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +6 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.d.ts.map +1 -0
- package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
- package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +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 +3 -0
- package/dist/app/lib/routing/index.d.ts.map +1 -0
- package/dist/app/lib/routing/index.js +2 -0
- 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 +19 -10
- package/dist/app/lib/routing/types.d.ts +60 -12
- package/dist/app/lib/routing/types.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.d.ts +7 -2
- package/dist/app/lib/routing/utils.d.ts.map +1 -0
- package/dist/app/lib/routing/utils.js +41 -4
- package/dist/app/lib/{hooks → runtime}/apiConfig.d.ts +11 -2
- package/dist/app/lib/runtime/apiConfig.d.ts.map +1 -0
- package/dist/app/lib/runtime/apiConfig.js +6 -0
- package/dist/app/lib/runtime/errorHandling.d.ts +40 -0
- package/dist/app/lib/runtime/errorHandling.d.ts.map +1 -0
- package/dist/app/lib/runtime/errorHandling.js +6 -0
- package/dist/app/lib/runtime/index.d.ts +3 -0
- package/dist/app/lib/runtime/index.d.ts.map +1 -0
- package/dist/app/lib/runtime/index.js +2 -0
- package/dist/app/lib/views/defineView.d.ts +2 -1
- package/dist/app/lib/views/defineView.d.ts.map +1 -0
- package/dist/app/lib/views/index.d.ts +1 -0
- package/dist/app/lib/views/index.d.ts.map +1 -0
- package/dist/app/server/index.d.ts +4 -1
- package/dist/app/server/index.d.ts.map +1 -0
- package/dist/app/server/index.js +3 -1
- package/dist/app/server/proxy-wp-admin.d.ts +2 -2
- package/dist/app/server/proxy-wp-admin.d.ts.map +1 -0
- package/dist/app/server/proxy-wp-admin.js +46 -13
- package/dist/app/server/render-ai-page.d.ts +13 -0
- package/dist/app/server/render-ai-page.d.ts.map +1 -0
- package/dist/app/server/render-ai-page.js +100 -0
- package/dist/app/server/render-ssr-page.d.ts +31 -3
- package/dist/app/server/render-ssr-page.d.ts.map +1 -0
- package/dist/app/server/render-ssr-page.js +226 -10
- package/dist/app/server/rpc.d.ts +60 -0
- package/dist/app/server/rpc.d.ts.map +1 -0
- package/dist/app/server/rpc.js +18 -0
- package/dist/app/server/server-context.d.ts +44 -6
- package/dist/app/server/server-context.d.ts.map +1 -0
- package/dist/app/server/server-context.js +334 -37
- 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 +2 -1
- package/dist/app/server/utils/replace-host.d.ts.map +1 -0
- package/dist/app/server/utils/replace-host.js +10 -2
- package/dist/app/server/utils/swr-cache.d.ts +5 -0
- package/dist/app/server/utils/swr-cache.d.ts.map +1 -0
- package/dist/app/server/utils/swr-cache.js +31 -0
- package/dist/app/utils/APIProvider.d.ts +3 -0
- package/dist/app/utils/APIProvider.d.ts.map +1 -0
- package/dist/app/utils/APIProvider.js +5 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts +20 -0
- package/dist/app/utils/BlockErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/BlockErrorBoundary.js +38 -0
- package/dist/app/utils/ErrorMessage.d.ts +6 -0
- package/dist/app/utils/ErrorMessage.d.ts.map +1 -0
- package/dist/app/utils/ErrorMessage.js +14 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts +20 -0
- package/dist/app/utils/RouteErrorBoundary.d.ts.map +1 -0
- package/dist/app/utils/RouteErrorBoundary.js +41 -0
- package/dist/app/utils/asset-capture.d.ts +3 -0
- package/dist/app/utils/asset-capture.d.ts.map +1 -0
- package/dist/app/utils/asset-capture.js +5 -0
- package/dist/app/utils/hydration-debugger.d.ts +14 -0
- package/dist/app/utils/hydration-debugger.d.ts.map +1 -0
- package/dist/app/utils/hydration-debugger.js +11 -0
- package/dist/app/utils/query-client.d.ts +3 -0
- package/dist/app/utils/query-client.d.ts.map +1 -0
- package/dist/app/utils/query-client.js +5 -1
- package/dist/app/utils/query-monitor.d.ts +27 -0
- package/dist/app/utils/query-monitor.d.ts.map +1 -0
- package/dist/app/utils/query-monitor.js +7 -0
- package/dist/app/utils/trpc-client.d.ts +3 -0
- package/dist/app/utils/trpc-client.d.ts.map +1 -0
- package/dist/app/utils/trpc-client.js +39 -0
- package/dist/app/utils/wp.d.ts +11 -10
- package/dist/app/utils/wp.d.ts.map +1 -0
- package/dist/node/cli/cli-mode.d.ts +1 -0
- package/dist/node/cli/cli-mode.d.ts.map +1 -0
- package/dist/node/cli/cli-worker.d.ts +1 -0
- package/dist/node/cli/cli-worker.d.ts.map +1 -0
- package/dist/node/cli/cli-worker.js +7 -3
- package/dist/node/cli/cli.d.ts +1 -0
- package/dist/node/cli/cli.d.ts.map +1 -0
- package/dist/node/cli/cli.js +120 -7
- 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/CLIApp.js +1 -1
- package/dist/node/cli/display/boot-cli-app.d.ts +1 -0
- package/dist/node/cli/display/boot-cli-app.d.ts.map +1 -0
- package/dist/node/cli/display/boot-cli-app.js +1 -1
- package/dist/node/cli/display/components/Fullscreen.d.ts +1 -0
- package/dist/node/cli/display/components/Fullscreen.d.ts.map +1 -0
- package/dist/node/cli/display/components/LogEntries.d.ts +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 +2 -1
- 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.admin.js +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 +26 -11
- package/dist/node/compiler/dev-server.d.ts +1 -0
- package/dist/node/compiler/dev-server.d.ts.map +1 -0
- package/dist/node/compiler/dev-server.js +17 -1
- package/dist/node/compiler/get-vite-config.d.ts +12 -1
- package/dist/node/compiler/get-vite-config.d.ts.map +1 -0
- package/dist/node/compiler/get-vite-config.js +173 -42
- package/dist/node/compiler/vinxi-app.d.ts +13 -0
- package/dist/node/compiler/vinxi-app.d.ts.map +1 -0
- package/dist/node/compiler/vinxi-app.js +142 -32
- 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 +371 -108
- package/dist/node/graphql/graphql-codegen.d.ts +12 -1
- package/dist/node/graphql/graphql-codegen.d.ts.map +1 -0
- package/dist/node/graphql/graphql-codegen.js +239 -37
- package/dist/node/graphql/graphql-schema-loader.d.ts +3 -1
- package/dist/node/graphql/graphql-schema-loader.d.ts.map +1 -0
- package/dist/node/graphql/graphql-schema-loader.js +5 -16
- package/dist/node/graphql/plugins/gql-plugin-files.d.ts +3 -1
- package/dist/node/graphql/plugins/gql-plugin-files.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-files.js +3 -2
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts +1 -0
- package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.d.ts +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.d.ts.map +1 -0
- package/dist/node/graphql/plugins/gql-plugin-queries.js +2 -2
- package/dist/node/graphql/query-files-loader.d.ts +4 -0
- package/dist/node/graphql/query-files-loader.d.ts.map +1 -0
- package/dist/node/graphql/query-files-loader.js +5 -0
- package/dist/node/graphql/wp-info-query.d.ts +1 -0
- package/dist/node/graphql/wp-info-query.d.ts.map +1 -0
- package/dist/node/project/config.d.ts +207 -73
- package/dist/node/project/config.d.ts.map +1 -0
- package/dist/node/project/config.js +94 -20
- 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 +5 -0
- package/dist/node/project/env.d.ts.map +1 -0
- package/dist/node/project/env.js +1 -0
- package/dist/node/project/favicons.d.ts +1 -1
- package/dist/node/project/favicons.d.ts.map +1 -0
- package/dist/node/project/favicons.js +1 -1
- 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 +6 -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 +2 -0
- package/dist/node/project/manifest/manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/manifest.js +14 -10
- package/dist/node/project/manifest/routes-manifest.d.ts +21 -0
- package/dist/node/project/manifest/routes-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/routes-manifest.js +74 -0
- package/dist/node/project/manifest/view-manifest.d.ts +1 -0
- package/dist/node/project/manifest/view-manifest.d.ts.map +1 -0
- package/dist/node/project/manifest/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 +12 -0
- package/dist/node/project/project.d.ts.map +1 -0
- package/dist/node/project/project.js +57 -3
- package/dist/node/project/wp-info.d.ts +3 -0
- package/dist/node/project/wp-info.d.ts.map +1 -0
- package/dist/node/project/wp-info.js +13 -1
- package/dist/node/storybook/index.d.ts +3 -0
- package/dist/node/storybook/index.d.ts.map +1 -0
- package/dist/node/storybook/index.js +13 -0
- package/dist/node/types/block-type.d.ts +57 -25
- package/dist/node/types/block-type.d.ts.map +1 -0
- package/dist/node/types/block-type.js +4 -1
- package/dist/node/types/view-type.d.ts +8 -7
- package/dist/node/types/view-type.d.ts.map +1 -0
- package/dist/node/utils/fetch-wp.d.ts +2 -0
- package/dist/node/utils/fetch-wp.d.ts.map +1 -0
- package/dist/node/utils/fetch-wp.js +28 -0
- package/dist/node/utils/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 +4 -0
- package/dist/node/utils/fs-codegen.d.ts.map +1 -0
- package/dist/node/utils/fs-codegen.js +10 -2
- package/dist/node/utils/fs.d.ts +5 -0
- 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/is-deploying.js +1 -1
- package/dist/node/utils/report-builder.d.ts +1 -0
- 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/stateful-log.js +2 -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 +18 -3
- package/dist/node/utils/watch-file-tree.d.ts.map +1 -0
- package/dist/node/utils/watch-file-tree.js +12 -5
- package/package.json +42 -25
- package/tsconfig.app.json +10 -5
- package/tsconfig.node.json +3 -2
- package/types.app.d.ts +2 -0
- package/types.meta.d.ts +449 -136
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +0 -15
- package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +0 -35
- package/dist/app/lib/hooks/apiConfig.js +0 -4
- package/dist/app/lib/hooks/usePageLoad.d.ts +0 -6
- package/dist/app/lib/hooks/usePageLoad.js +0 -5
|
@@ -31,20 +31,24 @@ export function createManifestGenerator(args) {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
if (args.watch) {
|
|
34
|
-
const disposer = await watchFileTree(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
fileList
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
const disposer = await watchFileTree({
|
|
35
|
+
pattern: args.pattern,
|
|
36
|
+
ignore: args.ignore,
|
|
37
|
+
callback: (fileList, event) => {
|
|
38
|
+
files = fileList;
|
|
39
|
+
cache = new Map();
|
|
40
|
+
if (args.onFileChange)
|
|
41
|
+
fileList.forEach(args.onFileChange);
|
|
42
|
+
update();
|
|
43
|
+
if (event) {
|
|
44
|
+
events.push(event);
|
|
45
|
+
}
|
|
46
|
+
},
|
|
43
47
|
});
|
|
44
48
|
disposers.push(disposer);
|
|
45
49
|
}
|
|
46
50
|
else {
|
|
47
|
-
files = await getFileTree(args.pattern);
|
|
51
|
+
files = await getFileTree({ pattern: args.pattern, ignore: args.ignore });
|
|
48
52
|
update();
|
|
49
53
|
}
|
|
50
54
|
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Project } from "../project.js";
|
|
2
|
+
export type RouteManifest = {
|
|
3
|
+
routes: Record<string, RouteInfo>;
|
|
4
|
+
contextFileName: string | null;
|
|
5
|
+
validationMessages: {
|
|
6
|
+
fieldKey: string;
|
|
7
|
+
message: string;
|
|
8
|
+
severity: "error" | "warning";
|
|
9
|
+
}[];
|
|
10
|
+
bases: string[];
|
|
11
|
+
};
|
|
12
|
+
type RouteInfo = {
|
|
13
|
+
kind: "context" | "route";
|
|
14
|
+
fileName: string;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
};
|
|
18
|
+
export type RouteManifestGenerator = ReturnType<typeof loadRouteManifest>;
|
|
19
|
+
export declare function loadRouteManifest(project: Project): import("./manifest.js").ManifestGenerator<RouteInfo, RouteManifest>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=routes-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes-manifest.d.ts","sourceRoot":"","sources":["../../../../src/node/project/manifest/routes-manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACjC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,kBAAkB,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;KAC9B,EAAE,CAAA;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;CAChB,CAAA;AAED,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,SAAS,GAAG,OAAO,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAEzE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,uEA4EjD"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { cliMode } from "../../cli/cli-mode.js";
|
|
2
|
+
import { createManifestGenerator } from "./manifest.js";
|
|
3
|
+
export function loadRouteManifest(project) {
|
|
4
|
+
return createManifestGenerator({
|
|
5
|
+
baseDir: project.rootDir,
|
|
6
|
+
pattern: ["server/routes/**/*.{ts,tsx}", "server/_context.{ts,tsx}"],
|
|
7
|
+
watch: cliMode.watch,
|
|
8
|
+
async generateManifest(entries) {
|
|
9
|
+
let result = {
|
|
10
|
+
routes: {},
|
|
11
|
+
contextFileName: null,
|
|
12
|
+
validationMessages: [],
|
|
13
|
+
bases: [],
|
|
14
|
+
};
|
|
15
|
+
const bases = new Set();
|
|
16
|
+
Object.entries(entries)
|
|
17
|
+
.sort(([b1], [b2]) => {
|
|
18
|
+
return b1.localeCompare(b2);
|
|
19
|
+
})
|
|
20
|
+
.forEach(([key, entry]) => {
|
|
21
|
+
if (entry.value.kind === "context") {
|
|
22
|
+
result.contextFileName = entry.value.fileName;
|
|
23
|
+
}
|
|
24
|
+
else if (entry.value.kind === "route") {
|
|
25
|
+
const { error: initialError } = entry.value;
|
|
26
|
+
const prefix = entry.value.prefix;
|
|
27
|
+
result.routes[key] = entry.value;
|
|
28
|
+
if (prefix) {
|
|
29
|
+
let shouldAdd = true;
|
|
30
|
+
bases.forEach((base) => {
|
|
31
|
+
if (base.startsWith(prefix)) {
|
|
32
|
+
bases.delete(base);
|
|
33
|
+
}
|
|
34
|
+
else if (prefix.startsWith(base)) {
|
|
35
|
+
shouldAdd = false;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
if (shouldAdd) {
|
|
40
|
+
bases.add(entry.value.prefix);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (initialError) {
|
|
44
|
+
result.validationMessages.push({
|
|
45
|
+
fieldKey: key,
|
|
46
|
+
message: initialError,
|
|
47
|
+
severity: "error",
|
|
48
|
+
});
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
result.bases = [...bases].sort().map((base) => "/" + base.replace(/\./g, "/"));
|
|
54
|
+
return result;
|
|
55
|
+
},
|
|
56
|
+
getKey(path) {
|
|
57
|
+
// Strip the views folder name + extension
|
|
58
|
+
return path.replace(/\.tsx?$/, "").replace(/^server\/routes\//, "");
|
|
59
|
+
},
|
|
60
|
+
async loadValue(fileName, key) {
|
|
61
|
+
if (fileName.startsWith("server/_context.")) {
|
|
62
|
+
return {
|
|
63
|
+
kind: "context",
|
|
64
|
+
fileName,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
kind: "route",
|
|
69
|
+
prefix: key.replace("/index", "").replace(/\//g, "."),
|
|
70
|
+
fileName,
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -17,3 +17,4 @@ type ViewLoadResult = {
|
|
|
17
17
|
export type ViewManifestGenerator = ReturnType<typeof loadViewManifest>;
|
|
18
18
|
export declare function loadViewManifest(project: Project): import("./manifest.js").ManifestGenerator<ViewLoadResult, ViewManifest>;
|
|
19
19
|
export {};
|
|
20
|
+
//# sourceMappingURL=view-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-manifest.d.ts","sourceRoot":"","sources":["../../../../src/node/project/manifest/view-manifest.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,YAAY,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAIhG,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAKvC,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE;QACL,CAAC,CAAC,EAAE,MAAM,GAAG,YAAY,CAAA;KAC1B,CAAA;IACD,kBAAkB,EAAE;QAClB,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;KAC9B,EAAE,CAAA;CACJ,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,uBAAuB,GAAG,IAAI,CAAA;IACpC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEvE,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,2EAwFhD"}
|
|
@@ -15,3 +15,4 @@ type WidgetInfo = {
|
|
|
15
15
|
export type WidgetManifestGenerator = ReturnType<typeof loadWidgetManifest>;
|
|
16
16
|
export declare function loadWidgetManifest(project: Project): import("./manifest.js").ManifestGenerator<WidgetInfo, WidgetManifest>;
|
|
17
17
|
export {};
|
|
18
|
+
//# sourceMappingURL=widget-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-manifest.d.ts","sourceRoot":"","sources":["../../../../src/node/project/manifest/widget-manifest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACnC,kBAAkB,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAA;QAChB,OAAO,EAAE,MAAM,CAAA;QACf,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;KAC9B,EAAE,CAAA;CACJ,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE3E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,yEA0ClD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EDConfig } from "./config.js";
|
|
2
2
|
import { BlockManifestGenerator } from "./manifest/block-manifest.js";
|
|
3
3
|
import { FieldManifestGenerator } from "./manifest/field-manifest.js";
|
|
4
|
+
import { RouteManifestGenerator } from "./manifest/routes-manifest.js";
|
|
4
5
|
import { ViewManifestGenerator } from "./manifest/view-manifest.js";
|
|
5
6
|
import { WidgetManifestGenerator } from "./manifest/widget-manifest.js";
|
|
6
7
|
export declare const projectLog: import("../utils/stateful-log.js").StatefulLog<Project>;
|
|
@@ -20,14 +21,23 @@ export declare class Project {
|
|
|
20
21
|
configFile: string;
|
|
21
22
|
origin: string;
|
|
22
23
|
config?: EDConfig;
|
|
24
|
+
cssEntryFile: string;
|
|
23
25
|
blocks: BlockManifestGenerator;
|
|
24
26
|
views: ViewManifestGenerator;
|
|
25
27
|
fields: FieldManifestGenerator;
|
|
26
28
|
widgets: WidgetManifestGenerator;
|
|
29
|
+
serverRoutes: RouteManifestGenerator;
|
|
27
30
|
private wp;
|
|
28
31
|
reportPluginCompatibility: boolean;
|
|
29
32
|
private constructor();
|
|
33
|
+
verifyOriginAccess(): Promise<{
|
|
34
|
+
success: true;
|
|
35
|
+
} | {
|
|
36
|
+
success: false;
|
|
37
|
+
message: string;
|
|
38
|
+
}>;
|
|
30
39
|
private load;
|
|
40
|
+
detectCssEntryFile(): Promise<void>;
|
|
31
41
|
reportProjectInfo(): string;
|
|
32
42
|
getWordpressInfo(): Promise<{
|
|
33
43
|
postTypes: {
|
|
@@ -52,7 +62,9 @@ export declare class Project {
|
|
|
52
62
|
isScalar: boolean;
|
|
53
63
|
typeName: string;
|
|
54
64
|
}[];
|
|
65
|
+
scalarTypeImports?: string[];
|
|
55
66
|
}>;
|
|
56
67
|
static create(args: ProjectArgs): Promise<Project>;
|
|
57
68
|
}
|
|
58
69
|
export {};
|
|
70
|
+
//# sourceMappingURL=project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/node/project/project.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEpD,OAAO,EAAE,sBAAsB,EAAqB,MAAM,8BAA8B,CAAA;AACxF,OAAO,EAAE,sBAAsB,EAAqB,MAAM,8BAA8B,CAAA;AACxF,OAAO,EAAE,sBAAsB,EAAqB,MAAM,+BAA+B,CAAA;AACzF,OAAO,EAAE,qBAAqB,EAAoB,MAAM,6BAA6B,CAAA;AACrF,OAAO,EAAE,uBAAuB,EAAsB,MAAM,+BAA+B,CAAA;AAO3F,eAAO,MAAM,UAAU,yDAAU,CAAA;AAEjC,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,yBAAyB,CAAC,EAAE,OAAO,CAAA;CACpC,CAAA;AAED;;;GAGG;AACH,qBAAa,OAAO;IAClB,OAAO,SAAK;IACZ,SAAS,SAAK;IACd,SAAS,SAAK;IACd,OAAO,SAAK;IACZ,UAAU,SAAK;IACf,MAAM,SAAK;IAEX,MAAM,CAAC,EAAE,QAAQ,CAAA;IAEjB,YAAY,SAAoB;IAChC,MAAM,EAAG,sBAAsB,CAAA;IAC/B,KAAK,EAAG,qBAAqB,CAAA;IAC7B,MAAM,EAAG,sBAAsB,CAAA;IAC/B,OAAO,EAAG,uBAAuB,CAAA;IACjC,YAAY,EAAG,sBAAsB,CAAA;IACrC,OAAO,CAAC,EAAE,CAAS;IAEnB,yBAAyB,UAAQ;IAEjC,OAAO;IAYD,kBAAkB,IAAI,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,OAAO,EAAE,KAAK,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;YA4B9E,IAAI;IAmEZ,kBAAkB;IAUxB,iBAAiB;IAkBX,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;WAKT,MAAM,CAAC,IAAI,EAAE,WAAW;CAKtC"}
|
|
@@ -8,9 +8,11 @@ import { Configurator } from "./config.js";
|
|
|
8
8
|
import { ProjectEnvUtils } from "./env.js";
|
|
9
9
|
import { loadBlockManifest } from "./manifest/block-manifest.js";
|
|
10
10
|
import { loadFieldManifest } from "./manifest/field-manifest.js";
|
|
11
|
+
import { loadRouteManifest } from "./manifest/routes-manifest.js";
|
|
11
12
|
import { loadViewManifest } from "./manifest/view-manifest.js";
|
|
12
13
|
import { loadWidgetManifest } from "./manifest/widget-manifest.js";
|
|
13
14
|
import { WPInfo } from "./wp-info.js";
|
|
15
|
+
import { fs } from "../utils/fs.js";
|
|
14
16
|
const console = createConsole("Project", "project");
|
|
15
17
|
export const projectLog = console;
|
|
16
18
|
/**
|
|
@@ -25,31 +27,74 @@ export class Project {
|
|
|
25
27
|
configFile = "";
|
|
26
28
|
origin = "";
|
|
27
29
|
config;
|
|
30
|
+
cssEntryFile = "views/index.css";
|
|
28
31
|
blocks;
|
|
29
32
|
views;
|
|
30
33
|
fields;
|
|
31
34
|
widgets;
|
|
35
|
+
serverRoutes;
|
|
32
36
|
wp;
|
|
33
37
|
reportPluginCompatibility = false;
|
|
34
38
|
constructor(opts) {
|
|
35
39
|
this.rootDir = opts.rootDir;
|
|
36
|
-
this.origin = ProjectEnvUtils.
|
|
40
|
+
this.origin = ProjectEnvUtils.getSafe("SITE_URL") ?? "";
|
|
37
41
|
this.reportPluginCompatibility = opts.reportPluginCompatibility || false;
|
|
38
42
|
this.blocks = loadBlockManifest(this);
|
|
39
43
|
this.views = loadViewManifest(this);
|
|
40
44
|
this.fields = loadFieldManifest(this);
|
|
41
45
|
this.widgets = loadWidgetManifest(this);
|
|
42
|
-
this.
|
|
46
|
+
this.serverRoutes = loadRouteManifest(this);
|
|
47
|
+
this.wp = new WPInfo(this.origin);
|
|
48
|
+
}
|
|
49
|
+
async verifyOriginAccess() {
|
|
50
|
+
try {
|
|
51
|
+
const response = await this.wp.ping();
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
return {
|
|
54
|
+
success: false,
|
|
55
|
+
message: [
|
|
56
|
+
`Failed to access WordPress origin at ${this.origin}`,
|
|
57
|
+
`Using API Key?: ${ProjectEnvUtils.getSafe("SITE_API_KEY") ? "Yes" : "No"}`,
|
|
58
|
+
`Response: ${response.status} ${response.statusText}`,
|
|
59
|
+
].join("\n"),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
success: true,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
return {
|
|
68
|
+
success: false,
|
|
69
|
+
message: [
|
|
70
|
+
`Failed to access WordPress origin at ${this.origin}`,
|
|
71
|
+
`Using API Key?: ${ProjectEnvUtils.getSafe("SITE_API_KEY") ? "Yes" : "No"}`,
|
|
72
|
+
`The following error occurred:${err}`,
|
|
73
|
+
].join("\n"),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
43
76
|
}
|
|
44
77
|
async load() {
|
|
45
78
|
console.setWorking(true);
|
|
46
79
|
console.setState(this);
|
|
47
|
-
const repoInfo = await getRepoInfo(this.rootDir)
|
|
80
|
+
const repoInfo = await getRepoInfo(this.rootDir).catch(() => {
|
|
81
|
+
projectLog.warn("Failed to get repo info");
|
|
82
|
+
const name = this.rootDir.split("/").pop();
|
|
83
|
+
return {
|
|
84
|
+
themeName: name,
|
|
85
|
+
repoName: name,
|
|
86
|
+
repoURL: "",
|
|
87
|
+
};
|
|
88
|
+
});
|
|
48
89
|
this.themeName = repoInfo.themeName;
|
|
49
90
|
this.publicUrl = `/wp-content/themes/${repoInfo.themeName}/`;
|
|
50
91
|
this.configFile = relative(process.cwd(), resolve(this.rootDir, "ed.config.json"));
|
|
51
92
|
this.repoUrl = repoInfo.repoURL?.replace("git@github.com:", "https://github.com/").replace(".git", "") || "";
|
|
52
93
|
this.reportProjectInfo();
|
|
94
|
+
/**
|
|
95
|
+
* Detect CSS file
|
|
96
|
+
*/
|
|
97
|
+
await this.detectCssEntryFile();
|
|
53
98
|
/**
|
|
54
99
|
* Make sure the git repo name matches
|
|
55
100
|
*/
|
|
@@ -87,6 +132,15 @@ export class Project {
|
|
|
87
132
|
console.setWorking(false);
|
|
88
133
|
console.info(this.reportProjectInfo());
|
|
89
134
|
}
|
|
135
|
+
async detectCssEntryFile() {
|
|
136
|
+
const candidates = ["styles/index.css", "views/index.css", "style.css"];
|
|
137
|
+
for (const candidate of candidates) {
|
|
138
|
+
if (await fs.exists(resolve(this.rootDir, candidate))) {
|
|
139
|
+
this.cssEntryFile = candidate;
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
90
144
|
reportProjectInfo() {
|
|
91
145
|
return objFormat({
|
|
92
146
|
"Theme Name": this.themeName,
|
|
@@ -21,12 +21,15 @@ type WPInfoData = {
|
|
|
21
21
|
isScalar: boolean;
|
|
22
22
|
typeName: string;
|
|
23
23
|
}[];
|
|
24
|
+
scalarTypeImports?: string[];
|
|
24
25
|
};
|
|
25
26
|
export declare class WPInfo {
|
|
26
27
|
siteUrl: string;
|
|
27
28
|
private cached?;
|
|
28
29
|
constructor(siteUrl: string);
|
|
30
|
+
ping(): Promise<Response>;
|
|
29
31
|
getInfo(force?: boolean): Promise<WPInfoData>;
|
|
30
32
|
getPluginIssues(): Promise<string[]>;
|
|
31
33
|
}
|
|
32
34
|
export {};
|
|
35
|
+
//# sourceMappingURL=wp-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wp-info.d.ts","sourceRoot":"","sources":["../../../src/node/project/wp-info.ts"],"names":[],"mappings":"AAGA,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,OAAO,CAAA;QACnB,iBAAiB,EAAE,MAAM,CAAA;QACzB,iBAAiB,EAAE,MAAM,CAAA;QACzB,iBAAiB,EAAE,OAAO,CAAA;KAC3B,EAAE,CAAA;IACH,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,GAAG,EAAE,MAAM,CAAA;KACZ,EAAE,CAAA;IACH,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,aAAa,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IACrE,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC7B,CAAA;AAED,qBAAa,MAAM;IAEE,OAAO,EAAE,MAAM;IADlC,OAAO,CAAC,MAAM,CAAC,CAAY;gBACR,OAAO,EAAE,MAAM;IAE5B,IAAI;IASJ,OAAO,CAAC,KAAK,GAAE,OAAe;IAe9B,eAAe;CAetB"}
|
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { resolveURL } from "ufo";
|
|
2
|
+
import { fetchWP } from "../utils/fetch-wp.js";
|
|
2
3
|
export class WPInfo {
|
|
3
4
|
siteUrl;
|
|
4
5
|
cached;
|
|
5
6
|
constructor(siteUrl) {
|
|
6
7
|
this.siteUrl = siteUrl;
|
|
7
8
|
}
|
|
9
|
+
async ping() {
|
|
10
|
+
if (!this.siteUrl) {
|
|
11
|
+
throw new Error("Attempted to ping WordPress, but SITE_URL was not present in the environment.");
|
|
12
|
+
}
|
|
13
|
+
const url = resolveURL(this.siteUrl, "/wp-json/ed/v1/handshake");
|
|
14
|
+
const response = await fetchWP(url);
|
|
15
|
+
return response;
|
|
16
|
+
}
|
|
8
17
|
async getInfo(force = false) {
|
|
18
|
+
if (!this.siteUrl) {
|
|
19
|
+
throw new Error("Attempted to get site info from WordPress, but SITE_URL was not present in the environment.");
|
|
20
|
+
}
|
|
9
21
|
if (this.cached && !force)
|
|
10
22
|
return this.cached;
|
|
11
23
|
const url = resolveURL(this.siteUrl, "/wp-json/ed/v1/dev/site-info");
|
|
12
|
-
const response = await
|
|
24
|
+
const response = await fetchWP(url);
|
|
13
25
|
const result = (await response.json());
|
|
14
26
|
this.cached = result;
|
|
15
27
|
return result;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/storybook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAA;AAGnC,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,YAAY,gBAc5D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { storybookVitePlugins } from "../compiler/get-vite-config";
|
|
2
|
+
export function applyViteStorybookConfig(config) {
|
|
3
|
+
config.plugins?.push(storybookVitePlugins({
|
|
4
|
+
client: true,
|
|
5
|
+
console: console,
|
|
6
|
+
mode: process.env.NODE_ENV === "production" ? "production" : "development",
|
|
7
|
+
rootDir: process.cwd(),
|
|
8
|
+
publicUrl: "/",
|
|
9
|
+
serverless: true,
|
|
10
|
+
target: "frontend",
|
|
11
|
+
}));
|
|
12
|
+
return config;
|
|
13
|
+
}
|
|
@@ -9,7 +9,7 @@ export declare const BlockMetaSchema: z.ZodObject<{
|
|
|
9
9
|
description: z.ZodOptional<z.ZodString>;
|
|
10
10
|
category: z.ZodDefault<z.ZodString>;
|
|
11
11
|
icon: z.ZodOptional<z.ZodString>;
|
|
12
|
-
keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
keywords: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
13
13
|
types: z.ZodArray<z.ZodString, "many">;
|
|
14
14
|
templates: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
15
15
|
mode: z.ZodDefault<z.ZodEnum<["preview", "edit", "both"]>>;
|
|
@@ -23,70 +23,102 @@ export declare const BlockMetaSchema: z.ZodObject<{
|
|
|
23
23
|
cache: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
24
24
|
allowMultiple: z.ZodDefault<z.ZodBoolean>;
|
|
25
25
|
postMetaBlock: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
postTypes: z.ZodArray<z.ZodString, "many">;
|
|
26
27
|
fieldName: z.ZodString;
|
|
27
28
|
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
postTypes: string[];
|
|
28
30
|
fieldName: string;
|
|
29
31
|
}, {
|
|
32
|
+
postTypes: string[];
|
|
30
33
|
fieldName: string;
|
|
31
34
|
}>>;
|
|
32
35
|
frontendMode: z.ZodDefault<z.ZodEnum<["hidden", "childrenOnly", "default"]>>;
|
|
33
36
|
inserter: z.ZodDefault<z.ZodBoolean>;
|
|
37
|
+
blockStyles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
38
|
+
name: z.ZodString;
|
|
39
|
+
label: z.ZodString;
|
|
40
|
+
isDefault: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
label: string;
|
|
43
|
+
name: string;
|
|
44
|
+
isDefault?: boolean | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
label: string;
|
|
47
|
+
name: string;
|
|
48
|
+
isDefault?: boolean | undefined;
|
|
49
|
+
}>, "many">>;
|
|
50
|
+
lazyLoad: z.ZodOptional<z.ZodBoolean>;
|
|
34
51
|
}, "strip", z.ZodTypeAny, {
|
|
35
|
-
|
|
52
|
+
title: string;
|
|
53
|
+
mode: "both" | "edit" | "preview";
|
|
54
|
+
slug: string;
|
|
55
|
+
tags: string[];
|
|
56
|
+
flags: Record<string, any>;
|
|
57
|
+
category: string;
|
|
58
|
+
parent: string[];
|
|
59
|
+
inserter: boolean;
|
|
36
60
|
acfName: string;
|
|
37
61
|
fileName: string;
|
|
38
|
-
slug: string;
|
|
39
62
|
graphqlFieldName: string;
|
|
40
|
-
title: string;
|
|
41
|
-
category: string;
|
|
42
63
|
types: string[];
|
|
43
|
-
mode: "preview" | "edit" | "both";
|
|
44
|
-
tags: string[];
|
|
45
|
-
flags: Record<string, any>;
|
|
46
64
|
childTags: string[];
|
|
47
65
|
childBlocks: string[];
|
|
48
|
-
parent: string[];
|
|
49
66
|
ancestors: string[];
|
|
50
67
|
dynamic: boolean;
|
|
68
|
+
cache: boolean;
|
|
51
69
|
allowMultiple: boolean;
|
|
52
|
-
frontendMode: "
|
|
53
|
-
inserter: boolean;
|
|
54
|
-
description?: string | undefined;
|
|
70
|
+
frontendMode: "hidden" | "default" | "childrenOnly";
|
|
55
71
|
icon?: string | undefined;
|
|
56
|
-
|
|
72
|
+
description?: string | undefined;
|
|
73
|
+
keywords?: string | string[] | undefined;
|
|
57
74
|
templates?: string[] | null | undefined;
|
|
58
75
|
postMetaBlock?: {
|
|
76
|
+
postTypes: string[];
|
|
59
77
|
fieldName: string;
|
|
60
78
|
} | undefined;
|
|
79
|
+
blockStyles?: {
|
|
80
|
+
label: string;
|
|
81
|
+
name: string;
|
|
82
|
+
isDefault?: boolean | undefined;
|
|
83
|
+
}[] | undefined;
|
|
84
|
+
lazyLoad?: boolean | undefined;
|
|
61
85
|
}, {
|
|
86
|
+
title: string;
|
|
87
|
+
slug: string;
|
|
62
88
|
acfName: string;
|
|
63
89
|
fileName: string;
|
|
64
|
-
slug: string;
|
|
65
90
|
graphqlFieldName: string;
|
|
66
|
-
title: string;
|
|
67
91
|
types: string[];
|
|
68
|
-
|
|
69
|
-
description?: string | undefined;
|
|
70
|
-
category?: string | undefined;
|
|
71
|
-
icon?: string | undefined;
|
|
72
|
-
keywords?: string[] | undefined;
|
|
73
|
-
templates?: string[] | null | undefined;
|
|
74
|
-
mode?: "preview" | "edit" | "both" | undefined;
|
|
92
|
+
mode?: "both" | "edit" | "preview" | undefined;
|
|
75
93
|
tags?: string[] | undefined;
|
|
76
94
|
flags?: Record<string, any> | undefined;
|
|
95
|
+
icon?: string | undefined;
|
|
96
|
+
category?: string | undefined;
|
|
97
|
+
description?: string | undefined;
|
|
98
|
+
keywords?: string | string[] | undefined;
|
|
99
|
+
parent?: string[] | undefined;
|
|
100
|
+
inserter?: boolean | undefined;
|
|
101
|
+
templates?: string[] | null | undefined;
|
|
77
102
|
childTags?: string[] | undefined;
|
|
78
103
|
childBlocks?: string[] | undefined;
|
|
79
|
-
parent?: string[] | undefined;
|
|
80
104
|
ancestors?: string[] | undefined;
|
|
81
105
|
dynamic?: boolean | undefined;
|
|
106
|
+
cache?: boolean | undefined;
|
|
82
107
|
allowMultiple?: boolean | undefined;
|
|
83
108
|
postMetaBlock?: {
|
|
109
|
+
postTypes: string[];
|
|
84
110
|
fieldName: string;
|
|
85
111
|
} | undefined;
|
|
86
|
-
frontendMode?: "
|
|
87
|
-
|
|
112
|
+
frontendMode?: "hidden" | "default" | "childrenOnly" | undefined;
|
|
113
|
+
blockStyles?: {
|
|
114
|
+
label: string;
|
|
115
|
+
name: string;
|
|
116
|
+
isDefault?: boolean | undefined;
|
|
117
|
+
}[] | undefined;
|
|
118
|
+
lazyLoad?: boolean | undefined;
|
|
88
119
|
}>;
|
|
89
120
|
export type BlockMetadata = z.infer<typeof BlockMetaSchema>;
|
|
90
121
|
export type BlockMetadataConstructor = z.input<typeof BlockMetaSchema>;
|
|
91
122
|
export declare function describeBlock(block: BlockMetadata): string;
|
|
92
123
|
export declare function describeBlockManifest(manifest: BlockManifest): string;
|
|
124
|
+
//# sourceMappingURL=block-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-type.d.ts","sourceRoot":"","sources":["../../../src/node/types/block-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAMrE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC1B,CAAA;AAEF,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE3D,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEtE,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,UAkBjD;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,aAAa,UA6B5D"}
|
|
@@ -12,7 +12,7 @@ export const BlockMetaSchema = z.object({
|
|
|
12
12
|
description: z.string().optional(),
|
|
13
13
|
category: z.string().default("common"),
|
|
14
14
|
icon: z.string().optional(),
|
|
15
|
-
keywords: z.array(z.string()).optional(),
|
|
15
|
+
keywords: z.union([z.string(), z.array(z.string())]).optional(),
|
|
16
16
|
types: z.array(z.string()),
|
|
17
17
|
templates: z.array(z.string()).nullable().optional(),
|
|
18
18
|
mode: z.enum(["preview", "edit", "both"]).default("preview"),
|
|
@@ -27,11 +27,14 @@ export const BlockMetaSchema = z.object({
|
|
|
27
27
|
allowMultiple: z.boolean().default(true),
|
|
28
28
|
postMetaBlock: z
|
|
29
29
|
.object({
|
|
30
|
+
postTypes: z.array(z.string()),
|
|
30
31
|
fieldName: z.string(),
|
|
31
32
|
})
|
|
32
33
|
.optional(),
|
|
33
34
|
frontendMode: z.enum(["hidden", "childrenOnly", "default"]).default("default"),
|
|
34
35
|
inserter: z.boolean().default(true),
|
|
36
|
+
blockStyles: z.array(z.object({ name: z.string(), label: z.string(), isDefault: z.boolean().optional() })).optional(),
|
|
37
|
+
lazyLoad: z.boolean().optional(),
|
|
35
38
|
});
|
|
36
39
|
export function describeBlock(block) {
|
|
37
40
|
let output = "";
|
|
@@ -9,23 +9,24 @@ export declare const ViewMetaSchema: z.ZodObject<{
|
|
|
9
9
|
routePattern: z.ZodOptional<z.ZodString>;
|
|
10
10
|
postType: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
cache: boolean;
|
|
13
|
-
fileName: string;
|
|
14
|
-
slug: string;
|
|
15
12
|
title: string;
|
|
13
|
+
slug: string;
|
|
14
|
+
fileName: string;
|
|
15
|
+
cache: boolean;
|
|
16
16
|
isCustomTemplate: boolean;
|
|
17
|
-
routePattern?: string | undefined;
|
|
18
17
|
postType?: string[] | undefined;
|
|
18
|
+
routePattern?: string | undefined;
|
|
19
19
|
}, {
|
|
20
|
-
fileName: string;
|
|
21
|
-
slug: string;
|
|
22
20
|
title: string;
|
|
21
|
+
slug: string;
|
|
22
|
+
fileName: string;
|
|
23
|
+
postType?: string[] | undefined;
|
|
23
24
|
cache?: boolean | undefined;
|
|
24
25
|
isCustomTemplate?: boolean | undefined;
|
|
25
26
|
routePattern?: string | undefined;
|
|
26
|
-
postType?: string[] | undefined;
|
|
27
27
|
}>;
|
|
28
28
|
export type ViewMetadata = z.infer<typeof ViewMetaSchema>;
|
|
29
29
|
export type ViewMetadataConstructor = z.input<typeof ViewMetaSchema>;
|
|
30
30
|
export declare function describeView(view: ViewMetadata): string;
|
|
31
31
|
export declare function describeViewManifest(manifest: ViewManifest): void;
|
|
32
|
+
//# sourceMappingURL=view-type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-type.d.ts","sourceRoot":"","sources":["../../../src/node/types/view-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAA;AAInE,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;EAQzB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAEzD,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAEpE,wBAAgB,YAAY,CAAC,IAAI,EAAE,YAAY,UAiB9C;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,YAAY,QAuB1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-wp.d.ts","sourceRoot":"","sources":["../../../src/node/utils/fetch-wp.ts"],"names":[],"mappings":"AASA,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAmB1F"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ProjectEnvUtils } from "../project/env.js";
|
|
2
|
+
import { Agent, fetch, setGlobalDispatcher, Headers } from "undici";
|
|
3
|
+
const agent = new Agent({
|
|
4
|
+
connect: {
|
|
5
|
+
rejectUnauthorized: false,
|
|
6
|
+
},
|
|
7
|
+
});
|
|
8
|
+
export async function fetchWP(url, args = {}) {
|
|
9
|
+
const headers = new Headers(args.headers);
|
|
10
|
+
// If an API key has been set in the environment, use it
|
|
11
|
+
const accessKey = ProjectEnvUtils.getSafe("SITE_API_KEY");
|
|
12
|
+
if (accessKey) {
|
|
13
|
+
headers.set("x-ed-api-key", accessKey);
|
|
14
|
+
}
|
|
15
|
+
// Allow self-signed certificates when using a local development domain
|
|
16
|
+
let allowSelfSigned = isDevelopmentDomain(url);
|
|
17
|
+
const response = (await fetch(url, {
|
|
18
|
+
...args,
|
|
19
|
+
dispatcher: allowSelfSigned ? agent : undefined,
|
|
20
|
+
headers,
|
|
21
|
+
}));
|
|
22
|
+
return response;
|
|
23
|
+
}
|
|
24
|
+
setGlobalDispatcher(agent);
|
|
25
|
+
function isDevelopmentDomain(url) {
|
|
26
|
+
const hostname = typeof url === "string" ? new URL(url).hostname : url.hostname;
|
|
27
|
+
return !!hostname?.match(/(^[0-9\.]+$|\.local$)/);
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-zod-error.d.ts","sourceRoot":"","sources":["../../../src/node/utils/format-zod-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,wBAAgB,cAAc,CAAC,KAAK,EAAE,QAAQ,UAmB7C;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,QAAQ,YAapD"}
|
|
@@ -15,14 +15,17 @@ export declare class FSCodegen {
|
|
|
15
15
|
project: Project;
|
|
16
16
|
opts: {
|
|
17
17
|
outDir: string;
|
|
18
|
+
onWritten?: (opts: Set<string>) => void;
|
|
18
19
|
};
|
|
19
20
|
outDir: string;
|
|
20
21
|
private generators;
|
|
21
22
|
private generatorFiles;
|
|
22
23
|
private unsubscribers;
|
|
24
|
+
private writtenContent;
|
|
23
25
|
private flushScheduled;
|
|
24
26
|
constructor(project: Project, opts: {
|
|
25
27
|
outDir: string;
|
|
28
|
+
onWritten?: (opts: Set<string>) => void;
|
|
26
29
|
});
|
|
27
30
|
register(generator: CodeGenerator): void;
|
|
28
31
|
registerFile({ name, generate, subscribe, }: {
|
|
@@ -38,3 +41,4 @@ export declare class FSCodegen {
|
|
|
38
41
|
stop(): void;
|
|
39
42
|
}
|
|
40
43
|
export {};
|
|
44
|
+
//# sourceMappingURL=fs-codegen.d.ts.map
|