@simplysf/simply-cicd 0.23.0 → 0.23.1

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 (243) hide show
  1. package/README.md +35 -35
  2. package/lib/commands/simply/cicd/build/check-permission-sets.d.ts +1 -1
  3. package/lib/commands/simply/cicd/build/check-permission-sets.js +1 -1
  4. package/lib/commands/simply/cicd/build/check-permission-sets.js.map +1 -1
  5. package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js +1 -2
  6. package/lib/commands/simply/cicd/build/cleanup-scratch-orgs.js.map +1 -1
  7. package/lib/commands/simply/cicd/build/create-fallback-tag.d.ts +1 -1
  8. package/lib/commands/simply/cicd/build/create-fallback-tag.js +1 -3
  9. package/lib/commands/simply/cicd/build/create-fallback-tag.js.map +1 -1
  10. package/lib/commands/simply/cicd/build/create-package-version.js +1 -3
  11. package/lib/commands/simply/cicd/build/create-package-version.js.map +1 -1
  12. package/lib/commands/simply/cicd/build/create-scratch.d.ts +1 -1
  13. package/lib/commands/simply/cicd/build/create-scratch.js +1 -3
  14. package/lib/commands/simply/cicd/build/create-scratch.js.map +1 -1
  15. package/lib/commands/simply/cicd/build/delete-scratch.js +1 -3
  16. package/lib/commands/simply/cicd/build/delete-scratch.js.map +1 -1
  17. package/lib/commands/simply/cicd/build/determine-package-changes.js +1 -2
  18. package/lib/commands/simply/cicd/build/determine-package-changes.js.map +1 -1
  19. package/lib/commands/simply/cicd/build/generate-flexipage-diff.d.ts +1 -1
  20. package/lib/commands/simply/cicd/build/generate-flexipage-diff.js +1 -1
  21. package/lib/commands/simply/cicd/build/generate-flexipage-diff.js.map +1 -1
  22. package/lib/commands/simply/cicd/build/generate-flow-diff.d.ts +1 -1
  23. package/lib/commands/simply/cicd/build/generate-flow-diff.js +1 -1
  24. package/lib/commands/simply/cicd/build/generate-flow-diff.js.map +1 -1
  25. package/lib/commands/simply/cicd/build/install-dependencies.js +1 -3
  26. package/lib/commands/simply/cicd/build/install-dependencies.js.map +1 -1
  27. package/lib/commands/simply/cicd/build/lwc-jest.d.ts +1 -1
  28. package/lib/commands/simply/cicd/build/lwc-jest.js +1 -1
  29. package/lib/commands/simply/cicd/build/lwc-jest.js.map +1 -1
  30. package/lib/commands/simply/cicd/build/publish-utam-page-objects.d.ts +1 -1
  31. package/lib/commands/simply/cicd/build/publish-utam-page-objects.js +1 -1
  32. package/lib/commands/simply/cicd/build/publish-utam-page-objects.js.map +1 -1
  33. package/lib/commands/simply/cicd/build/push-scratch.js +1 -3
  34. package/lib/commands/simply/cicd/build/push-scratch.js.map +1 -1
  35. package/lib/commands/simply/cicd/build/test-scratch.js +1 -3
  36. package/lib/commands/simply/cicd/build/test-scratch.js.map +1 -1
  37. package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js +2 -2
  38. package/lib/commands/simply/cicd/deploy/happy-soup/deploy-unpackaged.js.map +1 -1
  39. package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js +1 -1
  40. package/lib/commands/simply/cicd/deploy/happy-soup/deployment-close-out.js.map +1 -1
  41. package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js +1 -1
  42. package/lib/commands/simply/cicd/deploy/happy-soup/install-packaged.js.map +1 -1
  43. package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js +2 -2
  44. package/lib/commands/simply/cicd/deploy/happy-soup/post-deploy.js.map +1 -1
  45. package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js +2 -2
  46. package/lib/commands/simply/cicd/deploy/happy-soup/post-destructive.js.map +1 -1
  47. package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js +2 -2
  48. package/lib/commands/simply/cicd/deploy/happy-soup/pre-destructive.js.map +1 -1
  49. package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js +1 -1
  50. package/lib/commands/simply/cicd/deploy/happy-soup/tag-deployment.js.map +1 -1
  51. package/lib/commands/simply/cicd/deploy/happy-soup/validate.js +1 -1
  52. package/lib/commands/simply/cicd/deploy/happy-soup/validate.js.map +1 -1
  53. package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js +2 -2
  54. package/lib/commands/simply/cicd/deploy/project/deploy-unpackaged.js.map +1 -1
  55. package/lib/commands/simply/cicd/deploy/project/install-packaged.js +1 -1
  56. package/lib/commands/simply/cicd/deploy/project/install-packaged.js.map +1 -1
  57. package/lib/commands/simply/cicd/deploy/project/post-deploy.js +2 -2
  58. package/lib/commands/simply/cicd/deploy/project/post-deploy.js.map +1 -1
  59. package/lib/commands/simply/cicd/deploy/project/post-destructive.js +2 -2
  60. package/lib/commands/simply/cicd/deploy/project/post-destructive.js.map +1 -1
  61. package/lib/commands/simply/cicd/deploy/project/pre-destructive.js +2 -2
  62. package/lib/commands/simply/cicd/deploy/project/pre-destructive.js.map +1 -1
  63. package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js +1 -1
  64. package/lib/commands/simply/cicd/deploy/project/run-apex-tests.js.map +1 -1
  65. package/lib/commands/simply/cicd/deploy/project/validate.js +1 -1
  66. package/lib/commands/simply/cicd/deploy/project/validate.js.map +1 -1
  67. package/lib/commands/simply/cicd/deploy/validate.js +1 -1
  68. package/lib/commands/simply/cicd/deploy/validate.js.map +1 -1
  69. package/lib/commands/simply/cicd/notify/build.d.ts +2 -3
  70. package/lib/commands/simply/cicd/notify/build.js +1 -3
  71. package/lib/commands/simply/cicd/notify/build.js.map +1 -1
  72. package/lib/commands/simply/cicd/notify/happy-soup.d.ts +2 -3
  73. package/lib/commands/simply/cicd/notify/happy-soup.js +4 -6
  74. package/lib/commands/simply/cicd/notify/happy-soup.js.map +1 -1
  75. package/lib/commands/simply/cicd/notify/project.d.ts +1 -2
  76. package/lib/commands/simply/cicd/notify/project.js +3 -5
  77. package/lib/commands/simply/cicd/notify/project.js.map +1 -1
  78. package/lib/commands/simply/cicd/notify/teams.js +1 -2
  79. package/lib/commands/simply/cicd/notify/teams.js.map +1 -1
  80. package/lib/commands/simply/cicd/sfdx-dependabot.d.ts +1 -2
  81. package/lib/commands/simply/cicd/sfdx-dependabot.js +1 -4
  82. package/lib/commands/simply/cicd/sfdx-dependabot.js.map +1 -1
  83. package/lib/common/deploy/stageCommand.d.ts +0 -49
  84. package/lib/common/deploy/stageCommand.js +0 -54
  85. package/lib/common/deploy/stageCommand.js.map +1 -1
  86. package/oclif.manifest.json +1 -1
  87. package/package.json +3 -12
  88. package/lib/common/build/checkPermissionSets.d.ts +0 -22
  89. package/lib/common/build/checkPermissionSets.js +0 -102
  90. package/lib/common/build/checkPermissionSets.js.map +0 -1
  91. package/lib/common/build/cleanupScratchOrgs.d.ts +0 -6
  92. package/lib/common/build/cleanupScratchOrgs.js +0 -91
  93. package/lib/common/build/cleanupScratchOrgs.js.map +0 -1
  94. package/lib/common/build/createFallbackTag.d.ts +0 -24
  95. package/lib/common/build/createFallbackTag.js +0 -147
  96. package/lib/common/build/createFallbackTag.js.map +0 -1
  97. package/lib/common/build/createPackageVersion.d.ts +0 -42
  98. package/lib/common/build/createPackageVersion.js +0 -198
  99. package/lib/common/build/createPackageVersion.js.map +0 -1
  100. package/lib/common/build/createScratchOrg.d.ts +0 -14
  101. package/lib/common/build/createScratchOrg.js +0 -192
  102. package/lib/common/build/createScratchOrg.js.map +0 -1
  103. package/lib/common/build/deleteScratchOrg.d.ts +0 -13
  104. package/lib/common/build/deleteScratchOrg.js +0 -62
  105. package/lib/common/build/deleteScratchOrg.js.map +0 -1
  106. package/lib/common/build/deltaRunner.d.ts +0 -73
  107. package/lib/common/build/deltaRunner.js +0 -109
  108. package/lib/common/build/deltaRunner.js.map +0 -1
  109. package/lib/common/build/determinePackageChanges.d.ts +0 -11
  110. package/lib/common/build/determinePackageChanges.js +0 -90
  111. package/lib/common/build/determinePackageChanges.js.map +0 -1
  112. package/lib/common/build/devHubs.d.ts +0 -12
  113. package/lib/common/build/devHubs.js +0 -42
  114. package/lib/common/build/devHubs.js.map +0 -1
  115. package/lib/common/build/flexipageDelta.d.ts +0 -18
  116. package/lib/common/build/flexipageDelta.js +0 -35
  117. package/lib/common/build/flexipageDelta.js.map +0 -1
  118. package/lib/common/build/flowDelta.d.ts +0 -17
  119. package/lib/common/build/flowDelta.js +0 -34
  120. package/lib/common/build/flowDelta.js.map +0 -1
  121. package/lib/common/build/installDependencies.d.ts +0 -10
  122. package/lib/common/build/installDependencies.js +0 -39
  123. package/lib/common/build/installDependencies.js.map +0 -1
  124. package/lib/common/build/lwcJest.d.ts +0 -25
  125. package/lib/common/build/lwcJest.js +0 -126
  126. package/lib/common/build/lwcJest.js.map +0 -1
  127. package/lib/common/build/publishUtamPageObjects.d.ts +0 -50
  128. package/lib/common/build/publishUtamPageObjects.js +0 -283
  129. package/lib/common/build/publishUtamPageObjects.js.map +0 -1
  130. package/lib/common/build/pushScratch.d.ts +0 -9
  131. package/lib/common/build/pushScratch.js +0 -60
  132. package/lib/common/build/pushScratch.js.map +0 -1
  133. package/lib/common/build/scratchOrgAuth.d.ts +0 -18
  134. package/lib/common/build/scratchOrgAuth.js +0 -52
  135. package/lib/common/build/scratchOrgAuth.js.map +0 -1
  136. package/lib/common/build/scratchOrgInfo.d.ts +0 -14
  137. package/lib/common/build/scratchOrgInfo.js +0 -21
  138. package/lib/common/build/scratchOrgInfo.js.map +0 -1
  139. package/lib/common/build/skipGuard.d.ts +0 -8
  140. package/lib/common/build/skipGuard.js +0 -42
  141. package/lib/common/build/skipGuard.js.map +0 -1
  142. package/lib/common/build/testScratch.d.ts +0 -15
  143. package/lib/common/build/testScratch.js +0 -42
  144. package/lib/common/build/testScratch.js.map +0 -1
  145. package/lib/common/build/utamPageObjects.d.ts +0 -143
  146. package/lib/common/build/utamPageObjects.js +0 -245
  147. package/lib/common/build/utamPageObjects.js.map +0 -1
  148. package/lib/common/build/versionTagFormat.d.ts +0 -57
  149. package/lib/common/build/versionTagFormat.js +0 -194
  150. package/lib/common/build/versionTagFormat.js.map +0 -1
  151. package/lib/common/deploy/deployCommon.d.ts +0 -105
  152. package/lib/common/deploy/deployCommon.js +0 -358
  153. package/lib/common/deploy/deployCommon.js.map +0 -1
  154. package/lib/common/deploy/deployHappySoup.d.ts +0 -56
  155. package/lib/common/deploy/deployHappySoup.js +0 -160
  156. package/lib/common/deploy/deployHappySoup.js.map +0 -1
  157. package/lib/common/deploy/deployProject.d.ts +0 -27
  158. package/lib/common/deploy/deployProject.js +0 -114
  159. package/lib/common/deploy/deployProject.js.map +0 -1
  160. package/lib/common/deploy/runDeployStage.d.ts +0 -16
  161. package/lib/common/deploy/runDeployStage.js +0 -65
  162. package/lib/common/deploy/runDeployStage.js.map +0 -1
  163. package/lib/common/deploy/validate.d.ts +0 -11
  164. package/lib/common/deploy/validate.js +0 -54
  165. package/lib/common/deploy/validate.js.map +0 -1
  166. package/lib/common/env.d.ts +0 -9
  167. package/lib/common/env.js +0 -47
  168. package/lib/common/env.js.map +0 -1
  169. package/lib/common/exec/sfCli.d.ts +0 -27
  170. package/lib/common/exec/sfCli.js +0 -50
  171. package/lib/common/exec/sfCli.js.map +0 -1
  172. package/lib/common/flags/env.d.ts +0 -44
  173. package/lib/common/flags/env.js +0 -81
  174. package/lib/common/flags/env.js.map +0 -1
  175. package/lib/common/git.d.ts +0 -32
  176. package/lib/common/git.js +0 -106
  177. package/lib/common/git.js.map +0 -1
  178. package/lib/common/happySoup/resolveOriginProject.d.ts +0 -22
  179. package/lib/common/happySoup/resolveOriginProject.js +0 -61
  180. package/lib/common/happySoup/resolveOriginProject.js.map +0 -1
  181. package/lib/common/logger.d.ts +0 -10
  182. package/lib/common/logger.js +0 -33
  183. package/lib/common/logger.js.map +0 -1
  184. package/lib/common/notify/buildNotification.d.ts +0 -53
  185. package/lib/common/notify/buildNotification.js +0 -176
  186. package/lib/common/notify/buildNotification.js.map +0 -1
  187. package/lib/common/notify/getCommitStories.d.ts +0 -30
  188. package/lib/common/notify/getCommitStories.js +0 -70
  189. package/lib/common/notify/getCommitStories.js.map +0 -1
  190. package/lib/common/notify/getRemoteCommitStories.d.ts +0 -10
  191. package/lib/common/notify/getRemoteCommitStories.js +0 -45
  192. package/lib/common/notify/getRemoteCommitStories.js.map +0 -1
  193. package/lib/common/notify/happySoupNotification.d.ts +0 -26
  194. package/lib/common/notify/happySoupNotification.js +0 -139
  195. package/lib/common/notify/happySoupNotification.js.map +0 -1
  196. package/lib/common/notify/projectNotification.d.ts +0 -46
  197. package/lib/common/notify/projectNotification.js +0 -177
  198. package/lib/common/notify/projectNotification.js.map +0 -1
  199. package/lib/common/notify/renderTemplate.d.ts +0 -3
  200. package/lib/common/notify/renderTemplate.js +0 -24
  201. package/lib/common/notify/renderTemplate.js.map +0 -1
  202. package/lib/common/notify/sendNotification.d.ts +0 -2
  203. package/lib/common/notify/sendNotification.js +0 -50
  204. package/lib/common/notify/sendNotification.js.map +0 -1
  205. package/lib/common/notify/templates.d.ts +0 -13
  206. package/lib/common/notify/templates.js +0 -118
  207. package/lib/common/notify/templates.js.map +0 -1
  208. package/lib/common/schemas/deployConfig.d.ts +0 -25
  209. package/lib/common/schemas/deployConfig.js +0 -55
  210. package/lib/common/schemas/deployConfig.js.map +0 -1
  211. package/lib/common/schemas/deployProgress.d.ts +0 -33
  212. package/lib/common/schemas/deployProgress.js +0 -46
  213. package/lib/common/schemas/deployProgress.js.map +0 -1
  214. package/lib/common/schemas/deployRules.d.ts +0 -34
  215. package/lib/common/schemas/deployRules.js +0 -40
  216. package/lib/common/schemas/deployRules.js.map +0 -1
  217. package/lib/common/sfApex.d.ts +0 -22
  218. package/lib/common/sfApex.js +0 -169
  219. package/lib/common/sfApex.js.map +0 -1
  220. package/lib/common/sfAuth.d.ts +0 -19
  221. package/lib/common/sfAuth.js +0 -78
  222. package/lib/common/sfAuth.js.map +0 -1
  223. package/lib/common/sfConfig.d.ts +0 -23
  224. package/lib/common/sfConfig.js +0 -82
  225. package/lib/common/sfConfig.js.map +0 -1
  226. package/lib/common/sfPackages.d.ts +0 -31
  227. package/lib/common/sfPackages.js +0 -143
  228. package/lib/common/sfPackages.js.map +0 -1
  229. package/lib/common/sfPlugins.d.ts +0 -11
  230. package/lib/common/sfPlugins.js +0 -134
  231. package/lib/common/sfPlugins.js.map +0 -1
  232. package/lib/common/sfdxDependabot/dependabotRun.d.ts +0 -95
  233. package/lib/common/sfdxDependabot/dependabotRun.js +0 -287
  234. package/lib/common/sfdxDependabot/dependabotRun.js.map +0 -1
  235. package/lib/common/sfdxDependabot/updater.d.ts +0 -14
  236. package/lib/common/sfdxDependabot/updater.js +0 -94
  237. package/lib/common/sfdxDependabot/updater.js.map +0 -1
  238. package/lib/config/defaultDeploymentPlugins.d.ts +0 -2
  239. package/lib/config/defaultDeploymentPlugins.js +0 -18
  240. package/lib/config/defaultDeploymentPlugins.js.map +0 -1
  241. package/lib/config/trustedPlugins.d.ts +0 -2
  242. package/lib/config/trustedPlugins.js +0 -18
  243. package/lib/config/trustedPlugins.js.map +0 -1
@@ -1,27 +0,0 @@
1
- import { type ExecaChildProcess, type Options } from 'execa';
2
- /**
3
- * Run the Salesforce CLI.
4
- *
5
- * Everything this package does to an org ultimately shells out to `sf`, and each site was
6
- * naming the binary itself. Options are forwarded only when a caller supplies them, so the
7
- * underlying `execa()` call keeps the exact arity each site had.
8
- *
9
- * @param args - Arguments to pass to `sf`.
10
- * @param options - Optional `execa` options, e.g. `{ stdio: 'inherit' }` to stream output
11
- * straight into the job log.
12
- * @returns The completed `execa` result.
13
- */
14
- export declare function runSf(args: string[], options?: Options): ExecaChildProcess;
15
- /**
16
- * Run the Salesforce CLI and parse its `--json` output.
17
- *
18
- * The caller still passes `--json` in `args` — this doesn't inject it, because which commands
19
- * accept it and where it belongs in the argument list varies. What it does replace is the
20
- * `JSON.parse(stdout) as SomeShape` written out at each call site.
21
- *
22
- * @param args - Arguments to pass to `sf`, including `--json`.
23
- * @param options - Optional `execa` options.
24
- * @returns The parsed payload, typed as the caller asserts.
25
- * @throws {SyntaxError} If the command's output isn't valid JSON.
26
- */
27
- export declare function runSfJson<T>(args: string[], options?: Options): Promise<T>;
@@ -1,50 +0,0 @@
1
- /*
2
- * Copyright (c) 2026, SimplySF.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { execa } from 'execa';
17
- /** The `sf` executable, as resolved from `PATH` in the CI job. */
18
- const SF_BINARY = 'sf';
19
- /**
20
- * Run the Salesforce CLI.
21
- *
22
- * Everything this package does to an org ultimately shells out to `sf`, and each site was
23
- * naming the binary itself. Options are forwarded only when a caller supplies them, so the
24
- * underlying `execa()` call keeps the exact arity each site had.
25
- *
26
- * @param args - Arguments to pass to `sf`.
27
- * @param options - Optional `execa` options, e.g. `{ stdio: 'inherit' }` to stream output
28
- * straight into the job log.
29
- * @returns The completed `execa` result.
30
- */
31
- export function runSf(args, options) {
32
- return options ? execa(SF_BINARY, args, options) : execa(SF_BINARY, args);
33
- }
34
- /**
35
- * Run the Salesforce CLI and parse its `--json` output.
36
- *
37
- * The caller still passes `--json` in `args` — this doesn't inject it, because which commands
38
- * accept it and where it belongs in the argument list varies. What it does replace is the
39
- * `JSON.parse(stdout) as SomeShape` written out at each call site.
40
- *
41
- * @param args - Arguments to pass to `sf`, including `--json`.
42
- * @param options - Optional `execa` options.
43
- * @returns The parsed payload, typed as the caller asserts.
44
- * @throws {SyntaxError} If the command's output isn't valid JSON.
45
- */
46
- export async function runSfJson(args, options) {
47
- const { stdout } = await runSf(args, options);
48
- return JSON.parse(stdout);
49
- }
50
- //# sourceMappingURL=sfCli.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sfCli.js","sourceRoot":"","sources":["../../../src/common/exec/sfCli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,KAAK,EAAwC,MAAM,OAAO,CAAC;AAEpE,kEAAkE;AAClE,MAAM,SAAS,GAAG,IAAI,CAAC;AAEvB;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,KAAK,CAAC,IAAc,EAAE,OAAiB;IACrD,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAI,IAAc,EAAE,OAAiB;IAClE,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAE9C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAM,CAAC;AACjC,CAAC"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Coerce a string or boolean to a boolean. `'true'`/`'false'` are recognised
3
- * case- and whitespace-insensitively; anything else is `false`.
4
- *
5
- * Environment variables are always strings, unlike the boolean flags oclif parses natively, so
6
- * any flag with an env-var fallback needs this on the env side.
7
- *
8
- * @param value - The raw flag or environment value.
9
- * @returns The coerced boolean.
10
- */
11
- export declare function parseBooleanString(value: string | boolean): boolean;
12
- /**
13
- * Resolve a string setting with CLI flag > environment variable > fallback precedence.
14
- *
15
- * Several settings accept more than one environment variable — a `SIMPLY_CICD_`-prefixed name of
16
- * our own plus whatever the CI provider already exports — so the env side takes a list, tried in
17
- * order.
18
- *
19
- * @param flagValue - The parsed CLI flag, if the caller passed one.
20
- * @param envVars - Candidate environment values, most specific first.
21
- * @param fallback - Used when neither the flag nor any environment variable is set.
22
- * @returns The resolved value.
23
- */
24
- export declare function resolveString(flagValue: string | undefined, envVars: Array<string | undefined>, fallback?: string): string;
25
- /**
26
- * {@link resolveString} for settings with no default, where "unset" is meaningful.
27
- *
28
- * @param flagValue - The parsed CLI flag, if the caller passed one.
29
- * @param envVars - Candidate environment values, most specific first.
30
- * @returns The resolved value, or `undefined` if nothing supplied one.
31
- */
32
- export declare function resolveOptionalString(flagValue: string | undefined, envVars: Array<string | undefined>): string | undefined;
33
- /**
34
- * Resolve a boolean setting with CLI flag > environment variable > fallback precedence.
35
- *
36
- * The flag is checked for `undefined` rather than falsiness, so an explicit `--no-…` stays
37
- * distinguishable from an unset flag and still beats the environment.
38
- *
39
- * @param flagValue - The parsed CLI flag, if the caller passed one.
40
- * @param envVar - The environment value, coerced via {@link parseBooleanString}.
41
- * @param fallback - Used when neither the flag nor the environment variable is set.
42
- * @returns The resolved boolean.
43
- */
44
- export declare function resolveBoolean(flagValue: boolean | undefined, envVar: string | undefined, fallback: boolean): boolean;
@@ -1,81 +0,0 @@
1
- /*
2
- * Copyright (c) 2026, SimplySF.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /**
17
- * Coerce a string or boolean to a boolean. `'true'`/`'false'` are recognised
18
- * case- and whitespace-insensitively; anything else is `false`.
19
- *
20
- * Environment variables are always strings, unlike the boolean flags oclif parses natively, so
21
- * any flag with an env-var fallback needs this on the env side.
22
- *
23
- * @param value - The raw flag or environment value.
24
- * @returns The coerced boolean.
25
- */
26
- export function parseBooleanString(value) {
27
- if (typeof value === 'boolean') {
28
- return value;
29
- }
30
- const normalized = value.trim().toLowerCase();
31
- if (normalized === 'true') {
32
- return true;
33
- }
34
- if (normalized === 'false') {
35
- return false;
36
- }
37
- return false;
38
- }
39
- /**
40
- * Resolve a string setting with CLI flag > environment variable > fallback precedence.
41
- *
42
- * Several settings accept more than one environment variable — a `SIMPLY_CICD_`-prefixed name of
43
- * our own plus whatever the CI provider already exports — so the env side takes a list, tried in
44
- * order.
45
- *
46
- * @param flagValue - The parsed CLI flag, if the caller passed one.
47
- * @param envVars - Candidate environment values, most specific first.
48
- * @param fallback - Used when neither the flag nor any environment variable is set.
49
- * @returns The resolved value.
50
- */
51
- export function resolveString(flagValue, envVars, fallback = '') {
52
- return flagValue ?? envVars.find((value) => value !== undefined) ?? fallback;
53
- }
54
- /**
55
- * {@link resolveString} for settings with no default, where "unset" is meaningful.
56
- *
57
- * @param flagValue - The parsed CLI flag, if the caller passed one.
58
- * @param envVars - Candidate environment values, most specific first.
59
- * @returns The resolved value, or `undefined` if nothing supplied one.
60
- */
61
- export function resolveOptionalString(flagValue, envVars) {
62
- return flagValue ?? envVars.find((value) => value !== undefined);
63
- }
64
- /**
65
- * Resolve a boolean setting with CLI flag > environment variable > fallback precedence.
66
- *
67
- * The flag is checked for `undefined` rather than falsiness, so an explicit `--no-…` stays
68
- * distinguishable from an unset flag and still beats the environment.
69
- *
70
- * @param flagValue - The parsed CLI flag, if the caller passed one.
71
- * @param envVar - The environment value, coerced via {@link parseBooleanString}.
72
- * @param fallback - Used when neither the flag nor the environment variable is set.
73
- * @returns The resolved boolean.
74
- */
75
- export function resolveBoolean(flagValue, envVar, fallback) {
76
- if (flagValue !== undefined) {
77
- return flagValue;
78
- }
79
- return envVar !== undefined ? parseBooleanString(envVar) : fallback;
80
- }
81
- //# sourceMappingURL=env.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.js","sourceRoot":"","sources":["../../../src/common/flags/env.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAuB;IACxD,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE9C,IAAI,UAAU,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,aAAa,CAC3B,SAA6B,EAC7B,OAAkC,EAClC,QAAQ,GAAG,EAAE;IAEb,OAAO,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,IAAI,QAAQ,CAAC;AAC/E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAA6B,EAC7B,OAAkC;IAElC,OAAO,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACnE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,SAA8B,EAAE,MAA0B,EAAE,QAAiB;IAC1G,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACtE,CAAC"}
@@ -1,32 +0,0 @@
1
- import type { VcsProvider } from '@simplysf/simply-cicd-core';
2
- import { VersionTagFormat } from './build/versionTagFormat.js';
3
- export type Deployment = {
4
- name: string;
5
- slug: string;
6
- ref?: string;
7
- };
8
- export type CloneRepoOptions = {
9
- ciJobToken: string;
10
- vcsProvider: VcsProvider;
11
- };
12
- /**
13
- * The git tag a dependency pinned at `versionPart` was recorded under. `1.2.3-4` and `1.2.3.4` are
14
- * rendered through the project's version tag format, on the assumption that dependencies share the
15
- * project's tag convention (a deployment's explicit `ref` covers one that doesn't). Anything else,
16
- * e.g. `1.2.3-LATEST`, keeps the original `v<pin>` reading.
17
- */
18
- export declare function toDependencyRef(versionPart: string, versionTagFormat: VersionTagFormat): string;
19
- /**
20
- * Clones a repository based on deployment metadata and options. If a specific branch or tag
21
- * (ref) is not specified, it attempts to deduce the ref from package dependencies in
22
- * `sfdx-project.json` in the current working directory.
23
- */
24
- export declare function cloneRepo(deployment: Deployment, options: CloneRepoOptions): Promise<string>;
25
- /**
26
- * Adds a temporary authenticated git remote for CI push/tag operations. Returns the remote's alias.
27
- *
28
- * The alias is keyed on the pipeline ID, so a retried job, or a later job in the same pipeline that
29
- * lands on a runner reusing the working copy (`GIT_STRATEGY: fetch`), finds it already present. In
30
- * that case the existing remote's URL is overwritten instead, which also refreshes the token.
31
- */
32
- export declare function addGitRemote(ciPipelineId: string, accessToken: string, ciProjectPath: string, vcsProvider: VcsProvider): Promise<string>;
package/lib/common/git.js DELETED
@@ -1,106 +0,0 @@
1
- /*
2
- * Copyright (c) 2026, SimplySF.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { promises as fs } from 'node:fs';
17
- import path from 'node:path';
18
- import { execa } from 'execa';
19
- import { getDefaultPackageDirectory, readSfdxProject } from '@simplysf/simply-core';
20
- import { logger } from './logger.js';
21
- import { VersionTagFormat, VersionTagFormatError } from './build/versionTagFormat.js';
22
- /**
23
- * The git tag a dependency pinned at `versionPart` was recorded under. `1.2.3-4` and `1.2.3.4` are
24
- * rendered through the project's version tag format, on the assumption that dependencies share the
25
- * project's tag convention (a deployment's explicit `ref` covers one that doesn't). Anything else,
26
- * e.g. `1.2.3-LATEST`, keeps the original `v<pin>` reading.
27
- */
28
- export function toDependencyRef(versionPart, versionTagFormat) {
29
- const match = /^(?<version>\d+\.\d+\.\d+)[-.](?<build>\d+)$/.exec(versionPart);
30
- if (match?.groups) {
31
- return versionTagFormat.render(`${match.groups.version}.${match.groups.build}`);
32
- }
33
- return `v${versionPart}`;
34
- }
35
- /**
36
- * Clones a repository based on deployment metadata and options. If a specific branch or tag
37
- * (ref) is not specified, it attempts to deduce the ref from package dependencies in
38
- * `sfdx-project.json` in the current working directory.
39
- */
40
- export async function cloneRepo(deployment, options) {
41
- const { name, slug } = deployment;
42
- let { ref } = deployment;
43
- if (!ref) {
44
- try {
45
- const project = await readSfdxProject();
46
- const defaultPackageDir = getDefaultPackageDirectory(project);
47
- if (defaultPackageDir?.dependencies) {
48
- const dependency = defaultPackageDir.dependencies.find((dep) => dep.package?.startsWith(`${name}@`));
49
- if (dependency?.package) {
50
- const versionPart = dependency.package.split('@')[1];
51
- if (versionPart) {
52
- ref = toDependencyRef(versionPart, VersionTagFormat.fromProject(project));
53
- }
54
- }
55
- }
56
- }
57
- catch (e) {
58
- // A misconfigured format is the project's error to fix, not a reason to quietly clone the
59
- // dependency's default branch instead.
60
- if (e instanceof VersionTagFormatError) {
61
- throw e;
62
- }
63
- const err = e;
64
- if (err.code !== 'ENOENT') {
65
- logger.warn(`Could not deduce ref from sfdx-project.json for ${name}: ${err.message}`);
66
- }
67
- }
68
- }
69
- const repoUrl = options.vcsProvider.buildCiCloneUrl(options.ciJobToken, slug);
70
- const targetDir = path.join(process.cwd(), name);
71
- await fs.rm(targetDir, { recursive: true, force: true });
72
- const refMessage = ref ? `#${ref}` : ' (default branch)';
73
- logger.info(`Cloning ${slug}${refMessage} into ${name}`);
74
- try {
75
- const cloneArgs = ['clone', '--depth', '1'];
76
- if (ref) {
77
- cloneArgs.push('-b', ref);
78
- }
79
- cloneArgs.push(repoUrl, name);
80
- await execa('git', cloneArgs);
81
- return targetDir;
82
- }
83
- catch (e) {
84
- logger.error(`Failed to clone ${slug}${refMessage}.`);
85
- throw e;
86
- }
87
- }
88
- /**
89
- * Adds a temporary authenticated git remote for CI push/tag operations. Returns the remote's alias.
90
- *
91
- * The alias is keyed on the pipeline ID, so a retried job, or a later job in the same pipeline that
92
- * lands on a runner reusing the working copy (`GIT_STRATEGY: fetch`), finds it already present. In
93
- * that case the existing remote's URL is overwritten instead, which also refreshes the token.
94
- */
95
- export async function addGitRemote(ciPipelineId, accessToken, ciProjectPath, vcsProvider) {
96
- if (!accessToken) {
97
- throw new Error('accessToken is required for Git remote operations.');
98
- }
99
- const remoteAlias = `GITREMOTE${ciPipelineId}`;
100
- const remoteUrl = vcsProvider.buildAuthenticatedRemoteUrl(accessToken, ciProjectPath);
101
- const { stdout: existingRemotes } = await execa('git', ['remote']);
102
- const remoteExists = existingRemotes.split(/\r?\n/).includes(remoteAlias);
103
- await execa('git', ['remote', remoteExists ? 'set-url' : 'add', remoteAlias, remoteUrl]);
104
- return remoteAlias;
105
- }
106
- //# sourceMappingURL=git.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/common/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEpF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAatF;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAA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GAAG,UAAU,GAAG,CAAC,CAAC;QACtD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,YAAoB,EACpB,WAAmB,EACnB,aAAqB,EACrB,WAAwB;IAExB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,WAAW,GAAG,YAAY,YAAY,EAAE,CAAC;IAC/C,MAAM,SAAS,GAAG,WAAW,CAAC,2BAA2B,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACtF,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACnE,MAAM,YAAY,GAAG,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC1E,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;IACzF,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -1,22 +0,0 @@
1
- import { type VcsProviderKind } from '@simplysf/simply-cicd-core';
2
- /** Where a packaged dependency's source lives, resolved for a happy-soup story lookup. */
3
- export type ResolvedOriginProject = {
4
- vcsProvider: VcsProviderKind;
5
- host: string;
6
- projectPath: string;
7
- };
8
- /**
9
- * Parses a CI pipeline URL — as stored in `sf package version report`'s `Description` field by
10
- * `createPackageVersion` at build time — into the VCS project that built it. Recognizes GitLab
11
- * pipeline URLs and GitHub Actions run URLs. Returns `undefined` if the URL doesn't match either
12
- * shape (or isn't a URL at all), e.g. for a package version created outside this pipeline.
13
- */
14
- export declare function parseOriginPipelineUrl(pipelineUrl: string): ResolvedOriginProject | undefined;
15
- /**
16
- * Resolves which VCS project a packaged dependency's source lives in, for a happy-soup story
17
- * lookup. Checks `.sfdevrc.json`'s `packageOriginOverrides` first (for packages whose origin can't
18
- * be parsed, e.g. externally-vendored ones), then falls back to parsing the target version's
19
- * origin pipeline URL. Returns `undefined` (never throws) if neither resolves — callers must treat
20
- * that package's stories as unavailable and continue, not fail the notification.
21
- */
22
- export declare function resolvePackageOrigin(packageName: string, targetDescription: string | undefined): ResolvedOriginProject | undefined;
@@ -1,61 +0,0 @@
1
- /*
2
- * Copyright (c) 2026, SimplySF.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { GitHubProvider, GitLabProvider } from '@simplysf/simply-cicd-core';
17
- import { getPackageOriginOverride } from '../sfConfig.js';
18
- /** Matches a GitLab CI pipeline URL, e.g. `https://gitlab.com/group/subgroup/project/-/pipelines/12345`. */
19
- const GITLAB_PIPELINE_PATH = /^\/(?<projectPath>.+)\/-\/pipelines\/\d+/;
20
- /** Matches a GitHub Actions run URL, e.g. `https://github.com/owner/repo/actions/runs/12345`. */
21
- const GITHUB_RUN_PATH = /^\/(?<projectPath>[^/]+\/[^/]+)\/actions\/runs\/\d+/;
22
- /**
23
- * Parses a CI pipeline URL — as stored in `sf package version report`'s `Description` field by
24
- * `createPackageVersion` at build time — into the VCS project that built it. Recognizes GitLab
25
- * pipeline URLs and GitHub Actions run URLs. Returns `undefined` if the URL doesn't match either
26
- * shape (or isn't a URL at all), e.g. for a package version created outside this pipeline.
27
- */
28
- export function parseOriginPipelineUrl(pipelineUrl) {
29
- let url;
30
- try {
31
- url = new URL(pipelineUrl);
32
- }
33
- catch {
34
- return undefined;
35
- }
36
- const gitlabMatch = GITLAB_PIPELINE_PATH.exec(url.pathname);
37
- if (gitlabMatch?.groups?.projectPath) {
38
- return { vcsProvider: 'gitlab', host: url.host, projectPath: gitlabMatch.groups.projectPath };
39
- }
40
- const githubMatch = GITHUB_RUN_PATH.exec(url.pathname);
41
- if (githubMatch?.groups?.projectPath) {
42
- return { vcsProvider: 'github', host: url.host, projectPath: githubMatch.groups.projectPath };
43
- }
44
- return undefined;
45
- }
46
- /**
47
- * Resolves which VCS project a packaged dependency's source lives in, for a happy-soup story
48
- * lookup. Checks `.sfdevrc.json`'s `packageOriginOverrides` first (for packages whose origin can't
49
- * be parsed, e.g. externally-vendored ones), then falls back to parsing the target version's
50
- * origin pipeline URL. Returns `undefined` (never throws) if neither resolves — callers must treat
51
- * that package's stories as unavailable and continue, not fail the notification.
52
- */
53
- export function resolvePackageOrigin(packageName, targetDescription) {
54
- const override = getPackageOriginOverride(packageName);
55
- if (override) {
56
- const defaultHost = override.vcsProvider === 'gitlab' ? GitLabProvider.defaultHost : GitHubProvider.defaultHost;
57
- return { vcsProvider: override.vcsProvider, host: override.host ?? defaultHost, projectPath: override.projectPath };
58
- }
59
- return targetDescription ? parseOriginPipelineUrl(targetDescription) : undefined;
60
- }
61
- //# sourceMappingURL=resolveOriginProject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveOriginProject.js","sourceRoot":"","sources":["../../../src/common/happySoup/resolveOriginProject.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAwB,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAS1D,4GAA4G;AAC5G,MAAM,oBAAoB,GAAG,0CAA0C,CAAC;AAExE,iGAAiG;AACjG,MAAM,eAAe,GAAG,qDAAqD,CAAC;AAE9E;;;;;GAKG;AACH,MAAM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AAC;IAED,OAAO,iBAAiB,CAAC,CAAC,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnF,CAAC"}
@@ -1,10 +0,0 @@
1
- /** A logger utility for consistent logging across the simply-cicd package's shared modules. */
2
- export declare const logger: {
3
- debug: (message: string, ...args: unknown[]) => void;
4
- info: (message: string, ...args: unknown[]) => void;
5
- success: (message: string, ...args: unknown[]) => void;
6
- warn: (message: string, ...args: unknown[]) => void;
7
- error: (message: string, ...args: unknown[]) => void;
8
- log: (message: string, ...args: unknown[]) => void;
9
- raw: (...args: unknown[]) => void;
10
- };
@@ -1,33 +0,0 @@
1
- /*
2
- * Copyright (c) 2026, SimplySF.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- /* eslint-disable no-console -- this module is the sole intended console output surface for simply-cicd's shared modules */
17
- import chalk from 'chalk';
18
- import logSymbols from 'log-symbols';
19
- chalk.level = 1;
20
- const debugPrefix = chalk.yellow('[DEBUG]');
21
- const logPrefix = chalk.yellow('[SIMPLY-CICD]');
22
- const format = (message) => `${logPrefix} ${message}`;
23
- /** A logger utility for consistent logging across the simply-cicd package's shared modules. */
24
- export const logger = {
25
- debug: (message, ...args) => console.log(`${logPrefix} ${debugPrefix} ${message}`, ...args),
26
- info: (message, ...args) => console.log(logSymbols.info, format(message), ...args),
27
- success: (message, ...args) => console.log(logSymbols.success, format(message), ...args),
28
- warn: (message, ...args) => console.warn(logSymbols.warning, format(message), ...args),
29
- error: (message, ...args) => console.error(logSymbols.error, format(message), ...args),
30
- log: (message, ...args) => console.log(format(message), ...args),
31
- raw: (...args) => console.log(...args),
32
- };
33
- //# sourceMappingURL=logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/common/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2HAA2H;AAE3H,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;AAEhB,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAC5C,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAEhD,MAAM,MAAM,GAAG,CAAC,OAAe,EAAU,EAAE,CAAC,GAAG,SAAS,IAAI,OAAO,EAAE,CAAC;AAEtE,+FAA+F;AAC/F,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,IAAI,WAAW,IAAI,OAAO,EAAE,EAAE,GAAG,IAAI,CAAC;IACpH,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC3G,OAAO,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IACjH,IAAI,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC/G,KAAK,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IAC/G,GAAG,EAAE,CAAC,OAAe,EAAE,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC;IACzF,GAAG,EAAE,CAAC,GAAG,IAAe,EAAQ,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;CACxD,CAAC"}
@@ -1,53 +0,0 @@
1
- import { type AlmProviderKind } from '@simplysf/simply-cicd-core';
2
- import { type CommitStories } from './getCommitStories.js';
3
- /** The file `build create-package-version` writes the new version's `04t` ID to. */
4
- export declare const SUBSCRIBER_PACKAGE_VERSION_ID_FILE = "subscriberPackageVersionId.env";
5
- export type NotifyBuildResult = {
6
- sent: boolean;
7
- };
8
- export type NotifyBuildOptions = {
9
- ciCommitRefName?: string;
10
- ciJobName?: string;
11
- ciJobStage?: string;
12
- ciJobStatus?: string;
13
- ciPipelineId?: string;
14
- ciPipelineUrl?: string;
15
- ciProjectTitle?: string;
16
- subscriberPackageVersionId?: string;
17
- almBaseUrl?: string;
18
- almProjectKey?: string;
19
- almProvider?: AlmProviderKind;
20
- teamsWebhookUrl?: string[];
21
- debug: boolean;
22
- };
23
- /** The new package version's git tag and the issue references since the previous one. */
24
- export type PackageVersionHistory = CommitStories & {
25
- versionTag: string;
26
- previousVersionTag: string;
27
- };
28
- /**
29
- * The `04t` ID of a package version created in this job: the explicit value if given, otherwise the
30
- * one `build create-package-version` wrote to {@link SUBSCRIBER_PACKAGE_VERSION_ID_FILE}. `undefined`
31
- * when the job created none.
32
- */
33
- export declare function resolveSubscriberPackageVersionId(explicit?: string): Promise<string | undefined>;
34
- /** Fetches the tags, and the full history when the CI clone is shallow, so tags can be described and diffed. */
35
- export declare function fetchVersionHistory(): Promise<void>;
36
- /**
37
- * The tag at `HEAD` that `build create-package-version` annotated with `subscriberPackageVersionId`.
38
- * Matching on the annotation rather than the name works for any version tag format or suffix.
39
- */
40
- export declare function findPackageVersionTag(subscriberPackageVersionId: string): Promise<string | undefined>;
41
- /** The nearest version tag, in the project's format, before `versionTag`. `undefined` for a package's first version. */
42
- export declare function findPreviousVersionTag(versionTag: string): Promise<string | undefined>;
43
- /**
44
- * Resolves the new version's tag, the previous version's tag, and the issue references in between.
45
- * Never throws: anything it can't resolve comes back as `N/A`, because a notification shouldn't be
46
- * what fails a build.
47
- */
48
- export declare function getPackageVersionHistory(subscriberPackageVersionId: string, options: Pick<NotifyBuildOptions, 'almBaseUrl' | 'almProjectKey' | 'almProvider' | 'debug'>): Promise<PackageVersionHistory>;
49
- /**
50
- * Posts a failure card for a failed build job, or a package version card for a successful job that
51
- * created a package version. Any other job result sends nothing.
52
- */
53
- export declare function sendBuildNotification(options: NotifyBuildOptions): Promise<NotifyBuildResult>;