@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,7 +2,7 @@ import { consola } from "consola";
2
2
  import type { BuildResult } from "../infra/ResultCollector";
3
3
 
4
4
  /**
5
- * Format build warning/error messages
5
+ * 빌드 경고/에러 메시지를 포맷팅한다.
6
6
  */
7
7
  export function formatBuildMessages(name: string, label: string, messages: string[]): string {
8
8
  const lines: string[] = [`${name} (${label})`];
@@ -15,8 +15,8 @@ export function formatBuildMessages(name: string, label: string, messages: strin
15
15
  }
16
16
 
17
17
  /**
18
- * Print only errors
19
- * @param results Build result status per package
18
+ * 에러만 출력한다.
19
+ * @param results 패키지별 빌드 결과 상태
20
20
  */
21
21
  export function printErrors(results: Map<string, BuildResult>): void {
22
22
  for (const result of results.values()) {
@@ -32,34 +32,34 @@ export function printErrors(results: Map<string, BuildResult>): void {
32
32
  }
33
33
 
34
34
  /**
35
- * Print server URLs only
36
- * @param results Build result status per package
37
- * @param serverClientsMap List of connected clients per server
35
+ * 서버 URL만 출력한다.
36
+ * @param results 패키지별 빌드 결과 상태
37
+ * @param serverClientsMap 서버별 연결된 클라이언트 목록
38
38
  */
39
39
  export function printServers(
40
40
  results: Map<string, BuildResult>,
41
41
  serverClientsMap?: Map<string, string[]>,
42
42
  ): void {
43
- // Collect server info
43
+ // 서버 정보 수집
44
44
  const servers = [...results.values()].filter((r) => r.status === "running" && r.port != null);
45
45
 
46
- // Print server info (add blank line before if present)
46
+ // 서버 정보 출력 (있으면 앞에 추가)
47
47
  if (servers.length > 0) {
48
48
  process.stdout.write("\n");
49
49
  for (const server of servers) {
50
50
  if (server.target === "server") {
51
- // If server has connected clients, print only client URLs
51
+ // 서버에 연결된 클라이언트가 있으면 클라이언트 URL만 출력
52
52
  const clients = serverClientsMap?.get(server.name) ?? [];
53
53
  if (clients.length > 0) {
54
54
  for (const clientName of clients) {
55
55
  consola.info(`[server] http://localhost:${server.port}/${clientName}/`);
56
56
  }
57
57
  } else {
58
- // If no connected clients, print server root URL
58
+ // 연결된 클라이언트가 없으면 서버 루트 URL 출력
59
59
  consola.info(`[server] http://localhost:${server.port}/`);
60
60
  }
61
61
  } else {
62
- // Standalone client: print with name included
62
+ // 독립형 클라이언트: 이름 포함하여 출력
63
63
  consola.info(`[server] http://localhost:${server.port}/${server.name}/`);
64
64
  }
65
65
  }
@@ -33,7 +33,7 @@ export function iteratePackages(
33
33
  }
34
34
 
35
35
  /**
36
- * Walk up from import.meta.dirname to find package.json and return package root
36
+ * import.meta.dirname에서 위로 탐색하여 package.json 찾고 패키지 루트를 반환한다.
37
37
  */
38
38
  export function findPackageRoot(startDir: string): string {
39
39
  let dir = startDir;
@@ -46,8 +46,8 @@ export function findPackageRoot(startDir: string): string {
46
46
  }
47
47
 
48
48
  /**
49
- * Discover all workspace packages from packages/ and tests/ directories.
50
- * Returns a map of directory name → relative path (e.g., "orm" → "tests/orm").
49
+ * packages/ tests/ 디렉토리에서 모든 워크스페이스 패키지를 탐색한다.
50
+ * 디렉토리명 상대 경로의 맵을 반환한다 (예: "orm" → "tests/orm").
51
51
  */
52
52
  export function discoverWorkspacePackages(cwd: string): Map<string, string> {
53
53
  logger.debug("워크스페이스 패키지 탐색 시작");
@@ -71,13 +71,7 @@ export function discoverWorkspacePackages(cwd: string): Map<string, string> {
71
71
  }
72
72
 
73
73
  /**
74
- * Merge tests/ packages discovered from workspace into sd.config.ts packages.
75
- * Tests packages are assigned `{ target: "node" }` by default.
76
- * Also builds a pathMap (name → relative path) for all packages.
77
- * Throws SdError if a tests package name collides with an sd.config.ts package name.
78
- */
79
- /**
80
- * Build pathMap from sd.config.ts packages only (without tests packages).
74
+ * sd.config.ts 패키지만으로 pathMap을 구성한다 (tests 패키지 제외).
81
75
  */
82
76
  export function buildPathMapFromConfig(
83
77
  configPackages: Record<string, SdPackageConfig | undefined>,
@@ -89,6 +83,12 @@ export function buildPathMapFromConfig(
89
83
  return pathMap;
90
84
  }
91
85
 
86
+ /**
87
+ * workspace에서 발견된 tests/ 패키지를 sd.config.ts 패키지에 병합한다.
88
+ * tests 패키지는 기본적으로 `{ target: "node" }`가 할당된다.
89
+ * 모든 패키지의 pathMap(name → 상대 경로)도 함께 구성한다.
90
+ * tests 패키지명이 sd.config.ts 패키지명과 충돌하면 SdError를 던진다.
91
+ */
92
92
  export function mergeTestsPackagesIntoConfig(
93
93
  configPackages: Record<string, SdPackageConfig | undefined>,
94
94
  workspacePackages: Map<string, string>,
@@ -97,12 +97,12 @@ export function mergeTestsPackagesIntoConfig(
97
97
  const pathMap = new Map<string, string>();
98
98
  const merged: Record<string, SdPackageConfig | undefined> = { ...configPackages };
99
99
 
100
- // Set default paths for config packages
100
+ // config 패키지의 기본 경로 설정
101
101
  for (const name of Object.keys(configPackages)) {
102
102
  pathMap.set(name, `packages/${name}`);
103
103
  }
104
104
 
105
- // Add tests packages
105
+ // tests 패키지 추가
106
106
  for (const [name, relPath] of workspacePackages) {
107
107
  if (!relPath.startsWith("tests/")) continue;
108
108
 
@@ -125,6 +125,22 @@ export interface DepsResult {
125
125
  replaceDeps: string[];
126
126
  }
127
127
 
128
+ /**
129
+ * pnpm-workspace.yaml 기반으로 workspace 패키지의 name → 상대 디렉토리 맵을 구성한다.
130
+ * 예: "@simplysm/core-node" → "packages/core-node"
131
+ */
132
+ function buildWorkspacePkgMap(cwd: string): Map<string, string> {
133
+ const map = new Map<string, string>();
134
+ const wsPkgs = discoverWorkspacePackages(cwd);
135
+ for (const [, relDir] of wsPkgs) {
136
+ const pkgJsonPath = pathx.posix(path.join(cwd, relDir, "package.json"));
137
+ if (!fs.existsSync(pkgJsonPath)) continue;
138
+ const pkgJson = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8")) as { name: string };
139
+ map.set(pkgJson.name, relDir);
140
+ }
141
+ return map;
142
+ }
143
+
128
144
  export function collectDeps(
129
145
  pkgDir: string,
130
146
  cwd: string,
@@ -132,10 +148,9 @@ export function collectDeps(
132
148
  ): DepsResult {
133
149
  const startTime = performance.now();
134
150
  logger.debug("의존성 수집 시작");
135
- const rootPkgJsonPath = pathx.posix(path.join(cwd, "package.json"));
136
- const rootPkgJson = JSON.parse(fs.readFileSync(rootPkgJsonPath, "utf-8")) as { name: string };
137
- const scopeMatch = rootPkgJson.name.match(/^(@[^/]+)\//);
138
- const workspaceScope = scopeMatch != null ? scopeMatch[1] : undefined;
151
+
152
+ // pnpm-workspace.yaml에서 workspace 패키지 디렉토리 패턴을 읽어 실제 패키지 맵 구성
153
+ const workspacePkgMap = buildWorkspacePkgMap(cwd);
139
154
 
140
155
  const replaceDepsPatterns: Array<{ regex: RegExp }> = [];
141
156
  if (replaceDepsConfig != null) {
@@ -162,18 +177,15 @@ export function collectDeps(
162
177
  if (visited.has(dep)) continue;
163
178
  visited.add(dep);
164
179
 
165
- // Check for workspace package
166
- if (workspaceScope != null && dep.startsWith(workspaceScope + "/")) {
167
- const dirName = dep.slice(workspaceScope.length + 1);
168
- const depDir = pathx.posix(path.join(cwd, "packages", dirName));
169
- if (fs.existsSync(pathx.posix(path.join(depDir, "package.json")))) {
170
- workspaceDeps.push(dirName);
171
- traverse(depDir);
172
- continue;
173
- }
180
+ // 워크스페이스 패키지 확인
181
+ const wsDir = workspacePkgMap.get(dep);
182
+ if (wsDir != null) {
183
+ workspaceDeps.push(path.basename(wsDir));
184
+ traverse(pathx.posix(path.join(cwd, wsDir)));
185
+ continue;
174
186
  }
175
187
 
176
- // Check replaceDeps pattern
188
+ // replaceDeps 패턴 확인
177
189
  const matched = replaceDepsPatterns.find((p) => p.regex.test(dep));
178
190
  if (matched != null) {
179
191
  replaceDeps.push(dep);
@@ -194,8 +206,8 @@ export function collectDeps(
194
206
  }
195
207
 
196
208
  /**
197
- * Check if package.json in the given directory has @angular/core
198
- * in dependencies or peerDependencies.
209
+ * 지정된 디렉토리의 package.json @angular/core
210
+ * dependencies 또는 peerDependencies에 있는지 확인한다.
199
211
  */
200
212
  export function hasAngularCoreDependency(pkgDir: string): boolean {
201
213
  const pkgJsonPath = pathx.posix(path.join(pkgDir, "package.json"));
@@ -215,11 +227,11 @@ export function hasAngularCoreDependency(pkgDir: string): boolean {
215
227
  }
216
228
 
217
229
  /**
218
- * Validate that all target names exist in the sdConfig packages.
219
- * Throws SdError if any unknown targets are found.
220
- * Does nothing when targets is empty.
221
- * @param targets - package name list to validate
222
- * @param packages - sdConfig.packages object
230
+ * 모든 target 이름이 sdConfig 패키지에 존재하는지 검증한다.
231
+ * 없는 target이 발견되면 SdError를 던진다.
232
+ * targets가 비어있으면 아무 동작도 하지 않는다.
233
+ * @param targets - 검증할 패키지명 목록
234
+ * @param packages - sdConfig.packages 객체
223
235
  */
224
236
  export function validateTargets(
225
237
  targets: string[],
@@ -234,11 +246,11 @@ export function validateTargets(
234
246
  }
235
247
 
236
248
  /**
237
- * Filter packages config by targets (excluding scripts target)
238
- * @param packages Package config map
239
- * @param targets List of package names to filter. If empty array, return all packages except scripts
240
- * @returns Filtered package config map
241
- * @internal exported for testing
249
+ * targets로 패키지 설정을 필터링한다 (scripts target 제외)
250
+ * @param packages 패키지 설정
251
+ * @param targets 필터링할 패키지명 목록. 배열이면 scripts를 제외한 모든 패키지 반환
252
+ * @returns 필터링된 패키지 설정
253
+ * @internal 테스트용으로 export
242
254
  */
243
255
  export function filterPackagesByTargets(
244
256
  packages: Record<string, SdPackageConfig | undefined>,
@@ -250,16 +262,16 @@ export function filterPackagesByTargets(
250
262
  for (const [name, config] of Object.entries(packages)) {
251
263
  if (config == null) continue;
252
264
 
253
- // Exclude scripts target unless watch hook is configured
265
+ // watch hook이 설정되지 않은 scripts target 제외
254
266
  if (config.target === "scripts" && config.watch == null) continue;
255
267
 
256
- // If targets is empty, include all packages
268
+ // targets 비어있으면 모든 패키지 포함
257
269
  if (targets.length === 0) {
258
270
  result[name] = config;
259
271
  continue;
260
272
  }
261
273
 
262
- // Filter only packages included in targets
274
+ // targets에 포함된 패키지만 필터링
263
275
  if (targets.includes(name)) {
264
276
  result[name] = config;
265
277
  }
@@ -336,7 +348,7 @@ export function classifyDevPackages(
336
348
 
337
349
  const entries = iteratePackages(allPackages, []);
338
350
 
339
- // First pass: collect server names
351
+ // 1차 패스: 서버 이름 수집
340
352
  const serverNames = new Set<string>();
341
353
  for (const { name, config } of entries) {
342
354
  if (config.target === "server") {
@@ -344,7 +356,7 @@ export function classifyDevPackages(
344
356
  }
345
357
  }
346
358
 
347
- // Second pass: classify all packages
359
+ // 2차 패스: 모든 패키지 분류
348
360
  for (const { name, config } of entries) {
349
361
  const relPath = pathMap.get(name) ?? `packages/${name}`;
350
362
  const pkgDir = pathx.posix(path.join(cwd, relPath));
@@ -361,7 +373,7 @@ export function classifyDevPackages(
361
373
  config: config,
362
374
  });
363
375
 
364
- // Build server-client mapping
376
+ // 서버-클라이언트 매핑 구성
365
377
  const clientConfig = config;
366
378
  if (typeof clientConfig.server === "string") {
367
379
  if (serverNames.has(clientConfig.server)) {
@@ -375,7 +387,7 @@ export function classifyDevPackages(
375
387
  }
376
388
  }
377
389
  }
378
- // Library and scripts packages are excluded from dev mode
390
+ // 라이브러리 scripts 패키지는 dev 모드에서 제외
379
391
  }
380
392
 
381
393
  logger.debug(`dev 패키지 분류 완료 (server: ${serverPackages.length}, client: ${clientPackages.length})`);