skuba 4.4.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/config/tsconfig.json +1 -0
  2. package/jest/moduleNameMapper.js +50 -78
  3. package/jest/moduleNameMapper.test.ts +4 -14
  4. package/jest/transform.js +10 -1
  5. package/jest/tsConfig.js +26 -0
  6. package/lib/api/buildkite/annotate.js +46 -33
  7. package/lib/api/buildkite/annotate.js.map +7 -1
  8. package/lib/api/buildkite/index.js +31 -7
  9. package/lib/api/buildkite/index.js.map +7 -1
  10. package/lib/api/buildkite/md.js +31 -8
  11. package/lib/api/buildkite/md.js.map +7 -1
  12. package/lib/api/git/commit.js +45 -17
  13. package/lib/api/git/commit.js.map +7 -1
  14. package/lib/api/git/commitAllChanges.js +57 -27
  15. package/lib/api/git/commitAllChanges.js.map +7 -1
  16. package/lib/api/git/currentBranch.js +50 -28
  17. package/lib/api/git/currentBranch.js.map +7 -1
  18. package/lib/api/git/getChangedFiles.js +49 -27
  19. package/lib/api/git/getChangedFiles.js.map +7 -1
  20. package/lib/api/git/index.js +54 -22
  21. package/lib/api/git/index.js.map +7 -1
  22. package/lib/api/git/log.js +63 -42
  23. package/lib/api/git/log.js.map +7 -1
  24. package/lib/api/git/pull.js +62 -31
  25. package/lib/api/git/pull.js.map +7 -1
  26. package/lib/api/git/push.js +63 -31
  27. package/lib/api/git/push.js.map +7 -1
  28. package/lib/api/git/remote.js +59 -56
  29. package/lib/api/git/remote.js.map +7 -1
  30. package/lib/api/git/reset.js +55 -27
  31. package/lib/api/git/reset.js.map +7 -1
  32. package/lib/api/git/statusMatrix.js +46 -13
  33. package/lib/api/git/statusMatrix.js.map +7 -1
  34. package/lib/api/github/checkRun.js +70 -79
  35. package/lib/api/github/checkRun.js.map +7 -1
  36. package/lib/api/github/environment.js +40 -33
  37. package/lib/api/github/environment.js.map +7 -1
  38. package/lib/api/github/index.js +47 -17
  39. package/lib/api/github/index.js.map +7 -1
  40. package/lib/api/github/issueComment.js +73 -81
  41. package/lib/api/github/issueComment.js.map +7 -1
  42. package/lib/api/github/pullRequest.js +60 -61
  43. package/lib/api/github/pullRequest.js.map +7 -1
  44. package/lib/api/github/push.js +138 -133
  45. package/lib/api/github/push.js.map +7 -1
  46. package/lib/api/jest/index.d.ts +2 -1
  47. package/lib/api/jest/index.js +35 -14
  48. package/lib/api/jest/index.js.map +7 -1
  49. package/lib/api/net/compose.js +45 -17
  50. package/lib/api/net/compose.js.map +7 -1
  51. package/lib/api/net/index.js +28 -5
  52. package/lib/api/net/index.js.map +7 -1
  53. package/lib/api/net/socket.js +58 -36
  54. package/lib/api/net/socket.js.map +7 -1
  55. package/lib/api/net/waitFor.js +38 -18
  56. package/lib/api/net/waitFor.js.map +7 -1
  57. package/lib/cli/adapter/eslint.js +95 -72
  58. package/lib/cli/adapter/eslint.js.map +7 -1
  59. package/lib/cli/adapter/prettier.js +135 -123
  60. package/lib/cli/adapter/prettier.js.map +7 -1
  61. package/lib/cli/build/args.d.ts +7 -0
  62. package/lib/cli/build/args.js +69 -0
  63. package/lib/cli/build/args.js.map +7 -0
  64. package/lib/cli/build/esbuild.d.ts +5 -0
  65. package/lib/cli/build/esbuild.js +128 -0
  66. package/lib/cli/build/esbuild.js.map +7 -0
  67. package/lib/cli/build/index.d.ts +1 -1
  68. package/lib/cli/build/index.js +68 -5
  69. package/lib/cli/build/index.js.map +7 -1
  70. package/lib/cli/build/tsc.d.ts +1 -1
  71. package/lib/cli/build/tsc.js +34 -23
  72. package/lib/cli/build/tsc.js.map +7 -1
  73. package/lib/cli/buildPackage.js +53 -23
  74. package/lib/cli/buildPackage.js.map +7 -1
  75. package/lib/cli/configure/addEmptyExports.d.ts +5 -0
  76. package/lib/cli/configure/addEmptyExports.js +67 -0
  77. package/lib/cli/configure/addEmptyExports.js.map +7 -0
  78. package/lib/cli/configure/analyseConfiguration.js +61 -31
  79. package/lib/cli/configure/analyseConfiguration.js.map +7 -1
  80. package/lib/cli/configure/analyseDependencies.js +122 -113
  81. package/lib/cli/configure/analyseDependencies.js.map +7 -1
  82. package/lib/cli/configure/analysis/diff.js +37 -11
  83. package/lib/cli/configure/analysis/diff.js.map +7 -1
  84. package/lib/cli/configure/analysis/files.js +49 -22
  85. package/lib/cli/configure/analysis/files.js.map +7 -1
  86. package/lib/cli/configure/analysis/git.js +46 -16
  87. package/lib/cli/configure/analysis/git.js.map +7 -1
  88. package/lib/cli/configure/analysis/package.js +99 -52
  89. package/lib/cli/configure/analysis/package.js.map +7 -1
  90. package/lib/cli/configure/analysis/project.js +90 -54
  91. package/lib/cli/configure/analysis/project.js.map +7 -1
  92. package/lib/cli/configure/dependencies/index.js +40 -13
  93. package/lib/cli/configure/dependencies/index.js.map +7 -1
  94. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js +57 -32
  95. package/lib/cli/configure/dependencies/seekDatadogCustomMetrics.js.map +7 -1
  96. package/lib/cli/configure/dependencies/seekKoala.js +53 -31
  97. package/lib/cli/configure/dependencies/seekKoala.js.map +7 -1
  98. package/lib/cli/configure/dependencies/skuba.js +49 -27
  99. package/lib/cli/configure/dependencies/skuba.js.map +7 -1
  100. package/lib/cli/configure/dependencies/skubaDeps.js +49 -28
  101. package/lib/cli/configure/dependencies/skubaDeps.js.map +7 -1
  102. package/lib/cli/configure/dependencies/skubaDive.js +65 -38
  103. package/lib/cli/configure/dependencies/skubaDive.js.map +7 -1
  104. package/lib/cli/configure/ensureTemplateCompletion.js +69 -41
  105. package/lib/cli/configure/ensureTemplateCompletion.js.map +7 -1
  106. package/lib/cli/configure/getEntryPoint.js +62 -32
  107. package/lib/cli/configure/getEntryPoint.js.map +7 -1
  108. package/lib/cli/configure/getProjectType.js +50 -28
  109. package/lib/cli/configure/getProjectType.js.map +7 -1
  110. package/lib/cli/configure/index.js +134 -109
  111. package/lib/cli/configure/index.js.map +7 -1
  112. package/lib/cli/configure/modules/eslint.js +57 -26
  113. package/lib/cli/configure/modules/eslint.js.map +7 -1
  114. package/lib/cli/configure/modules/ignore.js +37 -14
  115. package/lib/cli/configure/modules/ignore.js.map +7 -1
  116. package/lib/cli/configure/modules/index.js +53 -28
  117. package/lib/cli/configure/modules/index.js.map +7 -1
  118. package/lib/cli/configure/modules/jest.js +82 -47
  119. package/lib/cli/configure/modules/jest.js.map +7 -1
  120. package/lib/cli/configure/modules/nodemon.js +29 -6
  121. package/lib/cli/configure/modules/nodemon.js.map +7 -1
  122. package/lib/cli/configure/modules/package.js +113 -92
  123. package/lib/cli/configure/modules/package.js.map +7 -1
  124. package/lib/cli/configure/modules/prettier.js +48 -19
  125. package/lib/cli/configure/modules/prettier.js.map +7 -1
  126. package/lib/cli/configure/modules/renovate.js +52 -39
  127. package/lib/cli/configure/modules/renovate.js.map +7 -1
  128. package/lib/cli/configure/modules/serverless.js +33 -15
  129. package/lib/cli/configure/modules/serverless.js.map +7 -1
  130. package/lib/cli/configure/modules/skubaDive.js +63 -37
  131. package/lib/cli/configure/modules/skubaDive.js.map +7 -1
  132. package/lib/cli/configure/modules/tsconfig.js +84 -63
  133. package/lib/cli/configure/modules/tsconfig.js.map +7 -1
  134. package/lib/cli/configure/modules/tslint.js +29 -6
  135. package/lib/cli/configure/modules/tslint.js.map +7 -1
  136. package/lib/cli/configure/processing/deleteFiles.js +30 -8
  137. package/lib/cli/configure/processing/deleteFiles.js.map +7 -1
  138. package/lib/cli/configure/processing/ignoreFile.js +65 -59
  139. package/lib/cli/configure/processing/ignoreFile.js.map +7 -1
  140. package/lib/cli/configure/processing/javascript.js +35 -15
  141. package/lib/cli/configure/processing/javascript.js.map +7 -1
  142. package/lib/cli/configure/processing/json.js +51 -20
  143. package/lib/cli/configure/processing/json.js.map +7 -1
  144. package/lib/cli/configure/processing/loadFiles.js +30 -8
  145. package/lib/cli/configure/processing/loadFiles.js.map +7 -1
  146. package/lib/cli/configure/processing/module.js +37 -14
  147. package/lib/cli/configure/processing/module.js.map +7 -1
  148. package/lib/cli/configure/processing/package.js +73 -43
  149. package/lib/cli/configure/processing/package.js.map +7 -1
  150. package/lib/cli/configure/processing/prettier.js +37 -11
  151. package/lib/cli/configure/processing/prettier.js.map +7 -1
  152. package/lib/cli/configure/processing/record.js +54 -31
  153. package/lib/cli/configure/processing/record.js.map +7 -1
  154. package/lib/cli/configure/processing/typescript.js +176 -158
  155. package/lib/cli/configure/processing/typescript.js.map +7 -1
  156. package/lib/cli/configure/refreshIgnoreFiles.js +64 -40
  157. package/lib/cli/configure/refreshIgnoreFiles.js.map +7 -1
  158. package/lib/cli/configure/types.js +16 -2
  159. package/lib/cli/configure/types.js.map +7 -1
  160. package/lib/cli/format.js +58 -31
  161. package/lib/cli/format.js.map +7 -1
  162. package/lib/cli/help.js +31 -8
  163. package/lib/cli/help.js.map +7 -1
  164. package/lib/cli/init/getConfig.d.ts +1 -1
  165. package/lib/cli/init/getConfig.js +238 -207
  166. package/lib/cli/init/getConfig.js.map +7 -1
  167. package/lib/cli/init/git.js +70 -63
  168. package/lib/cli/init/git.js.map +7 -1
  169. package/lib/cli/init/index.js +133 -100
  170. package/lib/cli/init/index.js.map +7 -1
  171. package/lib/cli/init/prompts.js +84 -54
  172. package/lib/cli/init/prompts.js.map +7 -1
  173. package/lib/cli/init/types.js +52 -52
  174. package/lib/cli/init/types.js.map +7 -1
  175. package/lib/cli/init/validation.js +34 -12
  176. package/lib/cli/init/validation.js.map +7 -1
  177. package/lib/cli/init/writePackageJson.js +51 -22
  178. package/lib/cli/init/writePackageJson.js.map +7 -1
  179. package/lib/cli/lint/annotate/buildkite/eslint.js +34 -28
  180. package/lib/cli/lint/annotate/buildkite/eslint.js.map +7 -1
  181. package/lib/cli/lint/annotate/buildkite/index.js +50 -44
  182. package/lib/cli/lint/annotate/buildkite/index.js.map +7 -1
  183. package/lib/cli/lint/annotate/buildkite/prettier.js +41 -35
  184. package/lib/cli/lint/annotate/buildkite/prettier.js.map +7 -1
  185. package/lib/cli/lint/annotate/buildkite/tsc.js +39 -39
  186. package/lib/cli/lint/annotate/buildkite/tsc.js.map +7 -1
  187. package/lib/cli/lint/annotate/github/eslint.js +40 -16
  188. package/lib/cli/lint/annotate/github/eslint.js.map +7 -1
  189. package/lib/cli/lint/annotate/github/index.js +55 -51
  190. package/lib/cli/lint/annotate/github/index.js.map +7 -1
  191. package/lib/cli/lint/annotate/github/prettier.js +36 -13
  192. package/lib/cli/lint/annotate/github/prettier.js.map +7 -1
  193. package/lib/cli/lint/annotate/github/tsc.js +52 -52
  194. package/lib/cli/lint/annotate/github/tsc.js.map +7 -1
  195. package/lib/cli/lint/annotate/index.d.ts +1 -1
  196. package/lib/cli/lint/annotate/index.js +33 -10
  197. package/lib/cli/lint/annotate/index.js.map +7 -1
  198. package/lib/cli/lint/autofix.js +122 -117
  199. package/lib/cli/lint/autofix.js.map +7 -1
  200. package/lib/cli/lint/eslint.js +48 -18
  201. package/lib/cli/lint/eslint.js.map +7 -1
  202. package/lib/cli/lint/external.js +102 -81
  203. package/lib/cli/lint/external.js.map +7 -1
  204. package/lib/cli/lint/index.js +42 -18
  205. package/lib/cli/lint/index.js.map +7 -1
  206. package/lib/cli/lint/internal.js +54 -21
  207. package/lib/cli/lint/internal.js.map +7 -1
  208. package/lib/cli/lint/prettier.js +48 -18
  209. package/lib/cli/lint/prettier.js.map +7 -1
  210. package/lib/cli/lint/tsc.js +56 -32
  211. package/lib/cli/lint/tsc.js.map +7 -1
  212. package/lib/cli/lint/types.js +16 -2
  213. package/lib/cli/lint/types.js.map +7 -1
  214. package/lib/cli/node.js +65 -58
  215. package/lib/cli/node.js.map +7 -1
  216. package/lib/cli/release.js +29 -6
  217. package/lib/cli/release.js.map +7 -1
  218. package/lib/cli/start.js +61 -24
  219. package/lib/cli/start.js.map +7 -1
  220. package/lib/cli/test/index.js +35 -11
  221. package/lib/cli/test/index.js.map +7 -1
  222. package/lib/cli/test/reporters/github/annotations.js +89 -92
  223. package/lib/cli/test/reporters/github/annotations.js.map +7 -1
  224. package/lib/cli/test/reporters/github/index.js +68 -68
  225. package/lib/cli/test/reporters/github/index.js.map +7 -1
  226. package/lib/cli/version.js +31 -8
  227. package/lib/cli/version.js.map +7 -1
  228. package/lib/enquirer.d.js +2 -0
  229. package/lib/enquirer.d.js.map +7 -0
  230. package/lib/index.d.ts +6 -0
  231. package/lib/index.js +45 -41
  232. package/lib/index.js.map +7 -1
  233. package/lib/skuba.js +45 -38
  234. package/lib/skuba.js.map +7 -1
  235. package/lib/utils/args.js +97 -96
  236. package/lib/utils/args.js.map +7 -1
  237. package/lib/utils/command.js +64 -33
  238. package/lib/utils/command.js.map +7 -1
  239. package/lib/utils/copy.js +88 -51
  240. package/lib/utils/copy.js.map +7 -1
  241. package/lib/utils/dir.js +79 -67
  242. package/lib/utils/dir.js.map +7 -1
  243. package/lib/utils/env.js +27 -7
  244. package/lib/utils/env.js.map +7 -1
  245. package/lib/utils/error.js +58 -56
  246. package/lib/utils/error.js.map +7 -1
  247. package/lib/utils/exec.js +139 -110
  248. package/lib/utils/exec.js.map +7 -1
  249. package/lib/utils/help.js +31 -8
  250. package/lib/utils/help.js.map +7 -1
  251. package/lib/utils/logging.js +52 -24
  252. package/lib/utils/logging.js.map +7 -1
  253. package/lib/utils/logo.js +65 -27
  254. package/lib/utils/logo.js.map +7 -1
  255. package/lib/utils/manifest.d.ts +1 -0
  256. package/lib/utils/manifest.js +65 -51
  257. package/lib/utils/manifest.js.map +7 -1
  258. package/lib/utils/port.js +38 -17
  259. package/lib/utils/port.js.map +7 -1
  260. package/lib/utils/template.js +106 -87
  261. package/lib/utils/template.js.map +7 -1
  262. package/lib/utils/validation.js +43 -18
  263. package/lib/utils/validation.js.map +7 -1
  264. package/lib/utils/version.js +72 -82
  265. package/lib/utils/version.js.map +7 -1
  266. package/lib/utils/wait.js +52 -25
  267. package/lib/utils/wait.js.map +7 -1
  268. package/lib/utils/worker.js +59 -44
  269. package/lib/utils/worker.js.map +7 -1
  270. package/lib/wrapper/function-arguments.d.js +2 -0
  271. package/lib/wrapper/function-arguments.d.js.map +7 -0
  272. package/lib/wrapper/functionHandler.js +56 -29
  273. package/lib/wrapper/functionHandler.js.map +7 -1
  274. package/lib/wrapper/http.js +66 -56
  275. package/lib/wrapper/http.js.map +7 -1
  276. package/lib/wrapper/index.js +9 -21
  277. package/lib/wrapper/index.js.map +7 -1
  278. package/lib/wrapper/main.js +39 -20
  279. package/lib/wrapper/main.js.map +7 -1
  280. package/lib/wrapper/requestListener.js +50 -35
  281. package/lib/wrapper/requestListener.js.map +7 -1
  282. package/package.json +85 -79
  283. package/template/base/jest.config.ts +0 -6
  284. package/template/base/jest.setup.ts +2 -0
  285. package/template/base/tsconfig.json +2 -2
  286. package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
  287. package/template/express-rest-api/.nvmrc +1 -1
  288. package/template/express-rest-api/Dockerfile +1 -1
  289. package/template/express-rest-api/Dockerfile.dev-deps +1 -1
  290. package/template/express-rest-api/package.json +14 -14
  291. package/template/greeter/.buildkite/pipeline.yml +1 -1
  292. package/template/greeter/.nvmrc +1 -1
  293. package/template/greeter/Dockerfile +1 -1
  294. package/template/greeter/package.json +11 -11
  295. package/template/greeter/src/app.test.ts +3 -1
  296. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
  297. package/template/koa-rest-api/.nvmrc +1 -1
  298. package/template/koa-rest-api/Dockerfile +1 -1
  299. package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
  300. package/template/koa-rest-api/package.json +20 -21
  301. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +3 -7
  302. package/template/koa-rest-api/src/api/jobs/postJob.ts +2 -2
  303. package/template/koa-rest-api/src/framework/validation.test.ts +17 -15
  304. package/template/koa-rest-api/src/framework/validation.ts +66 -12
  305. package/template/koa-rest-api/src/testing/types.ts +5 -10
  306. package/template/koa-rest-api/src/types/jobs.ts +5 -10
  307. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +4 -4
  308. package/template/lambda-sqs-worker/Dockerfile +1 -1
  309. package/template/lambda-sqs-worker/package.json +16 -20
  310. package/template/lambda-sqs-worker/src/app.ts +2 -2
  311. package/template/lambda-sqs-worker/src/framework/validation.test.ts +37 -17
  312. package/template/lambda-sqs-worker/src/framework/validation.ts +10 -2
  313. package/template/lambda-sqs-worker/src/services/jobScorer.ts +2 -2
  314. package/template/lambda-sqs-worker/src/testing/types.ts +5 -10
  315. package/template/lambda-sqs-worker/src/types/jobScorer.ts +9 -16
  316. package/template/lambda-sqs-worker/src/types/pipelineEvents.ts +13 -20
  317. package/template/lambda-sqs-worker/tsconfig.json +13 -0
  318. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +4 -4
  319. package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
  320. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +6 -0
  321. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  322. package/template/lambda-sqs-worker-cdk/infra/index.ts +2 -2
  323. package/template/lambda-sqs-worker-cdk/package.json +14 -14
  324. package/template/lambda-sqs-worker-cdk/shared/context-types.ts +16 -25
  325. package/template/lambda-sqs-worker-cdk/tsconfig.json +13 -0
  326. package/template/oss-npm-package/.nvmrc +1 -1
  327. package/template/oss-npm-package/_package.json +1 -1
  328. package/template/private-npm-package/.nvmrc +1 -1
  329. package/template/private-npm-package/_package.json +1 -1
  330. package/jest/resolver.js +0 -24
@@ -1,41 +1,41 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
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;
24
19
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.createTscAnnotations = void 0;
27
- const Buildkite = __importStar(require("../../../../api/buildkite"));
28
- const createTscAnnotations = (tscOk, tscOutputStream) => !tscOk
29
- ? [
30
- '**tsc**',
31
- Buildkite.md.terminal(tscOutputStream
32
- .output()
33
- .split('\n')
34
- .filter(Boolean)
35
- .filter((line) => !line.startsWith('TSFILE: '))
36
- .join('\n')
37
- .trim()),
38
- ]
39
- : [];
40
- exports.createTscAnnotations = createTscAnnotations;
41
- //# sourceMappingURL=tsc.js.map
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var tsc_exports = {};
26
+ __export(tsc_exports, {
27
+ createTscAnnotations: () => createTscAnnotations
28
+ });
29
+ module.exports = __toCommonJS(tsc_exports);
30
+ var Buildkite = __toESM(require("../../../../api/buildkite"));
31
+ const createTscAnnotations = (tscOk, tscOutputStream) => !tscOk ? [
32
+ "**tsc**",
33
+ Buildkite.md.terminal(
34
+ tscOutputStream.output().split("\n").filter(Boolean).filter((line) => !line.startsWith("TSFILE: ")).join("\n").trim()
35
+ )
36
+ ] : [];
37
+ // Annotate the CommonJS export names for ESM import in node:
38
+ 0 && (module.exports = {
39
+ createTscAnnotations
40
+ });
41
+ //# sourceMappingURL=tsc.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/buildkite/tsc.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAAuD;AAGhD,MAAM,oBAAoB,GAAG,CAClC,KAAc,EACd,eAAkC,EACxB,EAAE,CACZ,CAAC,KAAK;IACJ,CAAC,CAAC;QACE,SAAS;QACT,SAAS,CAAC,EAAE,CAAC,QAAQ,CACnB,eAAe;aACZ,MAAM,EAAE;aACR,KAAK,CAAC,IAAI,CAAC;aACX,MAAM,CAAC,OAAO,CAAC;aACf,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;aAC9C,IAAI,CAAC,IAAI,CAAC;aACV,IAAI,EAAE,CACV;KACF;IACH,CAAC,CAAC,EAAE,CAAC;AAjBI,QAAA,oBAAoB,wBAiBxB"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/buildkite/tsc.ts"],
4
+ "sourcesContent": ["import * as Buildkite from '../../../../api/buildkite';\nimport type { StreamInterceptor } from '../../../../cli/lint/external';\n\nexport const createTscAnnotations = (\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): string[] =>\n !tscOk\n ? [\n '**tsc**',\n Buildkite.md.terminal(\n tscOutputStream\n .output()\n .split('\\n')\n .filter(Boolean)\n .filter((line) => !line.startsWith('TSFILE: '))\n .join('\\n')\n .trim(),\n ),\n ]\n : [];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAA2B;AAGpB,MAAM,uBAAuB,CAClC,OACA,oBAEA,CAAC,QACG;AAAA,EACE;AAAA,EACA,UAAU,GAAG;AAAA,IACX,gBACG,OAAO,EACP,MAAM,IAAI,EACV,OAAO,OAAO,EACd,OAAO,CAAC,SAAS,CAAC,KAAK,WAAW,UAAU,CAAC,EAC7C,KAAK,IAAI,EACT,KAAK;AAAA,EACV;AACF,IACA,CAAC;",
6
+ "names": []
7
+ }
@@ -1,21 +1,45 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createEslintAnnotations = void 0;
4
- const createEslintAnnotations = (eslint) => [...eslint.errors, ...eslint.warnings].flatMap((result) => result.messages.map((message) => {
5
- // Annotations only support start_column and end_column on the same line.
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var eslint_exports = {};
20
+ __export(eslint_exports, {
21
+ createEslintAnnotations: () => createEslintAnnotations
22
+ });
23
+ module.exports = __toCommonJS(eslint_exports);
24
+ const createEslintAnnotations = (eslint) => [...eslint.errors, ...eslint.warnings].flatMap(
25
+ (result) => result.messages.map((message) => {
6
26
  const isSameLine = message.line === message.endLine;
7
27
  const startColumn = isSameLine && message.column;
8
- const endColumn = (isSameLine && message.endColumn) || startColumn;
28
+ const endColumn = isSameLine && message.endColumn || startColumn;
9
29
  return {
10
- annotation_level: message.severity === 2 ? 'failure' : 'warning',
11
- start_line: message.line ?? 1,
12
- end_line: message.endLine ?? message.line ?? 1,
13
- ...(startColumn && { start_column: startColumn }),
14
- ...(endColumn && { end_column: endColumn }),
15
- message: message.message,
16
- path: result.filePath,
17
- title: `ESLint${message.ruleId ? ` (${message.ruleId})` : ''}`,
30
+ annotation_level: message.severity === 2 ? "failure" : "warning",
31
+ start_line: message.line ?? 1,
32
+ end_line: message.endLine ?? message.line ?? 1,
33
+ ...startColumn && { start_column: startColumn },
34
+ ...endColumn && { end_column: endColumn },
35
+ message: message.message,
36
+ path: result.filePath,
37
+ title: `ESLint${message.ruleId ? ` (${message.ruleId})` : ""}`
18
38
  };
19
- }));
20
- exports.createEslintAnnotations = createEslintAnnotations;
21
- //# sourceMappingURL=eslint.js.map
39
+ })
40
+ );
41
+ // Annotate the CommonJS export names for ESM import in node:
42
+ 0 && (module.exports = {
43
+ createEslintAnnotations
44
+ });
45
+ //# sourceMappingURL=eslint.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"eslint.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/eslint.ts"],"names":[],"mappings":";;;AAGO,MAAM,uBAAuB,GAAG,CACrC,MAAoB,EACC,EAAE,CACvB,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAoB,CAAC,MAAM,EAAE,EAAE,CAC3E,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAqB,EAAE;IACjD,yEAAyE;IACzE,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC;IACpD,MAAM,WAAW,GAAG,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC;IACjD,MAAM,SAAS,GAAG,CAAC,UAAU,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,WAAW,CAAC;IAEnE,OAAO;QACL,gBAAgB,EAAE,OAAO,CAAC,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QAChE,UAAU,EAAE,OAAO,CAAC,IAAI,IAAI,CAAC;QAC7B,QAAQ,EAAE,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC;QAC9C,GAAG,CAAC,WAAW,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;QACjD,GAAG,CAAC,SAAS,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;QAC3C,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,KAAK,EAAE,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;KAC/D,CAAC;AACJ,CAAC,CAAC,CACH,CAAC;AArBS,QAAA,uBAAuB,2BAqBhC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/github/eslint.ts"],
4
+ "sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { ESLintOutput } from '../../../../cli/adapter/eslint';\n\nexport const createEslintAnnotations = (\n eslint: ESLintOutput,\n): GitHub.Annotation[] =>\n [...eslint.errors, ...eslint.warnings].flatMap<GitHub.Annotation>((result) =>\n result.messages.map((message): GitHub.Annotation => {\n // Annotations only support start_column and end_column on the same line.\n const isSameLine = message.line === message.endLine;\n const startColumn = isSameLine && message.column;\n const endColumn = (isSameLine && message.endColumn) || startColumn;\n\n return {\n annotation_level: message.severity === 2 ? 'failure' : 'warning',\n start_line: message.line ?? 1,\n end_line: message.endLine ?? message.line ?? 1,\n ...(startColumn && { start_column: startColumn }),\n ...(endColumn && { end_column: endColumn }),\n message: message.message,\n path: result.filePath,\n title: `ESLint${message.ruleId ? ` (${message.ruleId})` : ''}`,\n };\n }),\n );\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,0BAA0B,CACrC,WAEA,CAAC,GAAG,OAAO,QAAQ,GAAG,OAAO,QAAQ,EAAE;AAAA,EAA2B,CAAC,WACjE,OAAO,SAAS,IAAI,CAAC,YAA+B;AAElD,UAAM,aAAa,QAAQ,SAAS,QAAQ;AAC5C,UAAM,cAAc,cAAc,QAAQ;AAC1C,UAAM,YAAa,cAAc,QAAQ,aAAc;AAEvD,WAAO;AAAA,MACL,kBAAkB,QAAQ,aAAa,IAAI,YAAY;AAAA,MACvD,YAAY,QAAQ,QAAQ;AAAA,MAC5B,UAAU,QAAQ,WAAW,QAAQ,QAAQ;AAAA,MAC7C,GAAI,eAAe,EAAE,cAAc,YAAY;AAAA,MAC/C,GAAI,aAAa,EAAE,YAAY,UAAU;AAAA,MACzC,SAAS,QAAQ;AAAA,MACjB,MAAM,OAAO;AAAA,MACb,OAAO,SAAS,QAAQ,SAAS,KAAK,QAAQ,YAAY;AAAA,IAC5D;AAAA,EACF,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -1,55 +1,59 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
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;
24
19
  };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.createGitHubAnnotations = void 0;
27
- const GitHub = __importStar(require("../../../../api/github"));
28
- const environment_1 = require("../../../../api/github/environment");
29
- const eslint_1 = require("./eslint");
30
- const prettier_1 = require("./prettier");
31
- const tsc_1 = require("./tsc");
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var github_exports = {};
26
+ __export(github_exports, {
27
+ createGitHubAnnotations: () => createGitHubAnnotations
28
+ });
29
+ module.exports = __toCommonJS(github_exports);
30
+ var GitHub = __toESM(require("../../../../api/github"));
31
+ var import_environment = require("../../../../api/github/environment");
32
+ var import_eslint = require("./eslint");
33
+ var import_prettier = require("./prettier");
34
+ var import_tsc = require("./tsc");
32
35
  const createGitHubAnnotations = async (eslint, prettier, tscOk, tscOutputStream) => {
33
- if (!(0, environment_1.enabledFromEnvironment)()) {
34
- return;
35
- }
36
- const annotations = [
37
- ...(0, eslint_1.createEslintAnnotations)(eslint),
38
- ...(0, prettier_1.createPrettierAnnotations)(prettier),
39
- ...(0, tsc_1.createTscAnnotations)(tscOk, tscOutputStream),
40
- ];
41
- const isOk = eslint.ok && prettier.ok && tscOk;
42
- const summary = isOk
43
- ? '`skuba lint` passed.'
44
- : '`skuba lint` found issues that require triage.';
45
- const build = (0, environment_1.buildNameFromEnvironment)();
46
- await GitHub.createCheckRun({
47
- name: 'skuba/lint',
48
- summary,
49
- annotations,
50
- conclusion: isOk ? 'success' : 'failure',
51
- title: `${build} ${isOk ? 'passed' : 'failed'}`,
52
- });
36
+ if (!(0, import_environment.enabledFromEnvironment)()) {
37
+ return;
38
+ }
39
+ const annotations = [
40
+ ...(0, import_eslint.createEslintAnnotations)(eslint),
41
+ ...(0, import_prettier.createPrettierAnnotations)(prettier),
42
+ ...(0, import_tsc.createTscAnnotations)(tscOk, tscOutputStream)
43
+ ];
44
+ const isOk = eslint.ok && prettier.ok && tscOk;
45
+ const summary = isOk ? "`skuba lint` passed." : "`skuba lint` found issues that require triage.";
46
+ const build = (0, import_environment.buildNameFromEnvironment)();
47
+ await GitHub.createCheckRun({
48
+ name: "skuba/lint",
49
+ summary,
50
+ annotations,
51
+ conclusion: isOk ? "success" : "failure",
52
+ title: `${build} ${isOk ? "passed" : "failed"}`
53
+ });
53
54
  };
54
- exports.createGitHubAnnotations = createGitHubAnnotations;
55
- //# sourceMappingURL=index.js.map
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ createGitHubAnnotations
58
+ });
59
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+DAAiD;AACjD,oEAG4C;AAK5C,qCAAmD;AACnD,yCAAuD;AACvD,+BAA6C;AAEtC,MAAM,uBAAuB,GAAG,KAAK,EAC1C,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,EAClC,EAAE;IACF,IAAI,CAAC,IAAA,oCAAsB,GAAE,EAAE;QAC7B,OAAO;KACR;IAED,MAAM,WAAW,GAAwB;QACvC,GAAG,IAAA,gCAAuB,EAAC,MAAM,CAAC;QAClC,GAAG,IAAA,oCAAyB,EAAC,QAAQ,CAAC;QACtC,GAAG,IAAA,0BAAoB,EAAC,KAAK,EAAE,eAAe,CAAC;KAChD,CAAC;IAEF,MAAM,IAAI,GAAG,MAAM,CAAC,EAAE,IAAI,QAAQ,CAAC,EAAE,IAAI,KAAK,CAAC;IAE/C,MAAM,OAAO,GAAG,IAAI;QAClB,CAAC,CAAC,sBAAsB;QACxB,CAAC,CAAC,gDAAgD,CAAC;IAErD,MAAM,KAAK,GAAG,IAAA,sCAAwB,GAAE,CAAC;IAEzC,MAAM,MAAM,CAAC,cAAc,CAAC;QAC1B,IAAI,EAAE,YAAY;QAClB,OAAO;QACP,WAAW;QACX,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;QACxC,KAAK,EAAE,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;KAChD,CAAC,CAAC;AACL,CAAC,CAAC;AA/BW,QAAA,uBAAuB,2BA+BlC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/github/index.ts"],
4
+ "sourcesContent": ["import * as GitHub from '../../../../api/github';\nimport {\n buildNameFromEnvironment,\n enabledFromEnvironment,\n} from '../../../../api/github/environment';\nimport type { ESLintOutput } from '../../../../cli/adapter/eslint';\nimport type { PrettierOutput } from '../../../../cli/adapter/prettier';\nimport type { StreamInterceptor } from '../../../../cli/lint/external';\n\nimport { createEslintAnnotations } from './eslint';\nimport { createPrettierAnnotations } from './prettier';\nimport { createTscAnnotations } from './tsc';\n\nexport const createGitHubAnnotations = async (\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n) => {\n if (!enabledFromEnvironment()) {\n return;\n }\n\n const annotations: GitHub.Annotation[] = [\n ...createEslintAnnotations(eslint),\n ...createPrettierAnnotations(prettier),\n ...createTscAnnotations(tscOk, tscOutputStream),\n ];\n\n const isOk = eslint.ok && prettier.ok && tscOk;\n\n const summary = isOk\n ? '`skuba lint` passed.'\n : '`skuba lint` found issues that require triage.';\n\n const build = buildNameFromEnvironment();\n\n await GitHub.createCheckRun({\n name: 'skuba/lint',\n summary,\n annotations,\n conclusion: isOk ? 'success' : 'failure',\n title: `${build} ${isOk ? 'passed' : 'failed'}`,\n });\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAAwB;AACxB,yBAGO;AAKP,oBAAwC;AACxC,sBAA0C;AAC1C,iBAAqC;AAE9B,MAAM,0BAA0B,OACrC,QACA,UACA,OACA,oBACG;AACH,MAAI,KAAC,2CAAuB,GAAG;AAC7B;AAAA,EACF;AAEA,QAAM,cAAmC;AAAA,IACvC,OAAG,uCAAwB,MAAM;AAAA,IACjC,OAAG,2CAA0B,QAAQ;AAAA,IACrC,OAAG,iCAAqB,OAAO,eAAe;AAAA,EAChD;AAEA,QAAM,OAAO,OAAO,MAAM,SAAS,MAAM;AAEzC,QAAM,UAAU,OACZ,yBACA;AAEJ,QAAM,YAAQ,6CAAyB;AAEvC,QAAM,OAAO,eAAe;AAAA,IAC1B,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA,YAAY,OAAO,YAAY;AAAA,IAC/B,OAAO,GAAG,SAAS,OAAO,WAAW;AAAA,EACvC,CAAC;AACH;",
6
+ "names": []
7
+ }
@@ -1,16 +1,39 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPrettierAnnotations = void 0;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var prettier_exports = {};
20
+ __export(prettier_exports, {
21
+ createPrettierAnnotations: () => createPrettierAnnotations
22
+ });
23
+ module.exports = __toCommonJS(prettier_exports);
4
24
  const createPrettierAnnotations = (prettier) => prettier.result.errored.map((result) => {
5
- const message = result.err instanceof Error ? result.err.message : result.err;
6
- return {
7
- annotation_level: 'failure',
8
- start_line: 1,
9
- end_line: 1,
10
- path: result.filepath,
11
- message: message ? String(message) : 'This file has not been formatted.',
12
- title: 'Prettier',
13
- };
25
+ const message = result.err instanceof Error ? result.err.message : result.err;
26
+ return {
27
+ annotation_level: "failure",
28
+ start_line: 1,
29
+ end_line: 1,
30
+ path: result.filepath,
31
+ message: message ? String(message) : "This file has not been formatted.",
32
+ title: "Prettier"
33
+ };
34
+ });
35
+ // Annotate the CommonJS export names for ESM import in node:
36
+ 0 && (module.exports = {
37
+ createPrettierAnnotations
14
38
  });
15
- exports.createPrettierAnnotations = createPrettierAnnotations;
16
- //# sourceMappingURL=prettier.js.map
39
+ //# sourceMappingURL=prettier.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"prettier.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/prettier.ts"],"names":[],"mappings":";;;AAGO,MAAM,yBAAyB,GAAG,CACvC,QAAwB,EACH,EAAE,CACvB,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;IACrC,MAAM,OAAO,GACX,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;IAEhE,OAAO;QACL,gBAAgB,EAAE,SAAS;QAC3B,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,CAAC;QACX,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,mCAAmC;QACxE,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC,CAAC,CAAC;AAfQ,QAAA,yBAAyB,6BAejC"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/github/prettier.ts"],
4
+ "sourcesContent": ["import type * as GitHub from '../../../../api/github';\nimport type { PrettierOutput } from '../../../../cli/adapter/prettier';\n\nexport const createPrettierAnnotations = (\n prettier: PrettierOutput,\n): GitHub.Annotation[] =>\n prettier.result.errored.map((result) => {\n const message =\n result.err instanceof Error ? result.err.message : result.err;\n\n return {\n annotation_level: 'failure',\n start_line: 1,\n end_line: 1,\n path: result.filepath,\n message: message ? String(message) : 'This file has not been formatted.',\n title: 'Prettier',\n };\n });\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,4BAA4B,CACvC,aAEA,SAAS,OAAO,QAAQ,IAAI,CAAC,WAAW;AACtC,QAAM,UACJ,OAAO,eAAe,QAAQ,OAAO,IAAI,UAAU,OAAO;AAE5D,SAAO;AAAA,IACL,kBAAkB;AAAA,IAClB,YAAY;AAAA,IACZ,UAAU;AAAA,IACV,MAAM,OAAO;AAAA,IACb,SAAS,UAAU,OAAO,OAAO,IAAI;AAAA,IACrC,OAAO;AAAA,EACT;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -1,59 +1,59 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
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 });
4
11
  };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createTscAnnotations = void 0;
7
- const strip_ansi_1 = __importDefault(require("strip-ansi"));
8
- /**
9
- * Matches the `tsc │` prefix on each `tsc` log.
10
- */
11
- /**
12
- * Matches regular and pretty `tsc` output.
13
- *
14
- * For example, given the following input string:
15
- *
16
- * ```console
17
- * src/skuba.ts:43:7 - error TS2769: No overload matches this call.
18
- * Overload 1 of 2, '(obj: LogContext, msg?: string | undefined, ...args: any[]): void', gave the following error.
19
- * Argument of type 'unknown' is not assignable to parameter of type 'LogContext'.
20
- * Overload 2 of 2, '(msg?: string | undefined, ...args: any[]): void', gave the following error.
21
- * Argument of type 'unknown' is not assignable to parameter of type 'string | undefined'.
22
- * Type 'unknown' is not assignable to type 'string'.
23
- * ```
24
- *
25
- * This pattern will produce the following matches:
26
- *
27
- * 1. src/skuba.ts
28
- * 2. 43
29
- * 3. 7
30
- * 4. error
31
- * 5. 2769
32
- * 6. No overload matches this call [...] not assignable to type 'string'.
33
- */
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
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
22
+ mod
23
+ ));
24
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
+ var tsc_exports = {};
26
+ __export(tsc_exports, {
27
+ createTscAnnotations: () => createTscAnnotations
28
+ });
29
+ module.exports = __toCommonJS(tsc_exports);
30
+ var import_strip_ansi = __toESM(require("strip-ansi"));
34
31
  const tscOutputRegex = /([^\s].*)[\(:](\d+)[,:](\d+)(?:\):\s+|\s+-\s+)(error|warning|info)\s+TS(\d+)\s*:\s*([\s\S]*?)(?=\n\S)(?=\n\D)/g;
35
32
  const annotationLevelMap = {
36
- error: 'failure',
37
- warning: 'warning',
38
- info: 'notice',
33
+ error: "failure",
34
+ warning: "warning",
35
+ info: "notice"
39
36
  };
40
37
  const createTscAnnotations = (tscOk, tscOutputStream) => {
41
- if (tscOk) {
42
- return [];
43
- }
44
- const matches = (0, strip_ansi_1.default)(tscOutputStream.output()).matchAll(tscOutputRegex);
45
- return Array.from(matches).flatMap((match) => match?.length === 7
46
- ? {
47
- annotation_level: annotationLevelMap[match[4]],
48
- path: match[1],
49
- start_line: Number(match[2]),
50
- end_line: Number(match[2]),
51
- start_column: Number(match[3]),
52
- end_column: Number(match[3]),
53
- message: match[6].trim(),
54
- title: `tsc (TS${match[5]})`,
55
- }
56
- : []);
38
+ if (tscOk) {
39
+ return [];
40
+ }
41
+ const matches = (0, import_strip_ansi.default)(tscOutputStream.output()).matchAll(tscOutputRegex);
42
+ return Array.from(matches).flatMap(
43
+ (match) => match?.length === 7 ? {
44
+ annotation_level: annotationLevelMap[match[4]],
45
+ path: match[1],
46
+ start_line: Number(match[2]),
47
+ end_line: Number(match[2]),
48
+ start_column: Number(match[3]),
49
+ end_column: Number(match[3]),
50
+ message: match[6].trim(),
51
+ title: `tsc (TS${match[5]})`
52
+ } : []
53
+ );
57
54
  };
58
- exports.createTscAnnotations = createTscAnnotations;
59
- //# sourceMappingURL=tsc.js.map
55
+ // Annotate the CommonJS export names for ESM import in node:
56
+ 0 && (module.exports = {
57
+ createTscAnnotations
58
+ });
59
+ //# sourceMappingURL=tsc.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"tsc.js","sourceRoot":"","sources":["../../../../../src/cli/lint/annotate/github/tsc.ts"],"names":[],"mappings":";;;;;;AAAA,4DAAmC;AAOnC;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,cAAc,GAClB,gHAAgH,CAAC;AAEnH,MAAM,kBAAkB,GAGpB;IACF,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,QAAQ;CACf,CAAC;AAEK,MAAM,oBAAoB,GAAG,CAClC,KAAc,EACd,eAAkC,EACb,EAAE;IACvB,IAAI,KAAK,EAAE;QACT,OAAO,EAAE,CAAC;KACX;IAED,MAAM,OAAO,GAAG,IAAA,oBAAS,EAAC,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC7E,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAoB,CAAC,KAAK,EAAE,EAAE,CAC9D,KAAK,EAAE,MAAM,KAAK,CAAC;QACjB,CAAC,CAAC;YACE,gBAAgB,EAAE,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAa,CAAC;YAC1D,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;YACd,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5B,QAAQ,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC1B,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC9B,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC5B,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;YACxB,KAAK,EAAE,UAAU,KAAK,CAAC,CAAC,CAAC,GAAG;SAC7B;QACH,CAAC,CAAC,EAAE,CACP,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,oBAAoB,wBAuB/B"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/cli/lint/annotate/github/tsc.ts"],
4
+ "sourcesContent": ["import stripAnsi from 'strip-ansi';\n\nimport type * as GitHub from '../../../../api/github';\nimport type { StreamInterceptor } from '../../../../cli/lint/external';\n\ntype TscLevel = 'error' | 'warning' | 'info';\n\n/**\n * Matches the `tsc \u2502` prefix on each `tsc` log.\n */\n\n/**\n * Matches regular and pretty `tsc` output.\n *\n * For example, given the following input string:\n *\n * ```console\n * src/skuba.ts:43:7 - error TS2769: No overload matches this call.\n * Overload 1 of 2, '(obj: LogContext, msg?: string | undefined, ...args: any[]): void', gave the following error.\n * Argument of type 'unknown' is not assignable to parameter of type 'LogContext'.\n * Overload 2 of 2, '(msg?: string | undefined, ...args: any[]): void', gave the following error.\n * Argument of type 'unknown' is not assignable to parameter of type 'string | undefined'.\n * Type 'unknown' is not assignable to type 'string'.\n * ```\n *\n * This pattern will produce the following matches:\n *\n * 1. src/skuba.ts\n * 2. 43\n * 3. 7\n * 4. error\n * 5. 2769\n * 6. No overload matches this call [...] not assignable to type 'string'.\n */\nconst tscOutputRegex =\n /([^\\s].*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+TS(\\d+)\\s*:\\s*([\\s\\S]*?)(?=\\n\\S)(?=\\n\\D)/g;\n\nconst annotationLevelMap: Record<\n TscLevel,\n GitHub.Annotation['annotation_level']\n> = {\n error: 'failure',\n warning: 'warning',\n info: 'notice',\n};\n\nexport const createTscAnnotations = (\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): GitHub.Annotation[] => {\n if (tscOk) {\n return [];\n }\n\n const matches = stripAnsi(tscOutputStream.output()).matchAll(tscOutputRegex);\n return Array.from(matches).flatMap<GitHub.Annotation>((match) =>\n match?.length === 7\n ? {\n annotation_level: annotationLevelMap[match[4] as TscLevel],\n path: match[1],\n start_line: Number(match[2]),\n end_line: Number(match[2]),\n start_column: Number(match[3]),\n end_column: Number(match[3]),\n message: match[6].trim(),\n title: `tsc (TS${match[5]})`,\n }\n : [],\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAsB;AAkCtB,MAAM,iBACJ;AAEF,MAAM,qBAGF;AAAA,EACF,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR;AAEO,MAAM,uBAAuB,CAClC,OACA,oBACwB;AACxB,MAAI,OAAO;AACT,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,cAAU,kBAAAA,SAAU,gBAAgB,OAAO,CAAC,EAAE,SAAS,cAAc;AAC3E,SAAO,MAAM,KAAK,OAAO,EAAE;AAAA,IAA2B,CAAC,UACrD,OAAO,WAAW,IACd;AAAA,MACE,kBAAkB,mBAAmB,MAAM;AAAA,MAC3C,MAAM,MAAM;AAAA,MACZ,YAAY,OAAO,MAAM,EAAE;AAAA,MAC3B,UAAU,OAAO,MAAM,EAAE;AAAA,MACzB,cAAc,OAAO,MAAM,EAAE;AAAA,MAC7B,YAAY,OAAO,MAAM,EAAE;AAAA,MAC3B,SAAS,MAAM,GAAG,KAAK;AAAA,MACvB,OAAO,UAAU,MAAM;AAAA,IACzB,IACA,CAAC;AAAA,EACP;AACF;",
6
+ "names": ["stripAnsi"]
7
+ }
@@ -1,4 +1,4 @@
1
+ import type { StreamInterceptor } from '../external';
1
2
  import type { ESLintOutput } from 'cli/adapter/eslint';
2
3
  import type { PrettierOutput } from 'cli/adapter/prettier';
3
- import type { StreamInterceptor } from '../external';
4
4
  export declare const createAnnotations: (eslint: ESLintOutput, prettier: PrettierOutput, tscOk: boolean, tscOutputStream: StreamInterceptor) => Promise<void>;
@@ -1,13 +1,36 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAnnotations = void 0;
4
- const buildkite_1 = require("./buildkite");
5
- const github_1 = require("./github");
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var annotate_exports = {};
20
+ __export(annotate_exports, {
21
+ createAnnotations: () => createAnnotations
22
+ });
23
+ module.exports = __toCommonJS(annotate_exports);
24
+ var import_buildkite = require("./buildkite");
25
+ var import_github = require("./github");
6
26
  const createAnnotations = async (eslint, prettier, tscOk, tscOutputStream) => {
7
- await Promise.all([
8
- (0, github_1.createGitHubAnnotations)(eslint, prettier, tscOk, tscOutputStream),
9
- (0, buildkite_1.createBuildkiteAnnotations)(eslint, prettier, tscOk, tscOutputStream),
10
- ]);
27
+ await Promise.all([
28
+ (0, import_github.createGitHubAnnotations)(eslint, prettier, tscOk, tscOutputStream),
29
+ (0, import_buildkite.createBuildkiteAnnotations)(eslint, prettier, tscOk, tscOutputStream)
30
+ ]);
11
31
  };
12
- exports.createAnnotations = createAnnotations;
13
- //# sourceMappingURL=index.js.map
32
+ // Annotate the CommonJS export names for ESM import in node:
33
+ 0 && (module.exports = {
34
+ createAnnotations
35
+ });
36
+ //# sourceMappingURL=index.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/cli/lint/annotate/index.ts"],"names":[],"mappings":";;;AAKA,2CAAyD;AACzD,qCAAmD;AAE5C,MAAM,iBAAiB,GAAG,KAAK,EACpC,MAAoB,EACpB,QAAwB,EACxB,KAAc,EACd,eAAkC,EACnB,EAAE;IACjB,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,gCAAuB,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC;QACjE,IAAA,sCAA0B,EAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,eAAe,CAAC;KACrE,CAAC,CAAC;AACL,CAAC,CAAC;AAVW,QAAA,iBAAiB,qBAU5B"}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/cli/lint/annotate/index.ts"],
4
+ "sourcesContent": ["import type { StreamInterceptor } from '../external';\n\nimport { createBuildkiteAnnotations } from './buildkite';\nimport { createGitHubAnnotations } from './github';\n\nimport type { ESLintOutput } from 'cli/adapter/eslint';\nimport type { PrettierOutput } from 'cli/adapter/prettier';\n\nexport const createAnnotations = async (\n eslint: ESLintOutput,\n prettier: PrettierOutput,\n tscOk: boolean,\n tscOutputStream: StreamInterceptor,\n): Promise<void> => {\n await Promise.all([\n createGitHubAnnotations(eslint, prettier, tscOk, tscOutputStream),\n createBuildkiteAnnotations(eslint, prettier, tscOk, tscOutputStream),\n ]);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uBAA2C;AAC3C,oBAAwC;AAKjC,MAAM,oBAAoB,OAC/B,QACA,UACA,OACA,oBACkB;AAClB,QAAM,QAAQ,IAAI;AAAA,QAChB,uCAAwB,QAAQ,UAAU,OAAO,eAAe;AAAA,QAChE,6CAA2B,QAAQ,UAAU,OAAO,eAAe;AAAA,EACrE,CAAC;AACH;",
6
+ "names": []
7
+ }