@akanjs/next 0.9.41 → 0.9.43

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.
package/cjs/bootCsr.js CHANGED
@@ -64,7 +64,9 @@ const bootCsr = async (context) => {
64
64
  return;
65
65
  }
66
66
  const getPageContent = value;
67
- pages[key] = await getPageContent();
67
+ const pageContent = await getPageContent();
68
+ if (pageContent.default)
69
+ pages[key] = pageContent;
68
70
  })
69
71
  );
70
72
  const getPageState = (csrConfig) => {
@@ -40,7 +40,7 @@ const useLocation = ({ rootRouteGuide }) => {
40
40
  const paramSegment = childrenSegments.find((segment) => segment.startsWith("/:"));
41
41
  const childRouteGuide = matchingPathSegment ? routeGuide.children[pathSegment] : paramSegment ? routeGuide.children[paramSegment] : null;
42
42
  if (!childRouteGuide)
43
- throw new Error("404");
43
+ throw new Error(`Not found: ${pathname2}`);
44
44
  return getTargetRouteGuide(pathSegments2, childRouteGuide);
45
45
  };
46
46
  const targetRouteGuide = getTargetRouteGuide(pathSegments, rootRouteGuide);
package/esm/bootCsr.js CHANGED
@@ -37,7 +37,9 @@ const bootCsr = async (context) => {
37
37
  return;
38
38
  }
39
39
  const getPageContent = value;
40
- pages[key] = await getPageContent();
40
+ const pageContent = await getPageContent();
41
+ if (pageContent.default)
42
+ pages[key] = pageContent;
41
43
  })
42
44
  );
43
45
  const getPageState = (csrConfig) => {
@@ -18,7 +18,7 @@ const useLocation = ({ rootRouteGuide }) => {
18
18
  const paramSegment = childrenSegments.find((segment) => segment.startsWith("/:"));
19
19
  const childRouteGuide = matchingPathSegment ? routeGuide.children[pathSegment] : paramSegment ? routeGuide.children[paramSegment] : null;
20
20
  if (!childRouteGuide)
21
- throw new Error("404");
21
+ throw new Error(`Not found: ${pathname2}`);
22
22
  return getTargetRouteGuide(pathSegments2, childRouteGuide);
23
23
  };
24
24
  const targetRouteGuide = getTargetRouteGuide(pathSegments, rootRouteGuide);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/next",
3
- "version": "0.9.41",
3
+ "version": "0.9.43",
4
4
  "sourceType": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/usePage.d.ts CHANGED
@@ -2,10 +2,10 @@ import { Translation } from "@akanjs/dictionary";
2
2
  export declare const usePage: () => {
3
3
  path: string;
4
4
  l: {
5
- (key: `${string}.${string}` | `${string}.${number}`, param?: {
5
+ (key: `${string}.${string}`, param?: {
6
6
  [key: string]: string | number;
7
7
  } | undefined): string;
8
- rich(key: `${string}.${string}` | `${string}.${number}`, param?: {
8
+ rich(key: `${string}.${string}`, param?: {
9
9
  [key: string]: string | number;
10
10
  } | undefined): import("react").ReactNode;
11
11
  field<ModelKey extends string | number>(model: ModelKey, field: keyof {
@@ -68,7 +68,7 @@ export declare const usePage: () => {
68
68
  [key: string]: Translation;
69
69
  };
70
70
  }[ModelKey], arg: string): string;
71
- trans<Returns extends import("react").ReactNode>(translation: Record<"en" | "ko" | (string & {}), Returns>): Returns extends string ? string : Returns;
71
+ trans<Returns extends import("react").ReactNode>(translation: Record<(string & {}) | "en" | "ko", Returns>): Returns extends string ? string : Returns;
72
72
  };
73
73
  lang: string;
74
74
  };