skuba 13.0.0-subpath-imports-20250730060533 → 13.0.0-subpath-imports-20251003052152

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 (266) hide show
  1. package/README.md +1 -2
  2. package/config/tsconfig.json +2 -1
  3. package/jest/moduleNameMapper.js +3 -11
  4. package/lib/cli/build/assets.js +4 -8
  5. package/lib/cli/build/assets.js.map +2 -2
  6. package/lib/cli/build/esbuild.d.ts +2 -1
  7. package/lib/cli/build/esbuild.js +5 -4
  8. package/lib/cli/build/esbuild.js.map +2 -2
  9. package/lib/cli/build/index.js +9 -5
  10. package/lib/cli/build/index.js.map +2 -2
  11. package/lib/cli/build/tsc.d.ts +9 -2
  12. package/lib/cli/build/tsc.js +76 -40
  13. package/lib/cli/build/tsc.js.map +3 -3
  14. package/lib/cli/configure/analyseDependencies.d.ts +2 -2
  15. package/lib/cli/configure/analyseDependencies.js.map +1 -1
  16. package/lib/cli/configure/analysis/package.d.ts +1 -1
  17. package/lib/cli/configure/analysis/package.js +1 -1
  18. package/lib/cli/configure/analysis/package.js.map +2 -2
  19. package/lib/cli/configure/ensureTemplateCompletion.d.ts +2 -2
  20. package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
  21. package/lib/cli/configure/getEntryPoint.d.ts +2 -2
  22. package/lib/cli/configure/getEntryPoint.js.map +1 -1
  23. package/lib/cli/configure/getProjectType.d.ts +2 -2
  24. package/lib/cli/configure/getProjectType.js.map +1 -1
  25. package/lib/cli/configure/processing/configFile.d.ts +1 -1
  26. package/lib/cli/configure/processing/configFile.js +48 -6
  27. package/lib/cli/configure/processing/configFile.js.map +2 -2
  28. package/lib/cli/configure/processing/package.js +8 -2
  29. package/lib/cli/configure/processing/package.js.map +2 -2
  30. package/lib/cli/init/getConfig.js +1 -1
  31. package/lib/cli/init/getConfig.js.map +2 -2
  32. package/lib/cli/init/git.js +1 -1
  33. package/lib/cli/init/git.js.map +2 -2
  34. package/lib/cli/init/index.js +4 -4
  35. package/lib/cli/init/index.js.map +3 -3
  36. package/lib/cli/lint/annotate/buildkite/eslint.js +1 -1
  37. package/lib/cli/lint/annotate/buildkite/eslint.js.map +2 -2
  38. package/lib/cli/lint/annotate/buildkite/index.js +1 -1
  39. package/lib/cli/lint/annotate/buildkite/index.js.map +2 -2
  40. package/lib/cli/lint/annotate/buildkite/internal.js +1 -1
  41. package/lib/cli/lint/annotate/buildkite/internal.js.map +2 -2
  42. package/lib/cli/lint/annotate/buildkite/prettier.js +1 -1
  43. package/lib/cli/lint/annotate/buildkite/prettier.js.map +2 -2
  44. package/lib/cli/lint/annotate/buildkite/tsc.js +1 -1
  45. package/lib/cli/lint/annotate/buildkite/tsc.js.map +2 -2
  46. package/lib/cli/lint/annotate/github/eslint.d.ts +1 -1
  47. package/lib/cli/lint/annotate/github/eslint.js.map +2 -2
  48. package/lib/cli/lint/annotate/github/index.js +3 -4
  49. package/lib/cli/lint/annotate/github/index.js.map +2 -2
  50. package/lib/cli/lint/annotate/github/internal.d.ts +1 -1
  51. package/lib/cli/lint/annotate/github/internal.js.map +2 -2
  52. package/lib/cli/lint/annotate/github/prettier.d.ts +1 -1
  53. package/lib/cli/lint/annotate/github/prettier.js.map +2 -2
  54. package/lib/cli/lint/annotate/github/tsc.d.ts +1 -1
  55. package/lib/cli/lint/annotate/github/tsc.js.map +2 -2
  56. package/lib/cli/lint/autofix.d.ts +1 -1
  57. package/lib/cli/lint/autofix.js +3 -3
  58. package/lib/cli/lint/autofix.js.map +2 -2
  59. package/lib/cli/lint/internal.js +1 -1
  60. package/lib/cli/lint/internal.js.map +2 -2
  61. package/lib/cli/lint/internalLints/patchRenovateConfig.js +3 -3
  62. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  63. package/lib/cli/lint/internalLints/refreshConfigFiles.js +5 -3
  64. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
  65. package/lib/cli/lint/internalLints/upgrade/index.d.ts +2 -2
  66. package/lib/cli/lint/internalLints/upgrade/index.js.map +1 -1
  67. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +3 -3
  68. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +2 -2
  69. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +4 -0
  70. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +162 -0
  71. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +7 -0
  72. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.d.ts +2 -0
  73. package/lib/{api/buildkite → cli/lint/internalLints/upgrade/patches/12.1.1}/index.js +12 -9
  74. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +7 -0
  75. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.d.ts +3 -0
  76. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +105 -0
  77. package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +7 -0
  78. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.d.ts +2 -0
  79. package/lib/{api/git/statusMatrix.js → cli/lint/internalLints/upgrade/patches/12.3.0/index.js} +18 -25
  80. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/index.js.map +7 -0
  81. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.d.ts +3 -0
  82. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js +100 -0
  83. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchApiTokenFromEnvironment.js.map +7 -0
  84. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.d.ts +3 -0
  85. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js +99 -0
  86. package/lib/cli/lint/internalLints/upgrade/patches/12.3.0/patchDockerfileSyntaxDirective.js.map +7 -0
  87. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.d.ts +2 -0
  88. package/lib/{api/buildkite/md.js → cli/lint/internalLints/upgrade/patches/12.4.0/index.js} +13 -11
  89. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/index.js.map +7 -0
  90. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.d.ts +3 -0
  91. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js +101 -0
  92. package/lib/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.js.map +7 -0
  93. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.d.ts +2 -0
  94. package/lib/{api/net → cli/lint/internalLints/upgrade/patches/13.0.0}/index.js +12 -6
  95. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.js.map +7 -0
  96. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.d.ts +13 -0
  97. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js +221 -0
  98. package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js.map +7 -0
  99. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +1 -1
  100. package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
  101. package/lib/cli/node/index.js +6 -0
  102. package/lib/cli/node/index.js.map +2 -2
  103. package/lib/cli/start/index.js +6 -0
  104. package/lib/cli/start/index.js.map +2 -2
  105. package/lib/cli/test/index.d.ts +1 -1
  106. package/lib/cli/test/index.js +18 -4
  107. package/lib/cli/test/index.js.map +2 -2
  108. package/lib/cli/test/reporters/github/annotations.d.ts +1 -1
  109. package/lib/cli/test/reporters/github/annotations.js.map +1 -1
  110. package/lib/cli/test/reporters/github/index.js +3 -4
  111. package/lib/cli/test/reporters/github/index.js.map +2 -2
  112. package/lib/index.d.ts +4 -4
  113. package/lib/index.js +4 -4
  114. package/lib/index.js.map +2 -2
  115. package/lib/utils/args.d.ts +2 -0
  116. package/lib/utils/args.js +5 -0
  117. package/lib/utils/args.js.map +2 -2
  118. package/lib/utils/dir.js +2 -2
  119. package/lib/utils/dir.js.map +3 -3
  120. package/lib/utils/manifest.d.ts +6 -2
  121. package/lib/utils/manifest.js +17 -8
  122. package/lib/utils/manifest.js.map +2 -2
  123. package/lib/utils/template.d.ts +1 -1
  124. package/package.json +19 -21
  125. package/template/base/_.prettierrc.js +1 -1
  126. package/template/base/_eslint.config.js +1 -1
  127. package/template/base/_pnpm-workspace.yaml +11 -0
  128. package/template/base/jest.config.ts +4 -0
  129. package/template/base/jest.setup.ts +1 -1
  130. package/template/express-rest-api/.buildkite/pipeline.yml +6 -0
  131. package/template/express-rest-api/.env +1 -1
  132. package/template/express-rest-api/.gantry/dev.yml +5 -1
  133. package/template/express-rest-api/.gantry/prod.yml +5 -1
  134. package/template/express-rest-api/Dockerfile +2 -2
  135. package/template/express-rest-api/Dockerfile.dev-deps +0 -2
  136. package/template/express-rest-api/README.md +5 -5
  137. package/template/express-rest-api/gantry.apply.yml +17 -1
  138. package/template/express-rest-api/package.json +11 -5
  139. package/template/express-rest-api/src/api/healthCheck.ts +2 -2
  140. package/template/express-rest-api/src/config.ts +7 -7
  141. package/template/express-rest-api/src/framework/logging.ts +11 -7
  142. package/template/express-rest-api/src/framework/metrics.ts +1 -1
  143. package/template/express-rest-api/src/listen.ts +6 -0
  144. package/template/express-rest-api/src/tracing.ts +56 -0
  145. package/template/greeter/Dockerfile +0 -2
  146. package/template/greeter/README.md +2 -2
  147. package/template/greeter/package.json +2 -2
  148. package/template/koa-rest-api/.buildkite/pipeline.yml +6 -0
  149. package/template/koa-rest-api/.env +1 -1
  150. package/template/koa-rest-api/.gantry/dev.yml +3 -3
  151. package/template/koa-rest-api/.gantry/prod.yml +3 -3
  152. package/template/koa-rest-api/Dockerfile +1 -1
  153. package/template/koa-rest-api/Dockerfile.dev-deps +0 -2
  154. package/template/koa-rest-api/README.md +6 -6
  155. package/template/koa-rest-api/gantry.apply.yml +15 -3
  156. package/template/koa-rest-api/package.json +10 -11
  157. package/template/koa-rest-api/src/api/healthCheck.ts +2 -2
  158. package/template/koa-rest-api/src/config.ts +7 -7
  159. package/template/koa-rest-api/src/framework/logging.ts +12 -8
  160. package/template/koa-rest-api/src/framework/metrics.ts +1 -1
  161. package/template/koa-rest-api/src/framework/server.test.ts +7 -8
  162. package/template/koa-rest-api/src/framework/server.ts +1 -4
  163. package/template/koa-rest-api/src/listen.ts +6 -0
  164. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +6 -2
  165. package/template/lambda-sqs-worker-cdk/.env +1 -1
  166. package/template/lambda-sqs-worker-cdk/Dockerfile +0 -2
  167. package/template/lambda-sqs-worker-cdk/README.md +8 -8
  168. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +54 -26
  169. package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +5 -22
  170. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +16 -9
  171. package/template/lambda-sqs-worker-cdk/infra/config.ts +34 -20
  172. package/template/lambda-sqs-worker-cdk/infra/index.ts +1 -1
  173. package/template/lambda-sqs-worker-cdk/package.json +7 -9
  174. package/template/lambda-sqs-worker-cdk/src/app.test.ts +91 -51
  175. package/template/lambda-sqs-worker-cdk/src/app.ts +10 -9
  176. package/template/lambda-sqs-worker-cdk/src/config.ts +11 -16
  177. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +10 -5
  178. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +48 -24
  179. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -11
  180. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -4
  181. package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +4 -1
  182. package/template/oss-npm-package/.github/workflows/release.yml +7 -8
  183. package/template/oss-npm-package/.github/workflows/validate.yml +6 -6
  184. package/template/oss-npm-package/README.md +1 -1
  185. package/template/oss-npm-package/_package.json +0 -3
  186. package/template/oss-npm-package/skuba.template.js +1 -1
  187. package/lib/api/buildkite/annotate.d.ts +0 -28
  188. package/lib/api/buildkite/annotate.js +0 -62
  189. package/lib/api/buildkite/annotate.js.map +0 -7
  190. package/lib/api/buildkite/index.d.ts +0 -3
  191. package/lib/api/buildkite/index.js.map +0 -7
  192. package/lib/api/buildkite/md.d.ts +0 -6
  193. package/lib/api/buildkite/md.js.map +0 -7
  194. package/lib/api/git/commit.d.ts +0 -15
  195. package/lib/api/git/commit.js +0 -52
  196. package/lib/api/git/commit.js.map +0 -7
  197. package/lib/api/git/commitAllChanges.d.ts +0 -19
  198. package/lib/api/git/commitAllChanges.js +0 -83
  199. package/lib/api/git/commitAllChanges.js.map +0 -7
  200. package/lib/api/git/currentBranch.d.ts +0 -10
  201. package/lib/api/git/currentBranch.js +0 -59
  202. package/lib/api/git/currentBranch.js.map +0 -7
  203. package/lib/api/git/findRoot.d.ts +0 -9
  204. package/lib/api/git/findRoot.js +0 -52
  205. package/lib/api/git/findRoot.js.map +0 -7
  206. package/lib/api/git/getChangedFiles.d.ts +0 -20
  207. package/lib/api/git/getChangedFiles.js +0 -81
  208. package/lib/api/git/getChangedFiles.js.map +0 -7
  209. package/lib/api/git/index.d.ts +0 -12
  210. package/lib/api/git/index.js +0 -61
  211. package/lib/api/git/index.js.map +0 -7
  212. package/lib/api/git/isFileGitIgnored.d.ts +0 -4
  213. package/lib/api/git/isFileGitIgnored.js +0 -49
  214. package/lib/api/git/isFileGitIgnored.js.map +0 -7
  215. package/lib/api/git/log.d.ts +0 -19
  216. package/lib/api/git/log.js +0 -71
  217. package/lib/api/git/log.js.map +0 -7
  218. package/lib/api/git/pull.d.ts +0 -35
  219. package/lib/api/git/pull.js +0 -69
  220. package/lib/api/git/pull.js.map +0 -7
  221. package/lib/api/git/push.d.ts +0 -52
  222. package/lib/api/git/push.js +0 -70
  223. package/lib/api/git/push.js.map +0 -7
  224. package/lib/api/git/remote.d.ts +0 -20
  225. package/lib/api/git/remote.js +0 -73
  226. package/lib/api/git/remote.js.map +0 -7
  227. package/lib/api/git/reset.d.ts +0 -12
  228. package/lib/api/git/reset.js +0 -62
  229. package/lib/api/git/reset.js.map +0 -7
  230. package/lib/api/git/statusMatrix.d.ts +0 -7
  231. package/lib/api/git/statusMatrix.js.map +0 -7
  232. package/lib/api/github/checkRun.d.ts +0 -44
  233. package/lib/api/github/checkRun.js +0 -81
  234. package/lib/api/github/checkRun.js.map +0 -7
  235. package/lib/api/github/environment.d.ts +0 -17
  236. package/lib/api/github/environment.js +0 -48
  237. package/lib/api/github/environment.js.map +0 -7
  238. package/lib/api/github/index.d.ts +0 -7
  239. package/lib/api/github/index.js +0 -48
  240. package/lib/api/github/index.js.map +0 -7
  241. package/lib/api/github/issueComment.d.ts +0 -61
  242. package/lib/api/github/issueComment.js +0 -99
  243. package/lib/api/github/issueComment.js.map +0 -7
  244. package/lib/api/github/octokit.d.ts +0 -6
  245. package/lib/api/github/octokit.js +0 -42
  246. package/lib/api/github/octokit.js.map +0 -7
  247. package/lib/api/github/pullRequest.d.ts +0 -21
  248. package/lib/api/github/pullRequest.js +0 -69
  249. package/lib/api/github/pullRequest.js.map +0 -7
  250. package/lib/api/github/push.d.ts +0 -85
  251. package/lib/api/github/push.js +0 -166
  252. package/lib/api/github/push.js.map +0 -7
  253. package/lib/api/net/compose.d.ts +0 -4
  254. package/lib/api/net/compose.js +0 -51
  255. package/lib/api/net/compose.js.map +0 -7
  256. package/lib/api/net/index.d.ts +0 -1
  257. package/lib/api/net/index.js.map +0 -7
  258. package/lib/api/net/socket.d.ts +0 -5
  259. package/lib/api/net/socket.js +0 -68
  260. package/lib/api/net/socket.js.map +0 -7
  261. package/lib/api/net/waitFor.d.ts +0 -22
  262. package/lib/api/net/waitFor.js +0 -40
  263. package/lib/api/net/waitFor.js.map +0 -7
  264. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/rewriteSrcImports.d.ts +0 -6
  265. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/rewriteSrcImports.js +0 -104
  266. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/rewriteSrcImports.js.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/api/git/index.ts"],
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
- "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
- "names": []
7
- }
@@ -1,4 +0,0 @@
1
- export declare const isFileGitIgnored: ({ absolutePath, gitRoot, }: {
2
- absolutePath: string;
3
- gitRoot: string;
4
- }) => Promise<boolean>;
@@ -1,49 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var isFileGitIgnored_exports = {};
30
- __export(isFileGitIgnored_exports, {
31
- isFileGitIgnored: () => isFileGitIgnored
32
- });
33
- module.exports = __toCommonJS(isFileGitIgnored_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_fs_extra = __toESM(require("fs-extra"));
36
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
37
- const isFileGitIgnored = ({
38
- absolutePath,
39
- gitRoot
40
- }) => import_isomorphic_git.default.isIgnored({
41
- dir: gitRoot,
42
- filepath: import_path.default.relative(gitRoot, absolutePath),
43
- fs: import_fs_extra.default
44
- });
45
- // Annotate the CommonJS export names for ESM import in node:
46
- 0 && (module.exports = {
47
- isFileGitIgnored
48
- });
49
- //# sourceMappingURL=isFileGitIgnored.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/api/git/isFileGitIgnored.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\nexport const isFileGitIgnored = ({\n absolutePath,\n gitRoot,\n}: {\n absolutePath: string;\n gitRoot: string;\n}): Promise<boolean> =>\n git.isIgnored({\n dir: gitRoot,\n filepath: path.relative(gitRoot, absolutePath),\n fs,\n });\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,4BAAgB;AAET,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AACF,MAIE,sBAAAA,QAAI,UAAU;AAAA,EACZ,KAAK;AAAA,EACL,UAAU,YAAAC,QAAK,SAAS,SAAS,YAAY;AAAA,EAC7C,oBAAAC;AACF,CAAC;",
6
- "names": ["git", "path", "fs"]
7
- }
@@ -1,19 +0,0 @@
1
- interface GetHeadCommitParameters {
2
- dir: string;
3
- env?: Record<string, string | undefined>;
4
- }
5
- /**
6
- * Gets the object ID of the head commit.
7
- *
8
- * This tries to extract the commit ID from common CI environment variables,
9
- * and falls back to the local Git repository log.
10
- */
11
- export declare const getHeadCommitId: ({ dir, env, }: GetHeadCommitParameters) => Promise<string>;
12
- /**
13
- * Gets the message of the head commit.
14
- *
15
- * This tries to extract the message from common CI environment variables,
16
- * and falls back to the local Git repository log.
17
- */
18
- export declare const getHeadCommitMessage: ({ dir, env, }: GetHeadCommitParameters) => Promise<string>;
19
- export {};
@@ -1,71 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var log_exports = {};
30
- __export(log_exports, {
31
- getHeadCommitId: () => getHeadCommitId,
32
- getHeadCommitMessage: () => getHeadCommitMessage
33
- });
34
- module.exports = __toCommonJS(log_exports);
35
- var import_fs_extra = __toESM(require("fs-extra"));
36
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
37
- const EMPTY_GIT_LOG_ERROR = new Error("Git log does not contain any commits");
38
- const getHeadCommitId = async ({
39
- dir,
40
- env = process.env
41
- }) => {
42
- const oidFromEnv = env.BUILDKITE_COMMIT ?? env.GITHUB_SHA;
43
- if (oidFromEnv) {
44
- return oidFromEnv;
45
- }
46
- const [headResult] = await import_isomorphic_git.default.log({ depth: 1, dir, fs: import_fs_extra.default });
47
- if (!headResult) {
48
- throw EMPTY_GIT_LOG_ERROR;
49
- }
50
- return headResult.oid;
51
- };
52
- const getHeadCommitMessage = async ({
53
- dir,
54
- env = process.env
55
- }) => {
56
- const messageFromEnv = env.BUILDKITE_MESSAGE;
57
- if (messageFromEnv) {
58
- return messageFromEnv;
59
- }
60
- const [headResult] = await import_isomorphic_git.default.log({ depth: 1, dir, fs: import_fs_extra.default });
61
- if (!headResult) {
62
- throw EMPTY_GIT_LOG_ERROR;
63
- }
64
- return headResult.commit.message;
65
- };
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- getHeadCommitId,
69
- getHeadCommitMessage
70
- });
71
- //# sourceMappingURL=log.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/api/git/log.ts"],
4
- "sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\ninterface GetHeadCommitParameters {\n dir: string;\n env?: Record<string, string | undefined>;\n}\n\nconst EMPTY_GIT_LOG_ERROR = new Error('Git log does not contain any commits');\n\n/**\n * Gets the object ID of the head commit.\n *\n * This tries to extract the commit ID from common CI environment variables,\n * and falls back to the local Git repository log.\n */\nexport const getHeadCommitId = async ({\n dir,\n env = process.env,\n}: GetHeadCommitParameters) => {\n const oidFromEnv = env.BUILDKITE_COMMIT ?? env.GITHUB_SHA;\n\n if (oidFromEnv) {\n return oidFromEnv;\n }\n\n const [headResult] = await git.log({ depth: 1, dir, fs });\n\n if (!headResult) {\n throw EMPTY_GIT_LOG_ERROR;\n }\n\n return headResult.oid;\n};\n\n/**\n * Gets the message of the head commit.\n *\n * This tries to extract the message from common CI environment variables,\n * and falls back to the local Git repository log.\n */\nexport const getHeadCommitMessage = async ({\n dir,\n env = process.env,\n}: GetHeadCommitParameters) => {\n const messageFromEnv = env.BUILDKITE_MESSAGE;\n\n if (messageFromEnv) {\n return messageFromEnv;\n }\n\n const [headResult] = await git.log({ depth: 1, dir, fs });\n\n if (!headResult) {\n throw EMPTY_GIT_LOG_ERROR;\n }\n\n return headResult.commit.message;\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAOhB,MAAM,sBAAsB,IAAI,MAAM,sCAAsC;AAQrE,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA,MAAM,QAAQ;AAChB,MAA+B;AAC7B,QAAM,aAAa,IAAI,oBAAoB,IAAI;AAE/C,MAAI,YAAY;AACd,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,UAAU,IAAI,MAAM,sBAAAA,QAAI,IAAI,EAAE,OAAO,GAAG,KAAK,oBAAAC,QAAG,CAAC;AAExD,MAAI,CAAC,YAAY;AACf,UAAM;AAAA,EACR;AAEA,SAAO,WAAW;AACpB;AAQO,MAAM,uBAAuB,OAAO;AAAA,EACzC;AAAA,EACA,MAAM,QAAQ;AAChB,MAA+B;AAC7B,QAAM,iBAAiB,IAAI;AAE3B,MAAI,gBAAgB;AAClB,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,UAAU,IAAI,MAAM,sBAAAD,QAAI,IAAI,EAAE,OAAO,GAAG,KAAK,oBAAAC,QAAG,CAAC;AAExD,MAAI,CAAC,YAAY;AACf,UAAM;AAAA,EACR;AAEA,SAAO,WAAW,OAAO;AAC3B;",
6
- "names": ["git", "fs"]
7
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * Use a GitHub app token to auth the Git push.
3
- *
4
- * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment
5
- * variables if `token` is not provided.
6
- */
7
- interface GitHubAppAuth {
8
- type: 'gitHubApp';
9
- token?: string;
10
- }
11
- interface PullParameters {
12
- /**
13
- * The auth mechanism for the push.
14
- *
15
- * Currently, only GitHub app tokens are supported.
16
- */
17
- auth: GitHubAppAuth;
18
- dir: string;
19
- /**
20
- * The local branch to fast forward.
21
- */
22
- ref: string;
23
- remote?: string;
24
- /**
25
- * The branch or tag on the remote to reference.
26
- *
27
- * This defaults to `ref`.
28
- */
29
- remoteRef?: string;
30
- }
31
- /**
32
- * Fast forwards the specified `ref` on the local Git repository to match the remote branch.
33
- */
34
- export declare const fastForwardBranch: ({ auth, dir, ref, remote, remoteRef, }: PullParameters) => Promise<void>;
35
- export {};
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var pull_exports = {};
30
- __export(pull_exports, {
31
- fastForwardBranch: () => fastForwardBranch
32
- });
33
- module.exports = __toCommonJS(pull_exports);
34
- var import_fs_extra = __toESM(require("fs-extra"));
35
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
36
- var import_node = __toESM(require("isomorphic-git/http/node"));
37
- var import_environment = require("../github/environment.js");
38
- var import_remote = require("./remote.js");
39
- const fastForwardBranch = async ({
40
- auth,
41
- dir,
42
- ref,
43
- remote,
44
- remoteRef
45
- }) => {
46
- const { owner, repo } = await (0, import_remote.getOwnerAndRepo)({ dir });
47
- const url = `https://github.com/${encodeURIComponent(
48
- owner
49
- )}/${encodeURIComponent(repo)}`;
50
- return import_isomorphic_git.default.fastForward({
51
- onAuth: () => ({
52
- username: "x-access-token",
53
- password: auth.token ?? (0, import_environment.apiTokenFromEnvironment)()
54
- }),
55
- dir,
56
- fs: import_fs_extra.default,
57
- http: import_node.default,
58
- ref,
59
- remote,
60
- remoteRef,
61
- url,
62
- singleBranch: true
63
- });
64
- };
65
- // Annotate the CommonJS export names for ESM import in node:
66
- 0 && (module.exports = {
67
- fastForwardBranch
68
- });
69
- //# sourceMappingURL=pull.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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.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
- "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
- "names": ["git", "fs", "http"]
7
- }
@@ -1,52 +0,0 @@
1
- /**
2
- * Use a GitHub app token to auth the Git push.
3
- *
4
- * This defaults to the `GITHUB_API_TOKEN` and `GITHUB_TOKEN` environment
5
- * variables if `token` is not provided.
6
- */
7
- interface GitHubAppAuth {
8
- type: 'gitHubApp';
9
- token?: string;
10
- }
11
- interface PushParameters {
12
- /**
13
- * The auth mechanism for the push.
14
- *
15
- * Currently, only GitHub app tokens are supported.
16
- */
17
- auth: GitHubAppAuth;
18
- dir: string;
19
- /**
20
- * The reference to push to the remote.
21
- *
22
- * This may be a commit, branch or tag in the local repository.
23
- */
24
- ref: string;
25
- remote?: string;
26
- /**
27
- * The destination branch or tag on the remote.
28
- *
29
- * This defaults to `ref`.
30
- */
31
- remoteRef?: string;
32
- /**
33
- * Forcefully override any conflicts.
34
- *
35
- * This defaults to `false`.
36
- */
37
- force?: boolean;
38
- }
39
- interface PushResult {
40
- ok: boolean;
41
- error: string | null;
42
- refs: Record<string, {
43
- ok: boolean;
44
- error: string;
45
- }>;
46
- headers?: Record<string, string> | undefined;
47
- }
48
- /**
49
- * Pushes the specified `ref` from the local Git repository to a remote.
50
- */
51
- export declare const push: ({ auth, dir, ref, remote, remoteRef, force, }: PushParameters) => Promise<PushResult>;
52
- export {};
@@ -1,70 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var push_exports = {};
30
- __export(push_exports, {
31
- push: () => push
32
- });
33
- module.exports = __toCommonJS(push_exports);
34
- var import_fs_extra = __toESM(require("fs-extra"));
35
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
36
- var import_node = __toESM(require("isomorphic-git/http/node"));
37
- var import_environment = require("../github/environment.js");
38
- var import_remote = require("./remote.js");
39
- const push = async ({
40
- auth,
41
- dir,
42
- ref,
43
- remote,
44
- remoteRef,
45
- force
46
- }) => {
47
- const { owner, repo } = await (0, import_remote.getOwnerAndRepo)({ dir });
48
- const url = `https://github.com/${encodeURIComponent(
49
- owner
50
- )}/${encodeURIComponent(repo)}`;
51
- return import_isomorphic_git.default.push({
52
- onAuth: () => ({
53
- username: "x-access-token",
54
- password: auth.token ?? (0, import_environment.apiTokenFromEnvironment)()
55
- }),
56
- dir,
57
- fs: import_fs_extra.default,
58
- http: import_node.default,
59
- ref,
60
- remote,
61
- remoteRef,
62
- url,
63
- force
64
- });
65
- };
66
- // Annotate the CommonJS export names for ESM import in node:
67
- 0 && (module.exports = {
68
- push
69
- });
70
- //# sourceMappingURL=push.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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.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
- "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
- "names": ["git", "fs", "http"]
7
- }
@@ -1,20 +0,0 @@
1
- interface GetOwnerAndRepoParameters {
2
- dir: string;
3
- env?: Record<string, string | undefined>;
4
- }
5
- /**
6
- * Extracts the owner and repository names from CI environment variables,
7
- * falling back to local Git remotes.
8
- *
9
- * Currently, only GitHub repository URLs are supported:
10
- *
11
- * ```console
12
- * git@github.com:seek-oss/skuba.git
13
- * https://github.com/seek-oss/skuba.git
14
- * ```
15
- */
16
- export declare const getOwnerAndRepo: ({ dir, env, }: GetOwnerAndRepoParameters) => Promise<{
17
- owner: string;
18
- repo: string;
19
- }>;
20
- export {};
@@ -1,73 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var remote_exports = {};
30
- __export(remote_exports, {
31
- getOwnerAndRepo: () => getOwnerAndRepo
32
- });
33
- module.exports = __toCommonJS(remote_exports);
34
- var import_fs_extra = __toESM(require("fs-extra"));
35
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
36
- const ownerRepoRegex = /github.com(?::|\/)(.+)\/(.+).git$/;
37
- const ownerAndRepoFromUrl = (url) => {
38
- const match = ownerRepoRegex.exec(url);
39
- const owner = match?.[1];
40
- const repo = match?.[2];
41
- return { owner, repo };
42
- };
43
- const getOwnerAndRepo = async ({
44
- dir,
45
- env = process.env
46
- }) => {
47
- if (env.GITHUB_REPOSITORY) {
48
- const [owner, repo] = env.GITHUB_REPOSITORY.split("/");
49
- if (owner && repo) {
50
- return { owner, repo };
51
- }
52
- }
53
- if (env.BUILDKITE_REPO) {
54
- const { owner, repo } = ownerAndRepoFromUrl(env.BUILDKITE_REPO);
55
- if (owner && repo) {
56
- return { owner, repo };
57
- }
58
- }
59
- const gitRoot = await import_isomorphic_git.default.findRoot({ filepath: dir, fs: import_fs_extra.default });
60
- const remotes = await import_isomorphic_git.default.listRemotes({ dir: gitRoot, fs: import_fs_extra.default });
61
- for (const { url } of remotes) {
62
- const { owner, repo } = ownerAndRepoFromUrl(url);
63
- if (owner && repo) {
64
- return { owner, repo };
65
- }
66
- }
67
- throw new Error("Could not find a GitHub remote");
68
- };
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
71
- getOwnerAndRepo
72
- });
73
- //# sourceMappingURL=remote.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/api/git/remote.ts"],
4
- "sourcesContent": ["import fs from 'fs-extra';\nimport git from 'isomorphic-git';\n\n/**\n * Matches the owner and repository names in a GitHub repository URL.\n *\n * For example, given the following input strings:\n *\n * ```console\n * git@github.com:seek-oss/skuba.git\n * https://github.com/seek-oss/skuba.git\n * ```\n *\n * This pattern will produce the following matches:\n *\n * 1. seek-oss\n * 2. skuba\n */\nconst ownerRepoRegex = /github.com(?::|\\/)(.+)\\/(.+).git$/;\n\nconst ownerAndRepoFromUrl = (url: string) => {\n const match = ownerRepoRegex.exec(url);\n\n const owner = match?.[1];\n const repo = match?.[2];\n\n return { owner, repo };\n};\n\ninterface GetOwnerAndRepoParameters {\n dir: string;\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Extracts the owner and repository names from CI environment variables,\n * falling back to local Git remotes.\n *\n * Currently, only GitHub repository URLs are supported:\n *\n * ```console\n * git@github.com:seek-oss/skuba.git\n * https://github.com/seek-oss/skuba.git\n * ```\n */\nexport const getOwnerAndRepo = async ({\n dir,\n env = process.env,\n}: GetOwnerAndRepoParameters): Promise<{ owner: string; repo: string }> => {\n if (env.GITHUB_REPOSITORY) {\n const [owner, repo] = env.GITHUB_REPOSITORY.split('/');\n\n if (owner && repo) {\n return { owner, repo };\n }\n }\n\n if (env.BUILDKITE_REPO) {\n const { owner, repo } = ownerAndRepoFromUrl(env.BUILDKITE_REPO);\n\n if (owner && repo) {\n return { owner, repo };\n }\n }\n\n const gitRoot = await git.findRoot({ filepath: dir, fs });\n\n const remotes = await git.listRemotes({ dir: gitRoot, fs });\n\n for (const { url } of remotes) {\n const { owner, repo } = ownerAndRepoFromUrl(url);\n\n if (owner && repo) {\n return { owner, repo };\n }\n }\n\n throw new Error('Could not find a GitHub remote');\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAe;AACf,4BAAgB;AAiBhB,MAAM,iBAAiB;AAEvB,MAAM,sBAAsB,CAAC,QAAgB;AAC3C,QAAM,QAAQ,eAAe,KAAK,GAAG;AAErC,QAAM,QAAQ,QAAQ,CAAC;AACvB,QAAM,OAAO,QAAQ,CAAC;AAEtB,SAAO,EAAE,OAAO,KAAK;AACvB;AAkBO,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA,MAAM,QAAQ;AAChB,MAA2E;AACzE,MAAI,IAAI,mBAAmB;AACzB,UAAM,CAAC,OAAO,IAAI,IAAI,IAAI,kBAAkB,MAAM,GAAG;AAErD,QAAI,SAAS,MAAM;AACjB,aAAO,EAAE,OAAO,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,MAAI,IAAI,gBAAgB;AACtB,UAAM,EAAE,OAAO,KAAK,IAAI,oBAAoB,IAAI,cAAc;AAE9D,QAAI,SAAS,MAAM;AACjB,aAAO,EAAE,OAAO,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,UAAU,MAAM,sBAAAA,QAAI,SAAS,EAAE,UAAU,KAAK,oBAAAC,QAAG,CAAC;AAExD,QAAM,UAAU,MAAM,sBAAAD,QAAI,YAAY,EAAE,KAAK,SAAS,oBAAAC,QAAG,CAAC;AAE1D,aAAW,EAAE,IAAI,KAAK,SAAS;AAC7B,UAAM,EAAE,OAAO,KAAK,IAAI,oBAAoB,GAAG;AAE/C,QAAI,SAAS,MAAM;AACjB,aAAO,EAAE,OAAO,KAAK;AAAA,IACvB;AAAA,EACF;AAEA,QAAM,IAAI,MAAM,gCAAgC;AAClD;",
6
- "names": ["git", "fs"]
7
- }
@@ -1,12 +0,0 @@
1
- interface ResetParameters {
2
- dir: string;
3
- branch: string;
4
- commitId: string;
5
- hard?: boolean;
6
- }
7
- /**
8
- * Resets the specified branch in the local Git repository to a particular
9
- * commit.
10
- */
11
- export declare const reset: ({ dir, branch, commitId, hard, }: ResetParameters) => Promise<void>;
12
- export {};
@@ -1,62 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var reset_exports = {};
30
- __export(reset_exports, {
31
- reset: () => reset
32
- });
33
- module.exports = __toCommonJS(reset_exports);
34
- var import_path = __toESM(require("path"));
35
- var import_fs_extra = __toESM(require("fs-extra"));
36
- var import_isomorphic_git = __toESM(require("isomorphic-git"));
37
- var import_statusMatrix = require("./statusMatrix.js");
38
- const reset = async ({
39
- dir,
40
- branch,
41
- commitId,
42
- hard
43
- }) => {
44
- await import_fs_extra.default.promises.writeFile(
45
- import_path.default.join(dir, ".git/refs/heads", branch),
46
- `${commitId}
47
- `
48
- );
49
- if (hard) {
50
- const allFiles = await import_isomorphic_git.default.statusMatrix({ dir, fs: import_fs_extra.default });
51
- const modifiedFiles = allFiles.filter((row) => row[import_statusMatrix.WORKDIR] > import_statusMatrix.UNMODIFIED && row[import_statusMatrix.STAGE] > import_statusMatrix.UNMODIFIED).map((row) => row[import_statusMatrix.FILEPATH]);
52
- await Promise.all(
53
- modifiedFiles.map((filePath) => import_fs_extra.default.promises.rm(filePath))
54
- );
55
- await import_isomorphic_git.default.checkout({ dir, fs: import_fs_extra.default, ref: branch, force: true });
56
- }
57
- };
58
- // Annotate the CommonJS export names for ESM import in node:
59
- 0 && (module.exports = {
60
- reset
61
- });
62
- //# sourceMappingURL=reset.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 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.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
- "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
- "names": ["fs", "path", "git"]
7
- }
@@ -1,7 +0,0 @@
1
- export declare const FILEPATH = 0;
2
- export declare const HEAD = 1;
3
- export declare const WORKDIR = 2;
4
- export declare const STAGE = 3;
5
- export declare const ABSENT = 0;
6
- export declare const UNMODIFIED = 1;
7
- export declare const MODIFIED = 2;
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/api/git/statusMatrix.ts"],
4
- "sourcesContent": ["// Based off https://isomorphic-git.org/docs/en/statusMatrix.html\n\n// Status matrix row indexes\nexport const FILEPATH = 0;\nexport const HEAD = 1;\nexport const WORKDIR = 2;\nexport const STAGE = 3;\n\n// Status matrix state\nexport const ABSENT = 0;\nexport const UNMODIFIED = 1;\nexport const MODIFIED = 2;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,WAAW;AACjB,MAAM,OAAO;AACb,MAAM,UAAU;AAChB,MAAM,QAAQ;AAGd,MAAM,SAAS;AACf,MAAM,aAAa;AACnB,MAAM,WAAW;",
6
- "names": []
7
- }