@mandujs/cli 0.5.6 → 0.5.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mandujs/cli",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "Agent-Native Fullstack Framework - 에이전트가 코딩해도 아키텍처가 무너지지 않는 개발 OS",
5
5
  "type": "module",
6
6
  "main": "./src/main.ts",
@@ -3,6 +3,7 @@ import {
3
3
  startServer,
4
4
  registerApiHandler,
5
5
  registerPageLoader,
6
+ registerPageHandler,
6
7
  startDevBundler,
7
8
  createHMRServer,
8
9
  needsHydration,
@@ -59,9 +60,21 @@ export async function dev(options: DevOptions = {}): Promise<void> {
59
60
  }
60
61
  } else if (route.kind === "page" && route.componentModule) {
61
62
  const componentPath = path.resolve(rootDir, route.componentModule);
62
- registerPageLoader(route.id, () => import(componentPath));
63
63
  const isIsland = needsHydration(route);
64
- console.log(` 📄 Page: ${route.pattern} -> ${route.id}${isIsland ? " 🏝️" : ""}`);
64
+
65
+ // slotModule이 있으면 PageHandler 사용 (filling.loader 지원)
66
+ if (route.slotModule) {
67
+ registerPageHandler(route.id, async () => {
68
+ const module = await import(componentPath);
69
+ // module.default = { component, filling }
70
+ return module.default;
71
+ });
72
+ console.log(` 📄 Page: ${route.pattern} -> ${route.id} (with loader)${isIsland ? " 🏝️" : ""}`);
73
+ } else {
74
+ // slotModule이 없으면 기존 PageLoader 사용
75
+ registerPageLoader(route.id, () => import(componentPath));
76
+ console.log(` 📄 Page: ${route.pattern} -> ${route.id}${isIsland ? " 🏝️" : ""}`);
77
+ }
65
78
  }
66
79
  }
67
80
 
@@ -1,4 +1,10 @@
1
- import { loadManifest, startServer, registerApiHandler, registerPageLoader } from "@mandujs/core";
1
+ import {
2
+ loadManifest,
3
+ startServer,
4
+ registerApiHandler,
5
+ registerPageLoader,
6
+ registerPageHandler,
7
+ } from "@mandujs/core";
2
8
  import path from "path";
3
9
 
4
10
  const SPEC_PATH = path.resolve(import.meta.dir, "../../spec/routes.manifest.json");
@@ -28,8 +34,20 @@ async function main() {
28
34
  }
29
35
  } else if (route.kind === "page") {
30
36
  const componentPath = path.resolve(import.meta.dir, "../../", route.componentModule!);
31
- registerPageLoader(route.id, () => import(componentPath));
32
- console.log(` 📄 Page: ${route.pattern} -> ${route.id}`);
37
+
38
+ // slotModule이 있으면 PageHandler 사용 (filling.loader 지원)
39
+ if (route.slotModule) {
40
+ registerPageHandler(route.id, async () => {
41
+ const module = await import(componentPath);
42
+ // module.default = { component, filling }
43
+ return module.default;
44
+ });
45
+ console.log(` 📄 Page: ${route.pattern} -> ${route.id} (with loader)`);
46
+ } else {
47
+ // slotModule이 없으면 기존 PageLoader 사용
48
+ registerPageLoader(route.id, () => import(componentPath));
49
+ console.log(` 📄 Page: ${route.pattern} -> ${route.id}`);
50
+ }
33
51
  }
34
52
  }
35
53