@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
@@ -10,28 +10,28 @@ import stylelint from "stylelint";
10
10
  //#region Types
11
11
 
12
12
  /**
13
- * ESLint 실행 옵션
13
+ * ESLint execution options
14
14
  */
15
15
  export interface LintOptions {
16
- /** 린트할 경로 필터 (예: `packages/core-common`). 배열이면 전체 대상 */
16
+ /** Path filter for linting (e.g., `packages/core-common`). Empty array targets everything */
17
17
  targets: string[];
18
- /** 자동 수정 활성화 */
18
+ /** Enable auto-fix */
19
19
  fix: boolean;
20
- /** ESLint 규칙별 실행 시간 측정 활성화 (TIMING 환경변수 설정) */
20
+ /** Enable execution time measurement per ESLint rule (sets TIMING environment variable) */
21
21
  timing: boolean;
22
22
  }
23
23
 
24
24
  /**
25
- * executeLint()의 반환 타입
25
+ * Return type of executeLint()
26
26
  */
27
27
  export interface LintResult {
28
- /** 린트 에러가 없으면 true */
28
+ /** true if there are no lint errors */
29
29
  success: boolean;
30
- /** ESLint + Stylelint 에러 합계 */
30
+ /** Total error count from ESLint + Stylelint */
31
31
  errorCount: number;
32
- /** ESLint + Stylelint 경고 합계 */
32
+ /** Total warning count from ESLint + Stylelint */
33
33
  warningCount: number;
34
- /** 포맷터 출력 문자열 (stdout에 내용) */
34
+ /** Formatter output string (content to write to stdout) */
35
35
  formattedOutput: string;
36
36
  }
37
37
 
@@ -39,7 +39,7 @@ export interface LintResult {
39
39
 
40
40
  //#region Utilities
41
41
 
42
- /** ESLint 설정 파일 탐색 순서 */
42
+ /** ESLint config file search order */
43
43
  const ESLINT_CONFIG_FILES = [
44
44
  "eslint.config.ts",
45
45
  "eslint.config.mts",
@@ -47,7 +47,7 @@ const ESLINT_CONFIG_FILES = [
47
47
  "eslint.config.mjs",
48
48
  ] as const;
49
49
 
50
- /** Stylelint 설정 파일 탐색 순서 */
50
+ /** Stylelint config file search order */
51
51
  const STYLELINT_CONFIG_FILES = [
52
52
  "stylelint.config.ts",
53
53
  "stylelint.config.mts",
@@ -58,21 +58,21 @@ const STYLELINT_CONFIG_FILES = [
58
58
  ] as const;
59
59
 
60
60
  /**
61
- * ignores 속성만 가진 ESLint 설정 객체인지 검사하는 타입 가드
61
+ * Type guard to check if an ESLint config object has only ignores property
62
62
  */
63
63
  function isGlobalIgnoresConfig(item: unknown): item is { ignores: string[] } {
64
64
  if (item == null || typeof item !== "object") return false;
65
65
  if (!("ignores" in item)) return false;
66
- if ("files" in item) return false; // files 있으면 globalIgnores가 아님
66
+ if ("files" in item) return false; // if files exists, it's not globalIgnores
67
67
  const ignores = (item as { ignores: unknown }).ignores;
68
68
  if (!Array.isArray(ignores)) return false;
69
69
  return ignores.every((i) => typeof i === "string");
70
70
  }
71
71
 
72
72
  /**
73
- * eslint.config.ts/js에서 globalIgnores 패턴을 추출한다.
74
- * files 속성 없이 ignores 있는 설정 객체가 globalIgnores이다.
75
- * @internal 테스트용으로 export
73
+ * Extract globalIgnores patterns from eslint.config.ts/js.
74
+ * A config object with only ignores (no files) is a globalIgnores.
75
+ * @internal exported for testing
76
76
  */
77
77
  export async function loadIgnorePatterns(cwd: string): Promise<string[]> {
78
78
  let configPath: string | undefined;
@@ -86,7 +86,7 @@ export async function loadIgnorePatterns(cwd: string): Promise<string[]> {
86
86
 
87
87
  if (configPath == null) {
88
88
  throw new SdError(
89
- `ESLint 설정 파일을 찾을 없습니다 (cwd: ${cwd}): ${ESLINT_CONFIG_FILES.join(", ")}`,
89
+ `Cannot find ESLint config file (cwd: ${cwd}): ${ESLINT_CONFIG_FILES.join(", ")}`,
90
90
  );
91
91
  }
92
92
 
@@ -105,18 +105,18 @@ export async function loadIgnorePatterns(cwd: string): Promise<string[]> {
105
105
  ) {
106
106
  configs = configModule.default;
107
107
  } else {
108
- throw new SdError(`ESLint 설정 파일이 올바른 형식이 아닙니다: ${configPath}`);
108
+ throw new SdError(`ESLint config file is not in correct format: ${configPath}`);
109
109
  }
110
110
 
111
111
  if (!Array.isArray(configs)) {
112
- throw new SdError(`ESLint 설정이 배열이 아닙니다: ${configPath}`);
112
+ throw new SdError(`ESLint config is not an array: ${configPath}`);
113
113
  }
114
114
 
115
115
  return configs.filter(isGlobalIgnoresConfig).flatMap((item) => item.ignores);
116
116
  }
117
117
 
118
118
  /**
119
- * Stylelint 설정 파일이 존재하는지 확인한다.
119
+ * Check if Stylelint config file exists.
120
120
  */
121
121
  async function hasStylelintConfig(cwd: string): Promise<boolean> {
122
122
  for (const f of STYLELINT_CONFIG_FILES) {
@@ -130,36 +130,36 @@ async function hasStylelintConfig(cwd: string): Promise<boolean> {
130
130
  //#region Main
131
131
 
132
132
  /**
133
- * ESLint/Stylelint 실행하고 결과를 반환한다.
133
+ * Run ESLint/Stylelint and return results.
134
134
  *
135
- * - `eslint.config.ts/js`에서 globalIgnores 패턴을 추출하여 glob 필터링에 적용
136
- * - consola를 사용하여 진행 상황 표시
137
- * - 캐시 활성화 (`.cache/eslint.cache`에 저장, 설정 변경 자동 무효화)
138
- * - stdout 출력이나 process.exitCode 설정은 하지 않음 (호출자가 판단)
135
+ * - Extract globalIgnores patterns from `eslint.config.ts/js` and apply to glob filtering
136
+ * - Show progress using consola
137
+ * - Enable cache (saved to `.cache/eslint.cache`, auto invalidated on config changes)
138
+ * - No stdout output or process.exitCode setting (caller decides)
139
139
  *
140
- * @param options - 린트 실행 옵션
141
- * @returns 린트 결과 (성공 여부, 에러/경고 수, 포맷터 출력)
140
+ * @param options - lint execution options
141
+ * @returns lint result (success status, error/warning counts, formatter output)
142
142
  */
143
143
  export async function executeLint(options: LintOptions): Promise<LintResult> {
144
144
  const { targets, fix, timing } = options;
145
145
  const cwd = process.cwd();
146
146
  const logger = consola.withTag("sd:cli:lint");
147
147
 
148
- logger.debug("린트 시작", { targets, fix, timing });
148
+ logger.debug("start lint", { targets, fix, timing });
149
149
 
150
- // TIMING 환경변수 설정
150
+ // Set TIMING environment variable
151
151
  if (timing) {
152
152
  process.env["TIMING"] = "1";
153
153
  }
154
154
 
155
- // ESLint 설정 로드
156
- logger.start("ESLint 설정 로드");
155
+ // Load ESLint configuration
156
+ logger.start("loading ESLint config");
157
157
  const ignorePatterns = await loadIgnorePatterns(cwd);
158
- logger.debug("ignore 패턴 로드 완료", { ignorePatternCount: ignorePatterns.length });
159
- logger.success(`ESLint 설정 로드 (${ignorePatterns.length} ignore 패턴)`);
158
+ logger.debug("ignore patterns loaded", { ignorePatternCount: ignorePatterns.length });
159
+ logger.success(`loaded ESLint config (${ignorePatterns.length} ignore patterns)`);
160
160
 
161
- // 린트 대상 파일 수집
162
- logger.start("린트 대상 파일 수집");
161
+ // Collect lint target files
162
+ logger.start("collecting lint target files");
163
163
  let files = await fsGlob("**/*.{ts,tsx,js,jsx}", {
164
164
  cwd,
165
165
  ignore: ignorePatterns,
@@ -167,14 +167,14 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
167
167
  absolute: true,
168
168
  });
169
169
  files = pathFilterByTargets(files, targets, cwd);
170
- logger.debug("파일 수집 완료", { fileCount: files.length });
171
- logger.success(`린트 대상 파일 수집 (${files.length})`);
170
+ logger.debug("file collection complete", { fileCount: files.length });
171
+ logger.success(`collected lint target files (${files.length} files)`);
172
172
 
173
- // 린트 실행
173
+ // Run lint
174
174
  let eslint: ESLint | undefined;
175
175
  let eslintResults: ESLint.LintResult[] | undefined;
176
176
  if (files.length > 0) {
177
- logger.start(`린트 실행 중... (${files.length} 파일)`);
177
+ logger.start(`running lint... (${files.length} files)`);
178
178
  eslint = new ESLint({
179
179
  cwd,
180
180
  fix,
@@ -182,13 +182,13 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
182
182
  cacheLocation: path.join(cwd, ".cache", "eslint.cache"),
183
183
  });
184
184
  eslintResults = await eslint.lintFiles(files);
185
- logger.success("린트 실행 완료");
185
+ logger.success("lint complete");
186
186
 
187
- // 자동 수정 적용
187
+ // Apply auto-fix
188
188
  if (fix) {
189
- logger.debug("자동 수정 적용 중...");
189
+ logger.debug("applying auto-fix...");
190
190
  await ESLint.outputFixes(eslintResults);
191
- logger.debug("자동 수정 적용 완료");
191
+ logger.debug("auto-fix applied");
192
192
  }
193
193
  }
194
194
 
@@ -196,7 +196,7 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
196
196
  const hasStylelintCfg = await hasStylelintConfig(cwd);
197
197
  let stylelintResult: stylelint.LinterResult | undefined;
198
198
  if (hasStylelintCfg) {
199
- logger.start("CSS 파일 수집");
199
+ logger.start("collecting CSS files");
200
200
  let cssFiles = await fsGlob("**/*.css", {
201
201
  cwd,
202
202
  ignore: ignorePatterns,
@@ -204,10 +204,10 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
204
204
  absolute: true,
205
205
  });
206
206
  cssFiles = pathFilterByTargets(cssFiles, targets, cwd);
207
- logger.success(`CSS 파일 수집 (${cssFiles.length})`);
207
+ logger.success(`collected CSS files (${cssFiles.length} files)`);
208
208
 
209
209
  if (cssFiles.length > 0) {
210
- logger.start(`Stylelint 실행 중... (${cssFiles.length} 파일)`);
210
+ logger.start(`running Stylelint... (${cssFiles.length} files)`);
211
211
  let configFile: string | undefined;
212
212
  for (const f of STYLELINT_CONFIG_FILES) {
213
213
  const configPath = path.join(cwd, f);
@@ -217,7 +217,7 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
217
217
  }
218
218
  }
219
219
 
220
- // TypeScript 설정 파일 지원: jiti 로드 config 객체로 전달
220
+ // Support TypeScript config files: load with jiti, pass as config object
221
221
  let stylelintOptions: stylelint.LinterOptions;
222
222
  if (configFile != null && /\.ts$/.test(configFile)) {
223
223
  const jiti = createJiti(import.meta.url);
@@ -241,29 +241,29 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
241
241
  };
242
242
  }
243
243
  stylelintResult = await stylelint.lint(stylelintOptions);
244
- logger.success("Stylelint 실행 완료");
244
+ logger.success("Stylelint execution complete");
245
245
  }
246
246
  }
247
247
 
248
- // 파일이 없거나 린트가 실행되지 않았으면 성공 결과 반환
248
+ // Return success result if no files or lint was not executed
249
249
  if (files.length === 0 || eslintResults == null || eslint == null) {
250
- logger.info("린트할 파일 없음");
250
+ logger.info("no files to lint");
251
251
  return { success: true, errorCount: 0, warningCount: 0, formattedOutput: "" };
252
252
  }
253
253
 
254
- // 결과 집계
254
+ // Aggregate results
255
255
  let errorCount = eslintResults.sum((r) => r.errorCount);
256
256
  let warningCount = eslintResults.sum((r) => r.warningCount);
257
257
 
258
258
  if (errorCount > 0) {
259
- logger.error("린트 에러 발생", { errorCount, warningCount });
259
+ logger.error("lint errors occurred", { errorCount, warningCount });
260
260
  } else if (warningCount > 0) {
261
- logger.info("린트 완료 (경고 있음)", { errorCount, warningCount });
261
+ logger.info("lint complete (warnings present)", { errorCount, warningCount });
262
262
  } else {
263
- logger.info("린트 완료", { errorCount, warningCount });
263
+ logger.info("lint complete", { errorCount, warningCount });
264
264
  }
265
265
 
266
- // 포맷터 출력 수집
266
+ // Collect formatter output
267
267
  let formattedOutput = "";
268
268
  const formatter = await eslint.loadFormatter("stylish");
269
269
  const resultText = await formatter.format(eslintResults);
@@ -271,7 +271,7 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
271
271
  formattedOutput += resultText;
272
272
  }
273
273
 
274
- // Stylelint 결과 수집
274
+ // Collect Stylelint results
275
275
  if (stylelintResult != null && stylelintResult.results.length > 0) {
276
276
  const stylelintErrorCount = stylelintResult.results.sum(
277
277
  (r) => r.warnings.filter((w) => w.severity === "error").length,
@@ -284,23 +284,23 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
284
284
  warningCount += stylelintWarningCount;
285
285
 
286
286
  if (stylelintErrorCount > 0) {
287
- logger.error("Stylelint 에러 발생", {
287
+ logger.error("Stylelint errors occurred", {
288
288
  errorCount: stylelintErrorCount,
289
289
  warningCount: stylelintWarningCount,
290
290
  });
291
291
  } else if (stylelintWarningCount > 0) {
292
- logger.info("Stylelint 완료 (경고 있음)", {
292
+ logger.info("Stylelint complete (warnings present)", {
293
293
  errorCount: stylelintErrorCount,
294
294
  warningCount: stylelintWarningCount,
295
295
  });
296
296
  } else {
297
- logger.info("Stylelint 완료", {
297
+ logger.info("Stylelint complete", {
298
298
  errorCount: stylelintErrorCount,
299
299
  warningCount: stylelintWarningCount,
300
300
  });
301
301
  }
302
302
 
303
- // Stylelint formatter 출력
303
+ // Stylelint formatter output
304
304
  const stylelintFormatter = await stylelint.formatters.string;
305
305
  const stylelintOutput = stylelintFormatter(stylelintResult.results, stylelintResult);
306
306
  if (stylelintOutput) {
@@ -317,12 +317,12 @@ export async function executeLint(options: LintOptions): Promise<LintResult> {
317
317
  }
318
318
 
319
319
  /**
320
- * ESLint를 실행한다.
320
+ * Run ESLint.
321
321
  *
322
- * executeLint() 호출하고 결과를 stdout 출력한 exitCode를 설정하는 래퍼.
322
+ * Wrapper that calls executeLint(), outputs results to stdout, and sets exitCode.
323
323
  *
324
- * @param options - 린트 실행 옵션
325
- * @returns 완료 resolve. 에러 발견 `process.exitCode`를 1 설정하고 resolve (throw하지 않음)
324
+ * @param options - lint execution options
325
+ * @returns resolves when complete. If errors are found, sets `process.exitCode` to 1 and resolves (does not throw)
326
326
  */
327
327
  export async function runLint(options: LintOptions): Promise<void> {
328
328
  const result = await executeLint(options);