@simplysm/sd-cli 14.0.30 → 14.0.33

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 (626) hide show
  1. package/dist/{utils → angular}/angular-build-pipeline.d.ts +0 -2
  2. package/dist/angular/angular-build-pipeline.d.ts.map +1 -0
  3. package/dist/{utils → angular}/angular-build-pipeline.js +3 -6
  4. package/dist/angular/angular-build-pipeline.js.map +1 -0
  5. package/dist/{utils → angular}/angular-build.d.ts +1 -1
  6. package/dist/angular/angular-build.d.ts.map +1 -0
  7. package/dist/{utils → angular}/angular-build.js +1 -1
  8. package/dist/angular/angular-build.js.map +1 -0
  9. package/dist/{utils → angular}/angular-compiler.d.ts +0 -3
  10. package/dist/angular/angular-compiler.d.ts.map +1 -0
  11. package/dist/{utils → angular}/angular-compiler.js +1 -45
  12. package/dist/angular/angular-compiler.js.map +1 -0
  13. package/dist/angular/client-transform-stylesheet.js +1 -1
  14. package/dist/angular/client-transform-stylesheet.js.map +1 -1
  15. package/dist/{utils → angular}/ngtsc-build-core.d.ts +3 -3
  16. package/dist/angular/ngtsc-build-core.d.ts.map +1 -0
  17. package/dist/angular/ngtsc-build-core.js.map +1 -0
  18. package/dist/angular/scss-compiler.d.ts.map +1 -0
  19. package/dist/angular/scss-compiler.js.map +1 -0
  20. package/dist/angular/vite-angular-plugin.d.ts +2 -10
  21. package/dist/angular/vite-angular-plugin.d.ts.map +1 -1
  22. package/dist/angular/vite-angular-plugin.js +20 -286
  23. package/dist/angular/vite-angular-plugin.js.map +1 -1
  24. package/dist/capacitor/capacitor-build.d.ts +14 -0
  25. package/dist/capacitor/capacitor-build.d.ts.map +1 -0
  26. package/dist/capacitor/capacitor-build.js +105 -0
  27. package/dist/capacitor/capacitor-build.js.map +1 -0
  28. package/dist/capacitor/capacitor-config-writer.d.ts +11 -0
  29. package/dist/capacitor/capacitor-config-writer.d.ts.map +1 -0
  30. package/dist/capacitor/capacitor-config-writer.js +54 -0
  31. package/dist/capacitor/capacitor-config-writer.js.map +1 -0
  32. package/dist/capacitor/capacitor-icon.d.ts +5 -0
  33. package/dist/capacitor/capacitor-icon.d.ts.map +1 -0
  34. package/dist/capacitor/capacitor-icon.js +58 -0
  35. package/dist/capacitor/capacitor-icon.js.map +1 -0
  36. package/dist/capacitor/capacitor-npm-config.d.ts +11 -0
  37. package/dist/capacitor/capacitor-npm-config.d.ts.map +1 -0
  38. package/dist/capacitor/capacitor-npm-config.js +145 -0
  39. package/dist/capacitor/capacitor-npm-config.js.map +1 -0
  40. package/dist/capacitor/capacitor.d.ts +0 -45
  41. package/dist/capacitor/capacitor.d.ts.map +1 -1
  42. package/dist/capacitor/capacitor.js +15 -354
  43. package/dist/capacitor/capacitor.js.map +1 -1
  44. package/dist/commands/check.js +2 -2
  45. package/dist/commands/check.js.map +1 -1
  46. package/dist/commands/dev.d.ts +3 -3
  47. package/dist/commands/dev.d.ts.map +1 -1
  48. package/dist/commands/dev.js +3 -3
  49. package/dist/commands/dev.js.map +1 -1
  50. package/dist/commands/lint.d.ts +1 -1
  51. package/dist/commands/lint.d.ts.map +1 -1
  52. package/dist/commands/lint.js +1 -1
  53. package/dist/commands/lint.js.map +1 -1
  54. package/dist/commands/publish/deployment-phase.d.ts +12 -0
  55. package/dist/commands/publish/deployment-phase.d.ts.map +1 -0
  56. package/dist/commands/publish/deployment-phase.js +94 -0
  57. package/dist/commands/publish/deployment-phase.js.map +1 -0
  58. package/dist/commands/publish/env-utils.d.ts +10 -0
  59. package/dist/commands/publish/env-utils.d.ts.map +1 -0
  60. package/dist/commands/publish/env-utils.js +41 -0
  61. package/dist/commands/publish/env-utils.js.map +1 -0
  62. package/dist/commands/publish/git-phase.d.ts +12 -0
  63. package/dist/commands/publish/git-phase.d.ts.map +1 -0
  64. package/dist/commands/publish/git-phase.js +79 -0
  65. package/dist/commands/publish/git-phase.js.map +1 -0
  66. package/dist/commands/{publish.d.ts → publish/index.d.ts} +1 -1
  67. package/dist/commands/publish/index.d.ts.map +1 -0
  68. package/dist/commands/publish/index.js +211 -0
  69. package/dist/commands/publish/index.js.map +1 -0
  70. package/dist/commands/publish/local-publisher.d.ts +6 -0
  71. package/dist/commands/publish/local-publisher.d.ts.map +1 -0
  72. package/dist/commands/publish/local-publisher.js +16 -0
  73. package/dist/commands/publish/local-publisher.js.map +1 -0
  74. package/dist/commands/publish/npm-publisher.d.ts +6 -0
  75. package/dist/commands/publish/npm-publisher.d.ts.map +1 -0
  76. package/dist/commands/publish/npm-publisher.js +21 -0
  77. package/dist/commands/publish/npm-publisher.js.map +1 -0
  78. package/dist/commands/publish/post-publish-phase.d.ts +8 -0
  79. package/dist/commands/publish/post-publish-phase.d.ts.map +1 -0
  80. package/dist/commands/publish/post-publish-phase.js +34 -0
  81. package/dist/commands/publish/post-publish-phase.js.map +1 -0
  82. package/dist/commands/publish/storage-publisher.d.ts +18 -0
  83. package/dist/commands/publish/storage-publisher.d.ts.map +1 -0
  84. package/dist/commands/publish/storage-publisher.js +173 -0
  85. package/dist/commands/publish/storage-publisher.js.map +1 -0
  86. package/dist/commands/publish/version-upgrade.d.ts +28 -0
  87. package/dist/commands/publish/version-upgrade.d.ts.map +1 -0
  88. package/dist/commands/publish/version-upgrade.js +96 -0
  89. package/dist/commands/publish/version-upgrade.js.map +1 -0
  90. package/dist/commands/replace-deps.js +1 -1
  91. package/dist/commands/replace-deps.js.map +1 -1
  92. package/dist/commands/watch.d.ts +3 -4
  93. package/dist/commands/watch.d.ts.map +1 -1
  94. package/dist/commands/watch.js +3 -4
  95. package/dist/commands/watch.js.map +1 -1
  96. package/dist/deps/replace-deps/collect-deps.d.ts +6 -0
  97. package/dist/deps/replace-deps/collect-deps.d.ts.map +1 -0
  98. package/dist/deps/replace-deps/collect-deps.js +71 -0
  99. package/dist/deps/replace-deps/collect-deps.js.map +1 -0
  100. package/dist/{utils/replace-deps.d.ts → deps/replace-deps/replace-deps-resolve.d.ts} +7 -24
  101. package/dist/deps/replace-deps/replace-deps-resolve.d.ts.map +1 -0
  102. package/dist/{utils/replace-deps.js → deps/replace-deps/replace-deps-resolve.js} +4 -152
  103. package/dist/deps/replace-deps/replace-deps-resolve.js.map +1 -0
  104. package/dist/deps/replace-deps/replace-deps.d.ts +36 -0
  105. package/dist/deps/replace-deps/replace-deps.d.ts.map +1 -0
  106. package/dist/deps/replace-deps/replace-deps.js +155 -0
  107. package/dist/deps/replace-deps/replace-deps.js.map +1 -0
  108. package/dist/{utils → deps/server-externals}/server-production-files.d.ts +1 -1
  109. package/dist/deps/server-externals/server-production-files.d.ts.map +1 -0
  110. package/dist/{utils → deps/server-externals}/server-production-files.js +1 -1
  111. package/dist/deps/server-externals/server-production-files.js.map +1 -0
  112. package/dist/dev-server/dev-http-server.d.ts +23 -0
  113. package/dist/dev-server/dev-http-server.d.ts.map +1 -0
  114. package/dist/dev-server/dev-http-server.js +116 -0
  115. package/dist/dev-server/dev-http-server.js.map +1 -0
  116. package/dist/dev-server/hmr-client-script.d.ts +13 -0
  117. package/dist/dev-server/hmr-client-script.d.ts.map +1 -0
  118. package/dist/dev-server/hmr-client-script.js +73 -0
  119. package/dist/dev-server/hmr-client-script.js.map +1 -0
  120. package/dist/dev-server/hmr-service.d.ts +23 -0
  121. package/dist/dev-server/hmr-service.d.ts.map +1 -0
  122. package/dist/dev-server/hmr-service.js +139 -0
  123. package/dist/dev-server/hmr-service.js.map +1 -0
  124. package/dist/electron/electron.d.ts +5 -0
  125. package/dist/electron/electron.d.ts.map +1 -1
  126. package/dist/electron/electron.js +17 -24
  127. package/dist/electron/electron.js.map +1 -1
  128. package/dist/engines/BaseEngine.d.ts +18 -4
  129. package/dist/engines/BaseEngine.d.ts.map +1 -1
  130. package/dist/engines/BaseEngine.js +45 -66
  131. package/dist/engines/BaseEngine.js.map +1 -1
  132. package/dist/engines/{ViteEngine.d.ts → EsbuildClientEngine.d.ts} +11 -18
  133. package/dist/engines/EsbuildClientEngine.d.ts.map +1 -0
  134. package/dist/engines/{ViteEngine.js → EsbuildClientEngine.js} +28 -55
  135. package/dist/engines/EsbuildClientEngine.js.map +1 -0
  136. package/dist/engines/NgtscEngine.d.ts +2 -2
  137. package/dist/engines/NgtscEngine.d.ts.map +1 -1
  138. package/dist/engines/NgtscEngine.js +1 -9
  139. package/dist/engines/NgtscEngine.js.map +1 -1
  140. package/dist/engines/ServerEsbuildEngine.d.ts +2 -2
  141. package/dist/engines/ServerEsbuildEngine.d.ts.map +1 -1
  142. package/dist/engines/ServerEsbuildEngine.js +1 -9
  143. package/dist/engines/ServerEsbuildEngine.js.map +1 -1
  144. package/dist/engines/TscEngine.d.ts +2 -2
  145. package/dist/engines/TscEngine.d.ts.map +1 -1
  146. package/dist/engines/TscEngine.js +1 -9
  147. package/dist/engines/TscEngine.js.map +1 -1
  148. package/dist/engines/index.d.ts +15 -5
  149. package/dist/engines/index.d.ts.map +1 -1
  150. package/dist/engines/index.js +21 -5
  151. package/dist/engines/index.js.map +1 -1
  152. package/dist/engines/types.d.ts +3 -3
  153. package/dist/engines/types.d.ts.map +1 -1
  154. package/dist/esbuild/esbuild-client-config.d.ts +38 -0
  155. package/dist/esbuild/esbuild-client-config.d.ts.map +1 -0
  156. package/dist/esbuild/esbuild-client-config.js +171 -0
  157. package/dist/esbuild/esbuild-client-config.js.map +1 -0
  158. package/dist/esbuild/esbuild-config.d.ts.map +1 -0
  159. package/dist/{utils → esbuild}/esbuild-config.js +1 -0
  160. package/dist/esbuild/esbuild-config.js.map +1 -0
  161. package/dist/esbuild/esbuild-index-html.d.ts +39 -0
  162. package/dist/esbuild/esbuild-index-html.d.ts.map +1 -0
  163. package/dist/esbuild/esbuild-index-html.js +68 -0
  164. package/dist/esbuild/esbuild-index-html.js.map +1 -0
  165. package/dist/esbuild/esbuild-pwa.d.ts +21 -0
  166. package/dist/esbuild/esbuild-pwa.d.ts.map +1 -0
  167. package/dist/esbuild/esbuild-pwa.js +105 -0
  168. package/dist/esbuild/esbuild-pwa.js.map +1 -0
  169. package/dist/esbuild/esbuild-scss-plugin.d.ts +6 -0
  170. package/dist/esbuild/esbuild-scss-plugin.d.ts.map +1 -0
  171. package/dist/esbuild/esbuild-scss-plugin.js +41 -0
  172. package/dist/esbuild/esbuild-scss-plugin.js.map +1 -0
  173. package/dist/lint/lint-core.d.ts.map +1 -0
  174. package/dist/lint/lint-core.js.map +1 -0
  175. package/dist/lint/lint-utils.d.ts.map +1 -0
  176. package/dist/lint/lint-utils.js.map +1 -0
  177. package/dist/lint/lint-with-program.d.ts.map +1 -0
  178. package/dist/lint/lint-with-program.js.map +1 -0
  179. package/dist/orchestrators/BaseOrchestrator.d.ts +44 -0
  180. package/dist/orchestrators/BaseOrchestrator.d.ts.map +1 -0
  181. package/dist/orchestrators/BaseOrchestrator.js +92 -0
  182. package/dist/orchestrators/BaseOrchestrator.js.map +1 -0
  183. package/dist/orchestrators/BuildOrchestrator.d.ts +45 -3
  184. package/dist/orchestrators/BuildOrchestrator.d.ts.map +1 -1
  185. package/dist/orchestrators/BuildOrchestrator.js +170 -143
  186. package/dist/orchestrators/BuildOrchestrator.js.map +1 -1
  187. package/dist/orchestrators/DevOrchestrator.d.ts +39 -0
  188. package/dist/orchestrators/DevOrchestrator.d.ts.map +1 -0
  189. package/dist/orchestrators/DevOrchestrator.js +249 -0
  190. package/dist/orchestrators/DevOrchestrator.js.map +1 -0
  191. package/dist/orchestrators/ServerRuntimeManager.d.ts +22 -0
  192. package/dist/orchestrators/ServerRuntimeManager.d.ts.map +1 -0
  193. package/dist/orchestrators/ServerRuntimeManager.js +66 -0
  194. package/dist/orchestrators/ServerRuntimeManager.js.map +1 -0
  195. package/dist/orchestrators/TypecheckOrchestrator.d.ts +17 -2
  196. package/dist/orchestrators/TypecheckOrchestrator.d.ts.map +1 -1
  197. package/dist/orchestrators/TypecheckOrchestrator.js +122 -108
  198. package/dist/orchestrators/TypecheckOrchestrator.js.map +1 -1
  199. package/dist/orchestrators/WatchOrchestrator.d.ts +33 -0
  200. package/dist/orchestrators/WatchOrchestrator.d.ts.map +1 -0
  201. package/dist/orchestrators/WatchOrchestrator.js +158 -0
  202. package/dist/orchestrators/WatchOrchestrator.js.map +1 -0
  203. package/dist/orchestrators/types.d.ts +17 -0
  204. package/dist/orchestrators/types.d.ts.map +1 -0
  205. package/dist/orchestrators/types.js +2 -0
  206. package/dist/orchestrators/types.js.map +1 -0
  207. package/dist/runtime/ResultCollector.d.ts.map +1 -0
  208. package/dist/runtime/ResultCollector.js.map +1 -0
  209. package/dist/runtime/SignalHandler.d.ts.map +1 -0
  210. package/dist/runtime/SignalHandler.js.map +1 -0
  211. package/dist/{utils → runtime}/engine-stop.d.ts +1 -1
  212. package/dist/runtime/engine-stop.d.ts.map +1 -0
  213. package/dist/{utils → runtime}/engine-stop.js +1 -1
  214. package/dist/runtime/engine-stop.js.map +1 -0
  215. package/dist/runtime/engine-watch-events.d.ts +43 -0
  216. package/dist/runtime/engine-watch-events.d.ts.map +1 -0
  217. package/dist/runtime/engine-watch-events.js +72 -0
  218. package/dist/runtime/engine-watch-events.js.map +1 -0
  219. package/dist/{utils → runtime}/rebuild-manager.d.ts +1 -0
  220. package/dist/runtime/rebuild-manager.d.ts.map +1 -0
  221. package/dist/{utils → runtime}/rebuild-manager.js +8 -1
  222. package/dist/runtime/rebuild-manager.js.map +1 -0
  223. package/dist/runtime/worker-events.d.ts +22 -0
  224. package/dist/runtime/worker-events.d.ts.map +1 -0
  225. package/dist/runtime/worker-events.js +2 -0
  226. package/dist/runtime/worker-events.js.map +1 -0
  227. package/dist/runtime/worker-utils.d.ts.map +1 -0
  228. package/dist/runtime/worker-utils.js.map +1 -0
  229. package/dist/sd-cli-entry.d.ts.map +1 -1
  230. package/dist/sd-cli-entry.js +61 -54
  231. package/dist/sd-cli-entry.js.map +1 -1
  232. package/dist/sd-cli.js +1 -1
  233. package/dist/sd-cli.js.map +1 -1
  234. package/dist/sd-config.types.d.ts +6 -15
  235. package/dist/sd-config.types.d.ts.map +1 -1
  236. package/dist/typecheck/typecheck-non-package.d.ts.map +1 -0
  237. package/dist/{utils → typecheck}/typecheck-non-package.js +1 -1
  238. package/dist/typecheck/typecheck-non-package.js.map +1 -0
  239. package/dist/typecheck/typecheck-serialization.d.ts.map +1 -0
  240. package/dist/typecheck/typecheck-serialization.js.map +1 -0
  241. package/dist/utils/diagnostic-utils.d.ts +5 -0
  242. package/dist/utils/diagnostic-utils.d.ts.map +1 -1
  243. package/dist/utils/diagnostic-utils.js +15 -0
  244. package/dist/utils/diagnostic-utils.js.map +1 -1
  245. package/dist/utils/orchestrator-utils.d.ts +1 -5
  246. package/dist/utils/orchestrator-utils.d.ts.map +1 -1
  247. package/dist/utils/orchestrator-utils.js +2 -5
  248. package/dist/utils/orchestrator-utils.js.map +1 -1
  249. package/dist/utils/output-utils.d.ts +1 -1
  250. package/dist/utils/output-utils.d.ts.map +1 -1
  251. package/dist/utils/package-classify.d.ts +54 -0
  252. package/dist/utils/package-classify.d.ts.map +1 -0
  253. package/dist/utils/package-classify.js +134 -0
  254. package/dist/utils/package-classify.js.map +1 -0
  255. package/dist/utils/package-utils.d.ts +1 -58
  256. package/dist/utils/package-utils.d.ts.map +1 -1
  257. package/dist/utils/package-utils.js +0 -193
  258. package/dist/utils/package-utils.js.map +1 -1
  259. package/dist/utils/tsc-build.d.ts +1 -1
  260. package/dist/utils/tsc-build.d.ts.map +1 -1
  261. package/dist/utils/tsc-build.js +1 -1
  262. package/dist/utils/tsc-build.js.map +1 -1
  263. package/dist/workers/build-change-filter.d.ts +8 -0
  264. package/dist/workers/build-change-filter.d.ts.map +1 -0
  265. package/dist/workers/build-change-filter.js +16 -0
  266. package/dist/workers/build-change-filter.js.map +1 -0
  267. package/dist/workers/build-watch-paths.d.ts +20 -0
  268. package/dist/workers/build-watch-paths.d.ts.map +1 -0
  269. package/dist/workers/build-watch-paths.js +29 -0
  270. package/dist/workers/build-watch-paths.js.map +1 -0
  271. package/dist/workers/client.worker.d.ts +11 -18
  272. package/dist/workers/client.worker.d.ts.map +1 -1
  273. package/dist/workers/client.worker.js +218 -289
  274. package/dist/workers/client.worker.js.map +1 -1
  275. package/dist/workers/library-build.worker.d.ts +2 -2
  276. package/dist/workers/library-build.worker.d.ts.map +1 -1
  277. package/dist/workers/library-build.worker.js +13 -24
  278. package/dist/workers/library-build.worker.js.map +1 -1
  279. package/dist/workers/lint.worker.d.ts +1 -1
  280. package/dist/workers/lint.worker.d.ts.map +1 -1
  281. package/dist/workers/lint.worker.js +1 -1
  282. package/dist/workers/lint.worker.js.map +1 -1
  283. package/dist/workers/ngtsc-build.worker.d.ts +1 -1
  284. package/dist/workers/ngtsc-build.worker.d.ts.map +1 -1
  285. package/dist/workers/ngtsc-build.worker.js +19 -35
  286. package/dist/workers/ngtsc-build.worker.js.map +1 -1
  287. package/dist/workers/server-build.worker.d.ts +2 -2
  288. package/dist/workers/server-build.worker.d.ts.map +1 -1
  289. package/dist/workers/server-build.worker.js +36 -137
  290. package/dist/workers/server-build.worker.js.map +1 -1
  291. package/dist/workers/server-esbuild-context.d.ts +47 -0
  292. package/dist/workers/server-esbuild-context.d.ts.map +1 -0
  293. package/dist/workers/server-esbuild-context.js +92 -0
  294. package/dist/workers/server-esbuild-context.js.map +1 -0
  295. package/dist/workers/server-runtime.worker.d.ts.map +1 -1
  296. package/dist/workers/server-runtime.worker.js +3 -1
  297. package/dist/workers/server-runtime.worker.js.map +1 -1
  298. package/dist/workers/server-watch-manager.d.ts +44 -0
  299. package/dist/workers/server-watch-manager.d.ts.map +1 -0
  300. package/dist/workers/server-watch-manager.js +87 -0
  301. package/dist/workers/server-watch-manager.js.map +1 -0
  302. package/dist/workers/shared-worker-lifecycle.d.ts +14 -0
  303. package/dist/workers/shared-worker-lifecycle.d.ts.map +1 -0
  304. package/dist/workers/shared-worker-lifecycle.js +17 -0
  305. package/dist/workers/shared-worker-lifecycle.js.map +1 -0
  306. package/package.json +9 -9
  307. package/src/{utils → angular}/angular-build-pipeline.ts +3 -8
  308. package/src/{utils → angular}/angular-build.ts +1 -1
  309. package/src/{utils → angular}/angular-compiler.ts +1 -64
  310. package/src/angular/client-transform-stylesheet.ts +1 -1
  311. package/src/{utils → angular}/ngtsc-build-core.ts +3 -3
  312. package/src/angular/vite-angular-plugin.ts +22 -355
  313. package/src/capacitor/capacitor-build.ts +142 -0
  314. package/src/capacitor/capacitor-config-writer.ts +66 -0
  315. package/src/capacitor/capacitor-icon.ts +75 -0
  316. package/src/capacitor/capacitor-npm-config.ts +192 -0
  317. package/src/capacitor/capacitor.ts +32 -441
  318. package/src/commands/check.ts +2 -2
  319. package/src/commands/dev.ts +6 -6
  320. package/src/commands/lint.ts +1 -1
  321. package/src/commands/publish/deployment-phase.ts +125 -0
  322. package/src/commands/publish/env-utils.ts +44 -0
  323. package/src/commands/publish/git-phase.ts +99 -0
  324. package/src/commands/publish/index.ts +266 -0
  325. package/src/commands/publish/local-publisher.ts +23 -0
  326. package/src/commands/publish/npm-publisher.ts +30 -0
  327. package/src/commands/publish/post-publish-phase.ts +43 -0
  328. package/src/commands/publish/storage-publisher.ts +208 -0
  329. package/src/commands/publish/version-upgrade.ts +132 -0
  330. package/src/commands/replace-deps.ts +1 -1
  331. package/src/commands/watch.ts +6 -7
  332. package/src/deps/replace-deps/collect-deps.ts +92 -0
  333. package/src/{utils/replace-deps.ts → deps/replace-deps/replace-deps-resolve.ts} +4 -188
  334. package/src/deps/replace-deps/replace-deps.ts +193 -0
  335. package/src/{utils → deps/server-externals}/server-production-files.ts +2 -2
  336. package/src/dev-server/dev-http-server.ts +149 -0
  337. package/src/dev-server/hmr-client-script.ts +74 -0
  338. package/src/dev-server/hmr-service.ts +178 -0
  339. package/src/electron/electron.ts +21 -28
  340. package/src/engines/BaseEngine.ts +64 -83
  341. package/src/engines/{ViteEngine.ts → EsbuildClientEngine.ts} +33 -72
  342. package/src/engines/NgtscEngine.ts +3 -11
  343. package/src/engines/ServerEsbuildEngine.ts +3 -11
  344. package/src/engines/TscEngine.ts +3 -11
  345. package/src/engines/index.ts +29 -9
  346. package/src/engines/types.ts +3 -3
  347. package/src/esbuild/esbuild-client-config.ts +230 -0
  348. package/src/{utils → esbuild}/esbuild-config.ts +1 -0
  349. package/src/esbuild/esbuild-index-html.ts +119 -0
  350. package/src/esbuild/esbuild-pwa.ts +139 -0
  351. package/src/esbuild/esbuild-scss-plugin.ts +48 -0
  352. package/src/orchestrators/BaseOrchestrator.ts +118 -0
  353. package/src/orchestrators/BuildOrchestrator.ts +234 -171
  354. package/src/orchestrators/DevOrchestrator.ts +315 -0
  355. package/src/orchestrators/ServerRuntimeManager.ts +85 -0
  356. package/src/orchestrators/TypecheckOrchestrator.ts +166 -117
  357. package/src/orchestrators/WatchOrchestrator.ts +203 -0
  358. package/src/orchestrators/types.ts +18 -0
  359. package/src/{utils → runtime}/engine-stop.ts +1 -1
  360. package/src/runtime/engine-watch-events.ts +121 -0
  361. package/src/{utils → runtime}/rebuild-manager.ts +8 -1
  362. package/src/runtime/worker-events.ts +25 -0
  363. package/src/sd-cli-entry.ts +69 -54
  364. package/src/sd-cli.ts +1 -1
  365. package/src/sd-config.types.ts +6 -16
  366. package/src/{utils → typecheck}/typecheck-non-package.ts +1 -1
  367. package/src/utils/diagnostic-utils.ts +15 -0
  368. package/src/utils/orchestrator-utils.ts +2 -6
  369. package/src/utils/output-utils.ts +1 -1
  370. package/src/utils/package-classify.ts +182 -0
  371. package/src/utils/package-utils.ts +0 -257
  372. package/src/utils/tsc-build.ts +1 -1
  373. package/src/workers/build-change-filter.ts +27 -0
  374. package/src/workers/build-watch-paths.ts +54 -0
  375. package/src/workers/client.worker.ts +258 -328
  376. package/src/workers/library-build.worker.ts +15 -34
  377. package/src/workers/lint.worker.ts +1 -1
  378. package/src/workers/ngtsc-build.worker.ts +19 -46
  379. package/src/workers/server-build.worker.ts +38 -168
  380. package/src/workers/server-esbuild-context.ts +122 -0
  381. package/src/workers/server-runtime.worker.ts +4 -1
  382. package/src/workers/server-watch-manager.ts +124 -0
  383. package/src/workers/shared-worker-lifecycle.ts +24 -0
  384. package/tests/angular/angular-build-pipeline.spec.ts +2 -2
  385. package/tests/angular/angular-compiler-aot.acc.spec.ts +68 -0
  386. package/tests/angular/angular-compiler-aot.spec.ts +80 -0
  387. package/tests/angular/angular-compiler-hmr-removal.verify.md +16 -0
  388. package/tests/angular/vite-angular-plugin-legacy-watch.spec.ts +0 -17
  389. package/tests/angular/vite-angular-plugin-vitest.spec.ts +1 -6
  390. package/tests/angular/vite-angular-plugin-vitest.verify.md +20 -0
  391. package/tests/angular/vite-angular-plugin.spec.ts +4 -178
  392. package/tests/capacitor/capacitor-android.spec.ts +1 -0
  393. package/tests/capacitor/capacitor-build.spec.ts +1 -0
  394. package/tests/capacitor/capacitor-config-writer.acc.spec.ts +108 -0
  395. package/tests/capacitor/capacitor-config-writer.spec.ts +95 -0
  396. package/tests/capacitor/capacitor-icon.spec.ts +1 -0
  397. package/tests/capacitor/capacitor-init.spec.ts +1 -0
  398. package/tests/capacitor/capacitor-npm-config.acc.spec.ts +236 -0
  399. package/tests/capacitor/capacitor-npm-config.spec.ts +132 -0
  400. package/tests/capacitor/capacitor-run.spec.ts +1 -0
  401. package/tests/capacitor/capacitor-workspace.spec.ts +1 -0
  402. package/tests/commands/check.spec.ts +2 -2
  403. package/tests/commands/deployment-phase.acc.spec.ts +142 -0
  404. package/tests/commands/git-phase.acc.spec.ts +158 -0
  405. package/tests/commands/lint.spec.ts +1 -1
  406. package/tests/commands/post-publish-phase.acc.spec.ts +82 -0
  407. package/tests/commands/publish-npm-local-split.verify.md +9 -0
  408. package/tests/commands/publish-responsibility-split.verify.md +13 -0
  409. package/tests/commands/publish-storage-split.verify.md +8 -0
  410. package/tests/commands/publish.spec.ts +1 -1
  411. package/tests/commands/typecheck.spec.ts +18 -18
  412. package/tests/deps/deps-directory-separation.verify.md +15 -0
  413. package/tests/engines/base-engine.spec.ts +65 -6
  414. package/tests/engines/engine-adapter-isolation.spec.ts +11 -18
  415. package/tests/engines/engine-selection.spec.ts +38 -5
  416. package/tests/engines/engine-typecheck-selection.acc.spec.ts +85 -0
  417. package/tests/engines/engine-typecheck-selection.verify.md +8 -0
  418. package/tests/engines/esbuild-client-engine.acc.spec.ts +161 -0
  419. package/tests/engines/esbuild-client-engine.spec.ts +320 -0
  420. package/tests/engines/esbuild-client-engine.verify.md +15 -0
  421. package/tests/engines/normalize-result.verify.md +9 -0
  422. package/tests/engines/vite-dependency-cleanup.verify.md +24 -0
  423. package/tests/orchestrators/build-orchestrator.spec.ts +3 -3
  424. package/tests/orchestrators/dev-orchestrator.spec.ts +799 -0
  425. package/tests/orchestrators/orchestrator-baseenv.verify.md +10 -0
  426. package/tests/orchestrators/orchestrator-diagnostic-formatting.verify.md +10 -0
  427. package/tests/orchestrators/orchestrator-initializemode-signature.verify.md +9 -0
  428. package/tests/orchestrators/typecheck-orchestrator.spec.ts +11 -11
  429. package/tests/orchestrators/watch-orchestrator.spec.ts +511 -0
  430. package/tests/{infra → runtime}/result-collector.spec.ts +1 -1
  431. package/tests/{infra → runtime}/signal-handler.spec.ts +1 -1
  432. package/tests/sd-cli-entry.spec.ts +9 -0
  433. package/tests/utils/angular-build.spec.ts +15 -20
  434. package/tests/utils/angular-compiler-emit.spec.ts +2 -2
  435. package/tests/utils/angular-compiler.spec.ts +2 -2
  436. package/tests/utils/angular-source-file-cache.spec.ts +2 -2
  437. package/tests/utils/concurrency.spec.ts +2 -10
  438. package/tests/utils/dev-http-server.acc.spec.ts +206 -0
  439. package/tests/utils/dev-http-server.spec.ts +181 -0
  440. package/tests/utils/dev-http-server.verify.md +8 -0
  441. package/tests/utils/diagnostic-utils.spec.ts +42 -1
  442. package/tests/utils/engine-stop.spec.ts +1 -1
  443. package/tests/utils/engine-watch-events.acc.spec.ts +217 -0
  444. package/tests/utils/engine-watch-events.spec.ts +141 -0
  445. package/tests/utils/engine-watch-events.verify.md +17 -0
  446. package/tests/utils/esbuild-client-config.acc.spec.ts +443 -0
  447. package/tests/utils/esbuild-client-config.spec.ts +590 -0
  448. package/tests/utils/esbuild-client-config.verify.md +26 -0
  449. package/tests/utils/esbuild-config.spec.ts +11 -1
  450. package/tests/utils/esbuild-index-html.acc.spec.ts +166 -0
  451. package/tests/utils/esbuild-index-html.spec.ts +194 -0
  452. package/tests/utils/esbuild-index-html.verify.md +10 -0
  453. package/tests/utils/esbuild-pwa.acc.spec.ts +203 -0
  454. package/tests/utils/esbuild-pwa.spec.ts +189 -0
  455. package/tests/utils/esbuild-pwa.verify.md +9 -0
  456. package/tests/utils/esbuild-scss-plugin.acc.spec.ts +111 -0
  457. package/tests/utils/esbuild-scss-plugin.spec.ts +150 -0
  458. package/tests/utils/esbuild-scss-plugin.verify.md +8 -0
  459. package/tests/utils/external-modules.spec.ts +1 -1
  460. package/tests/utils/hmr-client-script.acc.spec.ts +128 -0
  461. package/tests/utils/hmr-client-script.spec.ts +44 -0
  462. package/tests/utils/hmr-service-dispatcher.acc.spec.ts +217 -0
  463. package/tests/utils/hmr-service-dispatcher.spec.ts +143 -0
  464. package/tests/utils/hmr-service.acc.spec.ts +139 -0
  465. package/tests/utils/hmr-service.spec.ts +131 -0
  466. package/tests/utils/hmr-service.verify.md +17 -0
  467. package/tests/utils/lint-core.spec.ts +2 -1
  468. package/tests/utils/lint-utils.spec.ts +1 -1
  469. package/tests/utils/lint-with-program.spec.ts +1 -1
  470. package/tests/utils/ngtsc-build-core-write-emit.spec.ts +19 -19
  471. package/tests/utils/ngtsc-build-core.spec.ts +4 -4
  472. package/tests/utils/orchestrator-utils.spec.ts +2 -2
  473. package/tests/utils/output-utils.spec.ts +1 -1
  474. package/tests/utils/package-utils.spec.ts +1 -1
  475. package/tests/utils/rebuild-manager.spec.ts +20 -7
  476. package/tests/utils/replace-deps-split.verify.md +15 -0
  477. package/tests/utils/replace-deps-watch.acc.spec.ts +131 -0
  478. package/tests/utils/replace-deps-watch.spec.ts +91 -0
  479. package/tests/utils/replace-deps-watch.verify.md +9 -0
  480. package/tests/utils/replace-deps.spec.ts +1 -1
  481. package/tests/utils/scss-compiler.spec.ts +1 -1
  482. package/tests/utils/tsc-build.spec.ts +1 -1
  483. package/tests/utils/typecheck-non-package.spec.ts +2 -2
  484. package/tests/utils/worker-utils.spec.ts +2 -1
  485. package/tests/workers/build-change-filter.acc.spec.ts +78 -0
  486. package/tests/workers/build-change-filter.spec.ts +39 -0
  487. package/tests/workers/build-watch-paths-library.verify.md +10 -0
  488. package/tests/workers/build-watch-paths-ngtsc-server.verify.md +12 -0
  489. package/tests/workers/build-watch-paths.acc.spec.ts +101 -0
  490. package/tests/workers/build-watch-paths.spec.ts +121 -0
  491. package/tests/workers/client-worker-browser-support.verify.md +7 -0
  492. package/tests/workers/client-worker-onend-sync.verify.md +7 -0
  493. package/tests/workers/client-worker.acc.spec.ts +185 -0
  494. package/tests/workers/client-worker.spec.ts +91 -178
  495. package/tests/workers/library-build-lint.spec.ts +3 -3
  496. package/tests/workers/library-build-worker.spec.ts +10 -11
  497. package/tests/workers/ngtsc-build-lint.spec.ts +4 -4
  498. package/tests/workers/ngtsc-build-worker.spec.ts +2 -2
  499. package/tests/workers/server-build-lint.spec.ts +4 -4
  500. package/tests/workers/server-build-worker.spec.ts +14 -15
  501. package/tests/workers/server-esbuild-context-integration.verify.md +10 -0
  502. package/tests/workers/server-esbuild-context.acc.spec.ts +98 -0
  503. package/tests/workers/server-esbuild-context.spec.ts +198 -0
  504. package/tests/workers/server-runtime-worker.spec.ts +4 -3
  505. package/tests/workers/server-watch-manager.acc.spec.ts +162 -0
  506. package/tests/workers/server-watch-manager.spec.ts +199 -0
  507. package/tests/workers/shared-worker-lifecycle.acc.spec.ts +27 -0
  508. package/tests/workers/shared-worker-lifecycle.spec.ts +47 -0
  509. package/dist/angular/vite-postcss-inline-plugin.d.ts +0 -18
  510. package/dist/angular/vite-postcss-inline-plugin.d.ts.map +0 -1
  511. package/dist/angular/vite-postcss-inline-plugin.js +0 -108
  512. package/dist/angular/vite-postcss-inline-plugin.js.map +0 -1
  513. package/dist/commands/publish.d.ts.map +0 -1
  514. package/dist/commands/publish.js +0 -689
  515. package/dist/commands/publish.js.map +0 -1
  516. package/dist/engines/ViteEngine.d.ts.map +0 -1
  517. package/dist/engines/ViteEngine.js.map +0 -1
  518. package/dist/infra/ResultCollector.d.ts.map +0 -1
  519. package/dist/infra/ResultCollector.js.map +0 -1
  520. package/dist/infra/SignalHandler.d.ts.map +0 -1
  521. package/dist/infra/SignalHandler.js.map +0 -1
  522. package/dist/orchestrators/DevWatchOrchestrator.d.ts +0 -63
  523. package/dist/orchestrators/DevWatchOrchestrator.d.ts.map +0 -1
  524. package/dist/orchestrators/DevWatchOrchestrator.js +0 -478
  525. package/dist/orchestrators/DevWatchOrchestrator.js.map +0 -1
  526. package/dist/utils/angular-build-pipeline.d.ts.map +0 -1
  527. package/dist/utils/angular-build-pipeline.js.map +0 -1
  528. package/dist/utils/angular-build.d.ts.map +0 -1
  529. package/dist/utils/angular-build.js.map +0 -1
  530. package/dist/utils/angular-compiler.d.ts.map +0 -1
  531. package/dist/utils/angular-compiler.js.map +0 -1
  532. package/dist/utils/engine-stop.d.ts.map +0 -1
  533. package/dist/utils/engine-stop.js.map +0 -1
  534. package/dist/utils/esbuild-config.d.ts.map +0 -1
  535. package/dist/utils/esbuild-config.js.map +0 -1
  536. package/dist/utils/hmr-candidates.d.ts +0 -15
  537. package/dist/utils/hmr-candidates.d.ts.map +0 -1
  538. package/dist/utils/hmr-candidates.js +0 -234
  539. package/dist/utils/hmr-candidates.js.map +0 -1
  540. package/dist/utils/lint-core.d.ts.map +0 -1
  541. package/dist/utils/lint-core.js.map +0 -1
  542. package/dist/utils/lint-utils.d.ts.map +0 -1
  543. package/dist/utils/lint-utils.js.map +0 -1
  544. package/dist/utils/lint-with-program.d.ts.map +0 -1
  545. package/dist/utils/lint-with-program.js.map +0 -1
  546. package/dist/utils/ngtsc-build-core.d.ts.map +0 -1
  547. package/dist/utils/ngtsc-build-core.js.map +0 -1
  548. package/dist/utils/rebuild-manager.d.ts.map +0 -1
  549. package/dist/utils/rebuild-manager.js.map +0 -1
  550. package/dist/utils/replace-deps.d.ts.map +0 -1
  551. package/dist/utils/replace-deps.js.map +0 -1
  552. package/dist/utils/scss-compiler.d.ts.map +0 -1
  553. package/dist/utils/scss-compiler.js.map +0 -1
  554. package/dist/utils/server-production-files.d.ts.map +0 -1
  555. package/dist/utils/server-production-files.js.map +0 -1
  556. package/dist/utils/typecheck-non-package.d.ts.map +0 -1
  557. package/dist/utils/typecheck-non-package.js.map +0 -1
  558. package/dist/utils/typecheck-serialization.d.ts.map +0 -1
  559. package/dist/utils/typecheck-serialization.js.map +0 -1
  560. package/dist/utils/vite-config.d.ts +0 -50
  561. package/dist/utils/vite-config.d.ts.map +0 -1
  562. package/dist/utils/vite-config.js +0 -242
  563. package/dist/utils/vite-config.js.map +0 -1
  564. package/dist/utils/vite-pwa-plugin.d.ts +0 -9
  565. package/dist/utils/vite-pwa-plugin.d.ts.map +0 -1
  566. package/dist/utils/vite-pwa-plugin.js +0 -139
  567. package/dist/utils/vite-pwa-plugin.js.map +0 -1
  568. package/dist/utils/vite-scope-watch-plugin.d.ts +0 -24
  569. package/dist/utils/vite-scope-watch-plugin.d.ts.map +0 -1
  570. package/dist/utils/vite-scope-watch-plugin.js +0 -51
  571. package/dist/utils/vite-scope-watch-plugin.js.map +0 -1
  572. package/dist/utils/worker-events.d.ts +0 -66
  573. package/dist/utils/worker-events.d.ts.map +0 -1
  574. package/dist/utils/worker-events.js +0 -55
  575. package/dist/utils/worker-events.js.map +0 -1
  576. package/dist/utils/worker-utils.d.ts.map +0 -1
  577. package/dist/utils/worker-utils.js.map +0 -1
  578. package/src/angular/vite-postcss-inline-plugin.ts +0 -139
  579. package/src/commands/publish.ts +0 -850
  580. package/src/orchestrators/DevWatchOrchestrator.ts +0 -594
  581. package/src/utils/hmr-candidates.ts +0 -327
  582. package/src/utils/vite-config.ts +0 -318
  583. package/src/utils/vite-pwa-plugin.ts +0 -168
  584. package/src/utils/vite-scope-watch-plugin.ts +0 -77
  585. package/src/utils/worker-events.ts +0 -128
  586. package/tests/angular/angular-compiler-hmr.spec.ts +0 -152
  587. package/tests/angular/hmr-candidates.spec.ts +0 -158
  588. package/tests/angular/linker-disk-cache.spec.ts +0 -171
  589. package/tests/angular/vite-angular-plugin-hmr-fallback.spec.ts +0 -333
  590. package/tests/angular/vite-angular-plugin-hmr.spec.ts +0 -320
  591. package/tests/angular/vite-angular-plugin-scss-hmr.spec.ts +0 -95
  592. package/tests/angular/vite-postcss-inline-plugin.spec.ts +0 -60
  593. package/tests/engines/vite-engine.spec.ts +0 -409
  594. package/tests/orchestrators/dev-watch-orchestrator.spec.ts +0 -1542
  595. package/tests/utils/vite-config.spec.ts +0 -780
  596. package/tests/utils/vite-pwa-plugin.spec.ts +0 -401
  597. package/tests/utils/vite-scope-watch-plugin.spec.ts +0 -218
  598. package/tests/utils/worker-events.spec.ts +0 -147
  599. package/tests/workers/client-worker-legacy.spec.ts +0 -659
  600. /package/dist/{utils → angular}/ngtsc-build-core.js +0 -0
  601. /package/dist/{utils → angular}/scss-compiler.d.ts +0 -0
  602. /package/dist/{utils → angular}/scss-compiler.js +0 -0
  603. /package/dist/{utils → esbuild}/esbuild-config.d.ts +0 -0
  604. /package/dist/{utils → lint}/lint-core.d.ts +0 -0
  605. /package/dist/{utils → lint}/lint-core.js +0 -0
  606. /package/dist/{utils → lint}/lint-utils.d.ts +0 -0
  607. /package/dist/{utils → lint}/lint-utils.js +0 -0
  608. /package/dist/{utils → lint}/lint-with-program.d.ts +0 -0
  609. /package/dist/{utils → lint}/lint-with-program.js +0 -0
  610. /package/dist/{infra → runtime}/ResultCollector.d.ts +0 -0
  611. /package/dist/{infra → runtime}/ResultCollector.js +0 -0
  612. /package/dist/{infra → runtime}/SignalHandler.d.ts +0 -0
  613. /package/dist/{infra → runtime}/SignalHandler.js +0 -0
  614. /package/dist/{utils → runtime}/worker-utils.d.ts +0 -0
  615. /package/dist/{utils → runtime}/worker-utils.js +0 -0
  616. /package/dist/{utils → typecheck}/typecheck-non-package.d.ts +0 -0
  617. /package/dist/{utils → typecheck}/typecheck-serialization.d.ts +0 -0
  618. /package/dist/{utils → typecheck}/typecheck-serialization.js +0 -0
  619. /package/src/{utils → angular}/scss-compiler.ts +0 -0
  620. /package/src/{utils → lint}/lint-core.ts +0 -0
  621. /package/src/{utils → lint}/lint-utils.ts +0 -0
  622. /package/src/{utils → lint}/lint-with-program.ts +0 -0
  623. /package/src/{infra → runtime}/ResultCollector.ts +0 -0
  624. /package/src/{infra → runtime}/SignalHandler.ts +0 -0
  625. /package/src/{utils → runtime}/worker-utils.ts +0 -0
  626. /package/src/{utils → typecheck}/typecheck-serialization.ts +0 -0
@@ -1,17 +1,15 @@
1
1
  import type ts from "typescript";
2
2
  import { createWorker, FsWatcher, pathx } from "@simplysm/core-node";
3
3
  import { err as errNs } from "@simplysm/core-common";
4
- import { consola } from "consola";
5
4
  import type { SdBuildPackageConfig } from "../sd-config.types";
6
5
  import type { BuildOutput } from "../engines/types";
7
- import type { SerializedDiagnostic } from "../utils/typecheck-serialization";
8
- import type { LintWithProgramResult } from "../utils/lint-with-program";
6
+ import type { SerializedDiagnostic } from "../typecheck/typecheck-serialization";
7
+ import type { LintWithProgramResult } from "../lint/lint-with-program";
9
8
  import { runTscPackageBuild } from "../utils/tsc-build";
10
- import { LintWithProgramRunner } from "../utils/lint-with-program";
11
- import { collectDeps } from "../utils/package-utils";
12
- import { registerCleanupHandlers, createOnceGuard, setupWorkerConsola } from "../utils/worker-utils";
13
-
14
- setupWorkerConsola();
9
+ import { LintWithProgramRunner } from "../lint/lint-with-program";
10
+ import { setupWorkerLifecycle } from "./shared-worker-lifecycle";
11
+ import { buildWatchPaths } from "./build-watch-paths";
12
+ import { hasFileAddOrRemove, shouldSkipRebuild } from "./build-change-filter";
15
13
 
16
14
  //#region Types
17
15
 
@@ -45,8 +43,6 @@ export interface LibraryBuildWorkerEvents extends Record<string, unknown> {
45
43
 
46
44
  //#region Resource Management
47
45
 
48
- const logger = consola.withTag("sd:cli:library-build:worker");
49
-
50
46
  let fsWatcher: FsWatcher | undefined;
51
47
 
52
48
  async function cleanup(): Promise<void> {
@@ -57,7 +53,7 @@ async function cleanup(): Promise<void> {
57
53
  await watcherToClose?.close();
58
54
  }
59
55
 
60
- registerCleanupHandlers(cleanup, logger);
56
+ const { logger, guardStartWatch } = setupWorkerLifecycle("library-build", cleanup);
61
57
 
62
58
  //#endregion
63
59
 
@@ -101,8 +97,6 @@ async function build(info: LibraryBuildInfo): Promise<LibraryBuildResult> {
101
97
 
102
98
  //#region startWatch (watch mode)
103
99
 
104
- const guardStartWatch = createOnceGuard("startWatch");
105
-
106
100
  // watch 모드용 가변 상태
107
101
  let watchInfo: LibraryBuildInfo | undefined;
108
102
  let watchLintRunner: LintWithProgramRunner | undefined;
@@ -169,34 +163,21 @@ async function startWatch(info: LibraryBuildInfo): Promise<void> {
169
163
  sender.send("build", initialResult);
170
164
 
171
165
  // workspace 의존성 경로 + replaceDeps 수집
172
- const { workspaceDeps, replaceDeps } = collectDeps(info.pkgDir, info.cwd, info.replaceDeps);
166
+ const { watchPaths } = buildWatchPaths({
167
+ pkgDir: info.pkgDir,
168
+ cwd: info.cwd,
169
+ srcGlobs: ["*.ts"],
170
+ replaceDeps: info.replaceDeps,
171
+ });
173
172
 
174
173
  // FsWatcher 시작 — 자체 src/ + workspace 의존성 src/ + replaceDeps dist/
175
174
  logger.debug(`[${info.name}] FsWatcher 시작`);
176
- const watchPaths = [
177
- pathx.posixResolve(info.pkgDir, "src", "**", "*.ts"),
178
- ...workspaceDeps.map((d) => pathx.posixResolve(info.cwd, "packages", d, "src", "**", "*.ts")),
179
- ...replaceDeps.flatMap((pkg) => [
180
- pathx.posixResolve(info.cwd, "node_modules", ...pkg.split("/"), "dist", "**", "*.{js,mjs,cjs}"),
181
- pathx.posixResolve(info.pkgDir, "node_modules", ...pkg.split("/"), "dist", "**", "*.{js,mjs,cjs}"),
182
- ]),
183
- ];
184
175
  fsWatcher = await FsWatcher.watch(watchPaths);
185
176
 
186
177
  fsWatcher.onChange({ delay: 300 }, async (changes) => {
187
178
  try {
188
- const hasFileAddOrRemove = changes.some(
189
- (c) => c.event === "add" || c.event === "unlink",
190
- );
191
-
192
- if (!hasFileAddOrRemove && lastSourceFilePaths != null) {
193
- const hasRelevantChange = changes.some((c) =>
194
- lastSourceFilePaths!.has(c.path),
195
- );
196
- if (!hasRelevantChange) {
197
- logger.debug("변경된 파일이 빌드에 포함되지 않아 리빌드 건너뜀");
198
- return;
199
- }
179
+ if (shouldSkipRebuild(changes.map((c) => c.path), hasFileAddOrRemove(changes), lastSourceFilePaths, logger)) {
180
+ return;
200
181
  }
201
182
 
202
183
  sender.send("buildStart", {});
@@ -1,5 +1,5 @@
1
1
  import { createWorker } from "@simplysm/core-node";
2
- import { executeLint, type LintOptions, type LintResult } from "../utils/lint-core";
2
+ import { executeLint, type LintOptions, type LintResult } from "../lint/lint-core";
3
3
 
4
4
  //#region Worker
5
5
 
@@ -1,8 +1,9 @@
1
1
  import path from "path";
2
2
  import { createWorker, FsWatcher, pathx } from "@simplysm/core-node";
3
3
  import { err as errNs } from "@simplysm/core-common";
4
- import { consola } from "consola";
5
- import { registerCleanupHandlers, createOnceGuard, setupWorkerConsola } from "../utils/worker-utils";
4
+ import { setupWorkerLifecycle } from "./shared-worker-lifecycle";
5
+ import { buildWatchPaths } from "./build-watch-paths";
6
+ import { hasFileAddOrRemove, shouldSkipRebuild } from "./build-change-filter";
6
7
  import {
7
8
  buildCompilerOptions,
8
9
  buildScssLoadPaths,
@@ -12,20 +13,17 @@ import {
12
13
  type NgtscBuildResult,
13
14
  type NgtscCombinedBuildEvent,
14
15
  type SideEffectScssEntry,
15
- } from "../utils/ngtsc-build-core";
16
- import { serializeDiagnostic } from "../utils/typecheck-serialization";
17
- import { LintWithProgramRunner, type LintWithProgramResult } from "../utils/lint-with-program";
16
+ } from "../angular/ngtsc-build-core";
17
+ import { serializeDiagnostic } from "../typecheck/typecheck-serialization";
18
+ import { LintWithProgramRunner, type LintWithProgramResult } from "../lint/lint-with-program";
18
19
  import {
19
20
  parseTsconfig,
20
21
  getPackageSourceFiles,
21
22
  getPackageFiles,
22
23
  getCompilerOptionsForEnv,
23
24
  } from "../utils/tsconfig";
24
- import { AngularBuildPipeline } from "../utils/angular-build-pipeline";
25
- import { AngularSourceFileCache } from "../utils/angular-compiler";
26
- import { collectDeps } from "../utils/package-utils";
27
-
28
- setupWorkerConsola();
25
+ import { AngularBuildPipeline } from "../angular/angular-build-pipeline";
26
+ import { AngularSourceFileCache } from "../angular/angular-compiler";
29
27
 
30
28
  //#region 타입 (워커 인터페이스용 re-export)
31
29
 
@@ -41,8 +39,6 @@ export interface NgtscBuildWorkerEvents extends Record<string, unknown> {
41
39
 
42
40
  //#region Resource Management
43
41
 
44
- const logger = consola.withTag("sd:cli:ngtsc-build:worker");
45
-
46
42
  let fsWatcher: FsWatcher | undefined;
47
43
 
48
44
  async function cleanup(): Promise<void> {
@@ -56,7 +52,7 @@ async function cleanup(): Promise<void> {
56
52
  }
57
53
  }
58
54
 
59
- registerCleanupHandlers(cleanup, logger);
55
+ const { logger, guardStartWatch } = setupWorkerLifecycle("ngtsc-build", cleanup);
60
56
 
61
57
  //#endregion
62
58
 
@@ -141,8 +137,6 @@ async function build(info: NgtscBuildInfo): Promise<NgtscBuildResult> {
141
137
 
142
138
  //#region startWatch (watch mode)
143
139
 
144
- const guardStartWatch = createOnceGuard("startWatch");
145
-
146
140
  let watchInfo: NgtscBuildInfo | undefined;
147
141
  let _watchPipeline: AngularBuildPipeline | undefined;
148
142
  let watchLintRunner: LintWithProgramRunner | undefined;
@@ -266,36 +260,21 @@ async function startWatch(info: NgtscBuildInfo): Promise<void> {
266
260
  sender.send("build", initialResult);
267
261
 
268
262
  // workspace 의존성 경로 + replaceDeps 수집
269
- const { workspaceDeps, replaceDeps } = collectDeps(
270
- watchInfo.pkgDir,
271
- watchInfo.cwd,
272
- watchInfo.replaceDeps,
273
- );
263
+ const { watchPaths } = buildWatchPaths({
264
+ pkgDir: watchInfo.pkgDir,
265
+ cwd: watchInfo.cwd,
266
+ srcGlobs: ["*.{ts,scss,css}"],
267
+ extraDirs: [{ dir: "scss", globs: ["*.{scss,css}"] }],
268
+ replaceDeps: watchInfo.replaceDeps,
269
+ });
274
270
 
275
271
  // FsWatcher 시작
276
272
  logger.debug(`[${watchInfo.name}] FsWatcher 시작`);
277
- const watchPaths = [
278
- pathx.posixResolve(watchInfo.pkgDir, "src", "**", "*.{ts,scss,css}"),
279
- pathx.posixResolve(watchInfo.pkgDir, "scss", "**", "*.{scss,css}"),
280
- ...workspaceDeps.flatMap((d) => {
281
- const depDir = pathx.posixResolve(watchInfo!.cwd, "packages", d);
282
- return [
283
- pathx.posixResolve(depDir, "src", "**", "*.{ts,scss,css}"),
284
- pathx.posixResolve(depDir, "scss", "**", "*.{scss,css}"),
285
- ];
286
- }),
287
- ...replaceDeps.flatMap((pkg) => [
288
- pathx.posixResolve(watchInfo!.cwd, "node_modules", ...pkg.split("/"), "dist", "**", "*.{js,mjs,cjs}"),
289
- pathx.posixResolve(watchInfo!.pkgDir, "node_modules", ...pkg.split("/"), "dist", "**", "*.{js,mjs,cjs}"),
290
- ]),
291
- ];
292
273
  fsWatcher = await FsWatcher.watch(watchPaths);
293
274
 
294
275
  fsWatcher.onChange({ delay: 300 }, async (changedFiles) => {
295
276
  try {
296
- const hasFileAddOrRemove = changedFiles.some(
297
- (c) => c.event === "add" || c.event === "unlink",
298
- );
277
+ const addOrRemove = hasFileAddOrRemove(changedFiles);
299
278
 
300
279
  // 변경된 파일 수집 (전체 변경 + SCSS 의존성 역방향 탐색)
301
280
  const modifiedFiles = new Set<string>();
@@ -311,14 +290,8 @@ async function startWatch(info: NgtscBuildInfo): Promise<void> {
311
290
  }
312
291
 
313
292
  // 의존성 필터: 관련 변경이 없으면 리빌드 건너뜀
314
- if (!hasFileAddOrRemove && lastSourceFilePaths != null) {
315
- const hasRelevantChange = [...modifiedFiles].some((p) =>
316
- lastSourceFilePaths!.has(p),
317
- );
318
- if (!hasRelevantChange) {
319
- logger.debug("변경된 파일이 빌드에 포함되지 않아 리빌드 건너뜀");
320
- return;
321
- }
293
+ if (shouldSkipRebuild(modifiedFiles, addOrRemove, lastSourceFilePaths, logger)) {
294
+ return;
322
295
  }
323
296
 
324
297
  sender.send("buildStart", {});
@@ -4,10 +4,9 @@ import fs from "fs";
4
4
  import esbuild from "esbuild";
5
5
  import { createWorker, FsWatcher, pathx } from "@simplysm/core-node";
6
6
  import { err as errNs } from "@simplysm/core-common";
7
- import { consola } from "consola";
8
7
  import type { BuildOutput } from "../engines/types";
9
- import type { SerializedDiagnostic } from "../utils/typecheck-serialization";
10
- import type { LintWithProgramResult } from "../utils/lint-with-program";
8
+ import type { SerializedDiagnostic } from "../typecheck/typecheck-serialization";
9
+ import type { LintWithProgramResult } from "../lint/lint-with-program";
11
10
  import {
12
11
  parseTsconfig,
13
12
  getPackageSourceFiles,
@@ -15,13 +14,15 @@ import {
15
14
  import {
16
15
  createServerEsbuildOptions,
17
16
  writeChangedOutputFiles,
18
- } from "../utils/esbuild-config";
19
- import { collectAllExternals, generateProductionFiles } from "../utils/server-production-files";
17
+ } from "../esbuild/esbuild-config";
18
+ import { collectAllExternals, generateProductionFiles } from "../deps/server-externals/server-production-files";
20
19
  import { runTscPackageBuild } from "../utils/tsc-build";
21
- import { LintWithProgramRunner } from "../utils/lint-with-program";
22
- import { registerCleanupHandlers, createOnceGuard, setupWorkerConsola } from "../utils/worker-utils";
23
- import { collectDeps } from "../utils/package-utils";
20
+ import { LintWithProgramRunner } from "../lint/lint-with-program";
21
+ import { setupWorkerLifecycle } from "./shared-worker-lifecycle";
22
+ import { buildWatchPaths } from "./build-watch-paths";
24
23
  import { copyPublicFiles, watchPublicFiles } from "../utils/copy-public";
24
+ import * as esbuildCtx from "./server-esbuild-context";
25
+ import { startServerWatchLoop } from "./server-watch-manager";
25
26
 
26
27
  //#region Types
27
28
 
@@ -97,16 +98,6 @@ export interface ServerBuildWorkerEvents extends Record<string, unknown> {
97
98
 
98
99
  //#region Resource Management
99
100
 
100
- setupWorkerConsola();
101
-
102
- const logger = consola.withTag("sd:cli:server-build:worker");
103
-
104
- /** esbuild 빌드 컨텍스트 (정리 대상) */
105
- let esbuildContext: esbuild.BuildContext | undefined;
106
-
107
- /** 마지막 빌드 metafile (리빌드 시 변경 파일 필터링용) */
108
- let lastMetafile: esbuild.Metafile | undefined;
109
-
110
101
  /** public 파일 감시자 (정리 대상) */
111
102
  let publicWatcher: FsWatcher | undefined;
112
103
 
@@ -114,9 +105,7 @@ let publicWatcher: FsWatcher | undefined;
114
105
  let srcWatcher: FsWatcher | undefined;
115
106
 
116
107
  async function cleanup(): Promise<void> {
117
- const contextToDispose = esbuildContext;
118
- esbuildContext = undefined;
119
- lastMetafile = undefined;
108
+ await esbuildCtx.dispose();
120
109
  lastBuilderProgram = undefined;
121
110
 
122
111
  const watcherToClose = publicWatcher;
@@ -125,9 +114,6 @@ async function cleanup(): Promise<void> {
125
114
  const srcWatcherToClose = srcWatcher;
126
115
  srcWatcher = undefined;
127
116
 
128
- if (contextToDispose != null) {
129
- await contextToDispose.dispose();
130
- }
131
117
  if (watcherToClose != null) {
132
118
  await watcherToClose.close();
133
119
  }
@@ -136,7 +122,7 @@ async function cleanup(): Promise<void> {
136
122
  }
137
123
  }
138
124
 
139
- registerCleanupHandlers(cleanup, logger);
125
+ const { logger, guardStartWatch } = setupWorkerLifecycle("server-build", cleanup);
140
126
 
141
127
  //#endregion
142
128
 
@@ -246,8 +232,6 @@ async function build(info: ServerBuildInfo): Promise<ServerBuildResult> {
246
232
  }
247
233
  }
248
234
 
249
- const guardStartWatch = createOnceGuard("startWatch");
250
-
251
235
  // watch 모드용 가변 상태
252
236
  let watchInfo: ServerWatchInfo | undefined;
253
237
  let watchLintRunner: LintWithProgramRunner | undefined;
@@ -263,26 +247,7 @@ async function rebuildAll(): Promise<ServerCombinedBuildEvent> {
263
247
  const parsedConfig = parseTsconfig(info.pkgDir);
264
248
 
265
249
  // esbuild 리빌드 (비동기)
266
- let esbuildPromise: Promise<{ success: boolean; errors?: string[]; warnings?: string[] }> | null = null;
267
- if (info.output.js && esbuildContext != null) {
268
- esbuildPromise = esbuildContext.rebuild().then(async (result) => {
269
- // metafile 저장
270
- if (result.metafile != null) {
271
- lastMetafile = result.metafile;
272
- }
273
-
274
- if (result.outputFiles) {
275
- await writeChangedOutputFiles(result.outputFiles);
276
- }
277
- const errors = result.errors.map((e) => e.text);
278
- const warnings = result.warnings.map((w) => w.text);
279
- return {
280
- success: result.errors.length === 0,
281
- errors: errors.length > 0 ? errors : undefined,
282
- warnings: warnings.length > 0 ? warnings : undefined,
283
- };
284
- });
285
- }
250
+ const esbuildPromise = info.output.js ? esbuildCtx.rebuild() : null;
286
251
 
287
252
  // tsc 리빌드 (동기, 증분)
288
253
  const tscResult = runTscPackageBuild({
@@ -313,8 +278,8 @@ async function rebuildAll(): Promise<ServerCombinedBuildEvent> {
313
278
  logger.debug(`[${info.name}] lint 완료`);
314
279
  }
315
280
 
316
- const jsResult = esbuildPromise
317
- ? await esbuildPromise
281
+ const jsResult = esbuildPromise != null
282
+ ? (await esbuildPromise) ?? { success: true, errors: undefined, warnings: undefined }
318
283
  : { success: true, errors: undefined, warnings: undefined };
319
284
 
320
285
  const allErrors = [...(jsResult.errors ?? []), ...(tscResult.errors ?? [])];
@@ -330,29 +295,6 @@ async function rebuildAll(): Promise<ServerCombinedBuildEvent> {
330
295
  };
331
296
  }
332
297
 
333
- /**
334
- * watch 모드용 esbuild 컨텍스트를 생성한다
335
- */
336
- async function createEsbuildWatchContext(
337
- info: ServerWatchInfo,
338
- entryPoints: string[],
339
- external: string[],
340
- ): Promise<esbuild.BuildContext> {
341
- const baseOptions = createServerEsbuildOptions({
342
- pkgDir: info.pkgDir,
343
- entryPoints,
344
- env: info.env,
345
- external,
346
- dev: true,
347
- });
348
-
349
- return esbuild.context({
350
- ...baseOptions,
351
- metafile: true,
352
- write: false,
353
- });
354
- }
355
-
356
298
  /**
357
299
  * watch 모드 시작
358
300
  */
@@ -365,12 +307,17 @@ async function startWatch(info: ServerWatchInfo): Promise<void> {
365
307
  const parsedConfig = parseTsconfig(info.pkgDir);
366
308
  const entryPoints = getPackageSourceFiles(info.pkgDir, parsedConfig);
367
309
 
368
- // 외부 모듈 수집 (watch 모드용 캐시)
369
- let cachedExternal = collectAllExternals(info.pkgDir, info.externals);
310
+ // 외부 모듈 수집 (watch 모드용 — watch manager가 자체 캐시를 유지)
311
+ const cachedExternal = collectAllExternals(info.pkgDir, info.externals);
370
312
 
371
313
  // esbuild 컨텍스트 생성 (JS 출력 필요 시)
372
314
  if (info.output.js) {
373
- esbuildContext = await createEsbuildWatchContext(info, entryPoints, cachedExternal);
315
+ await esbuildCtx.createContext({
316
+ pkgDir: info.pkgDir,
317
+ entryPoints,
318
+ env: info.env,
319
+ external: cachedExternal,
320
+ });
374
321
  }
375
322
 
376
323
  // 초기 빌드: esbuild + tsc 병렬
@@ -386,100 +333,23 @@ async function startWatch(info: ServerWatchInfo): Promise<void> {
386
333
  // public/ + public-dev/ 감시
387
334
  publicWatcher = await watchPublicFiles(info.pkgDir, true);
388
335
 
389
- // 의존성 기반 감시 경로 수집
390
- const { workspaceDeps, replaceDeps } = collectDeps(info.pkgDir, info.cwd, info.replaceDeps);
391
-
392
- const watchPaths: string[] = [];
393
-
394
- // 서버 패키지 자체 + workspace 의존성 패키지 소스
395
- const watchDirs = [
396
- info.pkgDir,
397
- ...workspaceDeps.map((d) => pathx.posixResolve(info.cwd, "packages", d)),
398
- ];
399
- for (const dir of watchDirs) {
400
- watchPaths.push(pathx.posixResolve(dir, "src", "**", "*"));
401
- }
402
-
403
- // replaceDeps 의존성 패키지 dist
404
- for (const pkg of replaceDeps) {
405
- watchPaths.push(pathx.posixResolve(info.cwd, "node_modules", ...pkg.split("/"), "dist", "**", "*.{js,mjs,cjs}"));
406
- watchPaths.push(
407
- pathx.posixResolve(info.pkgDir, "node_modules", ...pkg.split("/"), "dist", "**", "*.{js,mjs,cjs}"),
408
- );
409
- }
410
-
411
- // FsWatcher 시작
412
- srcWatcher = await FsWatcher.watch(watchPaths);
413
-
414
- srcWatcher.onChange({ delay: 300 }, async (changes) => {
415
- try {
416
- const hasFileAddOrRemove = changes.some((c) => c.event === "add" || c.event === "unlink");
417
-
418
- if (hasFileAddOrRemove) {
419
- sender.send("buildStart", {});
420
-
421
- // 파일 추가/삭제 시 컨텍스트 재생성
422
- const newParsedConfig = parseTsconfig(info.pkgDir);
423
- const newEntryPoints = getPackageSourceFiles(info.pkgDir, newParsedConfig);
424
-
425
- // package.json이 변경된 경우에만 외부 모듈 재수집
426
- const hasPackageJsonChange = changes.some((c) =>
427
- c.path.endsWith("package.json"),
428
- );
429
- if (hasPackageJsonChange) {
430
- cachedExternal = collectAllExternals(info.pkgDir, info.externals);
431
- }
432
- const newExternal = cachedExternal;
433
-
434
- const oldContext = esbuildContext;
435
- esbuildContext = undefined; // 선제 초기화 — 생성 실패 시 disposed 참조 방지 (LOGIC-001)
436
- try {
437
- if (info.output.js) {
438
- esbuildContext = await createEsbuildWatchContext(info, newEntryPoints, newExternal);
439
- }
440
- } finally {
441
- if (oldContext != null) {
442
- await oldContext.dispose();
443
- }
444
- }
336
+ // 의존성 기반 감시 경로 수집 + FsWatcher 감시 루프 시작
337
+ const { watchPaths } = buildWatchPaths({
338
+ pkgDir: info.pkgDir,
339
+ cwd: info.cwd,
340
+ srcGlobs: ["*"],
341
+ replaceDeps: info.replaceDeps,
342
+ });
445
343
 
446
- const result = await rebuildAll();
447
- sender.send("build", result);
448
- return;
449
- }
450
-
451
- // 파일 변경만 있는 경우: metafile로 필터링
452
- if (esbuildContext == null) {
453
- sender.send("buildStart", {});
454
- const result = await rebuildAll();
455
- sender.send("build", result);
456
- return;
457
- }
458
-
459
- if (lastMetafile == null) {
460
- sender.send("buildStart", {});
461
- const result = await rebuildAll();
462
- sender.send("build", result);
463
- return;
464
- }
465
-
466
- // metafile 입력 기반 필터링
467
- const metafileAbsPaths = new Set(
468
- Object.keys(lastMetafile.inputs).map((key) => pathx.posixResolve(info.cwd, key)),
469
- );
470
-
471
- const hasRelevantChange = changes.some((c) => metafileAbsPaths.has(c.path));
472
-
473
- if (hasRelevantChange) {
474
- sender.send("buildStart", {});
475
- const result = await rebuildAll();
476
- sender.send("build", result);
477
- } else {
478
- logger.debug("변경된 파일이 빌드에 포함되지 않아 리빌드 건너뜀");
479
- }
480
- } catch (err) {
481
- sender.send("error", { message: errNs.message(err) });
482
- }
344
+ srcWatcher = await startServerWatchLoop({
345
+ info,
346
+ watchPaths,
347
+ logger,
348
+ initialExternals: cachedExternal,
349
+ onBuildStart: () => sender.send("buildStart", {}),
350
+ onBuild: (result) => sender.send("build", result),
351
+ onError: (message) => sender.send("error", { message }),
352
+ rebuild: () => rebuildAll(),
483
353
  });
484
354
  } catch (err) {
485
355
  sender.send("error", { message: errNs.message(err) });
@@ -0,0 +1,122 @@
1
+ import esbuild from "esbuild";
2
+ import {
3
+ createServerEsbuildOptions,
4
+ writeChangedOutputFiles,
5
+ } from "../esbuild/esbuild-config";
6
+
7
+ /**
8
+ * esbuild watch context 생성 옵션
9
+ */
10
+ export interface EsbuildContextOptions {
11
+ pkgDir: string;
12
+ entryPoints: string[];
13
+ env?: Record<string, string>;
14
+ external: string[];
15
+ }
16
+
17
+ /** esbuild watch context (모듈 스코프 상태) */
18
+ let context: esbuild.BuildContext | undefined;
19
+
20
+ /** 마지막 빌드의 metafile (변경 필터링용) */
21
+ let lastMetafile: esbuild.Metafile | undefined;
22
+
23
+ /**
24
+ * esbuild watch context를 생성한다.
25
+ * dev 모드 전용 (metafile:true, write:false).
26
+ */
27
+ export async function createContext(options: EsbuildContextOptions): Promise<void> {
28
+ const baseOptions = createServerEsbuildOptions({
29
+ pkgDir: options.pkgDir,
30
+ entryPoints: options.entryPoints,
31
+ env: options.env,
32
+ external: options.external,
33
+ dev: true,
34
+ });
35
+
36
+ context = await esbuild.context({
37
+ ...baseOptions,
38
+ metafile: true,
39
+ write: false,
40
+ });
41
+ }
42
+
43
+ /**
44
+ * esbuild rebuild를 실행하고 metafile을 갱신한다.
45
+ * context가 없으면 null을 반환한다 (tsc-only 경로).
46
+ */
47
+ export async function rebuild(): Promise<{
48
+ success: boolean;
49
+ errors?: string[];
50
+ warnings?: string[];
51
+ } | null> {
52
+ if (context == null) return null;
53
+
54
+ const result = await context.rebuild();
55
+
56
+ if (result.metafile != null) {
57
+ lastMetafile = result.metafile;
58
+ }
59
+
60
+ if (result.outputFiles) {
61
+ await writeChangedOutputFiles(result.outputFiles);
62
+ }
63
+
64
+ const errors = result.errors.map((e) => e.text);
65
+ const warnings = result.warnings.map((w) => w.text);
66
+
67
+ return {
68
+ success: result.errors.length === 0,
69
+ errors: errors.length > 0 ? errors : undefined,
70
+ warnings: warnings.length > 0 ? warnings : undefined,
71
+ };
72
+ }
73
+
74
+ /**
75
+ * esbuild context를 재생성한다 (LOGIC-001).
76
+ *
77
+ * 선제 초기화 + try/finally 패턴으로 리소스 해제를 보장한다:
78
+ * 1. old context를 로컬 변수에 보관
79
+ * 2. 모듈 참조를 undefined로 선제 초기화 — 생성 실패 시 disposed 참조 방지
80
+ * 3. 새 context 생성 시도
81
+ * 4. finally에서 old context dispose — 생성 성공/실패와 무관하게 실행
82
+ */
83
+ export async function recreateContext(options: EsbuildContextOptions): Promise<void> {
84
+ const oldContext = context;
85
+ context = undefined;
86
+ lastMetafile = undefined;
87
+
88
+ try {
89
+ await createContext(options);
90
+ } finally {
91
+ if (oldContext != null) {
92
+ await oldContext.dispose();
93
+ }
94
+ }
95
+ }
96
+
97
+ /**
98
+ * esbuild context를 정리하고 상태를 초기화한다.
99
+ */
100
+ export async function dispose(): Promise<void> {
101
+ const contextToDispose = context;
102
+ context = undefined;
103
+ lastMetafile = undefined;
104
+
105
+ if (contextToDispose != null) {
106
+ await contextToDispose.dispose();
107
+ }
108
+ }
109
+
110
+ /**
111
+ * 마지막 빌드의 metafile을 반환한다 (변경 필터링에 사용).
112
+ */
113
+ export function getMetafile(): esbuild.Metafile | undefined {
114
+ return lastMetafile;
115
+ }
116
+
117
+ /**
118
+ * esbuild context 존재 여부를 반환한다.
119
+ */
120
+ export function hasContext(): boolean {
121
+ return context != null;
122
+ }
@@ -6,7 +6,7 @@ import { consola } from "consola";
6
6
  import proxy from "@fastify/http-proxy";
7
7
  import net from "net";
8
8
  import { pathToFileURL } from "url";
9
- import { registerCleanupHandlers, setupWorkerConsola } from "../utils/worker-utils";
9
+ import { registerCleanupHandlers, setupWorkerConsola } from "../runtime/worker-utils";
10
10
 
11
11
  //#region Types
12
12
 
@@ -136,6 +136,9 @@ async function start(info: ServerRuntimeStartInfo): Promise<void> {
136
136
  }
137
137
  }
138
138
 
139
+ // main.js import 전에 sourcemap 지원 활성화 (스택 트레이스에 원본 위치 표시)
140
+ process.setSourceMapsEnabled(true);
141
+
139
142
  // main.js import (서버 인스턴스를 export해야 함)
140
143
  logger.debug("main.js 임포트 중...");
141
144
  let stepStart = performance.now();