eddev 2.0.0-beta.2 → 2.0.0-beta.21

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.
Files changed (204) hide show
  1. package/dist/app/entry/boot-admin.d.ts +1 -0
  2. package/dist/app/entry/{main.admin.js → boot-admin.js} +3 -5
  3. package/dist/app/entry/spa-root.d.ts +1 -0
  4. package/dist/app/entry/{Root.js → spa-root.js} +4 -4
  5. package/dist/app/entry/ssr-root-client.d.ts +4 -0
  6. package/dist/app/entry/ssr-root-client.js +9 -0
  7. package/dist/app/entry/ssr-root.d.ts +9 -0
  8. package/dist/app/entry/ssr-root.js +21 -0
  9. package/dist/app/lib/admin/index.d.ts +2 -2
  10. package/dist/app/lib/admin/index.js +2 -2
  11. package/dist/app/lib/admin/installFieldTypes.js +1 -1
  12. package/dist/app/lib/admin/runWidgets.js +1 -1
  13. package/dist/app/lib/blocks/ContentBlocks.js +4 -4
  14. package/dist/app/lib/blocks/EditableText.d.ts +1 -1
  15. package/dist/app/lib/blocks/EditableText.js +2 -2
  16. package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +1 -1
  17. package/dist/app/lib/blocks/InnerBlocks.d.ts +2 -2
  18. package/dist/app/lib/blocks/InnerBlocks.js +4 -4
  19. package/dist/app/lib/blocks/block-utils.d.ts +1 -1
  20. package/dist/app/lib/blocks/block-utils.js +1 -1
  21. package/dist/app/lib/blocks/editor/EditorSupport.js +3 -3
  22. package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +1 -1
  23. package/dist/app/lib/blocks/editor/editor-config.d.ts +1 -1
  24. package/dist/app/lib/blocks/editor/editor-config.js +1 -1
  25. package/dist/app/lib/blocks/editor/installGutenbergHooks.js +5 -5
  26. package/dist/app/lib/blocks/editor/usePostEditor.d.ts +1 -1
  27. package/dist/app/lib/blocks/index.d.ts +9 -9
  28. package/dist/app/lib/blocks/index.js +9 -9
  29. package/dist/app/lib/blocks/inline-editing.d.ts +1 -1
  30. package/dist/app/lib/blocks/inline-editing.js +3 -3
  31. package/dist/app/lib/devtools/components/BreakpointIndicator.js +5 -3
  32. package/dist/app/lib/devtools/components/DevUI.js +1 -1
  33. package/dist/app/lib/devtools/dev-tools-store.d.ts +9 -0
  34. package/dist/app/lib/devtools/dev-tools-store.js +8 -0
  35. package/dist/app/lib/devtools/hooks/useTailwind.d.ts +1078 -1079
  36. package/dist/app/lib/devtools/hooks/useTailwind.js +6 -3
  37. package/dist/app/lib/devtools/index.d.ts +1 -0
  38. package/dist/app/lib/devtools/index.js +1 -1
  39. package/dist/app/lib/devtools/loader.js +4 -4
  40. package/dist/app/lib/dynamic/index.d.ts +1 -1
  41. package/dist/app/lib/dynamic/index.js +1 -1
  42. package/dist/app/lib/hooks/index.d.ts +5 -5
  43. package/dist/app/lib/hooks/index.js +5 -5
  44. package/dist/app/lib/hooks/queryUtils.d.ts +4 -1
  45. package/dist/app/lib/hooks/queryUtils.js +10 -13
  46. package/dist/app/lib/hooks/useAppData.js +1 -1
  47. package/dist/app/lib/internal/index.d.ts +4 -4
  48. package/dist/app/lib/internal/index.js +4 -4
  49. package/dist/app/lib/internal/internal-store.d.ts +0 -2
  50. package/dist/app/lib/internal/internal-store.js +1 -3
  51. package/dist/app/lib/internal/read-admin-manifest.d.ts +1 -1
  52. package/dist/app/lib/legacy-stitches/createStitches.d.ts +3 -511
  53. package/dist/app/lib/legacy-stitches/createStitches.js +1 -1
  54. package/dist/app/lib/legacy-stitches/index.d.ts +1 -1
  55. package/dist/app/lib/legacy-stitches/index.js +1 -1
  56. package/dist/app/lib/routing/components/BrowserRouter.js +4 -4
  57. package/dist/app/lib/routing/components/ClientOnly.d.ts +1 -1
  58. package/dist/app/lib/routing/components/ClientOnly.js +1 -1
  59. package/dist/app/lib/routing/components/Link.js +5 -5
  60. package/dist/app/lib/routing/components/RouteRenderer.d.ts +1 -1
  61. package/dist/app/lib/routing/components/RouteRenderer.js +3 -3
  62. package/dist/app/lib/routing/components/SSRRouter.d.ts +2 -2
  63. package/dist/app/lib/routing/components/SSRRouter.js +4 -4
  64. package/dist/app/lib/routing/components/ScrollRestoration.js +1 -1
  65. package/dist/app/lib/routing/context.d.ts +2 -2
  66. package/dist/app/lib/routing/context.js +1 -1
  67. package/dist/app/lib/routing/hooks/useRestorableState.js +2 -1
  68. package/dist/app/lib/routing/hooks/useRoute.d.ts +1 -1
  69. package/dist/app/lib/routing/hooks/useRoute.js +1 -1
  70. package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +1 -1
  71. package/dist/app/lib/routing/hooks/useRouteTransition.js +1 -1
  72. package/dist/app/lib/routing/hooks/useRouter.d.ts +1 -1
  73. package/dist/app/lib/routing/hooks/useRouter.js +1 -1
  74. package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +1 -1
  75. package/dist/app/lib/routing/hooks/useRouterEvents.js +1 -1
  76. package/dist/app/lib/routing/hooks/useRouterState.d.ts +1 -1
  77. package/dist/app/lib/routing/hooks/useRouterState.js +1 -1
  78. package/dist/app/lib/routing/hooks/useSearchParams.js +2 -2
  79. package/dist/app/lib/routing/index.d.ts +13 -13
  80. package/dist/app/lib/routing/index.js +13 -13
  81. package/dist/app/lib/routing/loader.d.ts +2 -2
  82. package/dist/app/lib/routing/loader.js +7 -5
  83. package/dist/app/lib/routing/types.d.ts +2 -2
  84. package/dist/app/lib/routing/utils.d.ts +1 -1
  85. package/dist/app/lib/views/index.d.ts +1 -1
  86. package/dist/app/lib/views/index.js +1 -1
  87. package/dist/app/server/index.d.ts +3 -0
  88. package/dist/app/server/index.js +3 -0
  89. package/dist/app/server/proxy-wp-admin.d.ts +3 -0
  90. package/dist/app/server/proxy-wp-admin.js +105 -0
  91. package/dist/app/server/render-ssr-page.d.ts +3 -0
  92. package/dist/app/server/render-ssr-page.js +21 -0
  93. package/dist/app/server/server-context.d.ts +37 -0
  94. package/dist/app/server/server-context.js +118 -0
  95. package/dist/app/server/utils/headers.d.ts +1 -0
  96. package/dist/app/server/utils/headers.js +17 -0
  97. package/dist/app/server/utils/replace-host.d.ts +6 -4
  98. package/dist/app/server/utils/replace-host.js +58 -11
  99. package/dist/node/cli/cli-worker.d.ts +1 -1
  100. package/dist/node/cli/cli-worker.js +7 -2
  101. package/dist/node/cli/cli.js +83 -12
  102. package/dist/node/cli/display/CLIApp.d.ts +1 -1
  103. package/dist/node/cli/display/CLIApp.js +3 -6
  104. package/dist/node/cli/display/components/LogEntries.d.ts +1 -1
  105. package/dist/node/cli/display/hooks/useStatefulLog.d.ts +1 -1
  106. package/dist/node/cli/display/tools/CreateBlock.d.ts +1 -1
  107. package/dist/node/cli/display/tools/cli-tools.d.ts +1 -11
  108. package/dist/node/cli/display/tools/cli-tools.js +9 -9
  109. package/dist/node/cli/display/util/colors.d.ts +2 -2
  110. package/dist/node/cli/version.d.ts +1 -1
  111. package/dist/node/cli/version.js +1 -1
  112. package/dist/node/compiler/build-vinxi.d.ts +8 -0
  113. package/dist/node/compiler/build-vinxi.js +37 -0
  114. package/dist/node/compiler/bundler.admin.d.ts +2 -2
  115. package/dist/node/compiler/bundler.admin.js +3 -4
  116. package/dist/node/compiler/bundler.frontend.d.ts +1 -1
  117. package/dist/node/compiler/bundler.frontend.js +3 -4
  118. package/dist/node/compiler/{serverless.dev.d.ts → dev-server.d.ts} +7 -5
  119. package/dist/node/compiler/dev-server.js +97 -0
  120. package/dist/node/compiler/get-vite-config.d.ts +19 -0
  121. package/dist/node/compiler/get-vite-config.js +201 -0
  122. package/dist/node/compiler/vinxi-app.d.ts +10 -0
  123. package/dist/node/compiler/vinxi-app.js +121 -0
  124. package/dist/node/compiler/vinxi-codegen.d.ts +12 -0
  125. package/dist/node/compiler/vinxi-codegen.js +417 -0
  126. package/dist/node/graphql/graphql-codegen.d.ts +1 -1
  127. package/dist/node/graphql/graphql-codegen.js +3 -3
  128. package/dist/node/graphql/graphql-schema-loader.js +15 -18
  129. package/dist/node/project/config.js +1 -1
  130. package/dist/node/project/env.d.ts +1 -1
  131. package/dist/node/project/env.js +1 -1
  132. package/dist/node/project/favicons.d.ts +1 -0
  133. package/dist/node/project/favicons.js +1 -1
  134. package/dist/node/project/manifest/block-manifest.js +2 -2
  135. package/dist/node/project/manifest/manifest.d.ts +1 -1
  136. package/dist/node/project/manifest/manifest.js +1 -1
  137. package/dist/node/project/manifest/view-manifest.js +2 -2
  138. package/dist/node/project/project.d.ts +3 -2
  139. package/dist/node/project/project.js +17 -19
  140. package/dist/node/project/wp-info.js +0 -2
  141. package/dist/node/types/block-type.d.ts +2 -2
  142. package/dist/node/types/view-type.js +3 -4
  143. package/dist/node/utils/fs-codegen.d.ts +40 -0
  144. package/dist/node/utils/fs-codegen.js +97 -0
  145. package/dist/node/utils/fs.js +2 -0
  146. package/dist/node/utils/{selfSignedCert.js → self-signed-cert.js} +1 -1
  147. package/dist/node/utils/{statefulLog.js → stateful-log.js} +1 -1
  148. package/package.json +29 -31
  149. package/tsconfig.app.json +2 -2
  150. package/tsconfig.node.json +2 -2
  151. package/types.app.d.ts +2 -2
  152. package/types.app.internal.d.ts +2 -2
  153. package/types.node.d.ts +3 -3
  154. package/dist/app/entry/Root.d.ts +0 -1
  155. package/dist/app/entry/main.admin.d.ts +0 -3
  156. package/dist/app/entry/main.frontend.spa.d.ts +0 -3
  157. package/dist/app/entry/main.frontend.spa.js +0 -13
  158. package/dist/app/entry/main.frontend.ssr.d.ts +0 -21
  159. package/dist/app/entry/main.frontend.ssr.js +0 -79
  160. package/dist/app/entry/main.serverless.dev.d.ts +0 -4
  161. package/dist/app/entry/main.serverless.dev.js +0 -21
  162. package/dist/app/server/create-api-builtin-hono.d.ts +0 -8
  163. package/dist/app/server/create-api-builtin-hono.js +0 -80
  164. package/dist/app/server/create-ssr-hono.d.ts +0 -18
  165. package/dist/app/server/create-ssr-hono.js +0 -104
  166. package/dist/app/server/utils/index.html.d.ts +0 -2
  167. package/dist/app/server/utils/index.html.js +0 -14
  168. package/dist/node/compiler/index.html.d.ts +0 -2
  169. package/dist/node/compiler/index.html.js +0 -15
  170. package/dist/node/compiler/serverless.dev.js +0 -215
  171. package/dist/node/compiler/vite/get-vite-config.d.ts +0 -13
  172. package/dist/node/compiler/vite/get-vite-config.js +0 -315
  173. package/dist/node/compiler/vite/plugin-admin.d.ts +0 -4
  174. package/dist/node/compiler/vite/plugin-admin.js +0 -67
  175. package/dist/node/compiler/vite/plugin-blocks.d.ts +0 -4
  176. package/dist/node/compiler/vite/plugin-blocks.js +0 -73
  177. package/dist/node/compiler/vite/plugin-entry.d.ts +0 -6
  178. package/dist/node/compiler/vite/plugin-entry.js +0 -16
  179. package/dist/node/compiler/vite/plugin-resolved-tailwind.d.ts +0 -4
  180. package/dist/node/compiler/vite/plugin-resolved-tailwind.js +0 -29
  181. package/dist/node/compiler/vite/plugin-theme.d.ts +0 -4
  182. package/dist/node/compiler/vite/plugin-theme.js +0 -40
  183. package/dist/node/compiler/vite/plugin-views.d.ts +0 -4
  184. package/dist/node/compiler/vite/plugin-views.js +0 -51
  185. package/dist/node/utils/console.d.ts +0 -21
  186. package/dist/node/utils/console.js +0 -28
  187. package/dist/node/utils/unsafe-fetch.d.ts +0 -2
  188. package/dist/node/utils/unsafe-fetch.js +0 -19
  189. package/tsup.config.ts +0 -40
  190. package/types.manifests.d.ts +0 -22
  191. /package/dist/node/utils/{formatZodError.d.ts → format-zod-error.d.ts} +0 -0
  192. /package/dist/node/utils/{formatZodError.js → format-zod-error.js} +0 -0
  193. /package/dist/node/utils/{getRepoInfo.d.ts → get-repo-info.d.ts} +0 -0
  194. /package/dist/node/utils/{getRepoInfo.js → get-repo-info.js} +0 -0
  195. /package/dist/node/utils/{highlightCode.d.ts → highlight-code.d.ts} +0 -0
  196. /package/dist/node/utils/{highlightCode.js → highlight-code.js} +0 -0
  197. /package/dist/node/utils/{isDeploying.d.ts → is-deploying.d.ts} +0 -0
  198. /package/dist/node/utils/{isDeploying.js → is-deploying.js} +0 -0
  199. /package/dist/node/utils/{selfSignedCert.d.ts → self-signed-cert.d.ts} +0 -0
  200. /package/dist/node/utils/{statefulLog.d.ts → stateful-log.d.ts} +0 -0
  201. /package/dist/node/utils/{export-extractor.d.ts → ts-export-extractor.d.ts} +0 -0
  202. /package/dist/node/utils/{export-extractor.js → ts-export-extractor.js} +0 -0
  203. /package/dist/node/utils/{watchFileTree.d.ts → watch-file-tree.d.ts} +0 -0
  204. /package/dist/node/utils/{watchFileTree.js → watch-file-tree.js} +0 -0
@@ -1,6 +1,9 @@
1
- import "@manifest/tailwind";
2
1
  import { useSnapshot } from "valtio";
3
- import { internalStore } from "../../internal";
2
+ import { devToolsStore } from "../dev-tools-store.js";
3
+ import { useEffect } from "react";
4
4
  export function useTailwindConfig() {
5
- return useSnapshot(internalStore).tailwindConfig;
5
+ useEffect(() => {
6
+ devToolsStore.loadTailwindConfig();
7
+ }, []);
8
+ return useSnapshot(devToolsStore).tailwindConfig;
6
9
  }
@@ -0,0 +1 @@
1
+ export * from "./dev-tools-store.js";
@@ -1 +1 @@
1
- "use strict";
1
+ export * from "./dev-tools-store.js";
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useEffect } from "react";
3
- import { dynamic } from "../dynamic";
4
- import { usePersistState } from "./hooks/usePersistState";
5
- import { useIsSSR } from "../routing";
6
- const DevUI = dynamic(() => import("./components/DevUI"));
3
+ import { dynamic } from "../dynamic/dynamic.js";
4
+ import { usePersistState } from "./hooks/usePersistState.js";
5
+ import { useIsSSR } from "../routing/hooks/useIsSSR.js";
6
+ const DevUI = dynamic(() => import("./components/DevUI.js"));
7
7
  export function DevUILoader() {
8
8
  const ssr = useIsSSR();
9
9
  const [render, setRender] = usePersistState("enable_devui", typeof window !== "undefined" && (env.dev || window["ENABLE_DEV_UI"]));
@@ -1 +1 @@
1
- export { dynamic, DynamicComponent } from "./dynamic";
1
+ export { dynamic, DynamicComponent } from "./dynamic.js";
@@ -1 +1 @@
1
- export { dynamic } from "./dynamic";
1
+ export { dynamic } from "./dynamic.js";
@@ -1,5 +1,5 @@
1
- export * from "./usePageLoad";
2
- export * from "./useAppData";
3
- export * from "./useRPC";
4
- export * from "./queryUtils";
5
- export * from "./apiConfig";
1
+ export * from "./usePageLoad.js";
2
+ export * from "./useAppData.js";
3
+ export * from "./useRPC.js";
4
+ export * from "./queryUtils.js";
5
+ export * from "./apiConfig.js";
@@ -1,5 +1,5 @@
1
- export * from "./usePageLoad";
2
- export * from "./useAppData";
3
- export * from "./useRPC";
4
- export * from "./queryUtils";
5
- export * from "./apiConfig";
1
+ export * from "./usePageLoad.js";
2
+ export * from "./useAppData.js";
3
+ export * from "./useRPC.js";
4
+ export * from "./queryUtils.js";
5
+ export * from "./apiConfig.js";
@@ -33,7 +33,10 @@ export type UseInfiniteQueryFunction<TData, TVars> = (args: OptionalMaybes<Omit<
33
33
  headers?: Record<string, string>;
34
34
  /** Initial data can be passed in, but should match the original GraphQL query in structure (including nodes/hasNextPage/endCursor) */
35
35
  initialData?: any;
36
- }) => UseInfiniteQueryResult<TData, QueryError>;
36
+ }) => UseInfiniteQueryResult<{
37
+ nodes: TData;
38
+ total?: number | null;
39
+ }, QueryError>;
37
40
  export declare function createUseInfiniteQuery<TData extends any, TVars extends MaybeVars>(init: CreateUseInfiniteQueryOptions): UseInfiniteQueryFunction<TData, TVars>;
38
41
  export type UseMutationFunction<TData, TArgs> = ((options?: Omit<UseMutationOptions<TData, QueryError, TArgs>, "mutationFn"> & {
39
42
  headers?: Record<string, string>;
@@ -1,7 +1,7 @@
1
1
  import { useMutation, useQuery, useInfiniteQuery, } from "@tanstack/react-query";
2
2
  import { joinURL } from "ufo";
3
- import { getQueryClient } from "../../utils/query-client";
4
- import { useAPIConfig } from "./apiConfig";
3
+ import { getQueryClient } from "../../utils/query-client.js";
4
+ import { useAPIConfig } from "./apiConfig.js";
5
5
  import { useEffect, useState } from "react";
6
6
  function createQueryError(messages, statusCode) {
7
7
  const error = new Error(messages.join(", "));
@@ -15,7 +15,7 @@ const fetchGETQuery = async (name, params, opts) => {
15
15
  headers: opts?.headers,
16
16
  };
17
17
  if (env.serverless && env.client) {
18
- url = `/api/rest/query/${name}`;
18
+ url = `/_data/query/${name}`;
19
19
  }
20
20
  else if (env.serverless) {
21
21
  url = joinURL(env.origin ?? "", `/wp-json/ed/v1/query/${name}`);
@@ -60,14 +60,6 @@ export function createUseQuery(init) {
60
60
  };
61
61
  return hook;
62
62
  }
63
- // & {
64
- // fetch: (
65
- // args: OptionalMaybes<TVars>,
66
- // options?: Omit<FetchInfiniteQueryOptions<TData, QueryError, InfiniteData<TData, string>>, "queryKey" | "queryFn"> & {
67
- // headers?: Record<string, string>
68
- // },
69
- // ) => Promise<TData>
70
- // }
71
63
  function selectByPath(data, path) {
72
64
  return path.reduce((acc, key) => (acc ? acc[key] : null), data);
73
65
  }
@@ -109,10 +101,12 @@ export function createUseInfiniteQuery(init) {
109
101
  const endCursor = selectByPath(data, init.paths.endCursorPath);
110
102
  const hasNextPage = selectByPath(data, init.paths.hasNextPagePath);
111
103
  const nodes = selectByPath(data, init.paths.nodesPath);
104
+ const total = selectByPath(data, [...init.paths.pageInfoPath, "total"]);
112
105
  return {
113
106
  nodes,
114
107
  hasNextPage,
115
108
  endCursor,
109
+ total,
116
110
  };
117
111
  },
118
112
  initialPageParam: "",
@@ -121,7 +115,10 @@ export function createUseInfiniteQuery(init) {
121
115
  return lastPage.hasNextPage ? lastPage.endCursor : undefined;
122
116
  },
123
117
  select(data) {
124
- return data.pages.flatMap((page) => page.nodes);
118
+ return {
119
+ nodes: data.pages.flatMap((page) => page.nodes),
120
+ total: data.pages[data.pages.length - 1]?.total,
121
+ };
125
122
  },
126
123
  ...options,
127
124
  ...initial,
@@ -142,7 +139,7 @@ const fetchMutation = async (name, params, opts) => {
142
139
  };
143
140
  if (env.serverless && env.client) {
144
141
  // Relative request (in browser)
145
- url = `/api/rest/mutation/${name}`;
142
+ url = `/_data/mutation/${name}`;
146
143
  }
147
144
  else if (env.serverless) {
148
145
  // Request to the origin server (server to server)
@@ -1,4 +1,4 @@
1
- import { useRouter } from "../routing";
1
+ import { useRouter } from "../routing/index.js";
2
2
  function useAppData(selector) {
3
3
  const loader = useRouter((r) => r.loader);
4
4
  if (selector) {
@@ -1,4 +1,4 @@
1
- export * from "./read-block-manifest";
2
- export * from "./read-view-manifest";
3
- export * from "./read-admin-manifest";
4
- export * from "./internal-store";
1
+ export * from "./read-block-manifest.js";
2
+ export * from "./read-view-manifest.js";
3
+ export * from "./read-admin-manifest.js";
4
+ export * from "./internal-store.js";
@@ -1,4 +1,4 @@
1
- export * from "./read-block-manifest";
2
- export * from "./read-view-manifest";
3
- export * from "./read-admin-manifest";
4
- export * from "./internal-store";
1
+ export * from "./read-block-manifest.js";
2
+ export * from "./read-view-manifest.js";
3
+ export * from "./read-admin-manifest.js";
4
+ export * from "./internal-store.js";
@@ -1,9 +1,7 @@
1
1
  import { FunctionComponent } from "react";
2
- import { Config as TailwindConfig } from "tailwindcss";
3
2
  type BlockManifest = Record<string, FunctionComponent<any>>;
4
3
  type Store = {
5
4
  blocks: BlockManifest;
6
- tailwindConfig: TailwindConfig | null;
7
5
  };
8
6
  export declare const internalStore: Store & {
9
7
  set<K extends keyof Store>(key: K, value: Store[K]): void;
@@ -1,9 +1,7 @@
1
1
  import { proxy, ref } from "valtio";
2
2
  export const internalStore = proxy({
3
3
  blocks: {},
4
- tailwindConfig: null,
5
4
  set(key, value) {
6
- ;
7
- internalStore[key] = value ? ref(value) : value;
5
+ internalStore[key] = (value ? ref(value) : value);
8
6
  },
9
7
  });
@@ -1,5 +1,5 @@
1
1
  import type { FunctionComponent } from "react";
2
- import { FieldTypeDefinition } from "../admin";
2
+ import { FieldTypeDefinition } from "../admin/index.js";
3
3
  /**
4
4
  * This file exists simply to prevent circular dependencies.
5
5
  * The manifest itself sets the value of this object directly.