pr-merge-queue 0.0.0-stage → 0.0.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 (331) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +125 -2
  3. package/dist/claim-pr/claim-pr.d.mts +45 -0
  4. package/dist/claim-pr/claim-pr.d.mts.map +1 -0
  5. package/dist/claim-pr/claim-pr.mjs +217 -0
  6. package/dist/claim-pr/claim-pr.mjs.map +1 -0
  7. package/dist/claim-pr/index.d.mts +2 -0
  8. package/dist/claim-pr/index.d.mts.map +1 -0
  9. package/dist/claim-pr/index.mjs +2 -0
  10. package/dist/claim-pr/index.mjs.map +1 -0
  11. package/dist/cmd/claim-pr.d.mts +3 -0
  12. package/dist/cmd/claim-pr.d.mts.map +1 -0
  13. package/dist/cmd/claim-pr.mjs +20 -0
  14. package/dist/cmd/claim-pr.mjs.map +1 -0
  15. package/dist/cmd/open-pr.d.mts +3 -0
  16. package/dist/cmd/open-pr.d.mts.map +1 -0
  17. package/dist/cmd/open-pr.mjs +20 -0
  18. package/dist/cmd/open-pr.mjs.map +1 -0
  19. package/dist/cmd/pr-report.d.mts +3 -0
  20. package/dist/cmd/pr-report.d.mts.map +1 -0
  21. package/dist/cmd/pr-report.mjs +20 -0
  22. package/dist/cmd/pr-report.mjs.map +1 -0
  23. package/dist/cmd/push-fixed-pr.d.mts +3 -0
  24. package/dist/cmd/push-fixed-pr.d.mts.map +1 -0
  25. package/dist/cmd/push-fixed-pr.mjs +20 -0
  26. package/dist/cmd/push-fixed-pr.mjs.map +1 -0
  27. package/dist/cmd/report-unowned-prs.d.mts +3 -0
  28. package/dist/cmd/report-unowned-prs.d.mts.map +1 -0
  29. package/dist/cmd/report-unowned-prs.mjs +20 -0
  30. package/dist/cmd/report-unowned-prs.mjs.map +1 -0
  31. package/dist/cmd/unblock-prs.d.mts +3 -0
  32. package/dist/cmd/unblock-prs.d.mts.map +1 -0
  33. package/dist/cmd/unblock-prs.mjs +19 -0
  34. package/dist/cmd/unblock-prs.mjs.map +1 -0
  35. package/dist/entry-point.d.mts +3 -0
  36. package/dist/entry-point.d.mts.map +1 -0
  37. package/dist/entry-point.mjs +3 -0
  38. package/dist/entry-point.mjs.map +1 -0
  39. package/dist/lib/cli-args.d.mts +27 -0
  40. package/dist/lib/cli-args.d.mts.map +1 -0
  41. package/dist/lib/cli-args.mjs +55 -0
  42. package/dist/lib/cli-args.mjs.map +1 -0
  43. package/dist/lib/github-api.d.mts +153 -0
  44. package/dist/lib/github-api.d.mts.map +1 -0
  45. package/dist/lib/github-api.mjs +291 -0
  46. package/dist/lib/github-api.mjs.map +1 -0
  47. package/dist/lib/index.d.mts +7 -0
  48. package/dist/lib/index.d.mts.map +1 -0
  49. package/dist/lib/index.mjs +7 -0
  50. package/dist/lib/index.mjs.map +1 -0
  51. package/dist/lib/json.d.mts +12 -0
  52. package/dist/lib/json.d.mts.map +1 -0
  53. package/dist/lib/json.mjs +28 -0
  54. package/dist/lib/json.mjs.map +1 -0
  55. package/dist/lib/log.d.mts +10 -0
  56. package/dist/lib/log.d.mts.map +1 -0
  57. package/dist/lib/log.mjs +13 -0
  58. package/dist/lib/log.mjs.map +1 -0
  59. package/dist/lib/shell.d.mts +18 -0
  60. package/dist/lib/shell.d.mts.map +1 -0
  61. package/dist/lib/shell.mjs +42 -0
  62. package/dist/lib/shell.mjs.map +1 -0
  63. package/dist/lib/time.d.mts +17 -0
  64. package/dist/lib/time.d.mts.map +1 -0
  65. package/dist/lib/time.mjs +35 -0
  66. package/dist/lib/time.mjs.map +1 -0
  67. package/dist/open-pr/github.d.mts +72 -0
  68. package/dist/open-pr/github.d.mts.map +1 -0
  69. package/dist/open-pr/github.mjs +249 -0
  70. package/dist/open-pr/github.mjs.map +1 -0
  71. package/dist/open-pr/index.d.mts +6 -0
  72. package/dist/open-pr/index.d.mts.map +1 -0
  73. package/dist/open-pr/index.mjs +6 -0
  74. package/dist/open-pr/index.mjs.map +1 -0
  75. package/dist/open-pr/main.d.mts +36 -0
  76. package/dist/open-pr/main.d.mts.map +1 -0
  77. package/dist/open-pr/main.mjs +204 -0
  78. package/dist/open-pr/main.mjs.map +1 -0
  79. package/dist/open-pr/options.d.mts +20 -0
  80. package/dist/open-pr/options.d.mts.map +1 -0
  81. package/dist/open-pr/options.mjs +66 -0
  82. package/dist/open-pr/options.mjs.map +1 -0
  83. package/dist/open-pr/steps.d.mts +23 -0
  84. package/dist/open-pr/steps.d.mts.map +1 -0
  85. package/dist/open-pr/steps.mjs +38 -0
  86. package/dist/open-pr/steps.mjs.map +1 -0
  87. package/dist/open-pr/types.d.mts +179 -0
  88. package/dist/open-pr/types.d.mts.map +1 -0
  89. package/dist/open-pr/types.mjs +20 -0
  90. package/dist/open-pr/types.mjs.map +1 -0
  91. package/dist/pr-report/github.d.mts +59 -0
  92. package/dist/pr-report/github.d.mts.map +1 -0
  93. package/dist/pr-report/github.mjs +561 -0
  94. package/dist/pr-report/github.mjs.map +1 -0
  95. package/dist/pr-report/index.d.mts +8 -0
  96. package/dist/pr-report/index.d.mts.map +1 -0
  97. package/dist/pr-report/index.mjs +8 -0
  98. package/dist/pr-report/index.mjs.map +1 -0
  99. package/dist/pr-report/linked-issues.d.mts +15 -0
  100. package/dist/pr-report/linked-issues.d.mts.map +1 -0
  101. package/dist/pr-report/linked-issues.mjs +39 -0
  102. package/dist/pr-report/linked-issues.mjs.map +1 -0
  103. package/dist/pr-report/main.d.mts +42 -0
  104. package/dist/pr-report/main.d.mts.map +1 -0
  105. package/dist/pr-report/main.mjs +163 -0
  106. package/dist/pr-report/main.mjs.map +1 -0
  107. package/dist/pr-report/options.d.mts +36 -0
  108. package/dist/pr-report/options.d.mts.map +1 -0
  109. package/dist/pr-report/options.mjs +90 -0
  110. package/dist/pr-report/options.mjs.map +1 -0
  111. package/dist/pr-report/queue.d.mts +28 -0
  112. package/dist/pr-report/queue.d.mts.map +1 -0
  113. package/dist/pr-report/queue.mjs +74 -0
  114. package/dist/pr-report/queue.mjs.map +1 -0
  115. package/dist/pr-report/render.d.mts +14 -0
  116. package/dist/pr-report/render.d.mts.map +1 -0
  117. package/dist/pr-report/render.mjs +318 -0
  118. package/dist/pr-report/render.mjs.map +1 -0
  119. package/dist/pr-report/repo-settings.d.mts +12 -0
  120. package/dist/pr-report/repo-settings.d.mts.map +1 -0
  121. package/dist/pr-report/repo-settings.mjs +22 -0
  122. package/dist/pr-report/repo-settings.mjs.map +1 -0
  123. package/dist/push-fixed-pr/index.d.mts +2 -0
  124. package/dist/push-fixed-pr/index.d.mts.map +1 -0
  125. package/dist/push-fixed-pr/index.mjs +2 -0
  126. package/dist/push-fixed-pr/index.mjs.map +1 -0
  127. package/dist/push-fixed-pr/push-fixed-pr.d.mts +54 -0
  128. package/dist/push-fixed-pr/push-fixed-pr.d.mts.map +1 -0
  129. package/dist/push-fixed-pr/push-fixed-pr.mjs +172 -0
  130. package/dist/push-fixed-pr/push-fixed-pr.mjs.map +1 -0
  131. package/dist/report-unowned-prs/index.d.mts +2 -0
  132. package/dist/report-unowned-prs/index.d.mts.map +1 -0
  133. package/dist/report-unowned-prs/index.mjs +2 -0
  134. package/dist/report-unowned-prs/index.mjs.map +1 -0
  135. package/dist/report-unowned-prs/report-unowned-prs.d.mts +49 -0
  136. package/dist/report-unowned-prs/report-unowned-prs.d.mts.map +1 -0
  137. package/dist/report-unowned-prs/report-unowned-prs.mjs +127 -0
  138. package/dist/report-unowned-prs/report-unowned-prs.mjs.map +1 -0
  139. package/dist/tsconfig.json +1 -0
  140. package/dist/unblock-prs/auto-fix.d.mts +45 -0
  141. package/dist/unblock-prs/auto-fix.d.mts.map +1 -0
  142. package/dist/unblock-prs/auto-fix.mjs +207 -0
  143. package/dist/unblock-prs/auto-fix.mjs.map +1 -0
  144. package/dist/unblock-prs/checks.d.mts +307 -0
  145. package/dist/unblock-prs/checks.d.mts.map +1 -0
  146. package/dist/unblock-prs/checks.mjs +372 -0
  147. package/dist/unblock-prs/checks.mjs.map +1 -0
  148. package/dist/unblock-prs/claims.d.mts +21 -0
  149. package/dist/unblock-prs/claims.d.mts.map +1 -0
  150. package/dist/unblock-prs/claims.mjs +23 -0
  151. package/dist/unblock-prs/claims.mjs.map +1 -0
  152. package/dist/unblock-prs/config.d.mts +487 -0
  153. package/dist/unblock-prs/config.d.mts.map +1 -0
  154. package/dist/unblock-prs/config.mjs +119 -0
  155. package/dist/unblock-prs/config.mjs.map +1 -0
  156. package/dist/unblock-prs/constants.d.mts +28 -0
  157. package/dist/unblock-prs/constants.d.mts.map +1 -0
  158. package/dist/unblock-prs/constants.mjs +28 -0
  159. package/dist/unblock-prs/constants.mjs.map +1 -0
  160. package/dist/unblock-prs/demotions.d.mts +42 -0
  161. package/dist/unblock-prs/demotions.d.mts.map +1 -0
  162. package/dist/unblock-prs/demotions.mjs +50 -0
  163. package/dist/unblock-prs/demotions.mjs.map +1 -0
  164. package/dist/unblock-prs/github.d.mts +739 -0
  165. package/dist/unblock-prs/github.d.mts.map +1 -0
  166. package/dist/unblock-prs/github.mjs +626 -0
  167. package/dist/unblock-prs/github.mjs.map +1 -0
  168. package/dist/unblock-prs/index.d.mts +25 -0
  169. package/dist/unblock-prs/index.d.mts.map +1 -0
  170. package/dist/unblock-prs/index.mjs +25 -0
  171. package/dist/unblock-prs/index.mjs.map +1 -0
  172. package/dist/unblock-prs/labels.d.mts +49 -0
  173. package/dist/unblock-prs/labels.d.mts.map +1 -0
  174. package/dist/unblock-prs/labels.mjs +49 -0
  175. package/dist/unblock-prs/labels.mjs.map +1 -0
  176. package/dist/unblock-prs/main.d.mts +179 -0
  177. package/dist/unblock-prs/main.d.mts.map +1 -0
  178. package/dist/unblock-prs/main.mjs +640 -0
  179. package/dist/unblock-prs/main.mjs.map +1 -0
  180. package/dist/unblock-prs/merge-after.d.mts +46 -0
  181. package/dist/unblock-prs/merge-after.d.mts.map +1 -0
  182. package/dist/unblock-prs/merge-after.mjs +65 -0
  183. package/dist/unblock-prs/merge-after.mjs.map +1 -0
  184. package/dist/unblock-prs/options.d.mts +35 -0
  185. package/dist/unblock-prs/options.d.mts.map +1 -0
  186. package/dist/unblock-prs/options.mjs +88 -0
  187. package/dist/unblock-prs/options.mjs.map +1 -0
  188. package/dist/unblock-prs/owner.d.mts +32 -0
  189. package/dist/unblock-prs/owner.d.mts.map +1 -0
  190. package/dist/unblock-prs/owner.mjs +63 -0
  191. package/dist/unblock-prs/owner.mjs.map +1 -0
  192. package/dist/unblock-prs/quiet.d.mts +21 -0
  193. package/dist/unblock-prs/quiet.d.mts.map +1 -0
  194. package/dist/unblock-prs/quiet.mjs +42 -0
  195. package/dist/unblock-prs/quiet.mjs.map +1 -0
  196. package/dist/unblock-prs/rebase.d.mts +120 -0
  197. package/dist/unblock-prs/rebase.d.mts.map +1 -0
  198. package/dist/unblock-prs/rebase.mjs +576 -0
  199. package/dist/unblock-prs/rebase.mjs.map +1 -0
  200. package/dist/unblock-prs/release.d.mts +62 -0
  201. package/dist/unblock-prs/release.d.mts.map +1 -0
  202. package/dist/unblock-prs/release.mjs +94 -0
  203. package/dist/unblock-prs/release.mjs.map +1 -0
  204. package/dist/unblock-prs/set-aside-comment.d.mts +20 -0
  205. package/dist/unblock-prs/set-aside-comment.d.mts.map +1 -0
  206. package/dist/unblock-prs/set-aside-comment.mjs +93 -0
  207. package/dist/unblock-prs/set-aside-comment.mjs.map +1 -0
  208. package/dist/unblock-prs/set-aside-detail.d.mts +41 -0
  209. package/dist/unblock-prs/set-aside-detail.d.mts.map +1 -0
  210. package/dist/unblock-prs/set-aside-detail.mjs +56 -0
  211. package/dist/unblock-prs/set-aside-detail.mjs.map +1 -0
  212. package/dist/unblock-prs/skips.d.mts +85 -0
  213. package/dist/unblock-prs/skips.d.mts.map +1 -0
  214. package/dist/unblock-prs/skips.mjs +141 -0
  215. package/dist/unblock-prs/skips.mjs.map +1 -0
  216. package/dist/unblock-prs/stack.d.mts +98 -0
  217. package/dist/unblock-prs/stack.d.mts.map +1 -0
  218. package/dist/unblock-prs/stack.mjs +141 -0
  219. package/dist/unblock-prs/stack.mjs.map +1 -0
  220. package/dist/unblock-prs/triage.d.mts +28 -0
  221. package/dist/unblock-prs/triage.d.mts.map +1 -0
  222. package/dist/unblock-prs/triage.mjs +396 -0
  223. package/dist/unblock-prs/triage.mjs.map +1 -0
  224. package/dist/unblock-prs/types.d.mts +793 -0
  225. package/dist/unblock-prs/types.d.mts.map +1 -0
  226. package/dist/unblock-prs/types.mjs +26 -0
  227. package/dist/unblock-prs/types.mjs.map +1 -0
  228. package/dist/unblock-prs/util.d.mts +23 -0
  229. package/dist/unblock-prs/util.d.mts.map +1 -0
  230. package/dist/unblock-prs/util.mjs +60 -0
  231. package/dist/unblock-prs/util.mjs.map +1 -0
  232. package/dist/unblock-prs/version-pr.d.mts +57 -0
  233. package/dist/unblock-prs/version-pr.d.mts.map +1 -0
  234. package/dist/unblock-prs/version-pr.mjs +79 -0
  235. package/dist/unblock-prs/version-pr.mjs.map +1 -0
  236. package/dist/unblock-prs/watch.d.mts +17 -0
  237. package/dist/unblock-prs/watch.d.mts.map +1 -0
  238. package/dist/unblock-prs/watch.mjs +128 -0
  239. package/dist/unblock-prs/watch.mjs.map +1 -0
  240. package/package.json +118 -3
  241. package/src/claim-pr/claim-pr.mts +380 -0
  242. package/src/claim-pr/claim-pr.test.mts +176 -0
  243. package/src/claim-pr/index.mts +1 -0
  244. package/src/cmd/claim-pr.mts +32 -0
  245. package/src/cmd/open-pr.mts +28 -0
  246. package/src/cmd/pr-report.mts +28 -0
  247. package/src/cmd/push-fixed-pr.mts +36 -0
  248. package/src/cmd/report-unowned-prs.mts +37 -0
  249. package/src/cmd/unblock-prs.mts +24 -0
  250. package/src/entry-point.mts +3 -0
  251. package/src/lib/cli-args.mts +86 -0
  252. package/src/lib/cli-args.test.mts +92 -0
  253. package/src/lib/github-api.mts +463 -0
  254. package/src/lib/github-api.test.mts +40 -0
  255. package/src/lib/index.mts +6 -0
  256. package/src/lib/json.mts +43 -0
  257. package/src/lib/json.test.mts +34 -0
  258. package/src/lib/log.mts +19 -0
  259. package/src/lib/log.test.mts +45 -0
  260. package/src/lib/shell.mts +52 -0
  261. package/src/lib/time.mts +49 -0
  262. package/src/open-pr/README.md +237 -0
  263. package/src/open-pr/github.mts +444 -0
  264. package/src/open-pr/index.mts +5 -0
  265. package/src/open-pr/main.mts +327 -0
  266. package/src/open-pr/options.mts +101 -0
  267. package/src/open-pr/options.test.mts +67 -0
  268. package/src/open-pr/steps.mts +57 -0
  269. package/src/open-pr/steps.test.mts +59 -0
  270. package/src/open-pr/types.mts +42 -0
  271. package/src/pr-report/README.md +244 -0
  272. package/src/pr-report/github.mts +911 -0
  273. package/src/pr-report/index.mts +7 -0
  274. package/src/pr-report/linked-issues.mts +51 -0
  275. package/src/pr-report/linked-issues.test.mts +65 -0
  276. package/src/pr-report/main.mts +257 -0
  277. package/src/pr-report/options.mts +140 -0
  278. package/src/pr-report/queue.mts +125 -0
  279. package/src/pr-report/render.mts +428 -0
  280. package/src/pr-report/render.test.mts +379 -0
  281. package/src/pr-report/repo-settings.mts +34 -0
  282. package/src/push-fixed-pr/index.mts +1 -0
  283. package/src/push-fixed-pr/push-fixed-pr.mts +276 -0
  284. package/src/push-fixed-pr/push-fixed-pr.test.mts +228 -0
  285. package/src/report-unowned-prs/index.mts +1 -0
  286. package/src/report-unowned-prs/report-unowned-prs.mts +190 -0
  287. package/src/report-unowned-prs/report-unowned-prs.test.mts +87 -0
  288. package/src/unblock-prs/README.md +1616 -0
  289. package/src/unblock-prs/auto-fix.mts +334 -0
  290. package/src/unblock-prs/auto-fix.test.mts +159 -0
  291. package/src/unblock-prs/checks.mts +538 -0
  292. package/src/unblock-prs/checks.test.mts +507 -0
  293. package/src/unblock-prs/claims.mts +33 -0
  294. package/src/unblock-prs/claims.test.mts +64 -0
  295. package/src/unblock-prs/config.mts +187 -0
  296. package/src/unblock-prs/config.schema.json +71 -0
  297. package/src/unblock-prs/config.test.mts +139 -0
  298. package/src/unblock-prs/constants.mts +33 -0
  299. package/src/unblock-prs/demotions.mts +73 -0
  300. package/src/unblock-prs/demotions.test.mts +100 -0
  301. package/src/unblock-prs/github.mts +1042 -0
  302. package/src/unblock-prs/github.test.mts +84 -0
  303. package/src/unblock-prs/index.mts +24 -0
  304. package/src/unblock-prs/labels.mts +70 -0
  305. package/src/unblock-prs/main.mts +1051 -0
  306. package/src/unblock-prs/merge-after.mts +117 -0
  307. package/src/unblock-prs/merge-after.test.mts +120 -0
  308. package/src/unblock-prs/options.mts +157 -0
  309. package/src/unblock-prs/owner.mts +91 -0
  310. package/src/unblock-prs/owner.test.mts +114 -0
  311. package/src/unblock-prs/quiet.mts +62 -0
  312. package/src/unblock-prs/quiet.test.mts +175 -0
  313. package/src/unblock-prs/rebase.mts +962 -0
  314. package/src/unblock-prs/release.mts +149 -0
  315. package/src/unblock-prs/release.test.mts +209 -0
  316. package/src/unblock-prs/set-aside-comment.mts +143 -0
  317. package/src/unblock-prs/set-aside-comment.test.mts +148 -0
  318. package/src/unblock-prs/set-aside-detail.mts +82 -0
  319. package/src/unblock-prs/set-aside-detail.test.mts +131 -0
  320. package/src/unblock-prs/skips.mts +215 -0
  321. package/src/unblock-prs/skips.test.mts +280 -0
  322. package/src/unblock-prs/stack.mts +220 -0
  323. package/src/unblock-prs/stack.test.mts +449 -0
  324. package/src/unblock-prs/triage.mts +669 -0
  325. package/src/unblock-prs/triage.test.mts +100 -0
  326. package/src/unblock-prs/types.mts +358 -0
  327. package/src/unblock-prs/util.mts +78 -0
  328. package/src/unblock-prs/util.test.mts +26 -0
  329. package/src/unblock-prs/version-pr.mts +112 -0
  330. package/src/unblock-prs/version-pr.test.mts +78 -0
  331. package/src/unblock-prs/watch.mts +219 -0
@@ -0,0 +1,23 @@
1
+ /** What the observed state allows, and nothing that talks to GitHub. */
2
+ /**
3
+ * The `Merge-After:` line for a chained pull request, or `undefined` when
4
+ * nothing was declared. One line, in the order given, which is the form
5
+ * `unblock-prs` reads.
6
+ */
7
+ export declare const mergeAfterTrailer: (numbers: readonly number[]) => string | undefined;
8
+ /**
9
+ * What to declare with `Merge-After:`: what was asked for, and — for a pull
10
+ * request stacked on another — that one first. The base already says it, and
11
+ * `unblock-prs` and the reports read the base alone; the trailer is written
12
+ * as well so that the order is stated in the body like every other, and
13
+ * survives the base being moved by hand.
14
+ */
15
+ export declare const withStackParent: (mergeAfter: readonly number[], parent: number | undefined) => readonly number[];
16
+ /**
17
+ * `body` with `numbers` declared in it as well: added to the `Merge-After:`
18
+ * line it opens with, which is where this command writes one, or in a line
19
+ * of their own before it. The numbers are what the issues it closes start
20
+ * after and the body does not yet say (`openPullRequest`).
21
+ */
22
+ export declare const withInheritedMergeAfter: (body: string, numbers: readonly number[]) => string;
23
+ //# sourceMappingURL=steps.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.d.mts","sourceRoot":"","sources":["../../src/open-pr/steps.mts"],"names":[],"mappings":"AAAA,wEAAwE;AAIxE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,YACnB,SAAS,MAAM,EAAE,KACzB,MAAM,GAAG,SAGG,CAAC;AAEhB;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,eACd,SAAS,MAAM,EAAE,UACrB,MAAM,GAAG,SAAS,KACzB,SAAS,MAAM,EAGiC,CAAC;AAEpD;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,SAC5B,MAAM,WACH,SAAS,MAAM,EAAE,KACzB,MAgBF,CAAC"}
@@ -0,0 +1,38 @@
1
+
2
+ import { Arr } from 'ts-data-forge';
3
+
4
+
5
+
6
+
7
+
8
+ export const mergeAfterTrailer = (numbers) => Arr.isNonEmpty(numbers)
9
+ ? `Merge-After: ${numbers.map((n) => `#${n}`).join(', ')}`
10
+ : undefined;
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+ export const withStackParent = (mergeAfter, parent) => parent === undefined
19
+ ? mergeAfter
20
+ : Arr.uniq(Arr.toUnshifted(parent)(mergeAfter));
21
+
22
+
23
+
24
+
25
+
26
+
27
+ export const withInheritedMergeAfter = (body, numbers) => {
28
+ const trailer = mergeAfterTrailer(numbers);
29
+ if (trailer === undefined) {
30
+ return body;
31
+ }
32
+ const [first = '', ...rest] = body.split('\n');
33
+ if (/^merge-after\s*:/iu.test(first)) {
34
+ return Arr.toUnshifted(`${first.trimEnd()}, ${numbers.map((n) => `#${n}`).join(', ')}`)(rest).join('\n');
35
+ }
36
+ return body === '' ? `${trailer}\n` : `${trailer}\n\n${body}`;
37
+ };
38
+ //# sourceMappingURL=steps.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"steps.mjs","sourceRoot":"","sources":["../../src/open-pr/steps.mts"],"names":[],"mappings":"AAAA,wEAAwE;AAExE,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,OAA0B,EACN,EAAE,CACtB,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;IACrB,CAAC,CAAE,gBAAgB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAY;IACrE,CAAC,CAAC,SAAS,CAAC;AAEhB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,UAA6B,EAC7B,MAA0B,EACP,EAAE,CACrB,MAAM,KAAK,SAAS;IAClB,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,IAAY,EACZ,OAA0B,EAClB,EAAE;IACV,MAAM,OAAO,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE3C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,KAAK,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAE/C,IAAI,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO,GAAG,CAAC,WAAW,CACpB,GAAG,KAAK,CAAC,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,IAAI,EAAE,CAAC;AAChE,CAAC,CAAC"}
@@ -0,0 +1,179 @@
1
+ /** The shapes this command passes around, and what the API answers with. */
2
+ import * as t from 'ts-fortress';
3
+ /**
4
+ * The fields the run needs, and no more. Deliberately smaller than
5
+ * `unblock-prs`'s pull request: this command decides two things — whether
6
+ * the pull request exists, and whether it is a draft — and asking for less
7
+ * keeps what a failure can be about small.
8
+ *
9
+ * `nodeId` is here because taking a pull request out of draft is a GraphQL
10
+ * mutation, which addresses it by node id rather than by number. It is
11
+ * carried on the read that already happens rather than fetched again.
12
+ */
13
+ export type PullRequest = Readonly<{
14
+ number: number;
15
+ nodeId: string;
16
+ isDraft: boolean;
17
+ }>;
18
+ /**
19
+ * What `GET /repos/{owner}/{repo}/pulls[/{number}]` answers with, in the
20
+ * REST API's own names. Only the fields above are declared; everything else
21
+ * in that response is ignored.
22
+ */
23
+ export declare const PullRequestResponseSchema: Readonly<{
24
+ typeName: string;
25
+ defaultValue: Readonly<{
26
+ draft: boolean;
27
+ node_id: string;
28
+ number: number;
29
+ }>;
30
+ is: (a: unknown) => a is Readonly<{
31
+ draft: boolean;
32
+ node_id: string;
33
+ number: number;
34
+ }>;
35
+ assertIs: (a: unknown) => asserts a is Readonly<{
36
+ draft: boolean;
37
+ node_id: string;
38
+ number: number;
39
+ }>;
40
+ cast: (a: unknown) => Readonly<{
41
+ draft: boolean;
42
+ node_id: string;
43
+ number: number;
44
+ }>;
45
+ fill: (a: unknown) => Readonly<{
46
+ draft: boolean;
47
+ node_id: string;
48
+ number: number;
49
+ }>;
50
+ prune: <B extends Readonly<{
51
+ draft: boolean;
52
+ node_id: string;
53
+ number: number;
54
+ }>>(a: B) => Readonly<{
55
+ draft: boolean;
56
+ node_id: string;
57
+ number: number;
58
+ }>;
59
+ validate: (a: unknown) => t.Result<Readonly<{
60
+ draft: boolean;
61
+ node_id: string;
62
+ number: number;
63
+ }>, readonly Readonly<{
64
+ path: readonly string[];
65
+ actualValue: unknown;
66
+ expectedType: string;
67
+ typeName: string;
68
+ details?: t.ValidationErrorDetails | undefined;
69
+ }>[]>;
70
+ structure?: t.TypeStructure;
71
+ annotations?: t.TypeAnnotations;
72
+ optional?: true;
73
+ }> & Readonly<{
74
+ shape: {
75
+ readonly number: t.ConstrainedType<number, Readonly<{
76
+ readonly finite: undefined;
77
+ readonly int: undefined;
78
+ readonly safeInteger: undefined;
79
+ readonly nonZero: undefined;
80
+ readonly negative: undefined;
81
+ readonly nonNegative: undefined;
82
+ readonly positive: undefined;
83
+ readonly nonPositive: undefined;
84
+ readonly gt: undefined;
85
+ readonly gte: undefined;
86
+ readonly min: undefined;
87
+ readonly lt: undefined;
88
+ readonly lte: undefined;
89
+ readonly max: undefined;
90
+ readonly multipleOf: undefined;
91
+ readonly step: undefined;
92
+ }>>;
93
+ readonly node_id: t.ConstrainedType<string, Readonly<{
94
+ readonly nonempty: undefined;
95
+ readonly minLength: undefined;
96
+ readonly maxLength: undefined;
97
+ readonly startsWith: undefined;
98
+ readonly endsWith: undefined;
99
+ readonly includes: undefined;
100
+ readonly uppercase: undefined;
101
+ readonly lowercase: undefined;
102
+ readonly regex: undefined;
103
+ }>>;
104
+ readonly draft: Readonly<{
105
+ typeName: string;
106
+ defaultValue: boolean;
107
+ is: (a: unknown) => a is boolean;
108
+ assertIs: (a: unknown) => asserts a is boolean;
109
+ cast: (a: unknown) => boolean;
110
+ fill: (a: unknown) => boolean;
111
+ prune: <B extends boolean>(a: B) => boolean;
112
+ validate: (a: unknown) => t.Result<boolean, readonly Readonly<{
113
+ path: readonly string[];
114
+ actualValue: unknown;
115
+ expectedType: string;
116
+ typeName: string;
117
+ details?: t.ValidationErrorDetails | undefined;
118
+ }>[]>;
119
+ structure?: t.TypeStructure;
120
+ annotations?: t.TypeAnnotations;
121
+ optional?: true;
122
+ }>;
123
+ };
124
+ }>;
125
+ export declare const PullRequestListResponseSchema: Readonly<{
126
+ typeName: string;
127
+ defaultValue: readonly Readonly<{
128
+ draft: boolean;
129
+ node_id: string;
130
+ number: number;
131
+ }>[];
132
+ is: (a: unknown) => a is readonly Readonly<{
133
+ draft: boolean;
134
+ node_id: string;
135
+ number: number;
136
+ }>[];
137
+ assertIs: (a: unknown) => asserts a is readonly Readonly<{
138
+ draft: boolean;
139
+ node_id: string;
140
+ number: number;
141
+ }>[];
142
+ cast: (a: unknown) => readonly Readonly<{
143
+ draft: boolean;
144
+ node_id: string;
145
+ number: number;
146
+ }>[];
147
+ fill: (a: unknown) => readonly Readonly<{
148
+ draft: boolean;
149
+ node_id: string;
150
+ number: number;
151
+ }>[];
152
+ prune: <B extends readonly Readonly<{
153
+ draft: boolean;
154
+ node_id: string;
155
+ number: number;
156
+ }>[]>(a: B) => readonly Readonly<{
157
+ draft: boolean;
158
+ node_id: string;
159
+ number: number;
160
+ }>[];
161
+ validate: (a: unknown) => t.Result<readonly Readonly<{
162
+ draft: boolean;
163
+ node_id: string;
164
+ number: number;
165
+ }>[], readonly Readonly<{
166
+ path: readonly string[];
167
+ actualValue: unknown;
168
+ expectedType: string;
169
+ typeName: string;
170
+ details?: t.ValidationErrorDetails | undefined;
171
+ }>[]>;
172
+ structure?: t.TypeStructure;
173
+ annotations?: t.TypeAnnotations;
174
+ optional?: true;
175
+ }>;
176
+ export type PullRequestResponse = t.TypeOf<typeof PullRequestResponseSchema>;
177
+ /** The REST response in this command's own terms. */
178
+ export declare const toPullRequest: (response: PullRequestResponse) => PullRequest;
179
+ //# sourceMappingURL=types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/open-pr/types.mts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAEjC;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIpC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC,CAAC;AAEhF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE7E,qDAAqD;AACrD,eAAO,MAAM,aAAa,aAAc,mBAAmB,KAAG,WAKjD,CAAC"}
@@ -0,0 +1,20 @@
1
+
2
+ import * as t from 'ts-fortress';
3
+
4
+
5
+
6
+
7
+
8
+ export const PullRequestResponseSchema = t.record({
9
+ number: t.number(),
10
+ node_id: t.string(),
11
+ draft: t.boolean(),
12
+ });
13
+ export const PullRequestListResponseSchema = t.array(PullRequestResponseSchema);
14
+
15
+ export const toPullRequest = (response) => ({
16
+ number: response.number,
17
+ nodeId: response.node_id,
18
+ isDraft: response.draft,
19
+ });
20
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/open-pr/types.mts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,CAAC,MAAM,aAAa,CAAC;AAkBjC;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;AAIhF,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAA6B,EAAe,EAAE,CAC1E,CAAC;IACC,MAAM,EAAE,QAAQ,CAAC,MAAM;IACvB,MAAM,EAAE,QAAQ,CAAC,OAAO;IACxB,OAAO,EAAE,QAAQ,CAAC,KAAK;CACxB,CAAU,CAAC"}
@@ -0,0 +1,59 @@
1
+ /** Everything that talks to GitHub, and nothing that decides. */
2
+ import { type MergedPullRequest, type OpenIssue, type PullRequestFacts, type QueueComments, type ReferenceStatus, type RepoRef } from 'pr-report-core';
3
+ import { Result } from 'ts-data-forge';
4
+ export type Client = Readonly<{
5
+ /** Whether a token was found, which decides how much can be read. */
6
+ authenticated: boolean;
7
+ /** What pull requests target unless they are stacked. */
8
+ defaultBranch: (repo: RepoRef) => Promise<Result<string, string>>;
9
+ /**
10
+ * The contexts GitHub requires on `branch`, every ruleset that applies to
11
+ * it together (`pr-report-core`'s `requirementsOfRules`).
12
+ */
13
+ requiredContexts: (repo: RepoRef, branch: string) => Promise<Result<readonly string[], string>>;
14
+ facts: (repo: RepoRef) => Promise<Result<readonly PullRequestFacts[], string>>;
15
+ /**
16
+ * The pull requests that landed in the last `withinDays` days, newest
17
+ * first. One request: the closed list, sorted by when it last changed.
18
+ */
19
+ merged: (repo: RepoRef, withinDays: number, limit: number) => Promise<Result<readonly MergedPullRequest[], string>>;
20
+ /**
21
+ * What the queue's comments say on each of `pulls` — the set-aside comment
22
+ * `unblock-prs` writes and the claim of whoever is fixing it — by the
23
+ * token's own account, which is what both are trusted by. Empty without a
24
+ * token, or one whose account cannot be read.
25
+ */
26
+ queueComments: (repo: RepoRef, defaultBranch: string, pulls: readonly PullRequestFacts[]) => Promise<ReadonlyMap<number, QueueComments>>;
27
+ /** The open issues, most recently updated first, at most `limit`. */
28
+ issues: (repo: RepoRef, limit: number) => Promise<Result<readonly OpenIssue[], string>>;
29
+ /**
30
+ * Whether each of `numbers` is an open issue, and what its body declares
31
+ * with `Start-After:`: one request each, for the issues the open pull
32
+ * requests close that the open list did not cover. One that cannot be read
33
+ * is left out, and declares nothing.
34
+ */
35
+ issueBodies: (repo: RepoRef, numbers: readonly number[]) => Promise<ReadonlyMap<number, IssueBody>>;
36
+ /**
37
+ * Where each of `numbers` — what the issues' `Start-After:` names beyond
38
+ * the open lists — stands: one request each, an issue or a pull request
39
+ * alike. One that cannot be read is left out, and is unknown.
40
+ */
41
+ references: (repo: RepoRef, numbers: readonly number[]) => Promise<ReadonlyMap<number, ReferenceStatus>>;
42
+ }>;
43
+ /** What {@link Client.issueBodies} reads of one issue. */
44
+ export type IssueBody = Readonly<{
45
+ open: boolean;
46
+ startAfter: readonly number[];
47
+ }>;
48
+ /**
49
+ * A client for the public REST API, using a token when one is in the
50
+ * environment and going without when there is not.
51
+ *
52
+ * Unauthenticated works because the repository is public, and one report a
53
+ * day fits inside the 60 requests an hour an anonymous caller gets — roughly
54
+ * three per pull request, for the comparison and the two kinds of check.
55
+ * A token raises that to 5000 and, through one GraphQL query, replaces the
56
+ * issue links read out of the bodies with the ones GitHub itself holds.
57
+ */
58
+ export declare const createClient: (token: string | undefined, baseUrl?: string) => Client;
59
+ //# sourceMappingURL=github.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"github.d.mts","sourceRoot":"","sources":["../../src/pr-report/github.mts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,OAAO,EAeL,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAO,MAAM,EAAE,MAAM,eAAe,CAAC;AAmM5C,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;IAC5B,qEAAqE;IACrE,aAAa,EAAE,OAAO,CAAC;IACvB,yDAAyD;IACzD,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAClE;;;OAGG;IACH,gBAAgB,EAAE,CAChB,IAAI,EAAE,OAAO,EACb,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,MAAM,CAAC,SAAS,MAAM,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IAChD,KAAK,EAAE,CACL,IAAI,EAAE,OAAO,KACV,OAAO,CAAC,MAAM,CAAC,SAAS,gBAAgB,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1D;;;OAGG;IACH,MAAM,EAAE,CACN,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,MAAM,CAAC,SAAS,iBAAiB,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3D;;;;;OAKG;IACH,aAAa,EAAE,CACb,IAAI,EAAE,OAAO,EACb,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,SAAS,gBAAgB,EAAE,KAC/B,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;IACjD,qEAAqE;IACrE,MAAM,EAAE,CACN,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,MAAM,KACV,OAAO,CAAC,MAAM,CAAC,SAAS,SAAS,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC;IACnD;;;;;OAKG;IACH,WAAW,EAAE,CACX,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,SAAS,MAAM,EAAE,KACvB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;IAC7C;;;;OAIG;IACH,UAAU,EAAE,CACV,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,SAAS,MAAM,EAAE,KACvB,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;CACpD,CAAC,CAAC;AAEH,0DAA0D;AAC1D,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,UAChB,MAAM,GAAG,SAAS,uBAExB,MAglBF,CAAC"}