skuba 11.2.0-lfs-20250711073350 → 12.0.0-enable-js-extensions-20250711051149

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 (412) hide show
  1. package/lib/api/buildkite/annotate.js +2 -2
  2. package/lib/api/buildkite/annotate.js.map +1 -1
  3. package/lib/api/buildkite/index.d.ts +3 -3
  4. package/lib/api/buildkite/index.js +2 -2
  5. package/lib/api/buildkite/index.js.map +1 -1
  6. package/lib/api/git/commitAllChanges.d.ts +2 -2
  7. package/lib/api/git/commitAllChanges.js +3 -3
  8. package/lib/api/git/commitAllChanges.js.map +1 -1
  9. package/lib/api/git/getChangedFiles.js +3 -20
  10. package/lib/api/git/getChangedFiles.js.map +3 -3
  11. package/lib/api/git/index.d.ts +12 -12
  12. package/lib/api/git/index.js +11 -11
  13. package/lib/api/git/index.js.map +1 -1
  14. package/lib/api/git/pull.js +2 -2
  15. package/lib/api/git/pull.js.map +1 -1
  16. package/lib/api/git/push.js +2 -2
  17. package/lib/api/git/push.js.map +1 -1
  18. package/lib/api/git/reset.js +1 -1
  19. package/lib/api/git/reset.js.map +1 -1
  20. package/lib/api/github/checkRun.js +4 -4
  21. package/lib/api/github/checkRun.js.map +1 -1
  22. package/lib/api/github/environment.js +1 -1
  23. package/lib/api/github/environment.js.map +1 -1
  24. package/lib/api/github/index.d.ts +7 -7
  25. package/lib/api/github/index.js +6 -6
  26. package/lib/api/github/index.js.map +1 -1
  27. package/lib/api/github/issueComment.js +4 -4
  28. package/lib/api/github/issueComment.js.map +1 -1
  29. package/lib/api/github/pullRequest.js +3 -3
  30. package/lib/api/github/pullRequest.js.map +1 -1
  31. package/lib/api/github/push.d.ts +1 -1
  32. package/lib/api/github/push.js +3 -3
  33. package/lib/api/github/push.js.map +1 -1
  34. package/lib/api/jest/index.js +2 -2
  35. package/lib/api/jest/index.js.map +1 -1
  36. package/lib/api/net/compose.js +1 -1
  37. package/lib/api/net/compose.js.map +1 -1
  38. package/lib/api/net/index.d.ts +1 -1
  39. package/lib/api/net/index.js +1 -1
  40. package/lib/api/net/index.js.map +1 -1
  41. package/lib/api/net/waitFor.d.ts +1 -1
  42. package/lib/api/net/waitFor.js +2 -2
  43. package/lib/api/net/waitFor.js.map +1 -1
  44. package/lib/cli/adapter/eslint.d.ts +1 -1
  45. package/lib/cli/adapter/eslint.js +1 -1
  46. package/lib/cli/adapter/eslint.js.map +1 -1
  47. package/lib/cli/adapter/prettier.d.ts +1 -1
  48. package/lib/cli/adapter/prettier.js +4 -4
  49. package/lib/cli/adapter/prettier.js.map +2 -2
  50. package/lib/cli/build/assets.d.ts +1 -1
  51. package/lib/cli/build/assets.js +4 -4
  52. package/lib/cli/build/assets.js.map +1 -1
  53. package/lib/cli/build/esbuild.js +3 -3
  54. package/lib/cli/build/esbuild.js.map +1 -1
  55. package/lib/cli/build/index.js +6 -6
  56. package/lib/cli/build/index.js.map +1 -1
  57. package/lib/cli/build/tsc.d.ts +1 -1
  58. package/lib/cli/build/tsc.js +2 -2
  59. package/lib/cli/build/tsc.js.map +1 -1
  60. package/lib/cli/buildPackage/index.js +3 -3
  61. package/lib/cli/buildPackage/index.js.map +1 -1
  62. package/lib/cli/configure/analyseConfiguration.d.ts +2 -2
  63. package/lib/cli/configure/analyseConfiguration.js +2 -2
  64. package/lib/cli/configure/analyseConfiguration.js.map +1 -1
  65. package/lib/cli/configure/analyseDependencies.d.ts +1 -1
  66. package/lib/cli/configure/analyseDependencies.js +6 -6
  67. package/lib/cli/configure/analyseDependencies.js.map +1 -1
  68. package/lib/cli/configure/analysis/files.js +1 -1
  69. package/lib/cli/configure/analysis/files.js.map +1 -1
  70. package/lib/cli/configure/analysis/git.js +2 -2
  71. package/lib/cli/configure/analysis/git.js.map +1 -1
  72. package/lib/cli/configure/analysis/package.d.ts +1 -1
  73. package/lib/cli/configure/analysis/package.js +2 -2
  74. package/lib/cli/configure/analysis/package.js.map +1 -1
  75. package/lib/cli/configure/analysis/project.d.ts +1 -1
  76. package/lib/cli/configure/analysis/project.js +4 -4
  77. package/lib/cli/configure/analysis/project.js.map +2 -2
  78. package/lib/cli/configure/dependencies/index.d.ts +5 -5
  79. package/lib/cli/configure/dependencies/index.js +5 -5
  80. package/lib/cli/configure/dependencies/index.js.map +1 -1
  81. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.d.ts +2 -2
  82. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +1 -1
  83. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +1 -1
  84. package/lib/cli/configure/dependencies/seekKoala.d.ts +2 -2
  85. package/lib/cli/configure/dependencies/seekKoala.js +1 -1
  86. package/lib/cli/configure/dependencies/seekKoala.js.map +1 -1
  87. package/lib/cli/configure/dependencies/skuba.d.ts +2 -2
  88. package/lib/cli/configure/dependencies/skuba.js +1 -1
  89. package/lib/cli/configure/dependencies/skuba.js.map +1 -1
  90. package/lib/cli/configure/dependencies/skubaDeps.d.ts +1 -1
  91. package/lib/cli/configure/dependencies/skubaDeps.js.map +1 -1
  92. package/lib/cli/configure/dependencies/skubaDive.d.ts +2 -2
  93. package/lib/cli/configure/dependencies/skubaDive.js +1 -1
  94. package/lib/cli/configure/dependencies/skubaDive.js.map +1 -1
  95. package/lib/cli/configure/ensureTemplateCompletion.d.ts +1 -1
  96. package/lib/cli/configure/ensureTemplateCompletion.js +6 -6
  97. package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
  98. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  99. package/lib/cli/configure/getEntryPoint.js +3 -3
  100. package/lib/cli/configure/getEntryPoint.js.map +1 -1
  101. package/lib/cli/configure/getProjectType.d.ts +2 -2
  102. package/lib/cli/configure/getProjectType.js +3 -3
  103. package/lib/cli/configure/getProjectType.js.map +1 -1
  104. package/lib/cli/configure/index.js +14 -14
  105. package/lib/cli/configure/index.js.map +1 -1
  106. package/lib/cli/configure/modules/eslint.d.ts +1 -1
  107. package/lib/cli/configure/modules/eslint.js +4 -4
  108. package/lib/cli/configure/modules/eslint.js.map +1 -1
  109. package/lib/cli/configure/modules/ignore.d.ts +1 -1
  110. package/lib/cli/configure/modules/ignore.js +2 -2
  111. package/lib/cli/configure/modules/ignore.js.map +1 -1
  112. package/lib/cli/configure/modules/index.d.ts +1 -1
  113. package/lib/cli/configure/modules/index.js +10 -10
  114. package/lib/cli/configure/modules/index.js.map +1 -1
  115. package/lib/cli/configure/modules/jest.d.ts +1 -1
  116. package/lib/cli/configure/modules/jest.js +4 -4
  117. package/lib/cli/configure/modules/jest.js.map +1 -1
  118. package/lib/cli/configure/modules/nodemon.d.ts +1 -1
  119. package/lib/cli/configure/modules/nodemon.js +1 -1
  120. package/lib/cli/configure/modules/nodemon.js.map +1 -1
  121. package/lib/cli/configure/modules/package.d.ts +1 -1
  122. package/lib/cli/configure/modules/package.js +4 -4
  123. package/lib/cli/configure/modules/package.js.map +1 -1
  124. package/lib/cli/configure/modules/prettier.d.ts +1 -1
  125. package/lib/cli/configure/modules/prettier.js +4 -4
  126. package/lib/cli/configure/modules/prettier.js.map +1 -1
  127. package/lib/cli/configure/modules/renovate.d.ts +1 -1
  128. package/lib/cli/configure/modules/renovate.js +5 -5
  129. package/lib/cli/configure/modules/renovate.js.map +1 -1
  130. package/lib/cli/configure/modules/serverless.d.ts +1 -1
  131. package/lib/cli/configure/modules/serverless.js.map +1 -1
  132. package/lib/cli/configure/modules/skubaDive.d.ts +1 -1
  133. package/lib/cli/configure/modules/skubaDive.js +4 -4
  134. package/lib/cli/configure/modules/skubaDive.js.map +1 -1
  135. package/lib/cli/configure/modules/tslint.d.ts +1 -1
  136. package/lib/cli/configure/modules/tslint.js +1 -1
  137. package/lib/cli/configure/modules/tslint.js.map +1 -1
  138. package/lib/cli/configure/processing/deleteFiles.d.ts +1 -1
  139. package/lib/cli/configure/processing/deleteFiles.js.map +1 -1
  140. package/lib/cli/configure/processing/json.js +2 -2
  141. package/lib/cli/configure/processing/json.js.map +1 -1
  142. package/lib/cli/configure/processing/loadFiles.d.ts +1 -1
  143. package/lib/cli/configure/processing/loadFiles.js.map +1 -1
  144. package/lib/cli/configure/processing/module.d.ts +1 -1
  145. package/lib/cli/configure/processing/module.js +1 -1
  146. package/lib/cli/configure/processing/module.js.map +1 -1
  147. package/lib/cli/configure/processing/package.d.ts +1 -1
  148. package/lib/cli/configure/processing/package.js +2 -2
  149. package/lib/cli/configure/processing/package.js.map +1 -1
  150. package/lib/cli/configure/processing/prettier.js +1 -1
  151. package/lib/cli/configure/processing/prettier.js.map +1 -1
  152. package/lib/cli/configure/processing/typescript.js +1 -1
  153. package/lib/cli/configure/processing/typescript.js.map +1 -1
  154. package/lib/cli/configure/types.d.ts +2 -2
  155. package/lib/cli/configure/types.js.map +1 -1
  156. package/lib/cli/format/index.js +5 -5
  157. package/lib/cli/format/index.js.map +1 -1
  158. package/lib/cli/help/index.js +2 -2
  159. package/lib/cli/help/index.js.map +1 -1
  160. package/lib/cli/init/getConfig.d.ts +3 -3
  161. package/lib/cli/init/getConfig.js +9 -9
  162. package/lib/cli/init/getConfig.js.map +1 -1
  163. package/lib/cli/init/git.js +2 -2
  164. package/lib/cli/init/git.js.map +1 -1
  165. package/lib/cli/init/index.js +15 -15
  166. package/lib/cli/init/index.js.map +1 -1
  167. package/lib/cli/init/prompts.d.ts +1 -1
  168. package/lib/cli/init/prompts.js +2 -2
  169. package/lib/cli/init/prompts.js.map +1 -1
  170. package/lib/cli/init/types.js +2 -2
  171. package/lib/cli/init/types.js.map +1 -1
  172. package/lib/cli/init/writePackageJson.d.ts +1 -1
  173. package/lib/cli/init/writePackageJson.js +2 -2
  174. package/lib/cli/init/writePackageJson.js.map +1 -1
  175. package/lib/cli/lint/annotate/buildkite/eslint.d.ts +1 -1
  176. package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
  177. package/lib/cli/lint/annotate/buildkite/eslint.js.map +1 -1
  178. package/lib/cli/lint/annotate/buildkite/index.d.ts +4 -4
  179. package/lib/cli/lint/annotate/buildkite/index.js +5 -5
  180. package/lib/cli/lint/annotate/buildkite/index.js.map +1 -1
  181. package/lib/cli/lint/annotate/buildkite/internal.d.ts +1 -1
  182. package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
  183. package/lib/cli/lint/annotate/buildkite/internal.js.map +1 -1
  184. package/lib/cli/lint/annotate/buildkite/prettier.d.ts +1 -1
  185. package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
  186. package/lib/cli/lint/annotate/buildkite/prettier.js.map +1 -1
  187. package/lib/cli/lint/annotate/buildkite/tsc.d.ts +1 -1
  188. package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
  189. package/lib/cli/lint/annotate/buildkite/tsc.js.map +1 -1
  190. package/lib/cli/lint/annotate/github/eslint.d.ts +2 -2
  191. package/lib/cli/lint/annotate/github/eslint.js.map +1 -1
  192. package/lib/cli/lint/annotate/github/index.d.ts +4 -4
  193. package/lib/cli/lint/annotate/github/index.js +6 -6
  194. package/lib/cli/lint/annotate/github/index.js.map +2 -2
  195. package/lib/cli/lint/annotate/github/internal.d.ts +2 -2
  196. package/lib/cli/lint/annotate/github/internal.js.map +1 -1
  197. package/lib/cli/lint/annotate/github/prettier.d.ts +2 -2
  198. package/lib/cli/lint/annotate/github/prettier.js.map +1 -1
  199. package/lib/cli/lint/annotate/github/tsc.d.ts +2 -2
  200. package/lib/cli/lint/annotate/github/tsc.js.map +1 -1
  201. package/lib/cli/lint/annotate/index.d.ts +4 -4
  202. package/lib/cli/lint/annotate/index.js +2 -2
  203. package/lib/cli/lint/annotate/index.js.map +1 -1
  204. package/lib/cli/lint/autofix.d.ts +2 -2
  205. package/lib/cli/lint/autofix.js +11 -11
  206. package/lib/cli/lint/autofix.js.map +1 -1
  207. package/lib/cli/lint/eslint.d.ts +2 -2
  208. package/lib/cli/lint/eslint.js +3 -3
  209. package/lib/cli/lint/eslint.js.map +1 -1
  210. package/lib/cli/lint/external.d.ts +3 -3
  211. package/lib/cli/lint/external.js +3 -3
  212. package/lib/cli/lint/external.js.map +1 -1
  213. package/lib/cli/lint/index.js +8 -8
  214. package/lib/cli/lint/index.js.map +1 -1
  215. package/lib/cli/lint/internal.d.ts +1 -1
  216. package/lib/cli/lint/internal.js +5 -5
  217. package/lib/cli/lint/internal.js.map +1 -1
  218. package/lib/cli/lint/internalLints/detectBadCodeowners.d.ts +2 -2
  219. package/lib/cli/lint/internalLints/detectBadCodeowners.js +2 -2
  220. package/lib/cli/lint/internalLints/detectBadCodeowners.js.map +1 -1
  221. package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +2 -2
  222. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js +2 -2
  223. package/lib/cli/lint/internalLints/noSkubaTemplateJs.js.map +1 -1
  224. package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +2 -2
  225. package/lib/cli/lint/internalLints/patchRenovateConfig.js +5 -5
  226. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +1 -1
  227. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +3 -3
  228. package/lib/cli/lint/internalLints/refreshConfigFiles.js +7 -7
  229. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +1 -1
  230. package/lib/cli/lint/internalLints/upgrade/index.d.ts +3 -3
  231. package/lib/cli/lint/internalLints/upgrade/index.js +4 -4
  232. package/lib/cli/lint/internalLints/upgrade/index.js.map +1 -1
  233. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.d.ts +1 -1
  234. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js +1 -1
  235. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/index.js.map +1 -1
  236. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.d.ts +1 -1
  237. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js +1 -1
  238. package/lib/cli/lint/internalLints/upgrade/patches/10.0.4/removeYarnIgnoreOptionalFlags.js.map +2 -2
  239. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.d.ts +1 -1
  240. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js +2 -2
  241. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/index.js.map +1 -1
  242. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.d.ts +1 -1
  243. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js +4 -4
  244. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/migrateNpmrcToPnpmWorkspace.js.map +2 -2
  245. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.d.ts +1 -1
  246. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js +1 -1
  247. package/lib/cli/lint/internalLints/upgrade/patches/10.1.0/stopBundlingInCDKTests.js.map +2 -2
  248. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.d.ts +1 -1
  249. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +4 -4
  250. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  251. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.d.ts +1 -1
  252. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js +4 -4
  253. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/index.js.map +2 -2
  254. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.d.ts +1 -1
  255. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +2 -2
  256. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  257. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.d.ts +1 -1
  258. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +3 -3
  259. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  260. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +1 -1
  261. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +1 -1
  262. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +1 -1
  263. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +1 -1
  264. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +1 -1
  265. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +2 -2
  266. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.d.ts +1 -1
  267. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +1 -1
  268. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
  269. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.d.ts +1 -1
  270. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +5 -5
  271. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +1 -1
  272. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +1 -1
  273. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +1 -1
  274. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +2 -2
  275. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +1 -1
  276. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +1 -1
  277. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +2 -2
  278. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +1 -1
  279. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +1 -1
  280. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +2 -2
  281. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.d.ts +1 -1
  282. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +5 -5
  283. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
  284. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.d.ts +1 -1
  285. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js +1 -1
  286. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/index.js.map +1 -1
  287. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.d.ts +1 -1
  288. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js +1 -1
  289. package/lib/cli/lint/internalLints/upgrade/patches/9.0.1/patchPnpmDockerImages.js.map +2 -2
  290. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.d.ts +1 -1
  291. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js +1 -1
  292. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +1 -1
  293. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.d.ts +1 -1
  294. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js +2 -2
  295. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +2 -2
  296. package/lib/cli/lint/prettier.d.ts +2 -2
  297. package/lib/cli/lint/prettier.js +3 -3
  298. package/lib/cli/lint/prettier.js.map +1 -1
  299. package/lib/cli/lint/tsc.d.ts +1 -1
  300. package/lib/cli/lint/tsc.js +1 -1
  301. package/lib/cli/lint/tsc.js.map +1 -1
  302. package/lib/cli/migrate/index.js +2 -2
  303. package/lib/cli/migrate/index.js.map +1 -1
  304. package/lib/cli/migrate/nodeVersion/checks.js +1 -1
  305. package/lib/cli/migrate/nodeVersion/checks.js.map +1 -1
  306. package/lib/cli/migrate/nodeVersion/index.js +3 -3
  307. package/lib/cli/migrate/nodeVersion/index.js.map +1 -1
  308. package/lib/cli/node/index.js +3 -3
  309. package/lib/cli/node/index.js.map +1 -1
  310. package/lib/cli/release/index.js +1 -1
  311. package/lib/cli/release/index.js.map +1 -1
  312. package/lib/cli/start/index.js +4 -4
  313. package/lib/cli/start/index.js.map +1 -1
  314. package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
  315. package/lib/cli/test/reporters/github/annotations.js.map +1 -1
  316. package/lib/cli/test/reporters/github/index.js +5 -5
  317. package/lib/cli/test/reporters/github/index.js.map +2 -2
  318. package/lib/cli/version/index.js +2 -2
  319. package/lib/cli/version/index.js.map +1 -1
  320. package/lib/index.d.ts +5 -5
  321. package/lib/index.js +5 -5
  322. package/lib/index.js.map +1 -1
  323. package/lib/skuba.js +8 -8
  324. package/lib/skuba.js.map +1 -1
  325. package/lib/utils/args.js +1 -1
  326. package/lib/utils/args.js.map +1 -1
  327. package/lib/utils/copy.js +2 -2
  328. package/lib/utils/copy.js.map +1 -1
  329. package/lib/utils/dir.js +2 -2
  330. package/lib/utils/dir.js.map +1 -1
  331. package/lib/utils/error.js +2 -2
  332. package/lib/utils/error.js.map +1 -1
  333. package/lib/utils/exec.d.ts +1 -1
  334. package/lib/utils/exec.js +2 -2
  335. package/lib/utils/exec.js.map +1 -1
  336. package/lib/utils/help.js +2 -2
  337. package/lib/utils/help.js.map +1 -1
  338. package/lib/utils/logo.js +3 -3
  339. package/lib/utils/logo.js.map +1 -1
  340. package/lib/utils/manifest.js +1 -1
  341. package/lib/utils/manifest.js.map +1 -1
  342. package/lib/utils/packageManager.js +1 -1
  343. package/lib/utils/packageManager.js.map +1 -1
  344. package/lib/utils/template.js +2 -2
  345. package/lib/utils/template.js.map +1 -1
  346. package/lib/utils/version.js +2 -2
  347. package/lib/utils/version.js.map +1 -1
  348. package/lib/utils/wait.js +2 -2
  349. package/lib/utils/wait.js.map +1 -1
  350. package/lib/utils/worker.d.ts +3 -3
  351. package/lib/utils/worker.js +1 -1
  352. package/lib/utils/worker.js.map +1 -1
  353. package/lib/wrapper/functionHandler.js +3 -3
  354. package/lib/wrapper/functionHandler.js.map +1 -1
  355. package/lib/wrapper/http.js +1 -1
  356. package/lib/wrapper/http.js.map +1 -1
  357. package/lib/wrapper/index.js +3 -3
  358. package/lib/wrapper/index.js.map +1 -1
  359. package/lib/wrapper/main.js +2 -2
  360. package/lib/wrapper/main.js.map +1 -1
  361. package/lib/wrapper/requestListener.js +2 -2
  362. package/lib/wrapper/requestListener.js.map +1 -1
  363. package/package.json +2 -2
  364. package/template/express-rest-api/src/app.test.ts +1 -1
  365. package/template/express-rest-api/src/app.ts +3 -3
  366. package/template/express-rest-api/src/framework/logging.ts +1 -1
  367. package/template/express-rest-api/src/framework/metrics.ts +2 -2
  368. package/template/express-rest-api/src/listen.ts +4 -4
  369. package/template/greeter/package.json +1 -1
  370. package/template/greeter/src/app.test.ts +1 -1
  371. package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
  372. package/template/koa-rest-api/src/api/index.ts +3 -3
  373. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
  374. package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
  375. package/template/koa-rest-api/src/api/jobs/index.ts +3 -3
  376. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +3 -3
  377. package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
  378. package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
  379. package/template/koa-rest-api/src/app.test.ts +2 -2
  380. package/template/koa-rest-api/src/app.ts +3 -3
  381. package/template/koa-rest-api/src/framework/logging.ts +1 -1
  382. package/template/koa-rest-api/src/framework/metrics.ts +2 -2
  383. package/template/koa-rest-api/src/framework/server.test.ts +5 -5
  384. package/template/koa-rest-api/src/framework/server.ts +3 -3
  385. package/template/koa-rest-api/src/framework/validation.test.ts +4 -4
  386. package/template/koa-rest-api/src/framework/validation.ts +1 -1
  387. package/template/koa-rest-api/src/listen.ts +4 -4
  388. package/template/koa-rest-api/src/storage/jobs.ts +1 -1
  389. package/template/koa-rest-api/src/testing/metrics.ts +1 -1
  390. package/template/koa-rest-api/src/testing/server.ts +1 -1
  391. package/template/koa-rest-api/src/testing/types.ts +1 -1
  392. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +1 -1
  393. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
  394. package/template/lambda-sqs-worker-cdk/infra/index.ts +2 -2
  395. package/template/lambda-sqs-worker-cdk/package.json +1 -1
  396. package/template/lambda-sqs-worker-cdk/src/app.test.ts +6 -6
  397. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -7
  398. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +4 -4
  399. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
  400. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +1 -1
  401. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
  402. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +2 -2
  403. package/template/lambda-sqs-worker-cdk/src/mapping/jobScorer.ts +2 -2
  404. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
  405. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +3 -3
  406. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
  407. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
  408. package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +1 -1
  409. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
  410. package/template/lambda-sqs-worker-cdk/src/testing/types.ts +1 -1
  411. package/template/oss-npm-package/src/index.test.ts +1 -1
  412. package/template/private-npm-package/src/index.test.ts +1 -1
@@ -23,8 +23,8 @@ __export(annotate_exports, {
23
23
  annotate: () => annotate
24
24
  });
25
25
  module.exports = __toCommonJS(annotate_exports);
26
- var import_exec = require("../../utils/exec");
27
- var import_logging = require("../../utils/logging");
26
+ var import_exec = require("../../utils/exec.js");
27
+ var import_logging = require("../../utils/logging.js");
28
28
  const isAnnotationEnabled = async () => Boolean(
29
29
  process.env.BUILDKITE && process.env.BUILDKITE_AGENT_ACCESS_TOKEN && process.env.BUILDKITE_JOB_ID && await (0, import_exec.hasCommand)("buildkite-agent")
30
30
  );
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/buildkite/annotate.ts"],
4
- "sourcesContent": ["import { exec, hasCommand } from '../../utils/exec';\nimport { log } from '../../utils/logging';\n\nexport type AnnotationStyle = 'success' | 'info' | 'warning' | 'error';\n\nconst isAnnotationEnabled = async () =>\n Boolean(\n process.env.BUILDKITE &&\n process.env.BUILDKITE_AGENT_ACCESS_TOKEN &&\n process.env.BUILDKITE_JOB_ID &&\n (await hasCommand('buildkite-agent')),\n );\n\ninterface AnnotationOptions {\n context?: string;\n\n /**\n * Scopes an annotation's context to the Buildkite step ID.\n *\n * This lets you emit distinct annotations per step, and only takes effect if\n * the `BUILDKITE_STEP_ID` environment variable is present.\n */\n scopeContextToStep?: boolean;\n\n style?: AnnotationStyle;\n}\n\n// Buildkite annotation currently only supports 1MiB of data\nexport const MAX_SIZE = 1024 * 1024; // 1MiB in bytes\nexport const TRUNCATION_WARNING = '... [Truncated due to size limit]';\n\n/**\n * Asynchronously uploads a Buildkite annotation.\n *\n * If the following environment variables are not present,\n * the function will silently return without attempting to annotate:\n *\n * - `BUILDKITE`\n * - `BUILDKITE_AGENT_ACCESS_TOKEN`\n * - `BUILDKITE_JOB_ID`\n *\n * The `buildkite-agent` binary must also be on your `PATH`.\n */\nexport const annotate = async (\n markdown: string,\n opts: AnnotationOptions = {},\n): Promise<void> => {\n if (!(await isAnnotationEnabled())) {\n return;\n }\n\n // Check if the annotation exceeds the maximum size\n let truncatedMarkdown = markdown;\n if (markdown.length > MAX_SIZE) {\n // Notify user of truncation, leave space for message\n const remainingSpace = MAX_SIZE - TRUNCATION_WARNING.length;\n truncatedMarkdown = markdown.slice(0, remainingSpace) + TRUNCATION_WARNING;\n // Log full message to the build log\n log.warn(`Annotation truncated, full message is: ${markdown}`);\n }\n\n // Always scope to the current Buildkite step.\n const context = [\n opts.scopeContextToStep && process.env.BUILDKITE_STEP_ID,\n opts.context,\n ]\n .filter(Boolean)\n .join('|');\n\n const { style } = opts;\n\n await exec(\n 'buildkite-agent',\n 'annotate',\n ...(context ? ['--context', context] : []),\n ...(style ? ['--style', style] : []),\n truncatedMarkdown,\n );\n};\n"],
4
+ "sourcesContent": ["import { exec, hasCommand } from '../../utils/exec.js';\nimport { log } from '../../utils/logging.js';\n\nexport type AnnotationStyle = 'success' | 'info' | 'warning' | 'error';\n\nconst isAnnotationEnabled = async () =>\n Boolean(\n process.env.BUILDKITE &&\n process.env.BUILDKITE_AGENT_ACCESS_TOKEN &&\n process.env.BUILDKITE_JOB_ID &&\n (await hasCommand('buildkite-agent')),\n );\n\ninterface AnnotationOptions {\n context?: string;\n\n /**\n * Scopes an annotation's context to the Buildkite step ID.\n *\n * This lets you emit distinct annotations per step, and only takes effect if\n * the `BUILDKITE_STEP_ID` environment variable is present.\n */\n scopeContextToStep?: boolean;\n\n style?: AnnotationStyle;\n}\n\n// Buildkite annotation currently only supports 1MiB of data\nexport const MAX_SIZE = 1024 * 1024; // 1MiB in bytes\nexport const TRUNCATION_WARNING = '... [Truncated due to size limit]';\n\n/**\n * Asynchronously uploads a Buildkite annotation.\n *\n * If the following environment variables are not present,\n * the function will silently return without attempting to annotate:\n *\n * - `BUILDKITE`\n * - `BUILDKITE_AGENT_ACCESS_TOKEN`\n * - `BUILDKITE_JOB_ID`\n *\n * The `buildkite-agent` binary must also be on your `PATH`.\n */\nexport const annotate = async (\n markdown: string,\n opts: AnnotationOptions = {},\n): Promise<void> => {\n if (!(await isAnnotationEnabled())) {\n return;\n }\n\n // Check if the annotation exceeds the maximum size\n let truncatedMarkdown = markdown;\n if (markdown.length > MAX_SIZE) {\n // Notify user of truncation, leave space for message\n const remainingSpace = MAX_SIZE - TRUNCATION_WARNING.length;\n truncatedMarkdown = markdown.slice(0, remainingSpace) + TRUNCATION_WARNING;\n // Log full message to the build log\n log.warn(`Annotation truncated, full message is: ${markdown}`);\n }\n\n // Always scope to the current Buildkite step.\n const context = [\n opts.scopeContextToStep && process.env.BUILDKITE_STEP_ID,\n opts.context,\n ]\n .filter(Boolean)\n .join('|');\n\n const { style } = opts;\n\n await exec(\n 'buildkite-agent',\n 'annotate',\n ...(context ? ['--context', context] : []),\n ...(style ? ['--style', style] : []),\n truncatedMarkdown,\n );\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiC;AACjC,qBAAoB;AAIpB,MAAM,sBAAsB,YAC1B;AAAA,EACE,QAAQ,IAAI,aACV,QAAQ,IAAI,gCACZ,QAAQ,IAAI,oBACX,UAAM,wBAAW,iBAAiB;AACvC;AAiBK,MAAM,WAAW,OAAO;AACxB,MAAM,qBAAqB;AAc3B,MAAM,WAAW,OACtB,UACA,OAA0B,CAAC,MACT;AAClB,MAAI,CAAE,MAAM,oBAAoB,GAAI;AAClC;AAAA,EACF;AAGA,MAAI,oBAAoB;AACxB,MAAI,SAAS,SAAS,UAAU;AAE9B,UAAM,iBAAiB,WAAW,mBAAmB;AACrD,wBAAoB,SAAS,MAAM,GAAG,cAAc,IAAI;AAExD,uBAAI,KAAK,0CAA0C,QAAQ,EAAE;AAAA,EAC/D;AAGA,QAAM,UAAU;AAAA,IACd,KAAK,sBAAsB,QAAQ,IAAI;AAAA,IACvC,KAAK;AAAA,EACP,EACG,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,QAAM,EAAE,MAAM,IAAI;AAElB,YAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,GAAI,UAAU,CAAC,aAAa,OAAO,IAAI,CAAC;AAAA,IACxC,GAAI,QAAQ,CAAC,WAAW,KAAK,IAAI,CAAC;AAAA,IAClC;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,3 @@
1
- export type { AnnotationStyle } from './annotate';
2
- export { annotate } from './annotate';
3
- export { md } from './md';
1
+ export type { AnnotationStyle } from './annotate.js';
2
+ export { annotate } from './annotate.js';
3
+ export { md } from './md.js';
@@ -22,8 +22,8 @@ __export(buildkite_exports, {
22
22
  md: () => import_md.md
23
23
  });
24
24
  module.exports = __toCommonJS(buildkite_exports);
25
- var import_annotate = require("./annotate");
26
- var import_md = require("./md");
25
+ var import_annotate = require("./annotate.js");
26
+ var import_md = require("./md.js");
27
27
  // Annotate the CommonJS export names for ESM import in node:
28
28
  0 && (module.exports = {
29
29
  annotate,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/buildkite/index.ts"],
4
- "sourcesContent": ["export type { AnnotationStyle } from './annotate';\nexport { annotate } from './annotate';\nexport { md } from './md';\n"],
4
+ "sourcesContent": ["export type { AnnotationStyle } from './annotate.js';\nexport { annotate } from './annotate.js';\nexport { md } from './md.js';\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAyB;AACzB,gBAAmB;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,5 @@
1
- import { type Identity } from './commit';
2
- import { type ChangedFile } from './getChangedFiles';
1
+ import { type Identity } from './commit.js';
2
+ import { type ChangedFile } from './getChangedFiles.js';
3
3
  interface CommitAllParameters {
4
4
  dir: string;
5
5
  message: string;
@@ -34,9 +34,9 @@ module.exports = __toCommonJS(commitAllChanges_exports);
34
34
  var import_path = __toESM(require("path"));
35
35
  var import_fs_extra = __toESM(require("fs-extra"));
36
36
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
37
- var import_commit = require("./commit");
38
- var import_findRoot = require("./findRoot");
39
- var import_getChangedFiles = require("./getChangedFiles");
37
+ var import_commit = require("./commit.js");
38
+ var import_findRoot = require("./findRoot.js");
39
+ var import_getChangedFiles = require("./getChangedFiles.js");
40
40
  const commitAllChanges = async ({
41
41
  dir,
42
42
  message,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/git/commitAllChanges.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { type Identity, commit } from './commit';\nimport { findRoot } from './findRoot';\nimport { type ChangedFile, getChangedFiles } from './getChangedFiles';\n\ninterface CommitAllParameters {\n dir: string;\n message: string;\n author?: Identity;\n committer?: Identity;\n\n /**\n * File changes to exclude from the commit.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\n/**\n * Stages all changes and writes a commit to the local Git repository.\n */\nexport const commitAllChanges = async ({\n dir,\n message,\n\n author,\n committer,\n ignore,\n}: CommitAllParameters): Promise<string | undefined> => {\n const changedFiles = await getChangedFiles({ dir, ignore });\n\n if (!changedFiles.length) {\n return;\n }\n\n const gitRoot = await findRoot({ dir });\n\n if (!gitRoot) {\n throw new Error(`Could not find Git root from directory: ${dir}`);\n }\n\n await Promise.all(\n changedFiles.map(async (file) => {\n const relativePath = path.relative(dir, file.path);\n\n // Skipping file outside working directory, see https://github.com/seek-oss/skuba/pull/1269#discussion_r1335308704\n if (relativePath.startsWith('..')) {\n return;\n }\n\n return file.state === 'deleted'\n ? git.remove({\n fs,\n dir: gitRoot,\n filepath: file.path,\n })\n : git.add({\n fs,\n dir: gitRoot,\n filepath: file.path,\n });\n }),\n );\n\n return commit({\n dir: gitRoot,\n message,\n author,\n committer,\n });\n};\n"],
4
+ "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { type Identity, commit } from './commit.js';\nimport { findRoot } from './findRoot.js';\nimport { type ChangedFile, getChangedFiles } from './getChangedFiles.js';\n\ninterface CommitAllParameters {\n dir: string;\n message: string;\n author?: Identity;\n committer?: Identity;\n\n /**\n * File changes to exclude from the commit.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\n/**\n * Stages all changes and writes a commit to the local Git repository.\n */\nexport const commitAllChanges = async ({\n dir,\n message,\n\n author,\n committer,\n ignore,\n}: CommitAllParameters): Promise<string | undefined> => {\n const changedFiles = await getChangedFiles({ dir, ignore });\n\n if (!changedFiles.length) {\n return;\n }\n\n const gitRoot = await findRoot({ dir });\n\n if (!gitRoot) {\n throw new Error(`Could not find Git root from directory: ${dir}`);\n }\n\n await Promise.all(\n changedFiles.map(async (file) => {\n const relativePath = path.relative(dir, file.path);\n\n // Skipping file outside working directory, see https://github.com/seek-oss/skuba/pull/1269#discussion_r1335308704\n if (relativePath.startsWith('..')) {\n return;\n }\n\n return file.state === 'deleted'\n ? git.remove({\n fs,\n dir: gitRoot,\n filepath: file.path,\n })\n : git.add({\n fs,\n dir: gitRoot,\n filepath: file.path,\n });\n }),\n );\n\n return commit({\n dir: gitRoot,\n message,\n author,\n committer,\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAEhB,oBAAsC;AACtC,sBAAyB;AACzB,6BAAkD;AAmB3C,MAAM,mBAAmB,OAAO;AAAA,EACrC;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AACF,MAAwD;AACtD,QAAM,eAAe,UAAM,wCAAgB,EAAE,KAAK,OAAO,CAAC;AAE1D,MAAI,CAAC,aAAa,QAAQ;AACxB;AAAA,EACF;AAEA,QAAM,UAAU,UAAM,0BAAS,EAAE,IAAI,CAAC;AAEtC,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,2CAA2C,GAAG,EAAE;AAAA,EAClE;AAEA,QAAM,QAAQ;AAAA,IACZ,aAAa,IAAI,OAAO,SAAS;AAC/B,YAAM,eAAe,YAAAA,QAAK,SAAS,KAAK,KAAK,IAAI;AAGjD,UAAI,aAAa,WAAW,IAAI,GAAG;AACjC;AAAA,MACF;AAEA,aAAO,KAAK,UAAU,YAClB,sBAAAC,QAAI,OAAO;AAAA,QACT,oBAAAC;AAAA,QACA,KAAK;AAAA,QACL,UAAU,KAAK;AAAA,MACjB,CAAC,IACD,sBAAAD,QAAI,IAAI;AAAA,QACN,oBAAAC;AAAA,QACA,KAAK;AAAA,QACL,UAAU,KAAK;AAAA,MACjB,CAAC;AAAA,IACP,CAAC;AAAA,EACH;AAEA,aAAO,sBAAO;AAAA,IACZ,KAAK;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
6
6
  "names": ["path", "git", "fs"]
7
7
  }
@@ -32,9 +32,8 @@ __export(getChangedFiles_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(getChangedFiles_exports);
34
34
  var import_fs_extra = __toESM(require("fs-extra"));
35
- var import_ignore = __toESM(require("ignore"));
36
35
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
37
- var import_statusMatrix = require("./statusMatrix");
36
+ var import_statusMatrix = require("./statusMatrix.js");
38
37
  const mapState = (row) => {
39
38
  if (row[import_statusMatrix.HEAD] === import_statusMatrix.ABSENT) {
40
39
  return "added";
@@ -49,31 +48,15 @@ const getChangedFiles = async ({
49
48
  ignore = []
50
49
  }) => {
51
50
  const gitRoot = await (0, import_isomorphic_git.findRoot)({ fs: import_fs_extra.default, filepath: dir });
52
- const [allFiles, isLfs] = await Promise.all([
53
- import_isomorphic_git.default.statusMatrix({ fs: import_fs_extra.default, dir: gitRoot ?? dir }),
54
- createIsLfsFilter(gitRoot)
55
- ]);
51
+ const allFiles = await import_isomorphic_git.default.statusMatrix({ fs: import_fs_extra.default, dir: gitRoot ?? dir });
56
52
  return allFiles.filter(
57
53
  (row) => row[import_statusMatrix.HEAD] !== import_statusMatrix.UNMODIFIED || row[import_statusMatrix.WORKDIR] !== import_statusMatrix.UNMODIFIED || row[import_statusMatrix.STAGE] !== import_statusMatrix.UNMODIFIED
58
54
  ).map((row) => ({ path: row[import_statusMatrix.FILEPATH], state: mapState(row) })).filter(
59
55
  (changedFile) => !ignore.some(
60
56
  (i) => i.path === changedFile.path && i.state === changedFile.state
61
- ) && !isLfs(changedFile.path)
57
+ )
62
58
  );
63
59
  };
64
- const createIsLfsFilter = async (gitRoot) => {
65
- if (!gitRoot) {
66
- return () => false;
67
- }
68
- const lfsFile = `${gitRoot}/.gitattributes`;
69
- if (!await import_fs_extra.default.pathExists(lfsFile)) {
70
- return () => false;
71
- }
72
- const filter = (0, import_ignore.default)().add(
73
- (await import_fs_extra.default.readFile(lfsFile, "utf8")).split("\n").map((l) => l.trim()).filter((l) => !l.startsWith("#") && l.includes("filter=lfs")).map((l) => l.split(/\s+/)[0]).flatMap((l) => l ? [l] : [])
74
- );
75
- return (pathname) => filter.ignores(pathname);
76
- };
77
60
  // Annotate the CommonJS export names for ESM import in node:
78
61
  0 && (module.exports = {
79
62
  getChangedFiles
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/git/getChangedFiles.ts"],
4
- "sourcesContent": ["import fs from 'fs-extra';\nimport ignoreFilter from 'ignore';\nimport git, { findRoot } from 'isomorphic-git';\n\nimport {\n ABSENT,\n FILEPATH,\n HEAD,\n MODIFIED,\n STAGE,\n UNMODIFIED,\n WORKDIR,\n} from './statusMatrix';\n\ntype ChangedFileState = 'added' | 'modified' | 'deleted';\nexport interface ChangedFile {\n path: string;\n state: ChangedFileState;\n}\ninterface ChangedFilesParameters {\n dir: string;\n\n /**\n * File changes to exclude from the result.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\nconst mapState = (\n row: [string, 0 | 1, 0 | 1 | 2, 0 | 1 | 2 | 3],\n): ChangedFileState => {\n if (row[HEAD] === ABSENT) {\n return 'added';\n }\n\n if (row[WORKDIR] === MODIFIED) {\n return 'modified';\n }\n\n return 'deleted';\n};\n\n/**\n * Returns all the files which have been added, modified or deleted in the\n * working directory of the local Git repository since the last commit.\n */\nexport const getChangedFiles = async ({\n dir,\n\n ignore = [],\n}: ChangedFilesParameters): Promise<ChangedFile[]> => {\n const gitRoot = await findRoot({ fs, filepath: dir });\n const [allFiles, isLfs] = await Promise.all([\n git.statusMatrix({ fs, dir: gitRoot ?? dir }),\n createIsLfsFilter(gitRoot),\n ]);\n\n return allFiles\n .filter(\n (row) =>\n row[HEAD] !== UNMODIFIED ||\n row[WORKDIR] !== UNMODIFIED ||\n row[STAGE] !== UNMODIFIED,\n )\n .map((row) => ({ path: row[FILEPATH], state: mapState(row) }))\n .filter(\n (changedFile) =>\n !ignore.some(\n (i) => i.path === changedFile.path && i.state === changedFile.state,\n ) && !isLfs(changedFile.path),\n );\n};\n\nconst createIsLfsFilter = async (\n gitRoot: string | null,\n): Promise<(pathname: string) => boolean> => {\n if (!gitRoot) {\n return () => false;\n }\n\n const lfsFile = `${gitRoot}/.gitattributes`;\n if (!(await fs.pathExists(lfsFile))) {\n return () => false;\n }\n\n const filter = ignoreFilter().add(\n (await fs.readFile(lfsFile, 'utf8'))\n .split('\\n')\n .map((l) => l.trim())\n .filter((l) => !l.startsWith('#') && l.includes('filter=lfs'))\n .map((l) => l.split(/\\s+/)[0])\n .flatMap((l) => (l ? [l] : [])),\n );\n\n return (pathname) => filter.ignores(pathname);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,oBAAyB;AACzB,4BAA8B;AAE9B,0BAQO;AAkBP,MAAM,WAAW,CACf,QACqB;AACrB,MAAI,IAAI,wBAAI,MAAM,4BAAQ;AACxB,WAAO;AAAA,EACT;AAEA,MAAI,IAAI,2BAAO,MAAM,8BAAU;AAC7B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAMO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EAEA,SAAS,CAAC;AACZ,MAAsD;AACpD,QAAM,UAAU,UAAM,gCAAS,EAAE,oBAAAA,SAAI,UAAU,IAAI,CAAC;AACpD,QAAM,CAAC,UAAU,KAAK,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC1C,sBAAAC,QAAI,aAAa,EAAE,oBAAAD,SAAI,KAAK,WAAW,IAAI,CAAC;AAAA,IAC5C,kBAAkB,OAAO;AAAA,EAC3B,CAAC;AAED,SAAO,SACJ;AAAA,IACC,CAAC,QACC,IAAI,wBAAI,MAAM,kCACd,IAAI,2BAAO,MAAM,kCACjB,IAAI,yBAAK,MAAM;AAAA,EACnB,EACC,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,4BAAQ,GAAG,OAAO,SAAS,GAAG,EAAE,EAAE,EAC5D;AAAA,IACC,CAAC,gBACC,CAAC,OAAO;AAAA,MACN,CAAC,MAAM,EAAE,SAAS,YAAY,QAAQ,EAAE,UAAU,YAAY;AAAA,IAChE,KAAK,CAAC,MAAM,YAAY,IAAI;AAAA,EAChC;AACJ;AAEA,MAAM,oBAAoB,OACxB,YAC2C;AAC3C,MAAI,CAAC,SAAS;AACZ,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,UAAU,GAAG,OAAO;AAC1B,MAAI,CAAE,MAAM,gBAAAA,QAAG,WAAW,OAAO,GAAI;AACnC,WAAO,MAAM;AAAA,EACf;AAEA,QAAM,aAAS,cAAAE,SAAa,EAAE;AAAA,KAC3B,MAAM,gBAAAF,QAAG,SAAS,SAAS,MAAM,GAC/B,MAAM,IAAI,EACV,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,EACnB,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,EAAE,SAAS,YAAY,CAAC,EAC5D,IAAI,CAAC,MAAM,EAAE,MAAM,KAAK,EAAE,CAAC,CAAC,EAC5B,QAAQ,CAAC,MAAO,IAAI,CAAC,CAAC,IAAI,CAAC,CAAE;AAAA,EAClC;AAEA,SAAO,CAAC,aAAa,OAAO,QAAQ,QAAQ;AAC9C;",
6
- "names": ["fs", "git", "ignoreFilter"]
4
+ "sourcesContent": ["import fs from 'fs-extra';\nimport git, { findRoot } from 'isomorphic-git';\n\nimport {\n ABSENT,\n FILEPATH,\n HEAD,\n MODIFIED,\n STAGE,\n UNMODIFIED,\n WORKDIR,\n} from './statusMatrix.js';\n\ntype ChangedFileState = 'added' | 'modified' | 'deleted';\nexport interface ChangedFile {\n path: string;\n state: ChangedFileState;\n}\ninterface ChangedFilesParameters {\n dir: string;\n\n /**\n * File changes to exclude from the result.\n *\n * Defaults to `[]` (no exclusions).\n */\n ignore?: ChangedFile[];\n}\n\nconst mapState = (\n row: [string, 0 | 1, 0 | 1 | 2, 0 | 1 | 2 | 3],\n): ChangedFileState => {\n if (row[HEAD] === ABSENT) {\n return 'added';\n }\n\n if (row[WORKDIR] === MODIFIED) {\n return 'modified';\n }\n\n return 'deleted';\n};\n\n/**\n * Returns all the files which have been added, modified or deleted in the\n * working directory of the local Git repository since the last commit.\n */\nexport const getChangedFiles = async ({\n dir,\n\n ignore = [],\n}: ChangedFilesParameters): Promise<ChangedFile[]> => {\n const gitRoot = await findRoot({ fs, filepath: dir });\n const allFiles = await git.statusMatrix({ fs, dir: gitRoot ?? dir });\n return allFiles\n .filter(\n (row) =>\n row[HEAD] !== UNMODIFIED ||\n row[WORKDIR] !== UNMODIFIED ||\n row[STAGE] !== UNMODIFIED,\n )\n .map((row) => ({ path: row[FILEPATH], state: mapState(row) }))\n .filter(\n (changedFile) =>\n !ignore.some(\n (i) => i.path === changedFile.path && i.state === changedFile.state,\n ),\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAA8B;AAE9B,0BAQO;AAkBP,MAAM,WAAW,CACf,QACqB;AACrB,MAAI,IAAI,wBAAI,MAAM,4BAAQ;AACxB,WAAO;AAAA,EACT;AAEA,MAAI,IAAI,2BAAO,MAAM,8BAAU;AAC7B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAMO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EAEA,SAAS,CAAC;AACZ,MAAsD;AACpD,QAAM,UAAU,UAAM,gCAAS,EAAE,oBAAAA,SAAI,UAAU,IAAI,CAAC;AACpD,QAAM,WAAW,MAAM,sBAAAC,QAAI,aAAa,EAAE,oBAAAD,SAAI,KAAK,WAAW,IAAI,CAAC;AACnE,SAAO,SACJ;AAAA,IACC,CAAC,QACC,IAAI,wBAAI,MAAM,kCACd,IAAI,2BAAO,MAAM,kCACjB,IAAI,yBAAK,MAAM;AAAA,EACnB,EACC,IAAI,CAAC,SAAS,EAAE,MAAM,IAAI,4BAAQ,GAAG,OAAO,SAAS,GAAG,EAAE,EAAE,EAC5D;AAAA,IACC,CAAC,gBACC,CAAC,OAAO;AAAA,MACN,CAAC,MAAM,EAAE,SAAS,YAAY,QAAQ,EAAE,UAAU,YAAY;AAAA,IAChE;AAAA,EACJ;AACJ;",
6
+ "names": ["fs", "git"]
7
7
  }
@@ -1,12 +1,12 @@
1
- export { commit } from './commit';
2
- export { commitAllChanges } from './commitAllChanges';
3
- export { currentBranch } from './currentBranch';
4
- export { findRoot } from './findRoot';
5
- export type { ChangedFile } from './getChangedFiles';
6
- export { getChangedFiles } from './getChangedFiles';
7
- export { getHeadCommitId, getHeadCommitMessage } from './log';
8
- export { getOwnerAndRepo } from './remote';
9
- export { push } from './push';
10
- export { fastForwardBranch } from './pull';
11
- export { reset } from './reset';
12
- export { isFileGitIgnored } from './isFileGitIgnored';
1
+ export { commit } from './commit.js';
2
+ export { commitAllChanges } from './commitAllChanges.js';
3
+ export { currentBranch } from './currentBranch.js';
4
+ export { findRoot } from './findRoot.js';
5
+ export type { ChangedFile } from './getChangedFiles.js';
6
+ export { getChangedFiles } from './getChangedFiles.js';
7
+ export { getHeadCommitId, getHeadCommitMessage } from './log.js';
8
+ export { getOwnerAndRepo } from './remote.js';
9
+ export { push } from './push.js';
10
+ export { fastForwardBranch } from './pull.js';
11
+ export { reset } from './reset.js';
12
+ export { isFileGitIgnored } from './isFileGitIgnored.js';
@@ -32,17 +32,17 @@ __export(git_exports, {
32
32
  reset: () => import_reset.reset
33
33
  });
34
34
  module.exports = __toCommonJS(git_exports);
35
- var import_commit = require("./commit");
36
- var import_commitAllChanges = require("./commitAllChanges");
37
- var import_currentBranch = require("./currentBranch");
38
- var import_findRoot = require("./findRoot");
39
- var import_getChangedFiles = require("./getChangedFiles");
40
- var import_log = require("./log");
41
- var import_remote = require("./remote");
42
- var import_push = require("./push");
43
- var import_pull = require("./pull");
44
- var import_reset = require("./reset");
45
- var import_isFileGitIgnored = require("./isFileGitIgnored");
35
+ var import_commit = require("./commit.js");
36
+ var import_commitAllChanges = require("./commitAllChanges.js");
37
+ var import_currentBranch = require("./currentBranch.js");
38
+ var import_findRoot = require("./findRoot.js");
39
+ var import_getChangedFiles = require("./getChangedFiles.js");
40
+ var import_log = require("./log.js");
41
+ var import_remote = require("./remote.js");
42
+ var import_push = require("./push.js");
43
+ var import_pull = require("./pull.js");
44
+ var import_reset = require("./reset.js");
45
+ var import_isFileGitIgnored = require("./isFileGitIgnored.js");
46
46
  // Annotate the CommonJS export names for ESM import in node:
47
47
  0 && (module.exports = {
48
48
  commit,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/git/index.ts"],
4
- "sourcesContent": ["export { commit } from './commit';\nexport { commitAllChanges } from './commitAllChanges';\nexport { currentBranch } from './currentBranch';\nexport { findRoot } from './findRoot';\nexport type { ChangedFile } from './getChangedFiles';\nexport { getChangedFiles } from './getChangedFiles';\nexport { getHeadCommitId, getHeadCommitMessage } from './log';\nexport { getOwnerAndRepo } from './remote';\nexport { push } from './push';\nexport { fastForwardBranch } from './pull';\nexport { reset } from './reset';\nexport { isFileGitIgnored } from './isFileGitIgnored';\n"],
4
+ "sourcesContent": ["export { commit } from './commit.js';\nexport { commitAllChanges } from './commitAllChanges.js';\nexport { currentBranch } from './currentBranch.js';\nexport { findRoot } from './findRoot.js';\nexport type { ChangedFile } from './getChangedFiles.js';\nexport { getChangedFiles } from './getChangedFiles.js';\nexport { getHeadCommitId, getHeadCommitMessage } from './log.js';\nexport { getOwnerAndRepo } from './remote.js';\nexport { push } from './push.js';\nexport { fastForwardBranch } from './pull.js';\nexport { reset } from './reset.js';\nexport { isFileGitIgnored } from './isFileGitIgnored.js';\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,8BAAiC;AACjC,2BAA8B;AAC9B,sBAAyB;AAEzB,6BAAgC;AAChC,iBAAsD;AACtD,oBAAgC;AAChC,kBAAqB;AACrB,kBAAkC;AAClC,mBAAsB;AACtB,8BAAiC;",
6
6
  "names": []
7
7
  }
@@ -34,8 +34,8 @@ module.exports = __toCommonJS(pull_exports);
34
34
  var import_fs_extra = __toESM(require("fs-extra"));
35
35
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
36
36
  var import_node = __toESM(require("isomorphic-git/http/node"));
37
- var import_environment = require("../github/environment");
38
- var import_remote = require("./remote");
37
+ var import_environment = require("../github/environment.js");
38
+ var import_remote = require("./remote.js");
39
39
  const fastForwardBranch = async ({
40
40
  auth,
41
41
  dir,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/git/pull.ts"],
4
- "sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\n\nimport { apiTokenFromEnvironment } from '../github/environment';\n\nimport { getOwnerAndRepo } from './remote';\n\n/**\n * Use a GitHub app token to auth the Git push.\n *\n * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment\n * variables if `token` is not provided.\n */\ninterface GitHubAppAuth {\n type: 'gitHubApp';\n token?: string;\n}\n\ninterface PullParameters {\n /**\n * The auth mechanism for the push.\n *\n * Currently, only GitHub app tokens are supported.\n */\n auth: GitHubAppAuth;\n\n dir: string;\n\n /**\n * The local branch to fast forward.\n */\n ref: string;\n\n remote?: string;\n\n /**\n * The branch or tag on the remote to reference.\n *\n * This defaults to `ref`.\n */\n remoteRef?: string;\n}\n\n/**\n * Fast forwards the specified `ref` on the local Git repository to match the remote branch.\n */\nexport const fastForwardBranch = async ({\n auth,\n dir,\n ref,\n remote,\n remoteRef,\n}: PullParameters): Promise<void> => {\n const { owner, repo } = await getOwnerAndRepo({ dir });\n\n const url = `https://github.com/${encodeURIComponent(\n owner,\n )}/${encodeURIComponent(repo)}`;\n\n return git.fastForward({\n onAuth: () => ({\n username: 'x-access-token',\n password: auth.token ?? apiTokenFromEnvironment(),\n }),\n dir,\n fs,\n http,\n ref,\n remote,\n remoteRef,\n url,\n singleBranch: true,\n });\n};\n"],
4
+ "sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\n\nimport { apiTokenFromEnvironment } from '../github/environment.js';\n\nimport { getOwnerAndRepo } from './remote.js';\n\n/**\n * Use a GitHub app token to auth the Git push.\n *\n * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment\n * variables if `token` is not provided.\n */\ninterface GitHubAppAuth {\n type: 'gitHubApp';\n token?: string;\n}\n\ninterface PullParameters {\n /**\n * The auth mechanism for the push.\n *\n * Currently, only GitHub app tokens are supported.\n */\n auth: GitHubAppAuth;\n\n dir: string;\n\n /**\n * The local branch to fast forward.\n */\n ref: string;\n\n remote?: string;\n\n /**\n * The branch or tag on the remote to reference.\n *\n * This defaults to `ref`.\n */\n remoteRef?: string;\n}\n\n/**\n * Fast forwards the specified `ref` on the local Git repository to match the remote branch.\n */\nexport const fastForwardBranch = async ({\n auth,\n dir,\n ref,\n remote,\n remoteRef,\n}: PullParameters): Promise<void> => {\n const { owner, repo } = await getOwnerAndRepo({ dir });\n\n const url = `https://github.com/${encodeURIComponent(\n owner,\n )}/${encodeURIComponent(repo)}`;\n\n return git.fastForward({\n onAuth: () => ({\n username: 'x-access-token',\n password: auth.token ?? apiTokenFromEnvironment(),\n }),\n dir,\n fs,\n http,\n ref,\n remote,\n remoteRef,\n url,\n singleBranch: true,\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAChB,kBAAiB;AAEjB,yBAAwC;AAExC,oBAAgC;AAyCzB,MAAM,oBAAoB,OAAO;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAqC;AACnC,QAAM,EAAE,OAAO,KAAK,IAAI,UAAM,+BAAgB,EAAE,IAAI,CAAC;AAErD,QAAM,MAAM,sBAAsB;AAAA,IAChC;AAAA,EACF,CAAC,IAAI,mBAAmB,IAAI,CAAC;AAE7B,SAAO,sBAAAA,QAAI,YAAY;AAAA,IACrB,QAAQ,OAAO;AAAA,MACb,UAAU;AAAA,MACV,UAAU,KAAK,aAAS,4CAAwB;AAAA,IAClD;AAAA,IACA;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,cAAc;AAAA,EAChB,CAAC;AACH;",
6
6
  "names": ["git", "fs", "http"]
7
7
  }
@@ -34,8 +34,8 @@ module.exports = __toCommonJS(push_exports);
34
34
  var import_fs_extra = __toESM(require("fs-extra"));
35
35
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
36
36
  var import_node = __toESM(require("isomorphic-git/http/node"));
37
- var import_environment = require("../github/environment");
38
- var import_remote = require("./remote");
37
+ var import_environment = require("../github/environment.js");
38
+ var import_remote = require("./remote.js");
39
39
  const push = async ({
40
40
  auth,
41
41
  dir,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/git/push.ts"],
4
- "sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\n\nimport { apiTokenFromEnvironment } from '../github/environment';\n\nimport { getOwnerAndRepo } from './remote';\n\n/**\n * Use a GitHub app token to auth the Git push.\n *\n * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment\n * variables if `token` is not provided.\n */\ninterface GitHubAppAuth {\n type: 'gitHubApp';\n token?: string;\n}\n\ninterface PushParameters {\n /**\n * The auth mechanism for the push.\n *\n * Currently, only GitHub app tokens are supported.\n */\n auth: GitHubAppAuth;\n\n dir: string;\n\n /**\n * The reference to push to the remote.\n *\n * This may be a commit, branch or tag in the local repository.\n */\n ref: string;\n\n remote?: string;\n\n /**\n * The destination branch or tag on the remote.\n *\n * This defaults to `ref`.\n */\n remoteRef?: string;\n\n /**\n * Forcefully override any conflicts.\n *\n * This defaults to `false`.\n */\n force?: boolean;\n}\n\ninterface PushResult {\n ok: boolean;\n error: string | null;\n refs: Record<\n string,\n {\n ok: boolean;\n error: string;\n }\n >;\n headers?: Record<string, string> | undefined;\n}\n\n/**\n * Pushes the specified `ref` from the local Git repository to a remote.\n */\nexport const push = async ({\n auth,\n dir,\n ref,\n remote,\n remoteRef,\n force,\n}: PushParameters): Promise<PushResult> => {\n const { owner, repo } = await getOwnerAndRepo({ dir });\n\n const url = `https://github.com/${encodeURIComponent(\n owner,\n )}/${encodeURIComponent(repo)}`;\n\n return git.push({\n onAuth: () => ({\n username: 'x-access-token',\n password: auth.token ?? apiTokenFromEnvironment(),\n }),\n dir,\n fs,\n http,\n ref,\n remote,\n remoteRef,\n url,\n force,\n });\n};\n"],
4
+ "sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\nimport http from 'isomorphic-git/http/node';\n\nimport { apiTokenFromEnvironment } from '../github/environment.js';\n\nimport { getOwnerAndRepo } from './remote.js';\n\n/**\n * Use a GitHub app token to auth the Git push.\n *\n * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment\n * variables if `token` is not provided.\n */\ninterface GitHubAppAuth {\n type: 'gitHubApp';\n token?: string;\n}\n\ninterface PushParameters {\n /**\n * The auth mechanism for the push.\n *\n * Currently, only GitHub app tokens are supported.\n */\n auth: GitHubAppAuth;\n\n dir: string;\n\n /**\n * The reference to push to the remote.\n *\n * This may be a commit, branch or tag in the local repository.\n */\n ref: string;\n\n remote?: string;\n\n /**\n * The destination branch or tag on the remote.\n *\n * This defaults to `ref`.\n */\n remoteRef?: string;\n\n /**\n * Forcefully override any conflicts.\n *\n * This defaults to `false`.\n */\n force?: boolean;\n}\n\ninterface PushResult {\n ok: boolean;\n error: string | null;\n refs: Record<\n string,\n {\n ok: boolean;\n error: string;\n }\n >;\n headers?: Record<string, string> | undefined;\n}\n\n/**\n * Pushes the specified `ref` from the local Git repository to a remote.\n */\nexport const push = async ({\n auth,\n dir,\n ref,\n remote,\n remoteRef,\n force,\n}: PushParameters): Promise<PushResult> => {\n const { owner, repo } = await getOwnerAndRepo({ dir });\n\n const url = `https://github.com/${encodeURIComponent(\n owner,\n )}/${encodeURIComponent(repo)}`;\n\n return git.push({\n onAuth: () => ({\n username: 'x-access-token',\n password: auth.token ?? apiTokenFromEnvironment(),\n }),\n dir,\n fs,\n http,\n ref,\n remote,\n remoteRef,\n url,\n force,\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAChB,kBAAiB;AAEjB,yBAAwC;AAExC,oBAAgC;AA+DzB,MAAM,OAAO,OAAO;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA2C;AACzC,QAAM,EAAE,OAAO,KAAK,IAAI,UAAM,+BAAgB,EAAE,IAAI,CAAC;AAErD,QAAM,MAAM,sBAAsB;AAAA,IAChC;AAAA,EACF,CAAC,IAAI,mBAAmB,IAAI,CAAC;AAE7B,SAAO,sBAAAA,QAAI,KAAK;AAAA,IACd,QAAQ,OAAO;AAAA,MACb,UAAU;AAAA,MACV,UAAU,KAAK,aAAS,4CAAwB;AAAA,IAClD;AAAA,IACA;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
6
6
  "names": ["git", "fs", "http"]
7
7
  }
@@ -34,7 +34,7 @@ module.exports = __toCommonJS(reset_exports);
34
34
  var import_path = __toESM(require("path"));
35
35
  var import_fs_extra = __toESM(require("fs-extra"));
36
36
  var import_isomorphic_git = __toESM(require("isomorphic-git"));
37
- var import_statusMatrix = require("./statusMatrix");
37
+ var import_statusMatrix = require("./statusMatrix.js");
38
38
  const reset = async ({
39
39
  dir,
40
40
  branch,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/git/reset.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { FILEPATH, STAGE, UNMODIFIED, WORKDIR } from './statusMatrix';\n\ninterface ResetParameters {\n dir: string;\n branch: string;\n commitId: string;\n hard?: boolean;\n}\n\n/**\n * Resets the specified branch in the local Git repository to a particular\n * commit.\n */\nexport const reset = async ({\n dir,\n branch,\n commitId,\n hard,\n}: ResetParameters): Promise<void> => {\n await fs.promises.writeFile(\n path.join(dir, '.git/refs/heads', branch),\n `${commitId}\\n`,\n );\n\n if (hard) {\n const allFiles = await git.statusMatrix({ dir, fs });\n // Get all files which have been modified or staged - does not include new untracked files or deleted files\n const modifiedFiles = allFiles\n .filter((row) => row[WORKDIR] > UNMODIFIED && row[STAGE] > UNMODIFIED)\n .map((row) => row[FILEPATH]);\n\n // Delete modified/staged files\n await Promise.all(\n modifiedFiles.map((filePath) => fs.promises.rm(filePath)),\n );\n\n // This will bring in the unmodified versions of files plus any files which were deleted\n await git.checkout({ dir, fs, ref: branch, force: true });\n }\n};\n"],
4
+ "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nimport { FILEPATH, STAGE, UNMODIFIED, WORKDIR } from './statusMatrix.js';\n\ninterface ResetParameters {\n dir: string;\n branch: string;\n commitId: string;\n hard?: boolean;\n}\n\n/**\n * Resets the specified branch in the local Git repository to a particular\n * commit.\n */\nexport const reset = async ({\n dir,\n branch,\n commitId,\n hard,\n}: ResetParameters): Promise<void> => {\n await fs.promises.writeFile(\n path.join(dir, '.git/refs/heads', branch),\n `${commitId}\\n`,\n );\n\n if (hard) {\n const allFiles = await git.statusMatrix({ dir, fs });\n // Get all files which have been modified or staged - does not include new untracked files or deleted files\n const modifiedFiles = allFiles\n .filter((row) => row[WORKDIR] > UNMODIFIED && row[STAGE] > UNMODIFIED)\n .map((row) => row[FILEPATH]);\n\n // Delete modified/staged files\n await Promise.all(\n modifiedFiles.map((filePath) => fs.promises.rm(filePath)),\n );\n\n // This will bring in the unmodified versions of files plus any files which were deleted\n await git.checkout({ dir, fs, ref: branch, force: true });\n }\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAEhB,0BAAqD;AAa9C,MAAM,QAAQ,OAAO;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AACpC,QAAM,gBAAAA,QAAG,SAAS;AAAA,IAChB,YAAAC,QAAK,KAAK,KAAK,mBAAmB,MAAM;AAAA,IACxC,GAAG,QAAQ;AAAA;AAAA,EACb;AAEA,MAAI,MAAM;AACR,UAAM,WAAW,MAAM,sBAAAC,QAAI,aAAa,EAAE,KAAK,oBAAAF,QAAG,CAAC;AAEnD,UAAM,gBAAgB,SACnB,OAAO,CAAC,QAAQ,IAAI,2BAAO,IAAI,kCAAc,IAAI,yBAAK,IAAI,8BAAU,EACpE,IAAI,CAAC,QAAQ,IAAI,4BAAQ,CAAC;AAG7B,UAAM,QAAQ;AAAA,MACZ,cAAc,IAAI,CAAC,aAAa,gBAAAA,QAAG,SAAS,GAAG,QAAQ,CAAC;AAAA,IAC1D;AAGA,UAAM,sBAAAE,QAAI,SAAS,EAAE,KAAK,oBAAAF,SAAI,KAAK,QAAQ,OAAO,KAAK,CAAC;AAAA,EAC1D;AACF;",
6
6
  "names": ["fs", "path", "git"]
7
7
  }
@@ -31,10 +31,10 @@ __export(checkRun_exports, {
31
31
  createCheckRun: () => createCheckRun
32
32
  });
33
33
  module.exports = __toCommonJS(checkRun_exports);
34
- var import_logging = require("../../utils/logging");
35
- var Git = __toESM(require("../git"));
36
- var import_environment = require("./environment");
37
- var import_octokit = require("./octokit");
34
+ var import_logging = require("../../utils/logging.js");
35
+ var Git = __toESM(require("../git/index.js"));
36
+ var import_environment = require("./environment.js");
37
+ var import_octokit = require("./octokit.js");
38
38
  const GITHUB_MAX_ANNOTATIONS = 50;
39
39
  const suffixTitle = (title, inputAnnotations) => {
40
40
  const addedAnnotations = inputAnnotations > GITHUB_MAX_ANNOTATIONS ? GITHUB_MAX_ANNOTATIONS : inputAnnotations;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/github/checkRun.ts"],
4
- "sourcesContent": ["import type { Endpoints } from '@octokit/types';\n\nimport { pluralise } from '../../utils/logging';\nimport * as Git from '../git';\n\nimport { apiTokenFromEnvironment } from './environment';\nimport { createRestClient } from './octokit';\n\ntype Output = NonNullable<\n Endpoints['PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}']['parameters']['output']\n>;\n\nexport type Annotation = NonNullable<Output['annotations']>[number];\n\nconst GITHUB_MAX_ANNOTATIONS = 50;\n\n/**\n * Suffixes the title with the number of annotations added, e.g.\n *\n * ```text\n * Build #12 failed (24 annotations added)\n * ```\n */\nconst suffixTitle = (title: string, inputAnnotations: number): string => {\n const addedAnnotations =\n inputAnnotations > GITHUB_MAX_ANNOTATIONS\n ? GITHUB_MAX_ANNOTATIONS\n : inputAnnotations;\n\n return `${title} (${pluralise(addedAnnotations, 'annotation')} added)`;\n};\n\n/**\n * Enriches the summary with more context about the check run.\n */\nconst createEnrichedSummary = (\n summary: string,\n inputAnnotations: number,\n): string =>\n [\n summary,\n ...(inputAnnotations > GITHUB_MAX_ANNOTATIONS\n ? [\n `${inputAnnotations} annotations were provided, but only the first ${GITHUB_MAX_ANNOTATIONS} are visible in GitHub.`,\n ]\n : []),\n ].join('\\n\\n');\n\n/**\n * {@link https://docs.github.com/en/rest/reference/checks#create-a-check-run}\n */\ninterface CreateCheckRunParameters {\n /**\n * Adds information from your analysis to specific lines of code.\n * Annotations are visible on GitHub in the **Checks** and **Files changed**\n * tab of the pull request.\n */\n annotations: Annotation[];\n\n /**\n * The final conclusion of the check.\n */\n conclusion: 'failure' | 'success';\n\n /**\n * The name of the check. For example, \"code-coverage\".\n */\n name: string;\n\n /**\n * The summary of the check run. This parameter supports Markdown.\n */\n summary: string;\n\n /**\n * The details of the check run. This parameter supports Markdown.\n */\n text?: string;\n\n /**\n * The title of the check run.\n */\n title: string;\n}\n\n/**\n * Asynchronously creates a GitHub check run with annotations.\n *\n * The first 50 `annotations` are written in full to GitHub.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with the `checks:write` permission\n * must be present on the environment.\n */\nexport const createCheckRun = async ({\n annotations,\n conclusion,\n name,\n summary,\n text,\n title,\n}: CreateCheckRunParameters): Promise<void> => {\n const dir = process.cwd();\n\n const [commitId, { owner, repo }] = await Promise.all([\n Git.getHeadCommitId({ dir }),\n Git.getOwnerAndRepo({ dir }),\n ]);\n\n const client = await createRestClient({ auth: apiTokenFromEnvironment() });\n\n await client.checks.create({\n conclusion,\n head_sha: commitId,\n name,\n output: {\n annotations: annotations.slice(0, GITHUB_MAX_ANNOTATIONS),\n summary: createEnrichedSummary(summary, annotations.length),\n text,\n title: suffixTitle(title, annotations.length),\n },\n owner,\n repo,\n });\n};\n"],
4
+ "sourcesContent": ["import type { Endpoints } from '@octokit/types';\n\nimport { pluralise } from '../../utils/logging.js';\nimport * as Git from '../git/index.js';\n\nimport { apiTokenFromEnvironment } from './environment.js';\nimport { createRestClient } from './octokit.js';\n\ntype Output = NonNullable<\n Endpoints['PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}']['parameters']['output']\n>;\n\nexport type Annotation = NonNullable<Output['annotations']>[number];\n\nconst GITHUB_MAX_ANNOTATIONS = 50;\n\n/**\n * Suffixes the title with the number of annotations added, e.g.\n *\n * ```text\n * Build #12 failed (24 annotations added)\n * ```\n */\nconst suffixTitle = (title: string, inputAnnotations: number): string => {\n const addedAnnotations =\n inputAnnotations > GITHUB_MAX_ANNOTATIONS\n ? GITHUB_MAX_ANNOTATIONS\n : inputAnnotations;\n\n return `${title} (${pluralise(addedAnnotations, 'annotation')} added)`;\n};\n\n/**\n * Enriches the summary with more context about the check run.\n */\nconst createEnrichedSummary = (\n summary: string,\n inputAnnotations: number,\n): string =>\n [\n summary,\n ...(inputAnnotations > GITHUB_MAX_ANNOTATIONS\n ? [\n `${inputAnnotations} annotations were provided, but only the first ${GITHUB_MAX_ANNOTATIONS} are visible in GitHub.`,\n ]\n : []),\n ].join('\\n\\n');\n\n/**\n * {@link https://docs.github.com/en/rest/reference/checks#create-a-check-run}\n */\ninterface CreateCheckRunParameters {\n /**\n * Adds information from your analysis to specific lines of code.\n * Annotations are visible on GitHub in the **Checks** and **Files changed**\n * tab of the pull request.\n */\n annotations: Annotation[];\n\n /**\n * The final conclusion of the check.\n */\n conclusion: 'failure' | 'success';\n\n /**\n * The name of the check. For example, \"code-coverage\".\n */\n name: string;\n\n /**\n * The summary of the check run. This parameter supports Markdown.\n */\n summary: string;\n\n /**\n * The details of the check run. This parameter supports Markdown.\n */\n text?: string;\n\n /**\n * The title of the check run.\n */\n title: string;\n}\n\n/**\n * Asynchronously creates a GitHub check run with annotations.\n *\n * The first 50 `annotations` are written in full to GitHub.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with the `checks:write` permission\n * must be present on the environment.\n */\nexport const createCheckRun = async ({\n annotations,\n conclusion,\n name,\n summary,\n text,\n title,\n}: CreateCheckRunParameters): Promise<void> => {\n const dir = process.cwd();\n\n const [commitId, { owner, repo }] = await Promise.all([\n Git.getHeadCommitId({ dir }),\n Git.getOwnerAndRepo({ dir }),\n ]);\n\n const client = await createRestClient({ auth: apiTokenFromEnvironment() });\n\n await client.checks.create({\n conclusion,\n head_sha: commitId,\n name,\n output: {\n annotations: annotations.slice(0, GITHUB_MAX_ANNOTATIONS),\n summary: createEnrichedSummary(summary, annotations.length),\n text,\n title: suffixTitle(title, annotations.length),\n },\n owner,\n repo,\n });\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qBAA0B;AAC1B,UAAqB;AAErB,yBAAwC;AACxC,qBAAiC;AAQjC,MAAM,yBAAyB;AAS/B,MAAM,cAAc,CAAC,OAAe,qBAAqC;AACvE,QAAM,mBACJ,mBAAmB,yBACf,yBACA;AAEN,SAAO,GAAG,KAAK,SAAK,0BAAU,kBAAkB,YAAY,CAAC;AAC/D;AAKA,MAAM,wBAAwB,CAC5B,SACA,qBAEA;AAAA,EACE;AAAA,EACA,GAAI,mBAAmB,yBACnB;AAAA,IACE,GAAG,gBAAgB,kDAAkD,sBAAsB;AAAA,EAC7F,IACA,CAAC;AACP,EAAE,KAAK,MAAM;AA+CR,MAAM,iBAAiB,OAAO;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA+C;AAC7C,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,CAAC,UAAU,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACpD,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,IAC3B,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,EAC7B,CAAC;AAED,QAAM,SAAS,UAAM,iCAAiB,EAAE,UAAM,4CAAwB,EAAE,CAAC;AAEzE,QAAM,OAAO,OAAO,OAAO;AAAA,IACzB;AAAA,IACA,UAAU;AAAA,IACV;AAAA,IACA,QAAQ;AAAA,MACN,aAAa,YAAY,MAAM,GAAG,sBAAsB;AAAA,MACxD,SAAS,sBAAsB,SAAS,YAAY,MAAM;AAAA,MAC1D;AAAA,MACA,OAAO,YAAY,OAAO,YAAY,MAAM;AAAA,IAC9C;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -23,7 +23,7 @@ __export(environment_exports, {
23
23
  enabledFromEnvironment: () => enabledFromEnvironment
24
24
  });
25
25
  module.exports = __toCommonJS(environment_exports);
26
- var import_env = require("../../utils/env");
26
+ var import_env = require("../../utils/env.js");
27
27
  const buildNameFromEnvironment = (env = process.env) => {
28
28
  if (env.BUILDKITE_BUILD_NUMBER) {
29
29
  return `Build #${env.BUILDKITE_BUILD_NUMBER}`;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/github/environment.ts"],
4
- "sourcesContent": ["import { isCiEnv } from '../../utils/env';\n\n/**\n * Returns the name of the build as seen in GitHub status checks.\n *\n * This is driven off of environment variables and falls back to `Build`.\n */\nexport const buildNameFromEnvironment = (env = process.env): string => {\n if (env.BUILDKITE_BUILD_NUMBER) {\n return `Build #${env.BUILDKITE_BUILD_NUMBER}`;\n }\n\n if (env.GITHUB_RUN_NUMBER) {\n return `${env.GITHUB_WORKFLOW ?? 'Build'} #${env.GITHUB_RUN_NUMBER}`;\n }\n\n return 'Build';\n};\n\n/**\n * Whether GitHub API interactions should be enabled.\n *\n * This checks environment variables to see if the code is executing in a CI\n * environment and has access to a GitHub API token.\n */\nexport const enabledFromEnvironment = (env = process.env): boolean =>\n // Running in a CI environment.\n isCiEnv(env) &&\n // Has an API token at the ready.\n Boolean(apiTokenFromEnvironment(env));\n\n/**\n * Tries to return a GitHub API token from the environment.\n */\nexport const apiTokenFromEnvironment = (\n env = process.env,\n): string | undefined => env.GITHUB_API_TOKEN ?? env.GITHUB_TOKEN;\n"],
4
+ "sourcesContent": ["import { isCiEnv } from '../../utils/env.js';\n\n/**\n * Returns the name of the build as seen in GitHub status checks.\n *\n * This is driven off of environment variables and falls back to `Build`.\n */\nexport const buildNameFromEnvironment = (env = process.env): string => {\n if (env.BUILDKITE_BUILD_NUMBER) {\n return `Build #${env.BUILDKITE_BUILD_NUMBER}`;\n }\n\n if (env.GITHUB_RUN_NUMBER) {\n return `${env.GITHUB_WORKFLOW ?? 'Build'} #${env.GITHUB_RUN_NUMBER}`;\n }\n\n return 'Build';\n};\n\n/**\n * Whether GitHub API interactions should be enabled.\n *\n * This checks environment variables to see if the code is executing in a CI\n * environment and has access to a GitHub API token.\n */\nexport const enabledFromEnvironment = (env = process.env): boolean =>\n // Running in a CI environment.\n isCiEnv(env) &&\n // Has an API token at the ready.\n Boolean(apiTokenFromEnvironment(env));\n\n/**\n * Tries to return a GitHub API token from the environment.\n */\nexport const apiTokenFromEnvironment = (\n env = process.env,\n): string | undefined => env.GITHUB_API_TOKEN ?? env.GITHUB_TOKEN;\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,iBAAwB;AAOjB,MAAM,2BAA2B,CAAC,MAAM,QAAQ,QAAgB;AACrE,MAAI,IAAI,wBAAwB;AAC9B,WAAO,UAAU,IAAI,sBAAsB;AAAA,EAC7C;AAEA,MAAI,IAAI,mBAAmB;AACzB,WAAO,GAAG,IAAI,mBAAmB,OAAO,KAAK,IAAI,iBAAiB;AAAA,EACpE;AAEA,SAAO;AACT;AAQO,MAAM,yBAAyB,CAAC,MAAM,QAAQ;AAAA;AAAA,MAEnD,oBAAQ,GAAG;AAAA,EAEX,QAAQ,wBAAwB,GAAG,CAAC;AAAA;AAK/B,MAAM,0BAA0B,CACrC,MAAM,QAAQ,QACS,IAAI,oBAAoB,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
- export type { Annotation } from './checkRun';
2
- export { buildNameFromEnvironment } from './environment';
3
- export { createCheckRun } from './checkRun';
4
- export { enabledFromEnvironment } from './environment';
5
- export { getPullRequestNumber } from './pullRequest';
6
- export { putIssueComment } from './issueComment';
7
- export { readFileChanges, uploadAllFileChanges, uploadFileChanges, } from './push';
1
+ export type { Annotation } from './checkRun.js';
2
+ export { buildNameFromEnvironment } from './environment.js';
3
+ export { createCheckRun } from './checkRun.js';
4
+ export { enabledFromEnvironment } from './environment.js';
5
+ export { getPullRequestNumber } from './pullRequest.js';
6
+ export { putIssueComment } from './issueComment.js';
7
+ export { readFileChanges, uploadAllFileChanges, uploadFileChanges, } from './push.js';
@@ -28,12 +28,12 @@ __export(github_exports, {
28
28
  uploadFileChanges: () => import_push.uploadFileChanges
29
29
  });
30
30
  module.exports = __toCommonJS(github_exports);
31
- var import_environment = require("./environment");
32
- var import_checkRun = require("./checkRun");
33
- var import_environment2 = require("./environment");
34
- var import_pullRequest = require("./pullRequest");
35
- var import_issueComment = require("./issueComment");
36
- var import_push = require("./push");
31
+ var import_environment = require("./environment.js");
32
+ var import_checkRun = require("./checkRun.js");
33
+ var import_environment2 = require("./environment.js");
34
+ var import_pullRequest = require("./pullRequest.js");
35
+ var import_issueComment = require("./issueComment.js");
36
+ var import_push = require("./push.js");
37
37
  // Annotate the CommonJS export names for ESM import in node:
38
38
  0 && (module.exports = {
39
39
  buildNameFromEnvironment,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/github/index.ts"],
4
- "sourcesContent": ["export type { Annotation } from './checkRun';\nexport { buildNameFromEnvironment } from './environment';\nexport { createCheckRun } from './checkRun';\nexport { enabledFromEnvironment } from './environment';\nexport { getPullRequestNumber } from './pullRequest';\nexport { putIssueComment } from './issueComment';\nexport {\n readFileChanges,\n uploadAllFileChanges,\n uploadFileChanges,\n} from './push';\n"],
4
+ "sourcesContent": ["export type { Annotation } from './checkRun.js';\nexport { buildNameFromEnvironment } from './environment.js';\nexport { createCheckRun } from './checkRun.js';\nexport { enabledFromEnvironment } from './environment.js';\nexport { getPullRequestNumber } from './pullRequest.js';\nexport { putIssueComment } from './issueComment.js';\nexport {\n readFileChanges,\n uploadAllFileChanges,\n uploadFileChanges,\n} from './push.js';\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,yBAAyC;AACzC,sBAA+B;AAC/B,IAAAA,sBAAuC;AACvC,yBAAqC;AACrC,0BAAgC;AAChC,kBAIO;",
6
6
  "names": ["import_environment"]
7
7
  }
@@ -31,10 +31,10 @@ __export(issueComment_exports, {
31
31
  putIssueComment: () => putIssueComment
32
32
  });
33
33
  module.exports = __toCommonJS(issueComment_exports);
34
- var Git = __toESM(require("../git"));
35
- var import_environment = require("./environment");
36
- var import_octokit = require("./octokit");
37
- var import_pullRequest = require("./pullRequest");
34
+ var Git = __toESM(require("../git/index.js"));
35
+ var import_environment = require("./environment.js");
36
+ var import_octokit = require("./octokit.js");
37
+ var import_pullRequest = require("./pullRequest.js");
38
38
  const getUserId = async (client) => {
39
39
  const { data } = await client.users.getAuthenticated();
40
40
  return data.id;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/github/issueComment.ts"],
4
- "sourcesContent": ["import type { Octokit } from '@octokit/rest';\n\nimport * as Git from '../git';\n\nimport { apiTokenFromEnvironment } from './environment';\nimport { createRestClient } from './octokit';\nimport { getPullRequestNumber } from './pullRequest';\n\nconst getUserId = async (client: Octokit): Promise<number> => {\n const { data } = await client.users.getAuthenticated();\n\n return data.id;\n};\n\n/**\n * https://docs.github.com/en/rest/reference/issues#create-an-issue-comment\n */\ninterface PutIssueCommentParameters {\n /**\n * The body of the issue comment.\n *\n * An explicit `null` value will remove the comment, if `internalId` is provided.\n */\n body: string | null;\n\n /**\n * An internal identifier for the issue comment.\n *\n * This can be used to scope a given `put` to a particular comment, preventing\n * it from clobbering other comments from the same bot or user.\n *\n * The identifier is embedded as hidden content in the comment body.\n */\n internalId?: string;\n\n env?: Record<string, string | undefined>;\n\n /**\n * The number that identifies the GitHub issue.\n *\n * If this is not provided, the number will be inferred from the GitHub Repos\n * API by finding the latest pull request associated with the head commit.\n *\n * https://docs.github.com/en/rest/reference/repos#list-pull-requests-associated-with-a-commit\n */\n issueNumber?: number;\n\n /**\n * The ID of authenticated bot or user that is putting the issue comment.\n *\n * This drives our `put` behaviour, which tries to locate and edit an existing\n * comment before creating a new one. If this is not provided, the ID will be\n * inferred from the GitHub Users API.\n *\n * https://docs.github.com/en/rest/reference/users#get-the-authenticated-user\n *\n * If you're at SEEK and using BuildAgency's GitHub API integration, you may\n * use `'seek-build-agency'` as an optimisation to skip the user lookup.\n *\n * https://api.github.com/users/buildagencygitapitoken[bot]\n */\n userId?: number | 'seek-build-agency';\n}\n\ninterface IssueComment {\n id: number;\n}\n\n/**\n * Asynchronously creates or updates a GitHub issue comment.\n *\n * This emulates `put` behaviour by overwriting the first existing comment by\n * the same author on the issue, enabling use cases like a persistent bot\n * comment at the top of the pull request that reflects the current status of a\n * CI check.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with write permissions must be present\n * on the environment.\n */\nexport const putIssueComment = async (\n params: PutIssueCommentParameters,\n): Promise<IssueComment | null> => {\n if (params.body === null && !params.internalId) {\n // It's dangerous to just delete the first comment, as it may not be\n // from the current flow.\n throw new Error('Cannot remove comment without an internalId');\n }\n\n const env = params.env ?? process.env;\n\n const dir = process.cwd();\n\n const { owner, repo } = await Git.getOwnerAndRepo({ dir });\n\n const client = await createRestClient({ auth: apiTokenFromEnvironment() });\n\n const issueNumber =\n params.issueNumber ?? (await getPullRequestNumber({ client, env }));\n\n if (!issueNumber) {\n throw new Error('Failed to infer an issue number');\n }\n\n const comments = await client.issues.listComments({\n issue_number: issueNumber,\n owner,\n repo,\n });\n\n const userId: number =\n params.userId === 'seek-build-agency'\n ? // https://api.github.com/users/buildagencygitapitoken[bot]\n 87109344\n : (params.userId ?? (await getUserId(client)));\n\n const commentId = comments.data.find(\n (comment) =>\n comment.user?.id === userId &&\n (params.internalId\n ? comment.body?.endsWith(`\\n\\n<!-- ${params.internalId} -->`)\n : true),\n )?.id;\n\n if (params.body === null) {\n if (commentId) {\n await client.issues.deleteComment({\n comment_id: commentId,\n owner,\n repo,\n });\n }\n\n return null;\n }\n\n const body = params.internalId\n ? [params.body.trim(), `<!-- ${params.internalId} -->`].join('\\n\\n')\n : params.body.trim();\n\n const response = await (commentId\n ? client.issues.updateComment({\n body,\n comment_id: commentId,\n issue_number: issueNumber,\n owner,\n repo,\n })\n : client.issues.createComment({\n body,\n issue_number: issueNumber,\n owner,\n repo,\n }));\n\n return {\n id: response.data.id,\n };\n};\n"],
4
+ "sourcesContent": ["import type { Octokit } from '@octokit/rest';\n\nimport * as Git from '../git/index.js';\n\nimport { apiTokenFromEnvironment } from './environment.js';\nimport { createRestClient } from './octokit.js';\nimport { getPullRequestNumber } from './pullRequest.js';\n\nconst getUserId = async (client: Octokit): Promise<number> => {\n const { data } = await client.users.getAuthenticated();\n\n return data.id;\n};\n\n/**\n * https://docs.github.com/en/rest/reference/issues#create-an-issue-comment\n */\ninterface PutIssueCommentParameters {\n /**\n * The body of the issue comment.\n *\n * An explicit `null` value will remove the comment, if `internalId` is provided.\n */\n body: string | null;\n\n /**\n * An internal identifier for the issue comment.\n *\n * This can be used to scope a given `put` to a particular comment, preventing\n * it from clobbering other comments from the same bot or user.\n *\n * The identifier is embedded as hidden content in the comment body.\n */\n internalId?: string;\n\n env?: Record<string, string | undefined>;\n\n /**\n * The number that identifies the GitHub issue.\n *\n * If this is not provided, the number will be inferred from the GitHub Repos\n * API by finding the latest pull request associated with the head commit.\n *\n * https://docs.github.com/en/rest/reference/repos#list-pull-requests-associated-with-a-commit\n */\n issueNumber?: number;\n\n /**\n * The ID of authenticated bot or user that is putting the issue comment.\n *\n * This drives our `put` behaviour, which tries to locate and edit an existing\n * comment before creating a new one. If this is not provided, the ID will be\n * inferred from the GitHub Users API.\n *\n * https://docs.github.com/en/rest/reference/users#get-the-authenticated-user\n *\n * If you're at SEEK and using BuildAgency's GitHub API integration, you may\n * use `'seek-build-agency'` as an optimisation to skip the user lookup.\n *\n * https://api.github.com/users/buildagencygitapitoken[bot]\n */\n userId?: number | 'seek-build-agency';\n}\n\ninterface IssueComment {\n id: number;\n}\n\n/**\n * Asynchronously creates or updates a GitHub issue comment.\n *\n * This emulates `put` behaviour by overwriting the first existing comment by\n * the same author on the issue, enabling use cases like a persistent bot\n * comment at the top of the pull request that reflects the current status of a\n * CI check.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with write permissions must be present\n * on the environment.\n */\nexport const putIssueComment = async (\n params: PutIssueCommentParameters,\n): Promise<IssueComment | null> => {\n if (params.body === null && !params.internalId) {\n // It's dangerous to just delete the first comment, as it may not be\n // from the current flow.\n throw new Error('Cannot remove comment without an internalId');\n }\n\n const env = params.env ?? process.env;\n\n const dir = process.cwd();\n\n const { owner, repo } = await Git.getOwnerAndRepo({ dir });\n\n const client = await createRestClient({ auth: apiTokenFromEnvironment() });\n\n const issueNumber =\n params.issueNumber ?? (await getPullRequestNumber({ client, env }));\n\n if (!issueNumber) {\n throw new Error('Failed to infer an issue number');\n }\n\n const comments = await client.issues.listComments({\n issue_number: issueNumber,\n owner,\n repo,\n });\n\n const userId: number =\n params.userId === 'seek-build-agency'\n ? // https://api.github.com/users/buildagencygitapitoken[bot]\n 87109344\n : (params.userId ?? (await getUserId(client)));\n\n const commentId = comments.data.find(\n (comment) =>\n comment.user?.id === userId &&\n (params.internalId\n ? comment.body?.endsWith(`\\n\\n<!-- ${params.internalId} -->`)\n : true),\n )?.id;\n\n if (params.body === null) {\n if (commentId) {\n await client.issues.deleteComment({\n comment_id: commentId,\n owner,\n repo,\n });\n }\n\n return null;\n }\n\n const body = params.internalId\n ? [params.body.trim(), `<!-- ${params.internalId} -->`].join('\\n\\n')\n : params.body.trim();\n\n const response = await (commentId\n ? client.issues.updateComment({\n body,\n comment_id: commentId,\n issue_number: issueNumber,\n owner,\n repo,\n })\n : client.issues.createComment({\n body,\n issue_number: issueNumber,\n owner,\n repo,\n }));\n\n return {\n id: response.data.id,\n };\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,UAAqB;AAErB,yBAAwC;AACxC,qBAAiC;AACjC,yBAAqC;AAErC,MAAM,YAAY,OAAO,WAAqC;AAC5D,QAAM,EAAE,KAAK,IAAI,MAAM,OAAO,MAAM,iBAAiB;AAErD,SAAO,KAAK;AACd;AAmEO,MAAM,kBAAkB,OAC7B,WACiC;AACjC,MAAI,OAAO,SAAS,QAAQ,CAAC,OAAO,YAAY;AAG9C,UAAM,IAAI,MAAM,6CAA6C;AAAA,EAC/D;AAEA,QAAM,MAAM,OAAO,OAAO,QAAQ;AAElC,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,EAAE,OAAO,KAAK,IAAI,MAAM,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAEzD,QAAM,SAAS,UAAM,iCAAiB,EAAE,UAAM,4CAAwB,EAAE,CAAC;AAEzE,QAAM,cACJ,OAAO,eAAgB,UAAM,yCAAqB,EAAE,QAAQ,IAAI,CAAC;AAEnE,MAAI,CAAC,aAAa;AAChB,UAAM,IAAI,MAAM,iCAAiC;AAAA,EACnD;AAEA,QAAM,WAAW,MAAM,OAAO,OAAO,aAAa;AAAA,IAChD,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,SACJ,OAAO,WAAW;AAAA;AAAA,IAEd;AAAA,MACC,OAAO,UAAW,MAAM,UAAU,MAAM;AAE/C,QAAM,YAAY,SAAS,KAAK;AAAA,IAC9B,CAAC,YACC,QAAQ,MAAM,OAAO,WACpB,OAAO,aACJ,QAAQ,MAAM,SAAS;AAAA;AAAA,OAAY,OAAO,UAAU,MAAM,IAC1D;AAAA,EACR,GAAG;AAEH,MAAI,OAAO,SAAS,MAAM;AACxB,QAAI,WAAW;AACb,YAAM,OAAO,OAAO,cAAc;AAAA,QAChC,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,OAAO,OAAO,aAChB,CAAC,OAAO,KAAK,KAAK,GAAG,QAAQ,OAAO,UAAU,MAAM,EAAE,KAAK,MAAM,IACjE,OAAO,KAAK,KAAK;AAErB,QAAM,WAAW,OAAO,YACpB,OAAO,OAAO,cAAc;AAAA,IAC1B;AAAA,IACA,YAAY;AAAA,IACZ,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,CAAC,IACD,OAAO,OAAO,cAAc;AAAA,IAC1B;AAAA,IACA,cAAc;AAAA,IACd;AAAA,IACA;AAAA,EACF,CAAC;AAEL,SAAO;AAAA,IACL,IAAI,SAAS,KAAK;AAAA,EACpB;AACF;",
6
6
  "names": []
7
7
  }
@@ -31,9 +31,9 @@ __export(pullRequest_exports, {
31
31
  getPullRequestNumber: () => getPullRequestNumber
32
32
  });
33
33
  module.exports = __toCommonJS(pullRequest_exports);
34
- var Git = __toESM(require("../git"));
35
- var import_environment = require("./environment");
36
- var import_octokit = require("./octokit");
34
+ var Git = __toESM(require("../git/index.js"));
35
+ var import_environment = require("./environment.js");
36
+ var import_octokit = require("./octokit.js");
37
37
  const getPullRequestNumber = async (params = {}) => {
38
38
  const env = params.env ?? process.env;
39
39
  const dir = process.cwd();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/api/github/pullRequest.ts"],
4
- "sourcesContent": ["import type { Octokit } from '@octokit/rest' with { 'resolution-mode': 'import' };\n\nimport * as Git from '../git';\n\nimport { apiTokenFromEnvironment } from './environment';\nimport { createRestClient } from './octokit';\n\ninterface GetPullRequestParameters {\n /**\n * A preconstructed Octokit client to interact with GitHub's APIs.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with write permissions must be\n * present on the environment if this is not provided.\n */\n client?: Octokit;\n\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Gets the number of the current pull request.\n *\n * This tries to extract the pull request from common CI environment variables,\n * and falls back to querying the GitHub Repos API for the latest pull request\n * associated with the head commit. An error is thrown if there are no\n * associated pull requests, or if they are all closed or locked.\n */\nexport const getPullRequestNumber = async (\n params: GetPullRequestParameters = {},\n): Promise<number> => {\n const env = params.env ?? process.env;\n\n const dir = process.cwd();\n\n const number = Number(\n env.BUILDKITE_PULL_REQUEST ??\n env.GITHUB_REF?.replace(/^refs\\/pull\\/(\\d+).*$/, '$1'),\n );\n\n if (Number.isSafeInteger(number)) {\n return number;\n }\n\n const client =\n params.client ??\n (await createRestClient({ auth: apiTokenFromEnvironment() }));\n\n const [commitId, { owner, repo }] = await Promise.all([\n Git.getHeadCommitId({ dir, env }),\n Git.getOwnerAndRepo({ dir }),\n ]);\n\n const response = await client.repos.listPullRequestsAssociatedWithCommit({\n commit_sha: commitId,\n owner,\n repo,\n });\n\n const data = response.data\n .filter((pr) => pr.state === 'open' && !pr.locked)\n .sort((a, b) => b.updated_at.localeCompare(a.updated_at));\n\n const pullRequestData = data[0];\n if (!pullRequestData) {\n throw new Error(\n `Commit ${commitId} is not associated with an open GitHub pull request`,\n );\n }\n\n return pullRequestData.number;\n};\n"],
4
+ "sourcesContent": ["import type { Octokit } from '@octokit/rest' with { 'resolution-mode': 'import' };\n\nimport * as Git from '../git/index.js';\n\nimport { apiTokenFromEnvironment } from './environment.js';\nimport { createRestClient } from './octokit.js';\n\ninterface GetPullRequestParameters {\n /**\n * A preconstructed Octokit client to interact with GitHub's APIs.\n *\n * A `GITHUB_API_TOKEN` or `GITHUB_TOKEN` with write permissions must be\n * present on the environment if this is not provided.\n */\n client?: Octokit;\n\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Gets the number of the current pull request.\n *\n * This tries to extract the pull request from common CI environment variables,\n * and falls back to querying the GitHub Repos API for the latest pull request\n * associated with the head commit. An error is thrown if there are no\n * associated pull requests, or if they are all closed or locked.\n */\nexport const getPullRequestNumber = async (\n params: GetPullRequestParameters = {},\n): Promise<number> => {\n const env = params.env ?? process.env;\n\n const dir = process.cwd();\n\n const number = Number(\n env.BUILDKITE_PULL_REQUEST ??\n env.GITHUB_REF?.replace(/^refs\\/pull\\/(\\d+).*$/, '$1'),\n );\n\n if (Number.isSafeInteger(number)) {\n return number;\n }\n\n const client =\n params.client ??\n (await createRestClient({ auth: apiTokenFromEnvironment() }));\n\n const [commitId, { owner, repo }] = await Promise.all([\n Git.getHeadCommitId({ dir, env }),\n Git.getOwnerAndRepo({ dir }),\n ]);\n\n const response = await client.repos.listPullRequestsAssociatedWithCommit({\n commit_sha: commitId,\n owner,\n repo,\n });\n\n const data = response.data\n .filter((pr) => pr.state === 'open' && !pr.locked)\n .sort((a, b) => b.updated_at.localeCompare(a.updated_at));\n\n const pullRequestData = data[0];\n if (!pullRequestData) {\n throw new Error(\n `Commit ${commitId} is not associated with an open GitHub pull request`,\n );\n }\n\n return pullRequestData.number;\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,UAAqB;AAErB,yBAAwC;AACxC,qBAAiC;AAsB1B,MAAM,uBAAuB,OAClC,SAAmC,CAAC,MAChB;AACpB,QAAM,MAAM,OAAO,OAAO,QAAQ;AAElC,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,SAAS;AAAA,IACb,IAAI,0BACF,IAAI,YAAY,QAAQ,yBAAyB,IAAI;AAAA,EACzD;AAEA,MAAI,OAAO,cAAc,MAAM,GAAG;AAChC,WAAO;AAAA,EACT;AAEA,QAAM,SACJ,OAAO,UACN,UAAM,iCAAiB,EAAE,UAAM,4CAAwB,EAAE,CAAC;AAE7D,QAAM,CAAC,UAAU,EAAE,OAAO,KAAK,CAAC,IAAI,MAAM,QAAQ,IAAI;AAAA,IACpD,IAAI,gBAAgB,EAAE,KAAK,IAAI,CAAC;AAAA,IAChC,IAAI,gBAAgB,EAAE,IAAI,CAAC;AAAA,EAC7B,CAAC;AAED,QAAM,WAAW,MAAM,OAAO,MAAM,qCAAqC;AAAA,IACvE,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,OAAO,SAAS,KACnB,OAAO,CAAC,OAAO,GAAG,UAAU,UAAU,CAAC,GAAG,MAAM,EAChD,KAAK,CAAC,GAAG,MAAM,EAAE,WAAW,cAAc,EAAE,UAAU,CAAC;AAE1D,QAAM,kBAAkB,KAAK,CAAC;AAC9B,MAAI,CAAC,iBAAiB;AACpB,UAAM,IAAI;AAAA,MACR,UAAU,QAAQ;AAAA,IACpB;AAAA,EACF;AAEA,SAAO,gBAAgB;AACzB;",
6
6
  "names": []
7
7
  }
@@ -1,4 +1,4 @@
1
- import * as Git from '../git';
1
+ import * as Git from '../git/index.js';
2
2
  interface UploadAllFileChangesParams {
3
3
  dir: string;
4
4
  /**
@@ -35,9 +35,9 @@ __export(push_exports, {
35
35
  module.exports = __toCommonJS(push_exports);
36
36
  var import_path = __toESM(require("path"));
37
37
  var import_fs_extra = __toESM(require("fs-extra"));
38
- var Git = __toESM(require("../git"));
39
- var import_environment = require("./environment");
40
- var import_octokit = require("./octokit");
38
+ var Git = __toESM(require("../git/index.js"));
39
+ var import_environment = require("./environment.js");
40
+ var import_octokit = require("./octokit.js");
41
41
  const uploadAllFileChanges = async ({
42
42
  branch,
43
43
  dir,