@halospv3/hce.shared-config 3.5.3-develop.1 → 3.6.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/README.md +33 -10
- package/dotnet/.github/workflows/_unit_test.yml +2 -2
- package/dotnet/.github/workflows/dotnet-release.yml +1 -1
- package/dotnet/.github/workflows/sample-dotnet-build.yml +1 -1
- package/dotnet/CleanupWpfTmp.targets +15 -0
- package/dotnet/HCE.Shared.targets +3 -0
- package/mjs/CaseInsensitiveMap.mjs.map +1 -1
- package/mjs/commitlintConfig.mjs.map +1 -1
- package/mjs/debug.mjs.map +1 -1
- package/mjs/dotnet/GithubNugetRegistryInfo.d.mts +5 -5
- package/mjs/dotnet/GithubNugetRegistryInfo.d.mts.map +1 -1
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs +7 -7
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts +6 -6
- package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts.map +1 -1
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +14 -14
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs +5 -5
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -1
- package/mjs/dotnet/MSBuildProject.d.mts +28 -28
- package/mjs/dotnet/MSBuildProject.d.mts.map +1 -1
- package/mjs/dotnet/MSBuildProject.mjs +88 -66
- package/mjs/dotnet/MSBuildProject.mjs.map +1 -1
- package/mjs/dotnet/MSBuildProjectProperties.d.mts.map +1 -1
- package/mjs/dotnet/MSBuildProjectProperties.mjs +1 -1
- package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -1
- package/mjs/dotnet/NugetProjectProperties.d.mts +3 -3
- package/mjs/dotnet/NugetProjectProperties.d.mts.map +1 -1
- package/mjs/dotnet/NugetProjectProperties.mjs +7 -9
- package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -1
- package/mjs/dotnet/NugetRegistryInfo.d.mts +40 -40
- package/mjs/dotnet/NugetRegistryInfo.d.mts.map +1 -1
- package/mjs/dotnet/NugetRegistryInfo.mjs +170 -148
- package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/helpers.d.mts.map +1 -1
- package/mjs/dotnet/helpers.mjs +33 -34
- package/mjs/dotnet/helpers.mjs.map +1 -1
- package/mjs/eslintConfig.mjs.map +1 -1
- package/mjs/insertPlugins.mjs +2 -2
- package/mjs/insertPlugins.mjs.map +1 -1
- package/mjs/semantic-release__commit-analyzer.d.mts.map +1 -1
- package/mjs/semantic-release__exec.d.mts.map +1 -1
- package/mjs/semantic-release__git.d.mts.map +1 -1
- package/mjs/semantic-release__github.d.mts +1 -0
- package/mjs/semantic-release__github.d.mts.map +1 -1
- package/mjs/semanticReleaseConfig.d.mts.map +1 -1
- package/mjs/semanticReleaseConfig.mjs.map +1 -1
- package/mjs/semanticReleaseConfigDotnet.d.mts.map +1 -1
- package/mjs/semanticReleaseConfigDotnet.mjs +23 -16
- package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -1
- package/mjs/setupGitPluginSpec.d.mts.map +1 -1
- package/mjs/setupGitPluginSpec.default.mjs.map +1 -1
- package/mjs/setupGitPluginSpec.mjs +19 -19
- package/mjs/setupGitPluginSpec.mjs.map +1 -1
- package/mjs/utils/Exact.d.mts.map +1 -1
- package/mjs/utils/GracefulRecursion.d.mts.map +1 -1
- package/mjs/utils/env.d.mts.map +1 -1
- package/mjs/utils/env.mjs.map +1 -1
- package/mjs/utils/execAsync.d.mts +3 -3
- package/mjs/utils/execAsync.d.mts.map +1 -1
- package/mjs/utils/execAsync.mjs +14 -12
- package/mjs/utils/execAsync.mjs.map +1 -1
- package/mjs/utils/isError.mjs.map +1 -1
- package/mjs/utils/miscTypes.d.mts.map +1 -1
- package/mjs/utils/miscTypes.mjs.map +1 -1
- package/mjs/utils/reflection/FunctionLike.d.mts +1 -0
- package/mjs/utils/reflection/FunctionLike.d.mts.map +1 -1
- package/mjs/utils/reflection/GetterDescriptor.d.mts.map +1 -1
- package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mts.map +1 -1
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts +1 -1
- package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts.map +1 -1
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts +1 -1
- package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts.map +1 -1
- package/mjs/utils/reflection/OwnKeyOf.d.mts +1 -1
- package/mjs/utils/reflection/OwnKeyOf.d.mts.map +1 -1
- package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mts.map +1 -1
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mts +1 -1
- package/mjs/utils/reflection/PropertyDescriptorMap.d.mts.map +1 -1
- package/mjs/utils/reflection/filterForGetters.d.mts.map +1 -1
- package/mjs/utils/reflection/filterForGetters.mjs.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptors.d.mts.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.mts.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs +3 -3
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -1
- package/mjs/utils/reflection/getPrototypeChainOf.d.mts +2 -2
- package/mjs/utils/reflection/getPrototypeChainOf.d.mts.map +1 -1
- package/mjs/utils/reflection/getPrototypeChainOf.mjs +1 -2
- package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -1
- package/mjs/utils/reflection/getPrototypeOf.d.mts.map +1 -1
- package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -1
- package/mjs/utils/reflection/inheritance.d.mts +4 -4
- package/mjs/utils/reflection/inheritance.d.mts.map +1 -1
- package/mjs/utils/reflection/inheritance.mjs.map +1 -1
- package/mjs/utils/reflection/isConstructor.d.mts +3 -3
- package/mjs/utils/reflection/isConstructor.d.mts.map +1 -1
- package/mjs/utils/reflection/isConstructor.mjs +7 -7
- package/mjs/utils/reflection/isConstructor.mjs.map +1 -1
- package/mjs/utils/reflection/isGetterDescriptor.d.mts.map +1 -1
- package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -1
- package/mjs/utils/reflection/listOwnGetters.d.mts.map +1 -1
- package/mjs/utils/reflection/listOwnGetters.mjs +4 -2
- package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -1
- package/mjs/utils/reflection.d.mts +1 -1
- package/package.json +26 -25
- package/src/dotnet/GithubNugetRegistryInfo.ts +18 -15
- package/src/dotnet/GitlabNugetRegistryInfo.ts +28 -26
- package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +6 -6
- package/src/dotnet/MSBuildProject.ts +103 -106
- package/src/dotnet/MSBuildProjectProperties.ts +1 -1
- package/src/dotnet/NugetProjectProperties.ts +13 -18
- package/src/dotnet/NugetRegistryInfo.ts +287 -243
- package/src/dotnet/helpers.ts +58 -58
- package/src/insertPlugins.ts +3 -3
- package/src/semantic-release__github.d.ts +1 -0
- package/src/semanticReleaseConfigDotnet.ts +52 -54
- package/src/setupGitPluginSpec.ts +25 -26
- package/src/utils/env.ts +1 -0
- package/src/utils/execAsync.ts +16 -13
- package/src/utils/reflection/FunctionLike.d.ts +1 -0
- package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +4 -4
- package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +6 -6
- package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +2 -2
- package/src/utils/reflection/OwnKeyOf.d.ts +3 -3
- package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +3 -3
- package/src/utils/reflection/PropertyDescriptorMap.d.ts +3 -3
- package/src/utils/reflection/filterForGetters.ts +10 -10
- package/src/utils/reflection/getOwnPropertyDescriptors.ts +2 -2
- package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +13 -13
- package/src/utils/reflection/getPrototypeChainOf.ts +17 -17
- package/src/utils/reflection/getPrototypeOf.ts +2 -2
- package/src/utils/reflection/inheritance.ts +5 -4
- package/src/utils/reflection/isConstructor.ts +7 -7
- package/src/utils/reflection/listOwnGetters.ts +8 -8
- package/tsconfig.base.json +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isConstructor.mjs","names":[],"sources":["../../../src/utils/reflection/isConstructor.ts"],"sourcesContent":["/**\n * A very jank function to determine if an object can be the target of Reflect.construct.\n * Unfortunately, many functions have a constructor in their prototype. These\n * functions are treated like classes due to JavaScript's poor distinction between\n * classes and functions.\\\n * Typescript can enforce \"new\" keyword usage, but overriding the type\n * allows you to `new isConstructor()` despite this function not intended to be\n * used with the `new` keyword.\n * #### NOTE: Only works when targeting ES6/ES2015 or later.\n * > 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.\n * @param
|
|
1
|
+
{"version":3,"file":"isConstructor.mjs","names":[],"sources":["../../../src/utils/reflection/isConstructor.ts"],"sourcesContent":["/**\n * A very jank function to determine if an object can be the target of Reflect.construct.\n * Unfortunately, many functions have a constructor in their prototype. These\n * functions are treated like classes due to JavaScript's poor distinction between\n * classes and functions.\\\n * Typescript can enforce \"new\" keyword usage, but overriding the type\n * allows you to `new isConstructor()` despite this function not intended to be\n * used with the `new` keyword.\n * #### NOTE: Only works when targeting ES6/ES2015 or later.\n * > 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.\n * @param object Anything.\n * @returns `true` if the {@link object} is a constructor. Else, `false`.\n * @since 3.0.0\n * @see https://stackoverflow.com/a/49510834\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isConstructor(object: unknown): object is abstract new (...arguments_: any[]) => any {\n // Method 0 - filter\n if (typeof object !== 'function')\n return false;\n\n // Method 1\n // statically-defined class\n if (/^class\\s/.test(object.toString()))\n return true;\n\n /* Method 2\n * > class class_ {}; function func(){}\n * undefined\n * > class_.prototype.constructor.name === class_.name\n * true\n * > func.prototype?.constructor?.name === func.name\n * false\n * typeof String.prototype ==='object'\n * > true\n * typeof Function.prototype === 'object';\n * > false\n * typeof Function.prototype\n * > 'function'\n */\n const prototype: unknown = object.prototype;\n if ((typeof prototype === 'object' || typeof prototype === 'function')\n && prototype !== null\n && 'constructor' in prototype\n && typeof prototype.constructor === 'function') {\n const _ctor = prototype.constructor as (new (...arguments_: unknown[]) => unknown);\n const _name = Reflect.getOwnPropertyDescriptor(\n _ctor,\n 'name',\n );\n // short-circuit if `obj.prototype.constructor` is a function, but not a constructor. Return false.\n return (\n _ctor === object\n && _name?.writable === false\n && _name.enumerable === false\n && _name.configurable === true\n );\n }\n\n // Short-circuit\n // Method 3 catches exceptions when !isConstructor. When debugging, that's annoying.\n return false;\n\n // Method 3\n // isConstructable (See https://stackoverflow.com/a/49510834)\n // try {\n // // @ts-expect-error ts(2351): Type 'Function' has no construct signatures.\n // new new Proxy(obj, { construct: () => ({}) })()\n // return true\n // }\n // catch {\n // return false\n // }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,cAAc,QAAuE;CAEnG,IAAI,OAAO,WAAW,YACpB,OAAO;CAIT,IAAI,WAAW,KAAK,OAAO,SAAS,CAAC,GACnC,OAAO;CAgBT,MAAM,YAAqB,OAAO;CAClC,KAAK,OAAO,cAAc,YAAY,OAAO,cAAc,eACtD,cAAc,QACd,iBAAiB,aACjB,OAAO,UAAU,gBAAgB,YAAY;EAChD,MAAM,QAAQ,UAAU;EACxB,MAAM,QAAQ,QAAQ,yBACpB,OACA,MACF;EAEA,OACE,UAAU,UACP,OAAO,aAAa,SACpB,MAAM,eAAe,SACrB,MAAM,iBAAiB;CAE9B;CAIA,OAAO;AAYT"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isGetterDescriptor.d.mts","names":[],"sources":["../../../src/utils/reflection/isGetterDescriptor.ts"],"mappings":";;;;;AAQA;;;;iBAAgB,kBAAA,
|
|
1
|
+
{"version":3,"file":"isGetterDescriptor.d.mts","names":[],"sources":["../../../src/utils/reflection/isGetterDescriptor.ts"],"mappings":";;;;;AAQA;;;;iBAAgB,kBAAA,IAAsB,kBAAA,EAAoB,uBAAA,CAAwB,CAAA,IAAK,kBAAA,IAAsB,gBAAA,CAAiB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isGetterDescriptor.mjs","names":[],"sources":["../../../src/utils/reflection/isGetterDescriptor.ts"],"sourcesContent":["import type { GetterDescriptor } from './GetterDescriptor.d.ts';\n\n/**\n * A function for inferring a {@link TypedPropertyDescriptor} is a {@link GetterDescriptor}\n * @param propertyDescriptor The {@link TypedPropertyDescriptor} to inspect.\n * @returns `true` if {@link propertyDescriptor} describes a getter. Else, `false.\n * @since 3.0.0\n */\nexport function isGetterDescriptor<T>(propertyDescriptor: TypedPropertyDescriptor<T>): propertyDescriptor is GetterDescriptor<T> {\n return typeof propertyDescriptor.get === 'function';\n};\n"],"mappings":";;;;;;;AAQA,SAAgB,mBAAsB,oBAA2F;CAC/H,OAAO,OAAO,mBAAmB,QAAQ"}
|
|
1
|
+
{"version":3,"file":"isGetterDescriptor.mjs","names":[],"sources":["../../../src/utils/reflection/isGetterDescriptor.ts"],"sourcesContent":["import type { GetterDescriptor } from './GetterDescriptor.d.ts';\n\n/**\n * A function for inferring a {@link TypedPropertyDescriptor} is a {@link GetterDescriptor}\n * @param propertyDescriptor The {@link TypedPropertyDescriptor} to inspect.\n * @returns `true` if {@link propertyDescriptor} describes a getter. Else, `false.\n * @since 3.0.0\n */\nexport function isGetterDescriptor<T>(propertyDescriptor: TypedPropertyDescriptor<T>): propertyDescriptor is GetterDescriptor<T> {\n return typeof propertyDescriptor.get === 'function';\n};\n"],"mappings":";;;;;;;AAQA,SAAgB,mBAAsB,oBAA2F;CAC/H,OAAO,OAAO,mBAAmB,QAAQ;AAC3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOwnGetters.d.mts","names":[],"sources":["../../../src/utils/reflection/listOwnGetters.ts"],"mappings":";;;;;;AAUO;;;;KAUF,UAAA,eACW,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,
|
|
1
|
+
{"version":3,"file":"listOwnGetters.d.mts","names":[],"sources":["../../../src/utils/reflection/listOwnGetters.ts"],"mappings":";;;;;;AAUO;;;;KAUF,UAAA,eACW,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAc,cAAA,GAAiB,cAAA,8BAC5D,gBAAA,KAEvB,iBAAA,yBACC,OAAA,EACC,KAAA,sBAA2B,cAAA,UAA4B,kBAAA,CAAmB,KAAA,qCACjE,YAAA,CAAa,KAAA,IACnB,OAAA,OACM,YAAA,CAAa,KAAA,UACZ,KAAA,sBAA2B,cAAA,UAA4B,kBAAA,CAAmB,KAAA,oCAIpF,iBAAA,uBACG,OAAA,CACA,KAAA,mCAAwC,KAAA,GAAQ,OAAA,OAAc,KAAA,QAAa,KAAA;;;;;;;;;;;;;;;iBAmBrE,cAAA,eACA,SAAA,CAAU,qBAAA,CAAsB,KAAA,IAAS,SAAA,CAAc,cAAA,GAAiB,cAAA,8BAC5D,gBAAA,EAE1B,eAAA,EAAiB,KAAA,EACjB,gBAAA,EAAkB,OAAA,CAAQ,iBAAA,EAAmB,gBAAA,IAC5C,UAAA,CAAW,KAAA,EAAO,iBAAA"}
|
|
@@ -19,10 +19,12 @@ function listOwnGetters(classDefinition, instanceOrStatic) {
|
|
|
19
19
|
if (instanceOrStatic === "Instance") {
|
|
20
20
|
const getterDescriptorMap = filterForGetters(getOwnPropertyDescriptors(classDefinition, instanceOrStatic));
|
|
21
21
|
return Reflect.ownKeys(getterDescriptorMap);
|
|
22
|
-
}
|
|
22
|
+
}
|
|
23
|
+
if (instanceOrStatic === "Static") {
|
|
23
24
|
const getterDescriptorMap = filterForGetters(getOwnPropertyDescriptors(classDefinition, instanceOrStatic));
|
|
24
25
|
return Reflect.ownKeys(getterDescriptorMap);
|
|
25
|
-
}
|
|
26
|
+
}
|
|
27
|
+
throw new TypeError("Argument `instanceOrStatic` must be \"Instance\" or \"Static\".");
|
|
26
28
|
}
|
|
27
29
|
//#endregion
|
|
28
30
|
export { listOwnGetters };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"listOwnGetters.mjs","names":[],"sources":["../../../src/utils/reflection/listOwnGetters.ts"],"sourcesContent":["import type { InstanceOrStatic } from '../miscTypes.ts';\nimport { filterForGetters } from './filterForGetters.ts';\nimport { getOwnPropertyDescriptors } from './getOwnPropertyDescriptors.ts';\nimport type {\n BaseClassProto,\n ClassLike,\n ConstructorConstraint,\n InstanceTypeOrSelf,\n SuperClassLike,\n WithProto,\n} from './inheritance.ts';\nimport type { InstancePropertyDescriptorMap } from './InstancePropertyDescriptorMap.d.ts';\nimport type { OwnPropertyDescriptorMap } from './OwnPropertyDescriptorMap.d.ts';\n\n/**\n * Description placeholder\n * @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class\n * @template {InstanceOrStatic} _InstanceOrStatic\n * @since 3.0.0\n */\ntype OwnGetters<\n Class extends ClassLike<ConstructorConstraint<Class> &
|
|
1
|
+
{"version":3,"file":"listOwnGetters.mjs","names":[],"sources":["../../../src/utils/reflection/listOwnGetters.ts"],"sourcesContent":["import type { InstanceOrStatic } from '../miscTypes.ts';\nimport { filterForGetters } from './filterForGetters.ts';\nimport { getOwnPropertyDescriptors } from './getOwnPropertyDescriptors.ts';\nimport type {\n BaseClassProto as BaseClassPrototype,\n ClassLike,\n ConstructorConstraint,\n InstanceTypeOrSelf,\n SuperClassLike,\n WithProto as WithPrototype,\n} from './inheritance.ts';\nimport type { InstancePropertyDescriptorMap } from './InstancePropertyDescriptorMap.d.ts';\nimport type { OwnPropertyDescriptorMap } from './OwnPropertyDescriptorMap.d.ts';\n\n/**\n * Description placeholder\n * @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class\n * @template {InstanceOrStatic} _InstanceOrStatic\n * @since 3.0.0\n */\ntype OwnGetters<\n Class extends ClassLike<ConstructorConstraint<Class> & WithPrototype<SuperClassLike | BaseClassPrototype>>,\n _InstanceOrStatic extends InstanceOrStatic,\n>\n = [_InstanceOrStatic] extends ['Instance']\n ? Exclude<\n (Class['__proto__'] extends BaseClassPrototype ? null : InstanceTypeOrSelf<Class['__proto__']>) extends null\n ? keyof InstanceType<Class>\n : Exclude<\n keyof InstanceType<Class>,\n keyof (Class['__proto__'] extends BaseClassPrototype ? null : InstanceTypeOrSelf<Class['__proto__']>)\n >,\n '__proto__'\n >[]\n : [_InstanceOrStatic] extends ['Static']\n ? Exclude<\n Class['__proto__'] extends null ? keyof Class : Exclude<keyof Class, keyof Class['__proto__']>,\n '__proto__'\n >[]\n : never;\n\n/**\n * # !WARNING!\n * > 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.\n *\n * Returns the names of the instantiated (or static), noninherited getters derived from the\n * given prototype or prototype of the given object.\n * @template {ClassLike<ConstructorConstraint<Class> & WithProto<SuperClassLike | BaseClassProto>>} Class\n * @template {InstanceOrStatic} _InstanceOrStatic 'Instance' or 'Static'. Determines the return type.\n * @param classDefinition Any class cast to ClassLike\n * @param instanceOrStatic 'Instance' or 'Static'. Determines the return type.\n * @since 3.0.0\n * @returns\n * 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;\n */\nexport function listOwnGetters<\n Class extends ClassLike<ConstructorConstraint<Class> & WithPrototype<SuperClassLike | BaseClassPrototype>>,\n _InstanceOrStatic extends InstanceOrStatic,\n>(\n classDefinition: Class,\n instanceOrStatic: Extract<_InstanceOrStatic, InstanceOrStatic>,\n): OwnGetters<Class, _InstanceOrStatic> {\n if (instanceOrStatic === 'Instance') {\n const descriptorMap: InstancePropertyDescriptorMap<Class> = getOwnPropertyDescriptors(classDefinition, instanceOrStatic as 'Instance');\n const getterDescriptorMap = filterForGetters(descriptorMap);\n const keyArray = Reflect.ownKeys(getterDescriptorMap) as (keyof typeof getterDescriptorMap)[];\n return keyArray as [typeof instanceOrStatic & 'Instance'] extends ['Instance'] ? typeof keyArray : never;\n }\n if (instanceOrStatic === 'Static') {\n const descriptorMap: OwnPropertyDescriptorMap<Class> = getOwnPropertyDescriptors(classDefinition, instanceOrStatic as 'Static');\n const getterDescriptorMap = filterForGetters(descriptorMap);\n const keyArray = Reflect.ownKeys(getterDescriptorMap) as (keyof typeof getterDescriptorMap)[];\n return keyArray as [_InstanceOrStatic] extends ['Instance']\n ? never\n : [_InstanceOrStatic] extends ['Static']\n ? typeof keyArray\n : never;\n }\n throw new TypeError('Argument `instanceOrStatic` must be \"Instance\" or \"Static\".');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAuDA,SAAgB,eAId,iBACA,kBACsC;CACtC,IAAI,qBAAqB,YAAY;EAEnC,MAAM,sBAAsB,iBADgC,0BAA0B,iBAAiB,gBAC9C,CAAC;EAE1D,OADiB,QAAQ,QAAQ,mBACnB;CAChB;CACA,IAAI,qBAAqB,UAAU;EAEjC,MAAM,sBAAsB,iBAD2B,0BAA0B,iBAAiB,gBACzC,CAAC;EAE1D,OADiB,QAAQ,QAAQ,mBACnB;CAKhB;CACA,MAAM,IAAI,UAAU,iEAA6D;AACnF"}
|
|
@@ -15,4 +15,4 @@ import { getPrototypeOf } from "./reflection/getPrototypeOf.mjs";
|
|
|
15
15
|
import { isConstructor } from "./reflection/isConstructor.mjs";
|
|
16
16
|
import { isGetterDescriptor } from "./reflection/isGetterDescriptor.mjs";
|
|
17
17
|
import { listOwnGetters } from "./reflection/listOwnGetters.mjs";
|
|
18
|
-
export { BaseClass, BaseClassProto, ClassLike, ClassLike_Unknown, ConstructorConstraint, ConstructorLike, Constructor_Unknown, FunctionLike, GetterDescriptor, IClass, InstancePropertyDescriptorMap, InstanceTypeOrSelf, InstanceTypeOrSelfPropertyDescriptorMap, OwnGetterDescriptorMap, OwnKeyOf, OwnPropertyDescriptorMap, PropertyDescriptorMap, ProtoChainOfClass, ProtoChainOfClassInstance, ProtoChainOfObject, ProtoOrSuperClass, RecursedPropertyDescriptorMap, RecursedPropertyDescriptorMapArray, SuperClassLike, WithProto, baseClassProto, filterForGetters, getOwnPropertyDescriptors, getOwnPropertyDescriptorsRecursively, getPrototypeOf, getPrototypesChainOf, isConstructor, isGetterDescriptor, listOwnGetters };
|
|
18
|
+
export { BaseClass, BaseClassProto, ClassLike, ClassLike_Unknown, ConstructorConstraint, ConstructorLike, Constructor_Unknown, type FunctionLike, type GetterDescriptor, IClass, type InstancePropertyDescriptorMap, InstanceTypeOrSelf, type InstanceTypeOrSelfPropertyDescriptorMap, type OwnGetterDescriptorMap, type OwnKeyOf, type OwnPropertyDescriptorMap, type PropertyDescriptorMap, ProtoChainOfClass, ProtoChainOfClassInstance, ProtoChainOfObject, ProtoOrSuperClass, RecursedPropertyDescriptorMap, RecursedPropertyDescriptorMapArray, SuperClassLike, WithProto, baseClassProto, filterForGetters, getOwnPropertyDescriptors, getOwnPropertyDescriptorsRecursively, getPrototypeOf, getPrototypesChainOf, isConstructor, isGetterDescriptor, listOwnGetters };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@halospv3/hce.shared-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0-develop.1",
|
|
4
4
|
"description": "Automate commit message quality, changelogs, and CI/CD releases. Its `main` entry point is a Semantic Release config. Functions and classes are exposed for customization. An ESLint config, a Commitlint config, and addl. resources for .NET projects are also provided.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"semantic-release",
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
"bugs": "https://github.com/halospv3/hce.shared/issues",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"author": "Noah Sherwin",
|
|
17
|
+
"preferUnplugged": true,
|
|
17
18
|
"files": [
|
|
18
19
|
"!.github/",
|
|
19
20
|
"!.husky/",
|
|
@@ -54,30 +55,30 @@
|
|
|
54
55
|
"presemantic-release": "npm pack",
|
|
55
56
|
"semantic-release": "semantic-release",
|
|
56
57
|
"pretest": "npm run build && npm run test:cacheSampleProjects",
|
|
57
|
-
"test": "
|
|
58
|
-
"test:cacheSampleProjects": "echo \"START: Cache Sample Projects\" &&
|
|
58
|
+
"test": "node --trace-deprecation --trace-warnings --test --experimental-test-coverage --enable-source-maps --test-reporter=spec --test-reporter-destination=stdout --test-reporter=lcov --test-reporter-destination=lcov.txt --test-reporter=junit --test-reporter-destination=junit.xml",
|
|
59
|
+
"test:cacheSampleProjects": "echo \"START: Cache Sample Projects\" && node ./tests/dotnet/MSBuildProject.projects.ts && echo \"DONE: Cache Sample Projects\"",
|
|
59
60
|
"test:watch": "npm run test -- --watch",
|
|
60
61
|
"type": "tsc --build",
|
|
61
62
|
"validate": "tsdown --no-write",
|
|
62
63
|
"watch": "tsdown --watch"
|
|
63
64
|
},
|
|
64
65
|
"dependencies": {
|
|
65
|
-
"@commitlint/cli": "^21.
|
|
66
|
+
"@commitlint/cli": "^21.1.0",
|
|
66
67
|
"@commitlint/config-conventional": "^21.0.0",
|
|
67
|
-
"@dotenvx/dotenvx": "^1.
|
|
68
|
+
"@dotenvx/dotenvx": "^1.75.1",
|
|
68
69
|
"@eslint/js": "^10.0.1",
|
|
69
|
-
"@eslint/json": "^
|
|
70
|
+
"@eslint/json": "^2.0.0",
|
|
70
71
|
"@semantic-release/changelog": "^6.0.3",
|
|
71
72
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
72
73
|
"@semantic-release/exec": "^7.1.0",
|
|
73
74
|
"@semantic-release/git": "^10.0.1",
|
|
74
|
-
"@semantic-release/github": "^12.0.
|
|
75
|
+
"@semantic-release/github": "^12.0.8",
|
|
75
76
|
"@semantic-release/npm": "^13.1.5",
|
|
76
|
-
"@semantic-release/release-notes-generator": "^14.1.
|
|
77
|
+
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
77
78
|
"@stylistic/eslint-plugin": "^5.9.0",
|
|
78
|
-
"@types/node": "~
|
|
79
|
-
"arktype": "^2.1
|
|
80
|
-
"chardet": "^2.
|
|
79
|
+
"@types/node": "~26.0.1",
|
|
80
|
+
"arktype": "^2.2.1",
|
|
81
|
+
"chardet": "^2.2.0",
|
|
81
82
|
"conventional-changelog-conventionalcommits": "^9.3.1",
|
|
82
83
|
"debug": "^4.4.1",
|
|
83
84
|
"error.iserror": "^1.0.2",
|
|
@@ -86,10 +87,10 @@
|
|
|
86
87
|
"husky": "^9.1.7",
|
|
87
88
|
"patch-package": "^8.0.1",
|
|
88
89
|
"sanitize-filename": "^1.6.4",
|
|
89
|
-
"semantic-release": "^25.0.
|
|
90
|
+
"semantic-release": "^25.0.5",
|
|
90
91
|
"semantic-release-export-data": "^1.1.0",
|
|
91
|
-
"ts-essentials": "^10.
|
|
92
|
-
"typescript-eslint": "^8.
|
|
92
|
+
"ts-essentials": "^10.2.1",
|
|
93
|
+
"typescript-eslint": "^8.62.0"
|
|
93
94
|
},
|
|
94
95
|
"peerDependencies": {
|
|
95
96
|
"@bintoss/semantic-release-npm-multiple": "^3.0.0 || >= 3.0.0",
|
|
@@ -107,25 +108,25 @@
|
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
110
|
"devDependencies": {
|
|
110
|
-
"@arethetypeswrong/core": "^0.18.
|
|
111
|
+
"@arethetypeswrong/core": "^0.18.4",
|
|
111
112
|
"@bintoss/semantic-release-npm-multiple": "^3.17.1",
|
|
112
113
|
"@commitlint/types": "^21.0.0",
|
|
113
|
-
"@eslint/config-inspector": "^
|
|
114
|
-
"@eslint/markdown": "^8.0.
|
|
115
|
-
"@sebbo2002/semantic-release-jsr": "^
|
|
114
|
+
"@eslint/config-inspector": "^3.0.4",
|
|
115
|
+
"@eslint/markdown": "^8.0.2",
|
|
116
|
+
"@sebbo2002/semantic-release-jsr": "^4.0.1",
|
|
116
117
|
"@semantic-release/gitlab": "^13.3.2",
|
|
117
118
|
"@types/debug": "^4.1.13",
|
|
118
119
|
"@types/tmp": "^0.2.6",
|
|
119
120
|
"conventional-changelog-preset-loader": "^5.0.0",
|
|
120
121
|
"eslint": "^10.2.1",
|
|
121
|
-
"eslint-plugin-jsdoc": "^
|
|
122
|
-
"eslint-plugin-unicorn": "^
|
|
122
|
+
"eslint-plugin-jsdoc": "^63.0.8",
|
|
123
|
+
"eslint-plugin-unicorn": "^69.0.0",
|
|
123
124
|
"pinst": "^3.0.0",
|
|
124
|
-
"publint": "^0.3.
|
|
125
|
-
"tmp": "^0.2.
|
|
126
|
-
"tsdown": "^0.22.
|
|
125
|
+
"publint": "^0.3.21",
|
|
126
|
+
"tmp": "^0.2.7",
|
|
127
|
+
"tsdown": "^0.22.3",
|
|
127
128
|
"tslib": "^2.8.1",
|
|
128
|
-
"tsx": "^4.
|
|
129
|
+
"tsx": "^4.22.4",
|
|
129
130
|
"typescript": "^6.0.3",
|
|
130
131
|
"unplugin-unused": "^0.5.7"
|
|
131
132
|
},
|
|
@@ -186,5 +187,5 @@
|
|
|
186
187
|
"./*": "./*"
|
|
187
188
|
},
|
|
188
189
|
"types": "./mjs/index.d.mts",
|
|
189
|
-
"packageManager": "npm@11.
|
|
190
|
+
"packageManager": "npm@11.17.0+sha512.3eeaf18997b11070d313849268b23766b9db0068997dec9471073170fe43fa17f2b4d0337bf0f52330ee2274e7f5754b21b01052742e48f5c9c74d8b1e32ef43"
|
|
190
191
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { Type } from 'arktype';
|
|
2
|
-
import { getEnvVarValue } from '../utils/env.ts';
|
|
2
|
+
import { getEnvVarValue as getEnvironmentVariableValue } from '../utils/env.ts';
|
|
3
3
|
import type { MSBuildProject, MSBuildEvaluationOutput } from './MSBuildProject.ts';
|
|
4
4
|
import type { NugetProjectProperties } from './NugetProjectProperties.ts';
|
|
5
5
|
import {
|
|
6
6
|
NugetRegistryInfo,
|
|
7
|
-
NRIOptsBase,
|
|
7
|
+
NRIOptsBase as NRIOptionsBase,
|
|
8
8
|
} from './NugetRegistryInfo.ts';
|
|
9
9
|
import type { Default } from 'arktype/internal/attributes.ts';
|
|
10
10
|
|
|
11
11
|
const NUGET_PKG_GITHUB_COM = 'https://nuget.pkg.github.com';
|
|
12
|
+
// eslint-disable-next-line unicorn/name-replacements
|
|
12
13
|
export const DefaultGithubTokenEnvVars: readonly ['GH_TOKEN', 'GITHUB_TOKEN'] = Object.freeze([
|
|
13
14
|
'GH_TOKEN',
|
|
14
15
|
'GITHUB_TOKEN',
|
|
@@ -17,15 +18,6 @@ export const DefaultGithubTokenEnvVars: readonly ['GH_TOKEN', 'GITHUB_TOKEN'] =
|
|
|
17
18
|
export class GithubNugetRegistryInfo extends NugetRegistryInfo {
|
|
18
19
|
static readonly NUGET_PKG_GITHUB_COM = 'https://nuget.pkg.github.com';
|
|
19
20
|
|
|
20
|
-
// GithubNugetRegistryInfo.CtorArgs(...) behaves differently than NugetRegistryInfo.CtorArgs(...)
|
|
21
|
-
/**
|
|
22
|
-
* Creates an instance of GithubNugetRegistryInfo.
|
|
23
|
-
* @param opts The input type of {@link GHNRIOpts.from}
|
|
24
|
-
*/
|
|
25
|
-
constructor(opts: typeof GHNRIOpts.inferIn) {
|
|
26
|
-
super(GHNRIOpts.from(opts));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
21
|
/**
|
|
30
22
|
* Returns `https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json`
|
|
31
23
|
* or (if GITHUB_REPOSITORY_OWNER is not defined in {@link process.env} nor
|
|
@@ -34,11 +26,21 @@ export class GithubNugetRegistryInfo extends NugetRegistryInfo {
|
|
|
34
26
|
* Otherwise, returns `undefined`
|
|
35
27
|
*/
|
|
36
28
|
static getNugetGitHubUrl(): string | undefined {
|
|
37
|
-
const owner =
|
|
29
|
+
const owner = getEnvironmentVariableValue('GITHUB_REPOSITORY_OWNER');
|
|
38
30
|
return owner === undefined
|
|
39
31
|
? undefined
|
|
40
32
|
: `${NUGET_PKG_GITHUB_COM}/${owner}/index.json`;
|
|
41
33
|
}
|
|
34
|
+
|
|
35
|
+
// GithubNugetRegistryInfo.CtorArgs(...) behaves differently than NugetRegistryInfo.CtorArgs(...)
|
|
36
|
+
/**
|
|
37
|
+
* Creates an instance of GithubNugetRegistryInfo.
|
|
38
|
+
* @param opts The input type of {@link GHNRIOpts.from}
|
|
39
|
+
*/
|
|
40
|
+
// eslint-disable-next-line unicorn/name-replacements
|
|
41
|
+
constructor(opts: typeof GHNRIOpts.inferIn) {
|
|
42
|
+
super(GHNRIOpts.from(opts));
|
|
43
|
+
}
|
|
42
44
|
}
|
|
43
45
|
const GHNRI = GithubNugetRegistryInfo;
|
|
44
46
|
|
|
@@ -47,6 +49,7 @@ const GHNRI = GithubNugetRegistryInfo;
|
|
|
47
49
|
* {@link GHNRI.getNugetGitHubUrl} and will default to an empty string if the
|
|
48
50
|
* environment variable `GITHUB_REPOSITORY_OWNER` is undefined!
|
|
49
51
|
*/
|
|
52
|
+
// eslint-disable-next-line unicorn/name-replacements
|
|
50
53
|
export const GHNRIOpts: Type<{
|
|
51
54
|
project: MSBuildProject | {
|
|
52
55
|
readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;
|
|
@@ -56,11 +59,11 @@ export const GHNRIOpts: Type<{
|
|
|
56
59
|
};
|
|
57
60
|
source: Default<string, string>;
|
|
58
61
|
tokenEnvVars: Default<readonly string[], readonly ['GH_TOKEN', 'GITHUB_TOKEN']>;
|
|
59
|
-
}> =
|
|
62
|
+
}> = NRIOptionsBase.merge({
|
|
60
63
|
/** @see {@link GHNRI.getNugetGitHubUrl } */
|
|
61
|
-
source:
|
|
64
|
+
source: NRIOptionsBase.get('source')
|
|
62
65
|
.default(() => GHNRI.getNugetGitHubUrl() ?? ''),
|
|
63
|
-
tokenEnvVars:
|
|
66
|
+
tokenEnvVars: NRIOptionsBase.get('tokenEnvVars')
|
|
64
67
|
.default(
|
|
65
68
|
/* must be a function. A fixed-length array is NOT a primitive type! */
|
|
66
69
|
(): typeof DefaultGithubTokenEnvVars => DefaultGithubTokenEnvVars,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getEnvVarValue } from '../utils/env.ts';
|
|
1
|
+
import { getEnvVarValue as getEnvironmentVariableValue } from '../utils/env.ts';
|
|
2
2
|
import { isError } from '../utils/isError.ts';
|
|
3
3
|
import {
|
|
4
4
|
NugetRegistryInfo,
|
|
5
|
-
NRIOpts,
|
|
6
|
-
NRIOptsBase,
|
|
5
|
+
NRIOpts as NRIOptions,
|
|
6
|
+
NRIOptsBase as NRIOptionsBase,
|
|
7
7
|
} from './NugetRegistryInfo.ts';
|
|
8
8
|
import type { Out, Type } from 'arktype';
|
|
9
9
|
import type { Default } from 'arktype/internal/attributes.ts';
|
|
@@ -12,13 +12,19 @@ import type { NugetProjectProperties } from './NugetProjectProperties.ts';
|
|
|
12
12
|
|
|
13
13
|
// https://docs.gitlab.com/ee/user/packages/nuget_repository/
|
|
14
14
|
export class GitlabNugetRegistryInfo extends NugetRegistryInfo {
|
|
15
|
+
static readonly DefaultGitlabTokenEnvVars: readonly ['GL_TOKEN', 'GITLAB_TOKEN', 'CI_JOB_TOKEN'] = Object.freeze([
|
|
16
|
+
'GL_TOKEN',
|
|
17
|
+
'GITLAB_TOKEN',
|
|
18
|
+
'CI_JOB_TOKEN',
|
|
19
|
+
] as const);
|
|
20
|
+
|
|
15
21
|
/**
|
|
16
22
|
* The GitLab API v4 root URL.
|
|
17
23
|
* @returns The value of the environment variable `CI_API_V4_URL`.
|
|
18
24
|
* If that's `undefined`, 'https://gitlab.com/api/v4' is returned, instead.
|
|
19
25
|
*/
|
|
20
26
|
static get CI_API_V4_URL(): string {
|
|
21
|
-
return
|
|
27
|
+
return getEnvironmentVariableValue('CI_API_V4_URL') ?? 'https://gitlab.com/api/v4';
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
/**
|
|
@@ -28,7 +34,7 @@ export class GitlabNugetRegistryInfo extends NugetRegistryInfo {
|
|
|
28
34
|
* @todo add URI encoded project pathname as alternative e.g. 'halospv3%2FHCE.Shared' in 'https://gitlab.com/api/v4/projects/halospv3%2FHCE.Shared'
|
|
29
35
|
*/
|
|
30
36
|
static get projectId(): string | undefined {
|
|
31
|
-
return
|
|
37
|
+
return getEnvironmentVariableValue('CI_PROJECT_ID');
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
/**
|
|
@@ -37,24 +43,7 @@ export class GitlabNugetRegistryInfo extends NugetRegistryInfo {
|
|
|
37
43
|
* @returns The value of the environment variable 'CI_PROJECT_NAMESPACE_ID' or `undefined`.
|
|
38
44
|
*/
|
|
39
45
|
static get ownerId(): string | undefined {
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static readonly DefaultGitlabTokenEnvVars: readonly ['GL_TOKEN', 'GITLAB_TOKEN', 'CI_JOB_TOKEN'] = Object.freeze([
|
|
44
|
-
'GL_TOKEN',
|
|
45
|
-
'GITLAB_TOKEN',
|
|
46
|
-
'CI_JOB_TOKEN',
|
|
47
|
-
] as const);
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Creates an instance of GitlabNugetRegistryInfo.
|
|
51
|
-
* @param opts The input type of {@link GLNRIOpts.from}
|
|
52
|
-
*/
|
|
53
|
-
constructor(opts: typeof GLNRIOpts.inferIn) {
|
|
54
|
-
const optsOut = GLNRIOpts.from(opts);
|
|
55
|
-
if (isError(optsOut.source))
|
|
56
|
-
throw optsOut.source;
|
|
57
|
-
super(optsOut as typeof optsOut & { source: string });
|
|
46
|
+
return getEnvironmentVariableValue('CI_PROJECT_NAMESPACE_ID');
|
|
58
47
|
}
|
|
59
48
|
|
|
60
49
|
/**
|
|
@@ -81,12 +70,25 @@ export class GitlabNugetRegistryInfo extends NugetRegistryInfo {
|
|
|
81
70
|
? `${this.CI_API_V4_URL}/groups/${this.ownerId}/-/packages/nuget/index.json`
|
|
82
71
|
: new Error('env.CI_PROJECT_NAMESPACE_ID must be defined to use its GitLab API endpoint!');
|
|
83
72
|
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Creates an instance of GitlabNugetRegistryInfo.
|
|
76
|
+
* @param opts The input type of {@link GLNRIOpts.from}
|
|
77
|
+
*/
|
|
78
|
+
// eslint-disable-next-line unicorn/name-replacements
|
|
79
|
+
constructor(opts: typeof GLNRIOpts.inferIn) {
|
|
80
|
+
const optionsOut = GLNRIOpts.from(opts);
|
|
81
|
+
if (isError(optionsOut.source))
|
|
82
|
+
throw optionsOut.source;
|
|
83
|
+
super(optionsOut as typeof optionsOut & { source: string });
|
|
84
|
+
}
|
|
84
85
|
}
|
|
85
86
|
const GLNRI = GitlabNugetRegistryInfo;
|
|
86
87
|
|
|
87
88
|
/**
|
|
88
89
|
* The Arktype definition for {@link GitlabNugetRegistryInfo}'s constructor parameter. Construct an object of this type by calling {@link GLNRIOpts.from}
|
|
89
90
|
*/
|
|
91
|
+
// eslint-disable-next-line unicorn/name-replacements
|
|
90
92
|
export const GLNRIOpts: Type<{
|
|
91
93
|
project: MSBuildProject | {
|
|
92
94
|
readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;
|
|
@@ -96,8 +98,8 @@ export const GLNRIOpts: Type<{
|
|
|
96
98
|
};
|
|
97
99
|
tokenEnvVars: Default<readonly string[], readonly ['GL_TOKEN', 'GITLAB_TOKEN', 'CI_JOB_TOKEN']>;
|
|
98
100
|
source: (In: Default<string | Error, string | Error>) => Out<string | Error>;
|
|
99
|
-
}> =
|
|
100
|
-
tokenEnvVars:
|
|
101
|
+
}> = NRIOptions.merge({
|
|
102
|
+
tokenEnvVars: NRIOptionsBase.get('tokenEnvVars').default(
|
|
101
103
|
() => GLNRI.DefaultGitlabTokenEnvVars,
|
|
102
104
|
),
|
|
103
105
|
/**
|
|
@@ -107,7 +109,7 @@ export const GLNRIOpts: Type<{
|
|
|
107
109
|
* @see {@link GLNRI.projectUrl}, {@link GLNRI.groupUrl}
|
|
108
110
|
*/
|
|
109
111
|
// todo: change '"group" | "project"' to '"GITLAB:PROJECT" | "GITLAB:GROUP"'
|
|
110
|
-
source:
|
|
112
|
+
source: NRIOptionsBase.get('source')
|
|
111
113
|
.or('"group" | "project" | Error')
|
|
112
114
|
.pipe((source: string | Error): string | Error => {
|
|
113
115
|
switch (source) {
|
|
@@ -13,17 +13,17 @@ import esMain from 'es-main';
|
|
|
13
13
|
* - already exists at `source`
|
|
14
14
|
*/
|
|
15
15
|
async function main(): Promise<0> {
|
|
16
|
-
const
|
|
16
|
+
const arguments_ = process.argv.slice(2);
|
|
17
17
|
// Parse command-line arguments - https://stackoverflow.com/a/76298476/14894786
|
|
18
18
|
const options: {
|
|
19
19
|
packageId: string | undefined;
|
|
20
20
|
source: string | undefined;
|
|
21
21
|
} & Record<string, string | undefined> = { packageId: undefined, source: undefined };
|
|
22
|
-
for (let
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
options[
|
|
22
|
+
for (let index = 0; index < arguments_.length; index += 2) {
|
|
23
|
+
const argumentName = arguments_[index];
|
|
24
|
+
const argumentValue = arguments_[index + 1];
|
|
25
|
+
if (argumentValue !== undefined && argumentName?.startsWith('--') === true) {
|
|
26
|
+
options[argumentName.slice(2)] = argumentValue;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|