@monkeyplus/flow 5.0.0-rc.54 → 5.0.0-rc.56

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.
@@ -1,5 +1,10 @@
1
1
  import { eventHandler, useQuery } from "h3";
2
2
  import { joinURL } from "ufo";
3
+ const normalizeCall = async (seo, ctx) => {
4
+ if (typeof seo === "function")
5
+ return await seo(ctx);
6
+ return seo || {};
7
+ };
3
8
  export default eventHandler(async (event) => {
4
9
  const url = event.req.url?.split("?")[0];
5
10
  const flow = event.context.flow;
@@ -53,7 +58,7 @@ export default eventHandler(async (event) => {
53
58
  });
54
59
  templateContext.sharedContext = sharedContext || {};
55
60
  templateContext.utils = utils;
56
- templateContext.seo = await page.seo?.({ ...contextHooks, ...contextPage, utils, sharedContext }) || {};
61
+ templateContext.seo = await normalizeCall(page?.seo, { ...contextHooks, ...contextPage, utils, sharedContext });
57
62
  const contexData = await page.context?.({ ...contextHooks, ...contextPage, utils, sharedContext }) || {};
58
63
  templateContext.context = {
59
64
  ...contextHooks,
package/dist/index.mjs CHANGED
@@ -29,7 +29,7 @@ import { isExternal as isExternal$1, ExternalsDefaults } from 'externality';
29
29
  import { createHash } from 'node:crypto';
30
30
  import MagicString from 'magic-string';
31
31
 
32
- const version = "5.0.0-rc.54";
32
+ const version = "5.0.0-rc.56";
33
33
 
34
34
  let _distDir = dirname(fileURLToPath(import.meta.url));
35
35
  if (_distDir.endsWith("chunks"))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkeyplus/flow",
3
- "version": "5.0.0-rc.54",
3
+ "version": "5.0.0-rc.56",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -25,9 +25,9 @@
25
25
  "dist"
26
26
  ],
27
27
  "dependencies": {
28
- "@monkeyplus/flow-cli": "5.0.0-rc.54",
29
- "@monkeyplus/flow-kit": "5.0.0-rc.54",
30
- "@monkeyplus/flow-schema": "5.0.0-rc.54",
28
+ "@monkeyplus/flow-cli": "5.0.0-rc.56",
29
+ "@monkeyplus/flow-kit": "5.0.0-rc.56",
30
+ "@monkeyplus/flow-schema": "5.0.0-rc.56",
31
31
  "@rollup/plugin-replace": "^4.0.0",
32
32
  "@vueuse/head": "^0.7.6",
33
33
  "c12": "^0.2.7",