@mandujs/cli 0.18.7 → 0.18.8

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.18.7",
3
+ "version": "0.18.8",
4
4
  "description": "Agent-Native Fullstack Framework - 에이전트가 코딩해도 아키텍처가 무너지지 않는 개발 OS",
5
5
  "type": "module",
6
6
  "main": "./src/main.ts",
@@ -32,7 +32,7 @@
32
32
  "access": "public"
33
33
  },
34
34
  "dependencies": {
35
- "@mandujs/core": "^0.18.18",
35
+ "@mandujs/core": "^0.18.20",
36
36
  "@mandujs/ate": "^0.17.0",
37
37
  "cfonts": "^3.3.0"
38
38
  },
@@ -272,6 +272,20 @@ export async function dev(options: DevOptions = {}): Promise<void> {
272
272
  });
273
273
  };
274
274
 
275
+ // SSR 파일 변경 콜백 (page.tsx, layout.tsx → 서버 핸들러 재등록 + 브라우저 리로드)
276
+ const handleSSRChange = async (filePath: string) => {
277
+ const timestamp = new Date().toLocaleTimeString();
278
+ console.log(`\n🔄 [${timestamp}] SSR 변경 감지 → 핸들러 재등록`);
279
+ clearDefaultRegistry();
280
+ registeredLayouts.clear();
281
+ await registerHandlers(manifest, true);
282
+ hmrServer?.broadcast({
283
+ type: "reload",
284
+ data: { timestamp: Date.now() },
285
+ });
286
+ console.log(` ✅ SSR 갱신 완료 — 브라우저 리로드`);
287
+ };
288
+
275
289
  if (hasIslands && hmrEnabled) {
276
290
  // HMR 서버 시작
277
291
  hmrServer = createHMRServer(port);
@@ -283,6 +297,7 @@ export async function dev(options: DevOptions = {}): Promise<void> {
283
297
  watchDirs: devConfig.watchDirs,
284
298
  onRebuild: handleRebuild,
285
299
  onError: handleBundlerError,
300
+ onSSRChange: handleSSRChange,
286
301
  });
287
302
 
288
303
  // 재시작 핸들러 등록
@@ -306,6 +321,7 @@ export async function dev(options: DevOptions = {}): Promise<void> {
306
321
  watchDirs: devConfig.watchDirs,
307
322
  onRebuild: handleRebuild,
308
323
  onError: handleBundlerError,
324
+ onSSRChange: handleSSRChange,
309
325
  });
310
326
 
311
327
  // 5. 브라우저 전체 리로드