@simplysm/sd-cli 13.0.69 → 13.0.71

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
@@ -3,15 +3,15 @@ import { loadSdConfig } from "../utils/sd-config";
3
3
  import { setupReplaceDeps } from "../utils/replace-deps";
4
4
 
5
5
  /**
6
- * replace-deps 명령 옵션
6
+ * replace-deps command options
7
7
  */
8
8
  export interface ReplaceDepsOptions {
9
- /** sd.config.ts 전달할 추가 옵션 */
9
+ /** Additional options to pass to sd.config.ts */
10
10
  options: string[];
11
11
  }
12
12
 
13
13
  /**
14
- * sd.config.ts의 replaceDeps 설정에 따라 node_modules 패키지를 로컬 소스로 symlink 교체한다.
14
+ * Replace node_modules packages with symlinks to local source based on replaceDeps config in sd.config.ts.
15
15
  */
16
16
  export async function runReplaceDeps(opts: ReplaceDepsOptions): Promise<void> {
17
17
  const cwd = process.cwd();
@@ -19,7 +19,7 @@ export async function runReplaceDeps(opts: ReplaceDepsOptions): Promise<void> {
19
19
  const sdConfig = await loadSdConfig({ cwd, dev: false, opt: opts.options });
20
20
 
21
21
  if (sdConfig.replaceDeps == null) {
22
- consola.warn("sd.config.ts에 replaceDeps 설정이 없습니다.");
22
+ consola.warn("No replaceDeps config found in sd.config.ts.");
23
23
  return;
24
24
  }
25
25
 
@@ -14,17 +14,17 @@ import type * as DtsWorkerModule from "../workers/dts.worker";
14
14
  //#region Types
15
15
 
16
16
  /**
17
- * TypeScript 타입체크 옵션
17
+ * TypeScript typecheck options
18
18
  */
19
19
  export interface TypecheckOptions {
20
- /** 타입체크할 경로 필터 (예: `packages/core-common`). 배열이면 tsconfig.json에 정의된 모든 파일 대상 */
20
+ /** Path filter for typecheck (e.g., `packages/core-common`). Empty array targets all files defined in tsconfig.json */
21
21
  targets: string[];
22
- /** sd.config.ts 전달할 추가 옵션 */
22
+ /** Additional options to pass to sd.config.ts */
23
23
  options: string[];
24
24
  }
25
25
 
26
26
  /**
27
- * TypeScript 타입체크 실행 결과
27
+ * TypeScript typecheck execution result
28
28
  */
29
29
  export interface TypecheckResult {
30
30
  success: boolean;
@@ -33,18 +33,18 @@ export interface TypecheckResult {
33
33
  formattedOutput: string;
34
34
  }
35
35
 
36
- // 패키지 정보 (packages/* 하위 파일 분류용)
36
+ // Package information (for classifying files under packages/*)
37
37
  interface PackageInfo {
38
38
  name: string;
39
39
  dir: string;
40
- envs: TypecheckEnv[]; // neutral ["node", "browser"], 나머지는 단일 환경
40
+ envs: TypecheckEnv[]; // neutral is ["node", "browser"], others are single environment
41
41
  }
42
42
 
43
- // 타입체크 작업 정보 (내부 사용)
43
+ // Typecheck task information (internal use)
44
44
  interface TypecheckTask {
45
- /** 작업 표시 이름 (예: "패키지: core-common [node]") */
45
+ /** Task display name (e.g., "package: core-common [node]") */
46
46
  displayName: string;
47
- /** dts.worker 전달할 정보 */
47
+ /** Information to pass to dts.worker */
48
48
  buildInfo: DtsBuildInfo;
49
49
  }
50
50
 
@@ -52,31 +52,31 @@ interface TypecheckTask {
52
52
 
53
53
  //#region Utilities
54
54
 
55
- /** 경로 분류용 정규표현식 */
55
+ /** Regular expression for path classification */
56
56
  const PATH_PATTERNS = {
57
57
  /** packages/{pkg}/... */
58
58
  PACKAGE: /^packages\/([^/]+)\//,
59
59
  } as const;
60
60
 
61
61
  /**
62
- * 패키지 타겟을 타입체크 환경 목록으로 변환합니다.
63
- * - node/browser: 해당 환경만
64
- * - neutral: node + browser 둘 다
65
- * - client: browser로 처리
66
- * @param target 패키지 빌드 타겟
67
- * @returns 타입체크 환경 목록
62
+ * Convert package target to typecheck environment list.
63
+ * - node/browser: that environment only
64
+ * - neutral: both node + browser
65
+ * - client: treated as browser
66
+ * @param target package build target
67
+ * @returns list of typecheck environments
68
68
  */
69
69
  function toTypecheckEnvs(target: string | undefined): TypecheckEnv[] {
70
70
  if (target === "node") return ["node"];
71
71
  if (target === "browser" || target === "client") return ["browser"];
72
- // neutral 또는 미지정은 둘 다
72
+ // neutral or unspecified: both
73
73
  return ["node", "browser"];
74
74
  }
75
75
 
76
76
  /**
77
- * 파일 경로에서 패키지 정보를 추출합니다.
78
- * scripts 타겟 패키지는 제외합니다.
79
- * @internal 테스트용으로 export
77
+ * Extract package information from file paths.
78
+ * Excludes packages with scripts target.
79
+ * @internal exported for testing
80
80
  */
81
81
  export function extractPackages(
82
82
  fileNames: string[],
@@ -92,7 +92,7 @@ export function extractPackages(
92
92
  const packageMatch = relativePath.match(PATH_PATTERNS.PACKAGE);
93
93
  if (packageMatch) {
94
94
  const pkgName = packageMatch[1];
95
- // scripts 타겟 패키지는 제외
95
+ // Exclude packages with scripts target
96
96
  if (config.packages[pkgName]?.target === "scripts") continue;
97
97
 
98
98
  if (!packages.has(pkgName)) {
@@ -109,24 +109,24 @@ export function extractPackages(
109
109
  }
110
110
 
111
111
  /**
112
- * tsconfig 파일 목록에서 packages/ 하위가 아닌 파일이 있는지 확인합니다.
112
+ * Check if there are files not under packages/ in the tsconfig file list.
113
113
  */
114
114
  function hasNonPackageFiles(fileNames: string[], cwd: string): boolean {
115
115
  return fileNames.some((f) => {
116
116
  const relativePath = pathPosix(path.relative(cwd, f));
117
117
  if (!relativePath.startsWith("packages/")) return true;
118
- // 패키지 루트 직속 파일(설정 파일) non-package로 처리
118
+ // Also treat files directly under package root (config files) as non-package
119
119
  return relativePath.split("/").length === 3;
120
120
  });
121
121
  }
122
122
 
123
123
  /**
124
- * 패키지 정보로부터 타입체크 작업 목록을 생성합니다.
125
- * neutral 패키지는 node/browser 환경으로 분리하여 각각 체크합니다.
126
- * @param packages 패키지 정보
127
- * @param cwd 현재 작업 디렉토리
128
- * @param includeNonPackage non-package 파일이 있으면 "기타" 작업 추가
129
- * @returns 타입체크 작업 정보 배열
124
+ * Create typecheck task list from package information.
125
+ * Neutral packages are split into node/browser environments and checked separately.
126
+ * @param packages package information map
127
+ * @param cwd current working directory
128
+ * @param includeNonPackage add "other" task if non-package files exist
129
+ * @returns array of typecheck task information
130
130
  */
131
131
  function createTypecheckTasks(
132
132
  packages: Map<string, PackageInfo>,
@@ -135,27 +135,27 @@ function createTypecheckTasks(
135
135
  ): TypecheckTask[] {
136
136
  const tasks: TypecheckTask[] = [];
137
137
 
138
- // packages/* - env마다 별도 task 생성
138
+ // packages/* - create separate task per env
139
139
  for (const info of packages.values()) {
140
140
  for (const env of info.envs) {
141
141
  const envSuffix = info.envs.length > 1 ? ` [${env}]` : "";
142
142
  tasks.push({
143
- displayName: `패키지: ${info.name}${envSuffix}`,
143
+ displayName: `package: ${info.name}${envSuffix}`,
144
144
  buildInfo: {
145
145
  name: info.name,
146
146
  cwd,
147
147
  pkgDir: info.dir,
148
148
  env,
149
- emit: false, // 타입체크만 수행 (dts 생성 안 함)
149
+ emit: false, // Only typecheck (no dts generation)
150
150
  },
151
151
  });
152
152
  }
153
153
  }
154
154
 
155
- // non-package 파일 (tests/, 루트 *.ts )
155
+ // non-package files (tests/, root *.ts, etc.)
156
156
  if (includeNonPackage) {
157
157
  tasks.push({
158
- displayName: "기타",
158
+ displayName: "other",
159
159
  buildInfo: {
160
160
  name: "root",
161
161
  cwd,
@@ -172,24 +172,24 @@ function createTypecheckTasks(
172
172
  //#region Main
173
173
 
174
174
  /**
175
- * TypeScript 타입체크를 실행하고 결과를 반환한다.
175
+ * Execute TypeScript typecheck and return results.
176
176
  *
177
- * - `tsconfig.json`을 로드하여 컴파일러 옵션 적용
178
- * - `sd.config.ts`를 로드하여 패키지별 타겟 정보 확인 (없으면 기본값 사용)
179
- * - Worker threads를 사용하여 실제 병렬 타입체크 수행
180
- * - incremental 컴파일 사용 (`.cache/typecheck-{env}.tsbuildinfo`)
181
- * - consola 로깅을 사용하여 진행 상황 표시
182
- * - stdout 출력이나 exitCode 설정 없이 결과만 반환
177
+ * - Load `tsconfig.json` to apply compiler options
178
+ * - Load `sd.config.ts` to check package target info per package (use defaults if missing)
179
+ * - Perform actual parallel typecheck using Worker threads
180
+ * - Use incremental compilation (`.cache/typecheck-{env}.tsbuildinfo`)
181
+ * - Show progress using consola logging
182
+ * - Return results only, no stdout output or exitCode setting
183
183
  *
184
- * @param options - 타입체크 실행 옵션
185
- * @returns 타입체크 결과 (성공 여부, 에러/경고 수, 포맷된 출력 문자열)
184
+ * @param options - typecheck execution options
185
+ * @returns typecheck result (success status, error/warning counts, formatted output string)
186
186
  */
187
187
  export async function executeTypecheck(options: TypecheckOptions): Promise<TypecheckResult> {
188
188
  const { targets } = options;
189
189
  const cwd = process.cwd();
190
190
  const logger = consola.withTag("sd:cli:typecheck");
191
191
 
192
- logger.debug("타입체크 시작", { targets });
192
+ logger.debug("start typecheck", { targets });
193
193
 
194
194
  const formatHost: ts.FormatDiagnosticsHost = {
195
195
  getCanonicalFileName: (f) => f,
@@ -197,7 +197,7 @@ export async function executeTypecheck(options: TypecheckOptions): Promise<Typec
197
197
  getNewLine: () => ts.sys.newLine,
198
198
  };
199
199
 
200
- // tsconfig.json 로드 및 파싱
200
+ // Load and parse tsconfig.json
201
201
  let parsedConfig: ts.ParsedCommandLine;
202
202
  try {
203
203
  parsedConfig = parseRootTsconfig(cwd);
@@ -206,38 +206,38 @@ export async function executeTypecheck(options: TypecheckOptions): Promise<Typec
206
206
  return { success: false, errorCount: 1, warningCount: 0, formattedOutput: "" };
207
207
  }
208
208
 
209
- // sd.config.ts 로드
209
+ // Load sd.config.ts
210
210
  let sdConfig: SdConfig;
211
211
  try {
212
212
  sdConfig = await loadSdConfig({ cwd, dev: false, opt: options.options });
213
- logger.debug("sd.config.ts 로드 완료");
213
+ logger.debug("sd.config.ts loaded");
214
214
  } catch (err) {
215
- // sd.config.ts 없거나 로드 실패 기본값 사용
215
+ // Use defaults if sd.config.ts is missing or load fails
216
216
  sdConfig = { packages: {} };
217
- logger.debug("sd.config.ts 로드 실패, 기본값 사용", err);
217
+ logger.debug("sd.config.ts load failed, using defaults", err);
218
218
  }
219
219
 
220
- // targets가 지정되면 fileNames 필터링
220
+ // Filter fileNames if targets specified
221
221
  const fileNames = pathFilterByTargets(parsedConfig.fileNames, targets, cwd);
222
222
 
223
223
  if (fileNames.length === 0) {
224
- logger.info("타입체크할 파일 없음");
224
+ logger.info("no files to typecheck");
225
225
  return {
226
226
  success: true,
227
227
  errorCount: 0,
228
228
  warningCount: 0,
229
- formattedOutput: "✔ 타입체크할 파일이 없습니다.\n",
229
+ formattedOutput: "✔ No files to typecheck.\n",
230
230
  };
231
231
  }
232
232
 
233
- // 패키지 정보 추출
233
+ // Extract package information
234
234
  const packages = extractPackages(fileNames, cwd, sdConfig);
235
- logger.debug("패키지 추출 완료", {
235
+ logger.debug("package extraction complete", {
236
236
  packageCount: packages.size,
237
237
  packages: [...packages.keys()],
238
238
  });
239
239
 
240
- // 타입체크 작업 생성
240
+ // Create typecheck tasks
241
241
  const nonPackage = hasNonPackageFiles(fileNames, cwd);
242
242
  const tasks = createTypecheckTasks(packages, cwd, nonPackage);
243
243
 
@@ -246,16 +246,16 @@ export async function executeTypecheck(options: TypecheckOptions): Promise<Typec
246
246
  success: true,
247
247
  errorCount: 0,
248
248
  warningCount: 0,
249
- formattedOutput: "✔ 타입체크할 대상이 없습니다.\n",
249
+ formattedOutput: "✔ No typecheck targets.\n",
250
250
  };
251
251
  }
252
252
 
253
- // 동시성 설정: CPU 코어의 7/8 사용 (일반적인 병렬 빌드 도구의 기본값, OS/다른 프로세스 여유분 확보, 최소 1, 작업 이하)
253
+ // Concurrency setting: use 7/8 of CPU cores (standard default for parallel build tools, reserves for OS/other processes, minimum 1, at most task count)
254
254
  const maxConcurrency = Math.max(Math.floor((os.cpus().length * 7) / 8), 1);
255
255
  const concurrency = Math.min(maxConcurrency, tasks.length);
256
- logger.debug("동시성 설정", { concurrency, maxConcurrency, taskCount: tasks.length });
256
+ logger.debug("concurrency configuration", { concurrency, maxConcurrency, taskCount: tasks.length });
257
257
 
258
- // Worker 풀 생성
258
+ // Create Worker pool
259
259
  const workerPath = import.meta.resolve("../workers/dts.worker");
260
260
  const workers: WorkerProxy<typeof DtsWorkerModule>[] = [];
261
261
  for (let i = 0; i < concurrency; i++) {
@@ -272,17 +272,17 @@ export async function executeTypecheck(options: TypecheckOptions): Promise<Typec
272
272
  const currentIndex = taskIndex++;
273
273
  const task = tasks[currentIndex];
274
274
 
275
- logger.debug(`[${task.displayName}] 타입체크 시작`);
275
+ logger.debug(`[${task.displayName}] typecheck started`);
276
276
  try {
277
277
  const result = await worker.build(task.buildInfo);
278
278
  allResults.push({ displayName: task.displayName, result });
279
279
  if (result.success) {
280
- logger.debug(`[${task.displayName}] 타입체크 완료`);
280
+ logger.debug(`[${task.displayName}] typecheck completed`);
281
281
  } else {
282
- logger.debug(`[${task.displayName}] 타입체크 실패`, { errorCount: result.errorCount });
282
+ logger.debug(`[${task.displayName}] typecheck failed`, { errorCount: result.errorCount });
283
283
  }
284
284
  } catch (err) {
285
- logger.error(`Worker 오류: ${task.displayName}`, {
285
+ logger.error(`Worker error: ${task.displayName}`, {
286
286
  error: errorMessage(err),
287
287
  });
288
288
  allResults.push({
@@ -299,18 +299,18 @@ export async function executeTypecheck(options: TypecheckOptions): Promise<Typec
299
299
  }
300
300
  }
301
301
 
302
- logger.start(`타입체크 실행 중... (${tasks.length} 대상, 동시성: ${concurrency})`);
302
+ logger.start(`Running typecheck... (${tasks.length} targets, concurrency: ${concurrency})`);
303
303
  await Promise.all(workers.map((worker) => runNextTask(worker)));
304
- logger.success("타입체크 실행 완료");
304
+ logger.success("Typecheck execution completed");
305
305
  } finally {
306
306
  await Promise.all(workers.map((w) => w.terminate()));
307
307
  }
308
308
 
309
- // 결과 집계
309
+ // Aggregate results
310
310
  const allDiagnostics: ts.Diagnostic[] = [];
311
311
  let totalErrorCount = 0;
312
312
  let totalWarningCount = 0;
313
- const fileCache = new Map<string, string>(); // 파일 내용 캐시 (동일 파일 중복 읽기 방지)
313
+ const fileCache = new Map<string, string>(); // File content cache (prevent duplicate reads of same file)
314
314
  for (const { result } of allResults) {
315
315
  totalErrorCount += result.errorCount;
316
316
  totalWarningCount += result.warningCount;
@@ -320,17 +320,17 @@ export async function executeTypecheck(options: TypecheckOptions): Promise<Typec
320
320
  }
321
321
 
322
322
  if (totalErrorCount > 0) {
323
- logger.error("타입체크 에러 발생", {
323
+ logger.error("typecheck errors occurred", {
324
324
  errorCount: totalErrorCount,
325
325
  warningCount: totalWarningCount,
326
326
  });
327
327
  } else if (totalWarningCount > 0) {
328
- logger.info("타입체크 완료 (경고 있음)", {
328
+ logger.info("typecheck complete (warnings present)", {
329
329
  errorCount: totalErrorCount,
330
330
  warningCount: totalWarningCount,
331
331
  });
332
332
  } else {
333
- logger.info("타입체크 완료", { errorCount: totalErrorCount, warningCount: totalWarningCount });
333
+ logger.info("typecheck complete", { errorCount: totalErrorCount, warningCount: totalWarningCount });
334
334
  }
335
335
 
336
336
  let formattedOutput = "";
@@ -348,12 +348,12 @@ export async function executeTypecheck(options: TypecheckOptions): Promise<Typec
348
348
  }
349
349
 
350
350
  /**
351
- * TypeScript 타입체크를 실행한다.
351
+ * Run TypeScript typecheck.
352
352
  *
353
- * `executeTypecheck()`를 호출하고 결과를 stdout 출력하며, 에러 발생 시 `process.exitCode`를 설정한다.
353
+ * Calls `executeTypecheck()`, outputs results to stdout, and sets `process.exitCode` if errors occur.
354
354
  *
355
- * @param options - 타입체크 실행 옵션
356
- * @returns 완료 resolve. 에러 발견 `process.exitCode`를 1 설정하고 resolve (throw하지 않음)
355
+ * @param options - typecheck execution options
356
+ * @returns resolves when complete. If errors are found, sets `process.exitCode` to 1 and resolves (does not throw)
357
357
  */
358
358
  export async function runTypecheck(options: TypecheckOptions): Promise<void> {
359
359
  const result = await executeTypecheck(options);
@@ -5,15 +5,15 @@ import {
5
5
  } from "../orchestrators/WatchOrchestrator";
6
6
 
7
7
  /**
8
- * Library 패키지를 watch 모드로 빌드한다.
8
+ * Build library packages in watch mode.
9
9
  *
10
- * - `sd.config.ts`를 로드하여 패키지별 빌드 타겟 정보 확인 (필수)
11
- * - `node`/`browser`/`neutral` 타겟: esbuild watch 모드로 빌드 + .d.ts 생성
12
- * - 파일 변경 자동 리빌드
13
- * - SIGINT/SIGTERM 시그널로 종료
10
+ * - Load `sd.config.ts` to check build target info per package (required)
11
+ * - `node`/`browser`/`neutral` target: build in esbuild watch mode + generate .d.ts
12
+ * - Auto rebuild on file changes
13
+ * - Terminate with SIGINT/SIGTERM signals
14
14
  *
15
- * @param options - watch 실행 옵션
16
- * @returns 종료 시그널 수신 시 resolve
15
+ * @param options - watch execution options
16
+ * @returns resolves on termination signal
17
17
  */
18
18
  export async function runWatch(options: WatchOrchestratorOptions): Promise<void> {
19
19
  const orchestrator = new WatchOrchestrator(options);