gencow 0.1.113 → 0.1.114

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/bin/gencow.mjs CHANGED
@@ -2451,9 +2451,13 @@ ${BOLD}Examples:${RESET}
2451
2451
  };
2452
2452
  const tsFiles = scanTsFiles(gencowDir);
2453
2453
  // query(, mutation(, httpAction( 호출이 하나라도 있으면 실질적 백엔드
2454
+ // ⚠️ 주석 내 코드 예시를 오탐하지 않도록 주석을 먼저 제거
2454
2455
  const hasApiCalls = tsFiles.some(f => {
2455
2456
  const src = readFileSync(f, "utf8");
2456
- return /\b(query|mutation|httpAction)\s*\(/.test(src);
2457
+ const stripped = src
2458
+ .replace(/\/\/.*$/gm, "") // 한줄 주석 제거
2459
+ .replace(/\/\*[\s\S]*?\*\//g, ""); // 블록 주석 제거
2460
+ return /\b(query|mutation|httpAction)\s*\(/.test(stripped);
2457
2461
  });
2458
2462
  if (!hasApiCalls) {
2459
2463
  isBackendEmpty = true;
@@ -2699,23 +2703,29 @@ ${BOLD}Examples:${RESET}
2699
2703
  warn("서버 시작 실패 원인:");
2700
2704
  for (const line of errData.crashLogs) log(` ${DIM}${line}${RESET}`);
2701
2705
  }
2702
- error("백엔드 배포 실패로 프론트엔드 배포를 건너뜁니다.");
2703
- process.exit(1);
2704
- }
2706
+ if (targetDir) {
2707
+ // --static 모드: 백엔드 실패해도 프론트엔드 배포는 계속 진행
2708
+ warn("백엔드 배포 실패 — 정적 파일 배포는 계속 진행합니다.");
2709
+ log("");
2710
+ } else {
2711
+ error("백엔드 배포 실패로 프론트엔드 배포를 건너뜁니다.");
2712
+ process.exit(1);
2713
+ }
2714
+ } else {
2715
+ const backendData = await backendDeployRes.json();
2716
+ const backendElapsed = ((Date.now() - backendStartTime) / 1000).toFixed(1);
2717
+ success(`백엔드 빌드 완료! (${backendElapsed}s)`);
2705
2718
 
2706
- const backendData = await backendDeployRes.json();
2707
- const backendElapsed = ((Date.now() - backendStartTime) / 1000).toFixed(1);
2708
- success(`백엔드 빌드 완료! (${backendElapsed}s)`);
2719
+ // Health check 백엔드 앱 URL로 실제 응답 확인
2720
+ if (backendData.url) {
2721
+ await this._verifyAppReady(backendData.url, appId);
2722
+ }
2709
2723
 
2710
- // Health check — 백엔드 앱 URL로 실제 응답 확인
2711
- if (backendData.url) {
2712
- await this._verifyAppReady(backendData.url, appId);
2724
+ info(`URL: ${backendData.url}`);
2725
+ info(`Hash: ${backendData.bundleHash}`);
2726
+ updateEnvLocalUrl(backendData.url);
2727
+ log("");
2713
2728
  }
2714
-
2715
- info(`URL: ${backendData.url}`);
2716
- info(`Hash: ${backendData.bundleHash}`);
2717
- updateEnvLocalUrl(backendData.url);
2718
- log("");
2719
2729
  log(` ${BOLD}── 프론트엔드 배포 ──────────────────${RESET}\n`);
2720
2730
  }
2721
2731