intershell 0.3.0

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 (357) hide show
  1. package/README.md +301 -0
  2. package/dist/commands/ci/act.d.ts +13 -0
  3. package/dist/commands/ci/act.d.ts.map +1 -0
  4. package/dist/commands/ci/act.js +89 -0
  5. package/dist/commands/ci/act.js.map +1 -0
  6. package/dist/commands/ci/attach-affected.d.ts +12 -0
  7. package/dist/commands/ci/attach-affected.d.ts.map +1 -0
  8. package/dist/commands/ci/attach-affected.js +83 -0
  9. package/dist/commands/ci/attach-affected.js.map +1 -0
  10. package/dist/commands/ci/attach-service-ports.d.ts +10 -0
  11. package/dist/commands/ci/attach-service-ports.d.ts.map +1 -0
  12. package/dist/commands/ci/attach-service-ports.js +25 -0
  13. package/dist/commands/ci/attach-service-ports.js.map +1 -0
  14. package/dist/commands/commit-check.d.ts +13 -0
  15. package/dist/commands/commit-check.d.ts.map +1 -0
  16. package/dist/commands/commit-check.js +110 -0
  17. package/dist/commands/commit-check.js.map +1 -0
  18. package/dist/commands/commit.d.ts +16 -0
  19. package/dist/commands/commit.d.ts.map +1 -0
  20. package/dist/commands/commit.js +91 -0
  21. package/dist/commands/commit.js.map +1 -0
  22. package/dist/commands/dev/check.d.ts +13 -0
  23. package/dist/commands/dev/check.d.ts.map +1 -0
  24. package/dist/commands/dev/check.js +91 -0
  25. package/dist/commands/dev/check.js.map +1 -0
  26. package/dist/commands/dev/cleanup.d.ts +10 -0
  27. package/dist/commands/dev/cleanup.d.ts.map +1 -0
  28. package/dist/commands/dev/cleanup.js +28 -0
  29. package/dist/commands/dev/cleanup.js.map +1 -0
  30. package/dist/commands/dev/rm.d.ts +12 -0
  31. package/dist/commands/dev/rm.d.ts.map +1 -0
  32. package/dist/commands/dev/rm.js +49 -0
  33. package/dist/commands/dev/rm.js.map +1 -0
  34. package/dist/commands/dev/setup.d.ts +10 -0
  35. package/dist/commands/dev/setup.d.ts.map +1 -0
  36. package/dist/commands/dev/setup.js +40 -0
  37. package/dist/commands/dev/setup.js.map +1 -0
  38. package/dist/commands/local/cleanup.d.ts +12 -0
  39. package/dist/commands/local/cleanup.d.ts.map +1 -0
  40. package/dist/commands/local/cleanup.js +62 -0
  41. package/dist/commands/local/cleanup.js.map +1 -0
  42. package/dist/commands/local/setup.d.ts +11 -0
  43. package/dist/commands/local/setup.d.ts.map +1 -0
  44. package/dist/commands/local/setup.js +55 -0
  45. package/dist/commands/local/setup.js.map +1 -0
  46. package/dist/commands/local/vscode.d.ts +17 -0
  47. package/dist/commands/local/vscode.d.ts.map +1 -0
  48. package/dist/commands/local/vscode.js +94 -0
  49. package/dist/commands/local/vscode.js.map +1 -0
  50. package/dist/commands/update-package-json.d.ts +12 -0
  51. package/dist/commands/update-package-json.d.ts.map +1 -0
  52. package/dist/commands/update-package-json.js +82 -0
  53. package/dist/commands/update-package-json.js.map +1 -0
  54. package/dist/commands/version/apply.d.ts +16 -0
  55. package/dist/commands/version/apply.d.ts.map +1 -0
  56. package/dist/commands/version/apply.js +120 -0
  57. package/dist/commands/version/apply.js.map +1 -0
  58. package/dist/commands/version/ci.d.ts +12 -0
  59. package/dist/commands/version/ci.d.ts.map +1 -0
  60. package/dist/commands/version/ci.js +67 -0
  61. package/dist/commands/version/ci.js.map +1 -0
  62. package/dist/commands/version/prepare.d.ts +19 -0
  63. package/dist/commands/version/prepare.d.ts.map +1 -0
  64. package/dist/commands/version/prepare.js +153 -0
  65. package/dist/commands/version/prepare.js.map +1 -0
  66. package/dist/core/colorify.d.ts +21 -0
  67. package/dist/core/colorify.d.ts.map +1 -0
  68. package/dist/core/colorify.js +56 -0
  69. package/dist/core/colorify.js.map +1 -0
  70. package/dist/core/index.d.ts +4 -0
  71. package/dist/core/index.d.ts.map +1 -0
  72. package/dist/core/index.js +3 -0
  73. package/dist/core/index.js.map +1 -0
  74. package/dist/core/types.d.ts +181 -0
  75. package/dist/core/types.d.ts.map +1 -0
  76. package/dist/core/types.js +5 -0
  77. package/dist/core/types.js.map +1 -0
  78. package/dist/core/wrapshell.d.ts +19 -0
  79. package/dist/core/wrapshell.d.ts.map +1 -0
  80. package/dist/core/wrapshell.js +323 -0
  81. package/dist/core/wrapshell.js.map +1 -0
  82. package/dist/entities/affected/affected.d.ts +4 -0
  83. package/dist/entities/affected/affected.d.ts.map +1 -0
  84. package/dist/entities/affected/affected.js +20 -0
  85. package/dist/entities/affected/affected.js.map +1 -0
  86. package/dist/entities/affected/affected.test.d.ts +2 -0
  87. package/dist/entities/affected/affected.test.d.ts.map +1 -0
  88. package/dist/entities/affected/affected.test.js +305 -0
  89. package/dist/entities/affected/affected.test.js.map +1 -0
  90. package/dist/entities/affected/index.d.ts +2 -0
  91. package/dist/entities/affected/index.d.ts.map +1 -0
  92. package/dist/entities/affected/index.js +2 -0
  93. package/dist/entities/affected/index.js.map +1 -0
  94. package/dist/entities/branch/branch.d.ts +8 -0
  95. package/dist/entities/branch/branch.d.ts.map +1 -0
  96. package/dist/entities/branch/branch.js +74 -0
  97. package/dist/entities/branch/branch.js.map +1 -0
  98. package/dist/entities/branch/branch.test.d.ts +2 -0
  99. package/dist/entities/branch/branch.test.d.ts.map +1 -0
  100. package/dist/entities/branch/branch.test.js +316 -0
  101. package/dist/entities/branch/branch.test.js.map +1 -0
  102. package/dist/entities/branch/branch.types.d.ts +6 -0
  103. package/dist/entities/branch/branch.types.d.ts.map +1 -0
  104. package/dist/entities/branch/branch.types.js +2 -0
  105. package/dist/entities/branch/branch.types.js.map +1 -0
  106. package/dist/entities/branch/index.d.ts +3 -0
  107. package/dist/entities/branch/index.d.ts.map +1 -0
  108. package/dist/entities/branch/index.js +3 -0
  109. package/dist/entities/branch/index.js.map +1 -0
  110. package/dist/entities/commit/commit.d.ts +15 -0
  111. package/dist/entities/commit/commit.d.ts.map +1 -0
  112. package/dist/entities/commit/commit.js +196 -0
  113. package/dist/entities/commit/commit.js.map +1 -0
  114. package/dist/entities/commit/commit.test.d.ts +26 -0
  115. package/dist/entities/commit/commit.test.d.ts.map +1 -0
  116. package/dist/entities/commit/commit.test.js +550 -0
  117. package/dist/entities/commit/commit.test.js.map +1 -0
  118. package/dist/entities/commit/commit.types.d.ts +49 -0
  119. package/dist/entities/commit/commit.types.d.ts.map +1 -0
  120. package/dist/entities/commit/commit.types.js +31 -0
  121. package/dist/entities/commit/commit.types.js.map +1 -0
  122. package/dist/entities/commit/index.d.ts +3 -0
  123. package/dist/entities/commit/index.d.ts.map +1 -0
  124. package/dist/entities/commit/index.js +3 -0
  125. package/dist/entities/commit/index.js.map +1 -0
  126. package/dist/entities/commit/pr.d.ts +11 -0
  127. package/dist/entities/commit/pr.d.ts.map +1 -0
  128. package/dist/entities/commit/pr.js +201 -0
  129. package/dist/entities/commit/pr.js.map +1 -0
  130. package/dist/entities/commit/pr.test.d.ts +2 -0
  131. package/dist/entities/commit/pr.test.d.ts.map +1 -0
  132. package/dist/entities/commit/pr.test.js +782 -0
  133. package/dist/entities/commit/pr.test.js.map +1 -0
  134. package/dist/entities/compose/compose.d.ts +18 -0
  135. package/dist/entities/compose/compose.d.ts.map +1 -0
  136. package/dist/entities/compose/compose.js +197 -0
  137. package/dist/entities/compose/compose.js.map +1 -0
  138. package/dist/entities/compose/compose.test.d.ts +2 -0
  139. package/dist/entities/compose/compose.test.d.ts.map +1 -0
  140. package/dist/entities/compose/compose.test.js +406 -0
  141. package/dist/entities/compose/compose.test.js.map +1 -0
  142. package/dist/entities/compose/compose.types.d.ts +77 -0
  143. package/dist/entities/compose/compose.types.d.ts.map +1 -0
  144. package/dist/entities/compose/compose.types.js +2 -0
  145. package/dist/entities/compose/compose.types.js.map +1 -0
  146. package/dist/entities/compose/index.d.ts +3 -0
  147. package/dist/entities/compose/index.d.ts.map +1 -0
  148. package/dist/entities/compose/index.js +3 -0
  149. package/dist/entities/compose/index.js.map +1 -0
  150. package/dist/entities/entities.shell.d.ts +29 -0
  151. package/dist/entities/entities.shell.d.ts.map +1 -0
  152. package/dist/entities/entities.shell.js +27 -0
  153. package/dist/entities/entities.shell.js.map +1 -0
  154. package/dist/entities/entities.shell.test.d.ts +2 -0
  155. package/dist/entities/entities.shell.test.d.ts.map +1 -0
  156. package/dist/entities/entities.shell.test.js +23 -0
  157. package/dist/entities/entities.shell.test.js.map +1 -0
  158. package/dist/entities/index.d.ts +12 -0
  159. package/dist/entities/index.d.ts.map +1 -0
  160. package/dist/entities/index.js +12 -0
  161. package/dist/entities/index.js.map +1 -0
  162. package/dist/entities/intershell-config/intershell-config.d.ts +11 -0
  163. package/dist/entities/intershell-config/intershell-config.d.ts.map +1 -0
  164. package/dist/entities/intershell-config/intershell-config.default.d.ts +188 -0
  165. package/dist/entities/intershell-config/intershell-config.default.d.ts.map +1 -0
  166. package/dist/entities/intershell-config/intershell-config.default.js +225 -0
  167. package/dist/entities/intershell-config/intershell-config.default.js.map +1 -0
  168. package/dist/entities/intershell-config/intershell-config.js +132 -0
  169. package/dist/entities/intershell-config/intershell-config.js.map +1 -0
  170. package/dist/entities/intershell-config/intershell-config.test.d.ts +2 -0
  171. package/dist/entities/intershell-config/intershell-config.test.d.ts.map +1 -0
  172. package/dist/entities/intershell-config/intershell-config.test.js +102 -0
  173. package/dist/entities/intershell-config/intershell-config.test.js.map +1 -0
  174. package/dist/entities/intershell-config/intershell-config.types.d.ts +103 -0
  175. package/dist/entities/intershell-config/intershell-config.types.d.ts.map +1 -0
  176. package/dist/entities/intershell-config/intershell-config.types.js +2 -0
  177. package/dist/entities/intershell-config/intershell-config.types.js.map +1 -0
  178. package/dist/entities/package/index.d.ts +4 -0
  179. package/dist/entities/package/index.d.ts.map +1 -0
  180. package/dist/entities/package/index.js +4 -0
  181. package/dist/entities/package/index.js.map +1 -0
  182. package/dist/entities/package/package.d.ts +49 -0
  183. package/dist/entities/package/package.d.ts.map +1 -0
  184. package/dist/entities/package/package.js +234 -0
  185. package/dist/entities/package/package.js.map +1 -0
  186. package/dist/entities/package/package.shell.d.ts +48 -0
  187. package/dist/entities/package/package.shell.d.ts.map +1 -0
  188. package/dist/entities/package/package.shell.js +118 -0
  189. package/dist/entities/package/package.shell.js.map +1 -0
  190. package/dist/entities/package/package.test.d.ts +23 -0
  191. package/dist/entities/package/package.test.d.ts.map +1 -0
  192. package/dist/entities/package/package.test.js +637 -0
  193. package/dist/entities/package/package.test.js.map +1 -0
  194. package/dist/entities/package/package.types.d.ts +48 -0
  195. package/dist/entities/package/package.types.d.ts.map +1 -0
  196. package/dist/entities/package/package.types.js +2 -0
  197. package/dist/entities/package/package.types.js.map +1 -0
  198. package/dist/entities/package-changelog/index.d.ts +4 -0
  199. package/dist/entities/package-changelog/index.d.ts.map +1 -0
  200. package/dist/entities/package-changelog/index.js +4 -0
  201. package/dist/entities/package-changelog/index.js.map +1 -0
  202. package/dist/entities/package-changelog/package-changelog.d.ts +20 -0
  203. package/dist/entities/package-changelog/package-changelog.d.ts.map +1 -0
  204. package/dist/entities/package-changelog/package-changelog.js +59 -0
  205. package/dist/entities/package-changelog/package-changelog.js.map +1 -0
  206. package/dist/entities/package-changelog/package-changelog.types.d.ts +25 -0
  207. package/dist/entities/package-changelog/package-changelog.types.d.ts.map +1 -0
  208. package/dist/entities/package-changelog/package-changelog.types.js +2 -0
  209. package/dist/entities/package-changelog/package-changelog.types.js.map +1 -0
  210. package/dist/entities/package-changelog/template.d.ts +20 -0
  211. package/dist/entities/package-changelog/template.d.ts.map +1 -0
  212. package/dist/entities/package-changelog/template.default.d.ts +10 -0
  213. package/dist/entities/package-changelog/template.default.d.ts.map +1 -0
  214. package/dist/entities/package-changelog/template.default.js +85 -0
  215. package/dist/entities/package-changelog/template.default.js.map +1 -0
  216. package/dist/entities/package-changelog/template.js +90 -0
  217. package/dist/entities/package-changelog/template.js.map +1 -0
  218. package/dist/entities/package-commits/dependency-analyzer.d.ts +35 -0
  219. package/dist/entities/package-commits/dependency-analyzer.d.ts.map +1 -0
  220. package/dist/entities/package-commits/dependency-analyzer.js +169 -0
  221. package/dist/entities/package-commits/dependency-analyzer.js.map +1 -0
  222. package/dist/entities/package-commits/dependency-analyzer.test.d.ts +2 -0
  223. package/dist/entities/package-commits/dependency-analyzer.test.d.ts.map +1 -0
  224. package/dist/entities/package-commits/dependency-analyzer.test.js +25 -0
  225. package/dist/entities/package-commits/dependency-analyzer.test.js.map +1 -0
  226. package/dist/entities/package-commits/index.d.ts +3 -0
  227. package/dist/entities/package-commits/index.d.ts.map +1 -0
  228. package/dist/entities/package-commits/index.js +3 -0
  229. package/dist/entities/package-commits/index.js.map +1 -0
  230. package/dist/entities/package-commits/package-commits.d.ts +33 -0
  231. package/dist/entities/package-commits/package-commits.d.ts.map +1 -0
  232. package/dist/entities/package-commits/package-commits.js +149 -0
  233. package/dist/entities/package-commits/package-commits.js.map +1 -0
  234. package/dist/entities/package-commits/package-commits.test.d.ts +2 -0
  235. package/dist/entities/package-commits/package-commits.test.d.ts.map +1 -0
  236. package/dist/entities/package-commits/package-commits.test.js +40 -0
  237. package/dist/entities/package-commits/package-commits.test.js.map +1 -0
  238. package/dist/entities/package-tags/index.d.ts +2 -0
  239. package/dist/entities/package-tags/index.d.ts.map +1 -0
  240. package/dist/entities/package-tags/index.js +2 -0
  241. package/dist/entities/package-tags/index.js.map +1 -0
  242. package/dist/entities/package-tags/package-tags.d.ts +24 -0
  243. package/dist/entities/package-tags/package-tags.d.ts.map +1 -0
  244. package/dist/entities/package-tags/package-tags.js +197 -0
  245. package/dist/entities/package-tags/package-tags.js.map +1 -0
  246. package/dist/entities/package-tags/package-tags.test.d.ts +2 -0
  247. package/dist/entities/package-tags/package-tags.test.d.ts.map +1 -0
  248. package/dist/entities/package-tags/package-tags.test.js +60 -0
  249. package/dist/entities/package-tags/package-tags.test.js.map +1 -0
  250. package/dist/entities/package-version/index.d.ts +3 -0
  251. package/dist/entities/package-version/index.d.ts.map +1 -0
  252. package/dist/entities/package-version/index.js +3 -0
  253. package/dist/entities/package-version/index.js.map +1 -0
  254. package/dist/entities/package-version/package-version.d.ts +16 -0
  255. package/dist/entities/package-version/package-version.d.ts.map +1 -0
  256. package/dist/entities/package-version/package-version.js +166 -0
  257. package/dist/entities/package-version/package-version.js.map +1 -0
  258. package/dist/entities/package-version/package-version.test.d.ts +2 -0
  259. package/dist/entities/package-version/package-version.test.d.ts.map +1 -0
  260. package/dist/entities/package-version/package-version.test.js +113 -0
  261. package/dist/entities/package-version/package-version.test.js.map +1 -0
  262. package/dist/entities/package-version/package-version.types.d.ts +31 -0
  263. package/dist/entities/package-version/package-version.types.d.ts.map +1 -0
  264. package/dist/entities/package-version/package-version.types.js +2 -0
  265. package/dist/entities/package-version/package-version.types.js.map +1 -0
  266. package/dist/entities/tag/index.d.ts +3 -0
  267. package/dist/entities/tag/index.d.ts.map +1 -0
  268. package/dist/entities/tag/index.js +3 -0
  269. package/dist/entities/tag/index.js.map +1 -0
  270. package/dist/entities/tag/tag.d.ts +24 -0
  271. package/dist/entities/tag/tag.d.ts.map +1 -0
  272. package/dist/entities/tag/tag.js +168 -0
  273. package/dist/entities/tag/tag.js.map +1 -0
  274. package/dist/entities/tag/tag.test.d.ts +2 -0
  275. package/dist/entities/tag/tag.test.d.ts.map +1 -0
  276. package/dist/entities/tag/tag.test.js +638 -0
  277. package/dist/entities/tag/tag.test.js.map +1 -0
  278. package/dist/entities/tag/tag.types.d.ts +35 -0
  279. package/dist/entities/tag/tag.types.d.ts.map +1 -0
  280. package/dist/entities/tag/tag.types.js +2 -0
  281. package/dist/entities/tag/tag.types.js.map +1 -0
  282. package/dist/index.d.ts +3 -0
  283. package/dist/index.d.ts.map +1 -0
  284. package/dist/index.js +6 -0
  285. package/dist/index.js.map +1 -0
  286. package/package.json +73 -0
  287. package/src/commands/ci/act.ts +95 -0
  288. package/src/commands/ci/attach-affected.ts +93 -0
  289. package/src/commands/ci/attach-service-ports.ts +31 -0
  290. package/src/commands/commit-check.ts +124 -0
  291. package/src/commands/commit.ts +103 -0
  292. package/src/commands/dev/check.ts +117 -0
  293. package/src/commands/dev/cleanup.ts +34 -0
  294. package/src/commands/dev/rm.ts +66 -0
  295. package/src/commands/dev/setup.ts +48 -0
  296. package/src/commands/local/cleanup.ts +74 -0
  297. package/src/commands/local/setup.ts +68 -0
  298. package/src/commands/local/vscode.ts +118 -0
  299. package/src/commands/update-package-json.ts +104 -0
  300. package/src/commands/version/apply.ts +156 -0
  301. package/src/commands/version/ci.ts +85 -0
  302. package/src/commands/version/prepare.ts +217 -0
  303. package/src/core/colorify.ts +61 -0
  304. package/src/core/index.ts +3 -0
  305. package/src/core/types.ts +262 -0
  306. package/src/core/wrapshell.ts +388 -0
  307. package/src/entities/affected/affected.test.ts +427 -0
  308. package/src/entities/affected/affected.ts +22 -0
  309. package/src/entities/affected/index.ts +1 -0
  310. package/src/entities/branch/branch.test.ts +348 -0
  311. package/src/entities/branch/branch.ts +89 -0
  312. package/src/entities/branch/branch.types.ts +5 -0
  313. package/src/entities/branch/index.ts +2 -0
  314. package/src/entities/commit/commit.test.ts +769 -0
  315. package/src/entities/commit/commit.ts +245 -0
  316. package/src/entities/commit/commit.types.ts +81 -0
  317. package/src/entities/commit/index.ts +2 -0
  318. package/src/entities/commit/pr.test.ts +860 -0
  319. package/src/entities/commit/pr.ts +241 -0
  320. package/src/entities/compose/compose.test.ts +496 -0
  321. package/src/entities/compose/compose.ts +251 -0
  322. package/src/entities/compose/compose.types.ts +88 -0
  323. package/src/entities/compose/index.ts +2 -0
  324. package/src/entities/entities.shell.test.ts +35 -0
  325. package/src/entities/entities.shell.ts +81 -0
  326. package/src/entities/index.ts +11 -0
  327. package/src/entities/intershell-config/intershell-config.default.ts +229 -0
  328. package/src/entities/intershell-config/intershell-config.test.ts +117 -0
  329. package/src/entities/intershell-config/intershell-config.ts +143 -0
  330. package/src/entities/intershell-config/intershell-config.types.ts +118 -0
  331. package/src/entities/package/index.ts +3 -0
  332. package/src/entities/package/package.shell.ts +124 -0
  333. package/src/entities/package/package.test.ts +830 -0
  334. package/src/entities/package/package.ts +267 -0
  335. package/src/entities/package/package.types.ts +49 -0
  336. package/src/entities/package-changelog/index.ts +3 -0
  337. package/src/entities/package-changelog/package-changelog.ts +81 -0
  338. package/src/entities/package-changelog/package-changelog.types.ts +30 -0
  339. package/src/entities/package-changelog/template.default.ts +109 -0
  340. package/src/entities/package-changelog/template.ts +118 -0
  341. package/src/entities/package-commits/dependency-analyzer.test.ts +29 -0
  342. package/src/entities/package-commits/dependency-analyzer.ts +194 -0
  343. package/src/entities/package-commits/index.ts +2 -0
  344. package/src/entities/package-commits/package-commits.test.ts +44 -0
  345. package/src/entities/package-commits/package-commits.ts +191 -0
  346. package/src/entities/package-tags/index.ts +1 -0
  347. package/src/entities/package-tags/package-tags.test.ts +73 -0
  348. package/src/entities/package-tags/package-tags.ts +234 -0
  349. package/src/entities/package-version/index.ts +2 -0
  350. package/src/entities/package-version/package-version.test.ts +141 -0
  351. package/src/entities/package-version/package-version.ts +234 -0
  352. package/src/entities/package-version/package-version.types.ts +35 -0
  353. package/src/entities/tag/index.ts +2 -0
  354. package/src/entities/tag/tag.test.ts +844 -0
  355. package/src/entities/tag/tag.ts +208 -0
  356. package/src/entities/tag/tag.types.ts +37 -0
  357. package/src/index.ts +7 -0
@@ -0,0 +1,117 @@
1
+ import { setTimeout } from "node:timers/promises";
2
+ import { Command, Flags } from "@oclif/core";
3
+ import { $ } from "bun";
4
+ import { colorify } from "../../core";
5
+ import { EntityCompose, type ServiceHealth, type ServiceInfo } from "../../entities";
6
+
7
+ export default class DevCheck extends Command {
8
+ static description = "Check the health of the DevContainer services";
9
+
10
+ static examples = ["intershell dev:check", "intershell dev:check --keep-alive"];
11
+
12
+ static flags = {
13
+ "keep-alive": Flags.boolean({
14
+ char: "s",
15
+ description: "Keep services alive after checks complete",
16
+ default: false,
17
+ }),
18
+ };
19
+
20
+ async run(): Promise<void> {
21
+ const { flags } = await this.parse(DevCheck);
22
+
23
+ this.log(colorify.blue("๐Ÿงช Starting DevContainer Health Check..."));
24
+
25
+ await $`bun run dev:up --build`;
26
+ const compose = new EntityCompose("./docker-compose.dev.yml");
27
+ await this.monitorServiceHealth(compose);
28
+
29
+ this.log(colorify.blue("\n๐Ÿ“Š Services are available at:"));
30
+ const devUrls = await compose.getServiceUrls();
31
+ for (const [name, url] of Object.entries(devUrls)) {
32
+ this.log(colorify.cyan(` โ€ข ${name}: ${url}`));
33
+ }
34
+ this.log(colorify.green("โœ… DevContainer health check completed successfully!"));
35
+
36
+ if (flags["keep-alive"]) {
37
+ this.log(
38
+ colorify.yellow("๐Ÿ’ก Use 'intershell dev:check --keep-alive' to keep services alive"),
39
+ );
40
+ } else {
41
+ this.log(colorify.yellow("๐Ÿงน Cleaning up services..."));
42
+ await $`bun run dev:down`;
43
+ }
44
+ }
45
+
46
+ private readonly icons: Record<ServiceHealth["status"], string> = {
47
+ healthy: "โœ…",
48
+ starting: "๐Ÿ”„",
49
+ unhealthy: "โŒ",
50
+ unknown: "โ“",
51
+ };
52
+
53
+ private readonly colors: Record<ServiceHealth["status"], (text: string) => string> = {
54
+ healthy: colorify.green,
55
+ starting: colorify.yellow,
56
+ unhealthy: colorify.red,
57
+ unknown: colorify.gray,
58
+ };
59
+
60
+ private async monitorServiceHealth(compose: EntityCompose): Promise<void> {
61
+ const services = await compose.getServices();
62
+ this.log(colorify.yellow("โณ Waiting for services to become healthy..."));
63
+
64
+ const retryInterval = 5_000;
65
+ const maxRetries = 6; // 6 * retryInterval = 30 seconds total
66
+ let retryCount = 0;
67
+ let allHealthy = false;
68
+
69
+ let healthResult: ServiceHealth[] | null = null;
70
+ while (retryCount < maxRetries && !allHealthy) {
71
+ if (retryCount > 0) {
72
+ this.log(
73
+ colorify.yellow(
74
+ `๐Ÿ”„ Retry ${retryCount}/${maxRetries} - Checking health again in 5 seconds...`,
75
+ ),
76
+ );
77
+ await setTimeout(retryInterval);
78
+ }
79
+
80
+ healthResult = await compose.getServiceHealth();
81
+
82
+ if (
83
+ healthResult?.every((s) => s.status === "healthy") &&
84
+ healthResult.length === services.length
85
+ ) {
86
+ allHealthy = true;
87
+ } else {
88
+ retryCount++;
89
+ }
90
+ }
91
+
92
+ // Print detailed health status
93
+ this.log(colorify.blue("\n๐Ÿ“Š Final Service Health Status:"));
94
+ this.log("-".repeat(50));
95
+ if (!healthResult) {
96
+ throw new Error("Failed to get health status from services");
97
+ }
98
+
99
+ for (const service of healthResult) {
100
+ const icon = this.icons[service.status];
101
+ const color = this.colors[service.status];
102
+ const port = services.find((s: ServiceInfo) => s.name === service.name)?.ports[0]?.host;
103
+ this.log(`${icon} ${color(service.name)}: ${service.status} ${port ? `(${port})` : ""}`);
104
+ }
105
+
106
+ if (healthResult.some((s) => s.status === "unhealthy")) {
107
+ throw new Error(
108
+ `Unhealthy services after ${maxRetries} retries: ${healthResult
109
+ .filter((s) => s.status === "unhealthy")
110
+ .map((s) => s.name)
111
+ .join(", ")}`,
112
+ );
113
+ }
114
+
115
+ this.log(colorify.green("โœ… All services are healthy"));
116
+ }
117
+ }
@@ -0,0 +1,34 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { $ } from "bun";
3
+ import { colorify } from "../../core";
4
+
5
+ export default class DevCleanup extends Command {
6
+ static description = `Clean up DevContainer services and development artifacts.
7
+ This only cleans up the development services, not the VS Code DevContainer itself.
8
+ To stop the VS Code DevContainer, run \`bun run dev:rm\` from the host machine.`;
9
+
10
+ static examples = ["intershell dev:cleanup", "intershell dev:cleanup --verbose"];
11
+
12
+ static flags = {
13
+ verbose: Flags.boolean({
14
+ char: "v",
15
+ description: "Enable verbose output",
16
+ default: false,
17
+ }),
18
+ };
19
+
20
+ async run(): Promise<void> {
21
+ await this.parse(DevCleanup);
22
+
23
+ this.log(colorify.blue("๐Ÿงน Starting DevContainer cleanup..."));
24
+
25
+ this.log(colorify.yellow("๐Ÿณ Stopping DevContainer services..."));
26
+ await $`docker compose -f ./docker-compose.dev.yml --profile all down --volumes`;
27
+ await $`docker compose -f ./docker-compose.dev.yml --profile all rm -f --volumes`;
28
+
29
+ this.log(colorify.green("โœ… DevContainer cleanup completed successfully!"));
30
+ this.log(colorify.cyan("\n๐Ÿ’ก To start fresh on devcontainer, run:"));
31
+ this.log(colorify.cyan(" - intershell dev:setup"));
32
+ this.log(colorify.cyan(" - intershell dev:rm # To stop VS Code DevContainer (host only)"));
33
+ }
34
+ }
@@ -0,0 +1,66 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { $ } from "bun";
3
+ import { colorify } from "../../core";
4
+
5
+ export default class DevRm extends Command {
6
+ static description = `Stop and remove the VS Code DevContainer itself.
7
+ โš ๏ธ WARNING: This script must be run from the HOST machine, not from within the DevContainer.
8
+ This will stop the VS Code DevContainer and all associated containers.`;
9
+
10
+ static examples = ["intershell dev:rm", "intershell dev:rm --force"];
11
+
12
+ static flags = {
13
+ force: Flags.boolean({
14
+ char: "f",
15
+ description: "Force removal without confirmation",
16
+ default: false,
17
+ }),
18
+ };
19
+
20
+ async run(): Promise<void> {
21
+ await this.parse(DevRm);
22
+
23
+ this.log(colorify.blue("๐Ÿณ Stopping VS Code DevContainer..."));
24
+
25
+ // Check if we're in a DevContainer
26
+ const isInDevContainer = process.env.REMOTE_CONTAINERS === "true";
27
+ if (isInDevContainer) {
28
+ this.error(
29
+ colorify.red(
30
+ "โŒ ERROR: This script must be run from the HOST machine, not from within the DevContainer.",
31
+ ),
32
+ );
33
+ this.log(
34
+ colorify.yellow(
35
+ "๐Ÿ’ก Please exit the DevContainer and run this command from your host terminal.",
36
+ ),
37
+ );
38
+ process.exit(1);
39
+ }
40
+
41
+ await this.stepStopDevContainer();
42
+ await this.stepStopRemoveAllContainers();
43
+
44
+ this.log(colorify.green("โœ… DevContainer removal completed successfully!"));
45
+ this.log(colorify.cyan("\n๐Ÿ’ก To start fresh, run:"));
46
+ this.log(colorify.cyan(" - intershell local:setup # For local development"));
47
+ this.log(colorify.cyan(" - Press `Ctrl+Shift+P` (or `Cmd+Shift+P` on macOS) "));
48
+ this.log(colorify.cyan(" -Type 'Dev Containers: Reopen in Container' and select the command"));
49
+ this.log(colorify.cyan(" - intershell dev:setup # For DevContainer development"));
50
+ }
51
+
52
+ private async stepStopDevContainer(): Promise<void> {
53
+ this.log(colorify.yellow("๐Ÿ›‘ Stopping VS Code DevContainer..."));
54
+ // Stop the DevContainer using VS Code CLI
55
+ await $`code --command "devcontainers.stop"`.nothrow();
56
+ }
57
+
58
+ private async stepStopRemoveAllContainers(): Promise<void> {
59
+ this.log(colorify.yellow("๐Ÿณ Stopping all related containers..."));
60
+ await $`docker compose -f ./docker-compose.dev.yml --profile all down --volumes --remove-orphans`;
61
+ await $`docker compose -f docker-compose.yml down --volumes --remove-orphans`;
62
+ this.log(colorify.yellow("๐Ÿ—‘๏ธ Removing containers..."));
63
+ await $`docker compose -f ./docker-compose.dev.yml --profile all rm -f --volumes`;
64
+ await $`docker compose -f docker-compose.yml rm -f --volumes`;
65
+ }
66
+ }
@@ -0,0 +1,48 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { $ } from "bun";
3
+ import { colorify } from "../../core";
4
+ import { EntityCompose } from "../../entities";
5
+
6
+ export default class DevSetup extends Command {
7
+ static description =
8
+ "Setup DevContainer environment with Docker builds, service startup, and health verification";
9
+
10
+ static examples = [
11
+ "intershell dev:setup",
12
+ "intershell dev:setup --skip-health-check",
13
+ "intershell dev:setup --keep-running",
14
+ ];
15
+
16
+ static flags = {
17
+ "skip-health-check": Flags.boolean({
18
+ char: "h",
19
+ description: "Skip health check verification",
20
+ default: false,
21
+ }),
22
+ };
23
+
24
+ async run(): Promise<void> {
25
+ const { flags } = await this.parse(DevSetup);
26
+
27
+ this.log(colorify.blue("๐Ÿณ Starting DevContainer setup..."));
28
+
29
+ await $`bun run dev:up --build`;
30
+ if (!flags["skip-health-check"]) {
31
+ this.log(colorify.blue("๐Ÿฅ Running health checks..."));
32
+ await $`bun run dev:check`;
33
+ }
34
+
35
+ this.log(colorify.cyan("\n๐Ÿ’ก Services are running and available at:"));
36
+ const compose = new EntityCompose("./docker-compose.dev.yml");
37
+ const devUrls = await compose.getServiceUrls();
38
+ for (const [name, url] of Object.entries(devUrls)) {
39
+ this.log(colorify.cyan(` โ€ข ${name}: ${url}`));
40
+ }
41
+
42
+ this.log(colorify.yellow("๐Ÿ’ก Use 'bun run dev:cleanup' to stop services when done"));
43
+ this.log(colorify.cyan("\n๐Ÿ’ก Useful commands:"));
44
+ this.log(colorify.cyan(" - bun run dev:check # Check DevContainer health"));
45
+ this.log(colorify.cyan(" - bun run dev:logs # View service logs"));
46
+ this.log(colorify.cyan(" - bun run dev:cleanup # Clean DevContainer environment"));
47
+ }
48
+ }
@@ -0,0 +1,74 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { $ } from "bun";
3
+ import { colorify } from "../../core";
4
+
5
+ export default class LocalCleanup extends Command {
6
+ static description =
7
+ "Comprehensive cleanup of Docker containers, build artifacts, and development files. This includes DevContainer cleanup. To stop the VS Code DevContainer itself, run `bun run dev:rm` from host machine";
8
+
9
+ static examples = ["intershell local:cleanup", "intershell local:cleanup --verbose"];
10
+
11
+ static flags = {
12
+ verbose: Flags.boolean({
13
+ char: "v",
14
+ description: "Enable verbose output",
15
+ default: false,
16
+ }),
17
+ };
18
+
19
+ private readonly directories = [
20
+ "dist",
21
+ "build",
22
+ "dist",
23
+ "dist-storybook",
24
+ ".turbo",
25
+ ".next",
26
+ ".output",
27
+ "coverage",
28
+ ".nyc_output",
29
+ ".cache",
30
+ ".parcel-cache",
31
+ ".vite",
32
+ ".swc",
33
+ ".act",
34
+ ".biomecache",
35
+ "bin",
36
+ ];
37
+
38
+ private readonly files = [
39
+ ".act-event.json",
40
+ "*.tsbuildinfo",
41
+ ".log",
42
+ ".tmp",
43
+ ".temp",
44
+ ".DS_Store",
45
+ "Thumbs.db",
46
+ ];
47
+
48
+ async run(): Promise<void> {
49
+ await this.parse(LocalCleanup);
50
+
51
+ this.log(colorify.blue("๐Ÿงน Starting comprehensive cleanup..."));
52
+
53
+ this.log(colorify.yellow("๐Ÿ—‚๏ธ Cleaning development artifacts..."));
54
+ for (const directory of this.directories) {
55
+ await $`rm -rf ${directory} **/${directory} **/${directory}/**`.quiet().nothrow();
56
+ }
57
+
58
+ this.log(colorify.yellow("๐Ÿ“ Cleaning logs and temp files..."));
59
+ for (const file of this.files) {
60
+ await $`rm -rf ${file} **/${file}`.quiet().nothrow();
61
+ }
62
+
63
+ this.log(colorify.yellow("๐Ÿ“ฆ Cleaning node_modules in directories..."));
64
+ await $`rm -rf node_modules **/node_modules`.quiet().nothrow();
65
+
66
+ this.log(colorify.yellow("๐ŸŽฏ Cleaning VS Code configuration..."));
67
+ await $`rm -rf .vscode`.quiet().nothrow();
68
+
69
+ this.log(colorify.green("โœ… Cleanup completed successfully!"));
70
+ this.log(colorify.cyan("\n๐Ÿ’ก To start fresh, run:"));
71
+ this.log(colorify.cyan(" - intershell local:setup # For local development"));
72
+ this.log(colorify.cyan(" - intershell dev:setup # For DevContainer development"));
73
+ }
74
+ }
@@ -0,0 +1,68 @@
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { $ } from "bun";
3
+ import { colorify } from "../../core";
4
+
5
+ export default class LocalSetup extends Command {
6
+ static description =
7
+ "Complete local development environment setup with dependency installation, local builds, and VS Code configuration sync";
8
+
9
+ static examples = [
10
+ "intershell local:setup",
11
+ "intershell local:setup --skip-vscode",
12
+ "intershell local:setup --skip-tests",
13
+ ];
14
+
15
+ static flags = {
16
+ "skip-vscode": Flags.boolean({
17
+ char: "v",
18
+ description: "Skip VS Code configuration sync",
19
+ default: false,
20
+ }),
21
+ "skip-tests": Flags.boolean({
22
+ char: "t",
23
+ description: "Skip running tests",
24
+ default: false,
25
+ }),
26
+ };
27
+
28
+ async run(): Promise<void> {
29
+ const { flags } = await this.parse(LocalSetup);
30
+
31
+ this.log(colorify.blue("๐Ÿš€ Starting local development setup..."));
32
+
33
+ // Step 1: Install dependencies
34
+ this.log(colorify.blue("๐Ÿ“ฆ Installing dependencies..."));
35
+ await $`bun install`;
36
+
37
+ // Step 2: Run code quality checks
38
+ this.log(colorify.blue("๐Ÿ” Running code quality checks..."));
39
+ await $`bun run check:fix`;
40
+
41
+ // Step 3: Type checking
42
+ this.log(colorify.blue("๐Ÿ” Running type checks..."));
43
+ await $`bun run check:types`;
44
+
45
+ // Step 4: Run tests (unless skipped)
46
+ if (!flags["skip-tests"]) {
47
+ this.log(colorify.blue("๐Ÿงช Running tests..."));
48
+ await $`bun run test`;
49
+ }
50
+
51
+ // Step 5: Build all packages
52
+ this.log(colorify.blue("๐Ÿ—๏ธ Building all packages..."));
53
+ await $`bun run build`;
54
+
55
+ // Step 6: Sync VS Code configuration (unless skipped)
56
+ if (!flags["skip-vscode"]) {
57
+ this.log(colorify.blue("๐ŸŽฏ Syncing VS Code configuration..."));
58
+ await $`bun run local:vscode`;
59
+ }
60
+
61
+ this.log(colorify.green("โœ… Local setup completed successfully!"));
62
+
63
+ this.log(colorify.cyan("\n๐Ÿ’ก Useful commands:"));
64
+ this.log(colorify.cyan(" - bun run check:quick # Quick verification"));
65
+ this.log(colorify.cyan(" - intershell dev:setup # Setup DevContainer environment"));
66
+ this.log(colorify.cyan(" - intershell local:cleanup # Clean everything"));
67
+ }
68
+ }
@@ -0,0 +1,118 @@
1
+ import { exists, mkdir } from "node:fs/promises";
2
+ import { join } from "node:path";
3
+ import { Command, Flags } from "@oclif/core";
4
+ import { $ } from "bun";
5
+ import { EntityPackage } from "../../entities";
6
+
7
+ export default class LocalVscode extends Command {
8
+ static description =
9
+ "Synchronize VS Code extensions and settings from devcontainer.json to .vscode/ directory";
10
+
11
+ static examples = [
12
+ "intershell local:vscode",
13
+ "intershell local:vscode --dry-run",
14
+ "intershell local:vscode --extensions-only",
15
+ "intershell local:vscode --settings-only",
16
+ "intershell local:vscode --quiet",
17
+ ];
18
+
19
+ static flags = {
20
+ "dry-run": Flags.boolean({
21
+ description: "Show what would be synced without making changes",
22
+ default: false,
23
+ }),
24
+ "extensions-only": Flags.boolean({
25
+ description: "Only sync extensions",
26
+ default: false,
27
+ }),
28
+ "settings-only": Flags.boolean({
29
+ description: "Only sync settings",
30
+ default: false,
31
+ }),
32
+ quiet: Flags.boolean({
33
+ description: "Suppress all output except errors",
34
+ default: false,
35
+ }),
36
+ };
37
+
38
+ /**
39
+ * Log a message only if not in quiet mode
40
+ */
41
+ private logQuiet(message: string, quiet: boolean): void {
42
+ if (!quiet) {
43
+ this.log(message);
44
+ }
45
+ }
46
+
47
+ async run(): Promise<void> {
48
+ const { flags } = await this.parse(LocalVscode);
49
+
50
+ this.logQuiet("๐Ÿ”„ Syncing VS Code configuration from devcontainer.json...", flags.quiet);
51
+
52
+ const scopes = await EntityPackage.getAllPackages();
53
+ this.logQuiet(`๐Ÿ“‹ Generated scopes: ${scopes.join(", ")}`, flags.quiet);
54
+
55
+ const {
56
+ customizations: { vscode: { extensions: recommendations = [], settings = {} } = {} } = {},
57
+ } = JSON.parse(
58
+ stripComments(
59
+ await Bun.file(join(process.cwd(), ".devcontainer", "devcontainer.json")).text(),
60
+ ),
61
+ );
62
+
63
+ // Update settings with generated scopes
64
+ const updatedSettings = {
65
+ ...settings,
66
+ "conventionalCommits.scopes": scopes,
67
+ };
68
+
69
+ const settingsConfigString = JSON.stringify(updatedSettings, null, 2);
70
+ const extensionsConfigString = JSON.stringify({ recommendations }, null, 2);
71
+
72
+ if (flags["dry-run"]) {
73
+ this.logQuiet("๐Ÿ” Dry run mode - showing what would be synced:", flags.quiet);
74
+ this.logQuiet(`๐Ÿ“ฆ Extensions:\n${extensionsConfigString}`, flags.quiet);
75
+ this.logQuiet(`โš™๏ธ Settings:\n${settingsConfigString}`, flags.quiet);
76
+ return;
77
+ }
78
+
79
+ // Update devcontainer.json with new scopes
80
+ const devcontainerPath = join(process.cwd(), ".devcontainer", "devcontainer.json");
81
+ const devcontainerContent = JSON.parse(stripComments(await Bun.file(devcontainerPath).text()));
82
+
83
+ // Update the scopes in devcontainer.json
84
+ devcontainerContent.customizations.vscode.settings["conventionalCommits.scopes"] = scopes;
85
+
86
+ // Write back the updated devcontainer.json
87
+ await Bun.write(devcontainerPath, JSON.stringify(devcontainerContent, null, 2));
88
+ await $`bun run biome check --write ${devcontainerPath}`;
89
+ this.logQuiet(`โœ… Updated ${devcontainerPath} with new scopes!`, flags.quiet);
90
+
91
+ const vscodeDir = join(process.cwd(), ".vscode");
92
+ if (!(await exists(vscodeDir))) await mkdir(vscodeDir, { recursive: true });
93
+ const extensionsPath = join(vscodeDir, "extensions.json");
94
+ const settingsPath = join(vscodeDir, "settings.json");
95
+
96
+ if (!flags["settings-only"]) {
97
+ await Bun.write(extensionsPath, extensionsConfigString);
98
+ this.logQuiet(`โœ… Updated ${extensionsPath}!`, flags.quiet);
99
+ }
100
+
101
+ if (!flags["extensions-only"]) {
102
+ await Bun.write(settingsPath, settingsConfigString);
103
+ this.logQuiet(`โœ… Updated ${settingsPath}!`, flags.quiet);
104
+ }
105
+
106
+ this.logQuiet("โœ… VS Code configuration synced successfully!", flags.quiet);
107
+ }
108
+ }
109
+
110
+ /**
111
+ * Strip comments from JSON content
112
+ */
113
+ function stripComments(content: string): string {
114
+ return content
115
+ .replace(/\/\/[^\r\n]*/g, "")
116
+ .replace(/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g, "")
117
+ .replace(/^\s*[\r\n]/gm, "");
118
+ }
@@ -0,0 +1,104 @@
1
+ import { readdir } from "node:fs/promises";
2
+ import path from "node:path";
3
+ import { Command, Flags } from "@oclif/core";
4
+ import { $ } from "bun";
5
+ import { colorify } from "../core";
6
+
7
+ export default class UpdatePackageJson extends Command {
8
+ static description =
9
+ "Update the package.json exports attributes based on the files in the package";
10
+
11
+ static examples = ["intershell update-package-json"];
12
+
13
+ static flags = {
14
+ src: Flags.boolean({
15
+ char: "s",
16
+ description: "Are you using src directory? (default: true)",
17
+ default: true,
18
+ }),
19
+ "dry-run": Flags.boolean({
20
+ char: "d",
21
+ description: "Show what would be updated without making changes",
22
+ default: false,
23
+ }),
24
+ };
25
+
26
+ async run(): Promise<void> {
27
+ const { flags } = await this.parse(UpdatePackageJson);
28
+ this.log(colorify.blue("๐Ÿงน Starting package.json update..."));
29
+
30
+ const packageJsonPath = path.join(process.cwd(), "package.json");
31
+ const packageDir = path.dirname(packageJsonPath);
32
+ const srcDir = flags.src ? path.join(packageDir, "src") : packageDir;
33
+ const files = await readdir(srcDir, {
34
+ withFileTypes: true,
35
+ recursive: false,
36
+ });
37
+
38
+ this.log(
39
+ colorify.blue(`๐Ÿ” Found ${files.length} exportable modules:`),
40
+ colorify.cyan(files.map((f) => f.name).join(" ")),
41
+ );
42
+
43
+ const newExports = await this.getNewExports(files, srcDir, packageDir);
44
+
45
+ if (flags["dry-run"]) {
46
+ this.log(colorify.yellow("๐Ÿ” Dry run mode, skipping write:"));
47
+ this.log(JSON.stringify(newExports, null, 2));
48
+ return;
49
+ }
50
+
51
+ const packageJson = JSON.parse(await Bun.file(packageJsonPath).text());
52
+ packageJson.exports = newExports;
53
+
54
+ await Bun.write(packageJsonPath, JSON.stringify(packageJson, null, 2));
55
+ await $`bun biome check --write --no-errors-on-unmatched ${packageJsonPath}`;
56
+ this.log(colorify.green("โœ… Package.json updated successfully"));
57
+ }
58
+
59
+ private async getNewExports(
60
+ files: Array<{ name: string; isDirectory(): boolean }>,
61
+ srcDir: string,
62
+ packageDir: string,
63
+ ): Promise<Record<string, string>> {
64
+ const newExports: Record<string, string> = {};
65
+
66
+ for (const file of files) {
67
+ if (file.isDirectory()) {
68
+ const indexFile = path.join(srcDir, file.name, "index.ts");
69
+ const indexTsxFile = path.join(srcDir, file.name, "index.tsx");
70
+ const sameNameFile = path.join(srcDir, file.name, `${file.name}.ts`);
71
+ const sameNameTsxFile = path.join(srcDir, file.name, `${file.name}.tsx`);
72
+
73
+ if (await Bun.file(indexFile).exists()) {
74
+ newExports[`./${file.name}`] = `./${path.relative(packageDir, indexFile)}`;
75
+ } else if (await Bun.file(indexTsxFile).exists()) {
76
+ newExports[`./${file.name}`] = `./${path.relative(packageDir, indexTsxFile)}`;
77
+ } else if (await Bun.file(sameNameFile).exists()) {
78
+ newExports[`./${file.name}`] = `./${path.relative(packageDir, sameNameFile)}`;
79
+ } else if (await Bun.file(sameNameTsxFile).exists()) {
80
+ newExports[`./${file.name}`] = `./${path.relative(packageDir, sameNameTsxFile)}`;
81
+ }
82
+
83
+ continue;
84
+ }
85
+
86
+ const shouldSkip = !file.name.endsWith(".ts") && !file.name.endsWith(".tsx");
87
+ if (shouldSkip) continue;
88
+
89
+ if (file.name === "index.ts") {
90
+ newExports["."] = "./index.ts";
91
+ continue;
92
+ }
93
+
94
+ const mainFile = path.join(srcDir, file.name);
95
+ const relativePath = `./${path.relative(packageDir, mainFile)}`;
96
+
97
+ if (await Bun.file(mainFile).exists()) {
98
+ newExports[`./${file.name}`] = relativePath;
99
+ }
100
+ }
101
+
102
+ return newExports;
103
+ }
104
+ }