@halospv3/hce.shared-config 2.6.4 → 3.0.0-develop.10

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 (310) hide show
  1. package/CHANGELOG.md +452 -101
  2. package/README.md +100 -87
  3. package/dotnet/.github/workflows/_unit_test.yml +3 -3
  4. package/dotnet/.github/workflows/ci.yml +2 -2
  5. package/dotnet/.github/workflows/dotnet-release.yml +28 -28
  6. package/dotnet/.github/workflows/sample-dotnet-build.yml +13 -11
  7. package/dotnet/ExecNupkgDeterministicator.README.md +20 -0
  8. package/dotnet/ExecNupkgDeterministicator.targets +173 -0
  9. package/dotnet/GitVersion.yml +3 -1
  10. package/dotnet/GitVersion6.0.yml +3 -1
  11. package/dotnet/HCE.Shared.sln +34 -0
  12. package/dotnet/HCE.Shared.targets +1 -0
  13. package/dotnet/PublishAll.targets +2 -0
  14. package/dotnet/SignAfterPack.targets +104 -0
  15. package/dotnet/samples/HCE.Shared.DeterministicNupkg/Dummy.cs +6 -0
  16. package/dotnet/samples/HCE.Shared.DeterministicNupkg/HCE.Shared.DeterministicNupkg.csproj +21 -0
  17. package/dotnet/samples/HCE.Shared.SignAfterPack/Class1.cs +6 -0
  18. package/dotnet/samples/HCE.Shared.SignAfterPack/HCE.Shared.SignAfterPack.csproj +21 -0
  19. package/dotnet/samples/HCE.Shared.SignAfterPack/sampleCert.samplepfx +0 -0
  20. package/dotnet/samples/README.md +7 -0
  21. package/mjs/CaseInsensitiveMap.d.ts +12 -0
  22. package/mjs/CaseInsensitiveMap.d.ts.map +1 -0
  23. package/mjs/CaseInsensitiveMap.mjs +33 -0
  24. package/mjs/CaseInsensitiveMap.mjs.map +1 -0
  25. package/mjs/commitlintConfig.d.ts +12 -0
  26. package/mjs/commitlintConfig.d.ts.map +1 -0
  27. package/{cjs/commitlintConfig.cjs → mjs/commitlintConfig.mjs} +3 -4
  28. package/mjs/commitlintConfig.mjs.map +1 -0
  29. package/mjs/debug.d.ts +4 -0
  30. package/{cjs → mjs}/debug.d.ts.map +1 -1
  31. package/mjs/debug.mjs +7 -0
  32. package/mjs/debug.mjs.map +1 -0
  33. package/mjs/dotnet/GithubNugetRegistryInfo.d.ts +38 -0
  34. package/mjs/dotnet/GithubNugetRegistryInfo.d.ts.map +1 -0
  35. package/mjs/dotnet/GithubNugetRegistryInfo.mjs +43 -0
  36. package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -0
  37. package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts +62 -0
  38. package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts.map +1 -0
  39. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +99 -0
  40. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -0
  41. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts +2 -0
  42. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts.map +1 -0
  43. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs +26 -0
  44. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -0
  45. package/mjs/dotnet/MSBuildProject.d.ts +256 -0
  46. package/mjs/dotnet/MSBuildProject.d.ts.map +1 -0
  47. package/mjs/dotnet/MSBuildProject.mjs +447 -0
  48. package/mjs/dotnet/MSBuildProject.mjs.map +1 -0
  49. package/mjs/dotnet/MSBuildProjectProperties.d.ts +170 -0
  50. package/mjs/dotnet/MSBuildProjectProperties.d.ts.map +1 -0
  51. package/mjs/dotnet/MSBuildProjectProperties.mjs +260 -0
  52. package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -0
  53. package/mjs/dotnet/NugetProjectProperties.d.ts +379 -0
  54. package/mjs/dotnet/NugetProjectProperties.d.ts.map +1 -0
  55. package/mjs/dotnet/NugetProjectProperties.mjs +577 -0
  56. package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -0
  57. package/mjs/dotnet/NugetRegistryInfo.d.ts +384 -0
  58. package/mjs/dotnet/NugetRegistryInfo.d.ts.map +1 -0
  59. package/mjs/dotnet/NugetRegistryInfo.mjs +752 -0
  60. package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -0
  61. package/mjs/dotnet/helpers.d.ts +63 -0
  62. package/mjs/dotnet/helpers.d.ts.map +1 -0
  63. package/mjs/dotnet/helpers.mjs +354 -0
  64. package/mjs/dotnet/helpers.mjs.map +1 -0
  65. package/mjs/dotnet/index.d.ts +17 -0
  66. package/mjs/dotnet/index.d.ts.map +1 -0
  67. package/mjs/dotnet/index.mjs +9 -0
  68. package/mjs/dotnet/index.mjs.map +1 -0
  69. package/mjs/dotnet.d.ts +3 -0
  70. package/mjs/dotnet.d.ts.map +1 -0
  71. package/mjs/dotnet.mjs +9 -0
  72. package/mjs/dotnet.mjs.map +1 -0
  73. package/mjs/eslintConfig.d.ts +4 -0
  74. package/mjs/eslintConfig.d.ts.map +1 -0
  75. package/mjs/eslintConfig.mjs +98 -0
  76. package/mjs/eslintConfig.mjs.map +1 -0
  77. package/mjs/index.d.ts +3 -0
  78. package/mjs/index.d.ts.map +1 -0
  79. package/mjs/index.mjs +4 -0
  80. package/mjs/index.mjs.map +1 -0
  81. package/mjs/insertPlugins.d.ts +18 -0
  82. package/mjs/insertPlugins.d.ts.map +1 -0
  83. package/mjs/insertPlugins.mjs +73 -0
  84. package/mjs/insertPlugins.mjs.map +1 -0
  85. package/mjs/semantic-release__commit-analyzer.d.mjs +2 -0
  86. package/mjs/semantic-release__commit-analyzer.d.mjs.map +1 -0
  87. package/mjs/semantic-release__exec.d.mjs +2 -0
  88. package/mjs/semantic-release__exec.d.mjs.map +1 -0
  89. package/mjs/semantic-release__git.d.mjs +2 -0
  90. package/mjs/semantic-release__git.d.mjs.map +1 -0
  91. package/mjs/semantic-release__github.d.mjs +2 -0
  92. package/mjs/semantic-release__github.d.mjs.map +1 -0
  93. package/mjs/semanticReleaseConfig.d.ts +97 -0
  94. package/mjs/semanticReleaseConfig.d.ts.map +1 -0
  95. package/mjs/semanticReleaseConfig.mjs +63 -0
  96. package/mjs/semanticReleaseConfig.mjs.map +1 -0
  97. package/mjs/semanticReleaseConfigDotnet.d.ts +109 -0
  98. package/mjs/semanticReleaseConfigDotnet.d.ts.map +1 -0
  99. package/mjs/semanticReleaseConfigDotnet.mjs +267 -0
  100. package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -0
  101. package/mjs/setupGitPluginSpec.d.ts +22 -0
  102. package/mjs/setupGitPluginSpec.d.ts.map +1 -0
  103. package/mjs/setupGitPluginSpec.mjs +144 -0
  104. package/mjs/setupGitPluginSpec.mjs.map +1 -0
  105. package/mjs/utils/Exact.d.ts +20 -0
  106. package/mjs/utils/Exact.d.ts.map +1 -0
  107. package/mjs/utils/Exact.mjs +75 -0
  108. package/mjs/utils/Exact.mjs.map +1 -0
  109. package/mjs/utils/GracefulRecursion.d.mjs +2 -0
  110. package/mjs/utils/GracefulRecursion.d.mjs.map +1 -0
  111. package/mjs/utils/env.d.ts +24 -0
  112. package/mjs/utils/env.d.ts.map +1 -0
  113. package/mjs/utils/env.mjs +39 -0
  114. package/mjs/utils/env.mjs.map +1 -0
  115. package/mjs/utils/execAsync.d.ts +37 -0
  116. package/mjs/utils/execAsync.d.ts.map +1 -0
  117. package/mjs/utils/execAsync.mjs +59 -0
  118. package/mjs/utils/execAsync.mjs.map +1 -0
  119. package/mjs/utils/miscTypes.d.ts +13 -0
  120. package/mjs/utils/miscTypes.d.ts.map +1 -0
  121. package/mjs/utils/miscTypes.mjs +10 -0
  122. package/mjs/utils/miscTypes.mjs.map +1 -0
  123. package/mjs/utils/reflection/FunctionLike.d.mjs +2 -0
  124. package/mjs/utils/reflection/FunctionLike.d.mjs.map +1 -0
  125. package/mjs/utils/reflection/GetterDescriptor.d.mjs +2 -0
  126. package/mjs/utils/reflection/GetterDescriptor.d.mjs.map +1 -0
  127. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs +2 -0
  128. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs.map +1 -0
  129. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs +2 -0
  130. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs.map +1 -0
  131. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs +2 -0
  132. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs.map +1 -0
  133. package/mjs/utils/reflection/OwnKeyOf.d.mjs +2 -0
  134. package/mjs/utils/reflection/OwnKeyOf.d.mjs.map +1 -0
  135. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs +2 -0
  136. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs.map +1 -0
  137. package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs +2 -0
  138. package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs.map +1 -0
  139. package/mjs/utils/reflection/filterForGetters.d.ts +7 -0
  140. package/mjs/utils/reflection/filterForGetters.d.ts.map +1 -0
  141. package/mjs/utils/reflection/filterForGetters.mjs +27 -0
  142. package/mjs/utils/reflection/filterForGetters.mjs.map +1 -0
  143. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts +22 -0
  144. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts.map +1 -0
  145. package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs +34 -0
  146. package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -0
  147. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts +56 -0
  148. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts.map +1 -0
  149. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs +72 -0
  150. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -0
  151. package/mjs/utils/reflection/getPrototypeChainOf.d.ts +16 -0
  152. package/mjs/utils/reflection/getPrototypeChainOf.d.ts.map +1 -0
  153. package/mjs/utils/reflection/getPrototypeChainOf.mjs +55 -0
  154. package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -0
  155. package/mjs/utils/reflection/getPrototypeOf.d.ts +8 -0
  156. package/mjs/utils/reflection/getPrototypeOf.d.ts.map +1 -0
  157. package/mjs/utils/reflection/getPrototypeOf.mjs +10 -0
  158. package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -0
  159. package/mjs/utils/reflection/inheritance.d.ts +180 -0
  160. package/mjs/utils/reflection/inheritance.d.ts.map +1 -0
  161. package/mjs/utils/reflection/inheritance.mjs +148 -0
  162. package/mjs/utils/reflection/inheritance.mjs.map +1 -0
  163. package/mjs/utils/reflection/isConstructor.d.ts +17 -0
  164. package/mjs/utils/reflection/isConstructor.d.ts.map +1 -0
  165. package/mjs/utils/reflection/isConstructor.mjs +63 -0
  166. package/mjs/utils/reflection/isConstructor.mjs.map +1 -0
  167. package/mjs/utils/reflection/isGetterDescriptor.d.ts +9 -0
  168. package/mjs/utils/reflection/isGetterDescriptor.d.ts.map +1 -0
  169. package/mjs/utils/reflection/isGetterDescriptor.mjs +12 -0
  170. package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -0
  171. package/mjs/utils/reflection/listOwnGetters.d.ts +26 -0
  172. package/mjs/utils/reflection/listOwnGetters.d.ts.map +1 -0
  173. package/mjs/utils/reflection/listOwnGetters.mjs +39 -0
  174. package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -0
  175. package/mjs/utils/reflection.d.ts +18 -0
  176. package/mjs/utils/reflection.d.ts.map +1 -0
  177. package/mjs/utils/reflection.mjs +10 -0
  178. package/mjs/utils/reflection.mjs.map +1 -0
  179. package/package.json +77 -78
  180. package/src/CaseInsensitiveMap.ts +34 -0
  181. package/src/commitlintConfig.ts +17 -9
  182. package/src/debug.ts +4 -4
  183. package/src/dotnet/GithubNugetRegistryInfo.ts +68 -0
  184. package/src/dotnet/GitlabNugetRegistryInfo.ts +126 -0
  185. package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +44 -0
  186. package/src/dotnet/MSBuildProject.ts +702 -76
  187. package/src/dotnet/MSBuildProjectProperties.ts +281 -15
  188. package/src/dotnet/NugetProjectProperties.ts +609 -0
  189. package/src/dotnet/NugetRegistryInfo.ts +1025 -0
  190. package/src/dotnet/helpers.ts +479 -0
  191. package/src/dotnet/index.ts +17 -0
  192. package/src/dotnet.ts +2 -6
  193. package/src/eslintConfig.ts +174 -71
  194. package/src/index.ts +1 -3
  195. package/src/insertPlugins.ts +116 -0
  196. package/src/semantic-release__commit-analyzer.d.ts +44 -38
  197. package/src/semantic-release__exec.d.ts +15 -0
  198. package/src/semantic-release__git.d.ts +85 -88
  199. package/src/semantic-release__github.d.ts +139 -139
  200. package/src/semanticReleaseConfig.ts +111 -47
  201. package/src/semanticReleaseConfigDotnet.ts +397 -104
  202. package/src/setupGitPluginSpec.ts +153 -58
  203. package/src/tsconfig.json +8 -8
  204. package/src/utils/Exact.ts +49 -0
  205. package/src/utils/GracefulRecursion.d.ts +12 -0
  206. package/src/utils/env.ts +44 -0
  207. package/src/utils/execAsync.ts +89 -0
  208. package/src/utils/miscTypes.ts +18 -0
  209. package/src/utils/reflection/FunctionLike.d.ts +17 -0
  210. package/src/utils/reflection/GetterDescriptor.d.ts +8 -0
  211. package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +32 -0
  212. package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +20 -0
  213. package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +17 -0
  214. package/src/utils/reflection/OwnKeyOf.d.ts +20 -0
  215. package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +82 -0
  216. package/src/utils/reflection/PropertyDescriptorMap.d.ts +15 -0
  217. package/src/utils/reflection/filterForGetters.ts +59 -0
  218. package/src/utils/reflection/getOwnPropertyDescriptors.ts +52 -0
  219. package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +127 -0
  220. package/src/utils/reflection/getPrototypeChainOf.ts +85 -0
  221. package/src/utils/reflection/getPrototypeOf.ts +12 -0
  222. package/src/utils/reflection/inheritance.ts +262 -0
  223. package/src/utils/reflection/isConstructor.ts +74 -0
  224. package/src/utils/reflection/isGetterDescriptor.ts +11 -0
  225. package/src/utils/reflection/listOwnGetters.ts +80 -0
  226. package/src/utils/reflection.ts +18 -0
  227. package/cjs/commitlintConfig-wrapper.mjs +0 -6
  228. package/cjs/commitlintConfig.cjs.map +0 -1
  229. package/cjs/commitlintConfig.d.ts +0 -4
  230. package/cjs/commitlintConfig.d.ts.map +0 -1
  231. package/cjs/debug.cjs +0 -13
  232. package/cjs/debug.cjs.map +0 -1
  233. package/cjs/debug.d.ts +0 -4
  234. package/cjs/dotnet/MSBuildProject.cjs +0 -84
  235. package/cjs/dotnet/MSBuildProject.cjs.map +0 -1
  236. package/cjs/dotnet/MSBuildProject.d.ts +0 -42
  237. package/cjs/dotnet/MSBuildProject.d.ts.map +0 -1
  238. package/cjs/dotnet/MSBuildProjectProperties.cjs +0 -22
  239. package/cjs/dotnet/MSBuildProjectProperties.cjs.map +0 -1
  240. package/cjs/dotnet/MSBuildProjectProperties.d.ts +0 -13
  241. package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
  242. package/cjs/dotnet/createDummyNupkg.cjs +0 -26
  243. package/cjs/dotnet/createDummyNupkg.cjs.map +0 -1
  244. package/cjs/dotnet/createDummyNupkg.d.ts +0 -2
  245. package/cjs/dotnet/createDummyNupkg.d.ts.map +0 -1
  246. package/cjs/dotnet/dotnetGHPR.cjs +0 -173
  247. package/cjs/dotnet/dotnetGHPR.cjs.map +0 -1
  248. package/cjs/dotnet/dotnetGHPR.d.ts +0 -37
  249. package/cjs/dotnet/dotnetGHPR.d.ts.map +0 -1
  250. package/cjs/dotnet/dotnetGLPR.cjs +0 -41
  251. package/cjs/dotnet/dotnetGLPR.cjs.map +0 -1
  252. package/cjs/dotnet/dotnetGLPR.d.ts +0 -13
  253. package/cjs/dotnet/dotnetGLPR.d.ts.map +0 -1
  254. package/cjs/dotnet/dotnetHelpers.cjs +0 -141
  255. package/cjs/dotnet/dotnetHelpers.cjs.map +0 -1
  256. package/cjs/dotnet/dotnetHelpers.d.ts +0 -26
  257. package/cjs/dotnet/dotnetHelpers.d.ts.map +0 -1
  258. package/cjs/dotnet-wrapper.mjs +0 -6
  259. package/cjs/dotnet.cjs +0 -15
  260. package/cjs/dotnet.cjs.map +0 -1
  261. package/cjs/dotnet.d.ts +0 -7
  262. package/cjs/dotnet.d.ts.map +0 -1
  263. package/cjs/envUtils-wrapper.mjs +0 -6
  264. package/cjs/envUtils.cjs +0 -37
  265. package/cjs/envUtils.cjs.map +0 -1
  266. package/cjs/envUtils.d.ts +0 -15
  267. package/cjs/envUtils.d.ts.map +0 -1
  268. package/cjs/eslintConfig-wrapper.mjs +0 -6
  269. package/cjs/eslintConfig.cjs +0 -52
  270. package/cjs/eslintConfig.cjs.map +0 -1
  271. package/cjs/eslintConfig.d.ts +0 -3
  272. package/cjs/eslintConfig.d.ts.map +0 -1
  273. package/cjs/findStaticConfig-wrapper.mjs +0 -6
  274. package/cjs/findStaticConfig.cjs +0 -34
  275. package/cjs/findStaticConfig.cjs.map +0 -1
  276. package/cjs/findStaticConfig.d.ts +0 -2
  277. package/cjs/findStaticConfig.d.ts.map +0 -1
  278. package/cjs/index-wrapper.mjs +0 -6
  279. package/cjs/index.cjs +0 -10
  280. package/cjs/index.cjs.map +0 -1
  281. package/cjs/index.d.ts +0 -5
  282. package/cjs/index.d.ts.map +0 -1
  283. package/cjs/semantic-release__commit-analyzer.d.cjs +0 -2
  284. package/cjs/semantic-release__commit-analyzer.d.cjs.map +0 -1
  285. package/cjs/semantic-release__git.d.cjs +0 -2
  286. package/cjs/semantic-release__git.d.cjs.map +0 -1
  287. package/cjs/semantic-release__github.d.cjs +0 -2
  288. package/cjs/semantic-release__github.d.cjs.map +0 -1
  289. package/cjs/semanticReleaseConfig-wrapper.mjs +0 -6
  290. package/cjs/semanticReleaseConfig.cjs +0 -33
  291. package/cjs/semanticReleaseConfig.cjs.map +0 -1
  292. package/cjs/semanticReleaseConfig.d.ts +0 -4
  293. package/cjs/semanticReleaseConfig.d.ts.map +0 -1
  294. package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +0 -7
  295. package/cjs/semanticReleaseConfigDotnet.cjs +0 -112
  296. package/cjs/semanticReleaseConfigDotnet.cjs.map +0 -1
  297. package/cjs/semanticReleaseConfigDotnet.d.ts +0 -51
  298. package/cjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
  299. package/cjs/setupGitPluginSpec-wrapper.mjs +0 -6
  300. package/cjs/setupGitPluginSpec.cjs +0 -67
  301. package/cjs/setupGitPluginSpec.cjs.map +0 -1
  302. package/cjs/setupGitPluginSpec.d.ts +0 -19
  303. package/cjs/setupGitPluginSpec.d.ts.map +0 -1
  304. package/src/dotnet/createDummyNupkg.ts +0 -30
  305. package/src/dotnet/dotnetGHPR.ts +0 -232
  306. package/src/dotnet/dotnetGLPR.ts +0 -46
  307. package/src/dotnet/dotnetHelpers.ts +0 -184
  308. package/src/envUtils.ts +0 -36
  309. package/src/findStaticConfig.ts +0 -31
  310. package/static/.releaserc.yml +0 -35
@@ -0,0 +1,262 @@
1
+ import type { Increment } from '../GracefulRecursion.js';
2
+ import type { Integer } from '../miscTypes.js';
3
+ import type { FunctionLike } from './FunctionLike.js';
4
+ import { getPrototypeOf } from './getPrototypeOf.js';
5
+ import type { PropertyDescriptorMap } from './PropertyDescriptorMap.js';
6
+
7
+ /**
8
+ * The `[[Prototype]]` (i.e. `__proto__`) of any base class.
9
+ * @since 3.0.0
10
+ */
11
+ export type BaseClassProto = (() => object) & {
12
+ /** @example BaseClass.__proto__.__proto__.toString() === '[object Object]' */
13
+ ['__proto__']: ObjectConstructor['prototype'] & {
14
+ ['__proto__']: null;
15
+ constructor: ObjectConstructor;
16
+ };
17
+ constructor: IBaseClass;
18
+ length: 0;
19
+ name: '';
20
+ };
21
+
22
+ /**
23
+ * The `[[Prototype]]` of all base classes.
24
+ * @since 3.0.0
25
+ */
26
+ export const baseClassProto: BaseClassProto = getPrototypeOf(Object as BaseClass<ObjectConstructor>);
27
+
28
+ /**
29
+ * [INTERNAL]
30
+ * An interface representing for attaching base class properties to a class type.
31
+ * This kept separate from {@link BaseClass} so it can be used by {@link BaseClassProto}.
32
+ * @since 3.0.0
33
+ */
34
+ interface IBaseClass {
35
+ /**
36
+ * Readable for compatibility reasons, but invisible and non-enumerable in Node.js runtime.
37
+ * @example BaseClass.__proto__.toString() === 'function () { [native code] }'
38
+ */
39
+ ['__proto__']: BaseClassProto;
40
+
41
+ constructor: FunctionConstructor & { name: 'Function' };
42
+ }
43
+
44
+ /**
45
+ * Type a class type as a base class.
46
+ * Note: is `Class & ...`
47
+ * @since 3.0.0
48
+ */
49
+ export type BaseClass<Class extends ConstructorConstraint<Class>>
50
+ = IClass<Class> & IBaseClass;
51
+
52
+ /**
53
+ * A type representing any unknown constructor.
54
+ * @since 3.0.0
55
+ */
56
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
57
+ export type Constructor_Unknown = abstract new (...args: any[]) => any;
58
+
59
+ /**
60
+ * The constraint for constructor types.
61
+ * This is intended for generic type constraints.
62
+ * For conditional return types, use `T extends Constructor<T>` instead.
63
+ * @template T Any newable constructor type
64
+ * @since 3.0.0
65
+ */
66
+ export type ConstructorConstraint<T extends abstract new (...args: ConstructorParameters<T>) => InstanceType<T>> = abstract new (...arguments_: ConstructorParameters<T>) => InstanceType<T>;
67
+
68
+ /**
69
+ * {@link T} is a class constructor or unknown constructor. Else, `never`.
70
+ *
71
+ * Consider using {@link ClassLike} where walking the inheritance chain is necessary.
72
+ * @template [T=Constructor_Unknown]
73
+ * @since 3.0.0
74
+ */
75
+ export type ConstructorLike<T = Constructor_Unknown>
76
+ = T extends Constructor_Unknown
77
+ ? T extends ConstructorConstraint<T>
78
+ ? T & ConstructorConstraint<T>
79
+ : T & Constructor_Unknown
80
+ : never;
81
+
82
+ /**
83
+ * A type representing unknown {@link ClassLike} types.
84
+ * @since 3.0.0
85
+ */
86
+ export type ClassLike_Unknown
87
+ = IClass<
88
+ Constructor_Unknown
89
+ & WithProto<SuperClassLike | BaseClassProto>
90
+ >;
91
+
92
+ /**
93
+ * A subset of {@link ProtoOrSuperClass} suitable for a class's `[[Prototype]]`
94
+ * @since 3.0.0
95
+ */
96
+ export type SuperClassLike = BaseClass<Constructor_Unknown> | ClassLike_Unknown;
97
+
98
+ /**
99
+ * A terrible type. Use it if you must, but prefer other types when possible.
100
+ *
101
+ * Covers most SuperClass/Prototype types.
102
+ * A class that does not extend another class will satisfy {@link BaseClass}.
103
+ *
104
+ * If a type extends {@link ProtoOrSuperClass} and is `null`, you cannot get the
105
+ * type's keys. See {@link ./OwnKeyOf.ts}.
106
+ * @template [T=ReturnType<typeof Reflect.getPrototypeOf>] `null` or an `object`-like type.
107
+ * @since 3.0.0
108
+ */
109
+ export type ProtoOrSuperClass<T extends object | null = ReturnType<typeof Reflect.getPrototypeOf>>
110
+ = T extends null ? null
111
+ : T extends object
112
+ ? T extends ConstructorLike<T>
113
+ ? T extends ClassLike<T & WithProto<SuperClassLike | BaseClassProto>>
114
+ ? T extends BaseClass<T> ? ClassLike<BaseClass<T>>
115
+ : ClassLike<T>
116
+ : T extends BaseClass<T>
117
+ ? BaseClass<T>
118
+ : ConstructorLike<T>
119
+ : T extends FunctionLike<infer FunctionConstraint>
120
+ ? T extends FunctionConstraint
121
+ ? FunctionLike<T>
122
+ : T & FunctionLike<FunctionConstraint>
123
+ : T extends object
124
+ ? T & object
125
+ : never
126
+ : never;
127
+
128
+ /**
129
+ * The {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain prototype chain} of any `object`-like type.
130
+ * Not to be confused with the _instance_ `.prototype` chain!
131
+ * ```
132
+ * > util.isDeepStrictEqual(Object.getOwnPropertyDescriptors({}.__proto__), Object.getOwnPropertyDescriptors(Object.prototype))
133
+ * true
134
+ * ```
135
+ * @template Object0 Any type with its `[[Prototype]]` attached as a `__proto__` property. The type of `__proto__` must extend {@link ProtoOrSuperClass}.
136
+ * @template [Limit=16]
137
+ * The maximum depth of recursion.
138
+ * Affects the maximum length of the returned type.\
139
+ * CAUTION: Larger values will severely degrade performance.
140
+ * 50 or more will trigger infinite-or-near-infinite-recursion errors.
141
+ * @template [CurrentLevel=0] (INTERNAL) The current depth of the prototype chain.
142
+ * @since 3.0.0
143
+ */
144
+ export type ProtoChainOfObject<
145
+ Object0 extends WithProto<ProtoOrSuperClass>,
146
+ Limit extends Integer<number> = 16,
147
+ CurrentLevel extends Integer<number> = 0,
148
+ > = PropertyDescriptorMap<Object0['__proto__']> extends PropertyDescriptorMap<ObjectConstructor['prototype']>
149
+ ? [Object0]
150
+ : Object0['__proto__'] extends WithProto<ProtoOrSuperClass>
151
+ ? CurrentLevel extends Limit ? [Object0]
152
+ : [
153
+ Object0,
154
+ ...ProtoChainOfObject<Object0['__proto__'], Limit, Increment<CurrentLevel>>,
155
+ ]
156
+ : never;
157
+
158
+ /**
159
+ * The {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain prototype chain} of an object (particularly, a class).
160
+ * @template Class Any type with its `[[Prototype]]` attached as a `__proto__` property.
161
+ * The type of `__proto__` must extend {@link SuperClassLike} or {@link BaseClassProto}.
162
+ * @template [Limit=16]
163
+ * The maximum depth of recursion.
164
+ * Affects the maximum length of the returned type.\
165
+ * CAUTION: Larger values will severely degrade performance.
166
+ * 50 or more will trigger infinite-or-near-infinite-recursion errors.
167
+ * @template [CurrentLevel=0] (INTERNAL) The current depth of the prototype chain.
168
+ * @since 3.0.0
169
+ */
170
+ export type ProtoChainOfClass<
171
+ Class extends WithProto<SuperClassLike | BaseClassProto>,
172
+ Limit extends Integer<number> = 16,
173
+ CurrentLevel extends Integer<number> = 0,
174
+ > = Class['__proto__'] extends BaseClassProto ? [Class]
175
+ : Class['__proto__'] extends SuperClassLike
176
+ ? CurrentLevel extends Limit ? [Class]
177
+ : [
178
+ Class,
179
+ ...ProtoChainOfClass<Class['__proto__'], Limit, Increment<CurrentLevel>>,
180
+ ]
181
+ : never;
182
+
183
+ /**
184
+ * The {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Inheritance_and_the_prototype_chain prototype chain} of a class instance.
185
+ * @template Class A constructor type with its `[[Prototype]]` attached as a `__proto__` property.
186
+ * @template [Limit=16]
187
+ * The maximum depth of recursion.
188
+ * Affects the maximum length of the returned type.\
189
+ * CAUTION: Larger values will severely degrade performance.
190
+ * 50 or more will trigger infinite-or-near-infinite-recursion errors.
191
+ * @template [CurrentLevel=0] (INTERNAL) The current depth of the prototype chain.
192
+ * @since 3.0.0
193
+ */
194
+ export type ProtoChainOfClassInstance<
195
+ Class extends ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>,
196
+ Limit extends Integer<number> = 16,
197
+ CurrentLevel extends Integer<number> = 0,
198
+ > = Class['__proto__'] extends BaseClassProto ? [InstanceType<Class>]
199
+ : Class['__proto__'] extends SuperClassLike
200
+ ? CurrentLevel extends Limit ? [InstanceType<Class>]
201
+ : [
202
+ InstanceType<Class>,
203
+ ...ProtoChainOfClassInstance<Class['__proto__'], Limit, Increment<CurrentLevel>>,
204
+ ]
205
+ : never;
206
+
207
+ /**
208
+ * Augment a class type to expose properties not exposed by TypeScript by default.
209
+ * Note: is `Class & ...`
210
+ * @template Class The typeof any class. If the type is unknown, wrap it with {@link ConstructorConstraint}.
211
+ * @since 3.0.0
212
+ */
213
+ // defined as `type` because interfaces cannot extend their generic parameters
214
+ export type IClass<Class extends ConstructorConstraint<Class>>
215
+ = Class
216
+ & {
217
+ prototype: InstanceType<Class>;
218
+ name: ConstructorConstraint<Class>['name'];
219
+ length: ConstructorConstraint<Class>['length'];
220
+ };
221
+
222
+ /**
223
+ * A more fleshed-out Class type.
224
+ *
225
+ * Note: is `Class & ...`
226
+ *
227
+ * In addition to the Constructor constraint, this type...
228
+ * - Sets the type of the immediate superclass.
229
+ * - Sets `prototype` to {@link InstanceType}
230
+ * @template Class The `typeof MyClass`. If this class extends a class, pass `typeof MySuperClass` to the generic argument {@link Class}.
231
+ * @example
232
+ * type Class_MyClass = ClassLike<typeof MyClass & WithProto<BaseClass<typeof MyBaseClass>>;
233
+ * @since 3.0.0
234
+ */
235
+ export type ClassLike<
236
+ Class extends ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>,
237
+ > = Class extends BaseClass<Class> ? Class
238
+ : Class['__proto__'] extends BaseClassProto ? BaseClass<Class>
239
+ : Class['__proto__'] extends ConstructorLike<Class['__proto__']>
240
+ ? IClass<Class> & WithProto<ConstructorLike<Class['__proto__']>>
241
+ // Here, __proto__ is retained via Class
242
+ : IClass<Class>;
243
+
244
+ /**
245
+ * If {@link T} is a class or constructor, {@link InstanceType}<{@link T}>. Else, {@link T}.
246
+ * @template T `null` or any `object`-like type.
247
+ * @since 3.0.0
248
+ */
249
+ export type InstanceTypeOrSelf<T extends object | null> = T extends ConstructorLike
250
+ ? T extends ConstructorLike<T>
251
+ ? InstanceType<T>
252
+ : T
253
+ : T;
254
+
255
+ /**
256
+ * Interface for attaching a `__proto__` to an object e.g. `T0 & WithProto<T1>`
257
+ * @template __proto__ the type of the an object's `[[Prototype]]`.
258
+ * @since 3.0.0
259
+ */
260
+ export interface WithProto<__proto__ extends ProtoOrSuperClass> {
261
+ ['__proto__']: __proto__;
262
+ }
@@ -0,0 +1,74 @@
1
+ /**
2
+ * A very jank function to determine if an object can be the target of Reflect.construct.
3
+ * Unfortunately, many functions have a constructor in their prototype. These
4
+ * functions are treated like classes due to JavaScript's poor distinction between
5
+ * classes and functions.\
6
+ * Typescript can enforce "new" keyword usage, but overriding the type
7
+ * allows you to `new isConstructor()` despite this function not intended to be
8
+ * used with the `new` keyword.
9
+ * #### NOTE: Only works when targeting ES6/ES2015 or later.
10
+ * > If your project or a dependent project is compiled to < ES6, this function will always return `false`; classes and constructors were introduced in ES6/ES2015.
11
+ * @param obj Anything.
12
+ * @returns `true` if the obj is a constructor. Else, `false`.
13
+ * @since 3.0.0
14
+ * @see https://stackoverflow.com/a/49510834
15
+ */
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ export function isConstructor(obj: unknown): obj is abstract new (...args: any[]) => any {
18
+ // Method 0 - filter
19
+ if (typeof obj !== 'function')
20
+ return false;
21
+
22
+ // Method 1
23
+ // statically-defined class
24
+ if (/^class\s/.test(obj.toString()))
25
+ return true;
26
+
27
+ /* Method 2
28
+ * > class class_ {}; function func(){}
29
+ * undefined
30
+ * > class_.prototype.constructor.name === class_.name
31
+ * true
32
+ * > func.prototype?.constructor?.name === func.name
33
+ * false
34
+ * typeof String.prototype ==='object'
35
+ * > true
36
+ * typeof Function.prototype === 'object';
37
+ * > false
38
+ * typeof Function.prototype
39
+ * > 'function'
40
+ */
41
+ const prototype: unknown = obj.prototype;
42
+ if ((typeof prototype === 'object' || typeof prototype === 'function')
43
+ && prototype !== null
44
+ && 'constructor' in prototype
45
+ && typeof prototype.constructor === 'function') {
46
+ const _ctor = prototype.constructor as (new (...arguments_: unknown[]) => unknown);
47
+ const _name = Reflect.getOwnPropertyDescriptor(
48
+ _ctor,
49
+ 'name',
50
+ );
51
+ // short-circuit if `obj.prototype.constructor` is a function, but not a constructor. Return false.
52
+ return (
53
+ _ctor === obj
54
+ && _name?.writable === false
55
+ && _name.enumerable === false
56
+ && _name.configurable === true
57
+ );
58
+ }
59
+
60
+ // Short-circuit
61
+ // Method 3 catches exceptions when !isConstructor. When debugging, that's annoying.
62
+ return false;
63
+
64
+ // Method 3
65
+ // isConstructable (See https://stackoverflow.com/a/49510834)
66
+ // try {
67
+ // // @ts-expect-error ts(2351): Type 'Function' has no construct signatures.
68
+ // new new Proxy(obj, { construct: () => ({}) })()
69
+ // return true
70
+ // }
71
+ // catch {
72
+ // return false
73
+ // }
74
+ }
@@ -0,0 +1,11 @@
1
+ import type { GetterDescriptor } from './GetterDescriptor.js';
2
+
3
+ /**
4
+ * A function for inferring a {@link TypedPropertyDescriptor} is a {@link GetterDescriptor}
5
+ * @param propertyDescriptor The {@link TypedPropertyDescriptor} to inspect.
6
+ * @returns `true` if {@link propertyDescriptor} describes a getter. Else, `false.
7
+ * @since 3.0.0
8
+ */
9
+ export function isGetterDescriptor<T>(propertyDescriptor: TypedPropertyDescriptor<T>): propertyDescriptor is GetterDescriptor<T> {
10
+ return typeof propertyDescriptor.get === 'function';
11
+ };
@@ -0,0 +1,80 @@
1
+ import type { InstanceOrStatic } from '../miscTypes.js';
2
+ import { filterForGetters } from './filterForGetters.js';
3
+ import { getOwnPropertyDescriptors } from './getOwnPropertyDescriptors.js';
4
+ import type {
5
+ BaseClassProto,
6
+ ClassLike,
7
+ ConstructorConstraint,
8
+ InstanceTypeOrSelf,
9
+ SuperClassLike,
10
+ WithProto,
11
+ } from './inheritance.js';
12
+ import type { InstancePropertyDescriptorMap } from './InstancePropertyDescriptorMap.js';
13
+ import type { OwnPropertyDescriptorMap } from './OwnPropertyDescriptorMap.js';
14
+
15
+ /**
16
+ * Description placeholder
17
+ * @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class
18
+ * @template {InstanceOrStatic} _InstanceOrStatic
19
+ * @since 3.0.0
20
+ */
21
+ type OwnGetters<
22
+ Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,
23
+ _InstanceOrStatic extends InstanceOrStatic,
24
+ >
25
+ = [_InstanceOrStatic] extends ['Instance']
26
+ ? Exclude<
27
+ (Class['__proto__'] extends BaseClassProto ? null : InstanceTypeOrSelf<Class['__proto__']>) extends null
28
+ ? keyof InstanceType<Class>
29
+ : Exclude<
30
+ keyof InstanceType<Class>,
31
+ keyof (Class['__proto__'] extends BaseClassProto ? null : InstanceTypeOrSelf<Class['__proto__']>)
32
+ >,
33
+ '__proto__'
34
+ >[]
35
+ : [_InstanceOrStatic] extends ['Static']
36
+ ? Exclude<
37
+ Class['__proto__'] extends null ? keyof Class : Exclude<keyof Class, keyof Class['__proto__']>,
38
+ '__proto__'
39
+ >[]
40
+ : never;
41
+
42
+ /**
43
+ * # !WARNING!
44
+ * > If you don't specify the Class's SuperClass (or `BaseClassProto`) via WithProto, the return type will wrongly include inherited property names! This is a design limitation of TypeScript.
45
+ *
46
+ * Returns the names of the instantiated (or static), noninherited getters derived from the
47
+ * given prototype or prototype of the given object.
48
+ * @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class
49
+ * @template {InstanceOrStatic} _InstanceOrStatic 'Instance' or 'Static'. Determines the return type.
50
+ * @param classDefinition Any class cast to ClassLike
51
+ * @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.
52
+ * @since 3.0.0
53
+ * @returns
54
+ * An array of names of getters that were not inherited from a parent class. If {@link classDefinition} is a class instance, the names of instanced getters are returned. Otherwise, the names of static getters are returned;
55
+ */
56
+ export function listOwnGetters<
57
+ Class extends ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>,
58
+ _InstanceOrStatic extends InstanceOrStatic,
59
+ >(
60
+ classDefinition: Class,
61
+ instanceOrStatic: Extract<_InstanceOrStatic, InstanceOrStatic>,
62
+ ): OwnGetters<Class, _InstanceOrStatic> {
63
+ if (instanceOrStatic === 'Instance') {
64
+ const descriptorMap: InstancePropertyDescriptorMap<Class> = getOwnPropertyDescriptors(classDefinition, instanceOrStatic as 'Instance');
65
+ const getterDescriptorMap = filterForGetters(descriptorMap);
66
+ const keyArray = Reflect.ownKeys(getterDescriptorMap) as (keyof typeof getterDescriptorMap)[];
67
+ return keyArray as [typeof instanceOrStatic & 'Instance'] extends ['Instance'] ? typeof keyArray : never;
68
+ }
69
+ else if (instanceOrStatic === 'Static') {
70
+ const descriptorMap: OwnPropertyDescriptorMap<Class> = getOwnPropertyDescriptors(classDefinition, instanceOrStatic as 'Static');
71
+ const getterDescriptorMap = filterForGetters(descriptorMap);
72
+ const keyArray = Reflect.ownKeys(getterDescriptorMap) as (keyof typeof getterDescriptorMap)[];
73
+ return keyArray as [_InstanceOrStatic] extends ['Instance']
74
+ ? never
75
+ : [_InstanceOrStatic] extends ['Static']
76
+ ? typeof keyArray
77
+ : never;
78
+ }
79
+ else throw new TypeError('Argument `instanceOrStatic` must be "Instance" or "Static".');
80
+ }
@@ -0,0 +1,18 @@
1
+ export type * from './reflection/FunctionLike.js';
2
+ export type * from './reflection/GetterDescriptor.js';
3
+ export type * from './reflection/InstancePropertyDescriptorMap.js';
4
+ export type * from './reflection/InstanceTypeOrSelfPropertyDescriptorMap.js';
5
+ export type * from './reflection/OwnGetterDescriptorMap.js';
6
+ export type * from './reflection/OwnKeyOf.js';
7
+ export type * from './reflection/OwnPropertyDescriptorMap.js';
8
+ export type * from './reflection/PropertyDescriptorMap.js';
9
+
10
+ export * from './reflection/filterForGetters.js';
11
+ export * from './reflection/getOwnPropertyDescriptors.js';
12
+ export * from './reflection/getOwnPropertyDescriptorsRecursively.js';
13
+ export * from './reflection/getPrototypeChainOf.js';
14
+ export * from './reflection/getPrototypeOf.js';
15
+ export * from './reflection/inheritance.js';
16
+ export * from './reflection/isConstructor.js';
17
+ export * from './reflection/isGetterDescriptor.js';
18
+ export * from './reflection/listOwnGetters.js';
@@ -1,6 +0,0 @@
1
- // Bundled with Packemon: https://packemon.dev
2
- // This is an MJS wrapper for a sibling CJS file
3
-
4
- import data from './commitlintConfig.cjs';
5
-
6
- export default data;
@@ -1 +0,0 @@
1
- {"version":3,"file":"commitlintConfig.cjs","sources":["../src/commitlintConfig.ts"],"sourcesContent":null,"names":[],"mappings":";;AAAA;AACA,MAAM,QAAQ,GAAG,CAAC;AACb,MAAC,gBAAgB,GAAG;AACzB,EAAE,OAAO,EAAE,CAAC,iCAAiC,CAAC;AAC9C,EAAE,KAAK,EAAE;AACT,IAAI,sBAAsB,EAAE,CAAC,QAAQ,CAAC;AACtC,IAAI,wBAAwB,EAAE,CAAC,QAAQ,CAAC;AACxC,IAAI,mBAAmB,EAAE,CAAC,QAAQ;AAClC;AACA;;;;"}
@@ -1,4 +0,0 @@
1
- import { type UserConfig } from '@commitlint/types';
2
- declare const commitlintConfig: UserConfig;
3
- export default commitlintConfig;
4
- //# sourceMappingURL=commitlintConfig.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commitlintConfig.d.ts","sourceRoot":"","sources":["../src/commitlintConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI7E,QAAA,MAAM,gBAAgB,EAAE,UAOvB,CAAC;AAGF,eAAe,gBAAgB,CAAC"}
package/cjs/debug.cjs DELETED
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- const debug = require('debug');
4
- const _interopDefault = e => e && e.__esModule ? e : {
5
- default: e
6
- };
7
- const debug__default = /*#__PURE__*/_interopDefault(debug);
8
- const _debug = debug__default.default('@halospv3/hce.shared-config');
9
- if (process.argv.some(v => v.includes('--debug')) || debug__default.default.enabled('*')) {
10
- debug__default.default.enable(_debug.namespace);
11
- }
12
- module.exports = _debug;
13
- //# sourceMappingURL=debug.cjs.map
package/cjs/debug.cjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug.cjs","sources":["../src/debug.ts"],"sourcesContent":null,"names":["debug"],"mappings":";;;;;;;;AACK,MAAC,MAAM,GAAGA,sBAAK,CAAC,6BAA6B;AAClD,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,IAAIA,sBAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;AACzE,EAAEA,sBAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;AAChC;;;;"}
package/cjs/debug.d.ts DELETED
@@ -1,4 +0,0 @@
1
- import debug from 'debug';
2
- declare const _debug: debug.Debugger;
3
- export default _debug;
4
- //# sourceMappingURL=debug.d.ts.map
@@ -1,84 +0,0 @@
1
- 'use strict';
2
-
3
- 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; }
4
- 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; }
5
- 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; }
6
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
7
- 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); }
8
- const node_child_process = require('node:child_process');
9
- const MSBuildProjectProperties = require('./MSBuildProjectProperties.cjs');
10
-
11
- /**
12
- * All pre-defined properties of {@link MSBuildProjectProperties} except FullPath
13
- */
14
- const MSBuildProjectPreDefinedProperties = Object.keys(new MSBuildProjectProperties.MSBuildProjectProperties('', false)).filter(p => p !== 'FullPath');
15
- /** @todo Experimental and may be removed in a later release.
16
- * A cache for your evaluated MSBuild Projects.
17
- */
18
- const MSBuildEvaluatedProjects = [];
19
- class MSBuildProject {
20
- Properties;
21
-
22
- /**
23
- *
24
- * @param fullPath The full path of the .NET MSBuild project file.
25
- * @param customProperties MSBuild properties to evaluate in addition to those pre-defined in {@link MSBuildProjectProperties}
26
- */
27
- constructor(fullPath, customProperties) {
28
- // super();
29
- this.Properties = MSBuildProject.evaluateProperties(fullPath, customProperties ?? []);
30
- }
31
-
32
- /**
33
- *
34
- * `dotnet msbuild src -getProperty:TargetFramework -getProperty:TargetFrameworks -getProperty:RuntimeIdentifiers -getProperty:IsTrimmable`
35
- *
36
- * ...produces...
37
- *
38
- * ```json
39
- * {
40
- * "Properties": {
41
- * "TargetFramework": "net6.0",
42
- * "TargetFrameworks": "",
43
- * "RuntimeIdentifiers": "win7-x64;win7-x86;win-arm64;linux-x64;linux-arm64",
44
- * "IsTrimmable": "true",
45
- * }
46
- * }
47
- * ```
48
- *
49
- * ...which can can be parsed like...
50
- * ```js
51
- * var ridArray = JSON.parse(out).Properties.RuntimeIdentifiers.split(';');
52
- * ```
53
- */
54
- static evaluateProperties(fullPath, properties) {
55
- const evaluatedProps = new MSBuildProjectProperties.MSBuildProjectProperties(fullPath);
56
-
57
- // if a default prop isn't in properties, add it
58
- const defaultProps = MSBuildProjectPreDefinedProperties;
59
- for (const defaultProp of defaultProps) {
60
- if (!properties.includes(defaultProp)) properties.push(defaultProp);
61
- }
62
- const getPropArgs = properties.map(propName => `-getProperty:${propName}`);
63
- // should return a single value OR string-encoded JSON object with 'Properties' object-type property.
64
- const out = node_child_process.execFileSync('dotnet', ['msbuild', evaluatedProps.FullPath, ...getPropArgs], {
65
- encoding: 'utf8',
66
- stdio: 'pipe'
67
- }).trim();
68
- if (out.startsWith('MSBUILD : error')) throw new Error(out);
69
- let props;
70
- if (out.startsWith('{')) {
71
- const obj = JSON.parse(out);
72
- if ("Properties" in obj && typeof obj.Properties === 'object' && obj.Properties !== null) props = obj.Properties;else throw new Error('When evaluating properties with MSBuild, "Properties" could not be found in the deserialized JSON object...\n' + JSON.stringify(obj));
73
- } else {
74
- props = {
75
- [properties[0]]: out.trim()
76
- };
77
- }
78
- return _objectSpread(_objectSpread({}, evaluatedProps), props);
79
- }
80
- }
81
- exports.MSBuildEvaluatedProjects = MSBuildEvaluatedProjects;
82
- exports.MSBuildProject = MSBuildProject;
83
- exports.MSBuildProjectPreDefinedProperties = MSBuildProjectPreDefinedProperties;
84
- //# sourceMappingURL=MSBuildProject.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MSBuildProject.cjs","sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":null,"names":["MSBuildProjectProperties","execFileSync"],"mappings":";;;;;AAGA;AACA;AACA;AACY,MAAC,kCAAkC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAIA,iDAAwB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,UAAU;AACnI;AACA;AACA;AACY,MAAC,wBAAwB,GAAG;AACjC,MAAM,cAAc,CAAC;AAC5B,EAAE,UAAU;;AAEZ;AACA;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,QAAQ,EAAE,gBAAgB,EAAE;AAC1C;AACA,IAAI,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,IAAI,EAAE,CAAC;AACzF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE,OAAO,kBAAkB,CAAC,QAAQ,EAAE,UAAU,EAAE;AAClD,IAAI,MAAM,cAAc,GAAG,IAAIA,iDAAwB,CAAC,QAAQ,CAAC;;AAEjE;AACA,IAAI,MAAM,YAAY,GAAG,kCAAkC;AAC3D,IAAI,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE;AAC5C,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;AACzE;AACA,IAAI,MAAM,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,QAAQ,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC9E;AACA,IAAI,MAAM,GAAG,GAAGC,+BAAY,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,QAAQ,EAAE,GAAG,WAAW,CAAC,EAAE;AAC7F,MAAM,QAAQ,EAAE,MAAM;AACtB,MAAM,KAAK,EAAE;AACb,KAAK,CAAC,CAAC,IAAI,EAAE;AACb,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC;AAC/D,IAAI,IAAI,KAAK;AACb,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;AAC7B,MAAM,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC;AACjC,MAAM,IAAI,YAAY,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,IAAI,GAAG,CAAC,UAAU,KAAK,IAAI,EAAE,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,KAAK,MAAM,IAAI,KAAK,CAAC,+GAA+G,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;AAClR,KAAK,MAAM;AACX,MAAM,KAAK,GAAG;AACd,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,IAAI;AACjC,OAAO;AACP;AACA,IAAI,OAAO;AACX,MAAM,GAAG,cAAc;AACvB,MAAM,GAAG;AACT,KAAK;AACL;AACA;;;;;;"}
@@ -1,42 +0,0 @@
1
- import { MSBuildProjectProperties } from './MSBuildProjectProperties.js';
2
- /**
3
- * All pre-defined properties of {@link MSBuildProjectProperties} except FullPath
4
- */
5
- export declare const MSBuildProjectPreDefinedProperties: string[];
6
- /** @todo Experimental and may be removed in a later release.
7
- * A cache for your evaluated MSBuild Projects.
8
- */
9
- export declare const MSBuildEvaluatedProjects: MSBuildProject[];
10
- export declare class MSBuildProject {
11
- Properties: MSBuildProjectProperties;
12
- /**
13
- *
14
- * @param fullPath The full path of the .NET MSBuild project file.
15
- * @param customProperties MSBuild properties to evaluate in addition to those pre-defined in {@link MSBuildProjectProperties}
16
- */
17
- constructor(fullPath: string, customProperties?: string[]);
18
- /**
19
- *
20
- * `dotnet msbuild src -getProperty:TargetFramework -getProperty:TargetFrameworks -getProperty:RuntimeIdentifiers -getProperty:IsTrimmable`
21
- *
22
- * ...produces...
23
- *
24
- * ```json
25
- * {
26
- * "Properties": {
27
- * "TargetFramework": "net6.0",
28
- * "TargetFrameworks": "",
29
- * "RuntimeIdentifiers": "win7-x64;win7-x86;win-arm64;linux-x64;linux-arm64",
30
- * "IsTrimmable": "true",
31
- * }
32
- * }
33
- * ```
34
- *
35
- * ...which can can be parsed like...
36
- * ```js
37
- * var ridArray = JSON.parse(out).Properties.RuntimeIdentifiers.split(';');
38
- * ```
39
- */
40
- static evaluateProperties(fullPath: string, properties: string[]): MSBuildProjectProperties;
41
- }
42
- //# sourceMappingURL=MSBuildProject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MSBuildProject.d.ts","sourceRoot":"","sources":["../../src/dotnet/MSBuildProject.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,kCAAkC,UAEd,CAAC;AAClC;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,cAAc,EAAO,CAAC;AAE7D,qBAAa,cAAc;IAC1B,UAAU,EAAE,wBAAwB,CAAC;IAErC;;;;OAIG;gBACS,QAAQ,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,EAAE;IAKzD;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,wBAAwB;CAiC3F"}
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- const node_fs = require('node:fs');
4
- const path = require('node:path');
5
-
6
- /**
7
- * Known properties. Additional properties may be added upon request.
8
- */
9
- class MSBuildProjectProperties {
10
- FullPath = '';
11
- TargetFramework = '';
12
- TargetFrameworks = '';
13
- RuntimeIdentifier = '';
14
- RuntimeIdentifiers = '';
15
- constructor(fullPath, exists = true) {
16
- this.FullPath = fullPath;
17
- if (!path.isAbsolute(this.FullPath)) this.FullPath = path.resolve(this.FullPath);
18
- if (!node_fs.existsSync(this.FullPath) && exists) throw new Error(`Project ${path.basename(this.FullPath)} could not be found at "${this.FullPath}"`);
19
- }
20
- }
21
- exports.MSBuildProjectProperties = MSBuildProjectProperties;
22
- //# sourceMappingURL=MSBuildProjectProperties.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MSBuildProjectProperties.cjs","sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"sourcesContent":null,"names":["isAbsolute","resolve","existsSync","basename"],"mappings":";;;;;AAGA;AACA;AACA;AACO,MAAM,wBAAwB,CAAC;AACtC,EAAE,QAAQ,GAAG,EAAE;AACf,EAAE,eAAe,GAAG,EAAE;AACtB,EAAE,gBAAgB,GAAG,EAAE;AACvB,EAAE,iBAAiB,GAAG,EAAE;AACxB,EAAE,kBAAkB,GAAG,EAAE;AACzB,EAAE,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,EAAE;AACvC,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ;AAC5B,IAAI,IAAI,CAACA,eAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,GAAGC,YAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;AAC1E,IAAI,IAAI,CAACC,kBAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,MAAM,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,QAAQ,EAAEC,aAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,wBAAwB,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;AAC5I;AACA;;;;"}