eddev 2.0.0-beta.1 → 2.0.0-beta.100

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 (277) hide show
  1. package/dist/app/entry/HydrationOverlay.d.ts +1 -0
  2. package/dist/app/entry/HydrationOverlay.js +2 -0
  3. package/dist/app/entry/MetaTags.d.ts +7 -0
  4. package/dist/app/entry/MetaTags.js +17 -0
  5. package/dist/app/entry/boot-admin.d.ts +1 -0
  6. package/dist/app/entry/boot-admin.js +13 -0
  7. package/dist/app/entry/hydration-script.d.ts +1 -0
  8. package/dist/app/entry/hydration-script.js +18 -0
  9. package/dist/app/entry/spa-root.d.ts +1 -0
  10. package/dist/app/entry/spa-root.js +8 -0
  11. package/dist/app/entry/ssr-root-client.d.ts +6 -0
  12. package/dist/app/entry/ssr-root-client.js +20 -0
  13. package/dist/app/entry/ssr-root.d.ts +8 -0
  14. package/dist/app/entry/ssr-root.js +22 -0
  15. package/dist/app/lib/admin/index.d.ts +2 -2
  16. package/dist/app/lib/admin/index.js +2 -2
  17. package/dist/app/lib/admin/installFieldTypes.js +1 -1
  18. package/dist/app/lib/admin/runWidgets.js +1 -1
  19. package/dist/app/lib/blocks/ContentBlocks.d.ts +1 -1
  20. package/dist/app/lib/blocks/ContentBlocks.js +5 -5
  21. package/dist/app/lib/blocks/EditableText.d.ts +1 -1
  22. package/dist/app/lib/blocks/EditableText.js +3 -3
  23. package/dist/app/lib/blocks/InnerBlocks.d.ts +13 -3
  24. package/dist/app/lib/blocks/InnerBlocks.js +13 -5
  25. package/dist/app/lib/blocks/block-utils.d.ts +2 -2
  26. package/dist/app/lib/blocks/block-utils.js +2 -2
  27. package/dist/app/lib/blocks/editor/EditorHighlights.d.ts +7 -0
  28. package/dist/app/lib/blocks/editor/EditorHighlights.js +130 -0
  29. package/dist/app/lib/blocks/editor/EditorSupport.js +4 -5
  30. package/dist/app/lib/blocks/editor/editor-config.d.ts +17 -4
  31. package/dist/app/lib/blocks/editor/editor-config.js +21 -9
  32. package/dist/app/lib/blocks/editor/installGutenbergHooks.js +20 -14
  33. package/dist/app/lib/blocks/editor/root-blocks.d.ts +6 -0
  34. package/dist/app/lib/blocks/editor/root-blocks.js +30 -0
  35. package/dist/app/lib/blocks/editor/usePostEditor.d.ts +1 -1
  36. package/dist/app/lib/blocks/index.d.ts +9 -9
  37. package/dist/app/lib/blocks/index.js +9 -9
  38. package/dist/app/lib/blocks/inline-editing.d.ts +1 -1
  39. package/dist/app/lib/blocks/inline-editing.js +7 -5
  40. package/dist/app/lib/devtools/components/BreakpointIndicator.js +6 -4
  41. package/dist/app/lib/devtools/components/DevUI.js +4 -3
  42. package/dist/app/lib/devtools/components/GridIndicator.d.ts +1 -0
  43. package/dist/app/lib/devtools/components/GridIndicator.js +29 -0
  44. package/dist/app/lib/devtools/dev-tools-store.d.ts +9 -0
  45. package/dist/app/lib/devtools/dev-tools-store.js +8 -0
  46. package/dist/app/lib/devtools/hooks/usePersistState.d.ts +1 -1
  47. package/dist/app/lib/devtools/hooks/usePersistState.js +11 -2
  48. package/dist/app/lib/devtools/hooks/useTailwind.d.ts +1102 -1103
  49. package/dist/app/lib/devtools/hooks/useTailwind.js +6 -3
  50. package/dist/app/lib/devtools/index.d.ts +1 -0
  51. package/dist/app/lib/devtools/index.js +1 -1
  52. package/dist/app/lib/devtools/loader.js +8 -7
  53. package/dist/app/lib/devtools/useQueryDebug.d.ts +7 -1
  54. package/dist/app/lib/devtools/useQueryDebug.js +5 -8
  55. package/dist/app/lib/dynamic/dynamic.d.ts +1 -1
  56. package/dist/app/lib/dynamic/dynamic.js +5 -1
  57. package/dist/app/lib/dynamic/index.d.ts +1 -1
  58. package/dist/app/lib/dynamic/index.js +1 -1
  59. package/dist/app/lib/hooks/index.d.ts +4 -5
  60. package/dist/app/lib/hooks/index.js +4 -5
  61. package/dist/app/lib/hooks/queryUtils.d.ts +41 -4
  62. package/dist/app/lib/hooks/queryUtils.js +74 -37
  63. package/dist/app/lib/hooks/useAppData.js +1 -1
  64. package/dist/app/lib/hooks/useRPC.d.ts +0 -4
  65. package/dist/app/lib/hooks/useRPC.js +1 -8
  66. package/dist/app/lib/internal/finalize-rpc.d.ts +17 -0
  67. package/dist/app/lib/internal/finalize-rpc.js +3 -0
  68. package/dist/app/lib/internal/index.d.ts +5 -4
  69. package/dist/app/lib/internal/index.js +5 -4
  70. package/dist/app/lib/internal/internal-store.d.ts +0 -2
  71. package/dist/app/lib/internal/internal-store.js +1 -3
  72. package/dist/app/lib/internal/read-admin-manifest.d.ts +1 -1
  73. package/dist/app/lib/legacy-stitches/createStitches.d.ts +21 -21
  74. package/dist/app/lib/legacy-stitches/createStitches.js +1 -1
  75. package/dist/app/lib/legacy-stitches/index.d.ts +1 -1
  76. package/dist/app/lib/legacy-stitches/index.js +1 -1
  77. package/dist/app/lib/routing/components/BackButton.d.ts +49 -0
  78. package/dist/app/lib/routing/components/BackButton.js +47 -0
  79. package/dist/app/lib/routing/components/BrowserRouter.d.ts +4 -1
  80. package/dist/app/lib/routing/components/BrowserRouter.js +95 -19
  81. package/dist/app/lib/routing/components/ClientOnly.js +1 -1
  82. package/dist/app/lib/routing/components/Link.d.ts +1 -0
  83. package/dist/app/lib/routing/components/Link.js +11 -12
  84. package/dist/app/lib/routing/components/RouteRenderer.d.ts +1 -1
  85. package/dist/app/lib/routing/components/RouteRenderer.js +7 -6
  86. package/dist/app/lib/routing/components/SSRRouter.d.ts +2 -2
  87. package/dist/app/lib/routing/components/SSRRouter.js +5 -6
  88. package/dist/app/lib/routing/components/ScrollRestoration.js +5 -2
  89. package/dist/app/lib/routing/context.d.ts +8 -5
  90. package/dist/app/lib/routing/context.js +13 -96
  91. package/dist/app/lib/routing/hooks/useRestorableState.d.ts +2 -1
  92. package/dist/app/lib/routing/hooks/useRestorableState.js +2 -1
  93. package/dist/app/lib/routing/hooks/useRoute.d.ts +16 -1
  94. package/dist/app/lib/routing/hooks/useRoute.js +22 -1
  95. package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +5 -0
  96. package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
  97. package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +1 -1
  98. package/dist/app/lib/routing/hooks/useRouteTransition.js +1 -1
  99. package/dist/app/lib/routing/hooks/useRouter.d.ts +1 -1
  100. package/dist/app/lib/routing/hooks/useRouter.js +1 -1
  101. package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +1 -1
  102. package/dist/app/lib/routing/hooks/useRouterEvents.js +1 -1
  103. package/dist/app/lib/routing/hooks/useRouterState.d.ts +1 -1
  104. package/dist/app/lib/routing/hooks/useRouterState.js +1 -1
  105. package/dist/app/lib/routing/hooks/useSearchParams.js +2 -2
  106. package/dist/app/lib/routing/index.d.ts +14 -13
  107. package/dist/app/lib/routing/index.js +14 -13
  108. package/dist/app/lib/routing/loader.d.ts +2 -2
  109. package/dist/app/lib/routing/loader.js +26 -15
  110. package/dist/app/lib/routing/types.d.ts +36 -10
  111. package/dist/app/lib/routing/utils.d.ts +5 -2
  112. package/dist/app/lib/routing/utils.js +37 -4
  113. package/dist/app/lib/{hooks → runtime}/apiConfig.d.ts +6 -2
  114. package/dist/app/lib/runtime/apiConfig.js +6 -0
  115. package/dist/app/lib/runtime/errorHandling.d.ts +39 -0
  116. package/dist/app/lib/runtime/errorHandling.js +6 -0
  117. package/dist/app/lib/runtime/index.d.ts +2 -0
  118. package/dist/app/lib/runtime/index.js +2 -0
  119. package/dist/app/lib/views/index.d.ts +1 -1
  120. package/dist/app/lib/views/index.js +1 -1
  121. package/dist/app/server/defineRouter.d.ts +2 -0
  122. package/dist/app/server/defineRouter.js +4 -0
  123. package/dist/app/server/index.d.ts +5 -0
  124. package/dist/app/server/index.js +5 -0
  125. package/dist/app/server/proxy-wp-admin.d.ts +2 -0
  126. package/dist/app/server/proxy-wp-admin.js +124 -0
  127. package/dist/app/server/render-ssr-page.d.ts +21 -0
  128. package/dist/app/server/render-ssr-page.js +166 -0
  129. package/dist/app/server/rpc.d.ts +56 -0
  130. package/dist/app/server/rpc.js +18 -0
  131. package/dist/app/server/server-context.d.ts +72 -0
  132. package/dist/app/server/server-context.js +283 -0
  133. package/dist/app/server/utils/headers.d.ts +1 -0
  134. package/dist/app/server/utils/headers.js +17 -0
  135. package/dist/app/server/utils/replace-host.d.ts +6 -4
  136. package/dist/app/server/utils/replace-host.js +66 -11
  137. package/dist/app/server/utils/swr-cache.d.ts +4 -0
  138. package/dist/app/server/utils/swr-cache.js +31 -0
  139. package/dist/app/utils/APIProvider.d.ts +2 -0
  140. package/dist/app/utils/APIProvider.js +5 -0
  141. package/dist/app/utils/BlockErrorBoundary.d.ts +19 -0
  142. package/dist/app/utils/BlockErrorBoundary.js +38 -0
  143. package/dist/app/utils/ErrorMessage.d.ts +5 -0
  144. package/dist/app/utils/ErrorMessage.js +14 -0
  145. package/dist/app/utils/RouteErrorBoundary.d.ts +18 -0
  146. package/dist/app/utils/RouteErrorBoundary.js +38 -0
  147. package/dist/app/utils/asset-capture.d.ts +2 -0
  148. package/dist/app/utils/asset-capture.js +5 -0
  149. package/dist/app/utils/hydration-debugger.d.ts +13 -0
  150. package/dist/app/utils/hydration-debugger.js +11 -0
  151. package/dist/app/utils/query-client.d.ts +2 -0
  152. package/dist/app/utils/query-client.js +5 -1
  153. package/dist/app/utils/trpc-client.d.ts +2 -0
  154. package/dist/app/utils/trpc-client.js +39 -0
  155. package/dist/node/cli/cli-worker.d.ts +1 -1
  156. package/dist/node/cli/cli-worker.js +11 -3
  157. package/dist/node/cli/cli.js +112 -13
  158. package/dist/node/cli/display/CLIApp.d.ts +1 -1
  159. package/dist/node/cli/display/CLIApp.js +4 -7
  160. package/dist/node/cli/display/boot-cli-app.js +1 -1
  161. package/dist/node/cli/display/components/LogEntries.d.ts +1 -1
  162. package/dist/node/cli/display/hooks/useStatefulLog.d.ts +1 -1
  163. package/dist/node/cli/display/tools/CreateBlock.d.ts +1 -1
  164. package/dist/node/cli/display/tools/cli-tools.d.ts +1 -11
  165. package/dist/node/cli/display/tools/cli-tools.js +9 -9
  166. package/dist/node/cli/display/util/colors.d.ts +2 -2
  167. package/dist/node/cli/version.d.ts +1 -1
  168. package/dist/node/cli/version.js +1 -1
  169. package/dist/node/compiler/build-vinxi.d.ts +8 -0
  170. package/dist/node/compiler/build-vinxi.js +38 -0
  171. package/dist/node/compiler/bundler.admin.d.ts +2 -2
  172. package/dist/node/compiler/bundler.admin.js +4 -4
  173. package/dist/node/compiler/bundler.frontend.d.ts +1 -1
  174. package/dist/node/compiler/bundler.frontend.js +4 -4
  175. package/dist/node/compiler/{serverless.dev.d.ts → dev-server.d.ts} +7 -5
  176. package/dist/node/compiler/dev-server.js +107 -0
  177. package/dist/node/compiler/get-vite-config.d.ts +20 -0
  178. package/dist/node/compiler/get-vite-config.js +207 -0
  179. package/dist/node/compiler/vinxi-app.d.ts +22 -0
  180. package/dist/node/compiler/vinxi-app.js +228 -0
  181. package/dist/node/compiler/vinxi-codegen.d.ts +12 -0
  182. package/dist/node/compiler/vinxi-codegen.js +638 -0
  183. package/dist/node/graphql/graphql-codegen.d.ts +12 -2
  184. package/dist/node/graphql/graphql-codegen.js +213 -36
  185. package/dist/node/graphql/graphql-schema-loader.d.ts +2 -1
  186. package/dist/node/graphql/graphql-schema-loader.js +5 -19
  187. package/dist/node/graphql/plugins/gql-plugin-queries.js +1 -1
  188. package/dist/node/graphql/query-files-loader.d.ts +3 -0
  189. package/dist/node/graphql/query-files-loader.js +5 -0
  190. package/dist/node/project/config.d.ts +159 -73
  191. package/dist/node/project/config.js +70 -21
  192. package/dist/node/project/env.d.ts +5 -1
  193. package/dist/node/project/env.js +2 -1
  194. package/dist/node/project/manifest/block-manifest.js +3 -2
  195. package/dist/node/project/manifest/manifest.d.ts +2 -1
  196. package/dist/node/project/manifest/manifest.js +15 -11
  197. package/dist/node/project/manifest/routes-manifest.d.ts +20 -0
  198. package/dist/node/project/manifest/routes-manifest.js +74 -0
  199. package/dist/node/project/manifest/view-manifest.js +2 -2
  200. package/dist/node/project/project.d.ts +11 -2
  201. package/dist/node/project/project.js +49 -20
  202. package/dist/node/project/wp-info.d.ts +1 -0
  203. package/dist/node/project/wp-info.js +13 -3
  204. package/dist/node/types/block-type.d.ts +25 -20
  205. package/dist/node/types/block-type.js +1 -0
  206. package/dist/node/types/view-type.d.ts +7 -7
  207. package/dist/node/types/view-type.js +3 -4
  208. package/dist/node/utils/fetch-wp.d.ts +1 -0
  209. package/dist/node/utils/fetch-wp.js +27 -0
  210. package/dist/node/utils/fs-codegen.d.ts +42 -0
  211. package/dist/node/utils/fs-codegen.js +98 -0
  212. package/dist/node/utils/fs.js +2 -0
  213. package/dist/node/utils/{isDeploying.js → is-deploying.js} +1 -1
  214. package/dist/node/utils/{selfSignedCert.js → self-signed-cert.js} +1 -1
  215. package/dist/node/utils/{statefulLog.js → stateful-log.js} +3 -1
  216. package/dist/node/utils/watch-file-tree.d.ts +25 -0
  217. package/dist/node/utils/{watchFileTree.js → watch-file-tree.js} +12 -5
  218. package/package.json +40 -38
  219. package/types.app.d.ts +4 -2
  220. package/types.app.internal.d.ts +2 -2
  221. package/types.node.d.ts +3 -3
  222. package/dist/app/entry/Root.d.ts +0 -1
  223. package/dist/app/entry/Root.js +0 -9
  224. package/dist/app/entry/main.admin.d.ts +0 -3
  225. package/dist/app/entry/main.admin.js +0 -10
  226. package/dist/app/entry/main.frontend.spa.d.ts +0 -3
  227. package/dist/app/entry/main.frontend.spa.js +0 -13
  228. package/dist/app/entry/main.frontend.ssr.d.ts +0 -21
  229. package/dist/app/entry/main.frontend.ssr.js +0 -79
  230. package/dist/app/entry/main.serverless.dev.d.ts +0 -4
  231. package/dist/app/entry/main.serverless.dev.js +0 -21
  232. package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +0 -15
  233. package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +0 -35
  234. package/dist/app/lib/hooks/apiConfig.js +0 -4
  235. package/dist/app/lib/hooks/usePageLoad.d.ts +0 -6
  236. package/dist/app/lib/hooks/usePageLoad.js +0 -5
  237. package/dist/app/server/create-api-builtin-hono.d.ts +0 -8
  238. package/dist/app/server/create-api-builtin-hono.js +0 -80
  239. package/dist/app/server/create-ssr-hono.d.ts +0 -18
  240. package/dist/app/server/create-ssr-hono.js +0 -104
  241. package/dist/app/server/utils/index.html.d.ts +0 -2
  242. package/dist/app/server/utils/index.html.js +0 -14
  243. package/dist/node/compiler/index.html.d.ts +0 -2
  244. package/dist/node/compiler/index.html.js +0 -15
  245. package/dist/node/compiler/serverless.dev.js +0 -215
  246. package/dist/node/compiler/vite/get-vite-config.d.ts +0 -13
  247. package/dist/node/compiler/vite/get-vite-config.js +0 -315
  248. package/dist/node/compiler/vite/plugin-admin.d.ts +0 -4
  249. package/dist/node/compiler/vite/plugin-admin.js +0 -67
  250. package/dist/node/compiler/vite/plugin-blocks.d.ts +0 -4
  251. package/dist/node/compiler/vite/plugin-blocks.js +0 -73
  252. package/dist/node/compiler/vite/plugin-entry.d.ts +0 -6
  253. package/dist/node/compiler/vite/plugin-entry.js +0 -16
  254. package/dist/node/compiler/vite/plugin-resolved-tailwind.d.ts +0 -4
  255. package/dist/node/compiler/vite/plugin-resolved-tailwind.js +0 -29
  256. package/dist/node/compiler/vite/plugin-theme.d.ts +0 -4
  257. package/dist/node/compiler/vite/plugin-theme.js +0 -40
  258. package/dist/node/compiler/vite/plugin-views.d.ts +0 -4
  259. package/dist/node/compiler/vite/plugin-views.js +0 -51
  260. package/dist/node/utils/console.d.ts +0 -21
  261. package/dist/node/utils/console.js +0 -28
  262. package/dist/node/utils/unsafe-fetch.d.ts +0 -2
  263. package/dist/node/utils/unsafe-fetch.js +0 -19
  264. package/dist/node/utils/watchFileTree.d.ts +0 -11
  265. package/tsup.config.ts +0 -40
  266. package/types.manifests.d.ts +0 -22
  267. /package/dist/node/utils/{formatZodError.d.ts → format-zod-error.d.ts} +0 -0
  268. /package/dist/node/utils/{formatZodError.js → format-zod-error.js} +0 -0
  269. /package/dist/node/utils/{getRepoInfo.d.ts → get-repo-info.d.ts} +0 -0
  270. /package/dist/node/utils/{getRepoInfo.js → get-repo-info.js} +0 -0
  271. /package/dist/node/utils/{highlightCode.d.ts → highlight-code.d.ts} +0 -0
  272. /package/dist/node/utils/{highlightCode.js → highlight-code.js} +0 -0
  273. /package/dist/node/utils/{isDeploying.d.ts → is-deploying.d.ts} +0 -0
  274. /package/dist/node/utils/{selfSignedCert.d.ts → self-signed-cert.d.ts} +0 -0
  275. /package/dist/node/utils/{statefulLog.d.ts → stateful-log.d.ts} +0 -0
  276. /package/dist/node/utils/{export-extractor.d.ts → ts-export-extractor.d.ts} +0 -0
  277. /package/dist/node/utils/{export-extractor.js → ts-export-extractor.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.1",
3
+ "version": "2.0.0-beta.100",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -34,23 +34,38 @@
34
34
  "types": "./dist/app/lib/dynamic/index.d.ts",
35
35
  "import": "./dist/app/lib/dynamic/index.js"
36
36
  },
37
- "./types.app.public": {
38
- "types": "./types.app.d.ts"
37
+ "./devtools": {
38
+ "types": "./dist/app/lib/devtools/index.d.ts",
39
+ "import": "./dist/app/lib/devtools/index.js"
40
+ },
41
+ "./runtime": {
42
+ "types": "./dist/app/lib/runtime/index.d.ts",
43
+ "import": "./dist/app/lib/runtime/index.js"
44
+ },
45
+ "./server": {
46
+ "types": "./dist/app/server/index.d.ts",
47
+ "import": "./dist/app/server/index.js"
39
48
  },
40
- "./_internal/_entry/main.frontend.spa.js": {
41
- "import": "./dist/app/entry/main.frontend.spa.js"
49
+ "./_internal/boot-admin.js": {
50
+ "import": "./dist/app/entry/boot-admin.js"
42
51
  },
43
- "./_internal/_entry/main.admin.js": {
44
- "import": "./dist/app/entry/main.admin.js"
52
+ "./_internal/spa-root.js": {
53
+ "import": "./dist/app/entry/spa-root.js"
45
54
  },
46
- "./_internal/_entry/main.frontend.ssr.js": {
47
- "import": "./dist/app/entry/main.frontend.ssr.js"
55
+ "./_internal/ssr-root-client.js": {
56
+ "import": "./dist/app/entry/ssr-root-client.js"
48
57
  },
49
- "./_internal/_entry/main.serverless.dev.js": {
50
- "import": "./dist/app/entry/main.serverless.dev.js"
58
+ "./_internal/ssr-root.js": {
59
+ "import": "./dist/app/entry/ssr-root.js"
60
+ },
61
+ "./_internal/create-vinxi-app.js": {
62
+ "import": "./dist/node/compiler/vinxi-app.js"
51
63
  },
52
64
  "./_internal": {
53
65
  "import": "./dist/app/lib/internal/index.js"
66
+ },
67
+ "./types.app.public": {
68
+ "types": "./types.app.d.ts"
54
69
  }
55
70
  },
56
71
  "scripts": {
@@ -61,69 +76,56 @@
61
76
  "license": "ISC",
62
77
  "dependencies": {
63
78
  "@babel/types": "^7.25.2",
64
- "@clack/prompts": "^0.7.0",
79
+ "@epic-web/cachified": "^5.2.0",
65
80
  "@graphql-codegen/core": "^4.0.0",
66
81
  "@graphql-codegen/typescript": "^4.0.1",
67
82
  "@graphql-codegen/typescript-operations": "^4.0.1",
68
83
  "@graphql-tools/load": "^8.0.0",
69
84
  "@graphql-tools/url-loader": "^8.0.0",
70
- "@hono/node-server": "^1.7.0",
71
- "@inquirer/prompts": "^5.0.6",
72
85
  "@nozbe/microfuzz": "^1.0.0",
73
86
  "@rollup/plugin-replace": "^5.0.5",
74
87
  "@tanstack/react-query": "^5.51.23",
88
+ "@trpc/client": "^11.0.0-rc.608",
89
+ "@trpc/server": "^11.0.0-rc.608",
75
90
  "@types/qs": "^6.9.15",
76
- "@types/wordpress__blocks": "^12.5.13",
77
- "@types/wordpress__components": "^23.0.11",
78
- "@types/wordpress__editor": "^13.6.7",
79
- "@types/wordpress__hooks": "^2.11.0",
91
+ "@vinxi/react": "^0.2.5",
80
92
  "@vitejs/plugin-react": "^4.1.1",
81
93
  "chalk": "^5.3.0",
82
94
  "change-case-all": "^2.1.0",
83
95
  "chokidar": "^3.5.3",
84
96
  "commander": "^11.1.0",
85
- "concurrently": "^8.2.2",
86
- "consola": "^3.2.3",
87
97
  "csstype": "^3.1.3",
88
98
  "dotenv": "^16.3.1",
89
- "express": "^4.18.2",
90
- "express-http-proxy": "^2.0.0",
91
- "fastest-levenshtein": "^1.0.16",
92
99
  "globby": "^13.2.2",
93
100
  "graphql": "^16.8.1",
94
- "hono": "^3.12.11",
101
+ "hono": "^4.6.2",
95
102
  "ink": "^5.0.1",
96
- "ink-quicksearch-input": "^1.0.0",
97
103
  "ink-spinner": "^5.0.0",
98
- "ink-text-input": "^6.0.0",
99
- "listhen": "^1.6.0",
104
+ "lru-cache": "10.4.1",
100
105
  "mkcert": "^3.2.0",
101
- "mnemonist": "^0.39.8",
102
- "node-fetch": "^3.3.2",
103
106
  "obj-console": "^1.0.2",
104
107
  "object-code": "^1.3.3",
105
108
  "qs": "^6.13.0",
106
- "react-error-boundary": "^4.0.11",
107
- "rollup-plugin-external-globals": "^0.9.2",
109
+ "superjson": "^2.2.1",
108
110
  "ts-poet": "^6.6.0",
109
- "tsup": "^7.2.0",
110
111
  "ufo": "^1.3.1",
111
112
  "undent": "^0.1.0",
112
- "use-zustand": "^0.2.0",
113
+ "undici": "^6.21.0",
113
114
  "valtio": "^1.13.2",
114
- "vite": "^5.3.1",
115
+ "vinxi": "^0.4.3",
115
116
  "vite-tsconfig-paths": "^4.2.1",
116
117
  "zod": "^3.22.4",
117
118
  "zod-to-json-schema": "^3.21.4",
118
- "zod-validation-error": "^2.1.0",
119
- "zustand": "^4.5.5"
119
+ "zod-validation-error": "^2.1.0"
120
120
  },
121
121
  "devDependencies": {
122
- "@types/express": "^4.17.21",
123
- "@types/express-http-proxy": "^1.6.6",
124
122
  "@types/node": "^20.9.0",
125
123
  "@types/react": "^18.3.3",
126
124
  "@types/react-dom": "^18.3.0",
125
+ "@types/wordpress__blocks": "^12.5.13",
126
+ "@types/wordpress__components": "^23.0.11",
127
+ "@types/wordpress__editor": "^13.6.7",
128
+ "@types/wordpress__hooks": "^2.11.0",
127
129
  "typescript": "^5.5.2"
128
130
  },
129
131
  "peerDependencies": {
package/types.app.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="vite/client" />
2
- /// <reference types="./types.meta" />
3
- /// <reference types="./types.env" />
2
+ /// <reference types="./types.meta.d.ts" />
3
+ /// <reference types="./types.env.d.ts" />
4
+ import { Router } from "@trpc/server"
4
5
 
5
6
  declare global {
6
7
  interface ViewProps {}
@@ -13,6 +14,7 @@ declare global {
13
14
  interface PostMetaTypes {}
14
15
 
15
16
  interface RPCRouter {}
17
+ interface RPCContext {}
16
18
 
17
19
  type AppData = ViewProps["_app"]
18
20
 
@@ -1,5 +1,5 @@
1
- /// <reference types="./types.manifests" />
2
- /// <reference types="./types.app" />
1
+ /// <reference types="./types.manifests.d.ts" />
2
+ /// <reference types="./types.app.d.ts" />
3
3
 
4
4
  declare global {
5
5
  interface ViewProps {
package/types.node.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- /// <reference types="./types.app" />
2
- /// <reference types="./types.meta" />
3
- /// <reference types="./types.env" />
1
+ /// <reference types="./types.app.d.ts" />
2
+ /// <reference types="./types.meta.d.ts" />
3
+ /// <reference types="./types.env.d.ts" />
@@ -1 +0,0 @@
1
- export declare function Root(): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { QueryClientProvider } from "@tanstack/react-query";
3
- import { BrowserRouter } from "../lib/routing/components/BrowserRouter";
4
- import { getQueryClient } from "../utils/query-client";
5
- import { DevUILoader } from "../lib/devtools/loader";
6
- import { Suspense } from "react";
7
- export function Root() {
8
- return (_jsxs(QueryClientProvider, { client: getQueryClient(), children: [_jsx(Suspense, { children: _jsx(BrowserRouter, {}) }), _jsx(DevUILoader, {})] }));
9
- }
@@ -1,3 +0,0 @@
1
- import "@manifest/admin";
2
- import "@manifest/blocks";
3
- export default function bootAdmin(): void;
@@ -1,10 +0,0 @@
1
- import "@manifest/admin";
2
- import { installFieldTypes } from "../lib/admin/installFieldTypes";
3
- import { runWidgets } from "../lib/admin/runWidgets";
4
- import { installEDGutenbergHooks } from "../lib/blocks/editor/installGutenbergHooks";
5
- import "@manifest/blocks";
6
- export default function bootAdmin() {
7
- installEDGutenbergHooks();
8
- installFieldTypes();
9
- runWidgets();
10
- }
@@ -1,3 +0,0 @@
1
- import "@manifest/blocks";
2
- import "@manifest/views";
3
- export default function boot(): void;
@@ -1,13 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@manifest/blocks";
3
- import "@manifest/views";
4
- import { createRoot, hydrateRoot } from "react-dom/client";
5
- import { Root } from "./Root";
6
- export default function boot() {
7
- if (env.serverless) {
8
- hydrateRoot(document.getElementById("root"), _jsx(Root, {}));
9
- }
10
- else {
11
- createRoot(document.getElementById("root")).render(_jsx(Root, {}));
12
- }
13
- }
@@ -1,21 +0,0 @@
1
- import "@manifest/blocks";
2
- import "@manifest/views";
3
- import type { RouteData } from "../lib/routing/types";
4
- import { UrlReplacerConf } from "../server/utils/replace-host";
5
- export declare function patchConsole(c: any): void;
6
- export declare function setFetchImpl(opts: any): void;
7
- export declare function setPropsPreprocessor(func: any): void;
8
- export declare function getPageData(): RouteData;
9
- export declare function getCollectedOutput(): {
10
- head: string;
11
- foot: string;
12
- };
13
- export declare const getHonoAPI: (args: {
14
- fetchImpl: any;
15
- replaceUrls: UrlReplacerConf;
16
- }) => import("hono").Hono<import("hono").Env, {}, "/">;
17
- export declare const getHonoSSR: (args: {
18
- indexTransformer: (html: string) => Promise<string>;
19
- fetchImpl: any;
20
- replaceUrls: UrlReplacerConf;
21
- }) => import("hono").Hono<import("hono").Env, {}, "/">;
@@ -1,79 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@manifest/blocks";
3
- import { getCssText } from "@manifest/theme";
4
- import "@manifest/views";
5
- import { QueryClientProvider } from "@tanstack/react-query";
6
- import { SSRRouter } from "../lib/routing/components/SSRRouter";
7
- import { RouteLoader } from "../lib/routing/loader";
8
- import { createHonoStdAPI } from "../server/create-api-builtin-hono";
9
- import { createSSRHono } from "../server/create-ssr-hono";
10
- import indexHtml from "../server/utils/index.html";
11
- import { getQueryClient } from "../utils/query-client";
12
- import { normalizeRoute } from "../lib/routing/utils";
13
- import { createUrlReplacer } from "../server/utils/replace-host";
14
- let initialData;
15
- export function patchConsole(c) {
16
- console.log = (...args) => c.log(...args);
17
- console.info = (...args) => c.info(...args);
18
- console.warn = (...args) => c.warn(...args);
19
- console.error = (...args) => c.warn(...args);
20
- }
21
- export function setFetchImpl(opts) {
22
- // routeLoader4().setFetchImpl(opts)
23
- }
24
- export function setPropsPreprocessor(func) {
25
- // routeLoader4().setPropsPreprocessor(func)
26
- }
27
- export function getPageData() {
28
- return initialData;
29
- }
30
- export function getCollectedOutput() {
31
- const result = { head: "", foot: "" };
32
- if (getCssText) {
33
- result.head = `<style id="stitches">${getCssText()}</style>`;
34
- }
35
- return result;
36
- }
37
- export const getHonoAPI = (args) => {
38
- return createHonoStdAPI({
39
- fetch: args.fetchImpl,
40
- replaceUrls: args.replaceUrls,
41
- });
42
- };
43
- export const getHonoSSR = (args) => {
44
- const replaceUrls = args.replaceUrls ? createUrlReplacer(args.replaceUrls) : null;
45
- return createSSRHono({
46
- render: async function render({ pathname }) {
47
- const loader = new RouteLoader();
48
- if (replaceUrls) {
49
- loader.setPropsPreprocessor(replaceUrls);
50
- }
51
- loader.setFetchImpl(args.fetchImpl);
52
- initialData = await loader.loadRouteData(pathname, true);
53
- loader.setAppData(initialData.appData.data);
54
- return {
55
- jsx: (_jsx(QueryClientProvider, { client: getQueryClient(), children: _jsx(SSRRouter, { loader: loader, route: normalizeRoute({
56
- id: "initial",
57
- component: loader.getRouteComponent(initialData.view),
58
- pathname: pathname,
59
- hash: "",
60
- key: "",
61
- props: initialData.viewData.data,
62
- view: initialData.view,
63
- query: {},
64
- search: "",
65
- }) }) })),
66
- getCollectedOutput() {
67
- const result = { head: "", foot: "" };
68
- if (getCssText) {
69
- result.head = `<style id="stitches">${getCssText()}</style>`;
70
- }
71
- return result;
72
- },
73
- indexTemplate: args.indexTransformer ? await args.indexTransformer(indexHtml) : indexHtml,
74
- data: initialData,
75
- };
76
- },
77
- manifest: {},
78
- });
79
- };
@@ -1,4 +0,0 @@
1
- import "@manifest/blocks";
2
- import "@manifest/views";
3
- import "@manifest/admin";
4
- export default function boot(): void;
@@ -1,21 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@manifest/blocks";
3
- import "@manifest/views";
4
- import "@manifest/admin";
5
- import { createRoot, hydrateRoot } from "react-dom/client";
6
- import { Root } from "./Root";
7
- import bootAdmin from "./main.admin";
8
- // @ts-ignore
9
- if (!window.wp)
10
- window.wp = {};
11
- export default function boot() {
12
- if (env.admin) {
13
- bootAdmin();
14
- }
15
- else if (env.serverless) {
16
- hydrateRoot(document.getElementById("root"), _jsx(Root, {}));
17
- }
18
- else {
19
- createRoot(document.getElementById("root")).render(_jsx(Root, {}));
20
- }
21
- }
@@ -1,15 +0,0 @@
1
- import { Component, ErrorInfo, ReactNode } from "react";
2
- interface Props {
3
- children: ReactNode;
4
- }
5
- interface State {
6
- hasError: boolean;
7
- error?: Error;
8
- }
9
- export declare class ErrorBoundaryFrontend extends Component<Props, State> {
10
- state: State;
11
- static getDerivedStateFromError(err: Error): State;
12
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
13
- render(): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
14
- }
15
- export {};
@@ -1,35 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Component } from "react";
3
- export class ErrorBoundaryFrontend extends Component {
4
- state = {
5
- hasError: false,
6
- };
7
- static getDerivedStateFromError(err) {
8
- // Update state so the next render will show the fallback UI.
9
- return { hasError: true, error: err };
10
- }
11
- componentDidCatch(error, errorInfo) {
12
- console.error("Uncaught error:", error, errorInfo);
13
- }
14
- render() {
15
- if (this.state.hasError) {
16
- const err = this.state.error;
17
- if (env.dev) {
18
- return (_jsx("pre", { style: {
19
- backgroundColor: "#fafafa",
20
- fontSize: "12px",
21
- color: "#d92a0b",
22
- border: "2px solid #d92a0b",
23
- borderRadius: "4px",
24
- padding: "8px",
25
- overflowX: "auto",
26
- fontFamily: '"Roboto Mono", Menlo, monospace',
27
- }, children: err.stack }));
28
- }
29
- else {
30
- return null;
31
- }
32
- }
33
- return this.props.children;
34
- }
35
- }
@@ -1,4 +0,0 @@
1
- import { create } from "zustand";
2
- export const useAPIConfig = create((set, get) => ({
3
- set: (config) => set(config),
4
- }));
@@ -1,6 +0,0 @@
1
- interface PageLoadStore {
2
- loading: boolean;
3
- setIsLoading(loading: boolean): void;
4
- }
5
- export declare const usePageLoad: import("zustand").UseBoundStore<import("zustand").StoreApi<PageLoadStore>>;
6
- export {};
@@ -1,5 +0,0 @@
1
- import { create } from "zustand";
2
- export const usePageLoad = create((set) => ({
3
- loading: false,
4
- setIsLoading: (loading) => set({ loading: loading }),
5
- }));
@@ -1,8 +0,0 @@
1
- import { Hono } from "hono";
2
- import { UrlReplacerConf } from "./utils/replace-host";
3
- type Conf = {
4
- fetch: typeof fetch;
5
- replaceUrls?: UrlReplacerConf;
6
- };
7
- export declare function createHonoStdAPI(conf: Conf): Hono<import("hono").Env, {}, "/">;
8
- export {};
@@ -1,80 +0,0 @@
1
- import { Hono } from "hono";
2
- import { joinURL, withQuery } from "ufo";
3
- import { BRANDED_HEADERS, filterHeader } from "./utils/headers";
4
- import { createUrlReplacer } from "./utils/replace-host";
5
- let standardFetch = fetch;
6
- const PROXY_RESPONSE_HEADERS = ["content-type", "set-cookie", /^x-/, "cache-control", ...Object.keys(BRANDED_HEADERS)];
7
- function extractHeaders(rawHeaders) {
8
- const headers = {};
9
- rawHeaders.forEach((value, key) => {
10
- headers[key] = value;
11
- });
12
- return headers;
13
- }
14
- export function createHonoStdAPI(conf) {
15
- const fetch = conf.fetch ?? standardFetch;
16
- const replaceUrls = conf.replaceUrls ? createUrlReplacer(conf.replaceUrls) : undefined;
17
- const app = new Hono();
18
- app.get("/api/rest/query/:name{.+}", async (c) => {
19
- const name = c.req.param("name");
20
- const paramString = c.req.query("params");
21
- const fetchUrl = withQuery(joinURL(env.origin ?? "", `/wp-json/ed/v1/query/${name}`), { params: paramString });
22
- const response = await fetch(fetchUrl, {
23
- referrer: c.req.raw.referrer,
24
- cache: "no-cache",
25
- headers: {
26
- "Content-Type": "application/json",
27
- Accept: "application/json",
28
- ...extractHeaders(c.req.raw.headers),
29
- // Authorization: c.req.header("Authorization") ?? "",
30
- // Cookie: c.req.header("Cookie") ?? "",
31
- // ...c.req.raw.headers,
32
- },
33
- });
34
- c.status(response.status);
35
- response.headers.forEach((value, key) => {
36
- if (filterHeader(key, PROXY_RESPONSE_HEADERS)) {
37
- c.header(key, value);
38
- }
39
- });
40
- Object.entries(BRANDED_HEADERS).forEach(([key, value]) => c.header(key, value));
41
- let text = await response.text();
42
- if (replaceUrls) {
43
- text = replaceUrls(text);
44
- }
45
- return c.body(text);
46
- });
47
- app.post("/api/rest/mutation/:name{.+}", async (c) => {
48
- const name = c.req.param("name");
49
- const fetchUrl = joinURL(env.origin ?? "", `/wp-json/ed/v1/mutation/${name}`);
50
- const response = await fetch(fetchUrl, {
51
- method: "POST",
52
- referrer: c.req.raw.referrer,
53
- cache: "no-cache",
54
- headers: {
55
- "Content-Type": "application/json",
56
- Accept: "application/json",
57
- ...extractHeaders(c.req.raw.headers),
58
- // Authorization: c.req.header("Authorization") ?? "",
59
- // Cookie: c.req.header("Cookie") ?? "",
60
- },
61
- body: JSON.stringify({
62
- name: name,
63
- ...(await c.req.json()),
64
- }),
65
- });
66
- c.status(response.status);
67
- response.headers.forEach((value, key) => {
68
- if (filterHeader(key, PROXY_RESPONSE_HEADERS)) {
69
- c.header(key, value);
70
- }
71
- });
72
- Object.entries(BRANDED_HEADERS).forEach(([key, value]) => c.header(key, value));
73
- let text = await response.text();
74
- if (replaceUrls) {
75
- text = replaceUrls(text);
76
- }
77
- return c.body(text);
78
- });
79
- return app;
80
- }
@@ -1,18 +0,0 @@
1
- import { Hono } from "hono";
2
- import { ReactElement } from "react";
3
- type Conf = {
4
- render: (args: {
5
- pathname: string;
6
- }) => Promise<{
7
- jsx: ReactElement;
8
- getCollectedOutput(): {
9
- head: string;
10
- foot: string;
11
- };
12
- indexTemplate: string;
13
- data: any;
14
- }>;
15
- manifest: any;
16
- };
17
- export declare function createSSRHono(conf: Conf): Hono<import("hono").Env, {}, "/">;
18
- export {};
@@ -1,104 +0,0 @@
1
- import { Hono } from "hono";
2
- import ReactDOMServer from "react-dom/server";
3
- import { stream } from "hono/streaming";
4
- export function createSSRHono(conf) {
5
- const app = new Hono();
6
- app.get("*", async (c) => {
7
- const isPropsRequest = c.req.query("_props");
8
- const result = await conf.render({ pathname: c.req.path });
9
- let didError = false;
10
- async function propsResponse() {
11
- c.status(200);
12
- c.header("Content-Type", "application/json");
13
- return c.json(result.data);
14
- }
15
- const getTemplateParts = () => {
16
- const collected = result.getCollectedOutput();
17
- let [head, foot] = result.indexTemplate.split("<!--ssr-outlet-->");
18
- head = head.replace("<!--ssr-meta-->", collected.head);
19
- const dataPayload = `\n<script type="text/javascript">window._PAGE_DATA = ${JSON.stringify(result.data, null, 2)}</script>\n`;
20
- foot = foot.replace("<!--ssr-meta-->", dataPayload + collected.foot);
21
- return [head, foot];
22
- };
23
- // For Web Stream environments, and when react-dom/server exports renderToReadableStream for Node.js
24
- // (Even though Node 20+ supports Web Streams, ReactDOM doesn't yet export it for Node)
25
- if (ReactDOMServer.renderToReadableStream) {
26
- const reactStream = await ReactDOMServer.renderToReadableStream(result.jsx, {
27
- onError: (err) => {
28
- didError = true;
29
- console.warn("Failed to server-render React frontend");
30
- console.error(err);
31
- },
32
- });
33
- await reactStream.allReady;
34
- if (isPropsRequest) {
35
- return propsResponse();
36
- }
37
- const [head, foot] = getTemplateParts();
38
- return stream(c, async (stream) => {
39
- await stream.write(head);
40
- await stream.pipe(reactStream);
41
- await stream.write(foot);
42
- stream.close();
43
- });
44
- // const result = await stream.getReader().read()
45
- // const result = { value: "test" }
46
- // return finalize(result.value)
47
- }
48
- else {
49
- return new Promise((resolve, reject) => {
50
- const reactStream = ReactDOMServer.renderToPipeableStream(result.jsx, {
51
- onError: (err) => {
52
- didError = true;
53
- console.warn("Failed to server-render React frontend");
54
- console.error(err);
55
- // setModuleCollector(() => {})
56
- },
57
- onShellError: (err) => {
58
- console.warn("Shell");
59
- console.error(err);
60
- },
61
- onAllReady: async () => {
62
- if (isPropsRequest) {
63
- resolve(propsResponse());
64
- }
65
- else {
66
- c.status(200);
67
- c.header("Content-Type", "text/html");
68
- resolve(stream(c, async (stream) => {
69
- const [head, foot] = getTemplateParts();
70
- stream.write(head);
71
- reactStream.pipe({
72
- write(chunk) {
73
- stream.write(chunk);
74
- },
75
- close() {
76
- // stream.close()
77
- },
78
- destroy() { },
79
- on(event, cb) { },
80
- async end() {
81
- stream.write(foot);
82
- stream.close();
83
- },
84
- });
85
- }));
86
- // reac.pipe(new WritableStream((chunk) => {
87
- // chunk
88
- // }))
89
- // resolve(stream())
90
- // const collected = getCollectedOutput()
91
- // res.status(200).set({ "Content-Type": "text/html" })
92
- // res.write(htmlParts[0].replace("<!--ssr-meta-->", collected.head ?? ""))
93
- // stream.pipe(res)
94
- // res.write(htmlParts[1].replace("<!--ssr-meta-->", collected.footer ?? ""))
95
- // res.end()
96
- }
97
- // setModuleCollector(() => {})
98
- },
99
- });
100
- });
101
- }
102
- });
103
- return app;
104
- }
@@ -1,2 +0,0 @@
1
- declare const _default: "<!doctype html>\n<html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <link rel=\"icon\" type=\"image/svg+xml\" href=\"/vite.svg\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <!--ssr-meta-->\n </head>\n <body>\n <div id=\"root\"><!--ssr-outlet--></div>\n <!--ssr-meta-->\n <script type=\"module\" src=\"/_boot.js\"></script>\n </body>\n</html>";
2
- export default _default;