@halospv3/hce.shared-config 3.4.6 → 3.4.7

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 (288) hide show
  1. package/CHANGELOG.md +24 -6
  2. package/mjs/CaseInsensitiveMap.d.mts +15 -0
  3. package/mjs/CaseInsensitiveMap.d.mts.map +1 -0
  4. package/mjs/CaseInsensitiveMap.mjs +2 -33
  5. package/mjs/CaseInsensitiveMap.mjs.map +1 -1
  6. package/mjs/commitlintConfig.d.mts +15 -0
  7. package/mjs/commitlintConfig.d.mts.map +1 -0
  8. package/mjs/commitlintConfig.mjs +2 -13
  9. package/mjs/commitlintConfig.mjs.map +1 -1
  10. package/mjs/debug.d.mts +9 -0
  11. package/mjs/debug.d.mts.map +1 -0
  12. package/mjs/debug.mjs +2 -9
  13. package/mjs/debug.mjs.map +1 -1
  14. package/mjs/dotnet/GithubNugetRegistryInfo.d.mts +42 -0
  15. package/mjs/dotnet/GithubNugetRegistryInfo.d.mts.map +1 -0
  16. package/mjs/dotnet/GithubNugetRegistryInfo.mjs +2 -43
  17. package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -1
  18. package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts +65 -0
  19. package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts.map +1 -0
  20. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +2 -99
  21. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -1
  22. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.mts +1 -0
  23. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs +2 -44
  24. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -1
  25. package/mjs/dotnet/MSBuildProject.d.mts +267 -0
  26. package/mjs/dotnet/MSBuildProject.d.mts.map +1 -0
  27. package/mjs/dotnet/MSBuildProject.mjs +3 -490
  28. package/mjs/dotnet/MSBuildProject.mjs.map +1 -1
  29. package/mjs/dotnet/MSBuildProjectProperties.d.mts +172 -0
  30. package/mjs/dotnet/MSBuildProjectProperties.d.mts.map +1 -0
  31. package/mjs/dotnet/MSBuildProjectProperties.mjs +2 -260
  32. package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -1
  33. package/mjs/dotnet/NugetProjectProperties.d.mts +381 -0
  34. package/mjs/dotnet/NugetProjectProperties.d.mts.map +1 -0
  35. package/mjs/dotnet/NugetProjectProperties.mjs +2 -577
  36. package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -1
  37. package/mjs/dotnet/NugetRegistryInfo.d.mts +387 -0
  38. package/mjs/dotnet/NugetRegistryInfo.d.mts.map +1 -0
  39. package/mjs/dotnet/NugetRegistryInfo.mjs +4 -752
  40. package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -1
  41. package/mjs/dotnet/helpers.d.mts +66 -0
  42. package/mjs/dotnet/helpers.d.mts.map +1 -0
  43. package/mjs/dotnet/helpers.mjs +2 -354
  44. package/mjs/dotnet/helpers.mjs.map +1 -1
  45. package/mjs/dotnet/index.d.mts +8 -0
  46. package/mjs/dotnet/index.mjs +1 -9
  47. package/mjs/dotnet.d.mts +8 -0
  48. package/mjs/dotnet.mjs +1 -9
  49. package/mjs/eslintConfig.d.mts +7 -0
  50. package/mjs/eslintConfig.d.mts.map +1 -0
  51. package/mjs/eslintConfig.mjs +2 -64
  52. package/mjs/eslintConfig.mjs.map +1 -1
  53. package/mjs/index.d.mts +2 -0
  54. package/mjs/index.mjs +1 -4
  55. package/mjs/insertPlugins.d.mts +22 -0
  56. package/mjs/insertPlugins.d.mts.map +1 -0
  57. package/mjs/insertPlugins.mjs +2 -73
  58. package/mjs/insertPlugins.mjs.map +1 -1
  59. package/mjs/semantic-release__commit-analyzer.d.mts +44 -0
  60. package/mjs/semantic-release__commit-analyzer.d.mts.map +1 -0
  61. package/mjs/semantic-release__exec.d.mts +17 -0
  62. package/mjs/semantic-release__exec.d.mts.map +1 -0
  63. package/mjs/semantic-release__git.d.mts +83 -0
  64. package/mjs/semantic-release__git.d.mts.map +1 -0
  65. package/mjs/semantic-release__github.d.mts +141 -0
  66. package/mjs/semantic-release__github.d.mts.map +1 -0
  67. package/mjs/semanticReleaseConfig.d.mts +94 -0
  68. package/mjs/semanticReleaseConfig.d.mts.map +1 -0
  69. package/mjs/semanticReleaseConfig.mjs +2 -63
  70. package/mjs/semanticReleaseConfig.mjs.map +1 -1
  71. package/mjs/semanticReleaseConfigDotnet.d.mts +96 -0
  72. package/mjs/semanticReleaseConfigDotnet.d.mts.map +1 -0
  73. package/mjs/semanticReleaseConfigDotnet.mjs +7 -274
  74. package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -1
  75. package/mjs/setupGitPluginSpec.d.mts +18 -0
  76. package/mjs/setupGitPluginSpec.d.mts.map +1 -0
  77. package/mjs/setupGitPluginSpec.default.d.mts +13 -0
  78. package/mjs/setupGitPluginSpec.default.d.mts.map +1 -0
  79. package/mjs/setupGitPluginSpec.default.mjs +4 -0
  80. package/mjs/setupGitPluginSpec.default.mjs.map +1 -0
  81. package/mjs/setupGitPluginSpec.mjs +2 -144
  82. package/mjs/setupGitPluginSpec.mjs.map +1 -1
  83. package/mjs/utils/Exact.d.mts +18 -0
  84. package/mjs/utils/Exact.d.mts.map +1 -0
  85. package/mjs/utils/Exact.mjs +2 -75
  86. package/mjs/utils/Exact.mjs.map +1 -1
  87. package/mjs/utils/GracefulRecursion.d.mts +14 -0
  88. package/mjs/utils/GracefulRecursion.d.mts.map +1 -0
  89. package/mjs/utils/env.d.mts +28 -0
  90. package/mjs/utils/env.d.mts.map +1 -0
  91. package/mjs/utils/env.mjs +2 -47
  92. package/mjs/utils/env.mjs.map +1 -1
  93. package/mjs/utils/execAsync.d.mts +40 -0
  94. package/mjs/utils/execAsync.d.mts.map +1 -0
  95. package/mjs/utils/execAsync.mjs +10 -59
  96. package/mjs/utils/execAsync.mjs.map +1 -1
  97. package/mjs/utils/isError.d.mts +14 -0
  98. package/mjs/utils/isError.d.mts.map +1 -0
  99. package/mjs/utils/isError.mjs +2 -19
  100. package/mjs/utils/isError.mjs.map +1 -1
  101. package/mjs/utils/miscTypes.d.mts +16 -0
  102. package/mjs/utils/miscTypes.d.mts.map +1 -0
  103. package/mjs/utils/miscTypes.mjs +2 -10
  104. package/mjs/utils/miscTypes.mjs.map +1 -1
  105. package/mjs/utils/reflection/FunctionLike.d.mts +17 -0
  106. package/mjs/utils/reflection/FunctionLike.d.mts.map +1 -0
  107. package/mjs/utils/reflection/GetterDescriptor.d.mts +11 -0
  108. package/mjs/utils/reflection/GetterDescriptor.d.mts.map +1 -0
  109. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mts +26 -0
  110. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mts.map +1 -0
  111. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts +17 -0
  112. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts.map +1 -0
  113. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts +18 -0
  114. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts.map +1 -0
  115. package/mjs/utils/reflection/OwnKeyOf.d.mts +15 -0
  116. package/mjs/utils/reflection/OwnKeyOf.d.mts.map +1 -0
  117. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mts +15 -0
  118. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mts.map +1 -0
  119. package/mjs/utils/reflection/PropertyDescriptorMap.d.mts +13 -0
  120. package/mjs/utils/reflection/PropertyDescriptorMap.d.mts.map +1 -0
  121. package/mjs/utils/reflection/filterForGetters.d.mts +11 -0
  122. package/mjs/utils/reflection/filterForGetters.d.mts.map +1 -0
  123. package/mjs/utils/reflection/filterForGetters.mjs +2 -27
  124. package/mjs/utils/reflection/filterForGetters.mjs.map +1 -1
  125. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.mts +26 -0
  126. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.mts.map +1 -0
  127. package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs +2 -34
  128. package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -1
  129. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.mts +51 -0
  130. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.mts.map +1 -0
  131. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs +2 -72
  132. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -1
  133. package/mjs/utils/reflection/getPrototypeChainOf.d.mts +19 -0
  134. package/mjs/utils/reflection/getPrototypeChainOf.d.mts.map +1 -0
  135. package/mjs/utils/reflection/getPrototypeChainOf.mjs +2 -55
  136. package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -1
  137. package/mjs/utils/reflection/getPrototypeOf.d.mts +12 -0
  138. package/mjs/utils/reflection/getPrototypeOf.d.mts.map +1 -0
  139. package/mjs/utils/reflection/getPrototypeOf.mjs +2 -10
  140. package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -1
  141. package/mjs/utils/reflection/inheritance.d.mts +173 -0
  142. package/mjs/utils/reflection/inheritance.d.mts.map +1 -0
  143. package/mjs/utils/reflection/inheritance.mjs +2 -148
  144. package/mjs/utils/reflection/inheritance.mjs.map +1 -1
  145. package/mjs/utils/reflection/isConstructor.d.mts +20 -0
  146. package/mjs/utils/reflection/isConstructor.d.mts.map +1 -0
  147. package/mjs/utils/reflection/isConstructor.mjs +2 -63
  148. package/mjs/utils/reflection/isConstructor.mjs.map +1 -1
  149. package/mjs/utils/reflection/isGetterDescriptor.d.mts +13 -0
  150. package/mjs/utils/reflection/isGetterDescriptor.d.mts.map +1 -0
  151. package/mjs/utils/reflection/isGetterDescriptor.mjs +2 -12
  152. package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -1
  153. package/mjs/utils/reflection/listOwnGetters.d.mts +29 -0
  154. package/mjs/utils/reflection/listOwnGetters.d.mts.map +1 -0
  155. package/mjs/utils/reflection/listOwnGetters.mjs +2 -39
  156. package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -1
  157. package/mjs/utils/reflection.d.mts +18 -0
  158. package/mjs/utils/reflection.mjs +1 -10
  159. package/package.json +99 -62
  160. package/src/debug.ts +1 -0
  161. package/src/dotnet/GithubNugetRegistryInfo.ts +4 -4
  162. package/src/dotnet/GitlabNugetRegistryInfo.ts +5 -5
  163. package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +2 -1
  164. package/src/dotnet/MSBuildProject.ts +7 -6
  165. package/src/dotnet/MSBuildProjectProperties.ts +4 -3
  166. package/src/dotnet/NugetProjectProperties.ts +4 -4
  167. package/src/dotnet/NugetRegistryInfo.ts +9 -8
  168. package/src/dotnet/helpers.ts +5 -4
  169. package/src/dotnet/index.ts +8 -8
  170. package/src/dotnet.ts +1 -1
  171. package/src/index.ts +1 -1
  172. package/src/semanticReleaseConfig.ts +5 -1
  173. package/src/semanticReleaseConfigDotnet.ts +10 -8
  174. package/src/setupGitPluginSpec.default.ts +22 -0
  175. package/src/setupGitPluginSpec.ts +4 -21
  176. package/src/tsconfig.json +1 -2
  177. package/src/utils/execAsync.ts +1 -1
  178. package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +1 -1
  179. package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +2 -2
  180. package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +2 -2
  181. package/src/utils/reflection/filterForGetters.ts +5 -5
  182. package/src/utils/reflection/getOwnPropertyDescriptors.ts +4 -4
  183. package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +12 -12
  184. package/src/utils/reflection/getPrototypeChainOf.ts +5 -5
  185. package/src/utils/reflection/getPrototypeOf.ts +1 -1
  186. package/src/utils/reflection/inheritance.ts +5 -5
  187. package/src/utils/reflection/isGetterDescriptor.ts +1 -1
  188. package/src/utils/reflection/listOwnGetters.ts +6 -6
  189. package/src/utils/reflection.ts +17 -17
  190. package/tsconfig.base.json +2 -2
  191. package/mjs/CaseInsensitiveMap.d.ts +0 -12
  192. package/mjs/CaseInsensitiveMap.d.ts.map +0 -1
  193. package/mjs/commitlintConfig.d.ts +0 -12
  194. package/mjs/commitlintConfig.d.ts.map +0 -1
  195. package/mjs/debug.d.ts +0 -6
  196. package/mjs/debug.d.ts.map +0 -1
  197. package/mjs/dotnet/GithubNugetRegistryInfo.d.ts +0 -38
  198. package/mjs/dotnet/GithubNugetRegistryInfo.d.ts.map +0 -1
  199. package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts +0 -61
  200. package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts.map +0 -1
  201. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts +0 -2
  202. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts.map +0 -1
  203. package/mjs/dotnet/MSBuildProject.d.ts +0 -264
  204. package/mjs/dotnet/MSBuildProject.d.ts.map +0 -1
  205. package/mjs/dotnet/MSBuildProjectProperties.d.ts +0 -170
  206. package/mjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
  207. package/mjs/dotnet/NugetProjectProperties.d.ts +0 -379
  208. package/mjs/dotnet/NugetProjectProperties.d.ts.map +0 -1
  209. package/mjs/dotnet/NugetRegistryInfo.d.ts +0 -384
  210. package/mjs/dotnet/NugetRegistryInfo.d.ts.map +0 -1
  211. package/mjs/dotnet/helpers.d.ts +0 -63
  212. package/mjs/dotnet/helpers.d.ts.map +0 -1
  213. package/mjs/dotnet/index.d.ts +0 -9
  214. package/mjs/dotnet/index.d.ts.map +0 -1
  215. package/mjs/dotnet/index.mjs.map +0 -1
  216. package/mjs/dotnet.d.ts +0 -2
  217. package/mjs/dotnet.d.ts.map +0 -1
  218. package/mjs/dotnet.mjs.map +0 -1
  219. package/mjs/eslintConfig.d.ts +0 -4
  220. package/mjs/eslintConfig.d.ts.map +0 -1
  221. package/mjs/index.d.ts +0 -3
  222. package/mjs/index.d.ts.map +0 -1
  223. package/mjs/index.mjs.map +0 -1
  224. package/mjs/insertPlugins.d.ts +0 -18
  225. package/mjs/insertPlugins.d.ts.map +0 -1
  226. package/mjs/semantic-release__commit-analyzer.d.mjs +0 -2
  227. package/mjs/semantic-release__commit-analyzer.d.mjs.map +0 -1
  228. package/mjs/semantic-release__exec.d.mjs +0 -2
  229. package/mjs/semantic-release__exec.d.mjs.map +0 -1
  230. package/mjs/semantic-release__git.d.mjs +0 -2
  231. package/mjs/semantic-release__git.d.mjs.map +0 -1
  232. package/mjs/semantic-release__github.d.mjs +0 -2
  233. package/mjs/semantic-release__github.d.mjs.map +0 -1
  234. package/mjs/semanticReleaseConfig.d.ts +0 -97
  235. package/mjs/semanticReleaseConfig.d.ts.map +0 -1
  236. package/mjs/semanticReleaseConfigDotnet.d.ts +0 -112
  237. package/mjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
  238. package/mjs/setupGitPluginSpec.d.ts +0 -22
  239. package/mjs/setupGitPluginSpec.d.ts.map +0 -1
  240. package/mjs/utils/Exact.d.ts +0 -20
  241. package/mjs/utils/Exact.d.ts.map +0 -1
  242. package/mjs/utils/GracefulRecursion.d.mjs +0 -2
  243. package/mjs/utils/GracefulRecursion.d.mjs.map +0 -1
  244. package/mjs/utils/env.d.ts +0 -24
  245. package/mjs/utils/env.d.ts.map +0 -1
  246. package/mjs/utils/execAsync.d.ts +0 -37
  247. package/mjs/utils/execAsync.d.ts.map +0 -1
  248. package/mjs/utils/isError.d.ts +0 -11
  249. package/mjs/utils/isError.d.ts.map +0 -1
  250. package/mjs/utils/miscTypes.d.ts +0 -12
  251. package/mjs/utils/miscTypes.d.ts.map +0 -1
  252. package/mjs/utils/reflection/FunctionLike.d.mjs +0 -2
  253. package/mjs/utils/reflection/FunctionLike.d.mjs.map +0 -1
  254. package/mjs/utils/reflection/GetterDescriptor.d.mjs +0 -2
  255. package/mjs/utils/reflection/GetterDescriptor.d.mjs.map +0 -1
  256. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs +0 -2
  257. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs.map +0 -1
  258. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs +0 -2
  259. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs.map +0 -1
  260. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs +0 -2
  261. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs.map +0 -1
  262. package/mjs/utils/reflection/OwnKeyOf.d.mjs +0 -2
  263. package/mjs/utils/reflection/OwnKeyOf.d.mjs.map +0 -1
  264. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs +0 -2
  265. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs.map +0 -1
  266. package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs +0 -2
  267. package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs.map +0 -1
  268. package/mjs/utils/reflection/filterForGetters.d.ts +0 -7
  269. package/mjs/utils/reflection/filterForGetters.d.ts.map +0 -1
  270. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts +0 -22
  271. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts.map +0 -1
  272. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts +0 -56
  273. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts.map +0 -1
  274. package/mjs/utils/reflection/getPrototypeChainOf.d.ts +0 -16
  275. package/mjs/utils/reflection/getPrototypeChainOf.d.ts.map +0 -1
  276. package/mjs/utils/reflection/getPrototypeOf.d.ts +0 -8
  277. package/mjs/utils/reflection/getPrototypeOf.d.ts.map +0 -1
  278. package/mjs/utils/reflection/inheritance.d.ts +0 -180
  279. package/mjs/utils/reflection/inheritance.d.ts.map +0 -1
  280. package/mjs/utils/reflection/isConstructor.d.ts +0 -17
  281. package/mjs/utils/reflection/isConstructor.d.ts.map +0 -1
  282. package/mjs/utils/reflection/isGetterDescriptor.d.ts +0 -9
  283. package/mjs/utils/reflection/isGetterDescriptor.d.ts.map +0 -1
  284. package/mjs/utils/reflection/listOwnGetters.d.ts +0 -26
  285. package/mjs/utils/reflection/listOwnGetters.d.ts.map +0 -1
  286. package/mjs/utils/reflection.d.ts +0 -18
  287. package/mjs/utils/reflection.d.ts.map +0 -1
  288. package/mjs/utils/reflection.mjs.map +0 -1
@@ -1,274 +1,7 @@
1
- import { inspect } from 'node:util';
2
- import _debug from './debug.mjs';
3
- import { configurePrepareCmd, configureDotnetNugetPush } from './dotnet/helpers.mjs';
4
- import { getEnvVarValue } from './utils/env.mjs';
5
- import { baseConfig } from './semanticReleaseConfig.mjs';
6
- import { NugetRegistryInfo } from './dotnet/NugetRegistryInfo.mjs';
7
- import { MSBuildProject } from './dotnet/MSBuildProject.mjs';
8
- import { insertPlugin } from './insertPlugins.mjs';
9
-
10
- /**
11
- * # Semantic-Release Config Factory (dotnet)
12
- * A functional Semantic-Release configuration for dotnet projects
13
- *
14
- * extends {@link baseConfig }
15
- *
16
- * <-- TABLE OF CONTENTS -->
17
- *
18
- * EASY: {@link getConfig}
19
- * Just provide the paths of the project file(s) and keep your API tokens ready.
20
- * ADVANCED: {@link SemanticReleaseConfigDotnet}
21
- * Allows for a hands-on customization if {@link getConfig} doesn't meet your needs.
22
- * Use a copy of {@link getConfig} as the starting point of a new function and make changes from there.
23
- * - {@link SemanticReleaseConfigDotnet#splicePlugin splicePlugin (insert/edit plugins)}
24
- * - {@link SemanticReleaseConfigDotnet#setupDotnetCommands setupDotnetCommands}
25
- * - {@link SemanticReleaseConfigDotnet#getTokenTestingCommands getTokenTestingCommands}
26
- */
27
-
28
- class SemanticReleaseConfigDotnet {
29
- options;
30
- _projectsToPublish;
31
- _projectsToPackAndPush;
32
- _evaluatedProjects;
33
-
34
- /**
35
- * Creates an instance of SemanticReleaseConfigDotnet.
36
- * Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet` publish, pack, and push.
37
- *
38
- * Note: To sign packages, create a Target in the corresponding project(s) e.g.
39
- * ```xml
40
- * <Target Name="SignNupkgs" AfterTargets="Pack">
41
- * <Exec Command="dotnet nuget sign $(PackageOutputPath) [remaining args]" ConsoleToMsBuild="true" />
42
- * </Target>
43
- * ```
44
- * Alternatively, splice your signing commands into the publishCmd string,
45
- * inserting them before `dotnet nuget push`.
46
- * If you sign different signatures depending on the NuGet registry,
47
- * splice your signing command (with "overwrite signature" enabled, if
48
- * desired) before the corresponding registry's `dotnet nuget push` command.
49
- * @param projectsToPublish An array of dotnet projects' relative paths. If
50
- * empty or unspecified, tries getting projects' semi-colon-separated relative
51
- * paths from the `PROJECTS_TO_PUBLISH` environment variable. If configured as
52
- * recommended, the projects' publish outputs will be zipped to '$PWD/publish'
53
- * for use in the `publish` semantic-release step (typically, GitHub release).
54
- * @param projectsToPackAndPush An array of dotnet projects' relative paths.
55
- * If empty or unspecified, tries getting projects' semi-colon-separated
56
- * relative paths from the `PROJECTS_TO_PACK_AND_PUSH` environment variable.
57
- * Otherwise, no packages will be packed and pushed.
58
- * If configured as recommended, `dotnet pack` will output the nupkg/snupkg
59
- * files to `$PWD/publish` where they will be globbed by `dotnet nuget push`.
60
- */
61
- constructor(projectsToPublish, projectsToPackAndPush) {
62
- this.options = baseConfig;
63
- /* normalize PluginSpecs to tuples */
64
- this.options.plugins = this.options.plugins.map(pluginSpec => typeof pluginSpec === 'string' ? [pluginSpec, {}] : pluginSpec);
65
- this._projectsToPublish = projectsToPublish;
66
- if (this._projectsToPublish.length === 0) {
67
- const p = getEnvVarValue('PROJECTS_TO_PUBLISH')?.split(';');
68
- if (p && p.length > 0) {
69
- this._projectsToPublish = p;
70
- } else if (_debug.enabled) {
71
- _debug(new Error('At least one project must be published. `projectsToPackAndPush` is empty and environment variable `PROJECTS_TO_PUBLISH` is undefined or empty.'));
72
- }
73
- }
74
- this._projectsToPackAndPush = projectsToPackAndPush;
75
- if (this._projectsToPackAndPush.length === 0) {
76
- const p = getEnvVarValue('PROJECTS_TO_PACK_AND_PUSH')?.split(';');
77
- if (p && p.length > 0) {
78
- this._projectsToPackAndPush = p;
79
- } else if (_debug.enabled) {
80
- _debug(new Error('projectsToPackAndPush.length must be > 0 or PROJECTS_TO_PACK_AND_PUSH must be defined and contain at least one path.'));
81
- }
82
- }
83
-
84
- // may be zero-length array
85
- this._evaluatedProjects = [...this._projectsToPublish.filter(v => v instanceof MSBuildProject), ...this._projectsToPackAndPush.filter(v => v instanceof NugetRegistryInfo).map(v => v.project)];
86
- }
87
- get ProjectsToPublish() {
88
- return this._projectsToPublish;
89
- }
90
- get ProjectsToPackAndPush() {
91
- return this._projectsToPackAndPush;
92
- }
93
- get EvaluatedProjects() {
94
- return this._evaluatedProjects;
95
- }
96
-
97
- // eslint-disable-next-line jsdoc/require-param
98
- /** @deprecated Superseded by {@link splicePlugin} */
99
- insertPlugin(afterPluginsIDs, insertPluginIDs, beforePluginsIDs) {
100
- this.options.plugins = insertPlugin(this.options.plugins, afterPluginsIDs, insertPluginIDs, beforePluginsIDs);
101
- }
102
-
103
- /**
104
- * generate dotnet commands for \@semantic-release/exec, appending commands with ' && ' when necessary.
105
- *
106
- * Note: All strings in {@link this.ProjectsToPackAndPush} will be converted to basic {@link NugetRegistryInfo} instances with default values.
107
- * If you need specific NRI settings or you need to push to GitLab-like or GitHub-like registries, instantiate them instead of passing their paths.
108
- * @todo change to builder method? e.g. static async SetupDotnetCommands(this: SemanticReleaseConfigDotnet): Promise<SemanticReleaseConfigDotnet>
109
- * @todo Add options param to allow users to enable pushing to GitLab, GitHub, NuGet.org with default settings -OR- with entirely custom settings.
110
- * @see https://github.com/semantic-release/exec#usage
111
- */
112
- async setupDotnetCommands() {
113
- let srExecIndex = this.options.plugins.findIndex(v => v[0] === '@semantic-release/exec');
114
- if (srExecIndex === -1) {
115
- const message = `\
116
- Unable to find\`['@semantic-release/exec', unknown]\` in plugins array!
117
- Appending it to the end of the array...This may cause an unexpected order of operations!`;
118
- console.warn(message);
119
- srExecIndex = this.options.plugins.push(['@semantic-release/exec', {}]) - 1;
120
- }
121
- const plugin = this.options.plugins[srExecIndex];
122
- const execOptions = plugin[1];
123
-
124
- // ensure all packable projects are evaluated
125
- // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
126
- this._projectsToPackAndPush = await Promise.all(this._projectsToPackAndPush.map(async project => {
127
- if (typeof project === 'string') {
128
- const packableProjects = await Promise.all(await MSBuildProject.PackableProjectsToMSBuildProjects([project]));
129
- if (packableProjects.length === 0) throw new Error('No MSBuildProject instances were returned!');
130
- this._evaluatedProjects.push(...packableProjects);
131
-
132
- // if the user doesn't want a defaulted NRI, they should pass their own NRI (or derived) instance.
133
- return packableProjects.map(project => new NugetRegistryInfo({
134
- project
135
- }));
136
- } else return [project];
137
- })).then(p => p.flat());
138
-
139
- // todo: double-check token-testing commands. Are they formatted prepended correctly?
140
- const verifyConditionsCmdAppendix = await Promise.all(this._projectsToPackAndPush.map(async project => await project.PackDummyPackage({}).then(() => project.GetPushDummyCommand({})))).then(cmds => cmds.join(' && '));
141
- execOptions.verifyConditionsCmd = execOptions.verifyConditionsCmd && execOptions.verifyConditionsCmd.trim().length > 0 ? `${execOptions.verifyConditionsCmd} && ${verifyConditionsCmdAppendix}` : verifyConditionsCmdAppendix;
142
- const verifyReleaseCmdAppendix = this.ProjectsToPackAndPush.filter(project => typeof project !== 'string').map(project => project.GetIsNextVersionAlreadyPublishedCommand()).join(' && ');
143
- execOptions.verifyReleaseCmd = execOptions.verifyReleaseCmd && execOptions.verifyReleaseCmd.trim().length > 0 ? `${execOptions.verifyReleaseCmd} && ${verifyReleaseCmdAppendix}` : verifyConditionsCmdAppendix;
144
- const prepareCmdAppendix = await configurePrepareCmd(this._projectsToPublish, this._projectsToPackAndPush);
145
-
146
- // 'ZipPublishDir' zips each publish folder to ./publish/*.zip
147
- execOptions.prepareCmd = execOptions.prepareCmd && execOptions.prepareCmd.trim().length > 0 ? `${execOptions.prepareCmd} && ${prepareCmdAppendix}` : prepareCmdAppendix;
148
-
149
- // FINISHED execOptions.prepareCmd
150
- // STARTING execOptions.publishCmd
151
- if (this._projectsToPackAndPush.length > 0) {
152
- const publishCmdAppendix = configureDotnetNugetPush(this._projectsToPackAndPush);
153
- execOptions.publishCmd = execOptions.publishCmd && execOptions.publishCmd.trim().length > 0 ? `${execOptions.publishCmd} && ${publishCmdAppendix}` : publishCmdAppendix;
154
- }
155
-
156
- // FINISHED execOptions.publishCmd
157
- }
158
-
159
- /**
160
- * Insert a plugin into the plugins array.
161
- * @param insertAfterPluginIDs Plugins which should appear BEFORE
162
- * {@link insertPluginIDs}.
163
- * @param insertPluginIDs The plugin(s) to insert into the plugins array.
164
- * @param insertBeforePluginsIDs plugins which should appear AFTER the
165
- * inserted plugin(s).
166
- */
167
- splicePlugin(insertAfterPluginIDs, insertPluginIDs, insertBeforePluginsIDs) {
168
- const errors = [];
169
- const pluginIDs = this.options.plugins.map(v => typeof v === 'string' ? v : v[0]);
170
-
171
- // if any beforePluginIDs are ordered before the last afterPlugin, throw. Impossible to sort.
172
-
173
- const indexOfLastPreceding = insertAfterPluginIDs.filter(v => pluginIDs.includes(v)).map(v => pluginIDs.indexOf(v)).sort().find((_v, i, obj) => i === obj.length - 1);
174
- if (!indexOfLastPreceding) throw new ReferenceError('An attempt to get the last element of indexOfLastAfter returned undefined.');
175
- const indicesOfBefore = insertBeforePluginsIDs.filter(v => pluginIDs.includes(v)).map(v => pluginIDs.indexOf(v)).sort();
176
- for (const index of indicesOfBefore) {
177
- if (index <= indexOfLastPreceding) {
178
- const formattedInsertIds = '[' + insertPluginIDs.map(v => `"${v}"`).join(', ') + ']';
179
- const formattedAfterIds = '[' + insertAfterPluginIDs.map(v => `"${v}"`).join(', ') + ']';
180
- const formattedBeforeIds = '[' + insertBeforePluginsIDs.map(v => `"${v}"`).join(', ') + ']';
181
- errors.push(new Error(`insertPlugin was instructed to insert ${formattedInsertIds} after ${formattedAfterIds} and before ${formattedBeforeIds}, ` + `but ${JSON.stringify(pluginIDs[indexOfLastPreceding])} is ordered after ${JSON.stringify(pluginIDs[index])}!`));
182
- }
183
- }
184
- if (errors.length > 0) throw new AggregateError(errors, 'One or more errors occurred while splicing plugin-option tuples into the Semantic Release config!');
185
- this.options.plugins.splice(indexOfLastPreceding + 1, 0, ...insertPluginIDs.map(v => [v, {}]));
186
- }
187
-
188
- // todo: join result with dummy pack commands
189
- async getTokenTestingCommands() {
190
- const promiseProjects = this.ProjectsToPackAndPush.every(nri => nri instanceof NugetRegistryInfo) ? this.ProjectsToPackAndPush.map(nri => nri.project) : await Promise.all(await MSBuildProject.PackableProjectsToMSBuildProjects(this.ProjectsToPackAndPush));
191
-
192
- /** if a project is not in {@link EvaluatedProjects}, add it */
193
- for (const project of promiseProjects) {
194
- if (!this.EvaluatedProjects.includes(project)) this.EvaluatedProjects.push(project);
195
- }
196
- const regInfos = promiseProjects.map(p => new NugetRegistryInfo({
197
- project: p
198
- }));
199
- const nupkgPaths = await Promise.all(regInfos.map(async nri => nri.PackDummyPackage({}).then(nupkgs => {
200
- // this is a full file path.
201
- const mainNupkg = nupkgs.find(nupkg => new RegExp(/(?<!symbols)\.nupkg$/).test(nupkg));
202
- if (mainNupkg !== undefined) return {
203
- nri: nri,
204
- nupkgPath: mainNupkg
205
- };
206
- throw new Error('None of the following dummy packages are non-symbol .nupkg files:\n' + nupkgs.map(nupkg => ` - ${nupkg}`).join('\n') + '\nIf you intended to push only symbol packages, check if a feature request already exists (https://github.com/HaloSPV3/HCE.Shared/issues?q=push+snupkg) and, if one does not exist, create one containing the keywords "push snupkg".');
207
- })));
208
- const pushCommands = nupkgPaths.map(pair => pair.nri.GetPushDummyCommand({}));
209
- return pushCommands.join(' && ');
210
- }
211
- toOptions() {
212
- return this.options;
213
- }
214
- }
215
-
216
- /**
217
- * Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet`
218
- * publish, pack, and nuget-push.
219
- * @param projectsToPublish
220
- * An array of dotnet projects' relative paths -OR- an array of
221
- * {@link MSBuildProject} instances.
222
- * - If `MSBuildProject[]`, the instances will be used as-is.
223
- * - If `[]`, tries getting projects' semi-colon-separated relative paths from
224
- * the `PROJECTS_TO_PUBLISH` environment variable.
225
- * - If configured as recommended, the projects' publish outputs will be zipped
226
- * to '$PWD/publish' for use in the `publish` semantic-release step e.g. for a
227
- * GitHub release.
228
- * @param projectsToPackAndPush An array of dotnet projects' relative paths -OR-
229
- * an array of instances of {@link NugetRegistryInfo} and/or derived classes.
230
- * - If `NugetRegistryInfo[]`, no conversions or modifications will occur.
231
- * - If `string[]`, the project paths will be converted to
232
- * {@link NugetRegistryInfo} instances with default values. This may be undesired.
233
- * - If `[]`, `dotnet pack` and `dotnet nuget push` commands will not be configured.
234
- * - If `undefined`, tries getting projects' semi-colon-separated relative paths
235
- * from the `PROJECTS_TO_PACK_AND_PUSH` environment variable.
236
- * With the recommended configuration, `dotnet pack` will write the nupkg/snupkg
237
- * files to `$PWD/publish` where they will be globbed by `dotnet nuget push`.
238
- * @returns a semantic-release Options object, based on
239
- * `@halospv3/hce.shared-config` (our base config), with the
240
- * `@semantic-release/exec` plugin configured to `dotnet publish`, `pack`, and
241
- * `push` the specified projects.
242
- */
243
- async function getConfig(projectsToPublish, projectsToPackAndPush) {
244
- if (_debug.enabled) {
245
- _debug('hce.shared-config:\n' + inspect(baseConfig, false, Infinity, true));
246
- }
247
- const errors = [];
248
- if (projectsToPublish.length === 0) {
249
- const _ = getEnvVarValue('PROJECTS_TO_PUBLISH');
250
- if (_ === undefined) errors.push(new Error('projectsToPublish.length must be > 0 or PROJECTS_TO_PUBLISH must be defined and contain at least one path.'));else projectsToPublish = _.split(';');
251
- }
252
- if (!projectsToPackAndPush) {
253
- const _ = getEnvVarValue('PROJECTS_TO_PACK_AND_PUSH');
254
- if (_ === undefined) errors.push(new Error('projectsToPackAndPush.length must be > 0 or PROJECTS_TO_PACK_AND_PUSH must be defined and contain at least one path.'));else projectsToPackAndPush = _.split(';');
255
- }
256
- if (errors.length > 0) {
257
- throw new Error(['getConfig cannot continue. One or more errors occurred.', ...errors.map(v => v.stack)].join('\n'));
258
- }
259
- const config = new SemanticReleaseConfigDotnet(projectsToPublish, projectsToPackAndPush ?? []);
260
- await config.setupDotnetCommands();
261
- const options = config.toOptions();
262
- if (_debug.enabled) {
263
- _debug('modified plugins array:');
264
- _debug(inspect(options.plugins, false, Infinity));
265
- }
266
- return options;
267
- }
268
-
269
- /**
270
- * @module semanticReleaseConfigDotnet
271
- */
272
-
273
- export { SemanticReleaseConfigDotnet, getConfig };
274
- //# sourceMappingURL=semanticReleaseConfigDotnet.mjs.map
1
+ import{baseConfig as e}from"./semanticReleaseConfig.mjs";import t from"./debug.mjs";import{MSBuildProject as n}from"./dotnet/MSBuildProject.mjs";import{getEnvVarValue as r}from"./utils/env.mjs";import{NugetRegistryInfo as i}from"./dotnet/NugetRegistryInfo.mjs";import{configureDotnetNugetPush as a,configurePrepareCmd as o}from"./dotnet/helpers.mjs";import{insertPlugin as s}from"./insertPlugins.mjs";import{inspect as c}from"node:util";import*as l from"node:console";var u=class{options;_projectsToPublish;_projectsToPackAndPush;_evaluatedProjects;constructor(a,o){if(this.options=e,this.options.plugins=this.options.plugins.map(e=>typeof e==`string`?[e,{}]:e),this._projectsToPublish=a,this._projectsToPublish.length===0){let e=r(`PROJECTS_TO_PUBLISH`)?.split(`;`);e&&e.length>0?this._projectsToPublish=e:t.enabled&&t(Error("At least one project must be published. `projectsToPackAndPush` is empty and environment variable `PROJECTS_TO_PUBLISH` is undefined or empty."))}if(this._projectsToPackAndPush=o,this._projectsToPackAndPush.length===0){let e=r(`PROJECTS_TO_PACK_AND_PUSH`)?.split(`;`);e&&e.length>0?this._projectsToPackAndPush=e:t.enabled&&t(Error(`projectsToPackAndPush.length must be > 0 or PROJECTS_TO_PACK_AND_PUSH must be defined and contain at least one path.`))}this._evaluatedProjects=[...this._projectsToPublish.filter(e=>e instanceof n),...this._projectsToPackAndPush.filter(e=>e instanceof i).map(e=>e.project)]}get ProjectsToPublish(){return this._projectsToPublish}get ProjectsToPackAndPush(){return this._projectsToPackAndPush}get EvaluatedProjects(){return this._evaluatedProjects}insertPlugin(e,t,n){this.options.plugins=s(this.options.plugins,e,t,n)}async setupDotnetCommands(){let e=this.options.plugins.findIndex(e=>e[0]===`@semantic-release/exec`);e===-1&&(l.warn("Unable to find`['@semantic-release/exec', unknown]` in plugins array!\nAppending it to the end of the array...This may cause an unexpected order of operations!"),e=this.options.plugins.push([`@semantic-release/exec`,{}])-1);let t=this.options.plugins[e][1];this._projectsToPackAndPush=await Promise.all(this._projectsToPackAndPush.map(async e=>{if(typeof e==`string`){let t=await Promise.all(await n.PackableProjectsToMSBuildProjects([e]));if(t.length===0)throw Error(`No MSBuildProject instances were returned!`);return this._evaluatedProjects.push(...t),t.map(e=>new i({project:e}))}else return[e]})).then(e=>e.flat());let r=await Promise.all(this._projectsToPackAndPush.map(async e=>await e.PackDummyPackage({}).then(()=>e.GetPushDummyCommand({})))).then(e=>e.join(` && `));t.verifyConditionsCmd=t.verifyConditionsCmd&&t.verifyConditionsCmd.trim().length>0?`${t.verifyConditionsCmd} && ${r}`:r;let s=this.ProjectsToPackAndPush.filter(e=>typeof e!=`string`).map(e=>e.GetIsNextVersionAlreadyPublishedCommand()).join(` && `);t.verifyReleaseCmd=t.verifyReleaseCmd&&t.verifyReleaseCmd.trim().length>0?`${t.verifyReleaseCmd} && ${s}`:r;let c=await o(this._projectsToPublish,this._projectsToPackAndPush);if(t.prepareCmd=t.prepareCmd&&t.prepareCmd.trim().length>0?`${t.prepareCmd} && ${c}`:c,this._projectsToPackAndPush.length>0){let e=a(this._projectsToPackAndPush);t.publishCmd=t.publishCmd&&t.publishCmd.trim().length>0?`${t.publishCmd} && ${e}`:e}}splicePlugin(e,t,n){let r=[],i=this.options.plugins.map(e=>typeof e==`string`?e:e[0]),a=e.filter(e=>i.includes(e)).map(e=>i.indexOf(e)).sort().find((e,t,n)=>t===n.length-1);if(!a)throw ReferenceError(`An attempt to get the last element of indexOfLastAfter returned undefined.`);let o=n.filter(e=>i.includes(e)).map(e=>i.indexOf(e)).sort();for(let s of o)if(s<=a){let o=`[`+t.map(e=>`"${e}"`).join(`, `)+`]`,c=`[`+e.map(e=>`"${e}"`).join(`, `)+`]`,l=`[`+n.map(e=>`"${e}"`).join(`, `)+`]`;r.push(Error(`insertPlugin was instructed to insert ${o} after ${c} and before ${l}, but ${JSON.stringify(i[a])} is ordered after ${JSON.stringify(i[s])}!`))}if(r.length>0)throw AggregateError(r,`One or more errors occurred while splicing plugin-option tuples into the Semantic Release config!`);this.options.plugins.splice(a+1,0,...t.map(e=>[e,{}]))}async getTokenTestingCommands(){let e=this.ProjectsToPackAndPush.every(e=>e instanceof i)?this.ProjectsToPackAndPush.map(e=>e.project):await Promise.all(await n.PackableProjectsToMSBuildProjects(this.ProjectsToPackAndPush));for(let t of e)this.EvaluatedProjects.includes(t)||this.EvaluatedProjects.push(t);let t=e.map(e=>new i({project:e}));return(await Promise.all(t.map(e=>e.PackDummyPackage({}).then(t=>{let n=t.find(e=>new RegExp(/(?<!symbols)\.nupkg$/).test(e));if(n!==void 0)return{nri:e,nupkgPath:n};throw Error(`None of the following dummy packages are non-symbol .nupkg files:
2
+ `+t.map(e=>` - ${e}`).join(`
3
+ `)+`
4
+ If you intended to push only symbol packages, check if a feature request already exists (https://github.com/HaloSPV3/HCE.Shared/issues?q=push+snupkg) and, if one does not exist, create one containing the keywords "push snupkg".`)})))).map(e=>e.nri.GetPushDummyCommand({})).join(` && `)}toOptions(){return this.options}};async function d(n,i){t.enabled&&t(`hce.shared-config:
5
+ `+c(e,!1,1/0,!0));let a=[];if(n.length===0){let e=r(`PROJECTS_TO_PUBLISH`);e===void 0?a.push(Error(`projectsToPublish.length must be > 0 or PROJECTS_TO_PUBLISH must be defined and contain at least one path.`)):n=e.split(`;`)}if(!i){let e=r(`PROJECTS_TO_PACK_AND_PUSH`);e===void 0?a.push(Error(`projectsToPackAndPush.length must be > 0 or PROJECTS_TO_PACK_AND_PUSH must be defined and contain at least one path.`)):i=e.split(`;`)}if(a.length>0)throw Error([`getConfig cannot continue. One or more errors occurred.`,...a.map(e=>e.stack)].join(`
6
+ `));let o=new u(n,i??[]);await o.setupDotnetCommands();let s=o.toOptions();return t.enabled&&(t(`modified plugins array:`),t(c(s.plugins,!1,1/0))),s}export{u as SemanticReleaseConfigDotnet,d as getConfig};
7
+ //# sourceMappingURL=semanticReleaseConfigDotnet.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"semanticReleaseConfigDotnet.mjs","sources":["../src/semanticReleaseConfigDotnet.ts"],"names":["debug"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUO,MAAM,2BAA2B,CAAC;AACzC,EAAE,OAAO;AACT,EAAE,kBAAkB;AACpB,EAAE,sBAAsB;AACxB,EAAE,kBAAkB;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,iBAAiB,EAAE,qBAAqB,EAAE;AACxD,IAAI,IAAI,CAAC,OAAO,GAAG,UAAU;AAC7B;AACA,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,GAAG,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC;AACjI,IAAI,IAAI,CAAC,kBAAkB,GAAG,iBAAiB;AAC/C,IAAI,IAAI,IAAI,CAAC,kBAAkB,CAAC,MAAM,KAAK,CAAC,EAAE;AAC9C,MAAM,MAAM,CAAC,GAAG,cAAc,CAAC,qBAAqB,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC;A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EAAE;AACF,EAAE,OAAO,OAAO;AAChB;;AAEA;AACA;AACA;;;;"}
1
+ {"version":3,"file":"semanticReleaseConfigDotnet.mjs","names":["debug"],"sources":["../src/semanticReleaseConfigDotnet.ts"],"sourcesContent":["/**\n * # Semantic-Release Config Factory (dotnet)\n * A functional Semantic-Release configuration for dotnet projects\n *\n * extends {@link baseConfig }\n *\n * <-- TABLE OF CONTENTS -->\n *\n * EASY: {@link getConfig}\n * Just provide the paths of the project file(s) and keep your API tokens ready.\n * ADVANCED: {@link SemanticReleaseConfigDotnet}\n * Allows for a hands-on customization if {@link getConfig} doesn't meet your needs.\n * Use a copy of {@link getConfig} as the starting point of a new function and make changes from there.\n * - {@link SemanticReleaseConfigDotnet#splicePlugin splicePlugin (insert/edit plugins)}\n * - {@link SemanticReleaseConfigDotnet#setupDotnetCommands setupDotnetCommands}\n * - {@link SemanticReleaseConfigDotnet#getTokenTestingCommands getTokenTestingCommands}\n */\n\nimport { inspect } from 'node:util';\nimport type { Options } from 'semantic-release';\n// @ts-types=\"./semantic-release__exec.d.ts\"\nimport type { Options as SRExecOptions } from '@semantic-release/exec';\nimport * as console from 'node:console';\nimport debug from './debug.ts';\nimport { configureDotnetNugetPush, configurePrepareCmd } from './dotnet/helpers.ts';\nimport { getEnvVarValue } from './utils/env.ts';\nimport { baseConfig } from './semanticReleaseConfig.ts';\nimport { NugetRegistryInfo } from './dotnet/NugetRegistryInfo.ts';\nimport { MSBuildProject } from './dotnet/MSBuildProject.ts';\nimport { insertPlugin } from './insertPlugins.ts';\n\ntype UnArray<T> = T extends (infer U)[] ? U : T;\ninterface SRConfigDotnetOptions extends Omit<typeof baseConfig, 'plugins'> {\n plugins: (UnArray<typeof baseConfig.plugins> | [string, unknown])[];\n}\n\nexport class SemanticReleaseConfigDotnet {\n private readonly options: SRConfigDotnetOptions;\n private readonly _projectsToPublish: string[] | MSBuildProject[];\n private _projectsToPackAndPush: string[] | NugetRegistryInfo[];\n private readonly _evaluatedProjects: MSBuildProject[];\n\n /**\n * Creates an instance of SemanticReleaseConfigDotnet.\n * Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet` publish, pack, and push.\n *\n * Note: To sign packages, create a Target in the corresponding project(s) e.g.\n * ```xml\n * <Target Name=\"SignNupkgs\" AfterTargets=\"Pack\">\n * <Exec Command=\"dotnet nuget sign $(PackageOutputPath) [remaining args]\" ConsoleToMsBuild=\"true\" />\n * </Target>\n * ```\n * Alternatively, splice your signing commands into the publishCmd string,\n * inserting them before `dotnet nuget push`.\n * If you sign different signatures depending on the NuGet registry,\n * splice your signing command (with \"overwrite signature\" enabled, if\n * desired) before the corresponding registry's `dotnet nuget push` command.\n * @param projectsToPublish An array of dotnet projects' relative paths. If\n * empty or unspecified, tries getting projects' semi-colon-separated relative\n * paths from the `PROJECTS_TO_PUBLISH` environment variable. If configured as\n * recommended, the projects' publish outputs will be zipped to '$PWD/publish'\n * for use in the `publish` semantic-release step (typically, GitHub release).\n * @param projectsToPackAndPush An array of dotnet projects' relative paths.\n * If empty or unspecified, tries getting projects' semi-colon-separated\n * relative paths from the `PROJECTS_TO_PACK_AND_PUSH` environment variable.\n * Otherwise, no packages will be packed and pushed.\n * If configured as recommended, `dotnet pack` will output the nupkg/snupkg\n * files to `$PWD/publish` where they will be globbed by `dotnet nuget push`.\n */\n constructor(\n projectsToPublish: string[] | MSBuildProject[],\n projectsToPackAndPush: string[] | NugetRegistryInfo[],\n ) {\n this.options = baseConfig;\n /* normalize PluginSpecs to tuples */\n this.options.plugins = this.options.plugins.map(pluginSpec => typeof pluginSpec === 'string'\n ? [pluginSpec, {}]\n : pluginSpec,\n );\n\n this._projectsToPublish = projectsToPublish;\n if (this._projectsToPublish.length === 0) {\n const p = getEnvVarValue('PROJECTS_TO_PUBLISH')?.split(';');\n if (p && p.length > 0) {\n this._projectsToPublish = p;\n }\n else if (debug.enabled) {\n debug(new Error('At least one project must be published. `projectsToPackAndPush` is empty and environment variable `PROJECTS_TO_PUBLISH` is undefined or empty.'));\n }\n }\n\n this._projectsToPackAndPush = projectsToPackAndPush;\n if (this._projectsToPackAndPush.length === 0) {\n const p = getEnvVarValue('PROJECTS_TO_PACK_AND_PUSH')?.split(';');\n if (p && p.length > 0) {\n this._projectsToPackAndPush = p;\n }\n else if (debug.enabled) {\n debug(new Error('projectsToPackAndPush.length must be > 0 or PROJECTS_TO_PACK_AND_PUSH must be defined and contain at least one path.'));\n }\n }\n\n // may be zero-length array\n this._evaluatedProjects = [\n ...this._projectsToPublish.filter(v => v instanceof MSBuildProject),\n ...this._projectsToPackAndPush\n .filter(v => v instanceof NugetRegistryInfo)\n .map(v => v.project),\n ];\n }\n\n get ProjectsToPublish(): string[] | MSBuildProject[] {\n return this._projectsToPublish;\n }\n\n get ProjectsToPackAndPush(): string[] | NugetRegistryInfo[] {\n return this._projectsToPackAndPush;\n }\n\n get EvaluatedProjects(): MSBuildProject[] {\n return this._evaluatedProjects;\n }\n\n // eslint-disable-next-line jsdoc/require-param\n /** @deprecated Superseded by {@link splicePlugin} */\n insertPlugin(\n afterPluginsIDs: string[],\n insertPluginIDs: string[],\n beforePluginsIDs: string[],\n ): void {\n this.options.plugins = insertPlugin(this.options.plugins, afterPluginsIDs, insertPluginIDs, beforePluginsIDs);\n }\n\n /**\n * generate dotnet commands for \\@semantic-release/exec, appending commands with ' && ' when necessary.\n *\n * Note: All strings in {@link this.ProjectsToPackAndPush} will be converted to basic {@link NugetRegistryInfo} instances with default values.\n * If you need specific NRI settings or you need to push to GitLab-like or GitHub-like registries, instantiate them instead of passing their paths.\n * @todo change to builder method? e.g. static async SetupDotnetCommands(this: SemanticReleaseConfigDotnet): Promise<SemanticReleaseConfigDotnet>\n * @todo Add options param to allow users to enable pushing to GitLab, GitHub, NuGet.org with default settings -OR- with entirely custom settings.\n * @see https://github.com/semantic-release/exec#usage\n */\n async setupDotnetCommands(): Promise<void> {\n let srExecIndex = this.options.plugins.findIndex(\n v => v[0] === '@semantic-release/exec',\n );\n if (srExecIndex === -1) {\n const message = `\\\nUnable to find\\`['@semantic-release/exec', unknown]\\` in plugins array!\nAppending it to the end of the array...This may cause an unexpected order of operations!`;\n console.warn(message);\n srExecIndex = this.options.plugins.push(['@semantic-release/exec', {}]) - 1;\n }\n\n const plugin = this.options.plugins[srExecIndex] as ['@semantic-release/exec', SRExecOptions];\n const execOptions: SRExecOptions = plugin[1];\n\n // ensure all packable projects are evaluated\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n this._projectsToPackAndPush = await Promise.all(\n this._projectsToPackAndPush.map(async (project) => {\n if (typeof project === 'string') {\n const packableProjects = await Promise.all(\n await MSBuildProject.PackableProjectsToMSBuildProjects(\n [project],\n ),\n );\n if (packableProjects.length === 0)\n throw new Error('No MSBuildProject instances were returned!');\n this._evaluatedProjects.push(...packableProjects);\n\n // if the user doesn't want a defaulted NRI, they should pass their own NRI (or derived) instance.\n return packableProjects.map(project => new NugetRegistryInfo({ project }));\n }\n else return [project];\n }),\n ).then(p => p.flat()) as NugetRegistryInfo[];\n\n // todo: double-check token-testing commands. Are they formatted prepended correctly?\n const verifyConditionsCmdAppendix = await Promise.all(\n this._projectsToPackAndPush\n .map(async project =>\n await project.PackDummyPackage({})\n .then(() =>\n project.GetPushDummyCommand({}),\n ),\n ),\n ).then(cmds =>\n cmds.join(' && '),\n );\n execOptions.verifyConditionsCmd\n = execOptions.verifyConditionsCmd && execOptions.verifyConditionsCmd.trim().length > 0\n ? `${execOptions.verifyConditionsCmd} && ${verifyConditionsCmdAppendix}`\n : verifyConditionsCmdAppendix;\n\n const verifyReleaseCmdAppendix\n = this.ProjectsToPackAndPush\n .filter(project =>\n typeof project !== 'string',\n ).map(project =>\n project.GetIsNextVersionAlreadyPublishedCommand(),\n ).join(' && ');\n execOptions.verifyReleaseCmd\n = execOptions.verifyReleaseCmd && execOptions.verifyReleaseCmd.trim().length > 0\n ? `${execOptions.verifyReleaseCmd} && ${verifyReleaseCmdAppendix}`\n : verifyConditionsCmdAppendix;\n\n const prepareCmdAppendix = await configurePrepareCmd(\n this._projectsToPublish,\n this._projectsToPackAndPush,\n );\n\n // 'ZipPublishDir' zips each publish folder to ./publish/*.zip\n execOptions.prepareCmd\n = execOptions.prepareCmd && execOptions.prepareCmd.trim().length > 0\n ? `${execOptions.prepareCmd} && ${prepareCmdAppendix}`\n : prepareCmdAppendix;\n\n // FINISHED execOptions.prepareCmd\n // STARTING execOptions.publishCmd\n if (this._projectsToPackAndPush.length > 0) {\n const publishCmdAppendix: string = configureDotnetNugetPush(\n this._projectsToPackAndPush,\n );\n execOptions.publishCmd\n = execOptions.publishCmd && execOptions.publishCmd.trim().length > 0\n ? `${execOptions.publishCmd} && ${publishCmdAppendix}`\n : publishCmdAppendix;\n }\n\n // FINISHED execOptions.publishCmd\n }\n\n /**\n * Insert a plugin into the plugins array.\n * @param insertAfterPluginIDs Plugins which should appear BEFORE\n * {@link insertPluginIDs}.\n * @param insertPluginIDs The plugin(s) to insert into the plugins array.\n * @param insertBeforePluginsIDs plugins which should appear AFTER the\n * inserted plugin(s).\n */\n splicePlugin(\n insertAfterPluginIDs: string[],\n insertPluginIDs: string[],\n insertBeforePluginsIDs: string[],\n ): void {\n const errors: Error[] = [];\n const pluginIDs = this.options.plugins.map(v =>\n typeof v === 'string' ? v : v[0],\n ) as (typeof this.options.plugins[number])[][0];\n\n // if any beforePluginIDs are ordered before the last afterPlugin, throw. Impossible to sort.\n\n const indexOfLastPreceding: number | undefined = insertAfterPluginIDs\n .filter(v => pluginIDs.includes(v))\n .map(v => pluginIDs.indexOf(v))\n .sort()\n .find((_v, i, obj) => i === obj.length - 1);\n if (!indexOfLastPreceding)\n throw new ReferenceError(\n 'An attempt to get the last element of indexOfLastAfter returned undefined.',\n );\n\n const indicesOfBefore: number[] = insertBeforePluginsIDs\n .filter(v => pluginIDs.includes(v))\n .map(v => pluginIDs.indexOf(v))\n .sort();\n\n for (const index of indicesOfBefore) {\n if (index <= indexOfLastPreceding) {\n const formattedInsertIds: string\n = '[' + insertPluginIDs.map(v => `\"${v}\"`).join(', ') + ']';\n const formattedAfterIds: string\n = '[' + insertAfterPluginIDs.map(v => `\"${v}\"`).join(', ') + ']';\n const formattedBeforeIds: string\n = '[' + insertBeforePluginsIDs.map(v => `\"${v}\"`).join(', ') + ']';\n errors.push(\n new Error(\n `insertPlugin was instructed to insert ${formattedInsertIds} after ${formattedAfterIds} and before ${formattedBeforeIds}, `\n + `but ${JSON.stringify(pluginIDs[indexOfLastPreceding])} is ordered after ${JSON.stringify(pluginIDs[index])}!`,\n ),\n );\n }\n }\n\n if (errors.length > 0)\n throw new AggregateError(errors, 'One or more errors occurred while splicing plugin-option tuples into the Semantic Release config!');\n\n this.options.plugins.splice(\n indexOfLastPreceding + 1,\n 0,\n ...insertPluginIDs.map(v => [v, {}] satisfies [string, unknown]),\n );\n }\n\n // todo: join result with dummy pack commands\n protected async getTokenTestingCommands(): Promise<string> {\n const promiseProjects = this.ProjectsToPackAndPush.every(nri => nri instanceof NugetRegistryInfo)\n ? this.ProjectsToPackAndPush.map(nri => nri.project)\n : await Promise.all(await MSBuildProject.PackableProjectsToMSBuildProjects(this.ProjectsToPackAndPush));\n\n /** if a project is not in {@link EvaluatedProjects}, add it */\n for (const project of promiseProjects) {\n if (!this.EvaluatedProjects.includes(project))\n this.EvaluatedProjects.push(project);\n }\n\n const regInfos = promiseProjects.map(\n p => new NugetRegistryInfo({ project: p }),\n );\n const nupkgPaths = await Promise.all(\n regInfos.map(nri =>\n nri.PackDummyPackage({}).then((nupkgs) => {\n // this is a full file path.\n const mainNupkg = nupkgs.find(nupkg =>\n new RegExp(/(?<!symbols)\\.nupkg$/).test(nupkg),\n );\n if (mainNupkg !== undefined)\n return { nri: nri, nupkgPath: mainNupkg } as const;\n throw new Error(\n 'None of the following dummy packages are non-symbol .nupkg files:\\n'\n + nupkgs.map(nupkg => ` - ${nupkg}`).join('\\n')\n + '\\nIf you intended to push only symbol packages, check if a feature request already exists (https://github.com/HaloSPV3/HCE.Shared/issues?q=push+snupkg) and, if one does not exist, create one containing the keywords \"push snupkg\".',\n );\n }),\n ),\n );\n const pushCommands = nupkgPaths.map(pair =>\n pair.nri.GetPushDummyCommand({}),\n );\n return pushCommands.join(' && ');\n }\n\n toOptions(): Options {\n return this.options;\n }\n}\n\n/**\n * Configures {@link baseConfig} with `@semantic-release/exec` to `dotnet`\n * publish, pack, and nuget-push.\n * @param projectsToPublish\n * An array of dotnet projects' relative paths -OR- an array of\n * {@link MSBuildProject} instances.\n * - If `MSBuildProject[]`, the instances will be used as-is.\n * - If `[]`, tries getting projects' semi-colon-separated relative paths from\n * the `PROJECTS_TO_PUBLISH` environment variable.\n * - If configured as recommended, the projects' publish outputs will be zipped\n * to '$PWD/publish' for use in the `publish` semantic-release step e.g. for a\n * GitHub release.\n * @param projectsToPackAndPush An array of dotnet projects' relative paths -OR-\n * an array of instances of {@link NugetRegistryInfo} and/or derived classes.\n * - If `NugetRegistryInfo[]`, no conversions or modifications will occur.\n * - If `string[]`, the project paths will be converted to\n * {@link NugetRegistryInfo} instances with default values. This may be undesired.\n * - If `[]`, `dotnet pack` and `dotnet nuget push` commands will not be configured.\n * - If `undefined`, tries getting projects' semi-colon-separated relative paths\n * from the `PROJECTS_TO_PACK_AND_PUSH` environment variable.\n * With the recommended configuration, `dotnet pack` will write the nupkg/snupkg\n * files to `$PWD/publish` where they will be globbed by `dotnet nuget push`.\n * @returns a semantic-release Options object, based on\n * `@halospv3/hce.shared-config` (our base config), with the\n * `@semantic-release/exec` plugin configured to `dotnet publish`, `pack`, and\n * `push` the specified projects.\n */\nexport async function getConfig(\n projectsToPublish: string[] | MSBuildProject[],\n projectsToPackAndPush?: string[] | NugetRegistryInfo[],\n): Promise<Options> {\n if (debug.enabled) {\n debug(\n 'hce.shared-config:\\n' + inspect(baseConfig, false, Infinity, true),\n );\n }\n\n const errors: Error[] = [];\n\n if (projectsToPublish.length === 0) {\n const _ = getEnvVarValue('PROJECTS_TO_PUBLISH');\n if (_ === undefined)\n errors.push(\n new Error(\n 'projectsToPublish.length must be > 0 or PROJECTS_TO_PUBLISH must be defined and contain at least one path.',\n ),\n );\n else projectsToPublish = _.split(';');\n }\n\n if (!projectsToPackAndPush) {\n const _ = getEnvVarValue('PROJECTS_TO_PACK_AND_PUSH');\n if (_ === undefined)\n errors.push(\n new Error(\n 'projectsToPackAndPush.length must be > 0 or PROJECTS_TO_PACK_AND_PUSH must be defined and contain at least one path.',\n ),\n );\n else projectsToPackAndPush = _.split(';');\n }\n\n if (errors.length > 0) {\n throw new Error(\n [\n 'getConfig cannot continue. One or more errors occurred.',\n ...errors.map(v => v.stack),\n ].join('\\n'),\n );\n }\n\n const config = new SemanticReleaseConfigDotnet(\n projectsToPublish,\n projectsToPackAndPush ?? [],\n );\n await config.setupDotnetCommands();\n\n const options: Options = config.toOptions();\n if (debug.enabled) {\n debug('modified plugins array:');\n debug(inspect(options.plugins, false, Infinity));\n }\n\n return options;\n}\n\n/**\n * @module semanticReleaseConfigDotnet\n */\n"],"mappings":"odAoCA,IAAa,EAAb,KAAyC,CACvC,QACA,mBACA,uBACA,mBA6BA,YACE,EACA,EACA,CASA,GARA,KAAK,QAAU,EAEf,KAAK,QAAQ,QAAU,KAAK,QAAQ,QAAQ,IAAI,GAAc,OAAO,GAAe,SAChF,CAAC,EAAY,EAAE,CAAC,CAChB,EACH,CAED,KAAK,mBAAqB,EACtB,KAAK,mBAAmB,SAAW,EAAG,CACxC,IAAM,EAAI,EAAe,sBAAsB,EAAE,MAAM,IAAI,CACvD,GAAK,EAAE,OAAS,EAClB,KAAK,mBAAqB,EAEnBA,EAAM,SACb,EAAU,MAAM,iJAAiJ,CAAC,CAKtK,GADA,KAAK,uBAAyB,EAC1B,KAAK,uBAAuB,SAAW,EAAG,CAC5C,IAAM,EAAI,EAAe,4BAA4B,EAAE,MAAM,IAAI,CAC7D,GAAK,EAAE,OAAS,EAClB,KAAK,uBAAyB,EAEvBA,EAAM,SACb,EAAU,MAAM,uHAAuH,CAAC,CAK5I,KAAK,mBAA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AAoB,EAAE,CAAC,CACjC,CACmB,KAAK,OAAO,CAGlC,WAAqB,CACnB,OAAO,KAAK,UA+BhB,eAAsB,EACpB,EACA,EACkB,CACdA,EAAM,SACR,EACE;EAAyB,EAAQ,EAAY,GAAO,IAAU,GAAK,CACpE,CAGH,IAAM,EAAkB,EAAE,CAE1B,GAAI,EAAkB,SAAW,EAAG,CAClC,IAAM,EAAI,EAAe,sBAAsB,CAC3C,IAAM,IAAA,GACR,EAAO,KACD,MACF,6GACD,CACF,CACE,EAAoB,EAAE,MAAM,IAAI,CAGvC,GAAI,CAAC,EAAuB,CAC1B,IAAM,EAAI,EAAe,4BAA4B,CACjD,IAAM,IAAA,GACR,EAAO,KACD,MACF,uHACD,CACF,CACE,EAAwB,EAAE,MAAM,IAAI,CAG3C,GAAI,EAAO,OAAS,EAClB,MAAU,MACR,CACE,0DACA,GAAG,EAAO,IAAI,GAAK,EAAE,MAAM,CAC5B,CAAC,KAAK;EAAK,CACb,CAGH,IAAM,EAAS,IAAI,EACjB,EACA,GAAyB,EAAE,CAC5B,CACD,MAAM,EAAO,qBAAqB,CAElC,IAAM,EAAmB,EAAO,WAAW,CAM3C,OALIA,EAAM,UACR,EAAM,0BAA0B,CAChC,EAAM,EAAQ,EAAQ,QAAS,GAAO,IAAS,CAAC,EAG3C"}
@@ -0,0 +1,18 @@
1
+ import { DefaultOptions } from "./setupGitPluginSpec.default.mjs";
2
+ import { PluginSpecTuple } from "./semanticReleaseConfig.mjs";
3
+
4
+ //#region src/setupGitPluginSpec.d.ts
5
+ declare const GitPluginId = "@semantic-release/git";
6
+ /**
7
+ * https://github.com/semantic-release/git#options
8
+ *
9
+ * This plugin may be deprecated at a later date.
10
+ * Q: Why would I need to commit during release?
11
+ * A: This is for committing your changelog, README, and/or other files updated during the release procedure.
12
+ * @param plugins An ordered array of {@link PluginSpecTuple PluginSpecTuples}.
13
+ * @returns A {@link PluginSpecTuple}[]. Duplicate `@semantic-release/git` plugin entries are merged or overridden. The last entry takes priority e.g. if the last entry is `{assets: false}`, previous entries' assets are ignored.
14
+ */
15
+ declare function setupGitPluginSpec(plugins: PluginSpecTuple[]): PluginSpecTuple[];
16
+ //#endregion
17
+ export { DefaultOptions, GitPluginId, setupGitPluginSpec };
18
+ //# sourceMappingURL=setupGitPluginSpec.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupGitPluginSpec.d.mts","names":[],"sources":["../src/setupGitPluginSpec.ts"],"mappings":";;;;cAKa,WAAA;;AAAb;;;;;AAiGA;;;iBAAgB,kBAAA,CAAmB,OAAA,EAAS,eAAA,KAAoB,eAAA"}
@@ -0,0 +1,13 @@
1
+ //#region src/setupGitPluginSpec.default.d.ts
2
+ /**
3
+ * As specified at https://github.com/semantic-release/git#options
4
+ * To use, assign or create an object with the same (but mutable) properties and deeply-copy to the object
5
+ * @satisfies { GitOptions }
6
+ */
7
+ declare const DefaultOptions: {
8
+ readonly assets: ["README.md", "CHANGELOG.md", "package.json", "package-lock.json", "npm-shrinkwrap.json"];
9
+ readonly message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}";
10
+ };
11
+ //#endregion
12
+ export { DefaultOptions };
13
+ //# sourceMappingURL=setupGitPluginSpec.default.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupGitPluginSpec.default.d.mts","names":[],"sources":["../src/setupGitPluginSpec.default.ts"],"mappings":";;AAQA;;;;cAAa,cAAA;EAAA,SACF,MAAA;EAAA,SACA,OAAA;AAAA"}
@@ -0,0 +1,4 @@
1
+ const e={assets:[`README.md`,`CHANGELOG.md`,`package.json`,`package-lock.json`,`npm-shrinkwrap.json`],message:`chore(release): \${nextRelease.version} [skip ci]
2
+
3
+ \${nextRelease.notes}`};export{e as DefaultOptions};
4
+ //# sourceMappingURL=setupGitPluginSpec.default.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupGitPluginSpec.default.mjs","names":[],"sources":["../src/setupGitPluginSpec.default.ts"],"sourcesContent":["/// <reference file=\"./semantic-release__git.d.ts\">\n// @ts-types=\"./semantic-release__git.d.ts\"\nimport type { Options as GitOptions } from '@semantic-release/git';\n/**\n * As specified at https://github.com/semantic-release/git#options\n * To use, assign or create an object with the same (but mutable) properties and deeply-copy to the object\n * @satisfies { GitOptions }\n */\nexport const DefaultOptions: {\n readonly assets: ['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'];\n readonly message: 'chore(release): ${nextRelease.version} [skip ci]\\n\\n${nextRelease.notes}';\n} = {\n assets: [\n 'README.md',\n 'CHANGELOG.md',\n 'package.json',\n 'package-lock.json',\n 'npm-shrinkwrap.json',\n ],\n message:\n 'chore(release): ${nextRelease.version} [skip ci]\\n\\n${nextRelease.notes}',\n} as const satisfies GitOptions;\n"],"mappings":"AAQA,MAAa,EAGT,CACF,OAAQ,CACN,YACA,eACA,eACA,oBACA,sBACD,CACD,QACE;;uBACH"}
@@ -1,144 +1,2 @@
1
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- const GitPluginId = '@semantic-release/git';
7
-
8
- /**
9
- * As specified at https://github.com/semantic-release/git#options
10
- * To use, assign or create an object with the same (but mutable) properties and deeply-copy to the object
11
- * @satisfies { GitOptions }
12
- */
13
- const DefaultOptions = {
14
- assets: ['README.md', 'CHANGELOG.md', 'package.json', 'package-lock.json', 'npm-shrinkwrap.json'],
15
- message: 'chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}'
16
- };
17
-
18
- /**
19
- * Check if {@link unk} is an {@link AssetEntry}.
20
- * @param unk Anything.
21
- * @returns `true` if {@link unk} is an {@link AssetEntry}. Else, `false`.
22
- */
23
- function isGitAsset(unk) {
24
- if (typeof unk === 'string') return true;
25
- // Avoid ending condition with `typeof unk.path === 'string'`.
26
- // TS narrowing is bugged; requires the check to be performed TWICE!!
27
- if (typeof unk === 'object' && unk != undefined && 'path' in unk) {
28
- return typeof unk.path === 'string';
29
- }
30
- return false;
31
- }
32
-
33
- /**
34
- * Convert one or more {@link AssetEntry AssetEntries} to a `string[]`.
35
- * @param assets The `assets` property of a {@link GitOptions} object. This may not be `false`.
36
- * @returns A `string[]` of the given {@link AssetEntry} objects or strings.
37
- */
38
- function gitAssetsToStringArray(assets) {
39
- if (assets === undefined) return [];
40
- if (Array.isArray(assets)) {
41
- return assets.filter(asset => isGitAsset(asset)).map(v => typeof v === 'string' ? v : v.path);
42
- }
43
- if (typeof assets === 'string') return [assets];
44
- if (typeof assets.path === 'string') return [assets.path];else throw new TypeError('assets is not typeof GitOptions[\'assets\'!');
45
- }
46
-
47
- /**
48
- * Sanitize a {@link GitOptions} object so its {@link GitOptions#assets} property is either `false` or a `string[]`.
49
- * @param opts A {@link GitOptions} object.
50
- * @returns A {@link GitOptions} object whose {@link GitOptions#assets} is `string[] | false`.
51
- */
52
- function sanitizeGitOptions(opts) {
53
- return _objectSpread(_objectSpread({}, opts), {}, {
54
- assets: opts.assets === false ? opts.assets : gitAssetsToStringArray(opts.assets)
55
- });
56
- }
57
-
58
- /**
59
- *Determine if {@link opts} is a {@link GitOptions} object.
60
- * @param opts Anything.
61
- * @returns `true` if {@link opts} is a {@link GitOptions} object. Else, `false`.
62
- */
63
- function isGitOptions(opts) {
64
- let isOptions = false;
65
- if (typeof opts !== 'object' || opts == undefined) return isOptions;
66
- if ('assets' in opts) {
67
- isOptions = Array.isArray(opts.assets) ? opts.assets.every(unk => isGitAsset(unk)) : isGitAsset(opts.assets);
68
- }
69
- if ('message' in opts) isOptions = typeof opts.message === 'string';
70
- return isOptions;
71
- }
72
-
73
- /**
74
- * Determine if {@link pluginSpec} includes a {@link GitOptions} object.
75
- * @param pluginSpec a {@link PluginSpecTuple}.
76
- * @returns `true` if {@link pluginSpec[1]} is a {@link GitOptions} object. Else, `false`.
77
- */
78
- function hasGitOptions(pluginSpec) {
79
- return isGitOptions(pluginSpec[1]);
80
- }
81
- ;
82
-
83
- /**
84
- * Determined if the plugin ID in {@link pluginSpec} is {@link GitPluginId}.
85
- * @param pluginSpec A {@link PluginSpecTuple}
86
- * @returns `true` if {@link pluginSpec[0]} is {@link GitPluginId}
87
- */
88
- function isGitPluginSpecTuple(pluginSpec) {
89
- return pluginSpec[0] === GitPluginId;
90
- }
91
-
92
- /**
93
- * https://github.com/semantic-release/git#options
94
- *
95
- * This plugin may be deprecated at a later date.
96
- * Q: Why would I need to commit during release?
97
- * A: This is for committing your changelog, README, and/or other files updated during the release procedure.
98
- * @param plugins An ordered array of {@link PluginSpecTuple PluginSpecTuples}.
99
- * @returns A {@link PluginSpecTuple}[]. Duplicate `@semantic-release/git` plugin entries are merged or overridden. The last entry takes priority e.g. if the last entry is `{assets: false}`, previous entries' assets are ignored.
100
- */
101
- function setupGitPluginSpec(plugins) {
102
- /** if Git plugin not in load order, return as-is. */
103
- const firstGitPluginIndex = plugins.findIndex(plugin => isGitPluginSpecTuple(plugin));
104
- if (firstGitPluginIndex === -1) return plugins;
105
-
106
- /**
107
- * the following two const variables are references--not clones.
108
- * Modifying them will affect the plugins array.
109
- */
110
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
111
- const firstGitPlugin = plugins[firstGitPluginIndex];
112
- const firstGitOpts = isGitOptions(firstGitPlugin[1]) ? sanitizeGitOptions(firstGitPlugin[1]) : DefaultOptions;
113
-
114
- /**
115
- * remove duplicate Git plugin entries;
116
- * merge extra options into firstGitPlugin's options
117
- * if `firstGitOpts.assets === false`, do not change it.
118
- * All duplicate PluginSpecSRGit entries are then reassigned `undefined` and all
119
- * `undefined` items are filtered from the plugins array.
120
- */
121
- return plugins.map((current, index) => {
122
- // skip everything up to and including the first Git PluginSpec
123
- if (index <= firstGitPluginIndex || !isGitPluginSpecTuple(current)) return current;
124
-
125
- /** if another Git PluginSpec is discovered, copy its options to the first Git PluginSpec and return undefined. */
126
- if (hasGitOptions(current)) {
127
- const currentGitOpts = sanitizeGitOptions(current[1]);
128
- if (currentGitOpts.assets === false) {
129
- firstGitOpts.assets = false;
130
- } else {
131
- const assets = gitAssetsToStringArray(currentGitOpts.assets);
132
- if (Array.isArray(firstGitOpts.assets)) {
133
- firstGitOpts.assets.push(...assets);
134
- } else {
135
- firstGitOpts.assets = assets;
136
- }
137
- }
138
- if (typeof currentGitOpts.message === 'string') firstGitOpts.message = currentGitOpts.message;
139
- }
140
- return undefined;
141
- }).filter(pluginSpec => pluginSpec !== undefined);
142
- }
143
- export { DefaultOptions, GitPluginId, setupGitPluginSpec };
144
- //# sourceMappingURL=setupGitPluginSpec.mjs.map
1
+ import{DefaultOptions as e}from"./setupGitPluginSpec.default.mjs";const t=`@semantic-release/git`;function n(e){return typeof e==`string`?!0:typeof e==`object`&&e&&`path`in e?typeof e.path==`string`:!1}function r(e){if(e===void 0)return[];if(Array.isArray(e))return e.filter(e=>n(e)).map(e=>typeof e==`string`?e:e.path);if(typeof e==`string`)return[e];if(typeof e.path==`string`)return[e.path];throw TypeError(`assets is not typeof GitOptions['assets'!`)}function i(e){return{...e,assets:e.assets===!1?e.assets:r(e.assets)}}function a(e){let t=!1;return typeof e!=`object`||!e?t:(`assets`in e&&(t=Array.isArray(e.assets)?e.assets.every(e=>n(e)):n(e.assets)),`message`in e&&(t=typeof e.message==`string`),t)}function o(e){return a(e[1])}function s(e){return e[0]===t}function c(t){let n=t.findIndex(e=>s(e));if(n===-1)return t;let c=t[n],l=a(c[1])?i(c[1]):e;return t.map((e,t)=>{if(t<=n||!s(e))return e;if(o(e)){let t=i(e[1]);if(t.assets===!1)l.assets=!1;else{let e=r(t.assets);Array.isArray(l.assets)?l.assets.push(...e):l.assets=e}typeof t.message==`string`&&(l.message=t.message)}}).filter(e=>e!==void 0)}export{e as DefaultOptions,t as GitPluginId,c as setupGitPluginSpec};
2
+ //# sourceMappingURL=setupGitPluginSpec.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"setupGitPluginSpec.mjs","sources":["../src/setupGitPluginSpec.ts"],"names":[],"mappings":"AAAY,MAAC,WAAW,GAAG;;AAE3B;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG;AAC9B,EAAE,MAAM,EAAE,CAAC,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,CAAC;AACnG,EAAE,OAAO,EAAE;AACX;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,GAAG,EAAE;AACzB,EAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,OAAO,IAAI;AAC1C;AACA;AACA,EAAE,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,IAAI,SAAS,IAAI,MAAM,IAAI,GAAG,EAAE;AACpE,IAAI,OAAO,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;AACvC,EAAE;AACF,EAAE,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS,sBAA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AK,EAAE;AAC3C,QAAQ,YAAY,CAAC,MAAM,GAAG,KAAK;AACnC,MAAM,CAAC,MAAM;AACb,QAAQ,MAAM,MAAM,GAAG,sBAAsB,CAAC,cAAc,CAAC,MAAM,CAAC;AACpE,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;AAChD,UAAU,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC;AAC7C,QAAQ,CAAC,MAAM;AACf,UAAU,YAAY,CAAC,MAAM,GAAG,MAAM;AACtC,QAAQ;AACR,MAAM;AACN,MAAM,IAAI,OAAO,cAAc,CAAC,OAAO,KAAK,QAAQ,EAAE,YAAY,CAAC,OAAO,GAAG,cAAc,CAAC,OAAO;AACnG,IAAI;AACJ,IAAI,OAAO,SAAS;AACpB,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,IAAI,UAAU,KAAK,SAAS,CAAC;AACnD;;;;"}
1
+ {"version":3,"file":"setupGitPluginSpec.mjs","names":[],"sources":["../src/setupGitPluginSpec.ts"],"sourcesContent":["// @ts-types=\"./semantic-release__git.d.ts\"\nimport type { AssetEntry, Options as GitOptions } from '@semantic-release/git';\nimport type { PluginSpecSRGit, PluginSpecTuple } from './semanticReleaseConfig.ts';\nimport { DefaultOptions } from './setupGitPluginSpec.default.ts';\n\nexport const GitPluginId = '@semantic-release/git';\nexport { DefaultOptions } from './setupGitPluginSpec.default.ts';\n\n/**\n * Check if {@link unk} is an {@link AssetEntry}.\n * @param unk Anything.\n * @returns `true` if {@link unk} is an {@link AssetEntry}. Else, `false`.\n */\nfunction isGitAsset(unk: unknown): unk is AssetEntry {\n if (typeof unk === 'string')\n return true;\n // Avoid ending condition with `typeof unk.path === 'string'`.\n // TS narrowing is bugged; requires the check to be performed TWICE!!\n if (typeof unk === 'object' && unk != undefined && 'path' in unk) {\n return typeof unk.path === 'string';\n }\n return false;\n}\n\n/**\n * Convert one or more {@link AssetEntry AssetEntries} to a `string[]`.\n * @param assets The `assets` property of a {@link GitOptions} object. This may not be `false`.\n * @returns A `string[]` of the given {@link AssetEntry} objects or strings.\n */\nfunction gitAssetsToStringArray(\n assets: Exclude<GitOptions['assets'], false>,\n): string[] {\n if (assets === undefined)\n return [];\n if (Array.isArray(assets)) {\n return assets.filter(asset => isGitAsset(asset))\n .map(v => typeof v === 'string' ? v : v.path);\n }\n if (typeof assets === 'string')\n return [assets] as string[];\n if (typeof assets.path === 'string')\n return [assets.path];\n else\n throw new TypeError('assets is not typeof GitOptions[\\'assets\\'!');\n}\n\n/**\n * Sanitize a {@link GitOptions} object so its {@link GitOptions#assets} property is either `false` or a `string[]`.\n * @param opts A {@link GitOptions} object.\n * @returns A {@link GitOptions} object whose {@link GitOptions#assets} is `string[] | false`.\n */\nfunction sanitizeGitOptions(opts: GitOptions): Omit<GitOptions, 'assets'> & { assets: string[] | false } {\n return { ...opts, assets: opts.assets === false ? opts.assets : gitAssetsToStringArray(opts.assets) };\n}\n\n/**\n *Determine if {@link opts} is a {@link GitOptions} object.\n * @param opts Anything.\n * @returns `true` if {@link opts} is a {@link GitOptions} object. Else, `false`.\n */\nfunction isGitOptions(opts: unknown): opts is GitOptions {\n let isOptions = false;\n\n if (typeof opts !== 'object' || opts == undefined)\n return isOptions;\n if ('assets' in opts) {\n isOptions = Array.isArray(opts.assets)\n ? opts.assets.every(unk => isGitAsset(unk))\n : isGitAsset(opts.assets);\n }\n if ('message' in opts)\n isOptions = typeof opts.message === 'string';\n return isOptions;\n}\n\n/**\n * Determine if {@link pluginSpec} includes a {@link GitOptions} object.\n * @param pluginSpec a {@link PluginSpecTuple}.\n * @returns `true` if {@link pluginSpec[1]} is a {@link GitOptions} object. Else, `false`.\n */\nfunction hasGitOptions<P extends string>(pluginSpec: PluginSpecTuple<P>): pluginSpec is PluginSpecTuple<P, GitOptions> {\n return isGitOptions(pluginSpec[1]);\n};\n\n/**\n * Determined if the plugin ID in {@link pluginSpec} is {@link GitPluginId}.\n * @param pluginSpec A {@link PluginSpecTuple}\n * @returns `true` if {@link pluginSpec[0]} is {@link GitPluginId}\n */\nfunction isGitPluginSpecTuple<T>(pluginSpec: [string, T]): pluginSpec is [typeof GitPluginId, T] {\n return pluginSpec[0] === GitPluginId;\n}\n\n/**\n * https://github.com/semantic-release/git#options\n *\n * This plugin may be deprecated at a later date.\n * Q: Why would I need to commit during release?\n * A: This is for committing your changelog, README, and/or other files updated during the release procedure.\n * @param plugins An ordered array of {@link PluginSpecTuple PluginSpecTuples}.\n * @returns A {@link PluginSpecTuple}[]. Duplicate `@semantic-release/git` plugin entries are merged or overridden. The last entry takes priority e.g. if the last entry is `{assets: false}`, previous entries' assets are ignored.\n */\nexport function setupGitPluginSpec(plugins: PluginSpecTuple[]): PluginSpecTuple[] {\n /** if Git plugin not in load order, return as-is. */\n const firstGitPluginIndex = plugins.findIndex(plugin => isGitPluginSpecTuple(plugin));\n if (firstGitPluginIndex === -1)\n return plugins;\n\n /**\n * the following two const variables are references--not clones.\n * Modifying them will affect the plugins array.\n */\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const firstGitPlugin = plugins[firstGitPluginIndex]!;\n const firstGitOpts: ReturnType<typeof sanitizeGitOptions> = isGitOptions(firstGitPlugin[1])\n ? sanitizeGitOptions(firstGitPlugin[1])\n : DefaultOptions;\n\n /**\n * remove duplicate Git plugin entries;\n * merge extra options into firstGitPlugin's options\n * if `firstGitOpts.assets === false`, do not change it.\n * All duplicate PluginSpecSRGit entries are then reassigned `undefined` and all\n * `undefined` items are filtered from the plugins array.\n */\n return plugins.map((current: PluginSpecTuple, index): PluginSpecTuple | PluginSpecSRGit | undefined => {\n // skip everything up to and including the first Git PluginSpec\n if (index <= firstGitPluginIndex || !isGitPluginSpecTuple(current))\n return current;\n\n /** if another Git PluginSpec is discovered, copy its options to the first Git PluginSpec and return undefined. */\n if (hasGitOptions(current)) {\n const currentGitOpts = sanitizeGitOptions(current[1]);\n\n if (currentGitOpts.assets === false) {\n firstGitOpts.assets = false;\n }\n else {\n const assets: string[] = gitAssetsToStringArray(currentGitOpts.assets);\n if (Array.isArray(firstGitOpts.assets)) {\n firstGitOpts.assets.push(...assets);\n }\n else {\n firstGitOpts.assets = assets;\n }\n }\n\n if (typeof currentGitOpts.message === 'string')\n firstGitOpts.message = currentGitOpts.message;\n }\n return undefined;\n }).filter(pluginSpec => pluginSpec !== undefined);\n}\n"],"mappings":"kEAKA,MAAa,EAAc,wBAQ3B,SAAS,EAAW,EAAiC,CAQnD,OAPI,OAAO,GAAQ,SACV,GAGL,OAAO,GAAQ,UAAY,GAAoB,SAAU,EACpD,OAAO,EAAI,MAAS,SAEtB,GAQT,SAAS,EACP,EACU,CACV,GAAI,IAAW,IAAA,GACb,MAAO,EAAE,CACX,GAAI,MAAM,QAAQ,EAAO,CACvB,OAAO,EAAO,OAAO,GAAS,EAAW,EAAM,CAAC,CAC7C,IAAI,GAAK,OAAO,GAAM,SAAW,EAAI,EAAE,KAAK,CAEjD,GAAI,OAAO,GAAW,SACpB,MAAO,CAAC,EAAO,CACjB,GAAI,OAAO,EAAO,MAAS,SACzB,MAAO,CAAC,EAAO,KAAK,CAEpB,MAAU,UAAU,4CAA8C,CAQtE,SAAS,EAAmB,EAA6E,CACvG,MAAO,CAAE,GAAG,EAAM,OAAQ,EAAK,SAAW,GAAQ,EAAK,OAAS,EAAuB,EAAK,OAAO,CAAE,CAQvG,SAAS,EAAa,EAAmC,CACvD,IAAI,EAAY,GAWhB,OATI,OAAO,GAAS,WAAY,EACvB,GACL,WAAY,IACd,EAAY,MAAM,QAAQ,EAAK,OAAO,CAClC,EAAK,OAAO,MAAM,GAAO,EAAW,EAAI,CAAC,CACzC,EAAW,EAAK,OAAO,EAEzB,YAAa,IACf,EAAY,OAAO,EAAK,SAAY,UAC/B,GAQT,SAAS,EAAgC,EAA8E,CACrH,OAAO,EAAa,EAAW,GAAG,CAQpC,SAAS,EAAwB,EAAgE,CAC/F,OAAO,EAAW,KAAO,EAY3B,SAAgB,EAAmB,EAA+C,CAEhF,IAAM,EAAsB,EAAQ,UAAU,GAAU,EAAqB,EAAO,CAAC,CACrF,GAAI,IAAwB,GAC1B,OAAO,EAOT,IAAM,EAAiB,EAAQ,GACzB,EAAsD,EAAa,EAAe,GAAG,CACvF,EAAmB,EAAe,GAAG,CACrC,EASJ,OAAO,EAAQ,KAAK,EAA0B,IAAyD,CAErG,GAAI,GAAS,GAAuB,CAAC,EAAqB,EAAQ,CAChE,OAAO,EAGT,GAAI,EAAc,EAAQ,CAAE,CAC1B,IAAM,EAAiB,EAAmB,EAAQ,GAAG,CAErD,GAAI,EAAe,SAAW,GAC5B,EAAa,OAAS,OAEnB,CACH,IAAM,EAAmB,EAAuB,EAAe,OAAO,CAClE,MAAM,QAAQ,EAAa,OAAO,CACpC,EAAa,OAAO,KAAK,GAAG,EAAO,CAGnC,EAAa,OAAS,EAItB,OAAO,EAAe,SAAY,WACpC,EAAa,QAAU,EAAe,WAG1C,CAAC,OAAO,GAAc,IAAe,IAAA,GAAU"}
@@ -0,0 +1,18 @@
1
+ //#region src/utils/Exact.d.ts
2
+ /**
3
+ * ### `Exact<T, S>`
4
+ *
5
+ * [issue](https://github.com/microsoft/TypeScript/issues/12936#issuecomment-2816928183)\
6
+ * [author](https://github.com/ahrjarrett)\
7
+ * license: unlicensed[!]
8
+ * @see
9
+ * - {@link https://tsplay.dev/NnGG6m}
10
+ */
11
+ type Exact<T, S> = [keyof T] extends [keyof S] ? [T] extends [S] ? { [K in keyof T]: T[K] } : S : { [K in keyof T as K extends keyof S ? never : K]: TypeError<`Excess: '${Coerce<K>}'`> };
12
+ interface TypeError<Message> {
13
+ [" TypeError"]: Message;
14
+ }
15
+ type Coerce<T> = `${T & (string | number)}`;
16
+ //#endregion
17
+ export { Exact };
18
+ //# sourceMappingURL=Exact.d.mts.map