eddev 2.0.0-beta.2 → 2.0.0-beta.200

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 (522) hide show
  1. package/css/editor-styles.css +4 -0
  2. package/dist/app/entry/HydrationOverlay.d.ts +2 -0
  3. package/dist/app/entry/HydrationOverlay.d.ts.map +1 -0
  4. package/dist/app/entry/HydrationOverlay.js +2 -0
  5. package/dist/app/entry/MetaTags.d.ts +8 -0
  6. package/dist/app/entry/MetaTags.d.ts.map +1 -0
  7. package/dist/app/entry/MetaTags.js +30 -0
  8. package/dist/app/entry/boot-admin.d.ts +2 -0
  9. package/dist/app/entry/boot-admin.d.ts.map +1 -0
  10. package/dist/app/entry/boot-admin.js +12 -0
  11. package/dist/app/entry/hydration-script.d.ts +2 -0
  12. package/dist/app/entry/hydration-script.d.ts.map +1 -0
  13. package/dist/app/entry/hydration-script.js +18 -0
  14. package/dist/app/entry/spa-root.d.ts +2 -0
  15. package/dist/app/entry/spa-root.d.ts.map +1 -0
  16. package/dist/app/entry/spa-root.js +7 -0
  17. package/dist/app/entry/ssr-root-client.d.ts +7 -0
  18. package/dist/app/entry/ssr-root-client.d.ts.map +1 -0
  19. package/dist/app/entry/ssr-root-client.js +21 -0
  20. package/dist/app/entry/ssr-root.d.ts +11 -0
  21. package/dist/app/entry/ssr-root.d.ts.map +1 -0
  22. package/dist/app/entry/ssr-root.js +22 -0
  23. package/dist/app/lib/admin/defineField.d.ts +1 -0
  24. package/dist/app/lib/admin/defineField.d.ts.map +1 -0
  25. package/dist/app/lib/admin/defineWidget.d.ts +1 -0
  26. package/dist/app/lib/admin/defineWidget.d.ts.map +1 -0
  27. package/dist/app/lib/admin/index.d.ts +3 -2
  28. package/dist/app/lib/admin/index.d.ts.map +1 -0
  29. package/dist/app/lib/admin/index.js +2 -2
  30. package/dist/app/lib/admin/installFieldTypes.d.ts +1 -0
  31. package/dist/app/lib/admin/installFieldTypes.d.ts.map +1 -0
  32. package/dist/app/lib/admin/installFieldTypes.js +3 -1
  33. package/dist/app/lib/admin/runWidgets.d.ts +1 -0
  34. package/dist/app/lib/admin/runWidgets.d.ts.map +1 -0
  35. package/dist/app/lib/admin/runWidgets.js +8 -3
  36. package/dist/app/lib/blocks/ContentBlocks.d.ts +7 -4
  37. package/dist/app/lib/blocks/ContentBlocks.d.ts.map +1 -0
  38. package/dist/app/lib/blocks/ContentBlocks.js +19 -6
  39. package/dist/app/lib/blocks/EditableText.d.ts +31 -6
  40. package/dist/app/lib/blocks/EditableText.d.ts.map +1 -0
  41. package/dist/app/lib/blocks/EditableText.js +36 -7
  42. package/dist/app/lib/blocks/InnerBlocks.d.ts +23 -8
  43. package/dist/app/lib/blocks/InnerBlocks.d.ts.map +1 -0
  44. package/dist/app/lib/blocks/InnerBlocks.js +76 -28
  45. package/dist/app/lib/blocks/SlotBlocks.d.ts +8 -0
  46. package/dist/app/lib/blocks/SlotBlocks.d.ts.map +1 -0
  47. package/dist/app/lib/blocks/SlotBlocks.js +46 -0
  48. package/dist/app/lib/blocks/block-utils.d.ts +3 -2
  49. package/dist/app/lib/blocks/block-utils.d.ts.map +1 -0
  50. package/dist/app/lib/blocks/block-utils.js +4 -2
  51. package/dist/app/lib/blocks/builtin-blocks.d.ts +2 -0
  52. package/dist/app/lib/blocks/builtin-blocks.d.ts.map +1 -0
  53. package/dist/app/lib/blocks/builtin-blocks.js +55 -0
  54. package/dist/app/lib/blocks/defineBlock.d.ts +4 -0
  55. package/dist/app/lib/blocks/defineBlock.d.ts.map +1 -0
  56. package/dist/app/lib/blocks/defineBlock.js +9 -0
  57. package/dist/app/lib/blocks/editor/EditorHighlights.d.ts +8 -0
  58. package/dist/app/lib/blocks/editor/EditorHighlights.d.ts.map +1 -0
  59. package/dist/app/lib/blocks/editor/EditorHighlights.js +164 -0
  60. package/dist/app/lib/blocks/editor/EditorSupport.d.ts +1 -0
  61. package/dist/app/lib/blocks/editor/EditorSupport.d.ts.map +1 -0
  62. package/dist/app/lib/blocks/editor/EditorSupport.js +19 -12
  63. package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +1 -0
  64. package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts.map +1 -0
  65. package/dist/app/lib/blocks/editor/block-templates.d.ts +8 -1
  66. package/dist/app/lib/blocks/editor/block-templates.d.ts.map +1 -0
  67. package/dist/app/lib/blocks/editor/block-templates.js +71 -2
  68. package/dist/app/lib/blocks/editor/blocks-by-tag.d.ts +1 -0
  69. package/dist/app/lib/blocks/editor/blocks-by-tag.d.ts.map +1 -0
  70. package/dist/app/lib/blocks/editor/controls.d.ts +1 -0
  71. package/dist/app/lib/blocks/editor/controls.d.ts.map +1 -0
  72. package/dist/app/lib/blocks/editor/create-block.d.ts +10 -0
  73. package/dist/app/lib/blocks/editor/create-block.d.ts.map +1 -0
  74. package/dist/app/lib/blocks/editor/create-block.js +13 -0
  75. package/dist/app/lib/blocks/editor/editor-config.d.ts +78 -9
  76. package/dist/app/lib/blocks/editor/editor-config.d.ts.map +1 -0
  77. package/dist/app/lib/blocks/editor/editor-config.js +29 -62
  78. package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts +4 -0
  79. package/dist/app/lib/blocks/editor/installGutenbergHooks.d.ts.map +1 -0
  80. package/dist/app/lib/blocks/editor/installGutenbergHooks.js +130 -25
  81. package/dist/app/lib/blocks/editor/root-blocks.d.ts +7 -0
  82. package/dist/app/lib/blocks/editor/root-blocks.d.ts.map +1 -0
  83. package/dist/app/lib/blocks/editor/root-blocks.js +30 -0
  84. package/dist/app/lib/blocks/editor/usePostEditor.d.ts +13 -2
  85. package/dist/app/lib/blocks/editor/usePostEditor.d.ts.map +1 -0
  86. package/dist/app/lib/blocks/editor/usePostEditor.js +28 -13
  87. package/dist/app/lib/blocks/index.d.ts +12 -9
  88. package/dist/app/lib/blocks/index.d.ts.map +1 -0
  89. package/dist/app/lib/blocks/index.js +11 -9
  90. package/dist/app/lib/blocks/inline-editing.d.ts +11 -1
  91. package/dist/app/lib/blocks/inline-editing.d.ts.map +1 -0
  92. package/dist/app/lib/blocks/inline-editing.js +15 -5
  93. package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts +1 -0
  94. package/dist/app/lib/devtools/components/BreakpointIndicator.d.ts.map +1 -0
  95. package/dist/app/lib/devtools/components/BreakpointIndicator.js +7 -5
  96. package/dist/app/lib/devtools/components/DevUI.d.ts +1 -0
  97. package/dist/app/lib/devtools/components/DevUI.d.ts.map +1 -0
  98. package/dist/app/lib/devtools/components/DevUI.js +4 -3
  99. package/dist/app/lib/devtools/components/GridIndicator.d.ts +2 -0
  100. package/dist/app/lib/devtools/components/GridIndicator.d.ts.map +1 -0
  101. package/dist/app/lib/devtools/components/GridIndicator.js +29 -0
  102. package/dist/app/lib/devtools/dev-tools-store.d.ts +10 -0
  103. package/dist/app/lib/devtools/dev-tools-store.d.ts.map +1 -0
  104. package/dist/app/lib/devtools/dev-tools-store.js +8 -0
  105. package/dist/app/lib/devtools/hooks/usePersistState.d.ts +2 -1
  106. package/dist/app/lib/devtools/hooks/usePersistState.d.ts.map +1 -0
  107. package/dist/app/lib/devtools/hooks/usePersistState.js +11 -2
  108. package/dist/app/lib/devtools/hooks/useTailwind.d.ts +2311 -1267
  109. package/dist/app/lib/devtools/hooks/useTailwind.d.ts.map +1 -0
  110. package/dist/app/lib/devtools/hooks/useTailwind.js +6 -3
  111. package/dist/app/lib/devtools/index.d.ts +2 -0
  112. package/dist/app/lib/devtools/index.d.ts.map +1 -0
  113. package/dist/app/lib/devtools/index.js +1 -1
  114. package/dist/app/lib/devtools/loader.d.ts +1 -0
  115. package/dist/app/lib/devtools/loader.d.ts.map +1 -0
  116. package/dist/app/lib/devtools/loader.js +8 -7
  117. package/dist/app/lib/devtools/tailwind.config.d.ts +1 -0
  118. package/dist/app/lib/devtools/tailwind.config.d.ts.map +1 -0
  119. package/dist/app/lib/devtools/useQueryDebug.d.ts +8 -1
  120. package/dist/app/lib/devtools/useQueryDebug.d.ts.map +1 -0
  121. package/dist/app/lib/devtools/useQueryDebug.js +5 -8
  122. package/dist/app/lib/dynamic/dynamic.d.ts +2 -1
  123. package/dist/app/lib/dynamic/dynamic.d.ts.map +1 -0
  124. package/dist/app/lib/dynamic/dynamic.js +5 -1
  125. package/dist/app/lib/dynamic/index.d.ts +2 -1
  126. package/dist/app/lib/dynamic/index.d.ts.map +1 -0
  127. package/dist/app/lib/dynamic/index.js +1 -1
  128. package/dist/app/lib/hooks/index.d.ts +5 -5
  129. package/dist/app/lib/hooks/index.d.ts.map +1 -0
  130. package/dist/app/lib/hooks/index.js +4 -5
  131. package/dist/app/lib/hooks/{queryUtils.d.ts → query-hooks.d.ts} +46 -4
  132. package/dist/app/lib/hooks/query-hooks.d.ts.map +1 -0
  133. package/dist/app/lib/hooks/{queryUtils.js → query-hooks.js} +99 -40
  134. package/dist/app/lib/hooks/useAppData.d.ts +1 -0
  135. package/dist/app/lib/hooks/useAppData.d.ts.map +1 -0
  136. package/dist/app/lib/hooks/useAppData.js +12 -1
  137. package/dist/app/lib/hooks/useRPC.d.ts +1 -4
  138. package/dist/app/lib/hooks/useRPC.d.ts.map +1 -0
  139. package/dist/app/lib/hooks/useRPC.js +0 -8
  140. package/dist/app/lib/integrations/gravityforms/index.d.ts +3 -0
  141. package/dist/app/lib/integrations/gravityforms/index.d.ts.map +1 -0
  142. package/dist/app/lib/integrations/gravityforms/index.js +2 -0
  143. package/dist/app/lib/integrations/gravityforms/types.d.ts +145 -0
  144. package/dist/app/lib/integrations/gravityforms/types.d.ts.map +1 -0
  145. package/dist/app/lib/integrations/gravityforms/types.js +1 -0
  146. package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts +31 -0
  147. package/dist/app/lib/integrations/gravityforms/useGravityForm.d.ts.map +1 -0
  148. package/dist/app/lib/integrations/gravityforms/useGravityForm.js +295 -0
  149. package/dist/app/lib/internal/finalize-rpc.d.ts +18 -0
  150. package/dist/app/lib/internal/finalize-rpc.d.ts.map +1 -0
  151. package/dist/app/lib/internal/finalize-rpc.js +3 -0
  152. package/dist/app/lib/internal/index.d.ts +6 -4
  153. package/dist/app/lib/internal/index.d.ts.map +1 -0
  154. package/dist/app/lib/internal/index.js +5 -4
  155. package/dist/app/lib/internal/internal-store.d.ts +1 -2
  156. package/dist/app/lib/internal/internal-store.d.ts.map +1 -0
  157. package/dist/app/lib/internal/internal-store.js +1 -3
  158. package/dist/app/lib/internal/read-admin-manifest.d.ts +2 -1
  159. package/dist/app/lib/internal/read-admin-manifest.d.ts.map +1 -0
  160. package/dist/app/lib/internal/read-block-manifest.d.ts +1 -0
  161. package/dist/app/lib/internal/read-block-manifest.d.ts.map +1 -0
  162. package/dist/app/lib/internal/read-view-manifest.d.ts +1 -0
  163. package/dist/app/lib/internal/read-view-manifest.d.ts.map +1 -0
  164. package/dist/app/lib/legacy-stitches/createStitches.d.ts +22 -21
  165. package/dist/app/lib/legacy-stitches/createStitches.d.ts.map +1 -0
  166. package/dist/app/lib/legacy-stitches/createStitches.js +1 -1
  167. package/dist/app/lib/legacy-stitches/index.d.ts +2 -1
  168. package/dist/app/lib/legacy-stitches/index.d.ts.map +1 -0
  169. package/dist/app/lib/legacy-stitches/index.js +1 -1
  170. package/dist/app/lib/routing/components/BackButton.d.ts +50 -0
  171. package/dist/app/lib/routing/components/BackButton.d.ts.map +1 -0
  172. package/dist/app/lib/routing/components/BackButton.js +47 -0
  173. package/dist/app/lib/routing/components/BrowserRouter.d.ts +10 -1
  174. package/dist/app/lib/routing/components/BrowserRouter.d.ts.map +1 -0
  175. package/dist/app/lib/routing/components/BrowserRouter.js +138 -23
  176. package/dist/app/lib/routing/components/ClientOnly.d.ts +1 -0
  177. package/dist/app/lib/routing/components/ClientOnly.d.ts.map +1 -0
  178. package/dist/app/lib/routing/components/ClientOnly.js +2 -2
  179. package/dist/app/lib/routing/components/Link.d.ts +19 -2
  180. package/dist/app/lib/routing/components/Link.d.ts.map +1 -0
  181. package/dist/app/lib/routing/components/Link.js +47 -27
  182. package/dist/app/lib/routing/components/NativeLinkHandler.d.ts +10 -0
  183. package/dist/app/lib/routing/components/NativeLinkHandler.d.ts.map +1 -0
  184. package/dist/app/lib/routing/components/NativeLinkHandler.js +23 -0
  185. package/dist/app/lib/routing/components/RouteRenderer.d.ts +2 -1
  186. package/dist/app/lib/routing/components/RouteRenderer.d.ts.map +1 -0
  187. package/dist/app/lib/routing/components/RouteRenderer.js +20 -6
  188. package/dist/app/lib/routing/components/SSRRouter.d.ts +5 -2
  189. package/dist/app/lib/routing/components/SSRRouter.d.ts.map +1 -0
  190. package/dist/app/lib/routing/components/SSRRouter.js +7 -6
  191. package/dist/app/lib/routing/components/ScrollRestoration.d.ts +1 -0
  192. package/dist/app/lib/routing/components/ScrollRestoration.d.ts.map +1 -0
  193. package/dist/app/lib/routing/components/ScrollRestoration.js +5 -2
  194. package/dist/app/lib/routing/context.d.ts +9 -5
  195. package/dist/app/lib/routing/context.d.ts.map +1 -0
  196. package/dist/app/lib/routing/context.js +13 -96
  197. package/dist/app/lib/routing/hooks/useIsSSR.d.ts +1 -0
  198. package/dist/app/lib/routing/hooks/useIsSSR.d.ts.map +1 -0
  199. package/dist/app/lib/routing/hooks/useRestorableState.d.ts +3 -1
  200. package/dist/app/lib/routing/hooks/useRestorableState.d.ts.map +1 -0
  201. package/dist/app/lib/routing/hooks/useRestorableState.js +2 -1
  202. package/dist/app/lib/routing/hooks/useRoute.d.ts +17 -1
  203. package/dist/app/lib/routing/hooks/useRoute.d.ts.map +1 -0
  204. package/dist/app/lib/routing/hooks/useRoute.js +22 -1
  205. package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +6 -0
  206. package/dist/app/lib/routing/hooks/useRouteMeta.d.ts.map +1 -0
  207. package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
  208. package/dist/app/lib/routing/hooks/useRouteTransition.d.ts +2 -1
  209. package/dist/app/lib/routing/hooks/useRouteTransition.d.ts.map +1 -0
  210. package/dist/app/lib/routing/hooks/useRouteTransition.js +1 -1
  211. package/dist/app/lib/routing/hooks/useRouter.d.ts +2 -1
  212. package/dist/app/lib/routing/hooks/useRouter.d.ts.map +1 -0
  213. package/dist/app/lib/routing/hooks/useRouter.js +1 -1
  214. package/dist/app/lib/routing/hooks/useRouterEvents.d.ts +2 -1
  215. package/dist/app/lib/routing/hooks/useRouterEvents.d.ts.map +1 -0
  216. package/dist/app/lib/routing/hooks/useRouterEvents.js +1 -1
  217. package/dist/app/lib/routing/hooks/useRouterState.d.ts +2 -1
  218. package/dist/app/lib/routing/hooks/useRouterState.d.ts.map +1 -0
  219. package/dist/app/lib/routing/hooks/useRouterState.js +1 -1
  220. package/dist/app/lib/routing/hooks/useSearchParams.d.ts +78 -6
  221. package/dist/app/lib/routing/hooks/useSearchParams.d.ts.map +1 -0
  222. package/dist/app/lib/routing/hooks/useSearchParams.js +77 -17
  223. package/dist/app/lib/routing/index.d.ts +16 -13
  224. package/dist/app/lib/routing/index.d.ts.map +1 -0
  225. package/dist/app/lib/routing/index.js +15 -13
  226. package/dist/app/lib/routing/loader.d.ts +3 -2
  227. package/dist/app/lib/routing/loader.d.ts.map +1 -0
  228. package/dist/app/lib/routing/loader.js +26 -15
  229. package/dist/app/lib/routing/types.d.ts +62 -14
  230. package/dist/app/lib/routing/types.d.ts.map +1 -0
  231. package/dist/app/lib/routing/utils.d.ts +7 -2
  232. package/dist/app/lib/routing/utils.d.ts.map +1 -0
  233. package/dist/app/lib/routing/utils.js +41 -4
  234. package/dist/app/lib/{hooks → runtime}/apiConfig.d.ts +11 -2
  235. package/dist/app/lib/runtime/apiConfig.d.ts.map +1 -0
  236. package/dist/app/lib/runtime/apiConfig.js +6 -0
  237. package/dist/app/lib/runtime/errorHandling.d.ts +40 -0
  238. package/dist/app/lib/runtime/errorHandling.d.ts.map +1 -0
  239. package/dist/app/lib/runtime/errorHandling.js +6 -0
  240. package/dist/app/lib/runtime/index.d.ts +3 -0
  241. package/dist/app/lib/runtime/index.d.ts.map +1 -0
  242. package/dist/app/lib/runtime/index.js +2 -0
  243. package/dist/app/lib/views/defineView.d.ts +2 -1
  244. package/dist/app/lib/views/defineView.d.ts.map +1 -0
  245. package/dist/app/lib/views/index.d.ts +2 -1
  246. package/dist/app/lib/views/index.d.ts.map +1 -0
  247. package/dist/app/lib/views/index.js +1 -1
  248. package/dist/app/server/index.d.ts +6 -0
  249. package/dist/app/server/index.d.ts.map +1 -0
  250. package/dist/app/server/index.js +5 -0
  251. package/dist/app/server/proxy-wp-admin.d.ts +3 -0
  252. package/dist/app/server/proxy-wp-admin.d.ts.map +1 -0
  253. package/dist/app/server/proxy-wp-admin.js +138 -0
  254. package/dist/app/server/render-ai-page.d.ts +13 -0
  255. package/dist/app/server/render-ai-page.d.ts.map +1 -0
  256. package/dist/app/server/render-ai-page.js +100 -0
  257. package/dist/app/server/render-ssr-page.d.ts +31 -0
  258. package/dist/app/server/render-ssr-page.d.ts.map +1 -0
  259. package/dist/app/server/render-ssr-page.js +237 -0
  260. package/dist/app/server/rpc.d.ts +52 -0
  261. package/dist/app/server/rpc.d.ts.map +1 -0
  262. package/dist/app/server/rpc.js +18 -0
  263. package/dist/app/server/server-context.d.ts +75 -0
  264. package/dist/app/server/server-context.d.ts.map +1 -0
  265. package/dist/app/server/server-context.js +417 -0
  266. package/dist/app/server/server-custom-config.d.ts +3 -0
  267. package/dist/app/server/server-custom-config.d.ts.map +1 -0
  268. package/dist/app/server/server-custom-config.js +1 -0
  269. package/dist/app/server/utils/content-security.d.ts +26 -0
  270. package/dist/app/server/utils/content-security.d.ts.map +1 -0
  271. package/dist/app/server/utils/content-security.js +124 -0
  272. package/dist/app/server/utils/headers.d.ts +2 -0
  273. package/dist/app/server/utils/headers.d.ts.map +1 -0
  274. package/dist/app/server/utils/headers.js +17 -0
  275. package/dist/app/server/utils/replace-host.d.ts +7 -4
  276. package/dist/app/server/utils/replace-host.d.ts.map +1 -0
  277. package/dist/app/server/utils/replace-host.js +66 -11
  278. package/dist/app/server/utils/swr-cache.d.ts +5 -0
  279. package/dist/app/server/utils/swr-cache.d.ts.map +1 -0
  280. package/dist/app/server/utils/swr-cache.js +31 -0
  281. package/dist/app/utils/APIProvider.d.ts +3 -0
  282. package/dist/app/utils/APIProvider.d.ts.map +1 -0
  283. package/dist/app/utils/APIProvider.js +5 -0
  284. package/dist/app/utils/BlockErrorBoundary.d.ts +20 -0
  285. package/dist/app/utils/BlockErrorBoundary.d.ts.map +1 -0
  286. package/dist/app/utils/BlockErrorBoundary.js +38 -0
  287. package/dist/app/utils/ErrorMessage.d.ts +6 -0
  288. package/dist/app/utils/ErrorMessage.d.ts.map +1 -0
  289. package/dist/app/utils/ErrorMessage.js +14 -0
  290. package/dist/app/utils/RouteErrorBoundary.d.ts +20 -0
  291. package/dist/app/utils/RouteErrorBoundary.d.ts.map +1 -0
  292. package/dist/app/utils/RouteErrorBoundary.js +41 -0
  293. package/dist/app/utils/asset-capture.d.ts +3 -0
  294. package/dist/app/utils/asset-capture.d.ts.map +1 -0
  295. package/dist/app/utils/asset-capture.js +5 -0
  296. package/dist/app/utils/hydration-debugger.d.ts +14 -0
  297. package/dist/app/utils/hydration-debugger.d.ts.map +1 -0
  298. package/dist/app/utils/hydration-debugger.js +11 -0
  299. package/dist/app/utils/query-client.d.ts +3 -0
  300. package/dist/app/utils/query-client.d.ts.map +1 -0
  301. package/dist/app/utils/query-client.js +5 -1
  302. package/dist/app/utils/query-monitor.d.ts +27 -0
  303. package/dist/app/utils/query-monitor.d.ts.map +1 -0
  304. package/dist/app/utils/query-monitor.js +7 -0
  305. package/dist/app/utils/trpc-client.d.ts +3 -0
  306. package/dist/app/utils/trpc-client.d.ts.map +1 -0
  307. package/dist/app/utils/trpc-client.js +39 -0
  308. package/dist/app/utils/wp.d.ts +11 -10
  309. package/dist/app/utils/wp.d.ts.map +1 -0
  310. package/dist/node/cli/cli-mode.d.ts +1 -0
  311. package/dist/node/cli/cli-mode.d.ts.map +1 -0
  312. package/dist/node/cli/cli-worker.d.ts +2 -1
  313. package/dist/node/cli/cli-worker.d.ts.map +1 -0
  314. package/dist/node/cli/cli-worker.js +12 -3
  315. package/dist/node/cli/cli.d.ts +1 -0
  316. package/dist/node/cli/cli.d.ts.map +1 -0
  317. package/dist/node/cli/cli.js +195 -11
  318. package/dist/node/cli/display/CLIApp.d.ts +2 -1
  319. package/dist/node/cli/display/CLIApp.d.ts.map +1 -0
  320. package/dist/node/cli/display/CLIApp.js +4 -7
  321. package/dist/node/cli/display/boot-cli-app.d.ts +1 -0
  322. package/dist/node/cli/display/boot-cli-app.d.ts.map +1 -0
  323. package/dist/node/cli/display/boot-cli-app.js +1 -1
  324. package/dist/node/cli/display/components/Fullscreen.d.ts +1 -0
  325. package/dist/node/cli/display/components/Fullscreen.d.ts.map +1 -0
  326. package/dist/node/cli/display/components/LogEntries.d.ts +2 -1
  327. package/dist/node/cli/display/components/LogEntries.d.ts.map +1 -0
  328. package/dist/node/cli/display/components/MenuItem.d.ts +1 -0
  329. package/dist/node/cli/display/components/MenuItem.d.ts.map +1 -0
  330. package/dist/node/cli/display/components/TextInput.d.ts +1 -0
  331. package/dist/node/cli/display/components/TextInput.d.ts.map +1 -0
  332. package/dist/node/cli/display/hooks/useManifest.d.ts +1 -0
  333. package/dist/node/cli/display/hooks/useManifest.d.ts.map +1 -0
  334. package/dist/node/cli/display/hooks/useStatefulLog.d.ts +2 -1
  335. package/dist/node/cli/display/hooks/useStatefulLog.d.ts.map +1 -0
  336. package/dist/node/cli/display/tools/BlockList.d.ts +1 -0
  337. package/dist/node/cli/display/tools/BlockList.d.ts.map +1 -0
  338. package/dist/node/cli/display/tools/CreateBlock.d.ts +2 -1
  339. package/dist/node/cli/display/tools/CreateBlock.d.ts.map +1 -0
  340. package/dist/node/cli/display/tools/cli-tool-list.d.ts +1 -0
  341. package/dist/node/cli/display/tools/cli-tool-list.d.ts.map +1 -0
  342. package/dist/node/cli/display/tools/cli-tools.d.ts +2 -11
  343. package/dist/node/cli/display/tools/cli-tools.d.ts.map +1 -0
  344. package/dist/node/cli/display/tools/cli-tools.js +9 -9
  345. package/dist/node/cli/display/util/colors.d.ts +3 -2
  346. package/dist/node/cli/display/util/colors.d.ts.map +1 -0
  347. package/dist/node/cli/version.d.ts +2 -1
  348. package/dist/node/cli/version.d.ts.map +1 -0
  349. package/dist/node/cli/version.js +1 -1
  350. package/dist/node/compiler/build-vinxi.d.ts +9 -0
  351. package/dist/node/compiler/build-vinxi.d.ts.map +1 -0
  352. package/dist/node/compiler/build-vinxi.js +38 -0
  353. package/dist/node/compiler/bundler.admin.d.ts +3 -2
  354. package/dist/node/compiler/bundler.admin.d.ts.map +1 -0
  355. package/dist/node/compiler/bundler.admin.js +4 -4
  356. package/dist/node/compiler/bundler.frontend.d.ts +3 -1
  357. package/dist/node/compiler/bundler.frontend.d.ts.map +1 -0
  358. package/dist/node/compiler/bundler.frontend.js +29 -15
  359. package/dist/node/compiler/dev-server.d.ts +19 -0
  360. package/dist/node/compiler/dev-server.d.ts.map +1 -0
  361. package/dist/node/compiler/dev-server.js +113 -0
  362. package/dist/node/compiler/get-vite-config.d.ts +30 -0
  363. package/dist/node/compiler/get-vite-config.d.ts.map +1 -0
  364. package/dist/node/compiler/get-vite-config.js +332 -0
  365. package/dist/node/compiler/vinxi-app.d.ts +23 -0
  366. package/dist/node/compiler/vinxi-app.d.ts.map +1 -0
  367. package/dist/node/compiler/vinxi-app.js +230 -0
  368. package/dist/node/compiler/vinxi-codegen.d.ts +13 -0
  369. package/dist/node/compiler/vinxi-codegen.d.ts.map +1 -0
  370. package/dist/node/compiler/vinxi-codegen.js +731 -0
  371. package/dist/node/graphql/graphql-codegen.d.ts +13 -2
  372. package/dist/node/graphql/graphql-codegen.d.ts.map +1 -0
  373. package/dist/node/graphql/graphql-codegen.js +242 -40
  374. package/dist/node/graphql/graphql-schema-loader.d.ts +3 -1
  375. package/dist/node/graphql/graphql-schema-loader.d.ts.map +1 -0
  376. package/dist/node/graphql/graphql-schema-loader.js +5 -19
  377. package/dist/node/graphql/plugins/gql-plugin-files.d.ts +3 -1
  378. package/dist/node/graphql/plugins/gql-plugin-files.d.ts.map +1 -0
  379. package/dist/node/graphql/plugins/gql-plugin-files.js +3 -2
  380. package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts +1 -0
  381. package/dist/node/graphql/plugins/gql-plugin-no-duplicates.d.ts.map +1 -0
  382. package/dist/node/graphql/plugins/gql-plugin-queries.d.ts +1 -0
  383. package/dist/node/graphql/plugins/gql-plugin-queries.d.ts.map +1 -0
  384. package/dist/node/graphql/plugins/gql-plugin-queries.js +2 -2
  385. package/dist/node/graphql/query-files-loader.d.ts +4 -0
  386. package/dist/node/graphql/query-files-loader.d.ts.map +1 -0
  387. package/dist/node/graphql/query-files-loader.js +5 -0
  388. package/dist/node/graphql/wp-info-query.d.ts +1 -0
  389. package/dist/node/graphql/wp-info-query.d.ts.map +1 -0
  390. package/dist/node/project/config.d.ts +207 -73
  391. package/dist/node/project/config.d.ts.map +1 -0
  392. package/dist/node/project/config.js +95 -21
  393. package/dist/node/project/eddev-build-file.d.ts +1 -0
  394. package/dist/node/project/eddev-build-file.d.ts.map +1 -0
  395. package/dist/node/project/eddev-build-file.js +4 -2
  396. package/dist/node/project/env.d.ts +6 -1
  397. package/dist/node/project/env.d.ts.map +1 -0
  398. package/dist/node/project/env.js +2 -1
  399. package/dist/node/project/favicons.d.ts +1 -0
  400. package/dist/node/project/favicons.d.ts.map +1 -0
  401. package/dist/node/project/manifest/block-manifest.d.ts +1 -0
  402. package/dist/node/project/manifest/block-manifest.d.ts.map +1 -0
  403. package/dist/node/project/manifest/block-manifest.js +8 -4
  404. package/dist/node/project/manifest/field-manifest.d.ts +1 -0
  405. package/dist/node/project/manifest/field-manifest.d.ts.map +1 -0
  406. package/dist/node/project/manifest/manifest.d.ts +3 -1
  407. package/dist/node/project/manifest/manifest.d.ts.map +1 -0
  408. package/dist/node/project/manifest/manifest.js +15 -11
  409. package/dist/node/project/manifest/routes-manifest.d.ts +21 -0
  410. package/dist/node/project/manifest/routes-manifest.d.ts.map +1 -0
  411. package/dist/node/project/manifest/routes-manifest.js +74 -0
  412. package/dist/node/project/manifest/view-manifest.d.ts +1 -0
  413. package/dist/node/project/manifest/view-manifest.d.ts.map +1 -0
  414. package/dist/node/project/manifest/view-manifest.js +2 -2
  415. package/dist/node/project/manifest/widget-manifest.d.ts +1 -0
  416. package/dist/node/project/manifest/widget-manifest.d.ts.map +1 -0
  417. package/dist/node/project/project.d.ts +15 -2
  418. package/dist/node/project/project.d.ts.map +1 -0
  419. package/dist/node/project/project.js +73 -21
  420. package/dist/node/project/wp-info.d.ts +3 -0
  421. package/dist/node/project/wp-info.d.ts.map +1 -0
  422. package/dist/node/project/wp-info.js +13 -3
  423. package/dist/node/storybook/index.d.ts +3 -0
  424. package/dist/node/storybook/index.d.ts.map +1 -0
  425. package/dist/node/storybook/index.js +13 -0
  426. package/dist/node/types/block-type.d.ts +57 -25
  427. package/dist/node/types/block-type.d.ts.map +1 -0
  428. package/dist/node/types/block-type.js +4 -1
  429. package/dist/node/types/view-type.d.ts +8 -7
  430. package/dist/node/types/view-type.d.ts.map +1 -0
  431. package/dist/node/types/view-type.js +3 -4
  432. package/dist/node/utils/fetch-wp.d.ts +2 -0
  433. package/dist/node/utils/fetch-wp.d.ts.map +1 -0
  434. package/dist/node/utils/fetch-wp.js +28 -0
  435. package/dist/node/utils/{formatZodError.d.ts → format-zod-error.d.ts} +1 -0
  436. package/dist/node/utils/format-zod-error.d.ts.map +1 -0
  437. package/dist/node/utils/fs-codegen.d.ts +44 -0
  438. package/dist/node/utils/fs-codegen.d.ts.map +1 -0
  439. package/dist/node/utils/fs-codegen.js +105 -0
  440. package/dist/node/utils/fs.d.ts +5 -0
  441. package/dist/node/utils/fs.d.ts.map +1 -0
  442. package/dist/node/utils/fs.js +2 -0
  443. package/dist/node/utils/{getRepoInfo.d.ts → get-repo-info.d.ts} +1 -0
  444. package/dist/node/utils/get-repo-info.d.ts.map +1 -0
  445. package/dist/node/utils/helpers.d.ts +1 -0
  446. package/dist/node/utils/helpers.d.ts.map +1 -0
  447. package/dist/node/utils/{highlightCode.d.ts → highlight-code.d.ts} +1 -0
  448. package/dist/node/utils/highlight-code.d.ts.map +1 -0
  449. package/dist/node/utils/{isDeploying.d.ts → is-deploying.d.ts} +1 -0
  450. package/dist/node/utils/is-deploying.d.ts.map +1 -0
  451. package/dist/node/utils/{isDeploying.js → is-deploying.js} +1 -1
  452. package/dist/node/utils/report-builder.d.ts +7 -6
  453. package/dist/node/utils/report-builder.d.ts.map +1 -0
  454. package/dist/node/utils/self-signed-cert.d.ts +9 -0
  455. package/dist/node/utils/self-signed-cert.d.ts.map +1 -0
  456. package/dist/node/utils/{selfSignedCert.js → self-signed-cert.js} +29 -5
  457. package/dist/node/utils/{statefulLog.d.ts → stateful-log.d.ts} +1 -0
  458. package/dist/node/utils/stateful-log.d.ts.map +1 -0
  459. package/dist/node/utils/{statefulLog.js → stateful-log.js} +3 -1
  460. package/dist/node/utils/{export-extractor.d.ts → ts-export-extractor.d.ts} +1 -0
  461. package/dist/node/utils/ts-export-extractor.d.ts.map +1 -0
  462. package/dist/node/utils/watch-file-tree.d.ts +26 -0
  463. package/dist/node/utils/watch-file-tree.d.ts.map +1 -0
  464. package/dist/node/utils/{watchFileTree.js → watch-file-tree.js} +12 -5
  465. package/package.json +62 -47
  466. package/tsconfig.app.json +8 -3
  467. package/tsconfig.node.json +1 -0
  468. package/types.app.d.ts +4 -2
  469. package/types.app.internal.d.ts +2 -2
  470. package/types.meta.d.ts +449 -136
  471. package/types.node.d.ts +3 -3
  472. package/dist/app/entry/Root.d.ts +0 -1
  473. package/dist/app/entry/Root.js +0 -9
  474. package/dist/app/entry/main.admin.d.ts +0 -3
  475. package/dist/app/entry/main.admin.js +0 -10
  476. package/dist/app/entry/main.frontend.spa.d.ts +0 -3
  477. package/dist/app/entry/main.frontend.spa.js +0 -13
  478. package/dist/app/entry/main.frontend.ssr.d.ts +0 -21
  479. package/dist/app/entry/main.frontend.ssr.js +0 -79
  480. package/dist/app/entry/main.serverless.dev.d.ts +0 -4
  481. package/dist/app/entry/main.serverless.dev.js +0 -21
  482. package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +0 -15
  483. package/dist/app/lib/blocks/ErrorBoundaryFrontend.js +0 -35
  484. package/dist/app/lib/hooks/apiConfig.js +0 -4
  485. package/dist/app/lib/hooks/usePageLoad.d.ts +0 -6
  486. package/dist/app/lib/hooks/usePageLoad.js +0 -5
  487. package/dist/app/server/create-api-builtin-hono.d.ts +0 -8
  488. package/dist/app/server/create-api-builtin-hono.js +0 -80
  489. package/dist/app/server/create-ssr-hono.d.ts +0 -18
  490. package/dist/app/server/create-ssr-hono.js +0 -104
  491. package/dist/app/server/utils/index.html.d.ts +0 -2
  492. package/dist/app/server/utils/index.html.js +0 -14
  493. package/dist/node/compiler/index.html.d.ts +0 -2
  494. package/dist/node/compiler/index.html.js +0 -15
  495. package/dist/node/compiler/serverless.dev.d.ts +0 -16
  496. package/dist/node/compiler/serverless.dev.js +0 -215
  497. package/dist/node/compiler/vite/get-vite-config.d.ts +0 -13
  498. package/dist/node/compiler/vite/get-vite-config.js +0 -315
  499. package/dist/node/compiler/vite/plugin-admin.d.ts +0 -4
  500. package/dist/node/compiler/vite/plugin-admin.js +0 -67
  501. package/dist/node/compiler/vite/plugin-blocks.d.ts +0 -4
  502. package/dist/node/compiler/vite/plugin-blocks.js +0 -73
  503. package/dist/node/compiler/vite/plugin-entry.d.ts +0 -6
  504. package/dist/node/compiler/vite/plugin-entry.js +0 -16
  505. package/dist/node/compiler/vite/plugin-resolved-tailwind.d.ts +0 -4
  506. package/dist/node/compiler/vite/plugin-resolved-tailwind.js +0 -29
  507. package/dist/node/compiler/vite/plugin-theme.d.ts +0 -4
  508. package/dist/node/compiler/vite/plugin-theme.js +0 -40
  509. package/dist/node/compiler/vite/plugin-views.d.ts +0 -4
  510. package/dist/node/compiler/vite/plugin-views.js +0 -51
  511. package/dist/node/utils/console.d.ts +0 -21
  512. package/dist/node/utils/console.js +0 -28
  513. package/dist/node/utils/selfSignedCert.d.ts +0 -4
  514. package/dist/node/utils/unsafe-fetch.d.ts +0 -2
  515. package/dist/node/utils/unsafe-fetch.js +0 -19
  516. package/dist/node/utils/watchFileTree.d.ts +0 -11
  517. package/tsup.config.ts +0 -40
  518. package/types.manifests.d.ts +0 -22
  519. /package/dist/node/utils/{formatZodError.js → format-zod-error.js} +0 -0
  520. /package/dist/node/utils/{getRepoInfo.js → get-repo-info.js} +0 -0
  521. /package/dist/node/utils/{highlightCode.js → highlight-code.js} +0 -0
  522. /package/dist/node/utils/{export-extractor.js → ts-export-extractor.js} +0 -0
@@ -0,0 +1,332 @@
1
+ import * as t from "@babel/types";
2
+ import replace from "@rollup/plugin-replace";
3
+ import react from "@vitejs/plugin-react";
4
+ import { pascalCase } from "change-case-all";
5
+ import { withoutTrailingSlash } from "ufo";
6
+ import { createLogger } from "vite";
7
+ import tsconfigPaths from "vite-tsconfig-paths";
8
+ import { cliMode } from "../cli/cli-mode.js";
9
+ export function envPlugin(args) {
10
+ const envDefines = {
11
+ client: args.client ? "true" : "false",
12
+ serverless: args.serverless ? "true" : "false",
13
+ dev: args.mode === "development" ? "true" : "false",
14
+ admin: args.target === "cms" ? "true" : "false",
15
+ themePath: JSON.stringify(args.publicUrl),
16
+ devUI: args.mode === "development" ? "true" : "false",
17
+ serverlessOrigin: JSON.stringify("http://serverleress-endpoint"),
18
+ rpcEnabled: "true",
19
+ origin: JSON.stringify(process.env.SITE_URL ?? "/"),
20
+ };
21
+ const expandDefines = (obj, prefixes = []) => {
22
+ const result = {};
23
+ for (const prefix of prefixes) {
24
+ for (const [key, value] of Object.entries(obj)) {
25
+ result[prefix + key] = value;
26
+ }
27
+ }
28
+ return result;
29
+ };
30
+ const envVariables = {};
31
+ for (let key in process.env) {
32
+ if (key.startsWith("ED_PUBLIC_")) {
33
+ // Include all ED_PUBLIC_ variables
34
+ envVariables[key] = JSON.stringify(process.env[key]);
35
+ }
36
+ else if (key.startsWith("ED_")) {
37
+ if (!args.client) {
38
+ // Only include ED_ variables in non-client bundles
39
+ envVariables[key] = JSON.stringify(process.env[key]);
40
+ }
41
+ }
42
+ }
43
+ // console.log("Envs are", envVariables)
44
+ // const envFile = configDotenv()
45
+ // if (envFile.parsed) {
46
+ // }
47
+ return replace({
48
+ values: {
49
+ ...expandDefines(envDefines, ["process.env.", "process.", "env."]),
50
+ ...expandDefines(envVariables, ["process.env.", "import.meta.env."]),
51
+ "process.env.SITE_API_KEY": JSON.stringify(process.env.SITE_API_KEY),
52
+ },
53
+ preventAssignment: true,
54
+ });
55
+ }
56
+ export function reactPlugin(args = {}) {
57
+ let currentFile = null;
58
+ return react({
59
+ babel: {
60
+ overrides: [{ test: /types\./, compact: true }],
61
+ plugins: [
62
+ {
63
+ visitor: {
64
+ Program: {
65
+ enter: (path, state) => {
66
+ const filename = state.file.opts.filename;
67
+ if (filename.match(/.\/blocks\/.+\.tsx/)) {
68
+ currentFile = { type: "block", id: filename.replace(/.*\/blocks\/(.+)\.tsx/, "$1") };
69
+ }
70
+ else if (filename.match(/.\/views\/.+\.tsx/)) {
71
+ currentFile = { type: "view", id: filename.replace(/.*\/views\/(.+)\.tsx/, "$1") };
72
+ }
73
+ else {
74
+ currentFile = null;
75
+ }
76
+ },
77
+ exit: (path, state) => {
78
+ currentFile = null;
79
+ // console.log("Exiting", state.file.opts.filename)
80
+ },
81
+ },
82
+ ExportNamedDeclaration: (path, state) => {
83
+ if (!currentFile)
84
+ return;
85
+ const decl = path.node.declaration;
86
+ if (decl?.type !== "VariableDeclaration")
87
+ return;
88
+ const id = decl.declarations[0].id;
89
+ if (!t.isIdentifier(id))
90
+ return;
91
+ if (id.name === "meta") {
92
+ if (args.retainBlockMeta && currentFile?.type === "block") {
93
+ // Adds a defineBlock.meta("name", meta) call, which can be used by the editor
94
+ path.replaceWith(t.callExpression(t.memberExpression(t.identifier("defineBlock"), t.identifier("meta")), [
95
+ t.stringLiteral(currentFile.id),
96
+ decl.declarations[0].init,
97
+ ]));
98
+ }
99
+ else {
100
+ path.remove();
101
+ }
102
+ }
103
+ },
104
+ ExportDefaultDeclaration: (path) => {
105
+ if (!currentFile)
106
+ return;
107
+ if (path.node.declaration.type === "CallExpression") {
108
+ const call = path.node.declaration;
109
+ if (call.callee.type === "Identifier" && ["defineBlock", "defineView"].includes(call.callee.name)) {
110
+ const type = call.callee.name.replace("define", "");
111
+ const args = call.arguments;
112
+ if (args.length === 2 &&
113
+ args[0].type === "StringLiteral" &&
114
+ args[1].type === "ArrowFunctionExpression") {
115
+ const name = args[0].value;
116
+ let body = args[1].body;
117
+ if (t.isExpression(body)) {
118
+ body = t.blockStatement([t.returnStatement(body)]);
119
+ }
120
+ const componentName = pascalCase(type) + "_" + name.replace(/[^a-z0-9]/g, "_").replace(/_+/g, "_");
121
+ path.replaceWithMultiple([
122
+ t.exportDefaultDeclaration(t.functionDeclaration(t.identifier(componentName), args[1].params, body, args[1].generator, args[1].async)),
123
+ t.expressionStatement(t.assignmentExpression("=", t.memberExpression(t.identifier(componentName), t.identifier("displayName")), t.stringLiteral(pascalCase(type) + "(" + name + ")"))),
124
+ ]);
125
+ }
126
+ }
127
+ }
128
+ },
129
+ },
130
+ },
131
+ ],
132
+ },
133
+ });
134
+ }
135
+ /**
136
+ * Turns on SSR module proxying,
137
+ */
138
+ export function ssrPlugin() {
139
+ return {
140
+ name: "proxy-external-ssr-modules",
141
+ config(config) {
142
+ config.legacy = {
143
+ ...config.legacy,
144
+ proxySsrExternalModules: true,
145
+ // @ts-ignore
146
+ skipWebSocketTokenCheck: true,
147
+ };
148
+ config.ssr = {
149
+ ...config.ssr,
150
+ noExternal: [
151
+ "eddev",
152
+ "vinxi",
153
+ "react-use",
154
+ // @ts-ignore
155
+ ...(config?.optimizeDeps?.noExternal ?? []),
156
+ ],
157
+ optimizeDeps: {
158
+ exclude: ["eddev", "vinxi"],
159
+ },
160
+ };
161
+ config.optimizeDeps = {
162
+ ...config.optimizeDeps,
163
+ include: [
164
+ "valtio",
165
+ "@tanstack/react-query",
166
+ "qs",
167
+ "react",
168
+ "react-dom/client",
169
+ ...(config?.optimizeDeps?.include ?? []),
170
+ ],
171
+ exclude: ["eddev", "vinxi", ...(config?.optimizeDeps?.exclude ?? [])],
172
+ };
173
+ config.server = {
174
+ ...config.server,
175
+ allowedHosts: true,
176
+ cors: true,
177
+ };
178
+ return config;
179
+ },
180
+ };
181
+ }
182
+ function buildStatusPlugin(console) {
183
+ let timer = 0;
184
+ return {
185
+ name: "eddev:logging",
186
+ enforce: "post",
187
+ watchChange() {
188
+ console.resetLog();
189
+ clearTimeout(timer);
190
+ },
191
+ buildStart() {
192
+ clearTimeout(timer);
193
+ console.setWorking(true);
194
+ },
195
+ buildEnd() {
196
+ clearTimeout(timer);
197
+ timer = setTimeout(() => {
198
+ console.setWorking(false);
199
+ }, 0);
200
+ },
201
+ };
202
+ }
203
+ export function corePlugins(args) {
204
+ return [
205
+ args.serverless && ssrPlugin(),
206
+ envPlugin(args),
207
+ tsconfigPaths(),
208
+ reactPlugin({ retainBlockMeta: args.target === "cms" }),
209
+ ignoreRollupErrorsPlugin(),
210
+ args.console && loggerPlugin({ console: args.console }),
211
+ ].flat();
212
+ }
213
+ export function storybookVitePlugins(args) {
214
+ return [args.serverless && ssrPlugin(), envPlugin(args), tsconfigPaths()].flat();
215
+ }
216
+ export function ignoreRollupErrorsPlugin() {
217
+ return {
218
+ name: "ignore-rollup-errors",
219
+ config(config) {
220
+ const onWarn = config.build?.rollupOptions?.onwarn;
221
+ return {
222
+ build: {
223
+ rollupOptions: {
224
+ onwarn(warning, warn) {
225
+ if (!cliMode.verbose &&
226
+ warning.code &&
227
+ ["SOURCEMAP_ERROR", "UNUSED_EXTERNAL_IMPORT", "INVALID_ANNOTATION", "EVAL"].includes(warning.code)) {
228
+ return;
229
+ }
230
+ if (warning.code) {
231
+ warning.message = warning.code + ": " + warning.message;
232
+ }
233
+ if (onWarn) {
234
+ onWarn(warning, warn);
235
+ }
236
+ else {
237
+ warn(warning);
238
+ }
239
+ },
240
+ },
241
+ },
242
+ };
243
+ },
244
+ };
245
+ }
246
+ export function loggerPlugin(args) {
247
+ return {
248
+ name: "eddev:logger",
249
+ config() {
250
+ const logger = createLogger();
251
+ logger.info = (msg) => {
252
+ if (msg.includes("hmr update"))
253
+ args.console.resetLog();
254
+ args.console.info(msg.replace(/\n/, ""));
255
+ };
256
+ logger.warn = (msg) => {
257
+ if (typeof msg === "string" && msg.includes("auto-determine entry point"))
258
+ return;
259
+ if (typeof msg === "string" && msg.includes("Error when using sourcemap for reporting"))
260
+ return;
261
+ return args.console.warn(msg.replace(/\n/, ""));
262
+ };
263
+ logger.error = (msg) => {
264
+ args.console.fail(msg.replace(/\n/, ""));
265
+ };
266
+ logger.warnOnce = (msg) => {
267
+ args.console.warn(msg.replace(/\n/, ""));
268
+ };
269
+ logger.clearScreen = () => {
270
+ args.console.resetLog();
271
+ };
272
+ return {
273
+ customLogger: logger,
274
+ };
275
+ },
276
+ };
277
+ }
278
+ export function getViteConfig(args) {
279
+ const console = args.console;
280
+ const entryFile = `./.eddev/${args.mode === "production" ? "prod" : "dev"}-spa/entry.${args.target === "cms" ? "admin" : "client"}.tsx`;
281
+ /** Initial config */
282
+ const config = {
283
+ appType: "custom",
284
+ mode: args.mode,
285
+ root: args.rootDir,
286
+ logLevel: cliMode.verbose ? "info" : "warn",
287
+ base: withoutTrailingSlash(args.publicUrl) + "/dist/" + args.target,
288
+ define: {
289
+ "process.env.NODE_ENV": JSON.stringify(args.mode),
290
+ },
291
+ plugins: [
292
+ tsconfigPaths(),
293
+ envPlugin(args),
294
+ reactPlugin({
295
+ retainBlockMeta: args.target === "cms",
296
+ }),
297
+ buildStatusPlugin(console),
298
+ ignoreRollupErrorsPlugin(),
299
+ loggerPlugin({ console }),
300
+ ],
301
+ build: {
302
+ manifest: true,
303
+ sourcemap: true,
304
+ minify: args.target === "cms" ? false : args.mode === "production",
305
+ modulePreload: false,
306
+ outDir: args.outDir,
307
+ lib: args.target === "cms"
308
+ ? {
309
+ entry: [entryFile],
310
+ fileName: (format, entryName) => `${entryName}.${format}.js`,
311
+ name: "eddev",
312
+ formats: ["iife"],
313
+ }
314
+ : undefined,
315
+ rollupOptions: {
316
+ input: args.target === "frontend" ? entryFile : undefined,
317
+ external: args.target === "cms" ? ["react", "react-dom"] : [],
318
+ output: args.target === "cms"
319
+ ? {
320
+ // entryFileNames: "main.admin.js",
321
+ // format: "iife",
322
+ globals: {
323
+ react: "window.React",
324
+ "react-dom": "window.ReactDOM",
325
+ },
326
+ }
327
+ : undefined,
328
+ },
329
+ },
330
+ };
331
+ return config;
332
+ }
@@ -0,0 +1,23 @@
1
+ import { StatefulLog } from "../utils/stateful-log.js";
2
+ import { EDConfig } from "../project/config.js";
3
+ export type AppArgs = {
4
+ mode: "development" | "production";
5
+ publicUrl: string;
6
+ rootDir: string;
7
+ origin: string;
8
+ log?: StatefulLog<any>;
9
+ preset?: string;
10
+ routes?: CustomRoute[];
11
+ rpcBases?: string[];
12
+ config: EDConfig;
13
+ };
14
+ type HTTPMethod = "GET" | "POST" | "PUT" | "OPTIONS" | "HEAD";
15
+ type CustomRouteFunction = (req: Request) => Response;
16
+ type CustomRouteModule = Record<HTTPMethod, CustomRouteFunction>;
17
+ type CustomRoute = {
18
+ pattern: string;
19
+ handler: () => Promise<CustomRouteModule>;
20
+ };
21
+ export declare function createVinxiApp(args: AppArgs): import("vinxi").App;
22
+ export {};
23
+ //# sourceMappingURL=vinxi-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vinxi-app.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-app.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAGtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,MAAM,MAAM,OAAO,GAAG;IACpB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;IAClC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,CAAA;IACtB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,WAAW,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,MAAM,EAAE,QAAQ,CAAA;CACjB,CAAA;AAED,KAAK,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAA;AAC7D,KAAK,mBAAmB,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,QAAQ,CAAA;AACrD,KAAK,iBAAiB,GAAG,MAAM,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAA;AAEhE,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,OAAO,CAAC,iBAAiB,CAAC,CAAA;CAC1C,CAAA;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,uBAiO3C"}
@@ -0,0 +1,230 @@
1
+ import { joinURL } from "ufo";
2
+ import { createApp } from "vinxi";
3
+ import tsconfigPaths from "vite-tsconfig-paths";
4
+ import { StatefulLog } from "../utils/stateful-log.js";
5
+ import { corePlugins, envPlugin } from "./get-vite-config.js";
6
+ import { getVinxiFolder } from "./vinxi-codegen.js";
7
+ export function createVinxiApp(args) {
8
+ const log = args.log ?? new StatefulLog({ label: "Build" });
9
+ const folder = "./.eddev/" +
10
+ getVinxiFolder({
11
+ mode: args.mode,
12
+ serverless: true,
13
+ });
14
+ return createApp({
15
+ server: {
16
+ // experimental: {
17
+ // websocket: true,
18
+ // },
19
+ compatibilityDate: "2025-01-01",
20
+ preset: args.preset,
21
+ routeRules: {
22
+ "/wp-content/uploads/**": {
23
+ proxy: joinURL(args.origin, "wp-content/uploads/**"),
24
+ static: true,
25
+ cache: {
26
+ maxAge: 86400,
27
+ varies: [],
28
+ },
29
+ },
30
+ "/favicon.ico": {
31
+ proxy: joinURL(args.origin, "favicon.ico"),
32
+ static: true,
33
+ cache: {
34
+ maxAge: 3600,
35
+ varies: [],
36
+ },
37
+ },
38
+ "/robots.txt": {
39
+ cache: {
40
+ maxAge: 3600,
41
+ varies: [],
42
+ },
43
+ },
44
+ "/sitemap.xml": {
45
+ cache: {
46
+ maxAge: 3600,
47
+ swr: true,
48
+ },
49
+ },
50
+ "/sitemap*.xml": {
51
+ cache: {
52
+ maxAge: 3600,
53
+ swr: true,
54
+ },
55
+ },
56
+ "/wp-content/plugins/**": {
57
+ proxy: joinURL(args.origin, "wp-content/plugins/**"),
58
+ headers: {
59
+ "Cache-Control": "max-age=86400",
60
+ "CDN-Cache-Control": "max-age=86400",
61
+ "Vercel-CDN-Cache-Control": "max-age=86400",
62
+ },
63
+ },
64
+ "/wp-content/**": { proxy: joinURL(args.origin, "wp-content/**") },
65
+ "/wp-includes/**": { proxy: joinURL(args.origin, "wp-includes/**") },
66
+ "/_data/route/**": {
67
+ isr: 300,
68
+ swr: true,
69
+ cache: {
70
+ maxAge: 300,
71
+ swr: true,
72
+ varies: ["Authorization", "woocommerce-session"],
73
+ },
74
+ },
75
+ "/_data/query/**": {
76
+ isr: 300,
77
+ swr: true,
78
+ cache: {
79
+ maxAge: 300,
80
+ varies: ["Authorization", "woocommerce-session"],
81
+ },
82
+ },
83
+ ...args.rpcBases?.reduce((acc, base) => {
84
+ return {
85
+ ...acc,
86
+ ["/" + base.replace(/(^\/|\/$)/g, "") + "/**/*"]: {
87
+ isr: false,
88
+ swr: false,
89
+ },
90
+ };
91
+ }, {}),
92
+ "/**/*": {
93
+ isr: 300,
94
+ swr: true,
95
+ cache: {
96
+ maxAge: 300,
97
+ swr: true,
98
+ staleMaxAge: 3600,
99
+ },
100
+ },
101
+ },
102
+ vercel: {
103
+ config: {
104
+ bypassToken: process.env.VERCEL_BYPASS_TOKEN,
105
+ },
106
+ },
107
+ },
108
+ routers: [
109
+ ...args.config.serverless.themeAssets.map((folder) => {
110
+ const folderName = folder
111
+ .split("/")
112
+ .filter((p) => !p.includes("*") && p !== ".")
113
+ .join("/");
114
+ return {
115
+ name: "public_" + folderName,
116
+ type: "static",
117
+ dir: args.rootDir + "/" + folderName,
118
+ base: joinURL(args.publicUrl, folderName),
119
+ };
120
+ }),
121
+ {
122
+ name: "bypass-api",
123
+ type: "http",
124
+ base: "/_bypass",
125
+ handler: `${folder}/handler.bypass.ts`,
126
+ target: "server",
127
+ plugins: () => [
128
+ tsconfigPaths(),
129
+ envPlugin({
130
+ rootDir: args.rootDir,
131
+ console: log,
132
+ mode: args.mode,
133
+ publicUrl: args.publicUrl,
134
+ serverless: true,
135
+ target: "frontend",
136
+ client: false,
137
+ }),
138
+ ],
139
+ },
140
+ // {
141
+ // name: "wp-proxy",
142
+ // type: "http",
143
+ // base: "/wp-",
144
+ // handler: `${folder}/handler.wp-proxy.ts`,
145
+ // target: "server",
146
+ // plugins: () => [
147
+ // ...corePlugins({
148
+ // rootDir: args.rootDir,
149
+ // console: log,
150
+ // mode: args.mode,
151
+ // publicUrl: args.publicUrl,
152
+ // serverless: true,
153
+ // target: "frontend",
154
+ // }),
155
+ // ],
156
+ // },
157
+ {
158
+ name: "client",
159
+ type: "client",
160
+ handler: `${folder}/entry.client.tsx`,
161
+ target: "browser",
162
+ plugins: () => [
163
+ ...corePlugins({
164
+ rootDir: args.rootDir,
165
+ console: log,
166
+ mode: args.mode,
167
+ publicUrl: args.publicUrl,
168
+ serverless: true,
169
+ target: "frontend",
170
+ client: true,
171
+ }),
172
+ ],
173
+ base: "/_build",
174
+ },
175
+ {
176
+ name: "admin",
177
+ type: "client",
178
+ handler: `${folder}/entry.admin.tsx`,
179
+ target: "browser",
180
+ plugins: () => [
181
+ ...corePlugins({
182
+ rootDir: args.rootDir,
183
+ console: log,
184
+ mode: args.mode,
185
+ publicUrl: args.publicUrl,
186
+ serverless: true,
187
+ target: "cms",
188
+ client: true,
189
+ }),
190
+ ],
191
+ base: "/_admin",
192
+ },
193
+ // ...((args.rpcBases ?? []).map((base) => ({
194
+ // name: "trpc" + base.replace(/^\//, "-"),
195
+ // type: "http",
196
+ // base: "/" + base.replace(/^\//, ""),
197
+ // handler: `${folder}/handler.trpc-api.ts`,
198
+ // target: "server",
199
+ // plugins: () => [
200
+ // tsconfigPaths(),
201
+ // envPlugin({
202
+ // rootDir: args.rootDir,
203
+ // console: log,
204
+ // mode: args.mode,
205
+ // publicUrl: args.publicUrl,
206
+ // serverless: true,
207
+ // target: "frontend",
208
+ // }),
209
+ // ],
210
+ // })) as RouterSchemaInput[]),
211
+ {
212
+ name: "ssr",
213
+ type: "http",
214
+ handler: `${folder}/handler.ssr-page.ts`,
215
+ target: "server",
216
+ plugins: () => [
217
+ ...corePlugins({
218
+ rootDir: args.rootDir,
219
+ console: log,
220
+ mode: args.mode,
221
+ publicUrl: args.publicUrl,
222
+ serverless: true,
223
+ target: "frontend",
224
+ client: false,
225
+ }),
226
+ ],
227
+ },
228
+ ],
229
+ });
230
+ }
@@ -0,0 +1,13 @@
1
+ import { Project } from "../project/project.js";
2
+ import { FSCodegen } from "../utils/fs-codegen.js";
3
+ type Options = {
4
+ mode: "development" | "production";
5
+ serverless: boolean;
6
+ project: Project;
7
+ endpoint?: string;
8
+ };
9
+ export declare function getVinxiFolder(opts: Pick<Options, "mode" | "serverless">): string;
10
+ export declare function runVinxiCodegen(opts: Options): Promise<void>;
11
+ export declare function createVinxiCodegen(opts: Options): FSCodegen;
12
+ export {};
13
+ //# sourceMappingURL=vinxi-codegen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vinxi-codegen.d.ts","sourceRoot":"","sources":["../../../src/node/compiler/vinxi-codegen.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAIlD,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,aAAa,GAAG,YAAY,CAAA;IAClC,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAAC,UAExE;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,OAAO,iBAIlD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,aAkuB/C"}