intershell 0.3.7 → 0.4.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 (461) hide show
  1. package/README.md +70 -202
  2. package/dist/affected/affected.d.ts.map +1 -0
  3. package/dist/affected/affected.js.map +1 -0
  4. package/dist/affected/affected.test.d.ts.map +1 -0
  5. package/dist/affected/affected.test.js.map +1 -0
  6. package/dist/affected/index.d.ts.map +1 -0
  7. package/dist/affected/index.js.map +1 -0
  8. package/dist/branch/branch.d.ts.map +1 -0
  9. package/dist/{entities/branch → branch}/branch.js +12 -5
  10. package/dist/branch/branch.js.map +1 -0
  11. package/dist/branch/branch.test.d.ts.map +1 -0
  12. package/dist/{entities/branch → branch}/branch.test.js +55 -0
  13. package/dist/branch/branch.test.js.map +1 -0
  14. package/dist/branch/branch.types.d.ts.map +1 -0
  15. package/dist/branch/branch.types.js.map +1 -0
  16. package/dist/branch/index.d.ts.map +1 -0
  17. package/dist/branch/index.js.map +1 -0
  18. package/dist/commit/commit.d.ts.map +1 -0
  19. package/dist/{entities/commit → commit}/commit.js +12 -6
  20. package/dist/commit/commit.js.map +1 -0
  21. package/dist/commit/commit.test.d.ts.map +1 -0
  22. package/dist/{entities/commit → commit}/commit.test.js +87 -0
  23. package/dist/commit/commit.test.js.map +1 -0
  24. package/dist/commit/commit.types.d.ts.map +1 -0
  25. package/dist/commit/commit.types.js.map +1 -0
  26. package/dist/commit/index.d.ts.map +1 -0
  27. package/dist/commit/index.js.map +1 -0
  28. package/dist/commit/pr.d.ts.map +1 -0
  29. package/dist/commit/pr.js.map +1 -0
  30. package/dist/commit/pr.test.d.ts.map +1 -0
  31. package/dist/commit/pr.test.js.map +1 -0
  32. package/dist/commit-check.d.ts +2 -0
  33. package/dist/commit-check.d.ts.map +1 -0
  34. package/dist/commit-check.js +119 -0
  35. package/dist/commit-check.js.map +1 -0
  36. package/dist/compose/compose.d.ts.map +1 -0
  37. package/dist/compose/compose.js.map +1 -0
  38. package/dist/compose/compose.test.d.ts.map +1 -0
  39. package/dist/compose/compose.test.js.map +1 -0
  40. package/dist/compose/compose.types.d.ts.map +1 -0
  41. package/dist/compose/compose.types.js.map +1 -0
  42. package/dist/compose/index.d.ts.map +1 -0
  43. package/dist/compose/index.js.map +1 -0
  44. package/dist/{entities/entities.shell.d.ts → entities.shell.d.ts} +1 -0
  45. package/dist/entities.shell.d.ts.map +1 -0
  46. package/dist/{entities/entities.shell.js → entities.shell.js} +1 -0
  47. package/dist/entities.shell.js.map +1 -0
  48. package/dist/entities.shell.test.d.ts.map +1 -0
  49. package/dist/entities.shell.test.js.map +1 -0
  50. package/dist/index.d.ts +11 -2
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +11 -5
  53. package/dist/index.js.map +1 -1
  54. package/dist/intershell-config/intershell-config.d.ts.map +1 -0
  55. package/dist/{entities/intershell-config → intershell-config}/intershell-config.default.d.ts +1 -1
  56. package/dist/intershell-config/intershell-config.default.d.ts.map +1 -0
  57. package/dist/{entities/intershell-config → intershell-config}/intershell-config.default.js +1 -8
  58. package/dist/intershell-config/intershell-config.default.js.map +1 -0
  59. package/dist/{entities/intershell-config → intershell-config}/intershell-config.js +14 -3
  60. package/dist/intershell-config/intershell-config.js.map +1 -0
  61. package/dist/intershell-config/intershell-config.test.d.ts.map +1 -0
  62. package/dist/intershell-config/intershell-config.test.js.map +1 -0
  63. package/dist/{entities/intershell-config → intershell-config}/intershell-config.types.d.ts +3 -3
  64. package/dist/intershell-config/intershell-config.types.d.ts.map +1 -0
  65. package/dist/intershell-config/intershell-config.types.js.map +1 -0
  66. package/dist/package/index.d.ts.map +1 -0
  67. package/dist/package/index.js.map +1 -0
  68. package/dist/package/package.d.ts.map +1 -0
  69. package/dist/package/package.js.map +1 -0
  70. package/dist/package/package.shell.d.ts.map +1 -0
  71. package/dist/package/package.shell.js.map +1 -0
  72. package/dist/package/package.test.d.ts.map +1 -0
  73. package/dist/package/package.test.js.map +1 -0
  74. package/dist/package/package.types.d.ts.map +1 -0
  75. package/dist/package/package.types.js.map +1 -0
  76. package/dist/package-changelog/index.d.ts.map +1 -0
  77. package/dist/package-changelog/index.js.map +1 -0
  78. package/dist/package-changelog/package-changelog.d.ts.map +1 -0
  79. package/dist/package-changelog/package-changelog.js.map +1 -0
  80. package/dist/package-changelog/package-changelog.types.d.ts.map +1 -0
  81. package/dist/package-changelog/package-changelog.types.js.map +1 -0
  82. package/dist/package-changelog/template.d.ts.map +1 -0
  83. package/dist/package-changelog/template.default.d.ts.map +1 -0
  84. package/dist/package-changelog/template.default.js.map +1 -0
  85. package/dist/package-changelog/template.js.map +1 -0
  86. package/dist/package-commits/dependency-analyzer.d.ts.map +1 -0
  87. package/dist/package-commits/dependency-analyzer.js.map +1 -0
  88. package/dist/package-commits/dependency-analyzer.test.d.ts.map +1 -0
  89. package/dist/package-commits/dependency-analyzer.test.js.map +1 -0
  90. package/dist/package-commits/index.d.ts.map +1 -0
  91. package/dist/package-commits/index.js.map +1 -0
  92. package/dist/package-commits/package-commits.d.ts.map +1 -0
  93. package/dist/package-commits/package-commits.js.map +1 -0
  94. package/dist/package-commits/package-commits.test.d.ts.map +1 -0
  95. package/dist/package-commits/package-commits.test.js.map +1 -0
  96. package/dist/package-tags/index.d.ts.map +1 -0
  97. package/dist/package-tags/index.js.map +1 -0
  98. package/dist/{entities/package-tags → package-tags}/package-tags.d.ts +1 -1
  99. package/dist/package-tags/package-tags.d.ts.map +1 -0
  100. package/dist/{entities/package-tags → package-tags}/package-tags.js +2 -3
  101. package/dist/package-tags/package-tags.js.map +1 -0
  102. package/dist/package-tags/package-tags.test.d.ts.map +1 -0
  103. package/dist/package-tags/package-tags.test.js.map +1 -0
  104. package/dist/package-version/index.d.ts.map +1 -0
  105. package/dist/package-version/index.js.map +1 -0
  106. package/dist/package-version/package-version.d.ts.map +1 -0
  107. package/dist/package-version/package-version.js.map +1 -0
  108. package/dist/package-version/package-version.test.d.ts.map +1 -0
  109. package/dist/package-version/package-version.test.js.map +1 -0
  110. package/dist/package-version/package-version.types.d.ts.map +1 -0
  111. package/dist/package-version/package-version.types.js.map +1 -0
  112. package/dist/tag/index.d.ts.map +1 -0
  113. package/dist/tag/index.js.map +1 -0
  114. package/dist/tag/tag.d.ts.map +1 -0
  115. package/dist/{entities/tag → tag}/tag.js +12 -3
  116. package/dist/tag/tag.js.map +1 -0
  117. package/dist/tag/tag.test.d.ts.map +1 -0
  118. package/dist/tag/tag.test.js.map +1 -0
  119. package/dist/tag/tag.types.d.ts.map +1 -0
  120. package/dist/tag/tag.types.js.map +1 -0
  121. package/docs/1_ENTITIES.md +62 -0
  122. package/package.json +31 -46
  123. package/src/{entities/branch → branch}/branch.test.ts +64 -3
  124. package/src/{entities/branch → branch}/branch.ts +13 -5
  125. package/src/{entities/commit → commit}/commit.test.ts +100 -0
  126. package/src/{entities/commit → commit}/commit.ts +15 -5
  127. package/src/commit-check.ts +138 -0
  128. package/src/{entities/entities.shell.ts → entities.shell.ts} +2 -0
  129. package/src/index.ts +11 -7
  130. package/src/{entities/intershell-config → intershell-config}/intershell-config.default.ts +1 -8
  131. package/src/{entities/intershell-config → intershell-config}/intershell-config.ts +17 -3
  132. package/src/{entities/intershell-config → intershell-config}/intershell-config.types.ts +3 -3
  133. package/src/{entities/package-tags → package-tags}/package-tags.ts +2 -3
  134. package/src/{entities/tag → tag}/tag.ts +13 -3
  135. package/dist/commands/ci/act.d.ts +0 -13
  136. package/dist/commands/ci/act.d.ts.map +0 -1
  137. package/dist/commands/ci/act.js +0 -89
  138. package/dist/commands/ci/act.js.map +0 -1
  139. package/dist/commands/ci/attach-affected.d.ts +0 -12
  140. package/dist/commands/ci/attach-affected.d.ts.map +0 -1
  141. package/dist/commands/ci/attach-affected.js +0 -83
  142. package/dist/commands/ci/attach-affected.js.map +0 -1
  143. package/dist/commands/ci/attach-service-ports.d.ts +0 -10
  144. package/dist/commands/ci/attach-service-ports.d.ts.map +0 -1
  145. package/dist/commands/ci/attach-service-ports.js +0 -25
  146. package/dist/commands/ci/attach-service-ports.js.map +0 -1
  147. package/dist/commands/commit-check.d.ts +0 -13
  148. package/dist/commands/commit-check.d.ts.map +0 -1
  149. package/dist/commands/commit-check.js +0 -110
  150. package/dist/commands/commit-check.js.map +0 -1
  151. package/dist/commands/commit.d.ts +0 -16
  152. package/dist/commands/commit.d.ts.map +0 -1
  153. package/dist/commands/commit.js +0 -91
  154. package/dist/commands/commit.js.map +0 -1
  155. package/dist/commands/dev/check.d.ts +0 -13
  156. package/dist/commands/dev/check.d.ts.map +0 -1
  157. package/dist/commands/dev/check.js +0 -91
  158. package/dist/commands/dev/check.js.map +0 -1
  159. package/dist/commands/dev/cleanup.d.ts +0 -10
  160. package/dist/commands/dev/cleanup.d.ts.map +0 -1
  161. package/dist/commands/dev/cleanup.js +0 -28
  162. package/dist/commands/dev/cleanup.js.map +0 -1
  163. package/dist/commands/dev/rm.d.ts +0 -12
  164. package/dist/commands/dev/rm.d.ts.map +0 -1
  165. package/dist/commands/dev/rm.js +0 -49
  166. package/dist/commands/dev/rm.js.map +0 -1
  167. package/dist/commands/dev/setup.d.ts +0 -10
  168. package/dist/commands/dev/setup.d.ts.map +0 -1
  169. package/dist/commands/dev/setup.js +0 -40
  170. package/dist/commands/dev/setup.js.map +0 -1
  171. package/dist/commands/local/cleanup.d.ts +0 -12
  172. package/dist/commands/local/cleanup.d.ts.map +0 -1
  173. package/dist/commands/local/cleanup.js +0 -62
  174. package/dist/commands/local/cleanup.js.map +0 -1
  175. package/dist/commands/local/setup.d.ts +0 -11
  176. package/dist/commands/local/setup.d.ts.map +0 -1
  177. package/dist/commands/local/setup.js +0 -55
  178. package/dist/commands/local/setup.js.map +0 -1
  179. package/dist/commands/local/vscode.d.ts +0 -17
  180. package/dist/commands/local/vscode.d.ts.map +0 -1
  181. package/dist/commands/local/vscode.js +0 -94
  182. package/dist/commands/local/vscode.js.map +0 -1
  183. package/dist/commands/update-package-json.d.ts +0 -12
  184. package/dist/commands/update-package-json.d.ts.map +0 -1
  185. package/dist/commands/update-package-json.js +0 -82
  186. package/dist/commands/update-package-json.js.map +0 -1
  187. package/dist/commands/version/apply.d.ts +0 -16
  188. package/dist/commands/version/apply.d.ts.map +0 -1
  189. package/dist/commands/version/apply.js +0 -120
  190. package/dist/commands/version/apply.js.map +0 -1
  191. package/dist/commands/version/ci.d.ts +0 -12
  192. package/dist/commands/version/ci.d.ts.map +0 -1
  193. package/dist/commands/version/ci.js +0 -67
  194. package/dist/commands/version/ci.js.map +0 -1
  195. package/dist/commands/version/prepare.d.ts +0 -19
  196. package/dist/commands/version/prepare.d.ts.map +0 -1
  197. package/dist/commands/version/prepare.js +0 -158
  198. package/dist/commands/version/prepare.js.map +0 -1
  199. package/dist/core/colorify.d.ts +0 -21
  200. package/dist/core/colorify.d.ts.map +0 -1
  201. package/dist/core/colorify.js +0 -56
  202. package/dist/core/colorify.js.map +0 -1
  203. package/dist/core/index.d.ts +0 -4
  204. package/dist/core/index.d.ts.map +0 -1
  205. package/dist/core/index.js +0 -3
  206. package/dist/core/index.js.map +0 -1
  207. package/dist/core/types.d.ts +0 -181
  208. package/dist/core/types.d.ts.map +0 -1
  209. package/dist/core/types.js +0 -5
  210. package/dist/core/types.js.map +0 -1
  211. package/dist/core/wrapshell.d.ts +0 -19
  212. package/dist/core/wrapshell.d.ts.map +0 -1
  213. package/dist/core/wrapshell.js +0 -323
  214. package/dist/core/wrapshell.js.map +0 -1
  215. package/dist/entities/affected/affected.d.ts.map +0 -1
  216. package/dist/entities/affected/affected.js.map +0 -1
  217. package/dist/entities/affected/affected.test.d.ts.map +0 -1
  218. package/dist/entities/affected/affected.test.js.map +0 -1
  219. package/dist/entities/affected/index.d.ts.map +0 -1
  220. package/dist/entities/affected/index.js.map +0 -1
  221. package/dist/entities/branch/branch.d.ts.map +0 -1
  222. package/dist/entities/branch/branch.js.map +0 -1
  223. package/dist/entities/branch/branch.test.d.ts.map +0 -1
  224. package/dist/entities/branch/branch.test.js.map +0 -1
  225. package/dist/entities/branch/branch.types.d.ts.map +0 -1
  226. package/dist/entities/branch/branch.types.js.map +0 -1
  227. package/dist/entities/branch/index.d.ts.map +0 -1
  228. package/dist/entities/branch/index.js.map +0 -1
  229. package/dist/entities/commit/commit.d.ts.map +0 -1
  230. package/dist/entities/commit/commit.js.map +0 -1
  231. package/dist/entities/commit/commit.test.d.ts.map +0 -1
  232. package/dist/entities/commit/commit.test.js.map +0 -1
  233. package/dist/entities/commit/commit.types.d.ts.map +0 -1
  234. package/dist/entities/commit/commit.types.js.map +0 -1
  235. package/dist/entities/commit/index.d.ts.map +0 -1
  236. package/dist/entities/commit/index.js.map +0 -1
  237. package/dist/entities/commit/pr.d.ts.map +0 -1
  238. package/dist/entities/commit/pr.js.map +0 -1
  239. package/dist/entities/commit/pr.test.d.ts.map +0 -1
  240. package/dist/entities/commit/pr.test.js.map +0 -1
  241. package/dist/entities/compose/compose.d.ts.map +0 -1
  242. package/dist/entities/compose/compose.js.map +0 -1
  243. package/dist/entities/compose/compose.test.d.ts.map +0 -1
  244. package/dist/entities/compose/compose.test.js.map +0 -1
  245. package/dist/entities/compose/compose.types.d.ts.map +0 -1
  246. package/dist/entities/compose/compose.types.js.map +0 -1
  247. package/dist/entities/compose/index.d.ts.map +0 -1
  248. package/dist/entities/compose/index.js.map +0 -1
  249. package/dist/entities/entities.shell.d.ts.map +0 -1
  250. package/dist/entities/entities.shell.js.map +0 -1
  251. package/dist/entities/entities.shell.test.d.ts.map +0 -1
  252. package/dist/entities/entities.shell.test.js.map +0 -1
  253. package/dist/entities/index.d.ts +0 -12
  254. package/dist/entities/index.d.ts.map +0 -1
  255. package/dist/entities/index.js +0 -12
  256. package/dist/entities/index.js.map +0 -1
  257. package/dist/entities/intershell-config/intershell-config.d.ts.map +0 -1
  258. package/dist/entities/intershell-config/intershell-config.default.d.ts.map +0 -1
  259. package/dist/entities/intershell-config/intershell-config.default.js.map +0 -1
  260. package/dist/entities/intershell-config/intershell-config.js.map +0 -1
  261. package/dist/entities/intershell-config/intershell-config.test.d.ts.map +0 -1
  262. package/dist/entities/intershell-config/intershell-config.test.js.map +0 -1
  263. package/dist/entities/intershell-config/intershell-config.types.d.ts.map +0 -1
  264. package/dist/entities/intershell-config/intershell-config.types.js.map +0 -1
  265. package/dist/entities/package/index.d.ts.map +0 -1
  266. package/dist/entities/package/index.js.map +0 -1
  267. package/dist/entities/package/package.d.ts.map +0 -1
  268. package/dist/entities/package/package.js.map +0 -1
  269. package/dist/entities/package/package.shell.d.ts.map +0 -1
  270. package/dist/entities/package/package.shell.js.map +0 -1
  271. package/dist/entities/package/package.test.d.ts.map +0 -1
  272. package/dist/entities/package/package.test.js.map +0 -1
  273. package/dist/entities/package/package.types.d.ts.map +0 -1
  274. package/dist/entities/package/package.types.js.map +0 -1
  275. package/dist/entities/package-changelog/index.d.ts.map +0 -1
  276. package/dist/entities/package-changelog/index.js.map +0 -1
  277. package/dist/entities/package-changelog/package-changelog.d.ts.map +0 -1
  278. package/dist/entities/package-changelog/package-changelog.js.map +0 -1
  279. package/dist/entities/package-changelog/package-changelog.types.d.ts.map +0 -1
  280. package/dist/entities/package-changelog/package-changelog.types.js.map +0 -1
  281. package/dist/entities/package-changelog/template.d.ts.map +0 -1
  282. package/dist/entities/package-changelog/template.default.d.ts.map +0 -1
  283. package/dist/entities/package-changelog/template.default.js.map +0 -1
  284. package/dist/entities/package-changelog/template.js.map +0 -1
  285. package/dist/entities/package-commits/dependency-analyzer.d.ts.map +0 -1
  286. package/dist/entities/package-commits/dependency-analyzer.js.map +0 -1
  287. package/dist/entities/package-commits/dependency-analyzer.test.d.ts.map +0 -1
  288. package/dist/entities/package-commits/dependency-analyzer.test.js.map +0 -1
  289. package/dist/entities/package-commits/index.d.ts.map +0 -1
  290. package/dist/entities/package-commits/index.js.map +0 -1
  291. package/dist/entities/package-commits/package-commits.d.ts.map +0 -1
  292. package/dist/entities/package-commits/package-commits.js.map +0 -1
  293. package/dist/entities/package-commits/package-commits.test.d.ts.map +0 -1
  294. package/dist/entities/package-commits/package-commits.test.js.map +0 -1
  295. package/dist/entities/package-tags/index.d.ts.map +0 -1
  296. package/dist/entities/package-tags/index.js.map +0 -1
  297. package/dist/entities/package-tags/package-tags.d.ts.map +0 -1
  298. package/dist/entities/package-tags/package-tags.js.map +0 -1
  299. package/dist/entities/package-tags/package-tags.test.d.ts.map +0 -1
  300. package/dist/entities/package-tags/package-tags.test.js.map +0 -1
  301. package/dist/entities/package-version/index.d.ts.map +0 -1
  302. package/dist/entities/package-version/index.js.map +0 -1
  303. package/dist/entities/package-version/package-version.d.ts.map +0 -1
  304. package/dist/entities/package-version/package-version.js.map +0 -1
  305. package/dist/entities/package-version/package-version.test.d.ts.map +0 -1
  306. package/dist/entities/package-version/package-version.test.js.map +0 -1
  307. package/dist/entities/package-version/package-version.types.d.ts.map +0 -1
  308. package/dist/entities/package-version/package-version.types.js.map +0 -1
  309. package/dist/entities/tag/index.d.ts.map +0 -1
  310. package/dist/entities/tag/index.js.map +0 -1
  311. package/dist/entities/tag/tag.d.ts.map +0 -1
  312. package/dist/entities/tag/tag.js.map +0 -1
  313. package/dist/entities/tag/tag.test.d.ts.map +0 -1
  314. package/dist/entities/tag/tag.test.js.map +0 -1
  315. package/dist/entities/tag/tag.types.d.ts.map +0 -1
  316. package/dist/entities/tag/tag.types.js.map +0 -1
  317. package/src/commands/ci/act.ts +0 -95
  318. package/src/commands/ci/attach-affected.ts +0 -93
  319. package/src/commands/ci/attach-service-ports.ts +0 -31
  320. package/src/commands/commit-check.ts +0 -124
  321. package/src/commands/commit.ts +0 -103
  322. package/src/commands/dev/check.ts +0 -117
  323. package/src/commands/dev/cleanup.ts +0 -34
  324. package/src/commands/dev/rm.ts +0 -66
  325. package/src/commands/dev/setup.ts +0 -48
  326. package/src/commands/local/cleanup.ts +0 -74
  327. package/src/commands/local/setup.ts +0 -68
  328. package/src/commands/local/vscode.ts +0 -118
  329. package/src/commands/update-package-json.ts +0 -104
  330. package/src/commands/version/apply.ts +0 -156
  331. package/src/commands/version/ci.ts +0 -85
  332. package/src/commands/version/prepare.ts +0 -223
  333. package/src/core/colorify.ts +0 -61
  334. package/src/core/index.ts +0 -3
  335. package/src/core/types.ts +0 -262
  336. package/src/core/wrapshell.ts +0 -388
  337. package/src/entities/index.ts +0 -11
  338. /package/dist/{entities/affected → affected}/affected.d.ts +0 -0
  339. /package/dist/{entities/affected → affected}/affected.js +0 -0
  340. /package/dist/{entities/affected → affected}/affected.test.d.ts +0 -0
  341. /package/dist/{entities/affected → affected}/affected.test.js +0 -0
  342. /package/dist/{entities/affected → affected}/index.d.ts +0 -0
  343. /package/dist/{entities/affected → affected}/index.js +0 -0
  344. /package/dist/{entities/branch → branch}/branch.d.ts +0 -0
  345. /package/dist/{entities/branch → branch}/branch.test.d.ts +0 -0
  346. /package/dist/{entities/branch → branch}/branch.types.d.ts +0 -0
  347. /package/dist/{entities/branch → branch}/branch.types.js +0 -0
  348. /package/dist/{entities/branch → branch}/index.d.ts +0 -0
  349. /package/dist/{entities/branch → branch}/index.js +0 -0
  350. /package/dist/{entities/commit → commit}/commit.d.ts +0 -0
  351. /package/dist/{entities/commit → commit}/commit.test.d.ts +0 -0
  352. /package/dist/{entities/commit → commit}/commit.types.d.ts +0 -0
  353. /package/dist/{entities/commit → commit}/commit.types.js +0 -0
  354. /package/dist/{entities/commit → commit}/index.d.ts +0 -0
  355. /package/dist/{entities/commit → commit}/index.js +0 -0
  356. /package/dist/{entities/commit → commit}/pr.d.ts +0 -0
  357. /package/dist/{entities/commit → commit}/pr.js +0 -0
  358. /package/dist/{entities/commit → commit}/pr.test.d.ts +0 -0
  359. /package/dist/{entities/commit → commit}/pr.test.js +0 -0
  360. /package/dist/{entities/compose → compose}/compose.d.ts +0 -0
  361. /package/dist/{entities/compose → compose}/compose.js +0 -0
  362. /package/dist/{entities/compose → compose}/compose.test.d.ts +0 -0
  363. /package/dist/{entities/compose → compose}/compose.test.js +0 -0
  364. /package/dist/{entities/compose → compose}/compose.types.d.ts +0 -0
  365. /package/dist/{entities/compose → compose}/compose.types.js +0 -0
  366. /package/dist/{entities/compose → compose}/index.d.ts +0 -0
  367. /package/dist/{entities/compose → compose}/index.js +0 -0
  368. /package/dist/{entities/entities.shell.test.d.ts → entities.shell.test.d.ts} +0 -0
  369. /package/dist/{entities/entities.shell.test.js → entities.shell.test.js} +0 -0
  370. /package/dist/{entities/intershell-config → intershell-config}/intershell-config.d.ts +0 -0
  371. /package/dist/{entities/intershell-config → intershell-config}/intershell-config.test.d.ts +0 -0
  372. /package/dist/{entities/intershell-config → intershell-config}/intershell-config.test.js +0 -0
  373. /package/dist/{entities/intershell-config → intershell-config}/intershell-config.types.js +0 -0
  374. /package/dist/{entities/package → package}/index.d.ts +0 -0
  375. /package/dist/{entities/package → package}/index.js +0 -0
  376. /package/dist/{entities/package → package}/package.d.ts +0 -0
  377. /package/dist/{entities/package → package}/package.js +0 -0
  378. /package/dist/{entities/package → package}/package.shell.d.ts +0 -0
  379. /package/dist/{entities/package → package}/package.shell.js +0 -0
  380. /package/dist/{entities/package → package}/package.test.d.ts +0 -0
  381. /package/dist/{entities/package → package}/package.test.js +0 -0
  382. /package/dist/{entities/package → package}/package.types.d.ts +0 -0
  383. /package/dist/{entities/package → package}/package.types.js +0 -0
  384. /package/dist/{entities/package-changelog → package-changelog}/index.d.ts +0 -0
  385. /package/dist/{entities/package-changelog → package-changelog}/index.js +0 -0
  386. /package/dist/{entities/package-changelog → package-changelog}/package-changelog.d.ts +0 -0
  387. /package/dist/{entities/package-changelog → package-changelog}/package-changelog.js +0 -0
  388. /package/dist/{entities/package-changelog → package-changelog}/package-changelog.types.d.ts +0 -0
  389. /package/dist/{entities/package-changelog → package-changelog}/package-changelog.types.js +0 -0
  390. /package/dist/{entities/package-changelog → package-changelog}/template.d.ts +0 -0
  391. /package/dist/{entities/package-changelog → package-changelog}/template.default.d.ts +0 -0
  392. /package/dist/{entities/package-changelog → package-changelog}/template.default.js +0 -0
  393. /package/dist/{entities/package-changelog → package-changelog}/template.js +0 -0
  394. /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.d.ts +0 -0
  395. /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.js +0 -0
  396. /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.test.d.ts +0 -0
  397. /package/dist/{entities/package-commits → package-commits}/dependency-analyzer.test.js +0 -0
  398. /package/dist/{entities/package-commits → package-commits}/index.d.ts +0 -0
  399. /package/dist/{entities/package-commits → package-commits}/index.js +0 -0
  400. /package/dist/{entities/package-commits → package-commits}/package-commits.d.ts +0 -0
  401. /package/dist/{entities/package-commits → package-commits}/package-commits.js +0 -0
  402. /package/dist/{entities/package-commits → package-commits}/package-commits.test.d.ts +0 -0
  403. /package/dist/{entities/package-commits → package-commits}/package-commits.test.js +0 -0
  404. /package/dist/{entities/package-tags → package-tags}/index.d.ts +0 -0
  405. /package/dist/{entities/package-tags → package-tags}/index.js +0 -0
  406. /package/dist/{entities/package-tags → package-tags}/package-tags.test.d.ts +0 -0
  407. /package/dist/{entities/package-tags → package-tags}/package-tags.test.js +0 -0
  408. /package/dist/{entities/package-version → package-version}/index.d.ts +0 -0
  409. /package/dist/{entities/package-version → package-version}/index.js +0 -0
  410. /package/dist/{entities/package-version → package-version}/package-version.d.ts +0 -0
  411. /package/dist/{entities/package-version → package-version}/package-version.js +0 -0
  412. /package/dist/{entities/package-version → package-version}/package-version.test.d.ts +0 -0
  413. /package/dist/{entities/package-version → package-version}/package-version.test.js +0 -0
  414. /package/dist/{entities/package-version → package-version}/package-version.types.d.ts +0 -0
  415. /package/dist/{entities/package-version → package-version}/package-version.types.js +0 -0
  416. /package/dist/{entities/tag → tag}/index.d.ts +0 -0
  417. /package/dist/{entities/tag → tag}/index.js +0 -0
  418. /package/dist/{entities/tag → tag}/tag.d.ts +0 -0
  419. /package/dist/{entities/tag → tag}/tag.test.d.ts +0 -0
  420. /package/dist/{entities/tag → tag}/tag.test.js +0 -0
  421. /package/dist/{entities/tag → tag}/tag.types.d.ts +0 -0
  422. /package/dist/{entities/tag → tag}/tag.types.js +0 -0
  423. /package/src/{entities/affected → affected}/affected.test.ts +0 -0
  424. /package/src/{entities/affected → affected}/affected.ts +0 -0
  425. /package/src/{entities/affected → affected}/index.ts +0 -0
  426. /package/src/{entities/branch → branch}/branch.types.ts +0 -0
  427. /package/src/{entities/branch → branch}/index.ts +0 -0
  428. /package/src/{entities/commit → commit}/commit.types.ts +0 -0
  429. /package/src/{entities/commit → commit}/index.ts +0 -0
  430. /package/src/{entities/commit → commit}/pr.test.ts +0 -0
  431. /package/src/{entities/commit → commit}/pr.ts +0 -0
  432. /package/src/{entities/compose → compose}/compose.test.ts +0 -0
  433. /package/src/{entities/compose → compose}/compose.ts +0 -0
  434. /package/src/{entities/compose → compose}/compose.types.ts +0 -0
  435. /package/src/{entities/compose → compose}/index.ts +0 -0
  436. /package/src/{entities/entities.shell.test.ts → entities.shell.test.ts} +0 -0
  437. /package/src/{entities/intershell-config → intershell-config}/intershell-config.test.ts +0 -0
  438. /package/src/{entities/package → package}/index.ts +0 -0
  439. /package/src/{entities/package → package}/package.shell.ts +0 -0
  440. /package/src/{entities/package → package}/package.test.ts +0 -0
  441. /package/src/{entities/package → package}/package.ts +0 -0
  442. /package/src/{entities/package → package}/package.types.ts +0 -0
  443. /package/src/{entities/package-changelog → package-changelog}/index.ts +0 -0
  444. /package/src/{entities/package-changelog → package-changelog}/package-changelog.ts +0 -0
  445. /package/src/{entities/package-changelog → package-changelog}/package-changelog.types.ts +0 -0
  446. /package/src/{entities/package-changelog → package-changelog}/template.default.ts +0 -0
  447. /package/src/{entities/package-changelog → package-changelog}/template.ts +0 -0
  448. /package/src/{entities/package-commits → package-commits}/dependency-analyzer.test.ts +0 -0
  449. /package/src/{entities/package-commits → package-commits}/dependency-analyzer.ts +0 -0
  450. /package/src/{entities/package-commits → package-commits}/index.ts +0 -0
  451. /package/src/{entities/package-commits → package-commits}/package-commits.test.ts +0 -0
  452. /package/src/{entities/package-commits → package-commits}/package-commits.ts +0 -0
  453. /package/src/{entities/package-tags → package-tags}/index.ts +0 -0
  454. /package/src/{entities/package-tags → package-tags}/package-tags.test.ts +0 -0
  455. /package/src/{entities/package-version → package-version}/index.ts +0 -0
  456. /package/src/{entities/package-version → package-version}/package-version.test.ts +0 -0
  457. /package/src/{entities/package-version → package-version}/package-version.ts +0 -0
  458. /package/src/{entities/package-version → package-version}/package-version.types.ts +0 -0
  459. /package/src/{entities/tag → tag}/index.ts +0 -0
  460. /package/src/{entities/tag → tag}/tag.test.ts +0 -0
  461. /package/src/{entities/tag → tag}/tag.types.ts +0 -0
@@ -1,85 +0,0 @@
1
- import { Command, Flags } from "@oclif/core";
2
- import { $ } from "bun";
3
- import { colorify } from "../../core";
4
- import { EntityTag } from "../../entities";
5
-
6
- export default class VersionCi extends Command {
7
- static description = "Complete CI versioning workflow: auth → prepare → apply";
8
-
9
- static examples = [
10
- "intershell version:ci",
11
- "intershell version:ci --dry-run",
12
- "intershell version:ci --no-push",
13
- ];
14
-
15
- static flags = {
16
- "no-push": Flags.boolean({
17
- char: "n",
18
- description: "Don't push tag to remote after creation",
19
- default: false,
20
- }),
21
- "dry-run": Flags.boolean({
22
- char: "d",
23
- description: "Show planned changes without applying them",
24
- default: false,
25
- }),
26
- };
27
-
28
- async run(): Promise<void> {
29
- const { flags } = await this.parse(VersionCi);
30
- this.log("🚀 Starting CI version workflow...");
31
-
32
- await this.configureGitAuth(flags);
33
-
34
- const fromTag = await EntityTag.getBaseCommitSha();
35
- this.log(`📝 Using base commit: ${colorify.blue(fromTag)}`);
36
-
37
- this.log("\n🔧 Preparing versions...");
38
- // Note: In a real implementation, you would call the prepare command here
39
- // For now, we'll just show what would happen
40
- this.log(`📝 Would run: intershell version:prepare --from ${fromTag}`);
41
-
42
- this.log("\n🚀 Applying version changes...");
43
- // Note: In a real implementation, you would call the apply command here
44
- // For now, we'll just show what would happen
45
- this.log(`📝 Would run: intershell version:apply${flags["no-push"] ? " --no-push" : ""}`);
46
-
47
- this.log(colorify.green("\n✅ CI version workflow completed successfully!"));
48
- }
49
-
50
- private async configureGitAuth(flags: {
51
- "dry-run"?: boolean;
52
- "no-push"?: boolean;
53
- }): Promise<void> {
54
- this.log("🔍 Configuring Git authentication...");
55
-
56
- if (flags["dry-run"]) {
57
- this.log("-> 🔍 Dry run, skipping git config");
58
- return;
59
- }
60
-
61
- if (!process.env.GITHUB_ACTIONS) {
62
- this.log("-> 🔍 Running locally, skip git config");
63
- return;
64
- }
65
-
66
- if (!process.env.GITHUB_REPOSITORY) {
67
- this.log("-> ⚠️ GITHUB_REPOSITORY not found");
68
- return;
69
- }
70
-
71
- if (!process.env.GITHUB_TOKEN) {
72
- this.log("-> ⚠️ GITHUB_TOKEN not found");
73
- return;
74
- }
75
-
76
- this.log("-> 🔐 Configuring Git authentication...");
77
- await $`git config user.name "github-actions[bot]"`;
78
- await $`git config user.email "github-actions[bot]@users.noreply.github.com"`;
79
- await $`git remote set-url origin https://x-access-token:${process.env.GITHUB_TOKEN}@github.com/${process.env.GITHUB_REPOSITORY}.git`;
80
-
81
- const actualRemoteUrl = await $`git remote get-url origin`.text();
82
- const maskedUrl = actualRemoteUrl.replace(/https:\/\/x-access-token:[^@]+@/, "***@");
83
- this.log(`-> 🔗 Git authentication configured, remote URL: ${maskedUrl}`);
84
- }
85
- }
@@ -1,223 +0,0 @@
1
- import fs from "node:fs";
2
- import { Command, Flags } from "@oclif/core";
3
- import { $ } from "bun";
4
- import { colorify } from "../../core";
5
- import {
6
- DefaultChangelogTemplate,
7
- EntityCompose,
8
- EntityPackage,
9
- EntityPackageChangelog,
10
- EntityPackageCommits,
11
- EntityPackageTags,
12
- EntityPackageVersion,
13
- type EntityPackageVersionBumpType,
14
- EntityTag,
15
- } from "../../entities";
16
-
17
- const bumpTypeOptions = ["major", "minor", "patch", "none"] as EntityPackageVersionBumpType[];
18
-
19
- export default class VersionPrepare extends Command {
20
- static description = "Prepare version bumps and generate changelogs for packages";
21
-
22
- static examples = [
23
- "intershell version:prepare",
24
- "intershell version:prepare --package root",
25
- "intershell version:prepare --from v1.0.0 --to HEAD",
26
- "intershell version:prepare --from-version 1.0.0 --to-version 1.2.0",
27
- "intershell version:prepare --package package-name --from-version 1.0.0",
28
- "intershell version:prepare --package root --bump-type major",
29
- "intershell version:prepare --bump-type patch",
30
- ];
31
-
32
- static flags = {
33
- package: Flags.string({
34
- char: "p",
35
- description: "Package name to process (default: all packages)",
36
- default: "root",
37
- }),
38
- from: Flags.string({
39
- char: "f",
40
- description: "Start commit/tag for changelog generation",
41
- }),
42
- to: Flags.string({
43
- char: "t",
44
- description: "End commit/tag for changelog generation (default: HEAD)",
45
- }),
46
- "from-version": Flags.string({
47
- description:
48
- "Start version for changelog generation (converts to appropriate tag based on package)",
49
- }),
50
- "to-version": Flags.string({
51
- description:
52
- "End version for changelog generation (converts to appropriate tag based on package)",
53
- }),
54
- "bump-type": Flags.string({
55
- description: "Override version bump type (major, minor, patch, none)",
56
- options: bumpTypeOptions,
57
- }),
58
- };
59
-
60
- async run(): Promise<void> {
61
- const { flags } = await this.parse(VersionPrepare);
62
- const packageName = flags.package || "root";
63
-
64
- this.log("🔍 Validating package configurations...");
65
- const validationResult = await EntityPackage.validateAllPackages();
66
- if (validationResult.length > 0) {
67
- this.error(
68
- `❌ Package validation failed!\nFound ${validationResult.length} validation errors:\n${validationResult.map((error) => ` 📦 ${error}`).join("\n")}`,
69
- );
70
- }
71
- this.log(colorify.green("✅ All packages passed validation"));
72
-
73
- const allVersionedPackages = await EntityPackage.getVersionedPackages();
74
- const packageInstance = new EntityPackage(packageName);
75
- const packageTags = new EntityPackageTags(packageInstance);
76
- const packageCommits = new EntityPackageCommits(packageInstance);
77
- const packageVersion = new EntityPackageVersion(packageInstance, packageCommits, packageTags);
78
- const prefix = packageInstance.getTagSeriesName();
79
-
80
- if (!allVersionedPackages.includes(packageName)) {
81
- throw new Error(
82
- `Package "${packageName}" should not be versioned (private package). Only versioned packages can be processed.`,
83
- );
84
- }
85
- if (!prefix) {
86
- throw new Error(
87
- `Tag series name not found for ${packageName}, this package should not be versioned (private package). Only versioned packages can be processed.`,
88
- );
89
- }
90
-
91
- this.log(`🚀 Starting version preparation for package ${colorify.blue(packageName)}`);
92
- const { fromCommit, toCommit } = await this.resolveCommitRange({
93
- packageTags,
94
- from: flags.from,
95
- to: flags.to,
96
- fromVersion: Array.isArray(flags["from-version"])
97
- ? flags["from-version"][0]
98
- : flags["from-version"],
99
- toVersion: Array.isArray(flags["to-version"]) ? flags["to-version"][0] : flags["to-version"],
100
- });
101
-
102
- const from =
103
- flags.from || flags["from-version"]
104
- ? fromCommit
105
- : await packageTags.getBaseTagShaForPackage();
106
-
107
- this.log(`📝 Generating changelog from ${colorify.blue(from)} to ${colorify.blue(toCommit)}`);
108
-
109
- // Get commits and version data using EntityPackageVersion
110
- const commits = await packageCommits.getCommitsInRange(from, toCommit);
111
- const overrideBumpType = flags["bump-type"] as "major" | "minor" | "patch" | "none" | undefined;
112
- const versionData = await packageVersion.calculateVersionData(commits, overrideBumpType);
113
-
114
- // Create changelog with commits
115
- const template = new DefaultChangelogTemplate(packageName, prefix);
116
- const changelog = new EntityPackageChangelog(packageInstance, commits, {
117
- template,
118
- versionData,
119
- versionMode: true,
120
- });
121
- const changelogContent = changelog.generateMergedChangelog();
122
-
123
- if (commits.length === 0) {
124
- this.log(colorify.yellow(`📦 ${packageName}: ${colorify.yellow("No commits found")}`));
125
- return;
126
- }
127
- if (!versionData.shouldBump) {
128
- this.log(
129
- colorify.yellow(
130
- `📦 ${packageName}: ${colorify.yellow("No version bump needed")} (${versionData.bumpType})`,
131
- ),
132
- );
133
- return;
134
- }
135
-
136
- this.log(
137
- `🔄 Updating package version from ${versionData.currentVersion} to ${versionData.targetVersion} in ${packageInstance.getJsonPath()}`,
138
- );
139
- await packageInstance.writeVersion(versionData.targetVersion);
140
- await $`bun install`;
141
- await packageInstance.writeChangelog(changelogContent);
142
-
143
- const tagName = `${prefix}${versionData.targetVersion}`;
144
- const versionCommitMessage = `release(${packageName}): ${tagName} [${versionData.bumpType}] (${versionData.currentVersion} => ${versionData.targetVersion})\n\n📝 Commits processed: ${commits.length}\n📝 Changelog updated: (${packageInstance.getChangelogPath()})`;
145
- this.log(
146
- `📦 (${colorify.yellow(versionData.currentVersion)} => ${colorify.green(versionData.targetVersion)}) ${colorify.blue(packageName)}: ${versionData.bumpType} (${colorify.green(packageInstance.getChangelogPath())})`,
147
- );
148
- await Bun.write(".git/COMMIT_EDITMSG", versionCommitMessage);
149
- this.log(
150
- `${colorify.green("📝 Commit message written in")} ${colorify.blue(".git/COMMIT_EDITMSG")}:`,
151
- `\n\t${versionCommitMessage.replace(/\n/g, "\n\t")}`,
152
- );
153
-
154
- try {
155
- const services = await new EntityCompose("docker-compose.yml").getServices();
156
- const servicesToDeploy = services.filter((s) => s.name === packageName).map((s) => s.name);
157
- if (servicesToDeploy) {
158
- const servicesToDeployNames = servicesToDeploy.join(",");
159
- if (process.env.GITHUB_OUTPUT) {
160
- await fs.promises.appendFile(
161
- process.env.GITHUB_OUTPUT,
162
- `packages-to-deploy=${servicesToDeployNames}\n`,
163
- );
164
- }
165
- this.log(`\n🚀 Packages to deploy: ${colorify.blue(servicesToDeployNames)}`);
166
- }
167
- } catch (error) {
168
- this.log(
169
- colorify.yellow(`📦 ${packageName}: ${colorify.yellow("No services found")}: ${error}`),
170
- );
171
- }
172
-
173
- this.log(
174
- "\n📝 Next steps:\n" +
175
- "1. Review the generated changelogs\n" +
176
- `2. Run ${colorify.blue("intershell version:apply")} to commit, tag and push the versions (you can turn it off using --no-push)`,
177
- );
178
- this.log(colorify.green("✅ Version preparation completed!"));
179
- }
180
-
181
- /**
182
- * Resolves from/to commits, handling version-to-tag conversion when needed
183
- */
184
- private async resolveCommitRange({
185
- packageTags,
186
- from,
187
- to,
188
- fromVersion,
189
- toVersion,
190
- }: {
191
- packageTags: EntityPackageTags;
192
- from?: string;
193
- to?: string;
194
- fromVersion?: string;
195
- toVersion?: string;
196
- }): Promise<{ fromCommit: string; toCommit: string }> {
197
- let fromCommit: string;
198
- let toCommit: string;
199
- // Handle --from-version conversion
200
- if (fromVersion) {
201
- const fromTag = `${await packageTags.getTagPrefix()}${fromVersion}`;
202
- this.log(`📝 Converting --from-version ${fromVersion} to tag: ${fromTag}`);
203
- fromCommit = await EntityTag.getBaseCommitSha(fromTag);
204
- } else if (from) {
205
- fromCommit = await EntityTag.getBaseCommitSha(from);
206
- } else {
207
- // No --from specified, let EntityPackageTags auto-find the correct base SHA
208
- // This will use the latest tag if it exists, or fall back to first commit for first-time versioning
209
- fromCommit = await packageTags.getBaseTagShaForPackage();
210
- }
211
-
212
- // Handle --to-version conversion
213
- if (toVersion) {
214
- const toTag = `${await packageTags.getTagPrefix()}${toVersion}`;
215
- this.log(`📝 Converting --to-version ${toVersion} to tag: ${toTag}`);
216
- toCommit = await EntityTag.getBaseCommitSha(toTag);
217
- } else {
218
- toCommit = to || "HEAD";
219
- }
220
-
221
- return { fromCommit, toCommit };
222
- }
223
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * Custom console coloring utility to replace chalk
3
- * Provides ANSI color codes for terminal output
4
- */
5
-
6
- // ANSI color codes
7
- const colors = {
8
- red: "\x1b[31m",
9
- green: "\x1b[32m",
10
- yellow: "\x1b[33m",
11
- blue: "\x1b[34m",
12
- cyan: "\x1b[36m",
13
- gray: "\x1b[90m",
14
- bold: "\x1b[1m",
15
- reset: "\x1b[0m",
16
- } as const;
17
-
18
- const createColorFunction = (colorCode: string) => {
19
- return (text: string): string => {
20
- return `${colorCode}${text}${colors.reset}`;
21
- };
22
- };
23
-
24
- /**
25
- * Console color utility that mimics chalk's API
26
- */
27
- export const colorify = {
28
- red: createColorFunction(colors.red),
29
- green: createColorFunction(colors.green),
30
- yellow: createColorFunction(colors.yellow),
31
- blue: createColorFunction(colors.blue),
32
- cyan: createColorFunction(colors.cyan),
33
- gray: createColorFunction(colors.gray),
34
- bold: createColorFunction(colors.bold),
35
- reset: colors.reset,
36
-
37
- supportsColor: (): boolean => {
38
- // Check if we're in a terminal that supports colors
39
- return process.stdout.isTTY && process.env.NO_COLOR !== "1";
40
- },
41
- disable: () => {
42
- Object.keys(colorify).forEach((key) => {
43
- if (typeof colorify[key as keyof typeof colorify] === "function") {
44
- (colorify as unknown as Record<string, (text: string) => string>)[key] = (text: string) =>
45
- text;
46
- }
47
- });
48
- },
49
- enable: () => {
50
- Object.keys(colors).forEach((key) => {
51
- if (key !== "reset") {
52
- (colorify as unknown as Record<string, (text: string) => string>)[key] =
53
- createColorFunction(colors[key as keyof typeof colors]);
54
- }
55
- });
56
- },
57
- } as const;
58
-
59
- if (!colorify.supportsColor()) {
60
- colorify.disable();
61
- }
package/src/core/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./colorify";
2
- export type * from "./types";
3
- export { createScript } from "./wrapshell";
package/src/core/types.ts DELETED
@@ -1,262 +0,0 @@
1
- /**
2
- * Core type definitions for the InterShell CLI framework
3
- */
4
-
5
- // Basic CLI types
6
- export interface KeyPress {
7
- sequence: string;
8
- name?: string;
9
- ctrl: boolean;
10
- meta: boolean;
11
- shift: boolean;
12
- }
13
-
14
- export interface ValidationResult<T = unknown> {
15
- isValid: boolean;
16
- value?: T;
17
- error?: string;
18
- warnings?: string[];
19
- }
20
-
21
- export interface ValidationError {
22
- message: string;
23
- field?: string;
24
- code?: string;
25
- }
26
-
27
- // Event system types
28
- export type EventHandler<T = unknown> = (data: T) => void | Promise<void>;
29
-
30
- export interface EventEmitter<TEvents extends Record<string, unknown> = Record<string, unknown>> {
31
- on<K extends keyof TEvents>(event: K, handler: EventHandler<TEvents[K]>): void;
32
- off<K extends keyof TEvents>(event: K, handler: EventHandler<TEvents[K]>): void;
33
- emit<K extends keyof TEvents>(event: K, data: TEvents[K]): void;
34
- }
35
-
36
- // State management types
37
- export type StateListener<TState> = (state: TState, prevState: TState) => void;
38
-
39
- export interface StateManager<TState> {
40
- getState(): TState;
41
- setState(newState: TState): void;
42
- subscribe(listener: StateListener<TState>): () => void;
43
- }
44
-
45
- // Script configuration types
46
- export type ArgOption = {
47
- short?: string; // pay attention, this turned optional! in affects the logic
48
- long: string;
49
- description: string;
50
- examples?: string[];
51
- } & (
52
- | {
53
- required: true;
54
- type: "string" | "boolean" | "number";
55
- validator: (value: string) => boolean | string | Promise<boolean | string>;
56
- }
57
- | {
58
- required: false;
59
- type: "string" | "boolean" | "number";
60
- defaultValue?: string | boolean | number;
61
- validator: (value: string) => boolean | string | Promise<boolean | string>;
62
- }
63
- | {
64
- required: true;
65
- type: "string[]" | "number[]"; // there is no multi boolean anymore, we must use type conditionals
66
- validator: (value: string[]) => boolean | string | Promise<boolean | string>;
67
- }
68
- | {
69
- required: false;
70
- type: "string[]" | "number[]";
71
- defaultValue?: string[] | number[];
72
- validator: (value: string[]) => boolean | string | Promise<boolean | string>;
73
- }
74
- );
75
-
76
- export interface ScriptConfig {
77
- name: string;
78
- description: string;
79
- usage?: string;
80
- examples?: string[];
81
- options: ArgOption[];
82
- }
83
-
84
- export type ScriptHandler<TConfig extends ScriptConfig> = (
85
- args: InferArgs<TConfig>,
86
- console: Console,
87
- ) => Promise<void> | void;
88
-
89
- export interface ScriptInstance<TConfig extends ScriptConfig> {
90
- config: TConfig;
91
- handler: ScriptHandler<TConfig>;
92
- run(args?: Partial<InferArgs<TConfig>>): Promise<void>;
93
- }
94
-
95
- // Utility type to infer argument types from config
96
- export type InferArgs<TConfig extends ScriptConfig> = {
97
- [K in TConfig["options"][number] as K["long"] extends `--${infer Name}`
98
- ? Name
99
- : never]: K extends { required: true; type: infer T }
100
- ? T extends "string[]" | "number[]"
101
- ? string[] | number[]
102
- : T extends "string"
103
- ? string
104
- : T extends "boolean"
105
- ? boolean
106
- : T extends "number"
107
- ? number
108
- : never
109
- : K extends { required: false; type: infer T; defaultValue: infer D }
110
- ? T extends "string[]" | "number[]"
111
- ? (string[] | number[]) | D
112
- : T extends "string"
113
- ? string | D
114
- : T extends "boolean"
115
- ? boolean | D
116
- : T extends "number"
117
- ? number | D
118
- : never
119
- : K extends { required: false; type: infer T }
120
- ? T extends "string[]" | "number[]"
121
- ? (string[] | number[]) | undefined
122
- : T extends "string"
123
- ? string | undefined
124
- : T extends "boolean"
125
- ? boolean | undefined
126
- : T extends "number"
127
- ? number | undefined
128
- : never
129
- : never;
130
- } & {
131
- verbose?: boolean;
132
- quiet?: boolean;
133
- "dry-run"?: boolean;
134
- help?: boolean;
135
- debug?: boolean;
136
- };
137
-
138
- // Hook system types
139
- export interface HookContext<TConfig extends ScriptConfig> {
140
- script: ScriptInstance<TConfig>;
141
- args: InferArgs<TConfig>;
142
- startTime: number;
143
- error?: Error;
144
- }
145
-
146
- export type Hook<TConfig extends ScriptConfig, TReturn = void> = (
147
- context: HookContext<TConfig>,
148
- ) => Promise<TReturn> | TReturn;
149
-
150
- export interface HookSystem<TConfig extends ScriptConfig> {
151
- beforeRun: Hook<TConfig>[];
152
- afterRun: Hook<TConfig, unknown>[];
153
- onError: Hook<TConfig>[];
154
- onValidation: Hook<TConfig, ValidationResult>[];
155
- }
156
-
157
- // Color system types
158
- export type ColorFunction = (text: string) => string;
159
-
160
- export interface ColorSystem {
161
- // Basic colors
162
- red: ColorFunction;
163
- green: ColorFunction;
164
- blue: ColorFunction;
165
- yellow: ColorFunction;
166
- cyan: ColorFunction;
167
- magenta: ColorFunction;
168
- white: ColorFunction;
169
- black: ColorFunction;
170
- gray: ColorFunction;
171
- grey: ColorFunction;
172
-
173
- // Styles
174
- bold: ColorFunction;
175
- italic: ColorFunction;
176
- underline: ColorFunction;
177
- strikethrough: ColorFunction;
178
-
179
- // Advanced colors
180
- rgb(r: number, g: number, b: number): ColorFunction;
181
- hsl(h: number, s: number, l: number): ColorFunction;
182
- hex(color: string): ColorFunction;
183
-
184
- // Effects
185
- gradient(colors: string[]): ColorFunction;
186
- rainbow: ColorFunction;
187
-
188
- // Utilities
189
- strip(text: string): string;
190
- supportsColor(): boolean;
191
- enable(): void;
192
- disable(): void;
193
- }
194
-
195
- // CLI Tools types
196
- export interface QuickAction {
197
- key: string;
198
- label: string;
199
- description: string;
200
- shortcut?: string;
201
- action: () => void | Promise<void>;
202
- }
203
-
204
- export interface SelectConfig {
205
- multiple?: boolean;
206
- clearScreen?: boolean;
207
- showCursor?: boolean;
208
- exitOnCtrlC?: boolean;
209
- quickActions?: QuickAction[];
210
- }
211
-
212
- export interface PromptConfig {
213
- clearScreen?: boolean;
214
- allowEmpty?: boolean;
215
- showCursor?: boolean;
216
- exitOnCtrlC?: boolean;
217
- quickActions?: QuickAction[];
218
- onLeft?: () => void;
219
- }
220
-
221
- export interface ConfirmConfig {
222
- clearScreen?: boolean;
223
- defaultValue?: boolean;
224
- exitOnCtrlC?: boolean;
225
- }
226
-
227
- // Interactive CLI types
228
- export interface InteractiveCLIOptions {
229
- enableRawMode?: boolean;
230
- exitOnCtrlC?: boolean;
231
- clearOnExit?: boolean;
232
- }
233
-
234
- export interface InteractiveCLI {
235
- // Core methods
236
- select(question: string, options: string[], config?: SelectConfig): Promise<string[]>;
237
- prompt(question: string, config?: PromptConfig): Promise<string>;
238
- confirm(question: string, config?: ConfirmConfig): Promise<boolean>;
239
-
240
- // Screen management
241
- clearScreen(): void;
242
- showCursor(): void;
243
- hideCursor(): void;
244
-
245
- // Event handling
246
- onKeyPress(callback: (key: KeyPress) => void): void;
247
- offKeyPress(callback: (key: KeyPress) => void): void;
248
-
249
- // Lifecycle
250
- cleanup(): void;
251
- }
252
-
253
- // Framework-specific types (will be extended by interactive package)
254
- export interface FrameworkOptions {
255
- debug?: boolean;
256
- logLevel?: "error" | "warn" | "info" | "debug";
257
- enableHotkeys?: boolean;
258
- enableHistory?: boolean;
259
- maxHistorySize?: number;
260
- renderMode?: "immediate" | "debounced" | "throttled";
261
- renderDelay?: number;
262
- }