@halospv3/hce.shared-config 3.5.2-develop.1 → 3.5.3-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 +12 -0
- package/mjs/CaseInsensitiveMap.mjs.map +1 -1
- package/mjs/debug.mjs.map +1 -1
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs +1 -0
- package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +6 -0
- package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -1
- package/mjs/dotnet/MSBuildProject.mjs +54 -0
- package/mjs/dotnet/MSBuildProject.mjs.map +1 -1
- package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -1
- package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -1
- package/mjs/dotnet/NugetRegistryInfo.mjs +68 -0
- package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -1
- package/mjs/dotnet/helpers.mjs +65 -1
- package/mjs/dotnet/helpers.mjs.map +1 -1
- package/mjs/insertPlugins.mjs.map +1 -1
- package/mjs/semanticReleaseConfig.mjs +1 -0
- package/mjs/semanticReleaseConfig.mjs.map +1 -1
- package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -1
- package/mjs/setupGitPluginSpec.mjs.map +1 -1
- package/mjs/utils/env.mjs.map +1 -1
- package/mjs/utils/execAsync.mjs.map +1 -1
- package/mjs/utils/isError.mjs.map +1 -1
- package/mjs/utils/reflection/filterForGetters.mjs.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -1
- package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -1
- package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -1
- package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -1
- package/mjs/utils/reflection/isConstructor.mjs.map +1 -1
- package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -1
- package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -1
- package/package.json +10 -10
- package/src/utils/isError.ts +1 -1
- package/src/utils/reflection/getPrototypeOf.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NugetProjectProperties.mjs","names":[],"sources":["../../src/dotnet/NugetProjectProperties.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport {\n tBooleanString,\n tEmptyOrBooleanString,\n type BooleanString,\n type EmptyOrBooleanString,\n} from '../utils/miscTypes.ts';\nimport {\n getPrototypesChainOf,\n listOwnGetters,\n type ClassLike,\n type ProtoChainOfClass,\n type WithProto,\n} from '../utils/reflection.ts';\nimport { MSBuildProjectProperties, type Class_MSBPP } from './MSBuildProjectProperties.ts';\n\nconst Type_RepositoryType: type<'' | 'git' | 'tfs'> = type('\"\"|\"git\"|\"tfs\"');\nconst Type_SymbolPackageFormat: type<'symbols.nupkg' | 'snupkg'> = type('\"symbols.nupkg\" | \"snupkg\"');\n\n/**\n * A readonly record of a .csproj or .fsproj with NuGet configuration properties in\n * addition to those specified by {@link MSBuildProjectProperties}. This record\n * should be considered immutable. A new instance should be constructed from MSBuild's evaluation output.\n * @see https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target-inputs\n */\nexport class NugetProjectProperties extends MSBuildProjectProperties {\n // #region private\n private _isPackable: BooleanString | undefined;\n private _suppressDependenciesWhenPacking: BooleanString | undefined;\n private _packageVersion: string | undefined;\n private _packageId: string | undefined;\n private _packageDescription: string | undefined;\n private _authors: string | undefined;\n private _copyright: string | undefined;\n private _packageRequireLicenseAcceptance: BooleanString | undefined;\n private _developmentDependency: EmptyOrBooleanString | undefined;\n private _packageLicenseExpression: string | undefined;\n private _packageLicenseFile: string | undefined;\n private _packageProjectUrl: string | undefined;\n private _packageIcon: string | undefined;\n private _packageReleaseNotes: string | undefined;\n private _packageReadmeFile: string | undefined;\n private _packageTags: string | undefined;\n private _packageOutputPath: string | undefined;\n private _includeSymbols: EmptyOrBooleanString | undefined;\n private _includeSource: EmptyOrBooleanString | undefined;\n private _packageType: string | undefined;\n private _isTool: EmptyOrBooleanString | undefined;\n private _repositoryUrl: string | undefined;\n private _repositoryType: '' | 'git' | 'tfs' | undefined;\n private _repositoryCommit: string | undefined;\n private _symbolPackageFormat: 'symbols.nupkg' | 'snupkg' | undefined;\n private _noPackageAnalysis: EmptyOrBooleanString | undefined;\n private _minClientVersion: string | undefined;\n private _includeBuiltOutput: BooleanString | undefined;\n private _includeContentInPack: BooleanString | undefined;\n private _buildOutputTargetFolder: string | undefined;\n private _contentTargetFolders: string | undefined;\n private _nuspecFile: string | undefined;\n private _nuspecBasePath: string | undefined;\n private _nuspecProperties: string | undefined;\n private _title: string | undefined;\n private _company: string | undefined;\n private _product: string | undefined;\n // #endregion private\n\n /**\n * Initialize a readonly record of an MSBuild project's properties, including those related to NuGet.\n * @param msbuildProjectFullPath See {@link NugetProjectProperties.MSBuildProjectFullPath}\n * @param properties The dictionary returned by MSBuild's `-getProperty:propname,...` argument\n */\n constructor(\n msbuildProjectFullPath: string,\n properties: CaseInsensitiveMap<string, string>,\n ) {\n /**\n * names of properties to consume in this constructor instead of its super.\n * These are the names of getters, lowercased.\n */\n const keysToMoveOut = NPPGetterNames.InstanceGetters;\n /** Entries to remove from {@link properties} and apply to `this` after calling `super` */\n const consumables = new CaseInsensitiveMap<string, string>();\n // move property by key from `properties` to `consumables`. The types of keys and values in `properties` do not matter here.\n for (const key of keysToMoveOut) {\n const value = NugetProjectProperties.getAndForget(properties, key);\n if (value !== undefined)\n consumables.set(key, value);\n }\n\n // Pass the remainder to super\n super(msbuildProjectFullPath, properties);\n\n /** convert values to strings */\n for (const [value, key] of consumables.entries()) {\n if (typeof value !== 'string')\n consumables.set(key, String(value));\n }\n\n const _getAndForget = (key: string) => NugetProjectProperties.getAndForget(consumables, key);\n let data;\n this._authors = _getAndForget('Authors');\n this._buildOutputTargetFolder = _getAndForget('BuildOutputTargetFolder');\n this._company = _getAndForget('Company');\n this._contentTargetFolders = _getAndForget('ContentTargetFolders');\n this._copyright = _getAndForget('Copyright');\n if (tEmptyOrBooleanString.allows(data = _getAndForget('DevelopmentDependency')))\n this._developmentDependency = data;\n if (tBooleanString.allows(data = _getAndForget('IncludeBuiltOutput')))\n this._includeBuiltOutput = data;\n if (tBooleanString.allows(data = _getAndForget('IncludeContentInPack')))\n this._includeContentInPack = data;\n if (tEmptyOrBooleanString.allows(data = _getAndForget('IncludeSource')))\n this._includeSource = data;\n if (tEmptyOrBooleanString.allows(data = _getAndForget('IncludeSymbols')))\n this._includeSymbols = data;\n if (tBooleanString.allows(data = _getAndForget('IsPackable')))\n this._isPackable = data;\n if (tEmptyOrBooleanString.allows(data = _getAndForget('IsTool')))\n this._isTool = data;\n this._minClientVersion = _getAndForget('MinClientVersion');\n if (tEmptyOrBooleanString.allows(data = _getAndForget('NoPackageAnalysis')))\n this._noPackageAnalysis = data;\n this._nuspecBasePath = _getAndForget('NuspecBasePath');\n this._nuspecFile = _getAndForget('NuspecFile');\n this._nuspecProperties = _getAndForget('NuspecProperties');\n this._packageDescription = _getAndForget('PackageDescription');\n this._packageIcon = _getAndForget('PackageIcon');\n this._packageId = _getAndForget('PackageId');\n this._packageLicenseExpression = _getAndForget('PackageLicenseExpression');\n this._packageLicenseFile = _getAndForget('PackageLicenseFile');\n this._packageOutputPath = _getAndForget('PackageOutputPath');\n this._packageProjectUrl = _getAndForget('PackageProjectUrl');\n this._packageReadmeFile = _getAndForget('PackageReadmeFile');\n this._packageReleaseNotes = _getAndForget('PackageReleaseNotes');\n if (tBooleanString.allows(data = _getAndForget('PackageRequireLicenseAcceptance')))\n this._packageRequireLicenseAcceptance = data;\n this._packageTags = _getAndForget('PackageTags');\n this._packageType = _getAndForget('PackageType');\n this._packageVersion = _getAndForget('PackageVersion');\n this._product = _getAndForget('Product');\n this._repositoryCommit = _getAndForget('RepositoryCommit');\n if (Type_RepositoryType.allows(data = _getAndForget('RepositoryType')))\n this._repositoryType = data;\n this._repositoryUrl = _getAndForget('RepositoryUrl');\n if (tBooleanString.allows(data = _getAndForget('SuppressDependenciesWhenPacking')))\n this._suppressDependenciesWhenPacking = data;\n if (Type_SymbolPackageFormat.allows(data = _getAndForget('SymbolPackageFormat')))\n this._symbolPackageFormat = data;\n this._title = _getAndForget('Title');\n }\n\n /**\n * @returns A string-formatted boolean. If 'false', the project's `Pack`\n * Target (if available) will no-op.\n *\n * Default: `\"true\"`\n */\n get IsPackable(): BooleanString {\n return this._isPackable ??= 'true';\n }\n\n /**\n * @returns `\"true\"` or `\"false\"`. If \"true\", the package's dependencies are\n * excluded from the generated NuGet package.\n *\n * Default: `\"false\"`\n */\n get SuppressDependenciesWhenPacking(): BooleanString {\n return this._suppressDependenciesWhenPacking ??= 'false';\n }\n\n /**\n * @returns A semver-compatible version number in the form\n * Major.Minor.Patch[-Suffix], where -Suffix identifies prerelease versions.\n *\n * Default: {@link Version}\n * @example \"1.0.0\", \"1.0.0-beta\", \"1.0.0-beta-00345\"\n */\n get PackageVersion(): string {\n return this._packageVersion ??= this.Version;\n }\n\n /**\n * @returns The ID of the resulting NuGet package.\n *\n * Default: {@link AssemblyName}\n */\n get PackageId(): string {\n return this._packageId ??= this.AssemblyName;\n }\n\n /**\n * @returns A long description of the package for UI display.\n *\n * Default: {@link Description}\n */\n get PackageDescription(): string {\n return this._packageDescription ??= this.Description;\n }\n\n /**\n * @returns A semicolon-separated list of the package's authors, matching the\n * profile names on nuget.org. These are displayed in the NuGet Gallery on\n * nuget.org and are used to cross-reference packages by the same authors.\n *\n * Default: {@link AssemblyName `AssemblyName`}\n */\n get Authors(): string {\n return this._authors ??= this.AssemblyName;\n }\n\n /**\n * @returns Copyright details for the package.\n *\n * Default: `''`\n */\n get Copyright(): string {\n return this._copyright ??= '';\n }\n\n /**\n * @returns A string-formatted boolean. If `\"true\"`, the client must prompt the\n * consumer to accept the package license before installing the package.\n *\n * Default: `\"false\"`\n */\n get PackageRequireLicenseAcceptance(): BooleanString {\n return this._packageRequireLicenseAcceptance ??= 'false';\n }\n\n /**\n * This boolean only affects the package created from the project.\n * @see\n * {@link https://github.com/NuGet/Home/wiki/DevelopmentDependency-support-for-PackageReference DevelopmentDependency support for PackageReference}\n * @returns A string-formatted boolean. If `\"true\"`, the package is marked as\n * a development-only dependency and is prevented from being included as a\n * dependency in other packages. With PackageReference (NuGet 4.8+), this flag\n * also means that compile-time assets are excluded from compilation.\n *\n * Default: `''` (`false`-y)\n */\n get DevelopmentDependency(): EmptyOrBooleanString {\n return this._developmentDependency ??= '';\n }\n\n /**\n * @returns The {@link https://spdx.org/licenses/ SPDX license identifier} or\n * expression.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-a-license-expression-or-a-license-file Packing a license expression or a license file}\n * @example \"Apache-2.0\"\n */\n get PackageLicenseExpression(): string {\n return this._packageLicenseExpression ??= '';\n }\n\n /**\n * @returns The path to a license file within the package if you're using a\n * custom license or a license that hasn't been assigned an SPDX identifier.\n *\n * Default: `''`\n */\n get PackageLicenseFile(): string {\n return this._packageLicenseFile ??= '';\n }\n\n /**\n * @returns The package's project URL.\n *\n * Default: `''`\n */\n get PackageProjectUrl(): string {\n return this._packageProjectUrl ??= '';\n }\n\n /**\n * @returns The package icon path, relative to the root of the package.\n *\n * Default: `''`\n * @description You must pack the referenced icon image file. By default, it\n * is not packed.\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-an-icon-image-file Packing an icon image file},\n * {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec#icon icon metadata}\n */\n get PackageIcon(): string {\n return this._packageIcon ??= '';\n }\n\n /**\n * @returns Release notes for the package.\n *\n * Default: `''`\n */\n get PackageReleaseNotes(): string {\n return this._packageReleaseNotes ??= '';\n }\n\n /**\n * @returns The path of the package's README file relative to the package's\n * root.\n *\n * Default: `''`\n * @description You must pack the referenced readme file. By default, it is\n * not packed.\n */\n get PackageReadmeFile(): string {\n return this._packageReadmeFile ??= '';\n }\n\n /**\n * @returns A semicolon-delimited list of tags that designates the package.\n *\n * Default : `''`\n */\n get PackageTags(): string {\n return this._packageTags ??= '';\n }\n\n /**\n * @returns A relative or absolute path determining the where the packed\n * package will be dropped.\n *\n * Default: {@link OutputPath}\n */\n get PackageOutputPath(): string {\n return this._packageOutputPath ??= this.OutputPath;\n }\n\n /**\n * @returns A string-formatted boolean indicating whether the package should\n * create an additional symbols package when the project is packed. The\n * symbols package's format is controlled by the `SymbolPackageFormat`\n * property.\n *\n * Default: `''` (false-y)\n * @description When using `MSBuild -t:pack -p:IncludeSymbols=true`, the\n * corresponding .pdb files are copied along with other output files (.dll,\n * .exe, .winmd, .xml, .json, .pri). Note that setting `IncludeSymbols=true`\n * creates a regular package and a symbols package.\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#includesymbols IncludeSymbols}\n */\n get IncludeSymbols(): EmptyOrBooleanString {\n return this._includeSymbols ??= '';\n }\n\n /**\n * @returns A string-formatted boolean indicating whether the pack process\n * should create a source package. The source package contains the library's\n * source code as well as PDB files. Source files are put under the\n * `src/ProjectName` directory in the resulting package file.\n *\n * Default: `''` (false-y)\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#includesource IncludeSource}\n */\n get IncludeSource(): EmptyOrBooleanString {\n return this._includeSource ??= '';\n }\n\n /**\n * @returns A semicolon-separated list of tags indicating the package's\n * intended use. Custom types are allowed, but cannot be installed via Visual\n * Studio nor nuget.exe. See https://github.com/NuGet/Home/issues/10468.\n *\n * Package types can be version e.g. `PackageType1, 1.0.0.0;PackageType2`\n *\n * Default: `''`\n * @example \"Dependency \", \"DotnetTool\", \"MSBuildSdk\", \"Template\"\n * @see {@link https://learn.microsoft.com/en-us/nuget/create-packages/set-package-type?tabs=dotnet Set a NuGet package type}\n */\n get PackageType(): string {\n return this._packageType ??= '';\n }\n\n /**\n * @returns A string-formatted boolean specifying whether all output files are\n * copied to the *tools* folder instead of the *lib* folder.\n *\n * Default: `''` (false-y)\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#istool IsTool}\n */\n get IsTool(): EmptyOrBooleanString {\n return this._isTool ??= '';\n }\n\n /**\n * @returns The repository URL used to clone or retrieve source code.\n *\n * Default: `''`\n * @example \"https://github.com/NuGet/NuGet.Client.git\".\n */\n get RepositoryUrl(): string {\n return this._repositoryUrl ??= '';\n }\n\n /**\n * @returns The repository type.\n *\n * Default: `''`\n * @example \"git\", \"fts\"\n */\n get RepositoryType(): typeof Type_RepositoryType.inferOut {\n return this._repositoryType ??= '';\n }\n\n /**\n * @returns The (optional) repository commit or changeset to indicate which\n * source the package was built against. {@link RepositoryUrl} must also be\n * specified for this property to be included.\n *\n * Default: `''`\n * @description This is evaluated only during the \"Pack\" and \"Publish\"\n * Targets. If using nuget.exe or Visual Studio, NuGet 4.7.0 or later is\n * required.\n * @example \"0e4d1b598f350b3dc675018d539114d1328189ef\"\n */\n get RepositoryCommit(): string {\n return this._repositoryCommit ??= '';\n }\n\n /**\n * @returns A string specifying the format of the symbols package. If\n * \"symbols.nupkg\", a legacy symbols package is created with a .symbols.nupkg\n * extension containing PDBs, DLLs, and other output files. If \"snupkg\", a\n * snupkg symbol package is created containing the portable PDBs. The default\n * is \"symbols.nupkg\".\n *\n * Default: \"symbols.nupkg\"\n * @example \"symbols.nupkg\", \"snupkg\"\n */\n get SymbolPackageFormat(): typeof Type_SymbolPackageFormat.inferOut {\n return this._symbolPackageFormat ??= 'symbols.nupkg';\n }\n\n /**\n * @returns A string-formatted boolean specifying that `pack` should not run\n * package analysis after building the package.\n *\n * Default: `''` (false-y)\n */\n get NoPackageAnalysis(): EmptyOrBooleanString {\n return this._noPackageAnalysis ??= '';\n }\n\n /**\n * @returns A string specifying the minimum version of the NuGet client that\n * can install this package, enforced by nuget.exe and the Visual Studio\n * Package Manager.\n *\n * Default: `''`\n */\n get MinClientVersion(): string {\n return this._minClientVersion ??= '';\n }\n\n /**\n * @returns A string-formatted boolean value specifying whether the build\n * output assemblies should be packed into the .nupkg file or not.\n *\n * Default: `\"true\"`\n */\n get IncludeBuildOutput(): BooleanString {\n return this._includeBuiltOutput ??= 'true';\n }\n\n /**\n * @returns A string-formatted boolean specifying whether any items that have\n * a type of Content are included in the resulting package automatically.\n *\n * Default: `\"true\"`\n */\n get IncludeContentInPack(): BooleanString {\n return this._includeContentInPack ??= 'true';\n }\n\n /**\n * @returns The output directory of the output assemblies relative to the root\n * of the package. The output assemblies (and other output files) are copied\n * into their respective framework folders.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#output-assemblies Output assemblies}\n */\n get BuildOutputTargetFolder(): string {\n return this._buildOutputTargetFolder ??= '';\n }\n\n /**\n * @returns A semicolon-separated list of default locations of where all the\n * content files should go if `PackagePath` is not specified for them.\n *\n * Default: `\"content;contentFiles\"`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#including-content-in-a-package Including content in a package}\n */\n get ContentTargetFolders(): string {\n return this._contentTargetFolders ??= 'content;contentFiles';\n }\n\n /**\n * @returns The relative or absolute path to the `*.nuspec` file being used\n * for packing. If specified, it's used **exclusively** for packaging\n * information, and any information in the projects is not used.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-using-a-nuspec-file Packing using a .nuspec}\n */\n get NuspecFile(): string {\n return this._nuspecFile ??= '';\n }\n\n /**\n * @returns The base path for the *.nuspec* file.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-using-a-nuspec-file Packing using a .nuspec}\n */\n get NuspecBasePath(): string {\n return this._nuspecBasePath ??= '';\n }\n\n /**\n * @returns A semicolon-separated list of key=value pairs.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-using-a-nuspec-file Packing using a .nuspec}\n */\n get NuspecProperties(): string {\n return this._nuspecProperties ??= '';\n }\n\n /**\n * @returns A human-friendly title of the package, typically used in UI displays as\n * on nuget.org and the Package Manager in Visual Studio.\n * Default: {@link PackageId}\n */\n get Title(): string {\n return this._title ??= this.PackageId;\n }\n\n /**\n * @returns Company name or information.\n *\n * Default: {@link Authors}\n */\n get Company(): string {\n return this._company ??= this.Authors;\n }\n\n /**\n * @returns Product name or information.\n *\n * Default: {@link AssemblyName}\n */\n get Product(): string {\n return this._product ??= this.AssemblyName;\n }\n}\n\nexport type Class_NPP = ClassLike<\n typeof NugetProjectProperties\n & WithProto<Class_MSBPP>\n>;\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class NPPGetterNames {\n private static _prototypeChain: ProtoChainOfClass<Class_NPP> | undefined;\n private static get PrototypeChain(): [Class_NPP, Class_MSBPP] {\n return this._prototypeChain ??= getPrototypesChainOf(NugetProjectProperties as Class_NPP, 'classes');\n }\n\n private static _instanceGetters: Exclude<keyof NugetProjectProperties, keyof MSBuildProjectProperties>[] | undefined;\n private static _instanceGettersRecursive: (keyof NugetProjectProperties)[] | undefined;\n private static _StaticGetters: never[] | undefined;\n private static _StaticGettersRecursive: (keyof typeof NugetProjectProperties)[] | undefined;\n\n public static get InstanceGetters(): Exclude<keyof NugetProjectProperties, keyof MSBuildProjectProperties>[] {\n return this._instanceGetters ??= listOwnGetters(NugetProjectProperties as Class_NPP, 'Instance');\n }\n\n public static get InstanceGettersRecursive(): (keyof NugetProjectProperties)[] {\n return this._instanceGettersRecursive ??= this.PrototypeChain.flatMap(\n proto => listOwnGetters<typeof proto, 'Instance'>(proto, 'Instance'),\n );\n }\n\n public static get StaticGetters(): never[] {\n return this._StaticGetters ??= listOwnGetters(NugetProjectProperties as Class_NPP, 'Static');\n };\n\n public static get StaticGettersRecursive(): ('prototype' | 'GetFullPath')[] {\n return this._StaticGettersRecursive ??= this.PrototypeChain.flatMap(\n proto => listOwnGetters(proto, 'Static'),\n );\n }\n}\n\n/** @module NugetProjectProperties */\n"],"mappings":";;;;;;;;AAiBA,MAAM,sBAAgD,KAAK,uBAAiB;AAC5E,MAAM,2BAA6D,KAAK,iCAA6B;;;;;;;AAQrG,IAAa,yBAAb,MAAa,+BAA+B,yBAAyB;CAEnE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;;CAQA,YACE,wBACA,YACA;;;;;EAKA,MAAM,gBAAgB,eAAe;;EAErC,MAAM,cAAc,IAAI,oBAAoC;AAE5D,OAAK,MAAM,OAAO,eAAe;GAC/B,MAAM,QAAQ,uBAAuB,aAAa,YAAY,IAAI;AAClE,OAAI,UAAU,KAAA,EACZ,aAAY,IAAI,KAAK,MAAM;;AAI/B,QAAM,wBAAwB,WAAW;;AAGzC,OAAK,MAAM,CAAC,OAAO,QAAQ,YAAY,SAAS,CAC9C,KAAI,OAAO,UAAU,SACnB,aAAY,IAAI,KAAK,OAAO,MAAM,CAAC;EAGvC,MAAM,iBAAiB,QAAgB,uBAAuB,aAAa,aAAa,IAAI;EAC5F,IAAI;AACJ,OAAK,WAAW,cAAc,UAAU;AACxC,OAAK,2BAA2B,cAAc,0BAA0B;AACxE,OAAK,WAAW,cAAc,UAAU;AACxC,OAAK,wBAAwB,cAAc,uBAAuB;AAClE,OAAK,aAAa,cAAc,YAAY;AAC5C,MAAI,sBAAsB,OAAO,OAAO,cAAc,wBAAwB,CAAC,CAC7E,MAAK,yBAAyB;AAChC,MAAI,eAAe,OAAO,OAAO,cAAc,qBAAqB,CAAC,CACnE,MAAK,sBAAsB;AAC7B,MAAI,eAAe,OAAO,OAAO,cAAc,uBAAuB,CAAC,CACr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kBAA2F;AAC3G,SAAO,KAAK,qBAAqB,eAAe,wBAAqC,WAAW;;CAGlG,WAAkB,2BAA6D;AAC7E,SAAO,KAAK,8BAA8B,KAAK,eAAe,SAC5D,UAAS,eAAyC,OAAO,WAAW,CACrE;;CAGH,WAAkB,gBAAyB;AACzC,SAAO,KAAK,mBAAmB,eAAe,wBAAqC,SAAS;;CAG9F,WAAkB,yBAA0D;AAC1E,SAAO,KAAK,4BAA4B,KAAK,eAAe,SAC1D,UAAS,eAAe,OAAO,SAAS,CACzC"}
|
|
1
|
+
{"version":3,"file":"NugetProjectProperties.mjs","names":[],"sources":["../../src/dotnet/NugetProjectProperties.ts"],"sourcesContent":["import { type } from 'arktype';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport {\n tBooleanString,\n tEmptyOrBooleanString,\n type BooleanString,\n type EmptyOrBooleanString,\n} from '../utils/miscTypes.ts';\nimport {\n getPrototypesChainOf,\n listOwnGetters,\n type ClassLike,\n type ProtoChainOfClass,\n type WithProto,\n} from '../utils/reflection.ts';\nimport { MSBuildProjectProperties, type Class_MSBPP } from './MSBuildProjectProperties.ts';\n\nconst Type_RepositoryType: type<'' | 'git' | 'tfs'> = type('\"\"|\"git\"|\"tfs\"');\nconst Type_SymbolPackageFormat: type<'symbols.nupkg' | 'snupkg'> = type('\"symbols.nupkg\" | \"snupkg\"');\n\n/**\n * A readonly record of a .csproj or .fsproj with NuGet configuration properties in\n * addition to those specified by {@link MSBuildProjectProperties}. This record\n * should be considered immutable. A new instance should be constructed from MSBuild's evaluation output.\n * @see https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#pack-target-inputs\n */\nexport class NugetProjectProperties extends MSBuildProjectProperties {\n // #region private\n private _isPackable: BooleanString | undefined;\n private _suppressDependenciesWhenPacking: BooleanString | undefined;\n private _packageVersion: string | undefined;\n private _packageId: string | undefined;\n private _packageDescription: string | undefined;\n private _authors: string | undefined;\n private _copyright: string | undefined;\n private _packageRequireLicenseAcceptance: BooleanString | undefined;\n private _developmentDependency: EmptyOrBooleanString | undefined;\n private _packageLicenseExpression: string | undefined;\n private _packageLicenseFile: string | undefined;\n private _packageProjectUrl: string | undefined;\n private _packageIcon: string | undefined;\n private _packageReleaseNotes: string | undefined;\n private _packageReadmeFile: string | undefined;\n private _packageTags: string | undefined;\n private _packageOutputPath: string | undefined;\n private _includeSymbols: EmptyOrBooleanString | undefined;\n private _includeSource: EmptyOrBooleanString | undefined;\n private _packageType: string | undefined;\n private _isTool: EmptyOrBooleanString | undefined;\n private _repositoryUrl: string | undefined;\n private _repositoryType: '' | 'git' | 'tfs' | undefined;\n private _repositoryCommit: string | undefined;\n private _symbolPackageFormat: 'symbols.nupkg' | 'snupkg' | undefined;\n private _noPackageAnalysis: EmptyOrBooleanString | undefined;\n private _minClientVersion: string | undefined;\n private _includeBuiltOutput: BooleanString | undefined;\n private _includeContentInPack: BooleanString | undefined;\n private _buildOutputTargetFolder: string | undefined;\n private _contentTargetFolders: string | undefined;\n private _nuspecFile: string | undefined;\n private _nuspecBasePath: string | undefined;\n private _nuspecProperties: string | undefined;\n private _title: string | undefined;\n private _company: string | undefined;\n private _product: string | undefined;\n // #endregion private\n\n /**\n * Initialize a readonly record of an MSBuild project's properties, including those related to NuGet.\n * @param msbuildProjectFullPath See {@link NugetProjectProperties.MSBuildProjectFullPath}\n * @param properties The dictionary returned by MSBuild's `-getProperty:propname,...` argument\n */\n constructor(\n msbuildProjectFullPath: string,\n properties: CaseInsensitiveMap<string, string>,\n ) {\n /**\n * names of properties to consume in this constructor instead of its super.\n * These are the names of getters, lowercased.\n */\n const keysToMoveOut = NPPGetterNames.InstanceGetters;\n /** Entries to remove from {@link properties} and apply to `this` after calling `super` */\n const consumables = new CaseInsensitiveMap<string, string>();\n // move property by key from `properties` to `consumables`. The types of keys and values in `properties` do not matter here.\n for (const key of keysToMoveOut) {\n const value = NugetProjectProperties.getAndForget(properties, key);\n if (value !== undefined)\n consumables.set(key, value);\n }\n\n // Pass the remainder to super\n super(msbuildProjectFullPath, properties);\n\n /** convert values to strings */\n for (const [value, key] of consumables.entries()) {\n if (typeof value !== 'string')\n consumables.set(key, String(value));\n }\n\n const _getAndForget = (key: string) => NugetProjectProperties.getAndForget(consumables, key);\n let data;\n this._authors = _getAndForget('Authors');\n this._buildOutputTargetFolder = _getAndForget('BuildOutputTargetFolder');\n this._company = _getAndForget('Company');\n this._contentTargetFolders = _getAndForget('ContentTargetFolders');\n this._copyright = _getAndForget('Copyright');\n if (tEmptyOrBooleanString.allows(data = _getAndForget('DevelopmentDependency')))\n this._developmentDependency = data;\n if (tBooleanString.allows(data = _getAndForget('IncludeBuiltOutput')))\n this._includeBuiltOutput = data;\n if (tBooleanString.allows(data = _getAndForget('IncludeContentInPack')))\n this._includeContentInPack = data;\n if (tEmptyOrBooleanString.allows(data = _getAndForget('IncludeSource')))\n this._includeSource = data;\n if (tEmptyOrBooleanString.allows(data = _getAndForget('IncludeSymbols')))\n this._includeSymbols = data;\n if (tBooleanString.allows(data = _getAndForget('IsPackable')))\n this._isPackable = data;\n if (tEmptyOrBooleanString.allows(data = _getAndForget('IsTool')))\n this._isTool = data;\n this._minClientVersion = _getAndForget('MinClientVersion');\n if (tEmptyOrBooleanString.allows(data = _getAndForget('NoPackageAnalysis')))\n this._noPackageAnalysis = data;\n this._nuspecBasePath = _getAndForget('NuspecBasePath');\n this._nuspecFile = _getAndForget('NuspecFile');\n this._nuspecProperties = _getAndForget('NuspecProperties');\n this._packageDescription = _getAndForget('PackageDescription');\n this._packageIcon = _getAndForget('PackageIcon');\n this._packageId = _getAndForget('PackageId');\n this._packageLicenseExpression = _getAndForget('PackageLicenseExpression');\n this._packageLicenseFile = _getAndForget('PackageLicenseFile');\n this._packageOutputPath = _getAndForget('PackageOutputPath');\n this._packageProjectUrl = _getAndForget('PackageProjectUrl');\n this._packageReadmeFile = _getAndForget('PackageReadmeFile');\n this._packageReleaseNotes = _getAndForget('PackageReleaseNotes');\n if (tBooleanString.allows(data = _getAndForget('PackageRequireLicenseAcceptance')))\n this._packageRequireLicenseAcceptance = data;\n this._packageTags = _getAndForget('PackageTags');\n this._packageType = _getAndForget('PackageType');\n this._packageVersion = _getAndForget('PackageVersion');\n this._product = _getAndForget('Product');\n this._repositoryCommit = _getAndForget('RepositoryCommit');\n if (Type_RepositoryType.allows(data = _getAndForget('RepositoryType')))\n this._repositoryType = data;\n this._repositoryUrl = _getAndForget('RepositoryUrl');\n if (tBooleanString.allows(data = _getAndForget('SuppressDependenciesWhenPacking')))\n this._suppressDependenciesWhenPacking = data;\n if (Type_SymbolPackageFormat.allows(data = _getAndForget('SymbolPackageFormat')))\n this._symbolPackageFormat = data;\n this._title = _getAndForget('Title');\n }\n\n /**\n * @returns A string-formatted boolean. If 'false', the project's `Pack`\n * Target (if available) will no-op.\n *\n * Default: `\"true\"`\n */\n get IsPackable(): BooleanString {\n return this._isPackable ??= 'true';\n }\n\n /**\n * @returns `\"true\"` or `\"false\"`. If \"true\", the package's dependencies are\n * excluded from the generated NuGet package.\n *\n * Default: `\"false\"`\n */\n get SuppressDependenciesWhenPacking(): BooleanString {\n return this._suppressDependenciesWhenPacking ??= 'false';\n }\n\n /**\n * @returns A semver-compatible version number in the form\n * Major.Minor.Patch[-Suffix], where -Suffix identifies prerelease versions.\n *\n * Default: {@link Version}\n * @example \"1.0.0\", \"1.0.0-beta\", \"1.0.0-beta-00345\"\n */\n get PackageVersion(): string {\n return this._packageVersion ??= this.Version;\n }\n\n /**\n * @returns The ID of the resulting NuGet package.\n *\n * Default: {@link AssemblyName}\n */\n get PackageId(): string {\n return this._packageId ??= this.AssemblyName;\n }\n\n /**\n * @returns A long description of the package for UI display.\n *\n * Default: {@link Description}\n */\n get PackageDescription(): string {\n return this._packageDescription ??= this.Description;\n }\n\n /**\n * @returns A semicolon-separated list of the package's authors, matching the\n * profile names on nuget.org. These are displayed in the NuGet Gallery on\n * nuget.org and are used to cross-reference packages by the same authors.\n *\n * Default: {@link AssemblyName `AssemblyName`}\n */\n get Authors(): string {\n return this._authors ??= this.AssemblyName;\n }\n\n /**\n * @returns Copyright details for the package.\n *\n * Default: `''`\n */\n get Copyright(): string {\n return this._copyright ??= '';\n }\n\n /**\n * @returns A string-formatted boolean. If `\"true\"`, the client must prompt the\n * consumer to accept the package license before installing the package.\n *\n * Default: `\"false\"`\n */\n get PackageRequireLicenseAcceptance(): BooleanString {\n return this._packageRequireLicenseAcceptance ??= 'false';\n }\n\n /**\n * This boolean only affects the package created from the project.\n * @see\n * {@link https://github.com/NuGet/Home/wiki/DevelopmentDependency-support-for-PackageReference DevelopmentDependency support for PackageReference}\n * @returns A string-formatted boolean. If `\"true\"`, the package is marked as\n * a development-only dependency and is prevented from being included as a\n * dependency in other packages. With PackageReference (NuGet 4.8+), this flag\n * also means that compile-time assets are excluded from compilation.\n *\n * Default: `''` (`false`-y)\n */\n get DevelopmentDependency(): EmptyOrBooleanString {\n return this._developmentDependency ??= '';\n }\n\n /**\n * @returns The {@link https://spdx.org/licenses/ SPDX license identifier} or\n * expression.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-a-license-expression-or-a-license-file Packing a license expression or a license file}\n * @example \"Apache-2.0\"\n */\n get PackageLicenseExpression(): string {\n return this._packageLicenseExpression ??= '';\n }\n\n /**\n * @returns The path to a license file within the package if you're using a\n * custom license or a license that hasn't been assigned an SPDX identifier.\n *\n * Default: `''`\n */\n get PackageLicenseFile(): string {\n return this._packageLicenseFile ??= '';\n }\n\n /**\n * @returns The package's project URL.\n *\n * Default: `''`\n */\n get PackageProjectUrl(): string {\n return this._packageProjectUrl ??= '';\n }\n\n /**\n * @returns The package icon path, relative to the root of the package.\n *\n * Default: `''`\n * @description You must pack the referenced icon image file. By default, it\n * is not packed.\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-an-icon-image-file Packing an icon image file},\n * {@link https://learn.microsoft.com/en-us/nuget/reference/nuspec#icon icon metadata}\n */\n get PackageIcon(): string {\n return this._packageIcon ??= '';\n }\n\n /**\n * @returns Release notes for the package.\n *\n * Default: `''`\n */\n get PackageReleaseNotes(): string {\n return this._packageReleaseNotes ??= '';\n }\n\n /**\n * @returns The path of the package's README file relative to the package's\n * root.\n *\n * Default: `''`\n * @description You must pack the referenced readme file. By default, it is\n * not packed.\n */\n get PackageReadmeFile(): string {\n return this._packageReadmeFile ??= '';\n }\n\n /**\n * @returns A semicolon-delimited list of tags that designates the package.\n *\n * Default : `''`\n */\n get PackageTags(): string {\n return this._packageTags ??= '';\n }\n\n /**\n * @returns A relative or absolute path determining the where the packed\n * package will be dropped.\n *\n * Default: {@link OutputPath}\n */\n get PackageOutputPath(): string {\n return this._packageOutputPath ??= this.OutputPath;\n }\n\n /**\n * @returns A string-formatted boolean indicating whether the package should\n * create an additional symbols package when the project is packed. The\n * symbols package's format is controlled by the `SymbolPackageFormat`\n * property.\n *\n * Default: `''` (false-y)\n * @description When using `MSBuild -t:pack -p:IncludeSymbols=true`, the\n * corresponding .pdb files are copied along with other output files (.dll,\n * .exe, .winmd, .xml, .json, .pri). Note that setting `IncludeSymbols=true`\n * creates a regular package and a symbols package.\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#includesymbols IncludeSymbols}\n */\n get IncludeSymbols(): EmptyOrBooleanString {\n return this._includeSymbols ??= '';\n }\n\n /**\n * @returns A string-formatted boolean indicating whether the pack process\n * should create a source package. The source package contains the library's\n * source code as well as PDB files. Source files are put under the\n * `src/ProjectName` directory in the resulting package file.\n *\n * Default: `''` (false-y)\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#includesource IncludeSource}\n */\n get IncludeSource(): EmptyOrBooleanString {\n return this._includeSource ??= '';\n }\n\n /**\n * @returns A semicolon-separated list of tags indicating the package's\n * intended use. Custom types are allowed, but cannot be installed via Visual\n * Studio nor nuget.exe. See https://github.com/NuGet/Home/issues/10468.\n *\n * Package types can be version e.g. `PackageType1, 1.0.0.0;PackageType2`\n *\n * Default: `''`\n * @example \"Dependency \", \"DotnetTool\", \"MSBuildSdk\", \"Template\"\n * @see {@link https://learn.microsoft.com/en-us/nuget/create-packages/set-package-type?tabs=dotnet Set a NuGet package type}\n */\n get PackageType(): string {\n return this._packageType ??= '';\n }\n\n /**\n * @returns A string-formatted boolean specifying whether all output files are\n * copied to the *tools* folder instead of the *lib* folder.\n *\n * Default: `''` (false-y)\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#istool IsTool}\n */\n get IsTool(): EmptyOrBooleanString {\n return this._isTool ??= '';\n }\n\n /**\n * @returns The repository URL used to clone or retrieve source code.\n *\n * Default: `''`\n * @example \"https://github.com/NuGet/NuGet.Client.git\".\n */\n get RepositoryUrl(): string {\n return this._repositoryUrl ??= '';\n }\n\n /**\n * @returns The repository type.\n *\n * Default: `''`\n * @example \"git\", \"fts\"\n */\n get RepositoryType(): typeof Type_RepositoryType.inferOut {\n return this._repositoryType ??= '';\n }\n\n /**\n * @returns The (optional) repository commit or changeset to indicate which\n * source the package was built against. {@link RepositoryUrl} must also be\n * specified for this property to be included.\n *\n * Default: `''`\n * @description This is evaluated only during the \"Pack\" and \"Publish\"\n * Targets. If using nuget.exe or Visual Studio, NuGet 4.7.0 or later is\n * required.\n * @example \"0e4d1b598f350b3dc675018d539114d1328189ef\"\n */\n get RepositoryCommit(): string {\n return this._repositoryCommit ??= '';\n }\n\n /**\n * @returns A string specifying the format of the symbols package. If\n * \"symbols.nupkg\", a legacy symbols package is created with a .symbols.nupkg\n * extension containing PDBs, DLLs, and other output files. If \"snupkg\", a\n * snupkg symbol package is created containing the portable PDBs. The default\n * is \"symbols.nupkg\".\n *\n * Default: \"symbols.nupkg\"\n * @example \"symbols.nupkg\", \"snupkg\"\n */\n get SymbolPackageFormat(): typeof Type_SymbolPackageFormat.inferOut {\n return this._symbolPackageFormat ??= 'symbols.nupkg';\n }\n\n /**\n * @returns A string-formatted boolean specifying that `pack` should not run\n * package analysis after building the package.\n *\n * Default: `''` (false-y)\n */\n get NoPackageAnalysis(): EmptyOrBooleanString {\n return this._noPackageAnalysis ??= '';\n }\n\n /**\n * @returns A string specifying the minimum version of the NuGet client that\n * can install this package, enforced by nuget.exe and the Visual Studio\n * Package Manager.\n *\n * Default: `''`\n */\n get MinClientVersion(): string {\n return this._minClientVersion ??= '';\n }\n\n /**\n * @returns A string-formatted boolean value specifying whether the build\n * output assemblies should be packed into the .nupkg file or not.\n *\n * Default: `\"true\"`\n */\n get IncludeBuildOutput(): BooleanString {\n return this._includeBuiltOutput ??= 'true';\n }\n\n /**\n * @returns A string-formatted boolean specifying whether any items that have\n * a type of Content are included in the resulting package automatically.\n *\n * Default: `\"true\"`\n */\n get IncludeContentInPack(): BooleanString {\n return this._includeContentInPack ??= 'true';\n }\n\n /**\n * @returns The output directory of the output assemblies relative to the root\n * of the package. The output assemblies (and other output files) are copied\n * into their respective framework folders.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#output-assemblies Output assemblies}\n */\n get BuildOutputTargetFolder(): string {\n return this._buildOutputTargetFolder ??= '';\n }\n\n /**\n * @returns A semicolon-separated list of default locations of where all the\n * content files should go if `PackagePath` is not specified for them.\n *\n * Default: `\"content;contentFiles\"`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#including-content-in-a-package Including content in a package}\n */\n get ContentTargetFolders(): string {\n return this._contentTargetFolders ??= 'content;contentFiles';\n }\n\n /**\n * @returns The relative or absolute path to the `*.nuspec` file being used\n * for packing. If specified, it's used **exclusively** for packaging\n * information, and any information in the projects is not used.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-using-a-nuspec-file Packing using a .nuspec}\n */\n get NuspecFile(): string {\n return this._nuspecFile ??= '';\n }\n\n /**\n * @returns The base path for the *.nuspec* file.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-using-a-nuspec-file Packing using a .nuspec}\n */\n get NuspecBasePath(): string {\n return this._nuspecBasePath ??= '';\n }\n\n /**\n * @returns A semicolon-separated list of key=value pairs.\n *\n * Default: `''`\n * @see\n * {@link https://learn.microsoft.com/en-us/nuget/reference/msbuild-targets#packing-using-a-nuspec-file Packing using a .nuspec}\n */\n get NuspecProperties(): string {\n return this._nuspecProperties ??= '';\n }\n\n /**\n * @returns A human-friendly title of the package, typically used in UI displays as\n * on nuget.org and the Package Manager in Visual Studio.\n * Default: {@link PackageId}\n */\n get Title(): string {\n return this._title ??= this.PackageId;\n }\n\n /**\n * @returns Company name or information.\n *\n * Default: {@link Authors}\n */\n get Company(): string {\n return this._company ??= this.Authors;\n }\n\n /**\n * @returns Product name or information.\n *\n * Default: {@link AssemblyName}\n */\n get Product(): string {\n return this._product ??= this.AssemblyName;\n }\n}\n\nexport type Class_NPP = ClassLike<\n typeof NugetProjectProperties\n & WithProto<Class_MSBPP>\n>;\n\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class NPPGetterNames {\n private static _prototypeChain: ProtoChainOfClass<Class_NPP> | undefined;\n private static get PrototypeChain(): [Class_NPP, Class_MSBPP] {\n return this._prototypeChain ??= getPrototypesChainOf(NugetProjectProperties as Class_NPP, 'classes');\n }\n\n private static _instanceGetters: Exclude<keyof NugetProjectProperties, keyof MSBuildProjectProperties>[] | undefined;\n private static _instanceGettersRecursive: (keyof NugetProjectProperties)[] | undefined;\n private static _StaticGetters: never[] | undefined;\n private static _StaticGettersRecursive: (keyof typeof NugetProjectProperties)[] | undefined;\n\n public static get InstanceGetters(): Exclude<keyof NugetProjectProperties, keyof MSBuildProjectProperties>[] {\n return this._instanceGetters ??= listOwnGetters(NugetProjectProperties as Class_NPP, 'Instance');\n }\n\n public static get InstanceGettersRecursive(): (keyof NugetProjectProperties)[] {\n return this._instanceGettersRecursive ??= this.PrototypeChain.flatMap(\n proto => listOwnGetters<typeof proto, 'Instance'>(proto, 'Instance'),\n );\n }\n\n public static get StaticGetters(): never[] {\n return this._StaticGetters ??= listOwnGetters(NugetProjectProperties as Class_NPP, 'Static');\n };\n\n public static get StaticGettersRecursive(): ('prototype' | 'GetFullPath')[] {\n return this._StaticGettersRecursive ??= this.PrototypeChain.flatMap(\n proto => listOwnGetters(proto, 'Static'),\n );\n }\n}\n\n/** @module NugetProjectProperties */\n"],"mappings":";;;;;;;;AAiBA,MAAM,sBAAgD,KAAK,uBAAiB;AAC5E,MAAM,2BAA6D,KAAK,iCAA6B;;;;;;;AAQrG,IAAa,yBAAb,MAAa,+BAA+B,yBAAyB;CAEnE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;;;;;;CAQA,YACE,wBACA,YACA;;;;;EAKA,MAAM,gBAAgB,eAAe;;EAErC,MAAM,cAAc,IAAI,oBAAoC;EAE5D,KAAK,MAAM,OAAO,eAAe;GAC/B,MAAM,QAAQ,uBAAuB,aAAa,YAAY,IAAI;GAClE,IAAI,UAAU,KAAA,GACZ,YAAY,IAAI,KAAK,MAAM;;EAI/B,MAAM,wBAAwB,WAAW;;EAGzC,KAAK,MAAM,CAAC,OAAO,QAAQ,YAAY,SAAS,EAC9C,IAAI,OAAO,UAAU,UACnB,YAAY,IAAI,KAAK,OAAO,MAAM,CAAC;EAGvC,MAAM,iBAAiB,QAAgB,uBAAuB,aAAa,aAAa,IAAI;EAC5F,IAAI;EACJ,KAAK,WAAW,cAAc,UAAU;EACxC,KAAK,2BAA2B,cAAc,0BAA0B;EACxE,KAAK,WAAW,cAAc,UAAU;EACxC,KAAK,wBAAwB,cAAc,uBAAuB;EAClE,KAAK,aAAa,cAAc,YAAY;EAC5C,IAAI,sBAAsB,OAAO,OAAO,cAAc,wBAAwB,CAAC,EAC7E,KAA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OAAe;CACf,WAAmB,iBAA2C;EAC5D,OAAO,KAAK,oBAAoB,qBAAqB,wBAAqC,UAAU;;CAGtG,OAAe;CACf,OAAe;CACf,OAAe;CACf,OAAe;CAEf,WAAkB,kBAA2F;EAC3G,OAAO,KAAK,qBAAqB,eAAe,wBAAqC,WAAW;;CAGlG,WAAkB,2BAA6D;EAC7E,OAAO,KAAK,8BAA8B,KAAK,eAAe,SAC5D,UAAS,eAAyC,OAAO,WAAW,CACrE;;CAGH,WAAkB,gBAAyB;EACzC,OAAO,KAAK,mBAAmB,eAAe,wBAAqC,SAAS;;CAG9F,WAAkB,yBAA0D;EAC1E,OAAO,KAAK,4BAA4B,KAAK,eAAe,SAC1D,UAAS,eAAe,OAAO,SAAS,CACzC"}
|
|
@@ -214,6 +214,9 @@ but the environment variable is empty or undefined.`);
|
|
|
214
214
|
* is a wrapper for MSBuild's `-property:<n>=<v>` properties override arg.
|
|
215
215
|
*/
|
|
216
216
|
static PackPackagesOptionsType = Object.freeze(type({
|
|
217
|
+
/**
|
|
218
|
+
* a custom arg for handling MSBuild's `-property:<n>=<v>` argument for overriding MSBuild properties.
|
|
219
|
+
*/
|
|
217
220
|
"propertyOverrides?": type("Record<string,string>"),
|
|
218
221
|
"artifactsPath?": "string",
|
|
219
222
|
"configuration?": "\"Release\" | \"Debug\"",
|
|
@@ -232,6 +235,10 @@ but the environment variable is empty or undefined.`);
|
|
|
232
235
|
"useCurrentRuntime?": "boolean",
|
|
233
236
|
"verbosity?": "\"quiet\" | \"minimal\" | \"normal\" | \"detailed\" | \"diagnostic\"",
|
|
234
237
|
"versionSuffix?": "string",
|
|
238
|
+
/**
|
|
239
|
+
* MSBuild evaluation option. Added to get the output Nupkgs' file paths.
|
|
240
|
+
* @todo consider adding -GetProperty, -GetTarget
|
|
241
|
+
*/
|
|
235
242
|
"-GetItem?": type.string.array().readonly().or("string[]")
|
|
236
243
|
}));
|
|
237
244
|
static PackDummyPackagesOptionsType = this.PackPackagesOptionsType.omit("output");
|
|
@@ -362,18 +369,35 @@ but the environment variable is empty or undefined.`);
|
|
|
362
369
|
* If you want to use this API's default root value (\`${cwd()}/publish`), assign an empty string.
|
|
363
370
|
*/
|
|
364
371
|
static PushPackagesOptionsType = Object.freeze(type({
|
|
372
|
+
/** If an empty string is passed, this property is overridden to `./publish` */
|
|
365
373
|
root: "string",
|
|
374
|
+
/** The API key for the server. NOTE: if `undefined` or an empty string, the `dotnet nuget` client will lookup credentials set via `dotnet nuget {add|update} source`. */
|
|
366
375
|
"apiKey?": "string",
|
|
376
|
+
/** The NuGet configuration file (nuget.config) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see {@link https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior Common NuGet Configurations}. */
|
|
367
377
|
"configFile?": "string",
|
|
378
|
+
/** Disables buffering when pushing to an HTTP(S) server to reduce memory usage. */
|
|
368
379
|
"disableBuffering?": "boolean",
|
|
380
|
+
/** Forces the application to run using an invariant, English-based culture. */
|
|
369
381
|
"forceEnglishOutput?": "boolean",
|
|
382
|
+
/** Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK. */
|
|
370
383
|
"interactive?": "boolean",
|
|
384
|
+
/** Doesn't append "api/v2/package" to the source URL. */
|
|
371
385
|
"noServiceEndpoint?": "boolean",
|
|
372
386
|
"noSymbols?": "boolean",
|
|
387
|
+
/** When pushing multiple packages to an HTTP(S) server, treats any 409 Conflict response as a warning so that other pushes can continue. */
|
|
373
388
|
"skipDuplicate?": "boolean",
|
|
389
|
+
/**
|
|
390
|
+
* Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP.
|
|
391
|
+
*
|
|
392
|
+
* ### Important
|
|
393
|
+
* > Starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet config file specifies a `DefaultPushSource` value. For more information, see {@link https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior Configuring NuGet behavior}.
|
|
394
|
+
*/
|
|
374
395
|
"source?": "string",
|
|
396
|
+
/** The API key for the symbol server. NOTE: if `undefined`, the `dotnet nuget` client will lookup credentials set via `dotnet nuget {add|update} source`.` */
|
|
375
397
|
"symbolApiKey?": "string",
|
|
398
|
+
/** Specifies the symbol server URL. */
|
|
376
399
|
"symbolSource?": "string",
|
|
400
|
+
/** Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes). Specifying 0 applies the default value. */
|
|
377
401
|
"timeout?": "number"
|
|
378
402
|
}));
|
|
379
403
|
/**
|
|
@@ -560,15 +584,59 @@ const NRI = NugetRegistryInfo;
|
|
|
560
584
|
* overriding member types via {@link NRIOptsBase.merge}
|
|
561
585
|
*/
|
|
562
586
|
const NRIOptsBase = type({
|
|
587
|
+
/**
|
|
588
|
+
* The environment variables whose values are tokens with permission to push a
|
|
589
|
+
* package to the NuGet package registry. The array is iterated through until
|
|
590
|
+
* one token is found. If none of the environment variables are defined,
|
|
591
|
+
* {@link NugetRegistryInfo}'s constructor will throw an {@link Error}.
|
|
592
|
+
*/
|
|
563
593
|
project: type.instanceOf(MSBuildProject).or(type.instanceOf(MSBuildProject).readonly()),
|
|
594
|
+
/**
|
|
595
|
+
* A NuGet package registry's API endpoint URL -OR- the name assigned via the
|
|
596
|
+
* client e.g. `dotnet nuget add source --name ${source} ${source's URL}`
|
|
597
|
+
*/
|
|
564
598
|
source: type.string,
|
|
599
|
+
/**
|
|
600
|
+
* WARNING: If possible, set credentials via `dotnet nuget {add|update}
|
|
601
|
+
* source` as recommended by Microsoft! This is more secure than exposing
|
|
602
|
+
* credentials to the Node.JS runtime and all its loaded modules.
|
|
603
|
+
*
|
|
604
|
+
* The environment variables whose values are tokens with permission to push a
|
|
605
|
+
* package to the NuGet package registry.The array is iterated through until
|
|
606
|
+
* one token is found.If none of the environment variables are defined,
|
|
607
|
+
* {@link NugetRegistryInfo}'s constructor will throw an {@link Error}.
|
|
608
|
+
*
|
|
609
|
+
* If none of these are defined in the `.env` or process environment variables (.vault.env is impractical in CI), the `--api-key/-k` argument is excluded from `dotnet nuget push` commands.
|
|
610
|
+
* Instead, the NuGet client relies on credentials configured for the
|
|
611
|
+
* given NuGet source. If the NuGet client does not find credentials saved for the
|
|
612
|
+
* NuGet {@link NRIOptsBase.t.source source} and they are required, the command will fail.
|
|
613
|
+
*
|
|
614
|
+
* Use the `dotnet` CLI to configure credentials for existing NuGet sources
|
|
615
|
+
* ({@link https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-update-source `dotnet nuget update source`})
|
|
616
|
+
* -OR- configure credentials for non-default NuGet sources
|
|
617
|
+
* ({@link https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source `dotnet nuget add source`}).\
|
|
618
|
+
* Alternatively, use the `nuget.exe` CLI to add/update sources. See
|
|
619
|
+
* {@link https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-sources `nuget sources` (NuGet CLI)}.
|
|
620
|
+
*
|
|
621
|
+
* The credentials will be validated during the `verifyConditions` step of Semantic Release.
|
|
622
|
+
*/
|
|
565
623
|
tokenEnvVars: type.string.array().readonly()
|
|
566
624
|
});
|
|
567
625
|
/**
|
|
568
626
|
* The type of the parameter for {@link NugetRegistryInfo}'s constructor.
|
|
569
627
|
*/
|
|
570
628
|
const NRIOpts = NRIOptsBase.merge({
|
|
629
|
+
/**
|
|
630
|
+
* Defaults to {@link NugetRegistryInfo.DefaultTokenEnvVars}
|
|
631
|
+
* @see {@link NRIOptsBase.t.tokenEnvVars}
|
|
632
|
+
*/
|
|
571
633
|
tokenEnvVars: NRIOptsBase.get("tokenEnvVars").default(() => NugetRegistryInfo.DefaultTokenEnvVars),
|
|
634
|
+
/**
|
|
635
|
+
* A NuGet package registry's API endpoint URL -OR- the name assigned to it
|
|
636
|
+
* via your NuGet client.
|
|
637
|
+
* @default 'https://api.nuget.org/v3/index.json' (name: 'nuget.org')
|
|
638
|
+
* @see {@link NRIOptsBase.t.source}
|
|
639
|
+
*/
|
|
572
640
|
source: NRIOptsBase.get("source").default(() => defaultNugetSource)
|
|
573
641
|
});
|
|
574
642
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NugetRegistryInfo.mjs","names":["configDotenv"],"sources":["../../src/dotnet/NugetRegistryInfo.ts"],"sourcesContent":["/* JSDoc Types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { SemanticReleaseConfigDotnet as _srcd } from '../semanticReleaseConfigDotnet.ts';\nimport type { NugetProjectProperties } from './NugetProjectProperties.ts';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nimport { config as configDotenv } from '@dotenvx/dotenvx';\nimport { type, type Type } from 'arktype';\nimport { detectFile, detectFileSync } from 'chardet';\nimport { ok } from 'node:assert/strict';\nimport type { ExecException } from 'node:child_process';\nimport { existsSync, writeFileSync } from 'node:fs';\nimport { writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\n// eslint-disable-next-line unicorn/import-style\nimport * as node_path from 'node:path';\nimport { cwd, env } from 'node:process';\nimport { setTimeout } from 'node:timers/promises';\nimport { isError } from '../utils/isError.ts';\nimport sanitizeFileName from 'sanitize-filename';\nimport { getEnvVarValue } from '../utils/env.ts';\nimport { execAsync } from '../utils/execAsync.ts';\nimport { catchEBUSY, MSBuildEvaluationOutput, MSBuildProject } from './MSBuildProject.ts';\nimport type { Default } from 'arktype/internal/attributes.ts';\n\ntype TmpDirNamespace_Unix = `${ReturnType<typeof tmpdir>}/HCE.Shared/.NET/Dummies`;\ntype TmpDirNamespace_Win = `${ReturnType<typeof tmpdir>}\\\\HCE.Shared\\\\.NET\\\\Dummies`;\nconst tmpDirNamespace = node_path.join(tmpdir(), 'HCE.Shared', '.NET', 'Dummies') as TmpDirNamespace_Unix | TmpDirNamespace_Win;\nconst defaultNugetSource = 'https://api.nuget.org/v3/index.json';\nconst key_OutputPackItems = '_OutputPackItems';\n/**\n * Read the contents of $GITHUB_OUTPUT (if its value is a file path) or $TEMP/GITHUB_OUTPUT.\n * If the file doesn't exist, it is created.\n * @returns If successful, a promised object with a parsed key.\n */\nexport async function getGithubOutput(): Promise<ReturnType<typeof configDotenv>['parsed']> {\n if (env['GITHUB_OUTPUT'] === undefined || !existsSync(env['GITHUB_OUTPUT'])) {\n const githubOutputPath: string = node_path.join(tmpdir(), 'GITHUB_OUTPUT');\n if (!existsSync(githubOutputPath))\n await writeFile(githubOutputPath, '');\n env['GITHUB_OUTPUT'] = githubOutputPath;\n }\n\n const encoding = await detectFile(env['GITHUB_OUTPUT']);\n const envOutput = configDotenv({\n path: env['GITHUB_OUTPUT'],\n override: true,\n encoding: encoding ?? undefined,\n processEnv: {},\n });\n\n if (isError(envOutput.error))\n throw envOutput.error;\n return envOutput.parsed;\n}\n\n/**\n * Read the contents of $GITHUB_OUTPUT (if its value is a file path) or $TEMP/GITHUB_OUTPUT.\n * If the file doesn't exist, it is created.\n * @returns An object with a parsed key if successful.\n */\nexport function getGithubOutputSync(): NonNullable<ReturnType<typeof configDotenv>['parsed']> {\n if (env['GITHUB_OUTPUT'] === undefined || !existsSync(env['GITHUB_OUTPUT'])) {\n const githubOutputPath: string = node_path.join(tmpdir(), 'GITHUB_OUTPUT');\n if (!existsSync(githubOutputPath))\n writeFileSync(githubOutputPath, '');\n env['GITHUB_OUTPUT'] = githubOutputPath;\n }\n\n const encoding = detectFileSync(env['GITHUB_OUTPUT']);\n const envOutput = configDotenv({\n path: env['GITHUB_OUTPUT'],\n override: true,\n encoding: encoding ?? undefined,\n processEnv: {},\n }) as { error: Error }\n | { parsed: NonNullable<ReturnType<typeof configDotenv>['parsed']> };\n\n if ('error' in envOutput)\n throw envOutput.error;\n return envOutput.parsed;\n}\n\ntype DummiesDir<T> = T extends undefined\n ? `${TmpDirNamespace_Unix}/` | `${TmpDirNamespace_Win}\\\\`\n : T extends MSBuildProject\n ? `${TmpDirNamespace_Unix}/${T['Properties']['PackageId']}/` | `${TmpDirNamespace_Win}\\\\${T['Properties']['PackageId']}\\\\`\n : never;\n\nfunction getDummiesDir<T extends MSBuildProject | undefined = undefined>(project?: T): DummiesDir<T>;\nfunction getDummiesDir<T extends MSBuildProject>(project: T): DummiesDir<T>;\n/**\n * Get HCE.Shared's temporary directory for .NET projects' dummy packages.\n * @param project The MSBuild project whose PackageId will be used to create a\n * directory for its dummy packages.\n * @returns a platform-specific path like\n * `${tmpdir()}/HCE.Shared/.NET/Dummies/${project.Properties.PackageId}` if\n * {@link project} is defined. Else `${tmpdir()}/HCE.Shared/.NET/Dummies`\n */\nfunction getDummiesDir<T extends MSBuildProject | undefined = undefined>(project?: T): DummiesDir<typeof project> {\n switch (true) {\n case project === undefined: {\n return node_path.join(tmpDirNamespace, node_path.sep) as\n DummiesDir<typeof project> satisfies\n ReturnType<typeof getDummiesDir>;\n }\n case project instanceof MSBuildProject: {\n return node_path.join(tmpDirNamespace, project.Properties.PackageId, node_path.sep) as\n DummiesDir<typeof project> satisfies\n ReturnType<typeof getDummiesDir<MSBuildProject>>;\n }\n default: {\n throw new Error('The type of argument `project` must be `undefined` or `MSBuildProject`.');\n }\n }\n}\n\n/**\n * Get the environment variables as key-value pairs.\n * @param tokenEnvVars The name of the environment variables whose values are\n * NuGet API keys.\n * @returns an array of key-value pairs of the given environment variables and\n * their values, filtered to only those whose values are not undefined.\n * @throws {Error} when none of the provided environment variables are defined.\n */\nfunction _GetTokenEnvVariables(tokenEnvVars: readonly string[]): undefined | [readonly [string, string], ...readonly [string, string][]] {\n const definedTokens = Object.freeze(\n tokenEnvVars\n .map((key: string) => [key, getEnvVarValue(key)] as const)\n .filter((envVarTuple: readonly [string, string | undefined]): envVarTuple is [string, string] =>\n envVarTuple[1] !== undefined,\n ),\n );\n\n if (definedTokens.length > 0)\n return definedTokens as [readonly [string, string], ...readonly [string, string][]];\n return undefined;\n}\n\nexport class NugetRegistryInfo {\n private _canPushPackagesToSource: Promise<true> | undefined = undefined;\n private readonly _project: MSBuildProject;\n private readonly _resolvedEnvVariable: string | undefined;\n private readonly _source: string;\n\n public static readonly DefaultTokenEnvVars: readonly ['NUGET_TOKEN']\n = Object.freeze(['NUGET_TOKEN'] as const);\n\n /**\n * Convert a URL string to a filesystem folder name.\n *\n * Intended usage: modify the output path of `dotnet pack` based on the NuGet\n * Source the package should be pushed to. This is extra work is usually\n * unnecessary and you'd typically push the same file to multiple sources.\n * This is for the edge-case scenario of creating multiple nupkgs and signing\n * each one with a different certificate corresponding to a given NuGet\n * Source. This is only useful if the Sources have different certificates\n * registered for a given package/user/organization.\n * @param source The URL of the NuGet Source\n * @returns A string suitable for a local filesystem folder name, formatted as\n * `${hostname}_${pathname.replace('/', '_')}`.\n */\n static GetDirNameForSource(source: string): string {\n return sanitizeFileName(\n source.replaceAll(/\\/index.json$/g, ''),\n { replacement: '_' },\n );\n }\n\n /**\n * Creates an instance of NugetRegistryInfo.\\\n * This class enables the ability to push a given {@link project}'s\n * package(s) to the {@link source} of a given NuGet Source's API endpoint with\n * a user-defined API key. This API key, herein referred to as a \"token\", is\n * derived from the {@link tokenEnvVars} array. This array is iterated through\n * until one of the items is discovered to be an existing environment variable\n * (or is defined in a file named '.env' in the current working directory for\n * LOCAL TESTING ONLY! Do NOT `git add` your private keys!).\n * \\\n * WARNING:\n * - The token value is stored privately within this class, but it is plain text.\n * - This private key may be copied to command line strings stored in Semantic\n * Release's config object for later use by `@semantic-release/exec`.\n * - Other EcmaScript modules can access the environment variable(s) and steal\n * your key. Be aware of malicious dependencies!\n * @param opts The input type of {@link NRIOpts.from}\n * @param opts.project The project whose package(s) will be\n * pushed.\\\n * - Its {@link NugetProjectProperties#PackageId} will be read.\\\n * - Its {@link NugetProjectProperties#PackageVersion} will be overridden via CLI args when creating a dummy package. The real package's\n * `PackageVersion` will *not* be overridden.\n * @param [opts.tokenEnvVars] The environment variables\n * whose values are tokens with permission to push a package to the NuGet\n * package registry. The array is iterated through until one token is found.\n * If none of the environment variables are defined, this constructor will\n * throw an {@link Error}.\n * @param [opts.source] A NuGet package registry's API endpoint URL or name. Default: 'https://api.nuget.org/v3/index.json'\n */\n constructor(opts: typeof NRIOpts['inferIn']) {\n // note: you can reassign `opts` only when typeof `inferOut` is assignable\n // to typeof `inferIn`.\n const validOpts = NRIOpts.from(opts);\n this._project = validOpts.project;\n /**\n * May throw! Assign key of the first key-value pair to\n * {@link resolvedEnvVariable}\n */\n const tokenVars = _GetTokenEnvVariables(validOpts.tokenEnvVars);\n if (tokenVars)\n this._resolvedEnvVariable = tokenVars[0][0];\n this._source = validOpts.source;\n }\n\n public get project(): MSBuildProject {\n return this._project;\n }\n\n /**\n * This is not useful without it being executed as part of a Semantic Release\n * plugin. Deferring this to `@semantic-release/exec`'s prepareCmd is possible,\n * but impractical. You'd need to configure prepareCmd to invoke something\n * like `node customScriptFile.mjs`. It's not worth the hassle.\n * @returns `true` if the token can be used to push nupkg to the given Nuget registry\n * @throws {TypeError | Error | import('../utils/execAsync.js').ChildProcessSpawnException }\n * - {@link Error} | {@link module:utils/execAsync:ChildProcessSpawnException ChildProcessSpawnException}\n * - The token is invalid, of the wrong token type, or lacks permission to push packages\n * - The URL does not exist or a connection could not be established\n * - The command line string is malformed.\n * @deprecated Call during the `verifyConditions` step of Semantic Release! Additionally, {@link GetIsNextVersionAlreadyPublishedCommand}'s return value should be assigned to `prepareCmd` to prevent package version collision errors.\n */\n public get canPushPackagesToSource(): Promise<true> {\n if (this._canPushPackagesToSource !== undefined)\n return this._canPushPackagesToSource;\n\n let tokenValue: string | undefined;\n if (this.resolvedEnvVariable !== undefined)\n tokenValue = NRI._GetTokenValue(this.resolvedEnvVariable);\n\n if (tokenValue?.startsWith('github_pat_')) {\n const errMsg = `The value of the token in 'resolvedEnvVariable' ${String(this.resolvedEnvVariable)} begins with 'github_pat_', indicating it's a Fine-Grained token. At the time of writing, GitHub Fine-Grained tokens cannot push packages. If you believe this is statement is outdated, report the issue at https://github.com/halospv3/hce.shared/issues/new. For more information, see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.`;\n const err = new Error(errMsg);\n return this._canPushPackagesToSource = Promise.reject(err);\n }\n\n return this._canPushPackagesToSource = this.PackDummyPackage({})\n .then(async () => await this._PushDummyPackages({\n apiKey: tokenValue,\n }))\n .then<true>((execAsyncReturn) => {\n ok(execAsyncReturn);\n return true as const;\n });\n }\n\n /**\n * The first environment variable found to have a defined value. Set by\n * {@link _GetTokenEnvVariables} in the constructor.\n * @returns The first environment variable found to have a defined value.\n */\n get resolvedEnvVariable(): string | undefined {\n return this._resolvedEnvVariable;\n }\n\n get source(): string {\n return this._source;\n }\n\n /**\n * Get the API token from {@link NugetRegistryInfo#resolvedEnvVariable}\n * @param resolvedEnvVariable The name of the environment variable(s) whose\n * value is a NuGet API key. Typically, the value of\n * {@link NugetRegistryInfo#resolvedEnvVariable}.\n * @returns The value of the first defined environment variable.\n * @throws {Error} when none of the provided environment variables are defined.\n */\n private static _GetTokenValue(resolvedEnvVariable: string): string {\n type.string.assert(resolvedEnvVariable);\n\n const tokenValue = getEnvVarValue(resolvedEnvVariable);\n if (tokenValue === undefined) {\n throw new Error(`\\\nThe environment variable ${resolvedEnvVariable} was specified \\\nas the source of the token to push a NuGet package, \\\nbut the environment variable is empty or undefined.`);\n }\n return tokenValue;\n }\n\n // #region Pack\n\n /**\n * The type for options and arguments of `dotnet pack`. See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack.\n *\n * {@link NRI.PackPackagesOptionsType.t.propertyOverrides `propertyOverrides`}\n * is a wrapper for MSBuild's `-property:<n>=<v>` properties override arg.\n */\n static readonly PackPackagesOptionsType: Type<{\n propertyOverrides?: Record<string, string> | undefined;\n artifactsPath?: string | undefined;\n configuration?: 'Release' | 'Debug' | undefined;\n disableBuildServers?: boolean | undefined;\n force?: boolean | undefined;\n includeSource?: boolean | undefined;\n includeSymbols?: boolean | undefined;\n interactive?: boolean | undefined;\n noBuild?: boolean | undefined;\n noLogo?: boolean | undefined;\n noRestore?: boolean | undefined;\n output?: string | undefined;\n runtime?: string | undefined;\n serviceable?: boolean | undefined;\n terminalLogger?: 'auto' | 'on' | 'off' | undefined;\n useCurrentRuntime?: boolean | undefined;\n verbosity?: 'quiet' | 'minimal' | 'normal' | 'detailed' | 'diagnostic' | undefined;\n versionSuffix?: string | undefined;\n '-GetItem'?: readonly string[] | string[] | undefined;\n }> = Object.freeze(\n type({\n /**\n * a custom arg for handling MSBuild's `-property:<n>=<v>` argument for overriding MSBuild properties.\n */\n 'propertyOverrides?': type('Record<string,string>'),\n 'artifactsPath?': 'string',\n 'configuration?': '\"Release\" | \"Debug\"',\n 'disableBuildServers?': 'boolean',\n 'force?': 'boolean',\n 'includeSource?': 'boolean',\n 'includeSymbols?': 'boolean',\n 'interactive?': 'boolean',\n 'noBuild?': 'boolean',\n 'noLogo?': 'boolean',\n 'noRestore?': 'boolean',\n 'output?': 'string',\n 'runtime?': 'string',\n 'serviceable?': 'boolean',\n 'terminalLogger?': '\"auto\" | \"on\" | \"off\"',\n 'useCurrentRuntime?': 'boolean',\n 'verbosity?': '\"quiet\" | \"minimal\" | \"normal\" | \"detailed\" | \"diagnostic\"',\n 'versionSuffix?': 'string',\n /**\n * MSBuild evaluation option. Added to get the output Nupkgs' file paths.\n * @todo consider adding -GetProperty, -GetTarget\n */\n '-GetItem?': type.string.array().readonly().or('string[]'),\n }),\n );\n\n public static readonly PackDummyPackagesOptionsType: Type<{\n propertyOverrides?: Record<string, string> | undefined;\n artifactsPath?: string | undefined;\n configuration?: 'Release' | 'Debug' | undefined;\n disableBuildServers?: boolean | undefined;\n force?: boolean | undefined;\n includeSource?: boolean | undefined;\n includeSymbols?: boolean | undefined;\n interactive?: boolean | undefined;\n noBuild?: boolean | undefined;\n noLogo?: boolean | undefined;\n noRestore?: boolean | undefined;\n runtime?: string | undefined;\n serviceable?: boolean | undefined;\n terminalLogger?: 'auto' | 'on' | 'off' | undefined;\n useCurrentRuntime?: boolean | undefined;\n verbosity?: 'quiet' | 'minimal' | 'normal' | 'detailed' | 'diagnostic' | undefined;\n versionSuffix?: string | undefined;\n '-GetItem'?: readonly string[] | string[] | undefined;\n }>\n = this.PackPackagesOptionsType.omit('output');\n\n /**\n * Get a `dotnet pack` command line string, outputting the package(s) to a\n * path determined by this method's parameters.\n * When pushing the package(s), you only need to supply the main .nupkg's path\n * or its directory to the dotnet CLI—by default, it will also push the\n * symbols package, if present.\n * @param opts Options passed to\n * `dotnet pack`, excluding the required `<PROJECT | SOLUTION>` argument. The\n * {@link PackPackagesOptionsType.t.output} path is modified according to the\n * {@link usePerSourceSubfolder} and {@link usePerPackageIdSubfolder}\n * arguments.\n * @param usePerSourceSubfolder If true, the path of the package output will\n * include a subfolder named after the NuGet Source.\n * @param usePerPackageIdSubfolder If true, the path of the package output\n * will include a subfolder named after the NuGet package's ID.\n * @returns `dotnet pack \"${this.project.Properties.MSBuildProjectFullPath}\"\n * -o \"${outDir}\"` where outDir may be `${cwd()}/publish/${NugetRegistryInfo.GetNameForURL(this.source)}/${this._project.Properties.PackageId}`\n */\n GetPackCommand(\n opts: typeof NRI.PackPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ): string {\n const validOpts = NRI.PackPackagesOptionsType.from(opts);\n type.boolean.assert(usePerSourceSubfolder);\n type.boolean.assert(usePerPackageIdSubfolder);\n\n validOpts.output ??= node_path.join(cwd(), 'publish');\n if (usePerSourceSubfolder)\n validOpts.output = node_path.join(validOpts.output, NugetRegistryInfo.GetDirNameForSource(this.source), node_path.sep);\n if (usePerPackageIdSubfolder)\n validOpts.output = node_path.join(validOpts.output, this._project.Properties.PackageId, node_path.sep);\n\n const packCmdArr: string[] = [\n 'dotnet',\n 'pack',\n `\"${this._project.Properties.MSBuildProjectFullPath}\"`,\n ];\n if (validOpts.artifactsPath !== undefined)\n packCmdArr.push('--artifactsPath', `\"${validOpts.artifactsPath}\"`);\n if (validOpts.configuration !== undefined)\n packCmdArr.push('--configuration', validOpts.configuration);\n if (validOpts.disableBuildServers === true)\n packCmdArr.push('--disable-build-servers');\n if (validOpts.force === true) packCmdArr.push('--force');\n if (validOpts.includeSource === true) packCmdArr.push('--include-source');\n if (validOpts.includeSymbols === true) packCmdArr.push('--include-symbols');\n if (validOpts.interactive === true) packCmdArr.push('--interactive');\n if (validOpts.noBuild === true) packCmdArr.push('--no-build');\n if (validOpts.noLogo === true) packCmdArr.push('--nologo');\n if (validOpts.noRestore === true) packCmdArr.push('--no-restore');\n if (validOpts.runtime !== undefined)\n packCmdArr.push('--runtime', validOpts.runtime);\n if (validOpts.serviceable === true) packCmdArr.push('--serviceable');\n if (validOpts.terminalLogger !== undefined)\n packCmdArr.push('--tl', validOpts.terminalLogger);\n if (validOpts.useCurrentRuntime === true)\n packCmdArr.push('--use-current-runtime');\n if (validOpts.verbosity !== undefined)\n packCmdArr.push('--verbosity', validOpts.verbosity);\n if (validOpts.versionSuffix !== undefined)\n packCmdArr.push('--version-suffix', validOpts.versionSuffix);\n /**\n * Haphazard. I need to override the Version and I'm not considering side\n * effects of arbitrary overrides.\n */\n if (validOpts.propertyOverrides) {\n /** convert propertyOverrides record to \"-p:n0=v0;n1=v1;n2=v2\" et cetera */\n const assignments: string = '-p:' + Object.entries(validOpts.propertyOverrides)\n .map(v => `${v[0]}=${v[1]}`).join(';');\n packCmdArr.push(`\"${assignments}\"`);\n }\n if (validOpts['-GetItem'] && validOpts['-GetItem'].length > 0) {\n // -GetItem:_OutputPackItems,MyCustomItem\n packCmdArr.push(`-GetItem:${validOpts['-GetItem'].join(',')}`);\n }\n // MSBuild parses everything after -o as the path.\n packCmdArr.push('-o', `\"${validOpts.output}\"`);\n\n return packCmdArr.join(' ');\n }\n\n /**\n * !Not ready for use! Remove private modifier and commit as `feat(dotnet)` when ready for release!\n * Blocking Issue: convert all dotnet-related functionality to a Semantic Release plugin!\n * The current {@link _srcd SemanticReleaseConfigDotnet} leverages\n * `@semantic-release/exec` to invoke dotnet commands. This is fine for\n * relatively short command lines, but chaining commands with ' && ' results\n * in quickly-growing complexity.\n * NuGet packages should be created during the `prepare` step, but complex\n * configuration of `dotnet pack` via command lines intended to be invoked by\n * `@semantic-release/exec` is impractical.\n * @param opts `dotnet pack` options. See `dotnet pack -h`,\n * https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack, and\n * {@link PackPackagesOptionsType}.\n * {@link opts['-GetItem']} will _always_ have '_OutputPackItems'.\n * @param [usePerSourceSubfolder] If `true`, modify the output path to\n * include a subfolder bearing a path-safe encoding of the NuGet Source that\n * will receive the nupkg.\n * @param [usePerPackageIdSubfolder] If `true`, modify the output path\n * to include a subfolder named after the the PackageId.\n * @returns a string[] containing the full file paths of all new packages i.e.\n * .nupkg, .symbols.nupkg, .snupkg\n */\n // @ts-expect-error Todo: publicize to dismiss this \"unused\" error.\n private async _PackPackages(\n opts: typeof NRI.PackPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ): Promise<string[]> {\n opts['-GetItem'] = [...opts['-GetItem'] ?? [], key_OutputPackItems];\n\n const packCmd = this.GetPackCommand(\n opts,\n usePerSourceSubfolder,\n usePerPackageIdSubfolder,\n );\n let packOutput: undefined | { stdout: string; stderr: string } = undefined;\n while (packOutput === undefined) {\n packOutput = await setTimeout(\n 1000,\n execAsync(packCmd, true),\n )\n .then(async p => await p)\n .catch<undefined>(catchEBUSY);\n }\n // may include .snupkg\n const nupkgFullPaths: string[] | undefined = new MSBuildEvaluationOutput(packOutput.stdout)\n .Items\n ?.[key_OutputPackItems]\n ?.filter(item => item.Extension !== '.nuspec')\n .map(item => item.FullPath);\n return nupkgFullPaths ?? [];\n }\n\n /**\n * Create a dummy package for the current {@link project} by executing a\n * command line like \\``dotnet pack ${this.project.Properties.MSBuildProjectFullPath} -p:Version=0.0.1-DUMMY -output ${getDummiesDir(this._project)}/${GetNameForURL(this.source)}`\\`\n * @param opts Options passed to\n * `dotnet pack`, excluding the required `<PROJECT | SOLUTION>` argument.\n * - The `output` field is ignored and overwritten. It is replaced with\n * ${{@link getDummiesDir}({@link project})}/${{@link GetDirNameForSource}({@link source})}\n * - The `output` path will be affixed with a folder named after this\n * {@link NugetRegistryInfo#source}, but will not include a subfolder for the\n * {@link NugetRegistryInfo#project NugetRegistryInfo.project}.{@link MSBuildProject#Properties Properties}.{@link MSBuildProject#Properties#PackageId PackageId}.\n * @returns the full paths of all nupkg, symbols.nupkg, and snupkg files\n * created by the Pack target, as extracted from the dotnet process's STDOUT.\n * If mixed with other nupkgs, filter for the {@link NugetProjectProperties#PackageId}\n */\n public async PackDummyPackage(\n opts: typeof NRI.PackDummyPackagesOptionsType.inferIn,\n ): Promise<string[]> {\n const packCmd: string = this.GetPackCommand(\n {\n ...opts,\n output: getDummiesDir(this._project),\n propertyOverrides: { ...opts.propertyOverrides, Version: '0.0.1-DUMMY', UpdateVersionProperties: 'false' },\n '-GetItem': [...opts['-GetItem'] ?? [], key_OutputPackItems],\n },\n true,\n );\n\n let packOutput: undefined | { stdout: string; stderr: string } = undefined;\n while (packOutput === undefined) {\n packOutput = await setTimeout(\n 1000,\n execAsync(packCmd, true),\n )\n .then(async p => await p)\n .catch<undefined>(catchEBUSY);\n }\n // may include .snupkg\n const nupkgFullPaths: string[] | undefined = new MSBuildEvaluationOutput(packOutput.stdout)\n .Items\n ?.[key_OutputPackItems]\n ?.filter(item => item.Extension !== '.nuspec')\n .map(item => item.FullPath);\n return nupkgFullPaths ?? [];\n }\n\n // #endregion Pack\n // #region Push\n\n /**\n * Also includes required argument 'ROOT': the directory in which packages\n * should be present and ready to be pushed the default or specified Source.\n * The ROOT may also include wildcards e.g. `*.nupkg`, `**\\\\*.nupkg`\n * See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push\n *\n * Specific to this API:\n * If you want to use this API's default root value (\\`${cwd()}/publish`), assign an empty string.\n */\n static readonly PushPackagesOptionsType: Type<{\n root: string;\n apiKey?: string | undefined;\n configFile?: string | undefined;\n disableBuffering?: boolean | undefined;\n forceEnglishOutput?: boolean | undefined;\n interactive?: boolean | undefined;\n noServiceEndpoint?: boolean | undefined;\n noSymbols?: boolean | undefined;\n skipDuplicate?: boolean | undefined;\n source?: string | undefined;\n symbolApiKey?: string | undefined;\n symbolSource?: string | undefined;\n timeout?: number | undefined;\n }> = Object.freeze(\n type({\n /** If an empty string is passed, this property is overridden to `./publish` */\n root: 'string',\n /** The API key for the server. NOTE: if `undefined` or an empty string, the `dotnet nuget` client will lookup credentials set via `dotnet nuget {add|update} source`. */\n 'apiKey?': 'string',\n /** The NuGet configuration file (nuget.config) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see {@link https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior Common NuGet Configurations}. */\n 'configFile?': 'string',\n /** Disables buffering when pushing to an HTTP(S) server to reduce memory usage. */\n 'disableBuffering?': 'boolean',\n /** Forces the application to run using an invariant, English-based culture. */\n 'forceEnglishOutput?': 'boolean',\n /** Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK. */\n 'interactive?': 'boolean',\n /** Doesn't append \"api/v2/package\" to the source URL. */\n 'noServiceEndpoint?': 'boolean',\n 'noSymbols?': 'boolean',\n /** When pushing multiple packages to an HTTP(S) server, treats any 409 Conflict response as a warning so that other pushes can continue. */\n 'skipDuplicate?': 'boolean',\n /**\n * Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP.\n *\n * ### Important\n * > Starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet config file specifies a `DefaultPushSource` value. For more information, see {@link https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior Configuring NuGet behavior}.\n */\n 'source?': 'string',\n /** The API key for the symbol server. NOTE: if `undefined`, the `dotnet nuget` client will lookup credentials set via `dotnet nuget {add|update} source`.` */\n 'symbolApiKey?': 'string',\n /** Specifies the symbol server URL. */\n 'symbolSource?': 'string',\n /** Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes). Specifying 0 applies the default value. */\n 'timeout?': 'number',\n }),\n );\n\n /**\n * {@link NRI.PushPackagesOptionsType} sans {@link NRI.PushPackagesOptionsType.t.root}.\n * The result of {@link getDummiesDir} is used, instead.\n */\n public static readonly PushDummyPackagesOptionsType: Type<{\n apiKey?: string | undefined;\n configFile?: string | undefined;\n disableBuffering?: boolean | undefined;\n forceEnglishOutput?: boolean | undefined;\n interactive?: boolean | undefined;\n noServiceEndpoint?: boolean | undefined;\n noSymbols?: boolean | undefined;\n source?: string | undefined;\n symbolApiKey?: string | undefined;\n symbolSource?: string | undefined;\n timeout?: number | undefined;\n skipDuplicate: Default<true, true>;\n }>\n = NugetRegistryInfo.PushPackagesOptionsType.merge({\n skipDuplicate: 'true = true',\n }).omit('root');\n\n /**\n * Create a `dotnet nuget push` command line from the given options and\n * optional boolean parameters.\n * @param opts See {@link PushPackagesOptionsType}\n * @param usePerSourceSubfolder If `true`, the NuGet Source name or URL is formatted\n * to a folder name and appended to the ROOT as a subfolder. Do not use\n * wildcards in ROOT with this set to `true`!\n * @param usePerPackageIdSubfolder If `true`, the\n * {@link project}'s {@link NugetProjectProperties#PackageId}\n * is appended to the ROOT as a subfolder. Do not use wildcards in\n * ROOT with this set to `true`!\n * @returns A `dotnet nuget push` command line formatted with the\n * appropriate arguments.\n */\n GetPushCommand(\n opts: typeof NRI.PushPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ): string {\n const validOpts = NRI.PushPackagesOptionsType.from(opts);\n type.boolean.assert(usePerSourceSubfolder);\n type.boolean.assert(usePerPackageIdSubfolder);\n\n validOpts.root = validOpts.root === '' ? `${cwd()}/publish` : validOpts.root;\n if (usePerSourceSubfolder)\n validOpts.root = node_path.join(validOpts.root, NugetRegistryInfo.GetDirNameForSource(this.source), node_path.sep);\n if (usePerPackageIdSubfolder)\n validOpts.root = node_path.join(validOpts.root, this._project.Properties.PackageId, node_path.sep);\n\n const packCmdArr: string[] = [\n 'dotnet',\n 'nuget',\n 'push',\n `\"${node_path.join(validOpts.root, '*.nupkg')}\"`,\n ];\n\n if (this.resolvedEnvVariable)\n validOpts.apiKey ??= NRI._GetTokenValue(this.resolvedEnvVariable);\n /**\n * If apiKey is an empty string, defer to the dotnet CLI's NuGet client\n * ability to lookup API keys saved via `dotnet nuget add source` or NuGet config\n * files.\n */\n if (validOpts.apiKey && validOpts.apiKey !== '')\n packCmdArr.push('--api-key', validOpts.apiKey);\n if (validOpts.configFile)\n packCmdArr.push('--configfile', validOpts.configFile);\n if (validOpts.disableBuffering === true)\n packCmdArr.push('--disable-buffering');\n if (validOpts.forceEnglishOutput === true)\n packCmdArr.push('--force-english-output');\n if (validOpts.interactive === true)\n packCmdArr.push('--interactive');\n if (validOpts.noServiceEndpoint === true)\n packCmdArr.push('--no-service-endpoint');\n if (validOpts.noSymbols === true)\n packCmdArr.push('--no-symbols');\n if (validOpts.skipDuplicate === true)\n packCmdArr.push('--skip-duplicate');\n validOpts.source ??= this.source;\n packCmdArr.push('--source', validOpts.source);\n if (validOpts.symbolApiKey !== undefined)\n packCmdArr.push('--symbol-api-key', validOpts.symbolApiKey);\n if (validOpts.symbolSource !== undefined)\n packCmdArr.push('--symbol-source', validOpts.symbolSource);\n if (validOpts.timeout !== undefined)\n packCmdArr.push('--timeout', validOpts.timeout.toString());\n\n return packCmdArr.join(' ');\n }\n\n /**\n * Immediately push packages. The input path may be modified according to the\n * {@link usePerSourceSubfolder} and {@link usePerPackageIdSubfolder}\n * arguments.\n * @param opts The `dotnet nuget push` command line options, including the\n * ROOT argument, the directory containing local nuget packages ready to be\n * pushed.\n * @param usePerSourceSubfolder If `true`, the NuGet Source name or URL is formatted\n * to a folder name and appended to the ROOT as a subfolder. Do not use\n * wildcards in ROOT with this set to `true`!\n * @param usePerPackageIdSubfolder If `true`, the current {@link project}'s\n * PackageId is appended to the ROOT as a subfolder. Do not use wildcards in\n * ROOT with this set to `true`!\n */\n // @ts-expect-error Todo: publicize to dismiss this \"unused\" error.\n private async _PushPackages(\n opts: typeof NRI.PushPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ) {\n // const pushOutput =\n await execAsync(\n this.GetPushCommand(\n opts,\n usePerSourceSubfolder,\n usePerPackageIdSubfolder,\n ),\n true,\n ).catch((error: unknown) => {\n const _error: Error = isError(error) ? error : new Error(JSON.stringify(error));\n throw opts.apiKey\n ? _censorTokenInError(_error, opts.apiKey)\n : _error;\n });\n }\n\n /**\n *\n * Get a `dotnet nuget push` command for pushing one or more nupkg/snupkg\n * files created by {@link GetPackCommand} or {@link _PackPackages}.\\\n * Like {@link PackDummyPackage}, the output/ROOT path will include a\n * folder named after this NRI instance's {@link NugetRegistryInfo#source},\n * but will not include a subfolder for the\n * {@link NugetRegistryInfo#project NugetRegistryInfo.project}.{@link MSBuildProject#Properties Properties}.{@link MSBuildProject#Properties#PackageId PackageId}\n * @example\n * ```ts\n * const packAndPushDummyCmd = [\n * nri.GetPackCommand(\n * NugetRegistryInfo.PackPackagesOptionsType.from({ root: '' }),\n * false,\n * false,\n * ),\n * nri.GetPushDummyPackageCommand(pushOpts, false, false),\n * ].join(' && ')\n * ```\n * @param opts options for `dotnet nuget push`. The following\n * fields are overwritten:\n * - root: getDummiesDir(this.project)\n * - skipDuplicates: true\n * @returns a `dotnet nuget push` command to push a dummy package\n * (created by executing {@link PackDummyPackage}) to {@link source}\n */\n GetPushDummyCommand(\n opts: typeof NRI.PushDummyPackagesOptionsType.inferIn,\n ): string {\n return this.GetPushCommand(\n {\n ...NRI.PushDummyPackagesOptionsType.from(opts),\n root: getDummiesDir(this._project),\n },\n true,\n );\n }\n\n /**\n * Call {@link GetPushDummyCommand} and immediately execute it.\n * @throws {Error} when the process exits with an error code indicating\n * failure i.e. the command line is invalid, the process fails to start,\n * the push fails, et cetera.\n * @param opts the ROOT arg and options for `dotnet nuget push`. The following\n * fields are overwritten:\n * - root: getDummiesDir(this.project)\n * - skipDuplicates: true\n * @returns The return type of {@link execAsync} i.e. a {@link Promise} resolving to `{ stdout: string; stderr: string }`.\n */\n private async _PushDummyPackages(\n opts: typeof NRI.PushDummyPackagesOptionsType.inferIn,\n ): ReturnType<typeof execAsync> {\n const pushCmd: string = this.GetPushDummyCommand(opts);\n return await execAsync(pushCmd, true)\n .catch((error: unknown) => {\n const _error: Error = isError(error) ? error : new Error(String(error));\n throw opts.apiKey\n ? _censorTokenInError(_error, opts.apiKey)\n : _error;\n });\n }\n\n // #endregion Push\n\n // if non-exact-match is needed, learn how to make a parameter-driven type.\n private static readonly _NugetSearchReturnTypes = {\n ExactMatch: {\n v2: type({\n version: '2',\n problems: 'unknown[]',\n searchResult: [\n {\n sourceName: 'string',\n packages: type({\n id: 'string',\n version: type.keywords.string.semver,\n }).array(),\n },\n ],\n }),\n },\n };\n\n private static readonly _ParseNugetSearchReturn = type(\n 'string.json.parse',\n ).to(this._NugetSearchReturnTypes.ExactMatch.v2);\n\n /**\n * !WARNING: this method requires the Nuget Source to be configured via `dotnet nuget add source` or `dotnet nuget update source`. `NUGET_TOKEN` works, but it may be vulnerable to supply chain attacks.\\\n * Call during the `prepare` step of a Semantic Release run.\\\n * Determine if the `nextVersion` generated during the `analyze` Semantic\n * Release step was already published to the NuGet {@link source}.\n * @param source The name or URI of the NuGet Source to search. If this API\n * endpoint does not support searches, the operation will fail. If this API\n * endpoint requires authentication (e.g. GitHub), it must be configured via\n * `dotnet nuget add source` or `dotnet nuget update source` before calling\n * this method.\n * @param packageId The ID of the NuGet package to search for.\n * @param nextVersion The nextVersion value generated by semantic-release's hidden [\"Create Git tag\" step](https://semantic-release.gitbook.io/semantic-release#:~:text=the%20last%20release.-,Create%20Git%20tag,-Create%20a%20Git).\n * @returns A promised boolean.\n * If the promise resolves to `true`, the semantic release run should be\n * cancelled immediately.\n * Otherwise, the release should proceed.\n * @todo utilize in custom plugin inserted at the beginning of `prepare`\n */\n static async IsNextVersionAlreadyPublished(\n source: string,\n packageId: string,\n nextVersion: string,\n ): Promise<boolean> {\n if (nextVersion === '')\n throw new Error('The value of nextVersion is empty');\n return await execAsync(\n `dotnet package search --format JSON --exact-match --source ${source} --prerelease ${packageId}`,\n true,\n )\n .then(stdPair => stdPair.stdout)\n .then(json => this._ParseNugetSearchReturn(json))\n .then(errsOrObj => errsOrObj instanceof type.errors ? errsOrObj.throw() : errsOrObj)\n .then(obj => obj.searchResult)\n .then(results => results[0].packages)\n .then(pkgs =>\n pkgs.find(p => p.version === type('string.semver').from(nextVersion)),\n )\n .then(pkg => pkg !== undefined);\n }\n\n /**\n * !WARNING: GITHUB_OUTPUT must be the full path to an environment file.\n * The plugin \"semantic-release-output-variables\" next-release-version\n *\n * !WARNING: NuGet Source API Key mus tbe configured via `dotnet nuget add source` or `dotnet nuget update source`.\n * Some Sources (e.g. GitHub) require authentication for package searches.\n *\n * # Authenticating NuGet Package Searches\n *\n * ## GitHub NuGet Registry authentication\n * - {@link https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#authenticating-in-a-github-actions-workflow Authenticating in a GitHub Actions workflow}\n * - {@link https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#authenticating-with-a-personal-access-token Authenticating with a personal access token}.\n * ## For GitLab NuGet Registry authentication, see\n * - {@link https://docs.gitlab.com/ee/user/packages/nuget_repository/#add-a-source-with-the-net-cli Add a source with the .NET CLI}\n * @returns a string containing a Node.JS command line invoking {@link ./IsNextVersionAlreadyPublished.cli.ts}\n * @see {@link ./IsNextVersionAlreadyPublished.cli.ts}, {@link ./IsNextVersionAlreadyPublished.cli.js}\n */\n GetIsNextVersionAlreadyPublishedCommand(): string {\n // if GITHUB_OUTPUT unset or its file does not exist, create it. ''\n getGithubOutputSync();\n // The script will run\n return `node ${node_path.join(import.meta.dirname, './IsNextVersionAlreadyPublished.cli.js')} --packageId ${this._project.Properties.PackageId} --source ${this.source}`;\n }\n\n /*\n * Copy https://github.com/joelharkes/nuget-push when we split off our dotnet\n * modules to a semantic-release plugin.\n */\n\n /*\n * If you want a deterministic nupkg, do so with a custom MSBuild target with\n * AfterTargets=\"Pack\" to restore and execute the dotnet tool \"Kuinox.NupkgDeterministicator\" .\n */\n}\n\n// shorthand/alias for NugetRegistryInfo\nconst NRI: typeof NugetRegistryInfo = NugetRegistryInfo;\n\n/**\n * The base type for {@link NRIOpts} and related types. Extend this type while\n * overriding member types via {@link NRIOptsBase.merge}\n */\nexport const NRIOptsBase: Type<{\n project: MSBuildProject | {\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n };\n source: string;\n tokenEnvVars: readonly string[];\n}> = type({\n /**\n * The environment variables whose values are tokens with permission to push a\n * package to the NuGet package registry. The array is iterated through until\n * one token is found. If none of the environment variables are defined,\n * {@link NugetRegistryInfo}'s constructor will throw an {@link Error}.\n */\n project: type\n .instanceOf(MSBuildProject)\n .or(type.instanceOf(MSBuildProject).readonly()),\n /**\n * A NuGet package registry's API endpoint URL -OR- the name assigned via the\n * client e.g. `dotnet nuget add source --name ${source} ${source's URL}`\n */\n source: type.string,\n /**\n * WARNING: If possible, set credentials via `dotnet nuget {add|update}\n * source` as recommended by Microsoft! This is more secure than exposing\n * credentials to the Node.JS runtime and all its loaded modules.\n *\n * The environment variables whose values are tokens with permission to push a\n * package to the NuGet package registry.The array is iterated through until\n * one token is found.If none of the environment variables are defined,\n * {@link NugetRegistryInfo}'s constructor will throw an {@link Error}.\n *\n * If none of these are defined in the `.env` or process environment variables (.vault.env is impractical in CI), the `--api-key/-k` argument is excluded from `dotnet nuget push` commands.\n * Instead, the NuGet client relies on credentials configured for the\n * given NuGet source. If the NuGet client does not find credentials saved for the\n * NuGet {@link NRIOptsBase.t.source source} and they are required, the command will fail.\n *\n * Use the `dotnet` CLI to configure credentials for existing NuGet sources\n * ({@link https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-update-source `dotnet nuget update source`})\n * -OR- configure credentials for non-default NuGet sources\n * ({@link https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source `dotnet nuget add source`}).\\\n * Alternatively, use the `nuget.exe` CLI to add/update sources. See\n * {@link https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-sources `nuget sources` (NuGet CLI)}.\n *\n * The credentials will be validated during the `verifyConditions` step of Semantic Release.\n */\n tokenEnvVars: type.string.array().readonly(),\n});\n\n/**\n * The type of the parameter for {@link NugetRegistryInfo}'s constructor.\n */\nexport const NRIOpts: Type<{\n project: MSBuildProject | {\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n };\n tokenEnvVars: Default<readonly string[], readonly ['NUGET_TOKEN']>;\n source: Default<string, string>;\n}> = NRIOptsBase.merge({\n /**\n * Defaults to {@link NugetRegistryInfo.DefaultTokenEnvVars}\n * @see {@link NRIOptsBase.t.tokenEnvVars}\n */\n tokenEnvVars: NRIOptsBase.get('tokenEnvVars').default(\n () => NugetRegistryInfo.DefaultTokenEnvVars,\n ),\n /**\n * A NuGet package registry's API endpoint URL -OR- the name assigned to it\n * via your NuGet client.\n * @default 'https://api.nuget.org/v3/index.json' (name: 'nuget.org')\n * @see {@link NRIOptsBase.t.source}\n */\n source: NRIOptsBase.get('source').default(() => defaultNugetSource),\n});\n\n// #region token censorship\n\n/**\n * Replace all occurrences of {@link token} in the {@link string} with '***'.\n * @param string The string in which a {@link token} may be found.\n * @param token The NuGet API token you definitely don't want to leak!\n * @returns A modified copy of the {@link string} with all occurrences of the\n * {@link token} replaced with '***'.\n */\nfunction _censorToken(string: string, token: string): string {\n return string.replaceAll(token, '***');\n}\n\n/**\n * Censor all occurrences of an API {@link token} in an {@link error}.\n * @param error A {@link ExecException} in which the NuGet API {@link token} may be found.\n * @param token The value of the NuGet API token\n * @returns A modified copy of the provided exception sans any occurrence of the\n * NuGet API token.\n */\nfunction _censorTokenInError(error: ExecException, token: string): ExecException {\n return Object.assign(\n error,\n JSON.parse(\n _censorToken(\n JSON.stringify({\n ...error,\n message: error.message,\n stack: error.stack,\n }),\n token,\n ),\n ) as ExecException,\n );\n}\n\n// #endregion token censorship\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAM,kBAAkB,UAAU,KAAK,QAAQ,EAAE,cAAc,QAAQ,UAAU;AACjF,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;;;;;;AAM5B,eAAsB,kBAAsE;AAC1F,KAAI,IAAI,qBAAqB,KAAA,KAAa,CAAC,WAAW,IAAI,iBAAiB,EAAE;EAC3E,MAAM,mBAA2B,UAAU,KAAK,QAAQ,EAAE,gBAAgB;AAC1E,MAAI,CAAC,WAAW,iBAAiB,CAC/B,OAAM,UAAU,kBAAkB,GAAG;AACvC,MAAI,mBAAmB;;CAGzB,MAAM,WAAW,MAAM,WAAW,IAAI,iBAAiB;CACvD,MAAM,YAAYA,OAAa;EAC7B,MAAM,IAAI;EACV,UAAU;EACV,UAAU,YAAY,KAAA;EACtB,YAAY,EAAE;EACf,CAAC;AAEF,KAAI,QAAQ,UAAU,MAAM,CAC1B,OAAM,UAAU;AAClB,QAAO,UAAU;;;;;;;AAQnB,SAAgB,sBAA8E;AAC5F,KAAI,IAAI,qBAAqB,KAAA,KAAa,CAAC,WAAW,IAAI,iBAAiB,EAAE;EAC3E,MAAM,mBAA2B,UAAU,KAAK,QAAQ,EAAE,gBAAgB;AAC1E,MAAI,CAAC,WAAW,iBAAiB,CAC/B,eAAc,kBAAkB,GAAG;AACrC,MAAI,mBAAmB;;CAGzB,MAAM,WAAW,eAAe,IAAI,iBAAiB;CACrD,MAAM,YAAYA,OAAa;EAC7B,MAAM,IAAI;EACV,UAAU;EACV,UAAU,YAAY,KAAA;EACtB,YAAY,EAAE;EACf,CAAC;AAGF,KAAI,W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KAAK,OAAO,OAAO,CAAC,UAAU;CAC7C,CAAC;;;;AAKF,MAAa,UASR,YAAY,MAAM;CAKrB,cAAc,YAAY,IAAI,eAAe,CAAC,cACtC,kBAAkB,oBACzB;CAOD,QAAQ,YAAY,IAAI,SAAS,CAAC,cAAc,mBAAmB;CACpE,CAAC;;;;;;;;AAWF,SAAS,aAAa,QAAgB,OAAuB;AAC3D,QAAO,OAAO,WAAW,OAAO,MAAM;;;;;;;;;AAUxC,SAAS,oBAAoB,OAAsB,OAA8B;AAC/E,QAAO,OAAO,OACZ,OACA,KAAK,MACH,aACE,KAAK,UAAU;EACb,GAAG;EACH,SAAS,MAAM;EACf,OAAO,MAAM;EACd,CAAC,EACF,MACD,CACF,CACF"}
|
|
1
|
+
{"version":3,"file":"NugetRegistryInfo.mjs","names":["configDotenv"],"sources":["../../src/dotnet/NugetRegistryInfo.ts"],"sourcesContent":["/* JSDoc Types */\n/* eslint-disable @typescript-eslint/no-unused-vars */\nimport type { SemanticReleaseConfigDotnet as _srcd } from '../semanticReleaseConfigDotnet.ts';\nimport type { NugetProjectProperties } from './NugetProjectProperties.ts';\n/* eslint-enable @typescript-eslint/no-unused-vars */\n\nimport { config as configDotenv } from '@dotenvx/dotenvx';\nimport { type, type Type } from 'arktype';\nimport { detectFile, detectFileSync } from 'chardet';\nimport { ok } from 'node:assert/strict';\nimport type { ExecException } from 'node:child_process';\nimport { existsSync, writeFileSync } from 'node:fs';\nimport { writeFile } from 'node:fs/promises';\nimport { tmpdir } from 'node:os';\n// eslint-disable-next-line unicorn/import-style\nimport * as node_path from 'node:path';\nimport { cwd, env } from 'node:process';\nimport { setTimeout } from 'node:timers/promises';\nimport { isError } from '../utils/isError.ts';\nimport sanitizeFileName from 'sanitize-filename';\nimport { getEnvVarValue } from '../utils/env.ts';\nimport { execAsync } from '../utils/execAsync.ts';\nimport { catchEBUSY, MSBuildEvaluationOutput, MSBuildProject } from './MSBuildProject.ts';\nimport type { Default } from 'arktype/internal/attributes.ts';\n\ntype TmpDirNamespace_Unix = `${ReturnType<typeof tmpdir>}/HCE.Shared/.NET/Dummies`;\ntype TmpDirNamespace_Win = `${ReturnType<typeof tmpdir>}\\\\HCE.Shared\\\\.NET\\\\Dummies`;\nconst tmpDirNamespace = node_path.join(tmpdir(), 'HCE.Shared', '.NET', 'Dummies') as TmpDirNamespace_Unix | TmpDirNamespace_Win;\nconst defaultNugetSource = 'https://api.nuget.org/v3/index.json';\nconst key_OutputPackItems = '_OutputPackItems';\n/**\n * Read the contents of $GITHUB_OUTPUT (if its value is a file path) or $TEMP/GITHUB_OUTPUT.\n * If the file doesn't exist, it is created.\n * @returns If successful, a promised object with a parsed key.\n */\nexport async function getGithubOutput(): Promise<ReturnType<typeof configDotenv>['parsed']> {\n if (env['GITHUB_OUTPUT'] === undefined || !existsSync(env['GITHUB_OUTPUT'])) {\n const githubOutputPath: string = node_path.join(tmpdir(), 'GITHUB_OUTPUT');\n if (!existsSync(githubOutputPath))\n await writeFile(githubOutputPath, '');\n env['GITHUB_OUTPUT'] = githubOutputPath;\n }\n\n const encoding = await detectFile(env['GITHUB_OUTPUT']);\n const envOutput = configDotenv({\n path: env['GITHUB_OUTPUT'],\n override: true,\n encoding: encoding ?? undefined,\n processEnv: {},\n });\n\n if (isError(envOutput.error))\n throw envOutput.error;\n return envOutput.parsed;\n}\n\n/**\n * Read the contents of $GITHUB_OUTPUT (if its value is a file path) or $TEMP/GITHUB_OUTPUT.\n * If the file doesn't exist, it is created.\n * @returns An object with a parsed key if successful.\n */\nexport function getGithubOutputSync(): NonNullable<ReturnType<typeof configDotenv>['parsed']> {\n if (env['GITHUB_OUTPUT'] === undefined || !existsSync(env['GITHUB_OUTPUT'])) {\n const githubOutputPath: string = node_path.join(tmpdir(), 'GITHUB_OUTPUT');\n if (!existsSync(githubOutputPath))\n writeFileSync(githubOutputPath, '');\n env['GITHUB_OUTPUT'] = githubOutputPath;\n }\n\n const encoding = detectFileSync(env['GITHUB_OUTPUT']);\n const envOutput = configDotenv({\n path: env['GITHUB_OUTPUT'],\n override: true,\n encoding: encoding ?? undefined,\n processEnv: {},\n }) as { error: Error }\n | { parsed: NonNullable<ReturnType<typeof configDotenv>['parsed']> };\n\n if ('error' in envOutput)\n throw envOutput.error;\n return envOutput.parsed;\n}\n\ntype DummiesDir<T> = T extends undefined\n ? `${TmpDirNamespace_Unix}/` | `${TmpDirNamespace_Win}\\\\`\n : T extends MSBuildProject\n ? `${TmpDirNamespace_Unix}/${T['Properties']['PackageId']}/` | `${TmpDirNamespace_Win}\\\\${T['Properties']['PackageId']}\\\\`\n : never;\n\nfunction getDummiesDir<T extends MSBuildProject | undefined = undefined>(project?: T): DummiesDir<T>;\nfunction getDummiesDir<T extends MSBuildProject>(project: T): DummiesDir<T>;\n/**\n * Get HCE.Shared's temporary directory for .NET projects' dummy packages.\n * @param project The MSBuild project whose PackageId will be used to create a\n * directory for its dummy packages.\n * @returns a platform-specific path like\n * `${tmpdir()}/HCE.Shared/.NET/Dummies/${project.Properties.PackageId}` if\n * {@link project} is defined. Else `${tmpdir()}/HCE.Shared/.NET/Dummies`\n */\nfunction getDummiesDir<T extends MSBuildProject | undefined = undefined>(project?: T): DummiesDir<typeof project> {\n switch (true) {\n case project === undefined: {\n return node_path.join(tmpDirNamespace, node_path.sep) as\n DummiesDir<typeof project> satisfies\n ReturnType<typeof getDummiesDir>;\n }\n case project instanceof MSBuildProject: {\n return node_path.join(tmpDirNamespace, project.Properties.PackageId, node_path.sep) as\n DummiesDir<typeof project> satisfies\n ReturnType<typeof getDummiesDir<MSBuildProject>>;\n }\n default: {\n throw new Error('The type of argument `project` must be `undefined` or `MSBuildProject`.');\n }\n }\n}\n\n/**\n * Get the environment variables as key-value pairs.\n * @param tokenEnvVars The name of the environment variables whose values are\n * NuGet API keys.\n * @returns an array of key-value pairs of the given environment variables and\n * their values, filtered to only those whose values are not undefined.\n * @throws {Error} when none of the provided environment variables are defined.\n */\nfunction _GetTokenEnvVariables(tokenEnvVars: readonly string[]): undefined | [readonly [string, string], ...readonly [string, string][]] {\n const definedTokens = Object.freeze(\n tokenEnvVars\n .map((key: string) => [key, getEnvVarValue(key)] as const)\n .filter((envVarTuple: readonly [string, string | undefined]): envVarTuple is [string, string] =>\n envVarTuple[1] !== undefined,\n ),\n );\n\n if (definedTokens.length > 0)\n return definedTokens as [readonly [string, string], ...readonly [string, string][]];\n return undefined;\n}\n\nexport class NugetRegistryInfo {\n private _canPushPackagesToSource: Promise<true> | undefined = undefined;\n private readonly _project: MSBuildProject;\n private readonly _resolvedEnvVariable: string | undefined;\n private readonly _source: string;\n\n public static readonly DefaultTokenEnvVars: readonly ['NUGET_TOKEN']\n = Object.freeze(['NUGET_TOKEN'] as const);\n\n /**\n * Convert a URL string to a filesystem folder name.\n *\n * Intended usage: modify the output path of `dotnet pack` based on the NuGet\n * Source the package should be pushed to. This is extra work is usually\n * unnecessary and you'd typically push the same file to multiple sources.\n * This is for the edge-case scenario of creating multiple nupkgs and signing\n * each one with a different certificate corresponding to a given NuGet\n * Source. This is only useful if the Sources have different certificates\n * registered for a given package/user/organization.\n * @param source The URL of the NuGet Source\n * @returns A string suitable for a local filesystem folder name, formatted as\n * `${hostname}_${pathname.replace('/', '_')}`.\n */\n static GetDirNameForSource(source: string): string {\n return sanitizeFileName(\n source.replaceAll(/\\/index.json$/g, ''),\n { replacement: '_' },\n );\n }\n\n /**\n * Creates an instance of NugetRegistryInfo.\\\n * This class enables the ability to push a given {@link project}'s\n * package(s) to the {@link source} of a given NuGet Source's API endpoint with\n * a user-defined API key. This API key, herein referred to as a \"token\", is\n * derived from the {@link tokenEnvVars} array. This array is iterated through\n * until one of the items is discovered to be an existing environment variable\n * (or is defined in a file named '.env' in the current working directory for\n * LOCAL TESTING ONLY! Do NOT `git add` your private keys!).\n * \\\n * WARNING:\n * - The token value is stored privately within this class, but it is plain text.\n * - This private key may be copied to command line strings stored in Semantic\n * Release's config object for later use by `@semantic-release/exec`.\n * - Other EcmaScript modules can access the environment variable(s) and steal\n * your key. Be aware of malicious dependencies!\n * @param opts The input type of {@link NRIOpts.from}\n * @param opts.project The project whose package(s) will be\n * pushed.\\\n * - Its {@link NugetProjectProperties#PackageId} will be read.\\\n * - Its {@link NugetProjectProperties#PackageVersion} will be overridden via CLI args when creating a dummy package. The real package's\n * `PackageVersion` will *not* be overridden.\n * @param [opts.tokenEnvVars] The environment variables\n * whose values are tokens with permission to push a package to the NuGet\n * package registry. The array is iterated through until one token is found.\n * If none of the environment variables are defined, this constructor will\n * throw an {@link Error}.\n * @param [opts.source] A NuGet package registry's API endpoint URL or name. Default: 'https://api.nuget.org/v3/index.json'\n */\n constructor(opts: typeof NRIOpts['inferIn']) {\n // note: you can reassign `opts` only when typeof `inferOut` is assignable\n // to typeof `inferIn`.\n const validOpts = NRIOpts.from(opts);\n this._project = validOpts.project;\n /**\n * May throw! Assign key of the first key-value pair to\n * {@link resolvedEnvVariable}\n */\n const tokenVars = _GetTokenEnvVariables(validOpts.tokenEnvVars);\n if (tokenVars)\n this._resolvedEnvVariable = tokenVars[0][0];\n this._source = validOpts.source;\n }\n\n public get project(): MSBuildProject {\n return this._project;\n }\n\n /**\n * This is not useful without it being executed as part of a Semantic Release\n * plugin. Deferring this to `@semantic-release/exec`'s prepareCmd is possible,\n * but impractical. You'd need to configure prepareCmd to invoke something\n * like `node customScriptFile.mjs`. It's not worth the hassle.\n * @returns `true` if the token can be used to push nupkg to the given Nuget registry\n * @throws {TypeError | Error | import('../utils/execAsync.js').ChildProcessSpawnException }\n * - {@link Error} | {@link module:utils/execAsync:ChildProcessSpawnException ChildProcessSpawnException}\n * - The token is invalid, of the wrong token type, or lacks permission to push packages\n * - The URL does not exist or a connection could not be established\n * - The command line string is malformed.\n * @deprecated Call during the `verifyConditions` step of Semantic Release! Additionally, {@link GetIsNextVersionAlreadyPublishedCommand}'s return value should be assigned to `prepareCmd` to prevent package version collision errors.\n */\n public get canPushPackagesToSource(): Promise<true> {\n if (this._canPushPackagesToSource !== undefined)\n return this._canPushPackagesToSource;\n\n let tokenValue: string | undefined;\n if (this.resolvedEnvVariable !== undefined)\n tokenValue = NRI._GetTokenValue(this.resolvedEnvVariable);\n\n if (tokenValue?.startsWith('github_pat_')) {\n const errMsg = `The value of the token in 'resolvedEnvVariable' ${String(this.resolvedEnvVariable)} begins with 'github_pat_', indicating it's a Fine-Grained token. At the time of writing, GitHub Fine-Grained tokens cannot push packages. If you believe this is statement is outdated, report the issue at https://github.com/halospv3/hce.shared/issues/new. For more information, see https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.`;\n const err = new Error(errMsg);\n return this._canPushPackagesToSource = Promise.reject(err);\n }\n\n return this._canPushPackagesToSource = this.PackDummyPackage({})\n .then(async () => await this._PushDummyPackages({\n apiKey: tokenValue,\n }))\n .then<true>((execAsyncReturn) => {\n ok(execAsyncReturn);\n return true as const;\n });\n }\n\n /**\n * The first environment variable found to have a defined value. Set by\n * {@link _GetTokenEnvVariables} in the constructor.\n * @returns The first environment variable found to have a defined value.\n */\n get resolvedEnvVariable(): string | undefined {\n return this._resolvedEnvVariable;\n }\n\n get source(): string {\n return this._source;\n }\n\n /**\n * Get the API token from {@link NugetRegistryInfo#resolvedEnvVariable}\n * @param resolvedEnvVariable The name of the environment variable(s) whose\n * value is a NuGet API key. Typically, the value of\n * {@link NugetRegistryInfo#resolvedEnvVariable}.\n * @returns The value of the first defined environment variable.\n * @throws {Error} when none of the provided environment variables are defined.\n */\n private static _GetTokenValue(resolvedEnvVariable: string): string {\n type.string.assert(resolvedEnvVariable);\n\n const tokenValue = getEnvVarValue(resolvedEnvVariable);\n if (tokenValue === undefined) {\n throw new Error(`\\\nThe environment variable ${resolvedEnvVariable} was specified \\\nas the source of the token to push a NuGet package, \\\nbut the environment variable is empty or undefined.`);\n }\n return tokenValue;\n }\n\n // #region Pack\n\n /**\n * The type for options and arguments of `dotnet pack`. See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack.\n *\n * {@link NRI.PackPackagesOptionsType.t.propertyOverrides `propertyOverrides`}\n * is a wrapper for MSBuild's `-property:<n>=<v>` properties override arg.\n */\n static readonly PackPackagesOptionsType: Type<{\n propertyOverrides?: Record<string, string> | undefined;\n artifactsPath?: string | undefined;\n configuration?: 'Release' | 'Debug' | undefined;\n disableBuildServers?: boolean | undefined;\n force?: boolean | undefined;\n includeSource?: boolean | undefined;\n includeSymbols?: boolean | undefined;\n interactive?: boolean | undefined;\n noBuild?: boolean | undefined;\n noLogo?: boolean | undefined;\n noRestore?: boolean | undefined;\n output?: string | undefined;\n runtime?: string | undefined;\n serviceable?: boolean | undefined;\n terminalLogger?: 'auto' | 'on' | 'off' | undefined;\n useCurrentRuntime?: boolean | undefined;\n verbosity?: 'quiet' | 'minimal' | 'normal' | 'detailed' | 'diagnostic' | undefined;\n versionSuffix?: string | undefined;\n '-GetItem'?: readonly string[] | string[] | undefined;\n }> = Object.freeze(\n type({\n /**\n * a custom arg for handling MSBuild's `-property:<n>=<v>` argument for overriding MSBuild properties.\n */\n 'propertyOverrides?': type('Record<string,string>'),\n 'artifactsPath?': 'string',\n 'configuration?': '\"Release\" | \"Debug\"',\n 'disableBuildServers?': 'boolean',\n 'force?': 'boolean',\n 'includeSource?': 'boolean',\n 'includeSymbols?': 'boolean',\n 'interactive?': 'boolean',\n 'noBuild?': 'boolean',\n 'noLogo?': 'boolean',\n 'noRestore?': 'boolean',\n 'output?': 'string',\n 'runtime?': 'string',\n 'serviceable?': 'boolean',\n 'terminalLogger?': '\"auto\" | \"on\" | \"off\"',\n 'useCurrentRuntime?': 'boolean',\n 'verbosity?': '\"quiet\" | \"minimal\" | \"normal\" | \"detailed\" | \"diagnostic\"',\n 'versionSuffix?': 'string',\n /**\n * MSBuild evaluation option. Added to get the output Nupkgs' file paths.\n * @todo consider adding -GetProperty, -GetTarget\n */\n '-GetItem?': type.string.array().readonly().or('string[]'),\n }),\n );\n\n public static readonly PackDummyPackagesOptionsType: Type<{\n propertyOverrides?: Record<string, string> | undefined;\n artifactsPath?: string | undefined;\n configuration?: 'Release' | 'Debug' | undefined;\n disableBuildServers?: boolean | undefined;\n force?: boolean | undefined;\n includeSource?: boolean | undefined;\n includeSymbols?: boolean | undefined;\n interactive?: boolean | undefined;\n noBuild?: boolean | undefined;\n noLogo?: boolean | undefined;\n noRestore?: boolean | undefined;\n runtime?: string | undefined;\n serviceable?: boolean | undefined;\n terminalLogger?: 'auto' | 'on' | 'off' | undefined;\n useCurrentRuntime?: boolean | undefined;\n verbosity?: 'quiet' | 'minimal' | 'normal' | 'detailed' | 'diagnostic' | undefined;\n versionSuffix?: string | undefined;\n '-GetItem'?: readonly string[] | string[] | undefined;\n }>\n = this.PackPackagesOptionsType.omit('output');\n\n /**\n * Get a `dotnet pack` command line string, outputting the package(s) to a\n * path determined by this method's parameters.\n * When pushing the package(s), you only need to supply the main .nupkg's path\n * or its directory to the dotnet CLI—by default, it will also push the\n * symbols package, if present.\n * @param opts Options passed to\n * `dotnet pack`, excluding the required `<PROJECT | SOLUTION>` argument. The\n * {@link PackPackagesOptionsType.t.output} path is modified according to the\n * {@link usePerSourceSubfolder} and {@link usePerPackageIdSubfolder}\n * arguments.\n * @param usePerSourceSubfolder If true, the path of the package output will\n * include a subfolder named after the NuGet Source.\n * @param usePerPackageIdSubfolder If true, the path of the package output\n * will include a subfolder named after the NuGet package's ID.\n * @returns `dotnet pack \"${this.project.Properties.MSBuildProjectFullPath}\"\n * -o \"${outDir}\"` where outDir may be `${cwd()}/publish/${NugetRegistryInfo.GetNameForURL(this.source)}/${this._project.Properties.PackageId}`\n */\n GetPackCommand(\n opts: typeof NRI.PackPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ): string {\n const validOpts = NRI.PackPackagesOptionsType.from(opts);\n type.boolean.assert(usePerSourceSubfolder);\n type.boolean.assert(usePerPackageIdSubfolder);\n\n validOpts.output ??= node_path.join(cwd(), 'publish');\n if (usePerSourceSubfolder)\n validOpts.output = node_path.join(validOpts.output, NugetRegistryInfo.GetDirNameForSource(this.source), node_path.sep);\n if (usePerPackageIdSubfolder)\n validOpts.output = node_path.join(validOpts.output, this._project.Properties.PackageId, node_path.sep);\n\n const packCmdArr: string[] = [\n 'dotnet',\n 'pack',\n `\"${this._project.Properties.MSBuildProjectFullPath}\"`,\n ];\n if (validOpts.artifactsPath !== undefined)\n packCmdArr.push('--artifactsPath', `\"${validOpts.artifactsPath}\"`);\n if (validOpts.configuration !== undefined)\n packCmdArr.push('--configuration', validOpts.configuration);\n if (validOpts.disableBuildServers === true)\n packCmdArr.push('--disable-build-servers');\n if (validOpts.force === true) packCmdArr.push('--force');\n if (validOpts.includeSource === true) packCmdArr.push('--include-source');\n if (validOpts.includeSymbols === true) packCmdArr.push('--include-symbols');\n if (validOpts.interactive === true) packCmdArr.push('--interactive');\n if (validOpts.noBuild === true) packCmdArr.push('--no-build');\n if (validOpts.noLogo === true) packCmdArr.push('--nologo');\n if (validOpts.noRestore === true) packCmdArr.push('--no-restore');\n if (validOpts.runtime !== undefined)\n packCmdArr.push('--runtime', validOpts.runtime);\n if (validOpts.serviceable === true) packCmdArr.push('--serviceable');\n if (validOpts.terminalLogger !== undefined)\n packCmdArr.push('--tl', validOpts.terminalLogger);\n if (validOpts.useCurrentRuntime === true)\n packCmdArr.push('--use-current-runtime');\n if (validOpts.verbosity !== undefined)\n packCmdArr.push('--verbosity', validOpts.verbosity);\n if (validOpts.versionSuffix !== undefined)\n packCmdArr.push('--version-suffix', validOpts.versionSuffix);\n /**\n * Haphazard. I need to override the Version and I'm not considering side\n * effects of arbitrary overrides.\n */\n if (validOpts.propertyOverrides) {\n /** convert propertyOverrides record to \"-p:n0=v0;n1=v1;n2=v2\" et cetera */\n const assignments: string = '-p:' + Object.entries(validOpts.propertyOverrides)\n .map(v => `${v[0]}=${v[1]}`).join(';');\n packCmdArr.push(`\"${assignments}\"`);\n }\n if (validOpts['-GetItem'] && validOpts['-GetItem'].length > 0) {\n // -GetItem:_OutputPackItems,MyCustomItem\n packCmdArr.push(`-GetItem:${validOpts['-GetItem'].join(',')}`);\n }\n // MSBuild parses everything after -o as the path.\n packCmdArr.push('-o', `\"${validOpts.output}\"`);\n\n return packCmdArr.join(' ');\n }\n\n /**\n * !Not ready for use! Remove private modifier and commit as `feat(dotnet)` when ready for release!\n * Blocking Issue: convert all dotnet-related functionality to a Semantic Release plugin!\n * The current {@link _srcd SemanticReleaseConfigDotnet} leverages\n * `@semantic-release/exec` to invoke dotnet commands. This is fine for\n * relatively short command lines, but chaining commands with ' && ' results\n * in quickly-growing complexity.\n * NuGet packages should be created during the `prepare` step, but complex\n * configuration of `dotnet pack` via command lines intended to be invoked by\n * `@semantic-release/exec` is impractical.\n * @param opts `dotnet pack` options. See `dotnet pack -h`,\n * https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack, and\n * {@link PackPackagesOptionsType}.\n * {@link opts['-GetItem']} will _always_ have '_OutputPackItems'.\n * @param [usePerSourceSubfolder] If `true`, modify the output path to\n * include a subfolder bearing a path-safe encoding of the NuGet Source that\n * will receive the nupkg.\n * @param [usePerPackageIdSubfolder] If `true`, modify the output path\n * to include a subfolder named after the the PackageId.\n * @returns a string[] containing the full file paths of all new packages i.e.\n * .nupkg, .symbols.nupkg, .snupkg\n */\n // @ts-expect-error Todo: publicize to dismiss this \"unused\" error.\n private async _PackPackages(\n opts: typeof NRI.PackPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ): Promise<string[]> {\n opts['-GetItem'] = [...opts['-GetItem'] ?? [], key_OutputPackItems];\n\n const packCmd = this.GetPackCommand(\n opts,\n usePerSourceSubfolder,\n usePerPackageIdSubfolder,\n );\n let packOutput: undefined | { stdout: string; stderr: string } = undefined;\n while (packOutput === undefined) {\n packOutput = await setTimeout(\n 1000,\n execAsync(packCmd, true),\n )\n .then(async p => await p)\n .catch<undefined>(catchEBUSY);\n }\n // may include .snupkg\n const nupkgFullPaths: string[] | undefined = new MSBuildEvaluationOutput(packOutput.stdout)\n .Items\n ?.[key_OutputPackItems]\n ?.filter(item => item.Extension !== '.nuspec')\n .map(item => item.FullPath);\n return nupkgFullPaths ?? [];\n }\n\n /**\n * Create a dummy package for the current {@link project} by executing a\n * command line like \\``dotnet pack ${this.project.Properties.MSBuildProjectFullPath} -p:Version=0.0.1-DUMMY -output ${getDummiesDir(this._project)}/${GetNameForURL(this.source)}`\\`\n * @param opts Options passed to\n * `dotnet pack`, excluding the required `<PROJECT | SOLUTION>` argument.\n * - The `output` field is ignored and overwritten. It is replaced with\n * ${{@link getDummiesDir}({@link project})}/${{@link GetDirNameForSource}({@link source})}\n * - The `output` path will be affixed with a folder named after this\n * {@link NugetRegistryInfo#source}, but will not include a subfolder for the\n * {@link NugetRegistryInfo#project NugetRegistryInfo.project}.{@link MSBuildProject#Properties Properties}.{@link MSBuildProject#Properties#PackageId PackageId}.\n * @returns the full paths of all nupkg, symbols.nupkg, and snupkg files\n * created by the Pack target, as extracted from the dotnet process's STDOUT.\n * If mixed with other nupkgs, filter for the {@link NugetProjectProperties#PackageId}\n */\n public async PackDummyPackage(\n opts: typeof NRI.PackDummyPackagesOptionsType.inferIn,\n ): Promise<string[]> {\n const packCmd: string = this.GetPackCommand(\n {\n ...opts,\n output: getDummiesDir(this._project),\n propertyOverrides: { ...opts.propertyOverrides, Version: '0.0.1-DUMMY', UpdateVersionProperties: 'false' },\n '-GetItem': [...opts['-GetItem'] ?? [], key_OutputPackItems],\n },\n true,\n );\n\n let packOutput: undefined | { stdout: string; stderr: string } = undefined;\n while (packOutput === undefined) {\n packOutput = await setTimeout(\n 1000,\n execAsync(packCmd, true),\n )\n .then(async p => await p)\n .catch<undefined>(catchEBUSY);\n }\n // may include .snupkg\n const nupkgFullPaths: string[] | undefined = new MSBuildEvaluationOutput(packOutput.stdout)\n .Items\n ?.[key_OutputPackItems]\n ?.filter(item => item.Extension !== '.nuspec')\n .map(item => item.FullPath);\n return nupkgFullPaths ?? [];\n }\n\n // #endregion Pack\n // #region Push\n\n /**\n * Also includes required argument 'ROOT': the directory in which packages\n * should be present and ready to be pushed the default or specified Source.\n * The ROOT may also include wildcards e.g. `*.nupkg`, `**\\\\*.nupkg`\n * See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push\n *\n * Specific to this API:\n * If you want to use this API's default root value (\\`${cwd()}/publish`), assign an empty string.\n */\n static readonly PushPackagesOptionsType: Type<{\n root: string;\n apiKey?: string | undefined;\n configFile?: string | undefined;\n disableBuffering?: boolean | undefined;\n forceEnglishOutput?: boolean | undefined;\n interactive?: boolean | undefined;\n noServiceEndpoint?: boolean | undefined;\n noSymbols?: boolean | undefined;\n skipDuplicate?: boolean | undefined;\n source?: string | undefined;\n symbolApiKey?: string | undefined;\n symbolSource?: string | undefined;\n timeout?: number | undefined;\n }> = Object.freeze(\n type({\n /** If an empty string is passed, this property is overridden to `./publish` */\n root: 'string',\n /** The API key for the server. NOTE: if `undefined` or an empty string, the `dotnet nuget` client will lookup credentials set via `dotnet nuget {add|update} source`. */\n 'apiKey?': 'string',\n /** The NuGet configuration file (nuget.config) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see {@link https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior Common NuGet Configurations}. */\n 'configFile?': 'string',\n /** Disables buffering when pushing to an HTTP(S) server to reduce memory usage. */\n 'disableBuffering?': 'boolean',\n /** Forces the application to run using an invariant, English-based culture. */\n 'forceEnglishOutput?': 'boolean',\n /** Allows the command to stop and wait for user input or action. For example, to complete authentication. Available since .NET Core 3.0 SDK. */\n 'interactive?': 'boolean',\n /** Doesn't append \"api/v2/package\" to the source URL. */\n 'noServiceEndpoint?': 'boolean',\n 'noSymbols?': 'boolean',\n /** When pushing multiple packages to an HTTP(S) server, treats any 409 Conflict response as a warning so that other pushes can continue. */\n 'skipDuplicate?': 'boolean',\n /**\n * Specifies the server URL. NuGet identifies a UNC or local folder source and simply copies the file there instead of pushing it using HTTP.\n *\n * ### Important\n * > Starting with NuGet 3.4.2, this is a mandatory parameter unless the NuGet config file specifies a `DefaultPushSource` value. For more information, see {@link https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior Configuring NuGet behavior}.\n */\n 'source?': 'string',\n /** The API key for the symbol server. NOTE: if `undefined`, the `dotnet nuget` client will lookup credentials set via `dotnet nuget {add|update} source`.` */\n 'symbolApiKey?': 'string',\n /** Specifies the symbol server URL. */\n 'symbolSource?': 'string',\n /** Specifies the timeout for pushing to a server in seconds. Defaults to 300 seconds (5 minutes). Specifying 0 applies the default value. */\n 'timeout?': 'number',\n }),\n );\n\n /**\n * {@link NRI.PushPackagesOptionsType} sans {@link NRI.PushPackagesOptionsType.t.root}.\n * The result of {@link getDummiesDir} is used, instead.\n */\n public static readonly PushDummyPackagesOptionsType: Type<{\n apiKey?: string | undefined;\n configFile?: string | undefined;\n disableBuffering?: boolean | undefined;\n forceEnglishOutput?: boolean | undefined;\n interactive?: boolean | undefined;\n noServiceEndpoint?: boolean | undefined;\n noSymbols?: boolean | undefined;\n source?: string | undefined;\n symbolApiKey?: string | undefined;\n symbolSource?: string | undefined;\n timeout?: number | undefined;\n skipDuplicate: Default<true, true>;\n }>\n = NugetRegistryInfo.PushPackagesOptionsType.merge({\n skipDuplicate: 'true = true',\n }).omit('root');\n\n /**\n * Create a `dotnet nuget push` command line from the given options and\n * optional boolean parameters.\n * @param opts See {@link PushPackagesOptionsType}\n * @param usePerSourceSubfolder If `true`, the NuGet Source name or URL is formatted\n * to a folder name and appended to the ROOT as a subfolder. Do not use\n * wildcards in ROOT with this set to `true`!\n * @param usePerPackageIdSubfolder If `true`, the\n * {@link project}'s {@link NugetProjectProperties#PackageId}\n * is appended to the ROOT as a subfolder. Do not use wildcards in\n * ROOT with this set to `true`!\n * @returns A `dotnet nuget push` command line formatted with the\n * appropriate arguments.\n */\n GetPushCommand(\n opts: typeof NRI.PushPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ): string {\n const validOpts = NRI.PushPackagesOptionsType.from(opts);\n type.boolean.assert(usePerSourceSubfolder);\n type.boolean.assert(usePerPackageIdSubfolder);\n\n validOpts.root = validOpts.root === '' ? `${cwd()}/publish` : validOpts.root;\n if (usePerSourceSubfolder)\n validOpts.root = node_path.join(validOpts.root, NugetRegistryInfo.GetDirNameForSource(this.source), node_path.sep);\n if (usePerPackageIdSubfolder)\n validOpts.root = node_path.join(validOpts.root, this._project.Properties.PackageId, node_path.sep);\n\n const packCmdArr: string[] = [\n 'dotnet',\n 'nuget',\n 'push',\n `\"${node_path.join(validOpts.root, '*.nupkg')}\"`,\n ];\n\n if (this.resolvedEnvVariable)\n validOpts.apiKey ??= NRI._GetTokenValue(this.resolvedEnvVariable);\n /**\n * If apiKey is an empty string, defer to the dotnet CLI's NuGet client\n * ability to lookup API keys saved via `dotnet nuget add source` or NuGet config\n * files.\n */\n if (validOpts.apiKey && validOpts.apiKey !== '')\n packCmdArr.push('--api-key', validOpts.apiKey);\n if (validOpts.configFile)\n packCmdArr.push('--configfile', validOpts.configFile);\n if (validOpts.disableBuffering === true)\n packCmdArr.push('--disable-buffering');\n if (validOpts.forceEnglishOutput === true)\n packCmdArr.push('--force-english-output');\n if (validOpts.interactive === true)\n packCmdArr.push('--interactive');\n if (validOpts.noServiceEndpoint === true)\n packCmdArr.push('--no-service-endpoint');\n if (validOpts.noSymbols === true)\n packCmdArr.push('--no-symbols');\n if (validOpts.skipDuplicate === true)\n packCmdArr.push('--skip-duplicate');\n validOpts.source ??= this.source;\n packCmdArr.push('--source', validOpts.source);\n if (validOpts.symbolApiKey !== undefined)\n packCmdArr.push('--symbol-api-key', validOpts.symbolApiKey);\n if (validOpts.symbolSource !== undefined)\n packCmdArr.push('--symbol-source', validOpts.symbolSource);\n if (validOpts.timeout !== undefined)\n packCmdArr.push('--timeout', validOpts.timeout.toString());\n\n return packCmdArr.join(' ');\n }\n\n /**\n * Immediately push packages. The input path may be modified according to the\n * {@link usePerSourceSubfolder} and {@link usePerPackageIdSubfolder}\n * arguments.\n * @param opts The `dotnet nuget push` command line options, including the\n * ROOT argument, the directory containing local nuget packages ready to be\n * pushed.\n * @param usePerSourceSubfolder If `true`, the NuGet Source name or URL is formatted\n * to a folder name and appended to the ROOT as a subfolder. Do not use\n * wildcards in ROOT with this set to `true`!\n * @param usePerPackageIdSubfolder If `true`, the current {@link project}'s\n * PackageId is appended to the ROOT as a subfolder. Do not use wildcards in\n * ROOT with this set to `true`!\n */\n // @ts-expect-error Todo: publicize to dismiss this \"unused\" error.\n private async _PushPackages(\n opts: typeof NRI.PushPackagesOptionsType.inferIn,\n usePerSourceSubfolder = false,\n usePerPackageIdSubfolder = false,\n ) {\n // const pushOutput =\n await execAsync(\n this.GetPushCommand(\n opts,\n usePerSourceSubfolder,\n usePerPackageIdSubfolder,\n ),\n true,\n ).catch((error: unknown) => {\n const _error: Error = isError(error) ? error : new Error(JSON.stringify(error));\n throw opts.apiKey\n ? _censorTokenInError(_error, opts.apiKey)\n : _error;\n });\n }\n\n /**\n *\n * Get a `dotnet nuget push` command for pushing one or more nupkg/snupkg\n * files created by {@link GetPackCommand} or {@link _PackPackages}.\\\n * Like {@link PackDummyPackage}, the output/ROOT path will include a\n * folder named after this NRI instance's {@link NugetRegistryInfo#source},\n * but will not include a subfolder for the\n * {@link NugetRegistryInfo#project NugetRegistryInfo.project}.{@link MSBuildProject#Properties Properties}.{@link MSBuildProject#Properties#PackageId PackageId}\n * @example\n * ```ts\n * const packAndPushDummyCmd = [\n * nri.GetPackCommand(\n * NugetRegistryInfo.PackPackagesOptionsType.from({ root: '' }),\n * false,\n * false,\n * ),\n * nri.GetPushDummyPackageCommand(pushOpts, false, false),\n * ].join(' && ')\n * ```\n * @param opts options for `dotnet nuget push`. The following\n * fields are overwritten:\n * - root: getDummiesDir(this.project)\n * - skipDuplicates: true\n * @returns a `dotnet nuget push` command to push a dummy package\n * (created by executing {@link PackDummyPackage}) to {@link source}\n */\n GetPushDummyCommand(\n opts: typeof NRI.PushDummyPackagesOptionsType.inferIn,\n ): string {\n return this.GetPushCommand(\n {\n ...NRI.PushDummyPackagesOptionsType.from(opts),\n root: getDummiesDir(this._project),\n },\n true,\n );\n }\n\n /**\n * Call {@link GetPushDummyCommand} and immediately execute it.\n * @throws {Error} when the process exits with an error code indicating\n * failure i.e. the command line is invalid, the process fails to start,\n * the push fails, et cetera.\n * @param opts the ROOT arg and options for `dotnet nuget push`. The following\n * fields are overwritten:\n * - root: getDummiesDir(this.project)\n * - skipDuplicates: true\n * @returns The return type of {@link execAsync} i.e. a {@link Promise} resolving to `{ stdout: string; stderr: string }`.\n */\n private async _PushDummyPackages(\n opts: typeof NRI.PushDummyPackagesOptionsType.inferIn,\n ): ReturnType<typeof execAsync> {\n const pushCmd: string = this.GetPushDummyCommand(opts);\n return await execAsync(pushCmd, true)\n .catch((error: unknown) => {\n const _error: Error = isError(error) ? error : new Error(String(error));\n throw opts.apiKey\n ? _censorTokenInError(_error, opts.apiKey)\n : _error;\n });\n }\n\n // #endregion Push\n\n // if non-exact-match is needed, learn how to make a parameter-driven type.\n private static readonly _NugetSearchReturnTypes = {\n ExactMatch: {\n v2: type({\n version: '2',\n problems: 'unknown[]',\n searchResult: [\n {\n sourceName: 'string',\n packages: type({\n id: 'string',\n version: type.keywords.string.semver,\n }).array(),\n },\n ],\n }),\n },\n };\n\n private static readonly _ParseNugetSearchReturn = type(\n 'string.json.parse',\n ).to(this._NugetSearchReturnTypes.ExactMatch.v2);\n\n /**\n * !WARNING: this method requires the Nuget Source to be configured via `dotnet nuget add source` or `dotnet nuget update source`. `NUGET_TOKEN` works, but it may be vulnerable to supply chain attacks.\\\n * Call during the `prepare` step of a Semantic Release run.\\\n * Determine if the `nextVersion` generated during the `analyze` Semantic\n * Release step was already published to the NuGet {@link source}.\n * @param source The name or URI of the NuGet Source to search. If this API\n * endpoint does not support searches, the operation will fail. If this API\n * endpoint requires authentication (e.g. GitHub), it must be configured via\n * `dotnet nuget add source` or `dotnet nuget update source` before calling\n * this method.\n * @param packageId The ID of the NuGet package to search for.\n * @param nextVersion The nextVersion value generated by semantic-release's hidden [\"Create Git tag\" step](https://semantic-release.gitbook.io/semantic-release#:~:text=the%20last%20release.-,Create%20Git%20tag,-Create%20a%20Git).\n * @returns A promised boolean.\n * If the promise resolves to `true`, the semantic release run should be\n * cancelled immediately.\n * Otherwise, the release should proceed.\n * @todo utilize in custom plugin inserted at the beginning of `prepare`\n */\n static async IsNextVersionAlreadyPublished(\n source: string,\n packageId: string,\n nextVersion: string,\n ): Promise<boolean> {\n if (nextVersion === '')\n throw new Error('The value of nextVersion is empty');\n return await execAsync(\n `dotnet package search --format JSON --exact-match --source ${source} --prerelease ${packageId}`,\n true,\n )\n .then(stdPair => stdPair.stdout)\n .then(json => this._ParseNugetSearchReturn(json))\n .then(errsOrObj => errsOrObj instanceof type.errors ? errsOrObj.throw() : errsOrObj)\n .then(obj => obj.searchResult)\n .then(results => results[0].packages)\n .then(pkgs =>\n pkgs.find(p => p.version === type('string.semver').from(nextVersion)),\n )\n .then(pkg => pkg !== undefined);\n }\n\n /**\n * !WARNING: GITHUB_OUTPUT must be the full path to an environment file.\n * The plugin \"semantic-release-output-variables\" next-release-version\n *\n * !WARNING: NuGet Source API Key mus tbe configured via `dotnet nuget add source` or `dotnet nuget update source`.\n * Some Sources (e.g. GitHub) require authentication for package searches.\n *\n * # Authenticating NuGet Package Searches\n *\n * ## GitHub NuGet Registry authentication\n * - {@link https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#authenticating-in-a-github-actions-workflow Authenticating in a GitHub Actions workflow}\n * - {@link https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry#authenticating-with-a-personal-access-token Authenticating with a personal access token}.\n * ## For GitLab NuGet Registry authentication, see\n * - {@link https://docs.gitlab.com/ee/user/packages/nuget_repository/#add-a-source-with-the-net-cli Add a source with the .NET CLI}\n * @returns a string containing a Node.JS command line invoking {@link ./IsNextVersionAlreadyPublished.cli.ts}\n * @see {@link ./IsNextVersionAlreadyPublished.cli.ts}, {@link ./IsNextVersionAlreadyPublished.cli.js}\n */\n GetIsNextVersionAlreadyPublishedCommand(): string {\n // if GITHUB_OUTPUT unset or its file does not exist, create it. ''\n getGithubOutputSync();\n // The script will run\n return `node ${node_path.join(import.meta.dirname, './IsNextVersionAlreadyPublished.cli.js')} --packageId ${this._project.Properties.PackageId} --source ${this.source}`;\n }\n\n /*\n * Copy https://github.com/joelharkes/nuget-push when we split off our dotnet\n * modules to a semantic-release plugin.\n */\n\n /*\n * If you want a deterministic nupkg, do so with a custom MSBuild target with\n * AfterTargets=\"Pack\" to restore and execute the dotnet tool \"Kuinox.NupkgDeterministicator\" .\n */\n}\n\n// shorthand/alias for NugetRegistryInfo\nconst NRI: typeof NugetRegistryInfo = NugetRegistryInfo;\n\n/**\n * The base type for {@link NRIOpts} and related types. Extend this type while\n * overriding member types via {@link NRIOptsBase.merge}\n */\nexport const NRIOptsBase: Type<{\n project: MSBuildProject | {\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n };\n source: string;\n tokenEnvVars: readonly string[];\n}> = type({\n /**\n * The environment variables whose values are tokens with permission to push a\n * package to the NuGet package registry. The array is iterated through until\n * one token is found. If none of the environment variables are defined,\n * {@link NugetRegistryInfo}'s constructor will throw an {@link Error}.\n */\n project: type\n .instanceOf(MSBuildProject)\n .or(type.instanceOf(MSBuildProject).readonly()),\n /**\n * A NuGet package registry's API endpoint URL -OR- the name assigned via the\n * client e.g. `dotnet nuget add source --name ${source} ${source's URL}`\n */\n source: type.string,\n /**\n * WARNING: If possible, set credentials via `dotnet nuget {add|update}\n * source` as recommended by Microsoft! This is more secure than exposing\n * credentials to the Node.JS runtime and all its loaded modules.\n *\n * The environment variables whose values are tokens with permission to push a\n * package to the NuGet package registry.The array is iterated through until\n * one token is found.If none of the environment variables are defined,\n * {@link NugetRegistryInfo}'s constructor will throw an {@link Error}.\n *\n * If none of these are defined in the `.env` or process environment variables (.vault.env is impractical in CI), the `--api-key/-k` argument is excluded from `dotnet nuget push` commands.\n * Instead, the NuGet client relies on credentials configured for the\n * given NuGet source. If the NuGet client does not find credentials saved for the\n * NuGet {@link NRIOptsBase.t.source source} and they are required, the command will fail.\n *\n * Use the `dotnet` CLI to configure credentials for existing NuGet sources\n * ({@link https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-update-source `dotnet nuget update source`})\n * -OR- configure credentials for non-default NuGet sources\n * ({@link https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-add-source `dotnet nuget add source`}).\\\n * Alternatively, use the `nuget.exe` CLI to add/update sources. See\n * {@link https://learn.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-sources `nuget sources` (NuGet CLI)}.\n *\n * The credentials will be validated during the `verifyConditions` step of Semantic Release.\n */\n tokenEnvVars: type.string.array().readonly(),\n});\n\n/**\n * The type of the parameter for {@link NugetRegistryInfo}'s constructor.\n */\nexport const NRIOpts: Type<{\n project: MSBuildProject | {\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n };\n tokenEnvVars: Default<readonly string[], readonly ['NUGET_TOKEN']>;\n source: Default<string, string>;\n}> = NRIOptsBase.merge({\n /**\n * Defaults to {@link NugetRegistryInfo.DefaultTokenEnvVars}\n * @see {@link NRIOptsBase.t.tokenEnvVars}\n */\n tokenEnvVars: NRIOptsBase.get('tokenEnvVars').default(\n () => NugetRegistryInfo.DefaultTokenEnvVars,\n ),\n /**\n * A NuGet package registry's API endpoint URL -OR- the name assigned to it\n * via your NuGet client.\n * @default 'https://api.nuget.org/v3/index.json' (name: 'nuget.org')\n * @see {@link NRIOptsBase.t.source}\n */\n source: NRIOptsBase.get('source').default(() => defaultNugetSource),\n});\n\n// #region token censorship\n\n/**\n * Replace all occurrences of {@link token} in the {@link string} with '***'.\n * @param string The string in which a {@link token} may be found.\n * @param token The NuGet API token you definitely don't want to leak!\n * @returns A modified copy of the {@link string} with all occurrences of the\n * {@link token} replaced with '***'.\n */\nfunction _censorToken(string: string, token: string): string {\n return string.replaceAll(token, '***');\n}\n\n/**\n * Censor all occurrences of an API {@link token} in an {@link error}.\n * @param error A {@link ExecException} in which the NuGet API {@link token} may be found.\n * @param token The value of the NuGet API token\n * @returns A modified copy of the provided exception sans any occurrence of the\n * NuGet API token.\n */\nfunction _censorTokenInError(error: ExecException, token: string): ExecException {\n return Object.assign(\n error,\n JSON.parse(\n _censorToken(\n JSON.stringify({\n ...error,\n message: error.message,\n stack: error.stack,\n }),\n token,\n ),\n ) as ExecException,\n );\n}\n\n// #endregion token censorship\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAM,kBAAkB,UAAU,KAAK,QAAQ,EAAE,cAAc,QAAQ,UAAU;AACjF,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;;;;;;AAM5B,eAAsB,kBAAsE;CAC1F,IAAI,IAAI,qBAAqB,KAAA,KAAa,CAAC,WAAW,IAAI,iBAAiB,EAAE;EAC3E,MAAM,mBAA2B,UAAU,KAAK,QAAQ,EAAE,gBAAgB;EAC1E,IAAI,CAAC,WAAW,iBAAiB,EAC/B,MAAM,UAAU,kBAAkB,GAAG;EACvC,IAAI,mBAAmB;;CAGzB,MAAM,WAAW,MAAM,WAAW,IAAI,iBAAiB;CACvD,MAAM,YAAYA,OAAa;EAC7B,MAAM,IAAI;EACV,UAAU;EACV,UAAU,YAAY,KAAA;EACtB,YAAY,EAAE;EACf,CAAC;CAEF,IAAI,QAAQ,UAAU,MAAM,EAC1B,MAAM,UAAU;CAClB,OAAO,UAAU;;;;;;;AAQnB,SAAgB,sBAA8E;CAC5F,IAAI,IAAI,qB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