@halospv3/hce.shared-config 3.0.0-develop.4 → 3.0.0-develop.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dotnet/.github/workflows/_unit_test.yml +0 -3
  3. package/dotnet/.github/workflows/dotnet-release.yml +0 -3
  4. package/dotnet/.github/workflows/sample-dotnet-build.yml +0 -3
  5. package/mjs/CaseInsensitiveMap.d.ts +12 -0
  6. package/mjs/CaseInsensitiveMap.d.ts.map +1 -0
  7. package/mjs/CaseInsensitiveMap.mjs +33 -0
  8. package/mjs/CaseInsensitiveMap.mjs.map +1 -0
  9. package/mjs/commitlintConfig.d.ts +12 -0
  10. package/mjs/commitlintConfig.d.ts.map +1 -0
  11. package/mjs/commitlintConfig.mjs +13 -0
  12. package/mjs/commitlintConfig.mjs.map +1 -0
  13. package/mjs/debug.d.ts +4 -0
  14. package/mjs/debug.d.ts.map +1 -0
  15. package/mjs/debug.mjs +7 -0
  16. package/mjs/debug.mjs.map +1 -0
  17. package/mjs/dotnet/GithubNugetRegistryInfo.d.ts +34 -0
  18. package/mjs/dotnet/GithubNugetRegistryInfo.d.ts.map +1 -0
  19. package/mjs/dotnet/GithubNugetRegistryInfo.mjs +45 -0
  20. package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -0
  21. package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts +57 -0
  22. package/mjs/dotnet/GitlabNugetRegistryInfo.d.ts.map +1 -0
  23. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +99 -0
  24. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -0
  25. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts +2 -0
  26. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.d.ts.map +1 -0
  27. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs +26 -0
  28. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -0
  29. package/mjs/dotnet/MSBuildProject.d.ts +263 -0
  30. package/mjs/dotnet/MSBuildProject.d.ts.map +1 -0
  31. package/mjs/dotnet/MSBuildProject.mjs +444 -0
  32. package/mjs/dotnet/MSBuildProject.mjs.map +1 -0
  33. package/mjs/dotnet/MSBuildProjectProperties.d.ts +169 -0
  34. package/mjs/dotnet/MSBuildProjectProperties.d.ts.map +1 -0
  35. package/mjs/dotnet/MSBuildProjectProperties.mjs +259 -0
  36. package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -0
  37. package/mjs/dotnet/NugetProjectProperties.d.ts +378 -0
  38. package/mjs/dotnet/NugetProjectProperties.d.ts.map +1 -0
  39. package/mjs/dotnet/NugetProjectProperties.mjs +577 -0
  40. package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -0
  41. package/mjs/dotnet/NugetRegistryInfo.d.ts +382 -0
  42. package/mjs/dotnet/NugetRegistryInfo.d.ts.map +1 -0
  43. package/mjs/dotnet/NugetRegistryInfo.mjs +752 -0
  44. package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -0
  45. package/mjs/dotnet/helpers.d.ts +95 -0
  46. package/mjs/dotnet/helpers.d.ts.map +1 -0
  47. package/mjs/dotnet/helpers.mjs +351 -0
  48. package/mjs/dotnet/helpers.mjs.map +1 -0
  49. package/mjs/eslintConfig.d.ts +4 -0
  50. package/mjs/eslintConfig.d.ts.map +1 -0
  51. package/mjs/eslintConfig.mjs +98 -0
  52. package/mjs/eslintConfig.mjs.map +1 -0
  53. package/mjs/index.d.ts +3 -0
  54. package/mjs/index.d.ts.map +1 -0
  55. package/mjs/index.mjs +4 -0
  56. package/mjs/index.mjs.map +1 -0
  57. package/mjs/insertPlugins.d.ts +18 -0
  58. package/mjs/insertPlugins.d.ts.map +1 -0
  59. package/mjs/insertPlugins.mjs +73 -0
  60. package/mjs/insertPlugins.mjs.map +1 -0
  61. package/mjs/semantic-release__commit-analyzer.d.mjs +2 -0
  62. package/mjs/semantic-release__commit-analyzer.d.mjs.map +1 -0
  63. package/mjs/semantic-release__exec.d.mjs +2 -0
  64. package/mjs/semantic-release__exec.d.mjs.map +1 -0
  65. package/mjs/semantic-release__git.d.mjs +2 -0
  66. package/mjs/semantic-release__git.d.mjs.map +1 -0
  67. package/mjs/semantic-release__github.d.mjs +2 -0
  68. package/mjs/semantic-release__github.d.mjs.map +1 -0
  69. package/mjs/semanticReleaseConfig.d.ts +92 -0
  70. package/mjs/semanticReleaseConfig.d.ts.map +1 -0
  71. package/mjs/semanticReleaseConfig.mjs +63 -0
  72. package/mjs/semanticReleaseConfig.mjs.map +1 -0
  73. package/mjs/semanticReleaseConfigDotnet.d.ts +109 -0
  74. package/mjs/semanticReleaseConfigDotnet.d.ts.map +1 -0
  75. package/mjs/semanticReleaseConfigDotnet.mjs +267 -0
  76. package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -0
  77. package/mjs/setupGitPluginSpec.d.ts +22 -0
  78. package/mjs/setupGitPluginSpec.d.ts.map +1 -0
  79. package/mjs/setupGitPluginSpec.mjs +144 -0
  80. package/mjs/setupGitPluginSpec.mjs.map +1 -0
  81. package/mjs/utils/Exact.d.ts +20 -0
  82. package/mjs/utils/Exact.d.ts.map +1 -0
  83. package/mjs/utils/Exact.mjs +75 -0
  84. package/mjs/utils/Exact.mjs.map +1 -0
  85. package/mjs/utils/GracefulRecursion.d.mjs +2 -0
  86. package/mjs/utils/GracefulRecursion.d.mjs.map +1 -0
  87. package/mjs/utils/env.d.ts +24 -0
  88. package/mjs/utils/env.d.ts.map +1 -0
  89. package/mjs/utils/env.mjs +39 -0
  90. package/mjs/utils/env.mjs.map +1 -0
  91. package/mjs/utils/execAsync.d.ts +36 -0
  92. package/mjs/utils/execAsync.d.ts.map +1 -0
  93. package/mjs/utils/execAsync.mjs +59 -0
  94. package/mjs/utils/execAsync.mjs.map +1 -0
  95. package/mjs/utils/miscTypes.d.ts +11 -0
  96. package/mjs/utils/miscTypes.d.ts.map +1 -0
  97. package/mjs/utils/miscTypes.mjs +10 -0
  98. package/mjs/utils/miscTypes.mjs.map +1 -0
  99. package/mjs/utils/reflection/FunctionLike.d.mjs +2 -0
  100. package/mjs/utils/reflection/FunctionLike.d.mjs.map +1 -0
  101. package/mjs/utils/reflection/GetterDescriptor.d.mjs +2 -0
  102. package/mjs/utils/reflection/GetterDescriptor.d.mjs.map +1 -0
  103. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs +2 -0
  104. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mjs.map +1 -0
  105. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs +2 -0
  106. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mjs.map +1 -0
  107. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs +2 -0
  108. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mjs.map +1 -0
  109. package/mjs/utils/reflection/OwnKeyOf.d.mjs +2 -0
  110. package/mjs/utils/reflection/OwnKeyOf.d.mjs.map +1 -0
  111. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs +2 -0
  112. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mjs.map +1 -0
  113. package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs +2 -0
  114. package/mjs/utils/reflection/PropertyDescriptorMap.d.mjs.map +1 -0
  115. package/mjs/utils/reflection/filterForGetters.d.ts +7 -0
  116. package/mjs/utils/reflection/filterForGetters.d.ts.map +1 -0
  117. package/mjs/utils/reflection/filterForGetters.mjs +27 -0
  118. package/mjs/utils/reflection/filterForGetters.mjs.map +1 -0
  119. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts +22 -0
  120. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.ts.map +1 -0
  121. package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs +34 -0
  122. package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -0
  123. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts +56 -0
  124. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.ts.map +1 -0
  125. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs +72 -0
  126. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -0
  127. package/mjs/utils/reflection/getPrototypeChainOf.d.ts +16 -0
  128. package/mjs/utils/reflection/getPrototypeChainOf.d.ts.map +1 -0
  129. package/mjs/utils/reflection/getPrototypeChainOf.mjs +55 -0
  130. package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -0
  131. package/mjs/utils/reflection/getPrototypeOf.d.ts +8 -0
  132. package/mjs/utils/reflection/getPrototypeOf.d.ts.map +1 -0
  133. package/mjs/utils/reflection/getPrototypeOf.mjs +10 -0
  134. package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -0
  135. package/mjs/utils/reflection/inheritance.d.ts +180 -0
  136. package/mjs/utils/reflection/inheritance.d.ts.map +1 -0
  137. package/mjs/utils/reflection/inheritance.mjs +148 -0
  138. package/mjs/utils/reflection/inheritance.mjs.map +1 -0
  139. package/mjs/utils/reflection/isConstructor.d.ts +17 -0
  140. package/mjs/utils/reflection/isConstructor.d.ts.map +1 -0
  141. package/mjs/utils/reflection/isConstructor.mjs +63 -0
  142. package/mjs/utils/reflection/isConstructor.mjs.map +1 -0
  143. package/mjs/utils/reflection/isGetterDescriptor.d.ts +9 -0
  144. package/mjs/utils/reflection/isGetterDescriptor.d.ts.map +1 -0
  145. package/mjs/utils/reflection/isGetterDescriptor.mjs +12 -0
  146. package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -0
  147. package/mjs/utils/reflection/listOwnGetters.d.ts +26 -0
  148. package/mjs/utils/reflection/listOwnGetters.d.ts.map +1 -0
  149. package/mjs/utils/reflection/listOwnGetters.mjs +39 -0
  150. package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -0
  151. package/mjs/utils/reflection.d.ts +18 -0
  152. package/mjs/utils/reflection.d.ts.map +1 -0
  153. package/mjs/utils/reflection.mjs +10 -0
  154. package/mjs/utils/reflection.mjs.map +1 -0
  155. package/package.json +6 -4
  156. package/src/insertPlugins.ts +116 -0
  157. package/src/semanticReleaseConfigDotnet.ts +84 -81
@@ -0,0 +1,382 @@
1
+ import type { NugetProjectProperties } from './NugetProjectProperties.js';
2
+ import { config as configDotenv } from '@dotenvx/dotenvx';
3
+ import { MSBuildEvaluationOutput, MSBuildProject } from './MSBuildProject.js';
4
+ /**
5
+ * Read the contents of $GITHUB_OUTPUT (if its value is a file path) or $TEMP/GITHUB_OUTPUT.
6
+ * If the file doesn't exist, it is created.
7
+ * @returns If successful, a promised object with a parsed key.
8
+ */
9
+ export declare function getGithubOutput(): Promise<ReturnType<typeof configDotenv>['parsed']>;
10
+ /**
11
+ * Read the contents of $GITHUB_OUTPUT (if its value is a file path) or $TEMP/GITHUB_OUTPUT.
12
+ * If the file doesn't exist, it is created.
13
+ * @returns An object with a parsed key if successful.
14
+ */
15
+ export declare function getGithubOutputSync(): NonNullable<ReturnType<typeof configDotenv>['parsed']>;
16
+ export declare class NugetRegistryInfo {
17
+ private _canPushPackagesToSource;
18
+ private readonly _project;
19
+ private readonly _resolvedEnvVariable;
20
+ private readonly _source;
21
+ static readonly DefaultTokenEnvVars: readonly ['NUGET_TOKEN'];
22
+ /**
23
+ * Convert a URL string to a filesystem folder name.
24
+ *
25
+ * Intended usage: modify the output path of `dotnet pack` based on the NuGet
26
+ * Source the package should be pushed to. This is extra work is usually
27
+ * unnecessary and you'd typically push the same file to multiple sources.
28
+ * This is for the edge-case scenario of creating multiple nupkgs and signing
29
+ * each one with a different certificate corresponding to a given NuGet
30
+ * Source. This is only useful if the Sources have different certificates
31
+ * registered for a given package/user/organization.
32
+ * @param source The URL of the NuGet Source
33
+ * @returns A string suitable for a local filesystem folder name, formatted as
34
+ * `${hostname}_${pathname.replace('/', '_')}`.
35
+ */
36
+ static GetDirNameForSource(source: string): string;
37
+ /**
38
+ * Creates an instance of NugetRegistryInfo.\
39
+ * This class enables the ability to push a given {@link project}'s
40
+ * package(s) to the {@link source} of a given NuGet Source's API endpoint with
41
+ * a user-defined API key. This API key, herein referred to as a "token", is
42
+ * derived from the {@link tokenEnvVars} array. This array is iterated through
43
+ * until one of the items is discovered to be an existing environment variable
44
+ * (or is defined in a file named '.env' in the current working directory for
45
+ * LOCAL TESTING ONLY! Do NOT `git add` your private keys!).
46
+ * \
47
+ * WARNING:
48
+ * - The token value is stored privately within this class, but it is plain text.
49
+ * - This private key may be copied to command line strings stored in Semantic
50
+ * Release's config object for later use by `@semantic-release/exec`.
51
+ * - Other EcmaScript modules can access the environment variable(s) and steal
52
+ * your key. Be aware of malicious dependencies!
53
+ * @param opts The input type of {@link NRIOpts.from}
54
+ * @param opts.project The project whose package(s) will be
55
+ * pushed.\
56
+ * - Its {@link NugetProjectProperties#PackageId} will be read.\
57
+ * - Its {@link NugetProjectProperties#PackageVersion} will be overridden via CLI args when creating a dummy package. The real package's
58
+ * `PackageVersion` will *not* be overridden.
59
+ * @param [opts.tokenEnvVars] The environment variables
60
+ * whose values are tokens with permission to push a package to the NuGet
61
+ * package registry. The array is iterated through until one token is found.
62
+ * If none of the environment variables are defined, this constructor will
63
+ * throw an {@link Error}.
64
+ * @param [opts.source] A NuGet package registry's API endpoint URL or name. Default: 'https://api.nuget.org/v3/index.json'
65
+ */
66
+ constructor(opts: typeof NRIOpts['inferIn']);
67
+ get project(): MSBuildProject;
68
+ /**
69
+ * This is not useful without it being executed as part of a Semantic Release
70
+ * plugin. Deferring this to @semantic-release/exec's prepareCmd is possible,
71
+ * but impractical. You'd need to configure prepareCmd to invoke something
72
+ * like `node customScriptFile.mjs`. It's not worth the hassle.
73
+ * @returns `true` if the token can be used to push nupkg to the given Nuget registry
74
+ * @throws {TypeError | Error | import('../utils/execAsync.js').ChildProcessSpawnException }
75
+ * - {@link Error} | {@link module:utils/execAsync:ChildProcessSpawnException ChildProcessSpawnException}
76
+ * - The token is invalid, of the wrong token type, or lacks permission to push packages
77
+ * - The URL does not exist or a connection could not be established
78
+ * - The command line string is malformed.
79
+ * @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.
80
+ */
81
+ get canPushPackagesToSource(): Promise<true>;
82
+ /**
83
+ * The first environment variable found to have a defined value. Set by
84
+ * {@link _GetTokenEnvVariables} in the constructor.
85
+ * @returns The first environment variable found to have a defined value.
86
+ */
87
+ get resolvedEnvVariable(): string | undefined;
88
+ get source(): string;
89
+ /**
90
+ * Get the API token from {@link NugetRegistryInfo#resolvedEnvVariable}
91
+ * @param resolvedEnvVariable The name of the environment variable(s) whose
92
+ * value is a NuGet API key. Typically, the value of
93
+ * {@link NugetRegistryInfo#resolvedEnvVariable}.
94
+ * @returns The value of the first defined environment variable.
95
+ * @throws {Error} when none of the provided environment variables are defined.
96
+ */
97
+ private static _GetTokenValue;
98
+ /**
99
+ * The type for options and arguments of `dotnet pack`. See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack.
100
+ *
101
+ * {@link NRI.PackPackagesOptionsType.t.propertyOverrides `propertyOverrides`}
102
+ * is a wrapper for MSBuild's `-property:<n>=<v>` properties override arg.
103
+ */
104
+ static readonly PackPackagesOptionsType: import("arktype/internal/methods/object.ts").ObjectType<{
105
+ propertyOverrides?: Record<string, string> | undefined;
106
+ artifactsPath?: string | undefined;
107
+ configuration?: "Release" | "Debug" | undefined;
108
+ disableBuildServers?: boolean | undefined;
109
+ force?: boolean | undefined;
110
+ includeSource?: boolean | undefined;
111
+ includeSymbols?: boolean | undefined;
112
+ interactive?: boolean | undefined;
113
+ noBuild?: boolean | undefined;
114
+ noLogo?: boolean | undefined;
115
+ noRestore?: boolean | undefined;
116
+ output?: string | undefined;
117
+ runtime?: string | undefined;
118
+ serviceable?: boolean | undefined;
119
+ terminalLogger?: "off" | "auto" | "on" | undefined;
120
+ useCurrentRuntime?: boolean | undefined;
121
+ verbosity?: "quiet" | "minimal" | "normal" | "detailed" | "diagnostic" | undefined;
122
+ versionSuffix?: string | undefined;
123
+ '-GetItem'?: readonly string[] | string[] | undefined;
124
+ }, {}>;
125
+ static readonly PackDummyPackagesOptionsType: import("arktype/internal/methods/object.ts").ObjectType<{
126
+ propertyOverrides?: Record<string, string> | undefined;
127
+ artifactsPath?: string | undefined;
128
+ configuration?: "Release" | "Debug" | undefined;
129
+ disableBuildServers?: boolean | undefined;
130
+ force?: boolean | undefined;
131
+ includeSource?: boolean | undefined;
132
+ includeSymbols?: boolean | undefined;
133
+ interactive?: boolean | undefined;
134
+ noBuild?: boolean | undefined;
135
+ noLogo?: boolean | undefined;
136
+ noRestore?: boolean | undefined;
137
+ runtime?: string | undefined;
138
+ serviceable?: boolean | undefined;
139
+ terminalLogger?: "off" | "auto" | "on" | undefined;
140
+ useCurrentRuntime?: boolean | undefined;
141
+ verbosity?: "quiet" | "minimal" | "normal" | "detailed" | "diagnostic" | undefined;
142
+ versionSuffix?: string | undefined;
143
+ "-GetItem"?: readonly string[] | string[] | undefined;
144
+ }, {}>;
145
+ /**
146
+ * Get a `dotnet pack` command line string, outputting the package(s) to a
147
+ * path determined by this method's parameters.
148
+ * When pushing the package(s), you only need to supply the main .nupkg's path
149
+ * or its directory to the dotnet CLI—by default, it will also push the
150
+ * symbols package, if present.
151
+ * @param opts Options passed to
152
+ * `dotnet pack`, excluding the required `<PROJECT | SOLUTION>` argument. The
153
+ * {@link PackPackagesOptionsType.t.output} path is modified according to the
154
+ * {@link usePerSourceSubfolder} and {@link usePerPackageIdSubfolder}
155
+ * arguments.
156
+ * @param usePerSourceSubfolder If true, the path of the package output will
157
+ * include a subfolder named after the NuGet Source.
158
+ * @param usePerPackageIdSubfolder If true, the path of the package output
159
+ * will include a subfolder named after the NuGet package's ID.
160
+ * @returns `dotnet pack "${this.project.Properties.MSBuildProjectFullPath}"
161
+ * -o "${outDir}"` where outDir may be `${cwd()}/publish/${NugetRegistryInfo.GetNameForURL(this.source)}/${this._project.Properties.PackageId}`
162
+ */
163
+ GetPackCommand(opts: typeof NRI.PackPackagesOptionsType.inferIn, usePerSourceSubfolder?: boolean, usePerPackageIdSubfolder?: boolean): string;
164
+ /**
165
+ * !Not ready for use! Remove private modifier and commit as `feat(dotnet)` when ready for release!
166
+ * Blocking Issue: convert all dotnet-related functionality to a Semantic Release plugin!
167
+ * The current {@link SemanticReleaseConfigDotnet} leverages
168
+ * `@semantic-release/exec` to invoke dotnet commands. This is fine for
169
+ * relatively short command lines, but chaining commands with ' && ' results
170
+ * in quickly-growing complexity.
171
+ * NuGet packages should be created during the `prepare` step, but complex
172
+ * configuration of `dotnet pack` via command lines intended to be invoked by
173
+ * `@semantic-release/exec` is impractical.
174
+ * @param opts `dotnet pack` options. See `dotnet pack -h`,
175
+ * https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-pack, and
176
+ * {@link PackPackagesOptionsType}.
177
+ * {@link opts['-GetItem']} will _always_ have '_OutputPackItems'.
178
+ * @param [usePerSourceSubfolder] If `true`, modify the output path to
179
+ * include a subfolder bearing a path-safe encoding of the NuGet Source that
180
+ * will receive the nupkg.
181
+ * @param [usePerPackageIdSubfolder] If `true`, modify the output path
182
+ * to include a subfolder named after the the PackageId.
183
+ * @returns a string[] containing the full file paths of all new packages i.e.
184
+ * .nupkg, .symbols.nupkg, .snupkg
185
+ */
186
+ private _PackPackages;
187
+ /**
188
+ * Create a dummy package for the current {@link project} by executing a
189
+ * command line like \``dotnet pack ${this.project.Properties.MSBuildProjectFullPath} -p:Version=0.0.1-DUMMY -output ${getDummiesDir(this._project)}/${GetNameForURL(this.source)}`\`
190
+ * @param opts Options passed to
191
+ * `dotnet pack`, excluding the required `<PROJECT | SOLUTION>` argument.
192
+ * - The `output` field is ignored and overwritten. It is replaced with
193
+ * ${{@link getDummiesDir}({@link project})}/${{@link GetDirNameForSource}({@link source})}
194
+ * - The `output` path will be affixed with a folder named after this
195
+ * {@link NugetRegistryInfo#source}, but will not include a subfolder for the
196
+ * {@link NugetRegistryInfo#project NugetRegistryInfo.project}.{@link MSBuildProject#Properties Properties}.{@link MSBuildProject#Properties#PackageId PackageId}.
197
+ * @returns the full paths of all nupkg, symbols.nupkg, and snupkg files
198
+ * created by the Pack target, as extracted from the dotnet process's STDOUT.
199
+ * If mixed with other nupkgs, filter for the {@link NugetProjectProperties#PackageId}
200
+ */
201
+ PackDummyPackage(opts: typeof NRI.PackDummyPackagesOptionsType.inferIn): Promise<string[]>;
202
+ /**
203
+ * Also includes required argument 'ROOT': the directory in which packages
204
+ * should be present and ready to be pushed the default or specified Source.
205
+ * The ROOT may also include wildcards e.g. `*.nupkg`, `**\\*.nupkg`
206
+ * See https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-nuget-push
207
+ *
208
+ * Specific to this API:
209
+ * If you want to use this API's default root value (\`${cwd()}/publish`), assign an empty string.
210
+ */
211
+ static readonly PushPackagesOptionsType: import("arktype/internal/methods/object.ts").ObjectType<{
212
+ root: string;
213
+ apiKey?: string | undefined;
214
+ configFile?: string | undefined;
215
+ disableBuffering?: boolean | undefined;
216
+ forceEnglishOutput?: boolean | undefined;
217
+ interactive?: boolean | undefined;
218
+ noServiceEndpoint?: boolean | undefined;
219
+ noSymbols?: boolean | undefined;
220
+ skipDuplicate?: boolean | undefined;
221
+ source?: string | undefined;
222
+ symbolApiKey?: string | undefined;
223
+ symbolSource?: string | undefined;
224
+ timeout?: number | undefined;
225
+ }, {}>;
226
+ /**
227
+ * {@link NRI.PushPackagesOptionsType} sans {@link NRI.PushPackagesOptionsType.t.root}.
228
+ * The result of {@link getDummiesDir} is used, instead.
229
+ */
230
+ static readonly PushDummyPackagesOptionsType: import("arktype/internal/methods/object.ts").ObjectType<{
231
+ apiKey?: string | undefined;
232
+ configFile?: string | undefined;
233
+ disableBuffering?: boolean | undefined;
234
+ forceEnglishOutput?: boolean | undefined;
235
+ interactive?: boolean | undefined;
236
+ noServiceEndpoint?: boolean | undefined;
237
+ noSymbols?: boolean | undefined;
238
+ source?: string | undefined;
239
+ symbolApiKey?: string | undefined;
240
+ symbolSource?: string | undefined;
241
+ timeout?: number | undefined;
242
+ skipDuplicate: import("arktype/internal/attributes.ts").Default<true, true>;
243
+ }, {}>;
244
+ /**
245
+ * Create a `dotnet nuget push` command line from the given options and
246
+ * optional boolean parameters.
247
+ * @param opts See {@link PushPackagesOptionsType}
248
+ * @param usePerSourceSubfolder If `true`, the NuGet Source name or URL is formatted
249
+ * to a folder name and appended to the ROOT as a subfolder. Do not use
250
+ * wildcards in ROOT with this set to `true`!
251
+ * @param usePerPackageIdSubfolder If `true`, the
252
+ * {@link project}'s {@link NugetProjectProperties#PackageId}
253
+ * is appended to the ROOT as a subfolder. Do not use wildcards in
254
+ * ROOT with this set to `true`!
255
+ * @returns A `dotnet nuget push` command line formatted with the
256
+ * appropriate arguments.
257
+ */
258
+ GetPushCommand(opts: typeof NRI.PushPackagesOptionsType.inferIn, usePerSourceSubfolder?: boolean, usePerPackageIdSubfolder?: boolean): string;
259
+ /**
260
+ * Immediately push packages. The input path may be modified according to the
261
+ * {@link usePerSourceSubfolder} and {@link usePerPackageIdSubfolder}
262
+ * arguments.
263
+ * @param opts The `dotnet nuget push` command line options, including the
264
+ * ROOT argument, the directory containing local nuget packages ready to be
265
+ * pushed.
266
+ * @param usePerSourceSubfolder If `true`, the NuGet Source name or URL is formatted
267
+ * to a folder name and appended to the ROOT as a subfolder. Do not use
268
+ * wildcards in ROOT with this set to `true`!
269
+ * @param usePerPackageIdSubfolder If `true`, the current {@link project}'s
270
+ * PackageId is appended to the ROOT as a subfolder. Do not use wildcards in
271
+ * ROOT with this set to `true`!
272
+ */
273
+ private _PushPackages;
274
+ /**
275
+ *
276
+ * Get a `dotnet nuget push` command for pushing one or more nupkg/snupkg
277
+ * files created by {@link GetPackCommand} or {@link _PackPackages}.\
278
+ * Like {@link PackDummyPackage}, the output/ROOT path will include a
279
+ * folder named after this NRI instance's {@link NugetRegistryInfo#source},
280
+ * but will not include a subfolder for the
281
+ * {@link NugetRegistryInfo#project NugetRegistryInfo.project}.{@link MSBuildProject#Properties Properties}.{@link MSBuildProject#Properties#PackageId PackageId}
282
+ * @example
283
+ * ```ts
284
+ * const packAndPushDummyCmd = [
285
+ * nri.GetPackCommand(
286
+ * NugetRegistryInfo.PackPackagesOptionsType.from({ root: '' }),
287
+ * false,
288
+ * false,
289
+ * ),
290
+ * nri.GetPushDummyPackageCommand(pushOpts, false, false),
291
+ * ].join(' && ')
292
+ * ```
293
+ * @param opts options for `dotnet nuget push`. The following
294
+ * fields are overwritten:
295
+ * - root: getDummiesDir(this.project)
296
+ * - skipDuplicates: true
297
+ * @returns a `dotnet nuget push` command to push a dummy package
298
+ * (created by executing {@link PackDummyPackage}) to {@link source}
299
+ */
300
+ GetPushDummyCommand(opts: typeof NRI.PushDummyPackagesOptionsType.inferIn): string;
301
+ /**
302
+ * Call {@link GetPushDummyCommand} and immediately execute it.
303
+ * @throws {Error} when the process exits with an error code indicating
304
+ * failure i.e. the command line is invalid, the process fails to start,
305
+ * the push fails, et cetera.
306
+ * @param opts the ROOT arg and options for `dotnet nuget push`. The following
307
+ * fields are overwritten:
308
+ * - root: getDummiesDir(this.project)
309
+ * - skipDuplicates: true
310
+ * @returns The return type of {@link execAsync} i.e. a {@link Promise} resolving to `{ stdout: string; stderr: string }`.
311
+ */
312
+ private _PushDummyPackages;
313
+ private static readonly _NugetSearchReturnTypes;
314
+ private static readonly _ParseNugetSearchReturn;
315
+ /**
316
+ * !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.\
317
+ * Call during the `prepare` step of a Semantic Release run.\
318
+ * Determine if the `nextVersion` generated during the `analyze` Semantic
319
+ * Release step was already published to the NuGet {@link source}.
320
+ * @param source The name or URI of the NuGet Source to search. If this API
321
+ * endpoint does not support searches, the operation will fail. If this API
322
+ * endpoint requires authentication (e.g. GitHub), it must be configured via
323
+ * `dotnet nuget add source` or `dotnet nuget update source` before calling
324
+ * this method.
325
+ * @param packageId The ID of the NuGet package to search for.
326
+ * @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).
327
+ * @returns A promised boolean.
328
+ * If the promise resolves to `true`, the semantic release run should be
329
+ * cancelled immediately.
330
+ * Otherwise, the release should proceed.
331
+ * @todo utilize in custom plugin inserted at the beginning of `prepare`
332
+ */
333
+ static IsNextVersionAlreadyPublished(source: string, packageId: string, nextVersion: string): Promise<boolean>;
334
+ /**
335
+ * !WARNING: GITHUB_OUTPUT must be the full path to an environment file.
336
+ * The plugin "semantic-release-output-variables" next-release-version
337
+ *
338
+ * !WARNING: NuGet Source API Key mus tbe configured via `dotnet nuget add source` or `dotnet nuget update source`.
339
+ * Some Sources (e.g. GitHub) require authentication for package searches.
340
+ *
341
+ * # Authenticating NuGet Package Searches
342
+ *
343
+ * ## GitHub NuGet Registry authentication
344
+ * - {@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}
345
+ * - {@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}.
346
+ * ## For GitLab NuGet Registry authentication, see
347
+ * - {@link https://docs.gitlab.com/ee/user/packages/nuget_repository/#add-a-source-with-the-net-cli Add a source with the .NET CLI}
348
+ * @returns a string containing a Node.JS command line invoking {@link ./IsNextVersionAlreadyPublished.cli.ts}
349
+ * @see {@link ./IsNextVersionAlreadyPublished.cli.ts}, {@link ./IsNextVersionAlreadyPublished.cli.js}
350
+ */
351
+ GetIsNextVersionAlreadyPublishedCommand(): string;
352
+ }
353
+ declare const NRI: typeof NugetRegistryInfo;
354
+ /**
355
+ * The base type for {@link NRIOpts} and related types. Extend this type while
356
+ * overriding member types via {@link NRIOptsBase.merge}
357
+ */
358
+ export declare const NRIOptsBase: import("arktype/internal/methods/object.ts").ObjectType<{
359
+ project: MSBuildProject | {
360
+ readonly Items: Readonly<Required<MSBuildEvaluationOutput>["Items"]>;
361
+ readonly Properties: Readonly<NugetProjectProperties>;
362
+ readonly Targets: readonly string[];
363
+ readonly TargetResults: Required<MSBuildEvaluationOutput>["TargetResults"][];
364
+ };
365
+ source: string;
366
+ tokenEnvVars: readonly string[];
367
+ }, {}>;
368
+ /**
369
+ * The type of the parameter for {@link NugetRegistryInfo}'s constructor.
370
+ */
371
+ export declare const NRIOpts: import("arktype/internal/methods/object.ts").ObjectType<{
372
+ project: MSBuildProject | {
373
+ readonly Items: Readonly<Required<MSBuildEvaluationOutput>["Items"]>;
374
+ readonly Properties: Readonly<NugetProjectProperties>;
375
+ readonly Targets: readonly string[];
376
+ readonly TargetResults: Required<MSBuildEvaluationOutput>["TargetResults"][];
377
+ };
378
+ tokenEnvVars: import("arktype/internal/attributes.ts").Default<readonly string[], readonly ["NUGET_TOKEN"]>;
379
+ source: import("arktype/internal/attributes.ts").Default<string, string>;
380
+ }, {}>;
381
+ export {};
382
+ //# sourceMappingURL=NugetRegistryInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NugetRegistryInfo.d.ts","sourceRoot":"","sources":["../../src/dotnet/NugetRegistryInfo.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAe1D,OAAO,EAAgB,uBAAuB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAO5F;;;;GAIG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,CAAC,CAAC,CAmB1F;AAED;;;;GAIG;AACH,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