@simplysm/sd-cli 13.0.68 → 13.0.70

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.
Files changed (201) hide show
  1. package/README.md +10 -957
  2. package/dist/builders/BaseBuilder.d.ts +23 -23
  3. package/dist/builders/BaseBuilder.d.ts.map +1 -1
  4. package/dist/builders/BaseBuilder.js +15 -15
  5. package/dist/builders/DtsBuilder.d.ts +4 -4
  6. package/dist/builders/DtsBuilder.js +1 -1
  7. package/dist/builders/LibraryBuilder.d.ts +3 -3
  8. package/dist/builders/types.d.ts +10 -10
  9. package/dist/capacitor/capacitor.d.ts +36 -36
  10. package/dist/capacitor/capacitor.js +63 -63
  11. package/dist/capacitor/capacitor.js.map +1 -1
  12. package/dist/commands/add-client.d.ts +8 -8
  13. package/dist/commands/add-client.js +15 -15
  14. package/dist/commands/add-client.js.map +1 -1
  15. package/dist/commands/add-server.d.ts +9 -9
  16. package/dist/commands/add-server.js +13 -13
  17. package/dist/commands/add-server.js.map +1 -1
  18. package/dist/commands/build.d.ts +9 -9
  19. package/dist/commands/check.js +3 -3
  20. package/dist/commands/check.js.map +1 -1
  21. package/dist/commands/dev.d.ts +9 -9
  22. package/dist/commands/device.d.ts +9 -9
  23. package/dist/commands/device.d.ts.map +1 -1
  24. package/dist/commands/device.js +17 -17
  25. package/dist/commands/device.js.map +1 -1
  26. package/dist/commands/init.d.ts +6 -6
  27. package/dist/commands/init.js +12 -12
  28. package/dist/commands/init.js.map +1 -1
  29. package/dist/commands/lint.d.ts +23 -23
  30. package/dist/commands/lint.d.ts.map +1 -1
  31. package/dist/commands/lint.js +25 -25
  32. package/dist/commands/lint.js.map +1 -1
  33. package/dist/commands/publish.d.ts +13 -13
  34. package/dist/commands/publish.d.ts.map +1 -1
  35. package/dist/commands/publish.js +61 -61
  36. package/dist/commands/publish.js.map +1 -1
  37. package/dist/commands/replace-deps.d.ts +3 -3
  38. package/dist/commands/replace-deps.d.ts.map +1 -1
  39. package/dist/commands/replace-deps.js +1 -1
  40. package/dist/commands/replace-deps.js.map +1 -1
  41. package/dist/commands/typecheck.d.ts +20 -20
  42. package/dist/commands/typecheck.d.ts.map +1 -1
  43. package/dist/commands/typecheck.js +20 -20
  44. package/dist/commands/typecheck.js.map +1 -1
  45. package/dist/commands/watch.d.ts +7 -7
  46. package/dist/electron/electron.d.ts +27 -27
  47. package/dist/electron/electron.js +32 -32
  48. package/dist/electron/electron.js.map +1 -1
  49. package/dist/infra/ResultCollector.d.ts +9 -9
  50. package/dist/infra/ResultCollector.js +5 -5
  51. package/dist/infra/SignalHandler.d.ts +7 -7
  52. package/dist/infra/SignalHandler.js +4 -4
  53. package/dist/infra/WorkerManager.d.ts +14 -14
  54. package/dist/infra/WorkerManager.js +11 -11
  55. package/dist/orchestrators/BuildOrchestrator.d.ts +19 -19
  56. package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
  57. package/dist/orchestrators/BuildOrchestrator.js +26 -26
  58. package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
  59. package/dist/orchestrators/DevOrchestrator.d.ts +25 -25
  60. package/dist/orchestrators/DevOrchestrator.d.ts.map +1 -1
  61. package/dist/orchestrators/DevOrchestrator.js +30 -30
  62. package/dist/orchestrators/DevOrchestrator.js.map +1 -1
  63. package/dist/orchestrators/WatchOrchestrator.d.ts +13 -13
  64. package/dist/orchestrators/WatchOrchestrator.js +17 -17
  65. package/dist/orchestrators/WatchOrchestrator.js.map +1 -1
  66. package/dist/sd-cli-entry.d.ts +2 -2
  67. package/dist/sd-cli-entry.js +38 -38
  68. package/dist/sd-cli-entry.js.map +1 -1
  69. package/dist/sd-cli.d.ts +2 -2
  70. package/dist/sd-cli.js +1 -1
  71. package/dist/sd-cli.js.map +1 -1
  72. package/dist/sd-config.types.d.ts +84 -84
  73. package/dist/sd-config.types.d.ts.map +1 -1
  74. package/dist/utils/build-env.d.ts +1 -1
  75. package/dist/utils/config-editor.d.ts +5 -5
  76. package/dist/utils/config-editor.js +2 -2
  77. package/dist/utils/config-editor.js.map +1 -1
  78. package/dist/utils/copy-public.d.ts +9 -9
  79. package/dist/utils/copy-src.d.ts +9 -9
  80. package/dist/utils/esbuild-config.d.ts +30 -30
  81. package/dist/utils/esbuild-config.d.ts.map +1 -1
  82. package/dist/utils/output-utils.d.ts +6 -6
  83. package/dist/utils/package-utils.d.ts +6 -6
  84. package/dist/utils/package-utils.js +1 -1
  85. package/dist/utils/package-utils.js.map +1 -1
  86. package/dist/utils/rebuild-manager.js +3 -3
  87. package/dist/utils/rebuild-manager.js.map +1 -1
  88. package/dist/utils/replace-deps.d.ts +25 -25
  89. package/dist/utils/replace-deps.js +3 -3
  90. package/dist/utils/replace-deps.js.map +1 -1
  91. package/dist/utils/sd-config.d.ts +3 -3
  92. package/dist/utils/sd-config.js +3 -3
  93. package/dist/utils/sd-config.js.map +1 -1
  94. package/dist/utils/tailwind-config-deps.d.ts +3 -3
  95. package/dist/utils/template.d.ts +8 -8
  96. package/dist/utils/tsconfig.d.ts +16 -16
  97. package/dist/utils/tsconfig.js +2 -2
  98. package/dist/utils/tsconfig.js.map +1 -1
  99. package/dist/utils/typecheck-serialization.d.ts +8 -8
  100. package/dist/utils/vite-config.d.ts +8 -8
  101. package/dist/utils/vite-config.d.ts.map +1 -1
  102. package/dist/utils/vite-config.js +3 -3
  103. package/dist/utils/worker-events.d.ts +12 -12
  104. package/dist/utils/worker-events.d.ts.map +1 -1
  105. package/dist/utils/worker-utils.d.ts +3 -3
  106. package/dist/utils/worker-utils.js +2 -2
  107. package/dist/utils/worker-utils.js.map +1 -1
  108. package/dist/workers/client.worker.d.ts +14 -14
  109. package/dist/workers/client.worker.d.ts.map +1 -1
  110. package/dist/workers/client.worker.js +1 -1
  111. package/dist/workers/client.worker.js.map +1 -1
  112. package/dist/workers/dts.worker.d.ts +13 -13
  113. package/dist/workers/dts.worker.d.ts.map +1 -1
  114. package/dist/workers/dts.worker.js +3 -3
  115. package/dist/workers/dts.worker.js.map +1 -1
  116. package/dist/workers/library.worker.d.ts +12 -12
  117. package/dist/workers/library.worker.js +1 -1
  118. package/dist/workers/library.worker.js.map +1 -1
  119. package/dist/workers/lint.worker.d.ts +1 -1
  120. package/dist/workers/server-runtime.worker.d.ts +6 -6
  121. package/dist/workers/server-runtime.worker.js +6 -6
  122. package/dist/workers/server-runtime.worker.js.map +1 -1
  123. package/dist/workers/server.worker.d.ts +20 -20
  124. package/dist/workers/server.worker.d.ts.map +1 -1
  125. package/dist/workers/server.worker.js +6 -6
  126. package/dist/workers/server.worker.js.map +1 -1
  127. package/package.json +8 -7
  128. package/src/builders/BaseBuilder.ts +33 -33
  129. package/src/builders/DtsBuilder.ts +5 -5
  130. package/src/builders/LibraryBuilder.ts +9 -9
  131. package/src/builders/types.ts +10 -10
  132. package/src/capacitor/capacitor.ts +119 -119
  133. package/src/commands/add-client.ts +31 -31
  134. package/src/commands/add-server.ts +34 -34
  135. package/src/commands/build.ts +9 -9
  136. package/src/commands/check.ts +5 -5
  137. package/src/commands/dev.ts +9 -9
  138. package/src/commands/device.ts +30 -30
  139. package/src/commands/init.ts +25 -25
  140. package/src/commands/lint.ts +64 -64
  141. package/src/commands/publish.ts +139 -139
  142. package/src/commands/replace-deps.ts +4 -4
  143. package/src/commands/typecheck.ts +74 -74
  144. package/src/commands/watch.ts +7 -7
  145. package/src/electron/electron.ts +51 -51
  146. package/src/infra/ResultCollector.ts +9 -9
  147. package/src/infra/SignalHandler.ts +7 -7
  148. package/src/infra/WorkerManager.ts +14 -14
  149. package/src/orchestrators/BuildOrchestrator.ts +76 -76
  150. package/src/orchestrators/DevOrchestrator.ts +88 -88
  151. package/src/orchestrators/WatchOrchestrator.ts +39 -39
  152. package/src/sd-cli-entry.ts +43 -43
  153. package/src/sd-cli.ts +15 -15
  154. package/src/sd-config.types.ts +85 -85
  155. package/src/utils/build-env.ts +1 -1
  156. package/src/utils/config-editor.ts +19 -19
  157. package/src/utils/copy-public.ts +17 -17
  158. package/src/utils/copy-src.ts +11 -11
  159. package/src/utils/esbuild-config.ts +33 -33
  160. package/src/utils/output-utils.ts +11 -11
  161. package/src/utils/package-utils.ts +12 -12
  162. package/src/utils/rebuild-manager.ts +3 -3
  163. package/src/utils/replace-deps.ts +361 -361
  164. package/src/utils/sd-config.ts +44 -44
  165. package/src/utils/tailwind-config-deps.ts +98 -98
  166. package/src/utils/template.ts +56 -56
  167. package/src/utils/tsconfig.ts +127 -127
  168. package/src/utils/typecheck-serialization.ts +86 -86
  169. package/src/utils/vite-config.ts +341 -341
  170. package/src/utils/worker-events.ts +16 -16
  171. package/src/utils/worker-utils.ts +45 -45
  172. package/src/workers/client.worker.ts +34 -34
  173. package/src/workers/dts.worker.ts +467 -467
  174. package/src/workers/library.worker.ts +314 -314
  175. package/src/workers/lint.worker.ts +16 -16
  176. package/src/workers/server-runtime.worker.ts +157 -157
  177. package/src/workers/server.worker.ts +572 -572
  178. package/templates/add-client/__CLIENT__/package.json.hbs +1 -1
  179. package/templates/add-server/__SERVER__/package.json.hbs +2 -2
  180. package/templates/init/package.json.hbs +3 -3
  181. package/tests/config-editor.spec.ts +160 -0
  182. package/tests/copy-src.spec.ts +50 -0
  183. package/tests/get-compiler-options-for-package.spec.ts +139 -0
  184. package/tests/get-package-source-files.spec.ts +181 -0
  185. package/tests/get-types-from-package-json.spec.ts +107 -0
  186. package/tests/infra/ResultCollector.spec.ts +39 -0
  187. package/tests/infra/SignalHandler.spec.ts +38 -0
  188. package/tests/infra/WorkerManager.spec.ts +97 -0
  189. package/tests/load-ignore-patterns.spec.ts +188 -0
  190. package/tests/load-sd-config.spec.ts +137 -0
  191. package/tests/package-utils.spec.ts +188 -0
  192. package/tests/parse-root-tsconfig.spec.ts +89 -0
  193. package/tests/replace-deps.spec.ts +308 -0
  194. package/tests/run-lint.spec.ts +415 -0
  195. package/tests/run-typecheck.spec.ts +653 -0
  196. package/tests/run-watch.spec.ts +75 -0
  197. package/tests/sd-cli.spec.ts +330 -0
  198. package/tests/tailwind-config-deps.spec.ts +30 -0
  199. package/tests/template.spec.ts +70 -0
  200. package/tests/utils/rebuild-manager.spec.ts +43 -0
  201. package/tests/write-changed-output-files.spec.ts +97 -0
@@ -27,17 +27,17 @@ import { formatBuildMessages } from "../utils/output-utils";
27
27
  //#region Types
28
28
 
29
29
  /**
30
- * Build Orchestrator 옵션
30
+ * Build Orchestrator options
31
31
  */
32
32
  export interface BuildOrchestratorOptions {
33
- /** 빌드할 패키지 필터 ( 배열이면 모든 패키지) */
33
+ /** Package filter for build (empty array includes all packages) */
34
34
  targets: string[];
35
- /** sd.config.ts 전달할 추가 옵션 */
35
+ /** Additional options to pass to sd.config.ts */
36
36
  options: string[];
37
37
  }
38
38
 
39
39
  /**
40
- * 빌드 결과
40
+ * Build result
41
41
  */
42
42
  interface BuildStepResult {
43
43
  name: string;
@@ -50,14 +50,14 @@ interface BuildStepResult {
50
50
  }
51
51
 
52
52
  /**
53
- * 패키지 분류 결과
53
+ * Package classification result
54
54
  */
55
55
  interface ClassifiedPackages {
56
- /** node/browser/neutral 타겟 (JS + dts) */
56
+ /** node/browser/neutral target (JS + dts) */
57
57
  buildPackages: Array<{ name: string; config: SdBuildPackageConfig }>;
58
- /** client 타겟 (Vite build + typecheck) */
58
+ /** client target (Vite build + typecheck) */
59
59
  clientPackages: Array<{ name: string; config: SdClientPackageConfig }>;
60
- /** server 타겟 (JS 빌드, dts 제외) */
60
+ /** server target (JS build, no dts) */
61
61
  serverPackages: Array<{ name: string; config: SdServerPackageConfig }>;
62
62
  }
63
63
 
@@ -66,11 +66,11 @@ interface ClassifiedPackages {
66
66
  //#region Utilities
67
67
 
68
68
  /**
69
- * 패키지를 타겟별로 분류
69
+ * Classify packages by target
70
70
  * - node/browser/neutral: buildPackages (JS + dts)
71
71
  * - client: clientPackages (Vite build + typecheck)
72
- * - server: serverPackages (JS 빌드, dts 제외)
73
- * - scripts: 제외
72
+ * - server: serverPackages (JS build, no dts)
73
+ * - scripts: excluded
74
74
  */
75
75
  function classifyPackages(
76
76
  packages: Record<
@@ -91,7 +91,7 @@ function classifyPackages(
91
91
  if (config == null) continue;
92
92
  if (config.target === "scripts") continue;
93
93
 
94
- // targets가 지정되면 해당 패키지만 포함
94
+ // Include only specified packages if targets is specified
95
95
  if (targets.length > 0 && !targets.includes(name)) continue;
96
96
 
97
97
  if (config.target === "client") {
@@ -107,7 +107,7 @@ function classifyPackages(
107
107
  }
108
108
 
109
109
  /**
110
- * dist 폴더 삭제
110
+ * Delete dist folders
111
111
  */
112
112
  async function cleanDistFolders(cwd: string, packageNames: string[]): Promise<void> {
113
113
  await Promise.all(packageNames.map((name) => fsRm(path.join(cwd, "packages", name, "dist"))));
@@ -118,14 +118,14 @@ async function cleanDistFolders(cwd: string, packageNames: string[]): Promise<vo
118
118
  //#region BuildOrchestrator
119
119
 
120
120
  /**
121
- * 프로덕션 빌드를 조율하는 Orchestrator
121
+ * Orchestrator for coordinating production builds
122
122
  *
123
- * sd.config.ts 기반으로 패키지를 분류하고, 빌드를 실행한다.
124
- * - dist 폴더 정리 (clean build)
125
- * - lint + 빌드 병렬 실행
126
- * - node/browser/neutral 타겟: esbuild JS 빌드 + dts 생성
127
- * - client 타겟: Vite production 빌드 + typecheck + Capacitor/Electron 빌드
128
- * - server 타겟: esbuild JS 빌드
123
+ * Classifies packages based on sd.config.ts and executes builds.
124
+ * - Clean dist folders (clean build)
125
+ * - Run lint + build concurrently
126
+ * - node/browser/neutral targets: esbuild JS build + dts generation
127
+ * - client targets: Vite production build + typecheck + Capacitor/Electron builds
128
+ * - server targets: esbuild JS build
129
129
  */
130
130
  export class BuildOrchestrator {
131
131
  private readonly _cwd: string;
@@ -143,34 +143,34 @@ export class BuildOrchestrator {
143
143
  }
144
144
 
145
145
  /**
146
- * Orchestrator 초기화
147
- * - sd.config.ts 로드
148
- * - replaceDeps 설정
149
- * - 패키지 분류
150
- * - 환경변수 준비
146
+ * Initialize Orchestrator
147
+ * - Load sd.config.ts
148
+ * - Configure replaceDeps
149
+ * - Classify packages
150
+ * - Prepare environment variables
151
151
  */
152
152
  async initialize(): Promise<void> {
153
- this._logger.debug("빌드 시작", { targets: this._options.targets });
153
+ this._logger.debug("build started", { targets: this._options.targets });
154
154
 
155
- // sd.config.ts 로드
155
+ // Load sd.config.ts
156
156
  try {
157
157
  this._sdConfig = await loadSdConfig({
158
158
  cwd: this._cwd,
159
159
  dev: false,
160
160
  opt: this._options.options,
161
161
  });
162
- this._logger.debug("sd.config.ts 로드 완료");
162
+ this._logger.debug("sd.config.ts loaded");
163
163
  } catch (err) {
164
- this._logger.error(`sd.config.ts 로드 실패: ${err instanceof Error ? err.message : err}`);
164
+ this._logger.error(`sd.config.ts load failed: ${err instanceof Error ? err.message : err}`);
165
165
  process.exitCode = 1;
166
166
  throw err;
167
167
  }
168
168
 
169
- // VER, DEV 환경변수 준비
169
+ // Prepare VER and DEV environment variables
170
170
  const version = await getVersion(this._cwd);
171
171
  this._baseEnv = { VER: version, DEV: "false" };
172
172
 
173
- // 패키지 분류
173
+ // Classify packages
174
174
  this._classified = classifyPackages(this._sdConfig.packages, this._options.targets);
175
175
  this._allPackageNames = [
176
176
  ...this._classified.buildPackages.map((p) => p.name),
@@ -179,11 +179,11 @@ export class BuildOrchestrator {
179
179
  ];
180
180
 
181
181
  if (this._allPackageNames.length === 0) {
182
- process.stdout.write("✔ 빌드할 패키지가 없습니다.\n");
182
+ process.stdout.write("✔ No packages to build.\n");
183
183
  return;
184
184
  }
185
185
 
186
- this._logger.debug("패키지 분류 완료", {
186
+ this._logger.debug("package classification complete", {
187
187
  buildPackages: this._classified.buildPackages.map((p) => p.name),
188
188
  clientPackages: this._classified.clientPackages.map((p) => p.name),
189
189
  serverPackages: this._classified.serverPackages.map((p) => p.name),
@@ -191,12 +191,12 @@ export class BuildOrchestrator {
191
191
  }
192
192
 
193
193
  /**
194
- * 빌드 실행
194
+ * Execute build
195
195
  * - Clean
196
196
  * - Lint + Build (concurrent)
197
- * - 결과 출력
197
+ * - Output results
198
198
  *
199
- * @returns 에러 여부 (true: 에러 있음)
199
+ * @returns whether errors occurred (true: errors present)
200
200
  */
201
201
  async start(): Promise<boolean> {
202
202
  if (this._allPackageNames.length === 0) {
@@ -206,29 +206,29 @@ export class BuildOrchestrator {
206
206
  const classified = this._classified!;
207
207
  const baseEnv = this._baseEnv!;
208
208
 
209
- // 결과 수집
209
+ // Collect results
210
210
  const results: BuildStepResult[] = [];
211
- // 에러 추적 (객체로 래핑하여 콜백 수정 추적 가능하게 )
211
+ // Track errors (wrapped in object to allow mutation tracking in callbacks)
212
212
  const state = { hasError: false };
213
213
 
214
- // Worker 경로
214
+ // Worker paths
215
215
  const libraryWorkerPath = import.meta.resolve("../workers/library.worker");
216
216
  const serverWorkerPath = import.meta.resolve("../workers/server.worker");
217
217
  const clientWorkerPath = import.meta.resolve("../workers/client.worker");
218
218
  const dtsWorkerPath = import.meta.resolve("../workers/dts.worker");
219
219
  const lintWorkerPath = import.meta.resolve("../workers/lint.worker");
220
220
 
221
- // 파일 캐시 (diagnostics 출력용)
221
+ // File cache (for diagnostics output)
222
222
  const fileCache = new Map<string, string>();
223
223
 
224
- // formatHost (diagnostics 출력용)
224
+ // formatHost (for diagnostics output)
225
225
  const formatHost: ts.FormatDiagnosticsHost = {
226
226
  getCanonicalFileName: (f) => f,
227
227
  getCurrentDirectory: () => this._cwd,
228
228
  getNewLine: () => ts.sys.newLine,
229
229
  };
230
230
 
231
- // Lint 옵션 (전체 패키지 대상)
231
+ // Lint options (target all packages)
232
232
  const lintOptions: LintOptions = {
233
233
  targets: this._allPackageNames.map((name) => `packages/${name}`),
234
234
  fix: false,
@@ -243,17 +243,17 @@ export class BuildOrchestrator {
243
243
  // Phase 2: Lint + Build (concurrent)
244
244
  this._logger.start("Lint + Build");
245
245
 
246
- // 빌드 작업 목록 생성
246
+ // Create list of build tasks
247
247
  const buildTasks: Array<() => Promise<void>> = [];
248
248
 
249
- // buildPackages: JS 빌드 + dts 생성
249
+ // buildPackages: JS build + dts generation
250
250
  for (const { name, config } of classified.buildPackages) {
251
251
  const pkgDir = path.join(this._cwd, "packages", name);
252
252
  const env: TypecheckEnv = config.target === "node" ? "node" : "browser";
253
253
 
254
254
  buildTasks.push(async () => {
255
- this._logger.debug(`${name} (${config.target}) 시작`);
256
- // JS 빌드와 DTS 생성을 병렬 실행
255
+ this._logger.debug(`${name} (${config.target}) started`);
256
+ // Run JS build and DTS generation in parallel
257
257
  const libraryWorker: WorkerProxy<typeof LibraryWorkerModule> =
258
258
  Worker.create<typeof LibraryWorkerModule>(libraryWorkerPath);
259
259
  const dtsWorker: WorkerProxy<typeof DtsWorkerModule> =
@@ -261,13 +261,13 @@ export class BuildOrchestrator {
261
261
 
262
262
  try {
263
263
  const [buildResult, dtsResult] = await Promise.all([
264
- // JS 빌드
264
+ // JS build
265
265
  libraryWorker.build({ name, config, cwd: this._cwd, pkgDir }),
266
- // DTS 생성
266
+ // DTS generation
267
267
  dtsWorker.build({ name, cwd: this._cwd, pkgDir, env, emit: true }),
268
268
  ]);
269
269
 
270
- // JS 빌드 결과 처리
270
+ // Handle JS build results
271
271
  results.push({
272
272
  name,
273
273
  target: config.target,
@@ -278,7 +278,7 @@ export class BuildOrchestrator {
278
278
  });
279
279
  if (!buildResult.success) state.hasError = true;
280
280
 
281
- // DTS 결과 처리
281
+ // Handle DTS results
282
282
  const diagnostics = dtsResult.diagnostics.map((d) => deserializeDiagnostic(d, fileCache));
283
283
  results.push({
284
284
  name,
@@ -293,21 +293,21 @@ export class BuildOrchestrator {
293
293
  await Promise.all([libraryWorker.terminate(), dtsWorker.terminate()]);
294
294
  }
295
295
 
296
- // copySrc 파일 복사
296
+ // Copy copySrc files
297
297
  if (config.copySrc != null && config.copySrc.length > 0) {
298
298
  await copySrcFiles(pkgDir, config.copySrc);
299
299
  }
300
- this._logger.debug(`${name} (${config.target}) 완료`);
300
+ this._logger.debug(`${name} (${config.target}) completed`);
301
301
  });
302
302
  }
303
303
 
304
- // clientPackages: Vite 빌드 + typecheck + Capacitor 빌드
304
+ // clientPackages: Vite build + typecheck + Capacitor build
305
305
  for (const { name, config } of classified.clientPackages) {
306
306
  const pkgDir = path.join(this._cwd, "packages", name);
307
307
 
308
308
  buildTasks.push(async () => {
309
- this._logger.debug(`${name} (client) 시작`);
310
- // Vite 빌드와 타입체크를 병렬 실행
309
+ this._logger.debug(`${name} (client) started`);
310
+ // Run Vite build and typecheck in parallel
311
311
  const clientWorker: WorkerProxy<typeof ClientWorkerModule> =
312
312
  Worker.create<typeof ClientWorkerModule>(clientWorkerPath);
313
313
  const dtsWorker: WorkerProxy<typeof DtsWorkerModule> =
@@ -319,9 +319,9 @@ export class BuildOrchestrator {
319
319
  env: { ...baseEnv, ...config.env },
320
320
  };
321
321
  const [clientResult, dtsResult] = await Promise.all([
322
- // Vite production 빌드
322
+ // Vite production build
323
323
  clientWorker.build({ name, config: clientConfig, cwd: this._cwd, pkgDir }),
324
- // typecheck (dts 없이)
324
+ // typecheck (without dts)
325
325
  dtsWorker.build({
326
326
  name,
327
327
  cwd: this._cwd,
@@ -331,7 +331,7 @@ export class BuildOrchestrator {
331
331
  }),
332
332
  ]);
333
333
 
334
- // Vite 빌드 결과 처리
334
+ // Handle Vite build results
335
335
  results.push({
336
336
  name,
337
337
  target: "client",
@@ -341,7 +341,7 @@ export class BuildOrchestrator {
341
341
  });
342
342
  if (!clientResult.success) state.hasError = true;
343
343
 
344
- // 타입체크 결과 처리
344
+ // Handle typecheck results
345
345
  const diagnostics = dtsResult.diagnostics.map((d) => deserializeDiagnostic(d, fileCache));
346
346
  results.push({
347
347
  name,
@@ -356,7 +356,7 @@ export class BuildOrchestrator {
356
356
  await Promise.all([clientWorker.terminate(), dtsWorker.terminate()]);
357
357
  }
358
358
 
359
- // Capacitor 빌드 (설정이 있는 경우만)
359
+ // Capacitor build (only if configured)
360
360
  if (config.capacitor != null) {
361
361
  const outPath = path.join(pkgDir, "dist");
362
362
  try {
@@ -381,7 +381,7 @@ export class BuildOrchestrator {
381
381
  }
382
382
  }
383
383
 
384
- // Electron 빌드 (설정이 있는 경우만)
384
+ // Electron build (only if configured)
385
385
  if (config.electron != null) {
386
386
  const outPath = path.join(pkgDir, "dist");
387
387
  try {
@@ -405,16 +405,16 @@ export class BuildOrchestrator {
405
405
  state.hasError = true;
406
406
  }
407
407
  }
408
- this._logger.debug(`${name} (client) 완료`);
408
+ this._logger.debug(`${name} (client) completed`);
409
409
  });
410
410
  }
411
411
 
412
- // serverPackages: JS 빌드만 (dts 생성 제외)
412
+ // serverPackages: JS build only (dts generation excluded)
413
413
  for (const { name, config } of classified.serverPackages) {
414
414
  const pkgDir = path.join(this._cwd, "packages", name);
415
415
 
416
416
  buildTasks.push(async () => {
417
- this._logger.debug(`${name} (server) 시작`);
417
+ this._logger.debug(`${name} (server) started`);
418
418
  const serverWorker: WorkerProxy<typeof ServerWorkerModule> =
419
419
  Worker.create<typeof ServerWorkerModule>(serverWorkerPath);
420
420
 
@@ -442,11 +442,11 @@ export class BuildOrchestrator {
442
442
  } finally {
443
443
  await serverWorker.terminate();
444
444
  }
445
- this._logger.debug(`${name} (server) 완료`);
445
+ this._logger.debug(`${name} (server) completed`);
446
446
  });
447
447
  }
448
448
 
449
- // Lint + 모든 빌드를 병렬 실행
449
+ // Run Lint + all builds in parallel
450
450
  const lintWorker = Worker.create<typeof LintWorkerModule>(lintWorkerPath);
451
451
  const lintTask = async (): Promise<void> => {
452
452
  try {
@@ -459,17 +459,17 @@ export class BuildOrchestrator {
459
459
  await Promise.allSettled([lintTask(), ...buildTasks.map((task) => task())]);
460
460
  this._logger.success("Lint + Build");
461
461
 
462
- // 결과 출력
462
+ // Output results
463
463
  const allDiagnostics: ts.Diagnostic[] = [];
464
464
  for (const result of results) {
465
465
  const typeLabel = result.type === "dts" ? "dts" : result.target;
466
466
 
467
- // warnings 출력
467
+ // Output warnings
468
468
  if (result.warnings != null) {
469
469
  this._logger.warn(formatBuildMessages(result.name, typeLabel, result.warnings));
470
470
  }
471
471
 
472
- // errors 출력
472
+ // Output errors
473
473
  if (!result.success) {
474
474
  if (result.errors != null) {
475
475
  this._logger.error(formatBuildMessages(result.name, typeLabel, result.errors));
@@ -482,29 +482,29 @@ export class BuildOrchestrator {
482
482
  }
483
483
  }
484
484
 
485
- // diagnostics 출력 (중복 제거)
485
+ // Output diagnostics (deduplicated)
486
486
  if (allDiagnostics.length > 0) {
487
487
  const uniqueDiagnostics = ts.sortAndDeduplicateDiagnostics(allDiagnostics);
488
488
  const message = ts.formatDiagnosticsWithColorAndContext(uniqueDiagnostics, formatHost);
489
489
  process.stdout.write(message);
490
490
  }
491
491
 
492
- // 결과 로그 출력
492
+ // Output result log
493
493
  if (state.hasError) {
494
- this._logger.error("빌드 실패");
494
+ this._logger.error("Build failed");
495
495
  } else {
496
- this._logger.info("빌드 완료");
496
+ this._logger.info("Build completed");
497
497
  }
498
498
 
499
499
  return state.hasError;
500
500
  }
501
501
 
502
502
  /**
503
- * Orchestrator 종료 (현재는 정리할 리소스 없음)
503
+ * Shutdown Orchestrator (no resources to clean up currently)
504
504
  */
505
505
  async shutdown(): Promise<void> {
506
- // 프로덕션 빌드는 일회성이므로 종료 정리할 리소스가 없음
507
- // Worker는 빌드 태스크 내에서 terminate() 정리됨
506
+ // Production builds are one-time operations, so there are no resources to clean up at shutdown
507
+ // Workers are cleaned up with terminate() within each build task
508
508
  await Promise.resolve();
509
509
  }
510
510
  }