eddev 2.0.0-beta.22 → 2.0.0-beta.24

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 (37) hide show
  1. package/dist/app/entry/MetaTags.d.ts +6 -0
  2. package/dist/app/entry/MetaTags.js +17 -0
  3. package/dist/app/entry/ssr-root-client.d.ts +3 -1
  4. package/dist/app/entry/ssr-root-client.js +10 -3
  5. package/dist/app/entry/ssr-root.d.ts +4 -3
  6. package/dist/app/entry/ssr-root.js +18 -15
  7. package/dist/app/lib/blocks/ErrorBoundaryFrontend.d.ts +1 -1
  8. package/dist/app/lib/blocks/editor/ErrorBoundaryEditor.d.ts +1 -1
  9. package/dist/app/lib/devtools/hooks/useTailwind.d.ts +32 -32
  10. package/dist/app/lib/legacy-stitches/createStitches.d.ts +509 -1
  11. package/dist/app/lib/routing/components/BrowserRouter.d.ts +4 -1
  12. package/dist/app/lib/routing/components/BrowserRouter.js +10 -2
  13. package/dist/app/lib/routing/components/ClientOnly.d.ts +1 -1
  14. package/dist/app/lib/routing/components/RouteRenderer.js +2 -2
  15. package/dist/app/lib/routing/components/SSRRouter.js +1 -2
  16. package/dist/app/lib/routing/context.js +1 -95
  17. package/dist/app/lib/routing/hooks/useRouteMeta.d.ts +5 -0
  18. package/dist/app/lib/routing/hooks/useRouteMeta.js +9 -0
  19. package/dist/app/lib/routing/types.d.ts +12 -5
  20. package/dist/app/lib/routing/utils.d.ts +2 -1
  21. package/dist/app/lib/routing/utils.js +5 -0
  22. package/dist/app/server/proxy-wp-admin.js +1 -1
  23. package/dist/app/server/render-ssr-page.js +11 -3
  24. package/dist/app/server/server-context.d.ts +8 -2
  25. package/dist/app/server/server-context.js +20 -3
  26. package/dist/node/cli/cli.js +2 -1
  27. package/dist/node/cli/version.d.ts +1 -1
  28. package/dist/node/cli/version.js +1 -1
  29. package/dist/node/compiler/vinxi-app.d.ts +9 -0
  30. package/dist/node/compiler/vinxi-app.js +19 -1
  31. package/dist/node/compiler/vinxi-codegen.js +76 -35
  32. package/dist/node/project/favicons.d.ts +0 -1
  33. package/dist/node/project/favicons.js +1 -1
  34. package/dist/node/types/block-type.d.ts +2 -2
  35. package/package.json +4 -3
  36. package/tsconfig.app.json +2 -2
  37. package/tsconfig.node.json +2 -2
@@ -12,6 +12,7 @@ const NOOP_ROUTE = {
12
12
  search: "",
13
13
  query: {},
14
14
  returnState: undefined,
15
+ meta: {},
15
16
  };
16
17
  export const RouterContext = createContext({
17
18
  loader: new RouteLoader(),
@@ -32,98 +33,3 @@ export const RouterStateContext = createContext({
32
33
  blockers: [],
33
34
  });
34
35
  export const RouteItemContext = createContext(NOOP_ROUTE);
35
- // type StoreHook<State> = <Slice = State>(
36
- // selector?: (state: State) => Slice,
37
- // areEqual?: (a: Slice, b: Slice) => boolean,
38
- // ) => Slice
39
- // type Store<T> = {
40
- // subscribe(sub: (value: T) => void): () => void
41
- // value: T
42
- // update(next: T): void
43
- // }
44
- // function createStore<T>(initial: T): Store<T> {
45
- // let value = initial
46
- // const subscribers = new Set<(value: T) => void>()
47
- // return {
48
- // subscribe(sub: (value: T) => void) {
49
- // subscribers.add(sub)
50
- // return () => {
51
- // subscribers.delete(sub)
52
- // }
53
- // },
54
- // get value() {
55
- // return value
56
- // },
57
- // update(nextValue: T) {
58
- // value = nextValue
59
- // if (subscribers.size) {
60
- // console.log("UPDATE", value)
61
- // startTransition(() => {
62
- // for (let sub of subscribers) {
63
- // sub(value)
64
- // }
65
- // })
66
- // }
67
- // },
68
- // }
69
- // }
70
- // export function createStoreHook<T>(store: Store<T>): StoreHook<T> {
71
- // const hook = (selector: any) => {
72
- // const get = () => (selector ? selector(store.value) : store.value)
73
- // return useSyncExternalStore(store.subscribe, get, get)
74
- // }
75
- // return hook as StoreHook<T>
76
- // }
77
- // export function createStoreContextHook<T>(ctx: Context<Store<T>>): StoreHook<T> {
78
- // const hook = (selector: any) => {
79
- // const store = useContext(ctx)
80
- // const get = () => (selector ? selector(store.value) : store.value)
81
- // return useSyncExternalStore(store.subscribe, get, get)
82
- // }
83
- // return hook as StoreHook<T>
84
- // }
85
- // export const RouterContext = createContext<Store<RouterAPI>>(null!)
86
- // export const RouterStateContext = createContext<Store<RouterAPIState>>(null!)
87
- // export const RouteContext = createContext<Store<RouteState>>(null!)
88
- // const NOOP_ROUTE: RouteState = {
89
- // component: () => null,
90
- // id: "initial",
91
- // hash: "",
92
- // key: "initial",
93
- // pathname: "",
94
- // props: {},
95
- // uri: "",
96
- // view: "_unknown",
97
- // search: "",
98
- // query: {},
99
- // returnState: undefined,
100
- // }
101
- // export const createRouteItemStore = (initial?: RouteState) => {
102
- // return createStore<RouteState>(initial ?? NOOP_ROUTE)
103
- // }
104
- // export function createRouterAPIStore(initial?: RouterAPI) {
105
- // return createStore<RouterAPI>(
106
- // initial ?? {
107
- // loader: new RouteLoader(),
108
- // async navigate(url) {},
109
- // async prefetch(url) {},
110
- // async preload(url) {},
111
- // subscribe(fn) {
112
- // return () => {}
113
- // },
114
- // replaceHash(hash) {},
115
- // replaceQuery(query) {},
116
- // handleClickEvent(e, originalHref) {},
117
- // emitEvent(event) {},
118
- // },
119
- // )
120
- // }
121
- // export function createRouterStateStore(initial?: RouterAPIState) {
122
- // return createStore<RouterAPIState>(
123
- // initial ?? {
124
- // history: [],
125
- // activeRoute: NOOP_ROUTE,
126
- // blockers: [],
127
- // },
128
- // )
129
- // }
@@ -0,0 +1,5 @@
1
+ import { RouteMeta } from "../types";
2
+ export declare const $routeMetaStore: {
3
+ data: RouteMeta;
4
+ };
5
+ export declare function useRouteMeta(): RouteMeta;
@@ -0,0 +1,9 @@
1
+ import { proxy, useSnapshot } from "valtio";
2
+ export const $routeMetaStore = proxy({
3
+ data: {},
4
+ });
5
+ export function useRouteMeta() {
6
+ return useSnapshot($routeMetaStore, {
7
+ sync: true,
8
+ }).data;
9
+ }
@@ -1,9 +1,11 @@
1
1
  import { FunctionComponent } from "react";
2
2
  import type { RouteLoader } from "./loader.js";
3
3
  import { LinkHandlerMode, PointerOrMouseEvent } from "./utils.js";
4
- export type ParsedRouteTags = Record<"title" | "meta" | "script" | "style" | "link", {
5
- [key: string]: string;
6
- }[]>;
4
+ export type RouteMetaTag = {
5
+ tagName: string;
6
+ attributes: Record<string, string>;
7
+ inner?: string;
8
+ };
7
9
  export interface RouteData {
8
10
  view: string;
9
11
  editLink?: string;
@@ -13,8 +15,8 @@ export interface RouteData {
13
15
  redirect?: string;
14
16
  canonical?: string;
15
17
  meta?: {
16
- head: ParsedRouteTags;
17
- footer: ParsedRouteTags;
18
+ head: RouteMetaTag[];
19
+ footer: RouteMetaTag[];
18
20
  };
19
21
  }
20
22
  export type RouteReturnState<T = {}> = {
@@ -131,6 +133,11 @@ export type TypedRouteState<T, TProps> = {
131
133
  component: FunctionComponent<TProps>;
132
134
  /** The props for this route, to be passed to the component. */
133
135
  props: TProps;
136
+ /** Loaded metadata for this route */
137
+ meta: RouteMeta;
138
+ };
139
+ export type RouteMeta = {
140
+ tags?: RouteMetaTag[];
134
141
  };
135
142
  export type RouteState = {
136
143
  [K in keyof ViewProps]: TypedRouteState<K, ViewProps[K]>;
@@ -1,5 +1,5 @@
1
1
  import { MouseEvent as ReactMouseEvent, PointerEvent as ReactPointerEvent } from "react";
2
- import { RouteLink, RouteState } from "./types.js";
2
+ import { RouteData, RouteLink, RouteMeta, RouteState } from "./types.js";
3
3
  export declare function isSameOrigin(url: string): boolean;
4
4
  export type PointerOrMouseEvent = MouseEvent | PointerEvent | ReactMouseEvent | ReactPointerEvent;
5
5
  export type LinkHandlerMode = {
@@ -12,4 +12,5 @@ export declare function normalizeRoute(route: Partialize<RouteState, "uri" | "re
12
12
  export declare function stringifyRouteLink(route: RouteLink): string;
13
13
  export declare function parseQuery(query: string): Record<string, string | string[]>;
14
14
  export declare function stringifyQuery(query: any): string;
15
+ export declare function getRouteMeta(data: RouteData): RouteMeta;
15
16
  export {};
@@ -92,3 +92,8 @@ export function stringifyQuery(query) {
92
92
  arrayFormat: "brackets",
93
93
  });
94
94
  }
95
+ export function getRouteMeta(data) {
96
+ return {
97
+ tags: data.meta?.head ?? [],
98
+ };
99
+ }
@@ -50,7 +50,7 @@ export async function proxyWpAdmin(event, serverContext) {
50
50
  }
51
51
  // If the content type is text/html, inject the Vite assets into the response — assuming the placeholder comments are found
52
52
  if (contentType.startsWith("text/html")) {
53
- const clientManifest = serverContext.getManifest("admin");
53
+ const clientManifest = serverContext.runtime.getManifest("admin");
54
54
  const assets = await clientManifest.inputs[clientManifest.handler].assets();
55
55
  body = body.replace("<!---VITE_HEADER--->", () => assets.map((asset) => renderAsset(asset)).join("\n"));
56
56
  body = body.replace("<!---VITE_FOOTER--->", () => renderAsset({
@@ -5,14 +5,22 @@ import { renderToPipeableStream } from "react-dom/server";
5
5
  import { SSRRoot } from "../entry/ssr-root.js";
6
6
  import { RouteLoader } from "../lib/routing/loader.js";
7
7
  export async function renderPageToSSRStream(pathname, initialData, serverContext) {
8
- const clientManifest = serverContext.getManifest("client");
8
+ const clientManifest = serverContext.runtime.getManifest("client");
9
9
  const assets = await clientManifest.inputs[clientManifest.handler].assets();
10
- const jsx = (_jsx(SSRRoot, { assets: _jsx(Suspense, { children: assets.map((m) => renderAsset(m)) }), pathname: pathname, initialData: initialData, loader: new RouteLoader() }));
11
- const stream = await new Promise(async (resolve) => {
10
+ const jsx = (_jsx(SSRRoot, { assets: _jsx(Suspense, { children: assets.map((m) => renderAsset(m)) }), metaTags: initialData?.meta?.head || [], pathname: pathname, initialData: initialData, loader: new RouteLoader() }));
11
+ const stream = await new Promise(async (resolve, reject) => {
12
12
  const stream = renderToPipeableStream(jsx, {
13
13
  onShellReady() {
14
14
  resolve(stream);
15
15
  },
16
+ onShellError(err) {
17
+ console.log("onShellError", err);
18
+ resolve("An error occurred");
19
+ },
20
+ onError(err, errInfo) {
21
+ console.log("Error occurred after shell ready", err, errInfo);
22
+ console.error(err);
23
+ },
16
24
  bootstrapModules: [clientManifest.inputs[clientManifest.handler].output.path],
17
25
  bootstrapScriptContent: `window.manifest = ${JSON.stringify(await clientManifest.json())}; window._PAGE_DATA = ${JSON.stringify(initialData)}`,
18
26
  });
@@ -4,15 +4,18 @@ import { Manifest } from "vinxi/dist/types/types/manifest";
4
4
  export type ServerContextArgs = {
5
5
  dev: boolean;
6
6
  origin: string;
7
- getManifest: (name: string) => Manifest;
8
7
  replaceUrls?: UrlReplacerConf;
9
8
  };
9
+ export type ServerContextRuntime = {
10
+ getManifest: (name: string) => Manifest;
11
+ };
10
12
  export declare class ServerContext {
11
13
  dev: boolean;
12
14
  origin: string;
13
- getManifest: (name: string) => Manifest;
14
15
  replaceUrls?: (text: string) => string;
15
16
  constructor(conf: ServerContextArgs);
17
+ get runtime(): ServerContextRuntime;
18
+ static setRuntime(rt: ServerContextRuntime): void;
16
19
  getOriginUrl(url: string): string;
17
20
  fetchOrigin(url: string, opts?: RequestInit & {
18
21
  replaceUrls?: boolean;
@@ -23,6 +26,9 @@ export declare class ServerContext {
23
26
  headers?: RequestHeaders;
24
27
  withAppData?: boolean;
25
28
  }): Promise<Response>;
29
+ fetchAppData(req?: {
30
+ headers?: RequestHeaders;
31
+ }): Promise<any>;
26
32
  extractRequestHeaders(req?: RequestHeaders): Partial<Record<import("vinxi/http").HTTPHeaderName, string | undefined>>;
27
33
  fetchNamedQuery(req: {
28
34
  name: string;
@@ -12,19 +12,24 @@ const PROXY_REQUEST_HEADERS = [
12
12
  "user-agent",
13
13
  "authorization",
14
14
  ];
15
+ let runtime;
15
16
  export class ServerContext {
16
17
  dev;
17
18
  origin;
18
- getManifest;
19
19
  replaceUrls;
20
20
  constructor(conf) {
21
21
  this.dev = conf.dev;
22
22
  this.origin = conf.origin;
23
- this.getManifest = conf.getManifest;
24
23
  if (conf.replaceUrls) {
25
24
  this.replaceUrls = createUrlReplacer(conf.replaceUrls);
26
25
  }
27
26
  }
27
+ get runtime() {
28
+ return runtime;
29
+ }
30
+ static setRuntime(rt) {
31
+ runtime = rt;
32
+ }
28
33
  getOriginUrl(url) {
29
34
  const parsed = parseURL(url);
30
35
  const parsedOrigin = parseURL(this.origin);
@@ -64,7 +69,7 @@ export class ServerContext {
64
69
  async fetchRouteData(req) {
65
70
  const fetchUrl = withQuery(req.pathname, {
66
71
  ...req.query,
67
- _props: req.withAppData ? "all" : "1",
72
+ _props: "1",
68
73
  _ssr: "1",
69
74
  _debug: this.dev ? "1" : undefined,
70
75
  });
@@ -78,6 +83,18 @@ export class ServerContext {
78
83
  },
79
84
  });
80
85
  }
86
+ async fetchAppData(req) {
87
+ const response = await this.fetchOrigin("/_appdata", {
88
+ cache: "no-cache",
89
+ replaceUrls: true,
90
+ headers: {
91
+ "Content-Type": "application/json",
92
+ Accept: "application/json",
93
+ ...(req?.headers ? this.extractRequestHeaders(req.headers) : {}),
94
+ },
95
+ });
96
+ return response.json();
97
+ }
81
98
  extractRequestHeaders(req) {
82
99
  const headers = {};
83
100
  if (req) {
@@ -166,6 +166,7 @@ program
166
166
  });
167
167
  }
168
168
  else {
169
+ // Generate bootstrap files
169
170
  const codegen = createVinxiCodegen({
170
171
  mode: "production",
171
172
  project: project,
@@ -175,7 +176,7 @@ program
175
176
  console.info("Building for SPA WordPress (Frontend and Admin)");
176
177
  // Load the compiler
177
178
  const admin = new AdminBundler(project, {
178
- mode: "development",
179
+ mode: "production",
179
180
  });
180
181
  const frontend = new FrontendBundler(project, {
181
182
  mode: "production",
@@ -1 +1 @@
1
- export declare const VERSION = "2.0.0-beta.22";
1
+ export declare const VERSION = "2.0.0-beta.24";
@@ -1 +1 @@
1
- export const VERSION = "2.0.0-beta.22";
1
+ export const VERSION = "2.0.0-beta.24";
@@ -6,5 +6,14 @@ export type AppArgs = {
6
6
  origin: string;
7
7
  log?: StatefulLog<any>;
8
8
  preset?: string;
9
+ routes?: CustomRoute[];
10
+ };
11
+ type HTTPMethod = "GET" | "POST" | "PUT" | "OPTIONS" | "HEAD";
12
+ type CustomRouteFunction = (req: Request) => Response;
13
+ type CustomRouteModule = Record<HTTPMethod, CustomRouteFunction>;
14
+ type CustomRoute = {
15
+ pattern: string;
16
+ handler: () => Promise<CustomRouteModule>;
9
17
  };
10
18
  export declare function createVinxiApp(args: AppArgs): import("vinxi").App;
19
+ export {};
@@ -18,8 +18,27 @@ export function createVinxiApp(args) {
18
18
  // },
19
19
  preset: args.preset,
20
20
  routeRules: {
21
+ "/wp-content/uploads/**": {
22
+ proxy: joinURL(args.origin, "wp-content/uploads/**"),
23
+ headers: {
24
+ "Cache-Control": "max-age=86400",
25
+ "CDN-Cache-Control": "max-age=86400",
26
+ "Vercel-CDN-Cache-Control": "max-age=86400",
27
+ },
28
+ },
29
+ "/wp-content/plugins/**": {
30
+ proxy: joinURL(args.origin, "wp-content/plugins/**"),
31
+ headers: {
32
+ "Cache-Control": "max-age=86400",
33
+ "CDN-Cache-Control": "max-age=86400",
34
+ "Vercel-CDN-Cache-Control": "max-age=86400",
35
+ },
36
+ },
21
37
  "/wp-content/**": { proxy: joinURL(args.origin, "wp-content/**") },
22
38
  "/wp-includes/**": { proxy: joinURL(args.origin, "wp-includes/**") },
39
+ "/*": {
40
+ isr: 300,
41
+ },
23
42
  },
24
43
  },
25
44
  routers: [
@@ -105,7 +124,6 @@ export function createVinxiApp(args) {
105
124
  handler: `${folder}/handler.ssr-page.ts`,
106
125
  target: "server",
107
126
  plugins: () => [
108
- // reactRefresh(),
109
127
  ...corePlugins({
110
128
  rootDir: args.rootDir,
111
129
  console: log,
@@ -34,10 +34,13 @@ export function createVinxiCodegen(opts) {
34
34
  import { ServerContext } from "eddev/server"
35
35
  import { getManifest } from "vinxi/manifest"
36
36
 
37
+ ServerContext.setRuntime({
38
+ getManifest
39
+ })
40
+
37
41
  export const serverContext = new ServerContext({${Object.entries(args)
38
42
  .map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
39
- .join(",\n")},
40
- getManifest
43
+ .join(",\n")}
41
44
  })
42
45
  `.toString();
43
46
  },
@@ -54,6 +57,24 @@ export function createVinxiCodegen(opts) {
54
57
  `,
55
58
  });
56
59
  }
60
+ if (opts.serverless) {
61
+ // codegen.registerFile({
62
+ // name: "manifest/extra-routes.ts",
63
+ // generate: code/* tsx */ `
64
+ // import { createRouter, eventHandler, getRouterParam, getQuery, getWebRequest, getRequestHeaders } from "vinxi/http"
65
+ // import { serverContext } from "./context.js"
66
+ // export const routes = [
67
+ // {
68
+ // pattern: '/test1',
69
+ // handler: () => import('../../../test.ts')
70
+ // }
71
+ // ]
72
+ // export default eventHandler((event) => {
73
+ // routes
74
+ // })
75
+ // `,
76
+ // })
77
+ }
57
78
  codegen.registerFile({
58
79
  name: "entry.admin.tsx",
59
80
  generate: () => {
@@ -109,14 +130,14 @@ export function createVinxiCodegen(opts) {
109
130
  window.$reactRoot ||
110
131
  hydrateRoot(
111
132
  document,
112
- <SSRClientRoot assets={getAssets()} />,
133
+ <SSRClientRoot assets={getAssets()} metaTags={window._PAGE_DATA.meta.head} />,
113
134
  )
114
135
 
115
136
  if (import.meta.hot) {
116
137
  import.meta.hot.accept((mod) => {
117
138
  if (mod) {
118
139
  const Assets = createAssets(getManifest("client").handler, getManifest("client"))
119
- const app = <SSRClientRoot assets={getAssets()} />
140
+ const app = <SSRClientRoot assets={getAssets()} metaTags={window._PAGE_DATA.meta.head} />
120
141
  window.$reactRoot?.render(app)
121
142
  }
122
143
  })
@@ -125,6 +146,7 @@ export function createVinxiCodegen(opts) {
125
146
  declare global {
126
147
  interface Window {
127
148
  $reactRoot?: Root
149
+ _PAGE_DATA: any
128
150
  }
129
151
  }
130
152
 
@@ -219,41 +241,60 @@ export function createVinxiCodegen(opts) {
219
241
  codegen.registerFile({
220
242
  name: "handler.ssr-page.ts",
221
243
  generate: code /* tsx */ `
222
- /// <reference types="vinxi/types/server" />
223
- import "../../views/index.css"
224
- import "./manifest/blocks.js"
225
- import "./manifest/styles.js"
226
- import "./manifest/views.js"
227
-
228
- import { renderPageToSSRStream, proxyWpAdmin } from "eddev/server"
229
- import { eventHandler, setResponseHeader, setResponseStatus, getRequestURL } from "vinxi/http"
230
- import { serverContext } from "./context.js"
231
- import { getManifest } from "vinxi/manifest"
244
+ /// <reference types="vinxi/types/server" />
245
+ import "../../views/index.css"
246
+ import "./manifest/blocks.js"
247
+ import "./manifest/styles.js"
248
+ import "./manifest/views.js"
232
249
 
233
- export default eventHandler({
234
- handler: async (event) => {
235
- const url = getRequestURL(event)
250
+ import { proxyWpAdmin, renderPageToSSRStream } from "eddev/server"
251
+ import { eventHandler, getRequestURL, setResponseHeader, setResponseStatus } from "vinxi/http"
252
+ import { serverContext } from "./context.js"
253
+ import { RouteData } from "eddev/routing"
236
254
 
237
- if (url.pathname.includes('.')) {
238
- return proxyWpAdmin(event, serverContext)
239
- }
255
+ export default eventHandler({
256
+ handler: async (event) => {
257
+ const url = getRequestURL(event)
240
258
 
241
- const response = await serverContext.fetchRouteData({
242
- pathname: url.pathname,
243
- withAppData: true,
244
- headers: {},
245
- query: {},
246
- })
247
- if (response.ok) {
248
- setResponseStatus(event, response.status)
249
- setResponseHeader(event, "Content-Type", "text/html; charset=utf-8")
250
- return renderPageToSSRStream(url.pathname, await response.json(), serverContext)
251
- } else {
252
- return response
253
- }
254
- },
255
- })
259
+ if (url.pathname.includes(".")) {
260
+ return proxyWpAdmin(event, serverContext)
261
+ }
256
262
 
263
+ try {
264
+ const [appData, response] = await Promise.all([
265
+ serverContext.fetchAppData(),
266
+ serverContext.fetchRouteData({
267
+ pathname: url.pathname,
268
+ withAppData: true,
269
+ headers: {},
270
+ query: {},
271
+ }),
272
+ ])
273
+
274
+ let data: RouteData
275
+ try {
276
+ data = await response.json()
277
+ data.appData = appData
278
+ } catch (err) {
279
+ data = {
280
+ view: "_error",
281
+ viewType: "react",
282
+ viewData: {},
283
+ appData: appData,
284
+ }
285
+ console.error(err)
286
+ setResponseStatus(event, 500)
287
+ }
288
+ setResponseHeader(event, "Content-Type", "text/html; charset=utf-8")
289
+ return renderPageToSSRStream(url.pathname, data, serverContext)
290
+ } catch (err) {
291
+ console.error(err)
292
+ setResponseStatus(event, 500)
293
+ setResponseHeader(event, "Content-Type", "text/html; charset=utf-8")
294
+ return '<!DOCTYPE html><html><head><title>500 Internal Server Error</title></head><body><h1>500 Internal Server Error</h1><p>"'+err.message+'"</p></body></html>'
295
+ }
296
+ },
297
+ })
257
298
  `,
258
299
  });
259
300
  }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +1 @@
1
- export {};
1
+ "use strict";
@@ -49,7 +49,7 @@ export declare const BlockMetaSchema: z.ZodObject<{
49
49
  ancestors: string[];
50
50
  dynamic: boolean;
51
51
  allowMultiple: boolean;
52
- frontendMode: "default" | "hidden" | "childrenOnly";
52
+ frontendMode: "hidden" | "childrenOnly" | "default";
53
53
  inserter: boolean;
54
54
  description?: string | undefined;
55
55
  icon?: string | undefined;
@@ -83,7 +83,7 @@ export declare const BlockMetaSchema: z.ZodObject<{
83
83
  postMetaBlock?: {
84
84
  fieldName: string;
85
85
  } | undefined;
86
- frontendMode?: "default" | "hidden" | "childrenOnly" | undefined;
86
+ frontendMode?: "hidden" | "childrenOnly" | "default" | undefined;
87
87
  inserter?: boolean | undefined;
88
88
  }>;
89
89
  export type BlockMetadata = z.infer<typeof BlockMetaSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eddev",
3
- "version": "2.0.0-beta.22",
3
+ "version": "2.0.0-beta.24",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -93,6 +93,7 @@
93
93
  "dotenv": "^16.3.1",
94
94
  "globby": "^13.2.2",
95
95
  "graphql": "^16.8.1",
96
+ "hono": "^4.6.2",
96
97
  "ink": "^5.0.1",
97
98
  "ink-spinner": "^5.0.0",
98
99
  "ink-text-input": "^6.0.0",
@@ -118,11 +119,11 @@
118
119
  "@types/node": "^20.9.0",
119
120
  "@types/react": "^18.3.3",
120
121
  "@types/react-dom": "^18.3.0",
121
- "typescript": "^5.5.2",
122
122
  "@types/wordpress__blocks": "^12.5.13",
123
123
  "@types/wordpress__components": "^23.0.11",
124
124
  "@types/wordpress__editor": "^13.6.7",
125
- "@types/wordpress__hooks": "^2.11.0"
125
+ "@types/wordpress__hooks": "^2.11.0",
126
+ "typescript": "^5.5.2"
126
127
  },
127
128
  "peerDependencies": {
128
129
  "react": "^18.3.1",
package/tsconfig.app.json CHANGED
@@ -3,9 +3,9 @@
3
3
  "target": "ESNext",
4
4
  "lib": ["DOM", "ESNext"],
5
5
  "jsx": "react-jsx",
6
- "module": "NodeNext",
6
+ "module": "ESNext",
7
7
  "rootDir": "./src/",
8
- "moduleResolution": "NodeNext",
8
+ "moduleResolution": "Bundler",
9
9
  "declaration": true,
10
10
  "outDir": "./dist",
11
11
  "allowJs": true,
@@ -4,8 +4,8 @@
4
4
  "lib": ["ESNext"],
5
5
  "jsx": "react-jsx",
6
6
  "rootDir": "./src/",
7
- "module": "NodeNext",
8
- "moduleResolution": "NodeNext",
7
+ "module": "ESNext",
8
+ "moduleResolution": "Bundler",
9
9
  "resolveJsonModule": true,
10
10
  "declaration": true,
11
11
  "outDir": "./dist",