@gaonjs/cli 0.41.3 → 0.41.4

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/dist/serve.js CHANGED
@@ -133,7 +133,20 @@ export async function runServeCommand(opts = {}) {
133
133
  };
134
134
  const configPath = findConfigPath(cwd);
135
135
  const config = await loadGaonConfig(cwd);
136
- const wired = await wireGaon(config, cwd);
136
+ // 결정 252(결정 250 확장): wireGaon 이 부팅 도중(mid-wire · 예: 잘못된 DB 자격증명으로
137
+ // ensureOutboxTable 의 첫 DB 접근이 throw) 실패하면, wireGaon 이 자기가 연 부분 핸들(NATS·
138
+ // Redis·DB)을 정리하고 rethrow 한다. 이전엔 이 호출이 try 밖이라, 상위(index.ts)가 exitCode 만
139
+ // 세팅하고 열린 소켓이 이벤트 루프를 붙잡아 프로세스가 종료하지 못하고 매달렸다(25s 미종료 실측).
140
+ // 여기서 fail-loud + 명시 종료로 확정 종료를 보장한다(post-wire 실패[아래]와 대칭 · exit 는 실패 시만).
141
+ let wired;
142
+ try {
143
+ wired = await wireGaon(config, cwd);
144
+ }
145
+ catch (err) {
146
+ const msg = err instanceof Error ? err.message : String(err);
147
+ process.stderr.write(` ✗ gaon serve 부팅 실패: ${msg}\n`);
148
+ process.exit(1);
149
+ }
137
150
  // 결정 250(샘플 C · P2): wireGaon 이 NATS·Redis 소켓을 연 뒤의 부팅 단계(포트 파싱·listen
138
151
  // 등)에서 실패하면, 상위 catch(index.ts)가 exitCode=1 만 세팅하고 끝나 열린 소켓이 이벤트
139
152
  // 루프를 붙잡아 프로세스가 종료하지 못하고 매달린다(정확한 fail-loud 메시지는 찍히지만
package/dist/work.js CHANGED
@@ -75,6 +75,10 @@ export async function runWorkCommand(opts = {}) {
75
75
  // catch(index.ts)가 exitCode=1 만 세팅한 채 프로세스가 매달린다. 부팅 실패는 그때까지 연
76
76
  // 핸들을 정리하고 명시 종료한다(serve 와 대칭). 정상 부팅·정상 종료엔 영향 없다.
77
77
  // (이전엔 runWork 실패만 정리했고, 그 앞의 wireDomain·loadDomain throw 는 nats 를 누출했다.)
78
+ // 결정 252: wireDomain 이 **mid-wire** 로 throw 하면(예: Redis 배선 후 다음 단계 실패)
79
+ // domainWiring 이 undefined 라 아래 catch 의 closeDomain 이 안 돌지만, wireDomain 이 자기
80
+ // 부분 핸들(Redis·DB)을 스스로 정리하고 rethrow 하므로(opener 소유) 누출이 없다 — nats 는
81
+ // 이 catch 가 닫는다. 이로써 serve(직접 exit)와 work(nats close + exit)가 mid-wire 대칭.
78
82
  let domainWiring;
79
83
  let work;
80
84
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaonjs/cli",
3
- "version": "0.41.3",
3
+ "version": "0.41.4",
4
4
  "description": "Gaon CLI — 스캐폴딩·제너레이터·마이그레이션·dev/serve/work/hub·doctor·check (bin: gaon)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,12 +28,12 @@
28
28
  "typescript": "^5.9.0",
29
29
  "vite": "^7.0.0",
30
30
  "@gaonjs/async": "0.15.0",
31
+ "@gaonjs/config": "0.17.4",
32
+ "@gaonjs/core": "0.2.3",
31
33
  "@gaonjs/mail": "0.3.0",
32
34
  "@gaonjs/data": "0.17.0",
33
- "@gaonjs/core": "0.2.3",
34
35
  "@gaonjs/i18n": "0.2.2",
35
- "@gaonjs/web": "0.19.4",
36
- "@gaonjs/config": "0.17.3"
36
+ "@gaonjs/web": "0.19.4"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json && node -e \"require('fs').cpSync('src/templates','dist/templates',{recursive:true})\""