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

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 (152) hide show
  1. package/CHANGELOG.md +356 -101
  2. package/README.md +100 -87
  3. package/dotnet/.github/workflows/_unit_test.yml +6 -3
  4. package/dotnet/.github/workflows/ci.yml +2 -2
  5. package/dotnet/.github/workflows/dotnet-release.yml +31 -28
  6. package/dotnet/.github/workflows/sample-dotnet-build.yml +16 -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/package.json +72 -73
  22. package/src/CaseInsensitiveMap.ts +34 -0
  23. package/src/commitlintConfig.ts +17 -9
  24. package/src/debug.ts +3 -3
  25. package/src/dotnet/GithubNugetRegistryInfo.ts +60 -0
  26. package/src/dotnet/GitlabNugetRegistryInfo.ts +112 -0
  27. package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +44 -0
  28. package/src/dotnet/MSBuildProject.ts +557 -76
  29. package/src/dotnet/MSBuildProjectProperties.ts +280 -15
  30. package/src/dotnet/NugetProjectProperties.ts +608 -0
  31. package/src/dotnet/NugetRegistryInfo.ts +939 -0
  32. package/src/dotnet/helpers.ts +448 -0
  33. package/src/eslintConfig.ts +174 -71
  34. package/src/index.ts +1 -3
  35. package/src/semantic-release__commit-analyzer.d.ts +44 -38
  36. package/src/semantic-release__exec.d.ts +15 -0
  37. package/src/semantic-release__git.d.ts +85 -88
  38. package/src/semantic-release__github.d.ts +139 -139
  39. package/src/semanticReleaseConfig.ts +106 -47
  40. package/src/semanticReleaseConfigDotnet.ts +394 -104
  41. package/src/setupGitPluginSpec.ts +149 -57
  42. package/src/tsconfig.json +8 -8
  43. package/src/utils/Exact.ts +49 -0
  44. package/src/utils/GracefulRecursion.d.ts +12 -0
  45. package/src/utils/env.ts +44 -0
  46. package/src/utils/execAsync.ts +77 -0
  47. package/src/utils/miscTypes.ts +17 -0
  48. package/src/utils/reflection/FunctionLike.d.ts +17 -0
  49. package/src/utils/reflection/GetterDescriptor.d.ts +8 -0
  50. package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +32 -0
  51. package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +20 -0
  52. package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +17 -0
  53. package/src/utils/reflection/OwnKeyOf.d.ts +20 -0
  54. package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +82 -0
  55. package/src/utils/reflection/PropertyDescriptorMap.d.ts +15 -0
  56. package/src/utils/reflection/filterForGetters.ts +59 -0
  57. package/src/utils/reflection/getOwnPropertyDescriptors.ts +52 -0
  58. package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +127 -0
  59. package/src/utils/reflection/getPrototypeChainOf.ts +85 -0
  60. package/src/utils/reflection/getPrototypeOf.ts +12 -0
  61. package/src/utils/reflection/inheritance.ts +262 -0
  62. package/src/utils/reflection/isConstructor.ts +74 -0
  63. package/src/utils/reflection/isGetterDescriptor.ts +11 -0
  64. package/src/utils/reflection/listOwnGetters.ts +80 -0
  65. package/src/utils/reflection.ts +18 -0
  66. package/cjs/commitlintConfig-wrapper.mjs +0 -6
  67. package/cjs/commitlintConfig.cjs +0 -14
  68. package/cjs/commitlintConfig.cjs.map +0 -1
  69. package/cjs/commitlintConfig.d.ts +0 -4
  70. package/cjs/commitlintConfig.d.ts.map +0 -1
  71. package/cjs/debug.cjs +0 -13
  72. package/cjs/debug.cjs.map +0 -1
  73. package/cjs/debug.d.ts +0 -4
  74. package/cjs/debug.d.ts.map +0 -1
  75. package/cjs/dotnet/MSBuildProject.cjs +0 -84
  76. package/cjs/dotnet/MSBuildProject.cjs.map +0 -1
  77. package/cjs/dotnet/MSBuildProject.d.ts +0 -42
  78. package/cjs/dotnet/MSBuildProject.d.ts.map +0 -1
  79. package/cjs/dotnet/MSBuildProjectProperties.cjs +0 -22
  80. package/cjs/dotnet/MSBuildProjectProperties.cjs.map +0 -1
  81. package/cjs/dotnet/MSBuildProjectProperties.d.ts +0 -13
  82. package/cjs/dotnet/MSBuildProjectProperties.d.ts.map +0 -1
  83. package/cjs/dotnet/createDummyNupkg.cjs +0 -26
  84. package/cjs/dotnet/createDummyNupkg.cjs.map +0 -1
  85. package/cjs/dotnet/createDummyNupkg.d.ts +0 -2
  86. package/cjs/dotnet/createDummyNupkg.d.ts.map +0 -1
  87. package/cjs/dotnet/dotnetGHPR.cjs +0 -173
  88. package/cjs/dotnet/dotnetGHPR.cjs.map +0 -1
  89. package/cjs/dotnet/dotnetGHPR.d.ts +0 -37
  90. package/cjs/dotnet/dotnetGHPR.d.ts.map +0 -1
  91. package/cjs/dotnet/dotnetGLPR.cjs +0 -41
  92. package/cjs/dotnet/dotnetGLPR.cjs.map +0 -1
  93. package/cjs/dotnet/dotnetGLPR.d.ts +0 -13
  94. package/cjs/dotnet/dotnetGLPR.d.ts.map +0 -1
  95. package/cjs/dotnet/dotnetHelpers.cjs +0 -141
  96. package/cjs/dotnet/dotnetHelpers.cjs.map +0 -1
  97. package/cjs/dotnet/dotnetHelpers.d.ts +0 -26
  98. package/cjs/dotnet/dotnetHelpers.d.ts.map +0 -1
  99. package/cjs/dotnet-wrapper.mjs +0 -6
  100. package/cjs/dotnet.cjs +0 -15
  101. package/cjs/dotnet.cjs.map +0 -1
  102. package/cjs/dotnet.d.ts +0 -7
  103. package/cjs/dotnet.d.ts.map +0 -1
  104. package/cjs/envUtils-wrapper.mjs +0 -6
  105. package/cjs/envUtils.cjs +0 -37
  106. package/cjs/envUtils.cjs.map +0 -1
  107. package/cjs/envUtils.d.ts +0 -15
  108. package/cjs/envUtils.d.ts.map +0 -1
  109. package/cjs/eslintConfig-wrapper.mjs +0 -6
  110. package/cjs/eslintConfig.cjs +0 -52
  111. package/cjs/eslintConfig.cjs.map +0 -1
  112. package/cjs/eslintConfig.d.ts +0 -3
  113. package/cjs/eslintConfig.d.ts.map +0 -1
  114. package/cjs/findStaticConfig-wrapper.mjs +0 -6
  115. package/cjs/findStaticConfig.cjs +0 -34
  116. package/cjs/findStaticConfig.cjs.map +0 -1
  117. package/cjs/findStaticConfig.d.ts +0 -2
  118. package/cjs/findStaticConfig.d.ts.map +0 -1
  119. package/cjs/index-wrapper.mjs +0 -6
  120. package/cjs/index.cjs +0 -10
  121. package/cjs/index.cjs.map +0 -1
  122. package/cjs/index.d.ts +0 -5
  123. package/cjs/index.d.ts.map +0 -1
  124. package/cjs/semantic-release__commit-analyzer.d.cjs +0 -2
  125. package/cjs/semantic-release__commit-analyzer.d.cjs.map +0 -1
  126. package/cjs/semantic-release__git.d.cjs +0 -2
  127. package/cjs/semantic-release__git.d.cjs.map +0 -1
  128. package/cjs/semantic-release__github.d.cjs +0 -2
  129. package/cjs/semantic-release__github.d.cjs.map +0 -1
  130. package/cjs/semanticReleaseConfig-wrapper.mjs +0 -6
  131. package/cjs/semanticReleaseConfig.cjs +0 -33
  132. package/cjs/semanticReleaseConfig.cjs.map +0 -1
  133. package/cjs/semanticReleaseConfig.d.ts +0 -4
  134. package/cjs/semanticReleaseConfig.d.ts.map +0 -1
  135. package/cjs/semanticReleaseConfigDotnet-wrapper.mjs +0 -7
  136. package/cjs/semanticReleaseConfigDotnet.cjs +0 -112
  137. package/cjs/semanticReleaseConfigDotnet.cjs.map +0 -1
  138. package/cjs/semanticReleaseConfigDotnet.d.ts +0 -51
  139. package/cjs/semanticReleaseConfigDotnet.d.ts.map +0 -1
  140. package/cjs/setupGitPluginSpec-wrapper.mjs +0 -6
  141. package/cjs/setupGitPluginSpec.cjs +0 -67
  142. package/cjs/setupGitPluginSpec.cjs.map +0 -1
  143. package/cjs/setupGitPluginSpec.d.ts +0 -19
  144. package/cjs/setupGitPluginSpec.d.ts.map +0 -1
  145. package/src/dotnet/createDummyNupkg.ts +0 -30
  146. package/src/dotnet/dotnetGHPR.ts +0 -232
  147. package/src/dotnet/dotnetGLPR.ts +0 -46
  148. package/src/dotnet/dotnetHelpers.ts +0 -184
  149. package/src/dotnet.ts +0 -6
  150. package/src/envUtils.ts +0 -36
  151. package/src/findStaticConfig.ts +0 -31
  152. package/static/.releaserc.yml +0 -35
@@ -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,14 +0,0 @@
1
- 'use strict';
2
-
3
- // CJS compatibility; This enum cannot be required.
4
- const disabled = 0;
5
- const commitlintConfig = {
6
- extends: ['@commitlint/config-conventional'],
7
- rules: {
8
- 'body-max-line-length': [disabled],
9
- 'footer-max-line-length': [disabled],
10
- 'header-max-length': [disabled]
11
- }
12
- };
13
- module.exports = commitlintConfig;
14
- //# sourceMappingURL=commitlintConfig.cjs.map
@@ -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 +0,0 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,QAAA,MAAM,MAAM,gBAAuC,CAAC;AAMpD,eAAe,MAAM,CAAC"}
@@ -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;;;;"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Known properties. Additional properties may be added upon request.
3
- */
4
- export declare class MSBuildProjectProperties {
5
- [Property: string]: string;
6
- FullPath: string;
7
- TargetFramework: string;
8
- TargetFrameworks: string;
9
- RuntimeIdentifier: string;
10
- RuntimeIdentifiers: string;
11
- constructor(fullPath: string, exists?: boolean);
12
- }
13
- //# sourceMappingURL=MSBuildProjectProperties.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MSBuildProjectProperties.d.ts","sourceRoot":"","sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,qBAAa,wBAAwB;IACpC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3B,QAAQ,SAAM;IAEd,eAAe,SAAM;IAErB,gBAAgB,SAAM;IAEtB,iBAAiB,SAAM;IAEvB,kBAAkB,SAAM;gBAEZ,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAO;CAQ3C"}
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- const node_child_process = require('node:child_process');
4
- const node_fs = require('node:fs');
5
- const path = require('node:path');
6
- const tmp = require('tmp');
7
- function createDummyNupkg() {
8
- const dirResult = tmp.dirSync({
9
- unsafeCleanup: true
10
- });
11
- const dummyPkgFullPath = path.join(dirResult.name, 'DUMMY.1.0.0.nupkg');
12
-
13
- // delete old and possibly-poisoned nupkg
14
- if (node_fs.existsSync(dummyPkgFullPath)) node_fs.unlinkSync(dummyPkgFullPath);
15
- const options = {
16
- cwd: dirResult.name,
17
- encoding: 'utf8'
18
- };
19
- node_child_process.execSync('dotnet new console --name DUMMY', options);
20
- const packOut = node_child_process.execSync(`dotnet pack DUMMY --configuration Release --output ${path.dirname(dummyPkgFullPath)}`, options);
21
- const createdLine = packOut.replace('\r', '').split('\n').find(line => line.includes('Successfully created package'))?.trim();
22
- if (!node_fs.existsSync(dummyPkgFullPath)) throw new Error(`The dummy nupkg was created, but could not be found at ${dummyPkgFullPath}. See '${createdLine}'.`);
23
- return dummyPkgFullPath;
24
- }
25
- exports.createDummyNupkg = createDummyNupkg;
26
- //# sourceMappingURL=createDummyNupkg.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDummyNupkg.cjs","sources":["../../src/dotnet/createDummyNupkg.ts"],"sourcesContent":null,"names":["dirSync","join","existsSync","unlinkSync","execSync","dirname"],"mappings":";;;;;;;AAIO,SAAS,gBAAgB,GAAG;AACnC,EAAE,MAAM,SAAS,GAAGA,WAAO,CAAC;AAC5B,IAAI,aAAa,EAAE;AACnB,GAAG,CAAC;AACJ,EAAE,MAAM,gBAAgB,GAAGC,SAAI,CAAC,SAAS,CAAC,IAAI,EAAE,mBAAmB,CAAC;;AAEpE;AACA,EAAE,IAAIC,kBAAU,CAAC,gBAAgB,CAAC,EAAEC,kBAAU,CAAC,gBAAgB,CAAC;AAChE,EAAE,MAAM,OAAO,GAAG;AAClB,IAAI,GAAG,EAAE,SAAS,CAAC,IAAI;AACvB,IAAI,QAAQ,EAAE;AACd,GAAG;AACH,EAAEC,2BAAQ,CAAC,iCAAiC,EAAE,OAAO,CAAC;AACtD,EAAE,MAAM,OAAO,GAAGA,2BAAQ,CAAC,CAAC,mDAAmD,EAAEC,YAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC;AACtH,EAAE,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,8BAA8B,CAAC,CAAC,EAAE,IAAI,EAAE;AAC/H,EAAE,IAAI,CAACH,kBAAU,CAAC,gBAAgB,CAAC,EAAE,MAAM,IAAI,KAAK,CAAC,CAAC,uDAAuD,EAAE,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,CAAC,CAAC;AACzJ,EAAE,OAAO,gBAAgB;AACzB;;;;"}
@@ -1,2 +0,0 @@
1
- export declare function createDummyNupkg(): string;
2
- //# sourceMappingURL=createDummyNupkg.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createDummyNupkg.d.ts","sourceRoot":"","sources":["../../src/dotnet/createDummyNupkg.ts"],"names":[],"mappings":"AAKA,wBAAgB,gBAAgB,IAAI,MAAM,CAwBzC"}