@simplysm/sd-cli 14.0.11 → 14.0.12

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 (263) hide show
  1. package/README.md +58 -253
  2. package/dist/angular/client-transform-stylesheet.js +1 -1
  3. package/dist/angular/client-transform-stylesheet.js.map +1 -1
  4. package/dist/angular/vite-angular-plugin.d.ts +1 -1
  5. package/dist/angular/vite-angular-plugin.d.ts.map +1 -1
  6. package/dist/angular/vite-angular-plugin.js +60 -34
  7. package/dist/angular/vite-angular-plugin.js.map +1 -1
  8. package/dist/angular/vite-postcss-inline-plugin.d.ts +1 -1
  9. package/dist/angular/vite-postcss-inline-plugin.js +1 -1
  10. package/dist/capacitor/capacitor.d.ts +14 -2
  11. package/dist/capacitor/capacitor.d.ts.map +1 -1
  12. package/dist/capacitor/capacitor.js +131 -17
  13. package/dist/capacitor/capacitor.js.map +1 -1
  14. package/dist/commands/build.d.ts +3 -10
  15. package/dist/commands/build.d.ts.map +1 -1
  16. package/dist/commands/build.js +3 -10
  17. package/dist/commands/build.js.map +1 -1
  18. package/dist/commands/check.js +3 -3
  19. package/dist/commands/check.js.map +1 -1
  20. package/dist/commands/dev.d.ts +3 -9
  21. package/dist/commands/dev.d.ts.map +1 -1
  22. package/dist/commands/dev.js +3 -9
  23. package/dist/commands/dev.js.map +1 -1
  24. package/dist/commands/device.d.ts +3 -3
  25. package/dist/commands/device.js +5 -5
  26. package/dist/commands/device.js.map +1 -1
  27. package/dist/commands/publish.d.ts +1 -1
  28. package/dist/commands/publish.d.ts.map +1 -1
  29. package/dist/commands/publish.js +18 -26
  30. package/dist/commands/publish.js.map +1 -1
  31. package/dist/commands/replace-deps.d.ts +3 -3
  32. package/dist/commands/replace-deps.d.ts.map +1 -1
  33. package/dist/commands/replace-deps.js +1 -1
  34. package/dist/commands/typecheck.d.ts +4 -3
  35. package/dist/commands/typecheck.d.ts.map +1 -1
  36. package/dist/commands/typecheck.js +5 -11
  37. package/dist/commands/typecheck.js.map +1 -1
  38. package/dist/commands/watch.d.ts +9 -9
  39. package/dist/commands/watch.js +9 -9
  40. package/dist/electron/electron.d.ts.map +1 -1
  41. package/dist/electron/electron.js +42 -3
  42. package/dist/electron/electron.js.map +1 -1
  43. package/dist/engines/BaseEngine.d.ts +1 -1
  44. package/dist/engines/BaseEngine.d.ts.map +1 -1
  45. package/dist/engines/BaseEngine.js +3 -1
  46. package/dist/engines/BaseEngine.js.map +1 -1
  47. package/dist/engines/NgtscEngine.d.ts +7 -7
  48. package/dist/engines/NgtscEngine.d.ts.map +1 -1
  49. package/dist/engines/NgtscEngine.js +3 -3
  50. package/dist/engines/ServerEsbuildEngine.d.ts +7 -7
  51. package/dist/engines/ServerEsbuildEngine.d.ts.map +1 -1
  52. package/dist/engines/ServerEsbuildEngine.js +3 -3
  53. package/dist/engines/TscEngine.d.ts +7 -7
  54. package/dist/engines/TscEngine.d.ts.map +1 -1
  55. package/dist/engines/TscEngine.js +3 -3
  56. package/dist/engines/ViteEngine.d.ts +1 -1
  57. package/dist/engines/ViteEngine.d.ts.map +1 -1
  58. package/dist/engines/ViteEngine.js +7 -12
  59. package/dist/engines/ViteEngine.js.map +1 -1
  60. package/dist/engines/index.d.ts +5 -5
  61. package/dist/engines/index.js +5 -5
  62. package/dist/engines/types.d.ts +20 -20
  63. package/dist/engines/types.d.ts.map +1 -1
  64. package/dist/infra/ResultCollector.d.ts +9 -9
  65. package/dist/infra/ResultCollector.js +8 -8
  66. package/dist/infra/SignalHandler.d.ts +7 -7
  67. package/dist/infra/SignalHandler.js +7 -7
  68. package/dist/infra/WorkerManager.d.ts +14 -14
  69. package/dist/infra/WorkerManager.js +14 -14
  70. package/dist/orchestrators/BuildOrchestrator.d.ts +25 -25
  71. package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
  72. package/dist/orchestrators/BuildOrchestrator.js +29 -29
  73. package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
  74. package/dist/orchestrators/DevWatchOrchestrator.d.ts +7 -7
  75. package/dist/orchestrators/DevWatchOrchestrator.d.ts.map +1 -1
  76. package/dist/orchestrators/DevWatchOrchestrator.js +34 -34
  77. package/dist/orchestrators/DevWatchOrchestrator.js.map +1 -1
  78. package/dist/sd-cli-entry.d.ts +2 -2
  79. package/dist/sd-cli-entry.d.ts.map +1 -1
  80. package/dist/sd-cli-entry.js +15 -8
  81. package/dist/sd-cli-entry.js.map +1 -1
  82. package/dist/sd-cli.d.ts +3 -3
  83. package/dist/sd-cli.js +16 -16
  84. package/dist/sd-cli.js.map +1 -1
  85. package/dist/sd-config.types.d.ts +105 -105
  86. package/dist/sd-config.types.d.ts.map +1 -1
  87. package/dist/utils/angular-compiler.js +5 -5
  88. package/dist/utils/angular-compiler.js.map +1 -1
  89. package/dist/utils/build-env.d.ts +1 -1
  90. package/dist/utils/build-env.js +1 -1
  91. package/dist/utils/concurrency.d.ts +7 -7
  92. package/dist/utils/concurrency.js +7 -7
  93. package/dist/utils/copy-public.d.ts +9 -9
  94. package/dist/utils/copy-public.js +17 -17
  95. package/dist/utils/copy-public.js.map +1 -1
  96. package/dist/utils/copy-src.d.ts +9 -9
  97. package/dist/utils/copy-src.js +11 -11
  98. package/dist/utils/copy-src.js.map +1 -1
  99. package/dist/utils/engine-stop.d.ts +8 -9
  100. package/dist/utils/engine-stop.d.ts.map +1 -1
  101. package/dist/utils/engine-stop.js +9 -10
  102. package/dist/utils/engine-stop.js.map +1 -1
  103. package/dist/utils/esbuild-config.d.ts +23 -23
  104. package/dist/utils/esbuild-config.d.ts.map +1 -1
  105. package/dist/utils/esbuild-config.js +25 -25
  106. package/dist/utils/esbuild-config.js.map +1 -1
  107. package/dist/utils/lint-with-program.d.ts +15 -15
  108. package/dist/utils/lint-with-program.d.ts.map +1 -1
  109. package/dist/utils/lint-with-program.js +29 -29
  110. package/dist/utils/lint-with-program.js.map +1 -1
  111. package/dist/utils/ngtsc-build-core.d.ts +8 -8
  112. package/dist/utils/ngtsc-build-core.d.ts.map +1 -1
  113. package/dist/utils/ngtsc-build-core.js +14 -14
  114. package/dist/utils/ngtsc-build-core.js.map +1 -1
  115. package/dist/utils/output-path-rewriter.d.ts +14 -14
  116. package/dist/utils/output-path-rewriter.js +18 -18
  117. package/dist/utils/output-path-rewriter.js.map +1 -1
  118. package/dist/utils/output-utils.d.ts +6 -6
  119. package/dist/utils/output-utils.js +11 -11
  120. package/dist/utils/output-utils.js.map +1 -1
  121. package/dist/utils/package-utils.d.ts +21 -21
  122. package/dist/utils/package-utils.d.ts.map +1 -1
  123. package/dist/utils/package-utils.js +56 -45
  124. package/dist/utils/package-utils.js.map +1 -1
  125. package/dist/utils/replace-deps.d.ts +25 -25
  126. package/dist/utils/replace-deps.d.ts.map +1 -1
  127. package/dist/utils/replace-deps.js +84 -65
  128. package/dist/utils/replace-deps.js.map +1 -1
  129. package/dist/utils/sd-config.d.ts +3 -3
  130. package/dist/utils/sd-config.js +3 -3
  131. package/dist/utils/tsc-build.d.ts +13 -13
  132. package/dist/utils/tsc-build.d.ts.map +1 -1
  133. package/dist/utils/tsc-build.js +9 -9
  134. package/dist/utils/tsc-build.js.map +1 -1
  135. package/dist/utils/tsconfig.d.ts +11 -9
  136. package/dist/utils/tsconfig.d.ts.map +1 -1
  137. package/dist/utils/tsconfig.js +11 -9
  138. package/dist/utils/tsconfig.js.map +1 -1
  139. package/dist/utils/typecheck-non-package.d.ts +5 -6
  140. package/dist/utils/typecheck-non-package.d.ts.map +1 -1
  141. package/dist/utils/typecheck-non-package.js +7 -8
  142. package/dist/utils/typecheck-non-package.js.map +1 -1
  143. package/dist/utils/typecheck-serialization.d.ts +8 -8
  144. package/dist/utils/typecheck-serialization.d.ts.map +1 -1
  145. package/dist/utils/typecheck-serialization.js +12 -16
  146. package/dist/utils/typecheck-serialization.js.map +1 -1
  147. package/dist/utils/vite-config.d.ts +8 -5
  148. package/dist/utils/vite-config.d.ts.map +1 -1
  149. package/dist/utils/vite-config.js +36 -29
  150. package/dist/utils/vite-config.js.map +1 -1
  151. package/dist/utils/vite-scope-watch-plugin.d.ts.map +1 -1
  152. package/dist/utils/vite-scope-watch-plugin.js +1 -1
  153. package/dist/utils/vite-scope-watch-plugin.js.map +1 -1
  154. package/dist/utils/worker-events.d.ts +12 -12
  155. package/dist/utils/worker-events.d.ts.map +1 -1
  156. package/dist/utils/worker-events.js +10 -10
  157. package/dist/utils/worker-events.js.map +1 -1
  158. package/dist/utils/worker-utils.d.ts +12 -13
  159. package/dist/utils/worker-utils.d.ts.map +1 -1
  160. package/dist/utils/worker-utils.js +12 -13
  161. package/dist/utils/worker-utils.js.map +1 -1
  162. package/dist/vitest-plugin.d.ts.map +1 -1
  163. package/dist/vitest-plugin.js +5 -7
  164. package/dist/vitest-plugin.js.map +1 -1
  165. package/dist/workers/client.worker.d.ts +4 -2
  166. package/dist/workers/client.worker.d.ts.map +1 -1
  167. package/dist/workers/client.worker.js +209 -1
  168. package/dist/workers/client.worker.js.map +1 -1
  169. package/dist/workers/library-build.worker.d.ts +1 -1
  170. package/dist/workers/library-build.worker.d.ts.map +1 -1
  171. package/dist/workers/library-build.worker.js +7 -7
  172. package/dist/workers/library-build.worker.js.map +1 -1
  173. package/dist/workers/lint.worker.d.ts +2 -2
  174. package/dist/workers/lint.worker.js +2 -2
  175. package/dist/workers/ngtsc-build.worker.js +30 -30
  176. package/dist/workers/ngtsc-build.worker.js.map +1 -1
  177. package/dist/workers/server-build.worker.d.ts +17 -17
  178. package/dist/workers/server-build.worker.d.ts.map +1 -1
  179. package/dist/workers/server-build.worker.js +46 -46
  180. package/dist/workers/server-build.worker.js.map +1 -1
  181. package/dist/workers/server-runtime.worker.d.ts +7 -7
  182. package/dist/workers/server-runtime.worker.d.ts.map +1 -1
  183. package/dist/workers/server-runtime.worker.js +17 -17
  184. package/dist/workers/server-runtime.worker.js.map +1 -1
  185. package/docs/config.md +340 -0
  186. package/docs/publish-configuration-types.md +87 -0
  187. package/docs/pwa-configuration-types.md +55 -0
  188. package/docs/vitest-plugin.md +47 -0
  189. package/package.json +9 -7
  190. package/src/angular/client-transform-stylesheet.ts +1 -1
  191. package/src/angular/vite-angular-plugin.ts +70 -37
  192. package/src/angular/vite-postcss-inline-plugin.ts +1 -1
  193. package/src/capacitor/capacitor.ts +159 -23
  194. package/src/commands/build.ts +3 -10
  195. package/src/commands/check.ts +3 -3
  196. package/src/commands/dev.ts +3 -9
  197. package/src/commands/device.ts +5 -5
  198. package/src/commands/publish.ts +30 -26
  199. package/src/commands/replace-deps.ts +3 -3
  200. package/src/commands/typecheck.ts +7 -13
  201. package/src/commands/watch.ts +9 -9
  202. package/src/electron/electron.ts +49 -4
  203. package/src/engines/BaseEngine.ts +4 -1
  204. package/src/engines/NgtscEngine.ts +7 -7
  205. package/src/engines/ServerEsbuildEngine.ts +7 -7
  206. package/src/engines/TscEngine.ts +7 -7
  207. package/src/engines/ViteEngine.ts +8 -13
  208. package/src/engines/index.ts +5 -5
  209. package/src/engines/types.ts +20 -20
  210. package/src/infra/ResultCollector.ts +9 -9
  211. package/src/infra/SignalHandler.ts +7 -7
  212. package/src/infra/WorkerManager.ts +14 -14
  213. package/src/orchestrators/BuildOrchestrator.ts +37 -37
  214. package/src/orchestrators/DevWatchOrchestrator.ts +36 -36
  215. package/src/sd-cli-entry.ts +15 -8
  216. package/src/sd-cli.ts +16 -16
  217. package/src/sd-config.types.ts +107 -107
  218. package/src/utils/angular-compiler.ts +5 -5
  219. package/src/utils/build-env.ts +1 -1
  220. package/src/utils/concurrency.ts +7 -7
  221. package/src/utils/copy-public.ts +17 -17
  222. package/src/utils/copy-src.ts +11 -11
  223. package/src/utils/engine-stop.ts +9 -10
  224. package/src/utils/esbuild-config.ts +29 -29
  225. package/src/utils/lint-with-program.ts +34 -34
  226. package/src/utils/ngtsc-build-core.ts +17 -17
  227. package/src/utils/output-path-rewriter.ts +18 -18
  228. package/src/utils/output-utils.ts +11 -11
  229. package/src/utils/package-utils.ts +57 -45
  230. package/src/utils/replace-deps.ts +92 -67
  231. package/src/utils/sd-config.ts +3 -3
  232. package/src/utils/tsc-build.ts +18 -18
  233. package/src/utils/tsconfig.ts +11 -9
  234. package/src/utils/typecheck-non-package.ts +7 -8
  235. package/src/utils/typecheck-serialization.ts +13 -15
  236. package/src/utils/vite-config.ts +45 -35
  237. package/src/utils/vite-scope-watch-plugin.ts +6 -1
  238. package/src/utils/worker-events.ts +16 -16
  239. package/src/utils/worker-utils.ts +12 -13
  240. package/src/vitest-plugin.ts +5 -8
  241. package/src/workers/client.worker.ts +236 -2
  242. package/src/workers/library-build.worker.ts +8 -8
  243. package/src/workers/lint.worker.ts +2 -2
  244. package/src/workers/ngtsc-build.worker.ts +31 -31
  245. package/src/workers/server-build.worker.ts +60 -60
  246. package/src/workers/server-runtime.worker.ts +22 -22
  247. package/tests/angular/vite-angular-plugin-hmr-fallback.spec.ts +1 -0
  248. package/tests/angular/vite-angular-plugin-hmr.spec.ts +78 -0
  249. package/tests/angular/vite-angular-plugin.spec.ts +67 -0
  250. package/tests/capacitor/capacitor-build.spec.ts +6 -4
  251. package/tests/capacitor/capacitor-icon.spec.ts +7 -5
  252. package/tests/capacitor/capacitor-init.spec.ts +120 -10
  253. package/tests/capacitor/capacitor-run.spec.ts +14 -17
  254. package/tests/capacitor/capacitor-workspace.spec.ts +5 -3
  255. package/tests/commands/check.spec.ts +2 -2
  256. package/tests/commands/publish.spec.ts +2 -2
  257. package/tests/commands/typecheck.spec.ts +8 -0
  258. package/tests/electron/electron.spec.ts +12 -10
  259. package/tests/engines/base-engine.spec.ts +37 -0
  260. package/tests/engines/vite-engine.spec.ts +115 -3
  261. package/tests/utils/vite-config.spec.ts +144 -90
  262. package/tests/workers/client-worker.spec.ts +690 -0
  263. package/tests/workers/server-build-worker.spec.ts +3 -3
@@ -2,11 +2,11 @@ import path from "path";
2
2
  import { fsx, pathx, FsWatcher } from "@simplysm/core-node";
3
3
 
4
4
  /**
5
- * Copy files matching glob patterns from src/ to dist/
6
- * Relative paths are preserved: src/a/b.css → dist/a/b.css
5
+ * glob 패턴에 매칭되는 파일을 src/에서 dist/로 복사한다.
6
+ * 상대 경로가 유지된다: src/a/b.css → dist/a/b.css
7
7
  *
8
- * @param pkgDir Package root directory
9
- * @param patterns Array of glob patterns (relative to src/)
8
+ * @param pkgDir 패키지 루트 디렉토리
9
+ * @param patterns glob 패턴 배열 (src/ 기준 상대 경로)
10
10
  */
11
11
  export async function copySrcFiles(pkgDir: string, patterns: string[]): Promise<void> {
12
12
  const srcDir = pathx.posix(path.join(pkgDir, "src"));
@@ -26,21 +26,21 @@ export async function copySrcFiles(pkgDir: string, patterns: string[]): Promise<
26
26
  }
27
27
 
28
28
  /**
29
- * Watch and copy files matching glob patterns from src/ to dist/
30
- * Automatically reflects changes, additions, and deletions after initial copy.
29
+ * glob 패턴에 매칭되는 파일을 src/에서 dist/로 감시하며 복사한다.
30
+ * 초기 복사 변경, 추가, 삭제를 자동으로 반영한다.
31
31
  *
32
- * @param pkgDir Package root directory
33
- * @param patterns Array of glob patterns (relative to src/)
34
- * @returns FsWatcher instance (call close() on shutdown)
32
+ * @param pkgDir 패키지 루트 디렉토리
33
+ * @param patterns glob 패턴 배열 (src/ 기준 상대 경로)
34
+ * @returns FsWatcher 인스턴스 (종료 close() 호출)
35
35
  */
36
36
  export async function watchCopySrcFiles(pkgDir: string, patterns: string[]): Promise<FsWatcher> {
37
37
  const srcDir = pathx.posix(path.join(pkgDir, "src"));
38
38
  const distDir = pathx.posix(path.join(pkgDir, "dist"));
39
39
 
40
- // Initial copy
40
+ // 초기 복사
41
41
  await copySrcFiles(pkgDir, patterns);
42
42
 
43
- // Start watch
43
+ // 감시 시작
44
44
  const watchPaths = patterns.map((p) => pathx.posix(path.join(srcDir, p)));
45
45
  const watcher = await FsWatcher.watch(watchPaths);
46
46
 
@@ -1,8 +1,8 @@
1
1
  /**
2
- * Shared stop logic for build engines (BaseEngine, ViteEngine).
2
+ * 빌드 엔진(BaseEngine, ViteEngine)의 공유 중지 로직.
3
3
  *
4
- * Extracted to avoid duplicating the shutdown timeout + stopWatch race + terminate
5
- * pattern across engine implementations.
4
+ * 엔진 구현체 shutdown 타임아웃 + stopWatch 경쟁 + terminate
5
+ * 패턴의 중복을 방지하기 위해 추출하였다.
6
6
  */
7
7
 
8
8
  const SHUTDOWN_TIMEOUT = 3000;
@@ -13,14 +13,13 @@ interface StoppableWorker {
13
13
  }
14
14
 
15
15
  /**
16
- * Gracefully stop a build engine worker.
16
+ * 빌드 엔진 워커를 정상적으로 중지한다.
17
17
  *
18
- * In watch mode, attempts `stopWatch()` with a timeout guard so a hung worker
19
- * does not block shutdown. Then terminates the worker regardless.
18
+ * watch 모드에서는 타임아웃 가드와 함께 `stopWatch()`를 시도하여
19
+ * 멈춘 워커가 종료를 차단하지 않도록 한다. 이후 워커를 무조건 종료한다.
20
20
  *
21
- * @param worker - The worker proxy to stop (may be undefined if never started)
22
- * @param isWatchMode - Whether the engine is in watch mode
23
- * @returns A cleanup function that nullifies the caller's worker reference
21
+ * @param worker - 중지할 워커 프록시 (시작하지 않았으면 undefined)
22
+ * @param isWatchMode - watch 모드 여부
24
23
  */
25
24
  export async function stopEngineWorker(
26
25
  worker: StoppableWorker | undefined,
@@ -33,7 +32,7 @@ export async function stopEngineWorker(
33
32
  new Promise<void>((resolve) => setTimeout(resolve, SHUTDOWN_TIMEOUT)),
34
33
  ]);
35
34
  } catch {
36
- // Continue even if stopWatch fails
35
+ // stopWatch 실패해도 계속 진행
37
36
  }
38
37
  }
39
38
 
@@ -8,11 +8,11 @@ import { consola } from "consola";
8
8
  const logger = consola.withTag("sd:cli:esbuild-config");
9
9
 
10
10
  /**
11
- * Write only changed files from esbuild outputFiles to disk
11
+ * esbuild outputFiles에서 변경된 파일만 디스크에 쓴다.
12
12
  *
13
- * - .js files: Add .js extension to ESM relative import paths before comparing
14
- * - Other files (.js.map etc): Compare original content as-is
15
- * - Skip writing if content matches existing file to preserve timestamps
13
+ * - .js 파일: 비교 ESM 상대 import 경로에 .js 확장자를 추가한다
14
+ * - 기타 파일(.js.map ): 원본 내용을 그대로 비교한다
15
+ * - 기존 파일과 내용이 동일하면 타임스탬프 보존을 위해 쓰기를 스킵한다
16
16
  */
17
17
  export async function writeChangedOutputFiles(outputFiles: esbuild.OutputFile[]): Promise<boolean> {
18
18
  logger.debug(`변경된 출력 파일 쓰기 시작 (${outputFiles.length}개)`);
@@ -33,7 +33,7 @@ export async function writeChangedOutputFiles(outputFiles: esbuild.OutputFile[])
33
33
  const existing = await fs.readFile(file.path, "utf-8");
34
34
  if (existing === finalText) return;
35
35
  } catch {
36
- // File doesn't exist yet
36
+ // 파일이 아직 존재하지 않음
37
37
  }
38
38
 
39
39
  hasChanges = true;
@@ -46,23 +46,23 @@ export async function writeChangedOutputFiles(outputFiles: esbuild.OutputFile[])
46
46
  }
47
47
 
48
48
  /**
49
- * esbuild options for Server build
50
- * - bundle: true (single bundle with all dependencies)
49
+ * Server 빌드용 esbuild 옵션
50
+ * - bundle: true (모든 의존성을 포함한 단일 번들)
51
51
  */
52
52
  export interface ServerEsbuildOptions {
53
53
  pkgDir: string;
54
54
  entryPoints: string[];
55
55
  env?: Record<string, string>;
56
- /** External modules to exclude from bundle */
56
+ /** 번들에서 제외할 외부 모듈 */
57
57
  external?: string[];
58
- /** Dev mode: skip minification for faster builds */
58
+ /** dev 모드: 빠른 빌드를 위해 minification 스킵 */
59
59
  dev?: boolean;
60
60
  }
61
61
 
62
62
  /**
63
- * Generate a JS banner snippet that merges env vars into process.env at runtime.
64
- * Uses ??= so that runtime ENV (e.g. `DEV=false node server.js`) takes precedence
65
- * over build-time defaults.
63
+ * 런타임에 환경변수를 process.env 병합하는 JS 배너 스니펫을 생성한다.
64
+ * ??=를 사용하여 런타임 ENV(예: `DEV=false node server.js`)
65
+ * 빌드 타임 기본값보다 우선하도록 한다.
66
66
  */
67
67
  export function createEnvBanner(env?: Record<string, string>): string {
68
68
  if (env == null || Object.keys(env).length === 0) return "";
@@ -70,12 +70,12 @@ export function createEnvBanner(env?: Record<string, string>): string {
70
70
  }
71
71
 
72
72
  /**
73
- * Create esbuild config for Server build
73
+ * Server 빌드용 esbuild 설정을 생성한다.
74
74
  *
75
- * Used for server package builds
76
- * - bundle: true (single bundle with all dependencies)
77
- * - minify: true (minify for code protection)
78
- * - banner: createRequire shim for CJS package require() support + env injection
75
+ * server 패키지 빌드에 사용한다.
76
+ * - bundle: true (모든 의존성을 포함한 단일 번들)
77
+ * - minify: true (코드 보호를 위한 minify)
78
+ * - banner: CJS 패키지 require() 지원을 위한 createRequire shim + 환경변수 주입
79
79
  */
80
80
  export function createServerEsbuildOptions(options: ServerEsbuildOptions): esbuild.BuildOptions {
81
81
  const envBanner = createEnvBanner(options.env);
@@ -107,7 +107,7 @@ interface PkgJson {
107
107
  }
108
108
 
109
109
  /**
110
- * Recursively scan dependency tree and collect externals based on predicate
110
+ * 의존성 트리를 재귀적으로 스캔하고 predicate 기반으로 externals 수집한다.
111
111
  */
112
112
  function scanDependencyTree(
113
113
  pkgName: string,
@@ -132,13 +132,13 @@ function scanDependencyTree(
132
132
  const depDir = path.dirname(pkgJsonPath);
133
133
  const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8")) as PkgJson;
134
134
 
135
- // Collect packages marked as external by predicate
135
+ // predicate에 의해 external로 표시된 패키지 수집
136
136
  const toExternal = collector(pkgName, depDir, pkgJson);
137
137
  for (const name of toExternal) {
138
138
  external.add(name);
139
139
  }
140
140
 
141
- // Recursively traverse sub-dependencies
141
+ // 하위 의존성 재귀 탐색
142
142
  const subDeps = Object.keys(pkgJson.dependencies ?? {});
143
143
  if (subDeps.length > 0) {
144
144
  logger.debug(
@@ -151,7 +151,7 @@ function scanDependencyTree(
151
151
  }
152
152
 
153
153
  /**
154
- * Collect both uninstalled optional peer deps and native modules in a single tree traversal
154
+ * 단일 트리 탐색으로 미설치 optional peer deps 네이티브 모듈을 모두 수집한다.
155
155
  */
156
156
  export function collectAllDependencyExternals(pkgDir: string): {
157
157
  optionalPeerDeps: string[];
@@ -178,7 +178,7 @@ export function collectAllDependencyExternals(pkgDir: string): {
178
178
  (pkgName, depDir, depPkgJson) => {
179
179
  const found: string[] = [];
180
180
 
181
- // Optional peer deps check
181
+ // Optional peer deps 확인
182
182
  if (depPkgJson.peerDependenciesMeta != null) {
183
183
  const peerDeps = depPkgJson.peerDependencies ?? {};
184
184
  const depReq = createRequire(path.join(depDir, "noop.js"));
@@ -193,7 +193,7 @@ export function collectAllDependencyExternals(pkgDir: string): {
193
193
  }
194
194
  }
195
195
 
196
- // Native module check
196
+ // 네이티브 모듈 확인
197
197
  if (existsSync(path.join(depDir, "binding.gyp"))) {
198
198
  nativeModules.add(pkgName);
199
199
  }
@@ -215,10 +215,10 @@ export function collectAllDependencyExternals(pkgDir: string): {
215
215
  }
216
216
 
217
217
  /**
218
- * Collect uninstalled optional peer deps from dependency tree
218
+ * 의존성 트리에서 미설치 optional peer deps 수집한다.
219
219
  *
220
- * For server builds (bundle: true), specify uninstalled optional peer dependencies
221
- * as esbuild externals to prevent build failures
220
+ * server 빌드(bundle: true)에서 미설치 optional peer dependencies
221
+ * esbuild externals 지정하여 빌드 실패를 방지한다.
222
222
  */
223
223
  export function collectUninstalledOptionalPeerDeps(pkgDir: string): string[] {
224
224
  return collectAllDependencyExternals(pkgDir).optionalPeerDeps;
@@ -229,10 +229,10 @@ export function collectUninstalledOptionalPeerDeps(pkgDir: string): string[] {
229
229
  //#region Native Module Externals
230
230
 
231
231
  /**
232
- * Collect native modules with binding.gyp from dependencies
232
+ * 의존성에서 binding.gyp 있는 네이티브 모듈을 수집한다.
233
233
  *
234
- * Native modules built with node-gyp cannot be bundled by esbuild,
235
- * so they must be specified as externals.
234
+ * node-gyp 빌드된 네이티브 모듈은 esbuild로 번들링할 수 없으므로
235
+ * externals로 지정해야 한다.
236
236
  */
237
237
  export function collectNativeModuleExternals(pkgDir: string): string[] {
238
238
  return collectAllDependencyExternals(pkgDir).nativeModules;
@@ -7,7 +7,7 @@ import { consola } from "consola";
7
7
  const logger = consola.withTag("sd:cli:lint-with-program");
8
8
 
9
9
  /**
10
- * Lint result returned by LintWithProgramRunner.lint()
10
+ * LintWithProgramRunner.lint()가 반환하는 lint 결과
11
11
  */
12
12
  export interface LintWithProgramResult {
13
13
  success: boolean;
@@ -17,7 +17,7 @@ export interface LintWithProgramResult {
17
17
  }
18
18
 
19
19
  /**
20
- * Options for LintWithProgramRunner constructor
20
+ * LintWithProgramRunner 생성자 옵션
21
21
  */
22
22
  export interface LintWithProgramRunnerOptions {
23
23
  cwd: string;
@@ -25,22 +25,22 @@ export interface LintWithProgramRunnerOptions {
25
25
  }
26
26
 
27
27
  /**
28
- * Options for LintWithProgramRunner.lint()
28
+ * LintWithProgramRunner.lint() 옵션
29
29
  */
30
30
  export interface LintRunOptions {
31
31
  program: ts.Program;
32
- /** When provided, only files in this set are linted (intersection with extracted files).
33
- * Used in watch rebuild for incremental lint based on affected files. */
32
+ /** 제공 집합의 파일만 lint한다 (추출된 파일과의 교집합).
33
+ * watch 재빌드에서 affected 파일 기반 증분 lint 사용한다. */
34
34
  affectedFiles?: ReadonlySet<string>;
35
35
  }
36
36
 
37
37
  /**
38
- * Runs ESLint using an existing ts.Program (avoids duplicate Program creation).
38
+ * 기존 ts.Program을 사용하여 ESLint를 실행한다 (중복 Program 생성을 방지).
39
39
  *
40
- * - Extracts source files from program.getSourceFiles() filtered to pkgDir
41
- * - Excludes .d.ts files and node_modules paths
42
- * - Injects ts.Program via parserOptions.programs (typescript-eslint)
43
- * - Reuses ESLint instance across calls (watch mode optimization)
40
+ * - program.getSourceFiles()에서 pkgDir로 필터링하여 소스 파일을 추출한다
41
+ * - .d.ts 파일과 node_modules 경로를 제외한다
42
+ * - parserOptions.programs를 통해 ts.Program 주입한다 (typescript-eslint)
43
+ * - 호출 ESLint 인스턴스를 재사용한다 (watch 모드 최적화)
44
44
  */
45
45
  export class LintWithProgramRunner {
46
46
  private readonly _cwd: string;
@@ -55,8 +55,8 @@ export class LintWithProgramRunner {
55
55
  }
56
56
 
57
57
  /**
58
- * Extract lint target files from ts.Program.
59
- * Includes all workspace source files (cwd scope), excludes .d.ts, node_modules, and Angular shims.
58
+ * ts.Program에서 lint 대상 파일을 추출한다.
59
+ * 모든 워크스페이스 소스 파일(cwd 범위) 포함하고 .d.ts, node_modules, Angular shim을 제외한다.
60
60
  */
61
61
  private _extractFiles(program: ts.Program): string[] {
62
62
  logger.debug(`[${this._pkgName}] 린트 대상 파일 추출 시작`);
@@ -66,22 +66,22 @@ export class LintWithProgramRunner {
66
66
  for (const sf of program.getSourceFiles()) {
67
67
  const fileName = pathx.posix(sf.fileName);
68
68
 
69
- // Must be within workspace root
69
+ // 워크스페이스 루트 내에 있어야
70
70
  if (!fileName.startsWith(normalizedCwd + "/")) {
71
71
  continue;
72
72
  }
73
73
 
74
- // Exclude declaration files
74
+ // 선언 파일 제외
75
75
  if (sf.isDeclarationFile) {
76
76
  continue;
77
77
  }
78
78
 
79
- // Exclude node_modules
79
+ // node_modules 제외
80
80
  if (fileName.includes("/node_modules/")) {
81
81
  continue;
82
82
  }
83
83
 
84
- // Exclude Angular type-check shim files (virtual, not on disk)
84
+ // Angular 타입체크 shim 파일 제외 (가상 파일, 디스크에 없음)
85
85
  if (fileName.endsWith(".ngtypecheck.ts")) {
86
86
  continue;
87
87
  }
@@ -94,17 +94,17 @@ export class LintWithProgramRunner {
94
94
  }
95
95
 
96
96
  /**
97
- * Run ESLint on files from the given ts.Program.
98
- * When affectedFiles is provided, only the intersection is linted (watch rebuild).
99
- * Creates ESLint instance on first call, reuses on subsequent calls.
97
+ * 주어진 ts.Program의 파일에 대해 ESLint를 실행한다.
98
+ * affectedFiles 제공되면 교집합만 lint한다 (watch 재빌드).
99
+ * 호출 ESLint 인스턴스를 생성하고, 이후 호출에서 재사용한다.
100
100
  */
101
101
  async lint(options: LintRunOptions): Promise<LintWithProgramResult> {
102
102
  const { program, affectedFiles } = options;
103
103
 
104
- // Extract target files (workspace scope)
104
+ // 대상 파일 추출 (워크스페이스 범위)
105
105
  let files = this._extractFiles(program);
106
106
 
107
- // When affectedFiles is provided, intersect with extracted files
107
+ // affectedFiles 제공되면 추출된 파일과 교집합
108
108
  if (affectedFiles != null) {
109
109
  files = files.filter((f) => affectedFiles.has(pathx.posix(f)));
110
110
  }
@@ -118,23 +118,23 @@ export class LintWithProgramRunner {
118
118
  };
119
119
  }
120
120
 
121
- // Update programs reference (mutable array — ESLint reads it on lintFiles)
121
+ // programs 참조 업데이트 (가변 배열 — ESLint lintFiles 읽음)
122
122
  this._programsRef.length = 0;
123
123
  this._programsRef.push(program);
124
124
 
125
- // Cache policy: affected files-based incremental lint is more accurate than ESLint's
126
- // file-content-based cache (which misses dependency changes).
127
- // When affectedFiles is provided (watch rebuild), disable cache.
128
- // When not provided (one-time build), enable cache for performance.
125
+ // 캐시 정책: affected 파일 기반 증분 lint ESLint
126
+ // 파일 내용 기반 캐시(의존성 변경을 놓침)보다 정확하다.
127
+ // affectedFiles 제공되면 (watch 재빌드) 캐시를 비활성화한다.
128
+ // 제공되지 않으면 (일회성 빌드) 성능을 위해 캐시를 활성화한다.
129
129
  const useCache = affectedFiles == null;
130
130
 
131
- // Create new ESLint instance when cache policy changes or on first call
131
+ // 캐시 정책이 변경되거나 호출 ESLint 인스턴스 생성
132
132
  if (this._eslint == null || this._lastUseCache !== useCache) {
133
133
  logger.debug(`[${this._pkgName}] ESLint 인스턴스 생성 (cache: ${String(useCache)})`);
134
- // ESLint Flat Config serializes languageOptions via languageOptionsToJSON(),
135
- // which recurses into parserOptions and throws on ts.Program methods.
136
- // Adding toJSON() to parserOptions returns a serializable representation
137
- // while keeping the actual programs array accessible to typescript-eslint.
134
+ // ESLint Flat Config languageOptionsToJSON()을 통해 languageOptions 직렬화하는데,
135
+ // parserOptions 재귀 탐색하면서 ts.Program 메서드에서 예외가 발생한다.
136
+ // parserOptions에 toJSON() 추가하여 직렬화 가능한 표현을 반환하면서
137
+ // typescript-eslint가 실제 programs 배열에 접근할 있도록 한다.
138
138
  const parserOptions = {
139
139
  programs: this._programsRef,
140
140
  project: null,
@@ -157,11 +157,11 @@ export class LintWithProgramRunner {
157
157
  this._lastUseCache = useCache;
158
158
  }
159
159
 
160
- // Run lint
160
+ // lint 실행
161
161
  logger.debug(`[${this._pkgName}] 린트 시작 (${files.length}개 파일, affected: ${affectedFiles != null})`);
162
162
  const results = await this._eslint.lintFiles(files);
163
163
 
164
- // Aggregate results
164
+ // 결과 집계
165
165
  let errorCount = 0;
166
166
  let warningCount = 0;
167
167
  for (const r of results) {
@@ -169,7 +169,7 @@ export class LintWithProgramRunner {
169
169
  warningCount += r.warningCount;
170
170
  }
171
171
 
172
- // Format output
172
+ // 출력 포맷팅
173
173
  const formatter = await this._eslint.loadFormatter("stylish");
174
174
  const formattedOutput = await formatter.format(results);
175
175
 
@@ -29,9 +29,9 @@ export interface NgtscBuildInfo {
29
29
  cwd: string;
30
30
  pkgDir: string;
31
31
  output: BuildOutput;
32
- /** Typecheck environment. When set, adjusts compilerOptions via getCompilerOptionsForEnv(). */
32
+ /** 타입체크 환경. 설정 getCompilerOptionsForEnv()로 compilerOptions 조정한다. */
33
33
  env?: TypecheckEnv;
34
- /** replaceDeps configuration from sd.config.ts */
34
+ /** sd.config.ts replaceDeps 설정 */
35
35
  replaceDeps?: Record<string, string>;
36
36
  }
37
37
 
@@ -40,7 +40,7 @@ export interface NgtscBuildResult {
40
40
  lint?: LintWithProgramResult;
41
41
  }
42
42
 
43
- /** runNgtscBuild 내부 반환 타입. program은 워커 내에서 lint 용도로만 사용된다. */
43
+ /** runNgtscBuild 내부 반환 타입. program은 워커 내에서 lint 용도로만 사용한다. */
44
44
  export interface NgtscBuildInternalResult extends NgtscBuildResult {
45
45
  program?: ts.Program;
46
46
  }
@@ -83,7 +83,7 @@ export function buildCompilerOptions(
83
83
  options.emitDeclarationOnly = true;
84
84
  options.declarationDir = path.join(pkgDir, "dist");
85
85
  } else {
86
- // both false — typecheck only
86
+ // false — 타입체크만 수행
87
87
  options.noEmit = true;
88
88
  options.declaration = false;
89
89
  options.declarationMap = false;
@@ -199,12 +199,12 @@ export function writeEmitResults(
199
199
  if (rewrite == null) continue;
200
200
  let [newPath, newContent] = rewrite;
201
201
 
202
- // Process side-effect SCSS imports in .js files
202
+ // .js 파일 내 side-effect SCSS import 처리
203
203
  if (scss != null && newPath.endsWith(".js")) {
204
204
  const { text, scssImports } = rewriteScssImports(newContent);
205
205
  newContent = text;
206
206
 
207
- // Clear stale registry entries for this source file before registering new ones
207
+ // 항목 등록 전에 소스 파일의 기존 레지스트리 항목 제거
208
208
  if (scss.registry != null && sourceFileName != null) {
209
209
  for (const [key, entry] of scss.registry) {
210
210
  if (entry.sourceFileName === sourceFileName) {
@@ -222,7 +222,7 @@ export function writeEmitResults(
222
222
  const cssFileName = scssImport.replace(/\.scss$/, ".css");
223
223
  const cssAbsPath = path.resolve(outputDir, cssFileName);
224
224
 
225
- // Register in registry if provided (keyed by scssAbsPath for uniqueness)
225
+ // 레지스트리가 제공된 경우 등록 (scssAbsPath를 키로 사용하여 중복 방지)
226
226
  if (scss.registry != null) {
227
227
  scss.registry.set(scssAbsPath, { scssAbsPath, cssAbsPath, sourceFileName });
228
228
  }
@@ -248,9 +248,9 @@ export function writeEmitResults(
248
248
  //#region Side-effect SCSS
249
249
 
250
250
  /**
251
- * Compile all side-effect SCSS entries in the registry to CSS.
252
- * Follows the same pattern as compileGlobalScss always recompiles all entries.
253
- * On error, adds to scssErrors and preserves existing CSS file.
251
+ * 레지스트리의 모든 side-effect SCSS 항목을 CSS로 컴파일한다.
252
+ * compileGlobalScss와 동일한 패턴항상 모든 항목을 재컴파일한다.
253
+ * 에러 발생 scssErrors 추가하고 기존 CSS 파일을 보존한다.
254
254
  */
255
255
  export function compileSideEffectScss(
256
256
  registry: ReadonlyMap<string, SideEffectScssEntry>,
@@ -300,8 +300,8 @@ export function compileGlobalScss(
300
300
  //#endregion
301
301
 
302
302
  /**
303
- * Run a full Angular library build using AngularCompiler.
304
- * (parse, initialize, diagnostics, emit, global SCSS)
303
+ * AngularCompiler를 사용한 전체 Angular 라이브러리 빌드를 수행한다.
304
+ * (파싱, 초기화, 진단, emit, global SCSS)
305
305
  */
306
306
  export async function runNgtscBuild(info: NgtscBuildInfo): Promise<NgtscBuildInternalResult> {
307
307
  try {
@@ -328,7 +328,7 @@ export async function runNgtscBuild(info: NgtscBuildInfo): Promise<NgtscBuildInt
328
328
  const scssDependencies = new Map<string, Set<string>>();
329
329
  const loadPaths = buildScssLoadPaths(info);
330
330
 
331
- // Create AngularCompiler
331
+ // AngularCompiler 생성
332
332
  logger.debug(`[${info.name}] AngularCompiler 생성 중...`);
333
333
  const compiler = new AngularCompiler({
334
334
  rootNames: sourceFiles,
@@ -337,12 +337,12 @@ export async function runNgtscBuild(info: NgtscBuildInfo): Promise<NgtscBuildInt
337
337
  transformStylesheet: createLibraryTransformStylesheet(loadPaths, scssErrors, scssDependencies),
338
338
  });
339
339
 
340
- // Initialize (creates program, AOT analysis, finds affected files)
340
+ // 초기화 (프로그램 생성, AOT 분석, affected 파일 탐색)
341
341
  logger.debug(`[${info.name}] AngularCompiler 초기화 중...`);
342
342
  await compiler.initialize();
343
343
  logger.debug(`[${info.name}] AngularCompiler 초기화 완료`);
344
344
 
345
- // Collect diagnostics — workspace scope (no package-level filtering)
345
+ // 진단 수집 — workspace 스코프 (패키지 단위 필터링 없음)
346
346
  const allDiagnostics = [...compiler.collectDiagnostics()].filter(
347
347
  (d) => isWorkspaceDiagnostic(d, info.cwd),
348
348
  );
@@ -357,7 +357,7 @@ export async function runNgtscBuild(info: NgtscBuildInfo): Promise<NgtscBuildInt
357
357
  .filter((d) => d.category === ts.DiagnosticCategory.Error)
358
358
  .map(formatDiagnosticError);
359
359
 
360
- // Emit via AngularCompiler + output-path-rewriting
360
+ // AngularCompiler를 통한 emit + output-path-rewriting
361
361
  const emitResults = compiler.emitAffectedFiles({
362
362
  sourceFilter: (fileName: string) =>
363
363
  pathx.posix(fileName).startsWith(normalizedSrcDir + "/"),
@@ -368,7 +368,7 @@ export async function runNgtscBuild(info: NgtscBuildInfo): Promise<NgtscBuildInt
368
368
  scssDependencies,
369
369
  });
370
370
 
371
- // Global SCSS compilation
371
+ // Global SCSS 컴파일
372
372
  const globalScssErrors = compileGlobalScss(info.pkgDir, loadPaths);
373
373
 
374
374
  const allErrors = [...errors, ...scssErrors, ...globalScssErrors];
@@ -2,10 +2,10 @@ import path from "path";
2
2
  import { pathx } from "@simplysm/core-node";
3
3
 
4
4
  /**
5
- * Add .js extension to extensionless relative import/export paths in ESM output.
5
+ * ESM 출력에서 확장자가 없는 상대 import/export 경로에 .js 확장자를 추가한다.
6
6
  *
7
- * Matches: from "./foo", import("./bar"), from "../baz"
8
- * Skips: bare specifiers ("lodash"), paths already ending with known extensions (.js, .json, .css, etc.)
7
+ * 매칭: from "./foo", import("./bar"), from "../baz"
8
+ * 스킵: bare 지정자("lodash"), 이미 알려진 확장자로 끝나는 경로 (.js, .json, .css )
9
9
  */
10
10
  export function addJsExtensionToImports(text: string): string {
11
11
  return text.replace(
@@ -18,11 +18,11 @@ export function addJsExtensionToImports(text: string): string {
18
18
  }
19
19
 
20
20
  /**
21
- * Rewrite relative .scss imports to .css in emitted JS text.
22
- * Returns the transformed text and the list of original .scss import paths.
21
+ * emit된 JS 텍스트에서 상대 .scss import를 .css 변환한다.
22
+ * 변환된 텍스트와 원본 .scss import 경로 목록을 반환한다.
23
23
  *
24
- * Matches: import "./foo.scss", import("./bar.scss"), from "../baz.scss"
25
- * Only processes relative imports (starting with ./ or ../).
24
+ * 매칭: import "./foo.scss", import("./bar.scss"), from "../baz.scss"
25
+ * 상대 import(./ 또는 ../ 시작)만 처리한다.
26
26
  */
27
27
  export function rewriteScssImports(text: string): { text: string; scssImports: string[] } {
28
28
  const scssImports: string[] = [];
@@ -37,7 +37,7 @@ export function rewriteScssImports(text: string): { text: string; scssImports: s
37
37
  }
38
38
 
39
39
  /**
40
- * Adjust sources path in .d.ts.map file to new location
40
+ * .d.ts.map 파일의 sources 경로를 새 위치에 맞게 조정한다.
41
41
  */
42
42
  export function adjustMapSources(content: string, originalDir: string, newDir: string): string {
43
43
  if (originalDir === newDir) return content;
@@ -56,14 +56,14 @@ export function adjustMapSources(content: string, originalDir: string, newDir: s
56
56
  }
57
57
 
58
58
  /**
59
- * Create path rewriter function for NgtscProgram output files (.js, .d.ts, .d.ts.map)
59
+ * NgtscProgram 출력 파일(.js, .d.ts, .d.ts.map)용 경로 재작성 함수를 생성한다.
60
60
  *
61
- * TypeScript/NgtscProgram includes other package sources referenced via path alias (@simplysm/*)
62
- * in rootDir calculation, so output is generated as nested structure dist/{pkgName}/src/...
63
- * The returned function rewrites only this package's output to flat structure (dist/...)
64
- * and ignores output from other packages.
61
+ * TypeScript/NgtscProgram path alias(@simplysm/*)로 참조되는 다른 패키지 소스를
62
+ * rootDir 계산에 포함하므로 출력이 dist/{pkgName}/src/... 중첩 구조로 생성된다.
63
+ * 반환된 함수는 패키지의 출력만 평면 구조(dist/...)로 재작성하고
64
+ * 다른 패키지의 출력은 무시한다.
65
65
  *
66
- * @returns (fileName, content) => [newPath, newContent] | null (null to skip writing)
66
+ * @returns (fileName, content) => [newPath, newContent] | null (null이면 쓰기 스킵)
67
67
  */
68
68
  export function createOutputPathRewriter(
69
69
  pkgDir: string,
@@ -71,7 +71,7 @@ export function createOutputPathRewriter(
71
71
  const pkgName = path.basename(pkgDir);
72
72
  const distDir = pathx.posixResolve(pkgDir, "dist");
73
73
  const distPrefix = distDir + "/";
74
- // Nested structure prefix for this package: dist/{pkgName}/src/
74
+ // 패키지의 중첩 구조 접두사: dist/{pkgName}/src/
75
75
  const ownNestedPrefix = pathx.posixResolve(distDir, pkgName, "src") + "/";
76
76
 
77
77
  return (fileName, content) => {
@@ -80,7 +80,7 @@ export function createOutputPathRewriter(
80
80
  if (!fileName.startsWith(distPrefix)) return null;
81
81
 
82
82
  if (fileName.startsWith(ownNestedPrefix)) {
83
- // Rewrite nested path to flat: dist/{pkgName}/src/... → dist/...
83
+ // 중첩 경로를 평면으로 재작성: dist/{pkgName}/src/... → dist/...
84
84
  const flatPath = pathx.posixResolve(distDir, fileName.slice(ownNestedPrefix.length));
85
85
  if (fileName.endsWith(".d.ts.map") || fileName.endsWith(".js.map")) {
86
86
  content = adjustMapSources(content, path.dirname(fileName), path.dirname(flatPath));
@@ -88,14 +88,14 @@ export function createOutputPathRewriter(
88
88
  return [flatPath, content];
89
89
  }
90
90
 
91
- // Nested output from other packages (dist/{otherPkg}/src/...) → ignore
91
+ // 다른 패키지의 중첩 출력 (dist/{otherPkg}/src/...) → 무시
92
92
  const relFromDist = fileName.slice(distPrefix.length);
93
93
  const segments = relFromDist.split("/");
94
94
  if (segments.length >= 3 && segments[1] === "src") {
95
95
  return null;
96
96
  }
97
97
 
98
- // Already flat structure (package with no dependencies) → output as is
98
+ // 이미 평면 구조 (src/ 하위가 아닌 경로) → 그대로 출력
99
99
  return [fileName, content];
100
100
  };
101
101
  }