@halospv3/hce.shared-config 3.5.3-develop.2 → 3.6.0

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 (136) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +33 -10
  3. package/dotnet/.github/workflows/_unit_test.yml +1 -1
  4. package/dotnet/.github/workflows/dotnet-release.yml +1 -1
  5. package/dotnet/.github/workflows/sample-dotnet-build.yml +1 -1
  6. package/dotnet/CleanupWpfTmp.targets +15 -0
  7. package/dotnet/HCE.Shared.targets +3 -0
  8. package/mjs/CaseInsensitiveMap.mjs.map +1 -1
  9. package/mjs/commitlintConfig.mjs.map +1 -1
  10. package/mjs/debug.mjs.map +1 -1
  11. package/mjs/dotnet/GithubNugetRegistryInfo.d.mts +5 -5
  12. package/mjs/dotnet/GithubNugetRegistryInfo.d.mts.map +1 -1
  13. package/mjs/dotnet/GithubNugetRegistryInfo.mjs +7 -7
  14. package/mjs/dotnet/GithubNugetRegistryInfo.mjs.map +1 -1
  15. package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts +6 -6
  16. package/mjs/dotnet/GitlabNugetRegistryInfo.d.mts.map +1 -1
  17. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs +14 -14
  18. package/mjs/dotnet/GitlabNugetRegistryInfo.mjs.map +1 -1
  19. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs +5 -5
  20. package/mjs/dotnet/IsNextVersionAlreadyPublished.cli.mjs.map +1 -1
  21. package/mjs/dotnet/MSBuildProject.d.mts +28 -28
  22. package/mjs/dotnet/MSBuildProject.d.mts.map +1 -1
  23. package/mjs/dotnet/MSBuildProject.mjs +88 -66
  24. package/mjs/dotnet/MSBuildProject.mjs.map +1 -1
  25. package/mjs/dotnet/MSBuildProjectProperties.d.mts.map +1 -1
  26. package/mjs/dotnet/MSBuildProjectProperties.mjs +1 -1
  27. package/mjs/dotnet/MSBuildProjectProperties.mjs.map +1 -1
  28. package/mjs/dotnet/NugetProjectProperties.d.mts +3 -3
  29. package/mjs/dotnet/NugetProjectProperties.d.mts.map +1 -1
  30. package/mjs/dotnet/NugetProjectProperties.mjs +7 -9
  31. package/mjs/dotnet/NugetProjectProperties.mjs.map +1 -1
  32. package/mjs/dotnet/NugetRegistryInfo.d.mts +40 -40
  33. package/mjs/dotnet/NugetRegistryInfo.d.mts.map +1 -1
  34. package/mjs/dotnet/NugetRegistryInfo.mjs +170 -148
  35. package/mjs/dotnet/NugetRegistryInfo.mjs.map +1 -1
  36. package/mjs/dotnet/helpers.d.mts.map +1 -1
  37. package/mjs/dotnet/helpers.mjs +33 -34
  38. package/mjs/dotnet/helpers.mjs.map +1 -1
  39. package/mjs/eslintConfig.mjs.map +1 -1
  40. package/mjs/insertPlugins.mjs +2 -2
  41. package/mjs/insertPlugins.mjs.map +1 -1
  42. package/mjs/semantic-release__commit-analyzer.d.mts.map +1 -1
  43. package/mjs/semantic-release__exec.d.mts.map +1 -1
  44. package/mjs/semantic-release__git.d.mts.map +1 -1
  45. package/mjs/semantic-release__github.d.mts +1 -0
  46. package/mjs/semantic-release__github.d.mts.map +1 -1
  47. package/mjs/semanticReleaseConfig.d.mts.map +1 -1
  48. package/mjs/semanticReleaseConfig.mjs.map +1 -1
  49. package/mjs/semanticReleaseConfigDotnet.d.mts.map +1 -1
  50. package/mjs/semanticReleaseConfigDotnet.mjs +23 -16
  51. package/mjs/semanticReleaseConfigDotnet.mjs.map +1 -1
  52. package/mjs/setupGitPluginSpec.d.mts.map +1 -1
  53. package/mjs/setupGitPluginSpec.default.mjs.map +1 -1
  54. package/mjs/setupGitPluginSpec.mjs +19 -19
  55. package/mjs/setupGitPluginSpec.mjs.map +1 -1
  56. package/mjs/utils/Exact.d.mts.map +1 -1
  57. package/mjs/utils/GracefulRecursion.d.mts.map +1 -1
  58. package/mjs/utils/env.d.mts.map +1 -1
  59. package/mjs/utils/env.mjs.map +1 -1
  60. package/mjs/utils/execAsync.d.mts +3 -3
  61. package/mjs/utils/execAsync.d.mts.map +1 -1
  62. package/mjs/utils/execAsync.mjs +14 -12
  63. package/mjs/utils/execAsync.mjs.map +1 -1
  64. package/mjs/utils/isError.mjs.map +1 -1
  65. package/mjs/utils/miscTypes.d.mts.map +1 -1
  66. package/mjs/utils/miscTypes.mjs.map +1 -1
  67. package/mjs/utils/reflection/FunctionLike.d.mts +1 -0
  68. package/mjs/utils/reflection/FunctionLike.d.mts.map +1 -1
  69. package/mjs/utils/reflection/GetterDescriptor.d.mts.map +1 -1
  70. package/mjs/utils/reflection/InstancePropertyDescriptorMap.d.mts.map +1 -1
  71. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts +1 -1
  72. package/mjs/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.mts.map +1 -1
  73. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts +1 -1
  74. package/mjs/utils/reflection/OwnGetterDescriptorMap.d.mts.map +1 -1
  75. package/mjs/utils/reflection/OwnKeyOf.d.mts +1 -1
  76. package/mjs/utils/reflection/OwnKeyOf.d.mts.map +1 -1
  77. package/mjs/utils/reflection/OwnPropertyDescriptorMap.d.mts.map +1 -1
  78. package/mjs/utils/reflection/PropertyDescriptorMap.d.mts +1 -1
  79. package/mjs/utils/reflection/PropertyDescriptorMap.d.mts.map +1 -1
  80. package/mjs/utils/reflection/filterForGetters.d.mts.map +1 -1
  81. package/mjs/utils/reflection/filterForGetters.mjs.map +1 -1
  82. package/mjs/utils/reflection/getOwnPropertyDescriptors.d.mts.map +1 -1
  83. package/mjs/utils/reflection/getOwnPropertyDescriptors.mjs.map +1 -1
  84. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.d.mts.map +1 -1
  85. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs +3 -3
  86. package/mjs/utils/reflection/getOwnPropertyDescriptorsRecursively.mjs.map +1 -1
  87. package/mjs/utils/reflection/getPrototypeChainOf.d.mts +2 -2
  88. package/mjs/utils/reflection/getPrototypeChainOf.d.mts.map +1 -1
  89. package/mjs/utils/reflection/getPrototypeChainOf.mjs +1 -2
  90. package/mjs/utils/reflection/getPrototypeChainOf.mjs.map +1 -1
  91. package/mjs/utils/reflection/getPrototypeOf.d.mts.map +1 -1
  92. package/mjs/utils/reflection/getPrototypeOf.mjs.map +1 -1
  93. package/mjs/utils/reflection/inheritance.d.mts +4 -4
  94. package/mjs/utils/reflection/inheritance.d.mts.map +1 -1
  95. package/mjs/utils/reflection/inheritance.mjs.map +1 -1
  96. package/mjs/utils/reflection/isConstructor.d.mts +3 -3
  97. package/mjs/utils/reflection/isConstructor.d.mts.map +1 -1
  98. package/mjs/utils/reflection/isConstructor.mjs +7 -7
  99. package/mjs/utils/reflection/isConstructor.mjs.map +1 -1
  100. package/mjs/utils/reflection/isGetterDescriptor.d.mts.map +1 -1
  101. package/mjs/utils/reflection/isGetterDescriptor.mjs.map +1 -1
  102. package/mjs/utils/reflection/listOwnGetters.d.mts.map +1 -1
  103. package/mjs/utils/reflection/listOwnGetters.mjs +4 -2
  104. package/mjs/utils/reflection/listOwnGetters.mjs.map +1 -1
  105. package/mjs/utils/reflection.d.mts +1 -1
  106. package/package.json +25 -24
  107. package/src/dotnet/GithubNugetRegistryInfo.ts +18 -15
  108. package/src/dotnet/GitlabNugetRegistryInfo.ts +28 -26
  109. package/src/dotnet/IsNextVersionAlreadyPublished.cli.ts +6 -6
  110. package/src/dotnet/MSBuildProject.ts +103 -106
  111. package/src/dotnet/MSBuildProjectProperties.ts +1 -1
  112. package/src/dotnet/NugetProjectProperties.ts +13 -18
  113. package/src/dotnet/NugetRegistryInfo.ts +287 -243
  114. package/src/dotnet/helpers.ts +58 -58
  115. package/src/insertPlugins.ts +3 -3
  116. package/src/semantic-release__github.d.ts +1 -0
  117. package/src/semanticReleaseConfigDotnet.ts +52 -54
  118. package/src/setupGitPluginSpec.ts +25 -26
  119. package/src/utils/env.ts +1 -0
  120. package/src/utils/execAsync.ts +16 -13
  121. package/src/utils/reflection/FunctionLike.d.ts +1 -0
  122. package/src/utils/reflection/InstancePropertyDescriptorMap.d.ts +4 -4
  123. package/src/utils/reflection/InstanceTypeOrSelfPropertyDescriptorMap.d.ts +6 -6
  124. package/src/utils/reflection/OwnGetterDescriptorMap.d.ts +2 -2
  125. package/src/utils/reflection/OwnKeyOf.d.ts +3 -3
  126. package/src/utils/reflection/OwnPropertyDescriptorMap.d.ts +3 -3
  127. package/src/utils/reflection/PropertyDescriptorMap.d.ts +3 -3
  128. package/src/utils/reflection/filterForGetters.ts +10 -10
  129. package/src/utils/reflection/getOwnPropertyDescriptors.ts +2 -2
  130. package/src/utils/reflection/getOwnPropertyDescriptorsRecursively.ts +13 -13
  131. package/src/utils/reflection/getPrototypeChainOf.ts +17 -17
  132. package/src/utils/reflection/getPrototypeOf.ts +2 -2
  133. package/src/utils/reflection/inheritance.ts +5 -4
  134. package/src/utils/reflection/isConstructor.ts +7 -7
  135. package/src/utils/reflection/listOwnGetters.ts +8 -8
  136. package/tsconfig.base.json +2 -0
@@ -71,17 +71,6 @@ const msbuildEvaluationOutput = type({
71
71
  "TargetResults?": type({ "[string]": targetSuccess.or(targetFailure) })
72
72
  });
73
73
  var MSBuildEvaluationOutput = class {
74
- /**
75
- * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation.
76
- * May be the UTF-8 string-encoded JSON or the object decoded from that JSON.
77
- */
78
- constructor(rawMSBuildEvaluation) {
79
- /** `.assert` instead of `.from` to allow `unknown` JSON.parse return type */
80
- const knownObject = msbuildEvaluationOutput.assert(typeof rawMSBuildEvaluation === "string" ? JSON.parse(rawMSBuildEvaluation) : rawMSBuildEvaluation);
81
- this.Properties = knownObject.Properties;
82
- this.Items = knownObject.Items;
83
- this.TargetResults = knownObject.TargetResults;
84
- }
85
74
  /**
86
75
  * The specified properties and their values as evaluated by MSBuild Core.
87
76
  * `-getProperty:{propertyName,...}`
@@ -99,6 +88,17 @@ var MSBuildEvaluationOutput = class {
99
88
  * `-getTargetResult:{targetName,...}`
100
89
  */
101
90
  TargetResults;
91
+ /**
92
+ * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation.
93
+ * May be the UTF-8 string-encoded JSON or the object decoded from that JSON.
94
+ */
95
+ constructor(rawMSBuildEvaluation) {
96
+ /** `.assert` instead of `.from` to allow `unknown` JSON.parse return type */
97
+ const knownObject = msbuildEvaluationOutput.assert(typeof rawMSBuildEvaluation === "string" ? JSON.parse(rawMSBuildEvaluation) : rawMSBuildEvaluation);
98
+ this.Properties = knownObject.Properties;
99
+ this.Items = knownObject.Items;
100
+ this.TargetResults = knownObject.TargetResults;
101
+ }
102
102
  };
103
103
  const EvaluationOptions = Object.freeze(type({
104
104
  /**
@@ -155,30 +155,6 @@ var MSBuildProject = class MSBuildProject {
155
155
  "RuntimeIdentifiers"
156
156
  ]);
157
157
  /**
158
- * Creates an instance of MSBuildProject.
159
- * @param opts The order-independent arguments for this constructor.
160
- * Properties may be added or moved around in this definition without
161
- * breaking compatibility.
162
- * @param opts.fullPath The full path of the MSBuild project's file. This
163
- * should have a '.csproj', '.fsproj', or '.vbproj' file extension.
164
- * @param opts.projTargets A list of MSBuild Targets supported by the project.
165
- * @param opts.evaluation The output of an MSBuild project evaluation. This
166
- * comprises MSBuild Properties, Items, and Target results.
167
- */
168
- constructor(opts) {
169
- this.Items = opts.evaluation.Items ?? {};
170
- this.Properties = new NugetProjectProperties(opts.fullPath, new CaseInsensitiveMap(Object.entries(opts.evaluation.Properties ?? {})));
171
- this.Targets = opts.projTargets;
172
- this.TargetResults = opts.evaluation.TargetResults === void 0 ? [] : [opts.evaluation.TargetResults];
173
- }
174
- Items;
175
- Properties;
176
- Targets;
177
- /**
178
- * Allows appending subsequent target results.
179
- */
180
- TargetResults;
181
- /**
182
158
  * @param projectPath The full path of the project file or its directory. A
183
159
  * relative path may be passed, but will resolve relative to the current
184
160
  * working directory.
@@ -195,10 +171,8 @@ var MSBuildProject = class MSBuildProject {
195
171
  * -ts:out.txt
196
172
  */
197
173
  static async GetTargets(projectPath, includeNonPublic = false) {
198
- return execAsync(`dotnet msbuild ${projectPath} -targets`, true).then((v) => {
199
- const targets = v.stdout.split("\n").filter((v, index) => v !== "" && index !== 0).map((v) => v.replaceAll("\r", "")).sort((a, b) => a.localeCompare(b));
200
- return includeNonPublic ? targets : targets.filter((v) => !v.startsWith("_"));
201
- });
174
+ const targets = (await execAsync(`dotnet msbuild ${projectPath} -targets`, true)).stdout.split("\n").filter((v, index) => v !== "" && index !== 0).map((v) => v.replaceAll("\r", "")).sort((a, b) => a.localeCompare(b));
175
+ return includeNonPublic ? targets : targets.filter((v) => !v.startsWith("_"));
202
176
  }
203
177
  /**
204
178
  * Evaluate {@link Items}, {@link Properties}, and {@link TargetResults},
@@ -215,24 +189,28 @@ var MSBuildProject = class MSBuildProject {
215
189
  if (options.GetProperty.length === 0 && options.GetItem.length === 0 && options.GetTargetResult.length === 0) throw new Error("No MSBuild Property, Item, or TargetResult queries were provided.");
216
190
  options.FullName = MSBuildProjectProperties.GetFullPath(options.FullName);
217
191
  const _pairs = Object.entries(options.Property).filter((p) => typeof p[1] === "string");
218
- const property = _pairs.length === 0 ? "" : `-p:"${_pairs.map((pair) => pair[0] + "=" + pair[1]).join(";")}"`;
219
- const target = options.Targets.length === 0 ? "" : `"-t:${options.Targets.join(";")}"`;
220
- const getItem = options.GetItem.length === 0 ? "" : `-getItem:"${options.GetItem.join(",")}"`;
221
- const getProperty = options.GetProperty.length === 0 ? "" : `-getProperty:"${options.GetProperty.join(",")}"`;
222
- const getTargetResult = options.GetTargetResult.length === 0 ? "" : `-getTargetResult:"${options.GetTargetResult.join(",")}"`;
223
- const cmdLine = [
192
+ const string_property = _pairs.length === 0 ? "" : `-p:"${_pairs.map((pair) => pair[0] + "=" + pair[1]).join(";")}"`;
193
+ const string_target = options.Targets.length === 0 ? "" : `"-t:${options.Targets.join(";")}"`;
194
+ const string_getItem = options.GetItem.length === 0 ? "" : `-getItem:"${options.GetItem.join(",")}"`;
195
+ const string_getProperty = options.GetProperty.length === 0 ? "" : `-getProperty:"${options.GetProperty.join(",")}"`;
196
+ const string_getTargetResult = options.GetTargetResult.length === 0 ? "" : `-getTargetResult:"${options.GetTargetResult.join(",")}"`;
197
+ const commandLine = [
224
198
  "dotnet",
225
199
  "msbuild",
226
200
  `"${options.FullName}"`,
227
201
  "-restore",
228
- property,
229
- target,
230
- getItem,
231
- getProperty,
232
- getTargetResult
202
+ string_property,
203
+ string_target,
204
+ string_getItem,
205
+ string_getProperty,
206
+ string_getTargetResult
233
207
  ].filter((v) => v !== "").join(" ");
234
- let stdio = void 0;
235
- while (stdio === void 0) stdio = await setTimeout(1e3, execAsync(cmdLine, true)).then(async (p) => await p).catch(catchEBUSY);
208
+ let stdio;
209
+ while (stdio === void 0) try {
210
+ stdio = await setTimeout(1e3, execAsync(commandLine, true));
211
+ } catch (error) {
212
+ catchEBUSY(error);
213
+ }
236
214
  /**
237
215
  * The following issues have triggered this code path:
238
216
  * - BaseIntermediateOutputPath must use Unix path separators ('/') on all
@@ -252,7 +230,7 @@ var MSBuildProject = class MSBuildProject {
252
230
  const evaluation = new MSBuildEvaluationOutput(rawOutput);
253
231
  return new MSBuildProject({
254
232
  fullPath: options.FullName,
255
- projTargets: await MSBuildProject.GetTargets(options.FullName),
233
+ projTargets: await this.GetTargets(options.FullName),
256
234
  evaluation
257
235
  });
258
236
  }
@@ -268,7 +246,7 @@ var MSBuildProject = class MSBuildProject {
268
246
  * If applicable, a project's "Pack" target is evaluated.
269
247
  */
270
248
  static async PackableProjectsToMSBuildProjects(projectsToPackAndPush) {
271
- return await toDirEntries(typeof projectsToPackAndPush === "string" ? [projectsToPackAndPush] : projectsToPackAndPush).then((direntArray) => direntArray.map((element) => convertDirentToMSBuildProject(element)));
249
+ return (await toDirectoryEntries(typeof projectsToPackAndPush === "string" ? [projectsToPackAndPush] : projectsToPackAndPush)).map((element) => convertDirentToMSBuildProject(element));
272
250
  /**
273
251
  * Map an array of filesystem paths to {@link Dirent} instances representing project files.
274
252
  * @param projectsToPackAndPush An array of MSBuild projects' full file
@@ -277,7 +255,7 @@ var MSBuildProject = class MSBuildProject {
277
255
  * https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\
278
256
  * @returns An promised array of Dirent instances for discovered project files.
279
257
  */
280
- async function toDirEntries(projectsToPackAndPush) {
258
+ async function toDirectoryEntries(projectsToPackAndPush) {
281
259
  return (await Promise.all(projectsToPackAndPush.map(async (proj) => {
282
260
  proj = await realpath(makeAbsolute(proj));
283
261
  const stats = await stat(proj);
@@ -286,7 +264,7 @@ var MSBuildProject = class MSBuildProject {
286
264
  entries = await readdir(path.dirname(proj), { withFileTypes: true });
287
265
  const dirent = entries.find((v) => path.join(("path" in v ? v.path : void 0) ?? v.parentPath, v.name) === proj);
288
266
  if (dirent) return dirent;
289
- else throw new Error(`file "${proj}" not found. It may have been moved or deleted.`);
267
+ throw new Error(`file "${proj}" not found. It may have been moved or deleted.`);
290
268
  }
291
269
  if (!stats.isDirectory()) throw new Error(`"${proj}" is not a file or directory`);
292
270
  entries = await readdir(proj, { withFileTypes: true });
@@ -300,12 +278,12 @@ var MSBuildProject = class MSBuildProject {
300
278
  */
301
279
  async function convertDirentToMSBuildProject(dirent) {
302
280
  const fullPath = path.join(("path" in dirent ? dirent.path : void 0) ?? dirent.parentPath, dirent.name);
303
- const evalTargets = await MSBuildProject.GetTargets(fullPath).then((v) => v.includes("Pack") ? ["Pack"] : []);
304
- const getProperties = NPPGetterNames.InstanceGettersRecursive;
281
+ const evalTargets = (await MSBuildProject.GetTargets(fullPath)).includes("Pack") ? ["Pack"] : [];
282
+ const propertiesToEvaluate = NPPGetterNames.InstanceGettersRecursive;
305
283
  return await MSBuildProject.Evaluate(EvaluationOptions.from({
306
284
  FullName: fullPath,
307
285
  GetItem: [],
308
- GetProperty: getProperties,
286
+ GetProperty: propertiesToEvaluate,
309
287
  GetTargetResult: [],
310
288
  Property: {},
311
289
  Targets: evalTargets
@@ -314,11 +292,35 @@ var MSBuildProject = class MSBuildProject {
314
292
  }
315
293
  static fromJSON(json) {
316
294
  const parsed = T_PseudoMSBPInstance.assert(JSON.parse(json));
317
- type.true.assert(Reflect.setPrototypeOf(parsed, MSBuildProject.prototype));
295
+ type.true.assert(Reflect.setPrototypeOf(parsed, this.prototype));
318
296
  type.true.assert(Reflect.setPrototypeOf(parsed.Properties, NugetProjectProperties.prototype));
319
297
  parsed.Properties = T_NPP.assert(parsed.Properties);
320
298
  return T_MSBuildProject.assert(parsed);
321
299
  }
300
+ Items;
301
+ Properties;
302
+ Targets;
303
+ /**
304
+ * Allows appending subsequent target results.
305
+ */
306
+ TargetResults;
307
+ /**
308
+ * Creates an instance of MSBuildProject.
309
+ * @param opts The order-independent arguments for this constructor.
310
+ * Properties may be added or moved around in this definition without
311
+ * breaking compatibility.
312
+ * @param opts.fullPath The full path of the MSBuild project's file. This
313
+ * should have a '.csproj', '.fsproj', or '.vbproj' file extension.
314
+ * @param opts.projTargets A list of MSBuild Targets supported by the project.
315
+ * @param opts.evaluation The output of an MSBuild project evaluation. This
316
+ * comprises MSBuild Properties, Items, and Target results.
317
+ */
318
+ constructor(opts) {
319
+ this.Items = opts.evaluation.Items ?? {};
320
+ this.Properties = new NugetProjectProperties(opts.fullPath, new CaseInsensitiveMap(Object.entries(opts.evaluation.Properties ?? {})));
321
+ this.Targets = opts.projTargets;
322
+ this.TargetResults = opts.evaluation.TargetResults === void 0 ? [] : [opts.evaluation.TargetResults];
323
+ }
322
324
  };
323
325
  const T_MSBuildProject = type.instanceOf(MSBuildProject);
324
326
  const T_NPP = type.instanceOf(NugetProjectProperties);
@@ -374,10 +376,10 @@ function makeAbsolute(_path) {
374
376
  function catchEBUSY(error) {
375
377
  if (isError(error)) if ("stderr" in error && typeof error.stderr === "string") {
376
378
  const normalizedStderr = error.stderr.normalize("NFKC");
377
- const hasErrMsgPattern = /The process cannot access the file '[^']+' because it is being used by another process\./gm.test(normalizedStderr);
379
+ const hasErrorMessagePattern = /The process cannot access the file '[^']+' because it is being used by another process\./gm.test(normalizedStderr);
378
380
  const isCS2012 = /^CSC ?:.+CS2012:/gm.test(normalizedStderr);
379
- const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr) && hasErrMsgPattern;
380
- if (isCS2012 || isAVLN9999 || hasErrMsgPattern) return void 0;
381
+ const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr) && hasErrorMessagePattern;
382
+ if (isCS2012 || isAVLN9999 || hasErrorMessagePattern) return void 0;
381
383
  } else throw error;
382
384
  else throw new Error("unknown error", { cause: error });
383
385
  }
@@ -390,9 +392,29 @@ function catchEBUSY(error) {
390
392
  * @deprecated Use {@link catchEBUSY}.
391
393
  */
392
394
  function catchCsc2012(error) {
393
- if (isError(error)) if ("stderr" in error && typeof error.stderr === "string" && /^CSC ?:.+CS2012:/gm.test(error.stderr.normalize("NFKC"))) return;
394
- else throw error;
395
- else throw new Error("unknown error", { cause: error });
395
+ if (isError(error)) {
396
+ if ("stderr" in error && typeof error.stderr === "string" && /^CSC ?:.+CS2012:/gm.test(error.stderr.normalize("NFKC"))) return;
397
+ /**
398
+ * some known warnings/errors:
399
+ * - warning MSB3073:
400
+ * The command "dotnet tool list kuinox.nupkgdeterministicator"
401
+ * exited with code 145.
402
+ * > $ dotnet tool list kuinox.nupkgdeterministicator
403
+ * > The command could not be loaded, possibly because:
404
+ * > * You intended to execute a .NET application:
405
+ * > The application 'tool' does not exist.
406
+ * > * You intended to execute a .NET SDK command:
407
+ * > No .NET SDKs were found.
408
+ * >
409
+ * > Download a .NET SDK:
410
+ * > https://aka.ms/dotnet/download
411
+ * >
412
+ * > Learn about SDK resolution:
413
+ * > https://aka.ms/dotnet/sdk-not-found
414
+ */
415
+ throw error;
416
+ }
417
+ throw new Error("unknown error", { cause: error });
396
418
  }
397
419
  //#endregion
398
420
  export { EvaluationOptions, MSBuildEvaluationOutput, MSBuildProject, _InternalMSBuildEvaluationTypes, catchCsc2012, catchEBUSY };
@@ -1 +1 @@
1
- {"version":3,"file":"MSBuildProject.mjs","names":[],"sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":["import { type, type Scope, type Type } from 'arktype';\nimport { warn } from 'node:console';\nimport { type Dirent } from 'node:fs';\nimport { readdir, realpath, stat } from 'node:fs/promises';\n// eslint-disable-next-line unicorn/import-style\nimport * as path from 'node:path';\nimport { setTimeout } from 'node:timers/promises';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport { execAsync } from '../utils/execAsync.ts';\nimport { isError } from '../utils/isError.ts';\nimport { MSBuildProjectProperties } from './MSBuildProjectProperties.ts';\nimport {\n NPPGetterNames,\n NugetProjectProperties,\n} from './NugetProjectProperties.ts';\n\n/**\n * See [MSBuild well-known item metadata](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-well-known-item-metadata).\n * Additional string-type properties may be present (e.g. `{ SubType: \"designer\" }`).\n */\nconst interface_ItemMetadataBuiltIn = type({\n '[string]': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n Identity: 'string',\n /** @example \"Designer\" */\n 'SubType?': 'string',\n /** @example \".NETCoreApp\" */\n 'TargetFrameworkIdentifier?': 'string',\n 'TargetPlatformMoniker?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ConsoleApp1.csproj.CopyComplete\" */\n 'CopyUpToDateMarker?': 'string',\n 'TargetPlatformIdentifier?': 'string',\n /** @example \"6.0\" */\n 'TargetFrameworkVersion?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ref\\\\ConsoleApp1.dll\" */\n 'ReferenceAssembly?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n FullPath: 'string',\n /** @example \"c:\\\\\" */\n RootDir: 'string',\n /** @example \"ConsoleApp1\" */\n Filename: 'string',\n /** @example \".dll\" */\n Extension: 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n RelativeDir: 'string',\n /** @example \"source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n Directory: 'string',\n RecursiveDir: 'string',\n /** @example \"2023-11-30 13:38:06.5084339\" */\n ModifiedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9308716\" */\n CreatedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9318732\" */\n AccessedTime: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\Microsoft.Common.CurrentVersion.targets\" */\n DefiningProjectFullPath: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\\" */\n DefiningProjectDirectory: 'string',\n /** @example \"Microsoft.Common.CurrentVersion\" */\n DefiningProjectName: 'string',\n /** @example \".targets\" */\n DefiningProjectExtension: 'string',\n});\n\nconst targetSuccess = type({\n Result: '\\'Success\\'',\n Items: interface_ItemMetadataBuiltIn.array(),\n});\n\nconst targetFailure = type({\n Result: '\\'Failure\\'',\n Items: 'never[]',\n});\n\nconst msbuildEvaluationOutput: Type<{\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n}> = type({\n 'Properties?': type({ '[string]': 'string' }),\n 'Items?': type({ '[string]': interface_ItemMetadataBuiltIn.array() }),\n 'TargetResults?': type({ '[string]': targetSuccess.or(targetFailure) }),\n});\n\nexport class MSBuildEvaluationOutput {\n /**\n * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation.\n * May be the UTF-8 string-encoded JSON or the object decoded from that JSON.\n */\n constructor(rawMSBuildEvaluation: Parameters<typeof JSON.parse>[0] | Parameters<typeof msbuildEvaluationOutput.from>[0]) {\n /** `.assert` instead of `.from` to allow `unknown` JSON.parse return type */\n const knownObject = msbuildEvaluationOutput.assert(typeof rawMSBuildEvaluation === 'string' ? JSON.parse(rawMSBuildEvaluation) : rawMSBuildEvaluation);\n\n this.Properties = knownObject.Properties;\n this.Items = knownObject.Items;\n this.TargetResults = knownObject.TargetResults;\n }\n\n /**\n * The specified properties and their values as evaluated by MSBuild Core.\n * `-getProperty:{propertyName,...}`\n */\n Properties?: typeof msbuildEvaluationOutput.infer.Properties;\n /**\n * The specified items and their values and associated metadata as evaluated\n * by MSBuild Core.\n * `-getItem:{itemName,...}`\n */\n Items?: typeof msbuildEvaluationOutput.infer.Items;\n /**\n * The specified Targets and their output values as evaluated by MSBuild\n * Core.\n * `-getTargetResult:{targetName,...}`\n */\n TargetResults?: typeof msbuildEvaluationOutput.infer.TargetResults;\n}\n\nexport const EvaluationOptions: Type<{\n FullName: string;\n Property: {\n MSBuildProjectFullPath?: string | undefined;\n AssemblyName?: string | undefined;\n BaseIntermediateOutputPath?: string | undefined;\n BaseOutputPath?: string | undefined;\n Description?: string | undefined;\n IntermediateOutput?: string | undefined;\n OutDir?: string | undefined;\n OutputPath?: string | undefined;\n Version?: string | undefined;\n VersionPrefix?: string | undefined;\n VersionSuffix?: string | undefined;\n TargetFramework?: string | undefined;\n TargetFrameworks?: string | undefined;\n RuntimeIdentifier?: string | undefined;\n RuntimeIdentifiers?: string | undefined;\n };\n Targets: readonly string[] | string[];\n GetItem: readonly string[] | string[];\n GetProperty: readonly string[] | string[];\n GetTargetResult: readonly string[] | string[];\n}> = Object.freeze(\n type({\n /**\n * The project file's full path.\n */\n FullName: 'string',\n /**\n * User-defined Properties and their values.\n * { Configuration: \"Release\" } will cause the MSBuild to first set the\n * Configuration property to Release before evaluating the project\n * or the project's Target(s).\n * ```txt\n * -property:<n>=<v> Set or override these project-level properties. <n> is\n * the property name, and <v> is the property value. Use a\n * semicolon or a comma to separate multiple properties, or\n * specify each property separately. (Short form: -p)\n * Example:\n * -property:WarningLevel=2;OutDir=bin\\Debug\\\n * ```\n */\n Property: type({ '[string]': 'string' })\n .as<{ -readonly [P in keyof MSBuildProjectProperties]: MSBuildProjectProperties[P] }>()\n .partial(),\n /**\n * The MSBuild Targets to run for evaluation. [\"Pack\"] is recommended.\n * Property values may be changed by Targets such as those provided by\n * dependencies.\n *\n * ```txt\n * -target:<targets> Build these targets in this project. Use a semicolon or a\n * comma to separate multiple targets, or specify each\n * target separately. (Short form: -t)\n * Example:\n * -target:Resources;Compile\n * ```\n * @default []\n */\n Targets: type.string.array().readonly().or('string[]'),\n /**\n * MSBuild Items to evaluate. `[\"Compile\"]` will result in the MSBuild output\n * including {@link MSBuild}\n */\n GetItem: type.string.array().readonly().or('string[]'),\n GetProperty: type.string.array().readonly().or('string[]'),\n GetTargetResult: type.string.array().readonly().or('string[]'),\n }),\n);\n\nexport class MSBuildProject {\n /**\n * Properties for multi-targeting `dotnet publish` outputs.\n * These are included in {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n public static readonly MatrixProperties: readonly string[] = Object.freeze([\n 'TargetFramework',\n 'TargetFrameworks',\n 'RuntimeIdentifier',\n 'RuntimeIdentifiers',\n ]);\n\n /**\n * Creates an instance of MSBuildProject.\n * @param opts The order-independent arguments for this constructor.\n * Properties may be added or moved around in this definition without\n * breaking compatibility.\n * @param opts.fullPath The full path of the MSBuild project's file. This\n * should have a '.csproj', '.fsproj', or '.vbproj' file extension.\n * @param opts.projTargets A list of MSBuild Targets supported by the project.\n * @param opts.evaluation The output of an MSBuild project evaluation. This\n * comprises MSBuild Properties, Items, and Target results.\n */\n public constructor(opts: {\n fullPath: string;\n projTargets: string[];\n evaluation: MSBuildEvaluationOutput;\n }) {\n this.Items = opts.evaluation.Items ?? {};\n this.Properties = new NugetProjectProperties(\n opts.fullPath,\n new CaseInsensitiveMap<string, string>(\n Object.entries(opts.evaluation.Properties ?? {}),\n ),\n );\n this.Targets = opts.projTargets;\n this.TargetResults\n = opts.evaluation.TargetResults === undefined\n ? []\n : [opts.evaluation.TargetResults];\n }\n\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n /**\n * Allows appending subsequent target results.\n */\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n\n /**\n * @param projectPath The full path of the project file or its directory. A\n * relative path may be passed, but will resolve relative to the current\n * working directory.\n * @param includeNonPublic Include conventionally internal/private MSBuild\n * targets in the result.\n * @returns A string array of the project's MSBuild targets.\n * @todo consider 'file' of -targets[:file]\n * Prints a list of available targets without executing the\n * actual build process. By default the output is written to\n * the console window. If the path to an output file\n * is provided that will be used instead.\n * (Short form: -ts)\n * Example:\n * -ts:out.txt\n */\n static async GetTargets(\n projectPath: string,\n includeNonPublic = false,\n ): Promise<string[]> {\n return execAsync(`dotnet msbuild ${projectPath} -targets`, true)\n .then((v) => {\n const targets = v.stdout\n .split('\\n')\n .filter((v, index) => v !== '' && index !== 0)\n .map(v => v.replaceAll('\\r', ''))\n .sort((a, b) => a.localeCompare(b));\n return includeNonPublic\n ? targets\n : targets.filter(v => !v.startsWith('_'));\n });\n }\n\n /**\n * Evaluate {@link Items}, {@link Properties}, and {@link TargetResults},\n * returning them as an instance of {@link MSBuildProject}.\\\n * Note: MSBuild will probably fail if Restore is skipped and another\n * target is specified. If you choose Pack, you must do ['Restore', 'Pack'].\n * @param options The result of {@link EvaluationOptions.from}.\n * @returns A promised {@link MSBuildProject} instance.\n * @throws {Error} if the exec command fails -OR- the JSON parse fails -OR-\n * MSBuildProject's constructor fails.\n * @see {@link PackableProjectsToMSBuildProjects} for most use-cases.\n */\n public static async Evaluate(\n options: typeof EvaluationOptions.inferOut,\n ): Promise<MSBuildProject> {\n if (\n options.GetProperty.length === 0\n && options.GetItem.length === 0\n && options.GetTargetResult.length === 0\n ) {\n throw new Error(\n 'No MSBuild Property, Item, or TargetResult queries were provided.',\n );\n }\n // reminder: args containing spaces and semi-colons MUST be quote-enclosed!\n options.FullName = MSBuildProjectProperties.GetFullPath(options.FullName);\n const _pairs = Object.entries(options.Property).filter(p => typeof p[1] === 'string');\n const property\n = _pairs.length === 0\n ? ''\n : `-p:\"${_pairs.map(pair => pair[0] + '=' + pair[1]).join(';')}\"`;\n const target\n = options.Targets.length === 0\n ? ''\n : `\"-t:${options.Targets.join(';')}\"`;\n const getItem\n = options.GetItem.length === 0\n ? ''\n : `-getItem:\"${options.GetItem.join(',')}\"`;\n const getProperty\n = options.GetProperty.length === 0\n ? ''\n : `-getProperty:\"${options.GetProperty.join(',')}\"`;\n const getTargetResult\n = options.GetTargetResult.length === 0\n ? ''\n : `-getTargetResult:\"${options.GetTargetResult.join(',')}\"`;\n const cmdLine = [\n 'dotnet',\n 'msbuild',\n `\"${options.FullName}\"`,\n '-restore',\n property,\n target,\n getItem,\n getProperty,\n getTargetResult,\n ]\n .filter(v => v !== '')\n .join(' ');\n let stdio: Awaited<ReturnType<typeof execAsync>> | undefined = undefined;\n // may throw\n while (stdio === undefined) {\n stdio = await setTimeout(\n 1000,\n execAsync(cmdLine, true),\n )\n .then(async p => await p)\n .catch<undefined>(catchEBUSY);\n }\n\n // todo: consider -getResultOutputFile:file\n // Redirect output from get* into a file.\n //\n // Example:\n // -getProperty:Bar -getResultOutputFile:Biz.txt\n // This writes the value of property Bar into Biz.txt.\n\n /**\n * The following issues have triggered this code path:\n * - BaseIntermediateOutputPath must use Unix path separators ('/') on all\n * platforms. Even Windows. Otherwise, MSBuild/dotnet will error-exit with\n * \"The BaseIntermediateOutputPath must end with a trailing slash\".\n */\n if (stdio.stdout.startsWith('MSBuild version')) {\n warn(stdio.stdout);\n throw new Error(\n 'dotnet msbuild was expected to output JSON, but output its version header instead.',\n );\n }\n\n let rawOutput: ConstructorParameters<typeof MSBuildEvaluationOutput>[0];\n if (stdio.stdout.startsWith('{')) {\n /** stdout is JSON string */\n rawOutput = stdio.stdout;\n }\n else if (options.GetProperty.length > 0 && options.GetProperty[0] !== undefined) {\n rawOutput = {\n Properties: {\n [options.GetProperty[0]]: String(JSON.parse(stdio.stdout)),\n },\n };\n }\n else {\n throw new Error('Dotnet/MSBuild evaluation output is not a string nor JSON object or array.');\n }\n\n const evaluation = new MSBuildEvaluationOutput(rawOutput);\n\n return new MSBuildProject({\n fullPath: options.FullName,\n projTargets: await MSBuildProject.GetTargets(options.FullName),\n evaluation,\n });\n }\n\n /**\n * Evaluate multiple project paths with some default Evaluate options.\n * @async\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files.\n * See https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns A promised array of {@link MSBuildProject} instances.\n * All known MSBuild and NuGet properties are evaluated.\n * If applicable, a project's \"Pack\" target is evaluated.\n */\n public static async PackableProjectsToMSBuildProjects(\n projectsToPackAndPush: string[],\n ): Promise<Promise<MSBuildProject>[]> {\n const dirEntriesPromise = toDirEntries(typeof projectsToPackAndPush === 'string' ? [projectsToPackAndPush] : projectsToPackAndPush);\n const projectPromises: Promise<MSBuildProject>[] = await dirEntriesPromise\n .then(\n (direntArray: Dirent[]) =>\n direntArray.map(element => convertDirentToMSBuildProject(element)),\n );\n return projectPromises;\n\n /**\n * Map an array of filesystem paths to {@link Dirent} instances representing project files.\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files. See\n * https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns An promised array of Dirent instances for discovered project files.\n */\n async function toDirEntries(\n projectsToPackAndPush: string[],\n ): Promise<Dirent[]> {\n const dirEntries: (Dirent | Dirent[])[] = await Promise.all(\n projectsToPackAndPush.map(async (proj) => {\n proj = await realpath(makeAbsolute(proj));\n const stats = await stat(proj);\n let entries: Dirent[];\n\n if (stats.isFile()) {\n entries = await readdir(path.dirname(proj), { withFileTypes: true });\n const dirent: Dirent | undefined = entries.find(v =>\n path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in v ? v.path as string | undefined : undefined) ?? (v as unknown as Omit<typeof v, 'path'> & { parentPath: string }).parentPath,\n v.name,\n ) === proj,\n );\n if (dirent)\n return dirent;\n else\n throw new Error(\n `file \"${proj}\" not found. It may have been moved or deleted.`,\n );\n }\n if (!stats.isDirectory())\n throw new Error(`\"${proj}\" is not a file or directory`);\n\n entries = await readdir(proj, { withFileTypes: true });\n return entries.filter(v =>\n v.isFile()\n && (v.name.endsWith('.csproj') || v.name.endsWith('.fsproj') || v.name.endsWith('.vbproj')),\n );\n }),\n );\n\n return dirEntries.flat();\n }\n\n /**\n * Map a {@link Dirent} instance to an {@link MSBuildProject} instance.\n * @param dirent A {@link Dirent} instance. This instance should be an MSBuild project file.\n * @returns An instance of {@link MSBuildProject} evaluated with the `Pack` target result, if applicable. Evaluated properties will be those whose names are returned by {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n async function convertDirentToMSBuildProject(dirent: Dirent): Promise<MSBuildProject> {\n const fullPath = path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in dirent ? dirent.path as string | undefined : undefined) ?? (dirent as unknown as Omit<typeof dirent, 'path'> & { parentPath: string }).parentPath,\n dirent.name,\n );\n const projTargets: Promise<string[]> = MSBuildProject.GetTargets(fullPath);\n const evalTargets = await projTargets.then(v =>\n v.includes('Pack') ? ['Pack'] : [],\n );\n // this might be too long for a command line. What was it on Windows?\n // 2^15 (32,768) character limit for command lines?\n const getProperties = NPPGetterNames.InstanceGettersRecursive;\n\n return await MSBuildProject.Evaluate(\n EvaluationOptions.from({\n FullName: fullPath,\n GetItem: [],\n GetProperty: getProperties,\n GetTargetResult: [],\n Property: {},\n Targets: evalTargets,\n }),\n );\n }\n }\n\n public static fromJSON(json: string): MSBuildProject {\n const parsed = T_PseudoMSBPInstance.assert(JSON.parse(json));\n\n type.true.assert(\n Reflect.setPrototypeOf(parsed, MSBuildProject.prototype),\n );\n type.true.assert(\n Reflect.setPrototypeOf(parsed.Properties, NugetProjectProperties.prototype),\n );\n parsed.Properties = T_NPP.assert(parsed.Properties);\n return T_MSBuildProject.assert(parsed);\n }\n}\n\nconst T_MSBuildProject = type.instanceOf(MSBuildProject);\nconst T_NPP = type.instanceOf(NugetProjectProperties);\nconst T_PseudoMSBPInstance = type({\n Items: type({\n '[string]': type({\n '[string]': 'string',\n Identity: 'string',\n FullPath: 'string',\n RootDir: 'string',\n Filename: 'string',\n Extension: 'string',\n RelativeDir: 'string',\n Directory: 'string',\n RecursiveDir: 'string',\n ModifiedTime: 'string',\n CreatedTime: 'string',\n AccessedTime: 'string',\n DefiningProjectFullPath: 'string',\n DefiningProjectDirectory: 'string',\n DefiningProjectName: 'string',\n DefiningProjectExtension: 'string',\n 'SubType?': ' string | undefined',\n 'TargetFrameworkIdentifier?': 'string | undefined',\n 'TargetPlatformMoniker?': 'string | undefined',\n 'CopyUpToDateMarker?': 'string | undefined',\n 'TargetPlatformIdentifier?': 'string | undefined',\n 'TargetFrameworkVersion?': 'string | undefined',\n 'ReferenceAssembly?': 'string | undefined',\n }).array(),\n }),\n Properties: type.Record('string', 'string').or(T_NPP),\n Targets: type.string.array(),\n TargetResults: msbuildEvaluationOutput.get('TargetResults').exclude('undefined').array(),\n\n});\n\n/**\n * ArkType type definitions for internal usage, but may be re-used elsewhere\n * @internal\n */\nexport const _InternalMSBuildEvaluationTypes: Scope<{\n msbuildEvaluationOutput: {\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n };\n}> = type.scope({\n msbuildEvaluationOutput,\n});\n\n/**\n * Resolve a path if it is not already absolute.\n * @param _path A filesystem path.\n * @returns A full path to a filesystem entry. The path is unchecked for whether or not the path (or its parts) exist.\n */\nfunction makeAbsolute(_path: string) {\n return path.isAbsolute(_path) ? _path : path.resolve(_path);\n}\n\n/**\n * Use this in your catch statement or .catch call to return `undefined` when\n * a \"file in use by another process\" (i.e. EBUSY/ERROR_SHARING_VIOLATION) error is reported.\n * @param error Probably an Error object\n * @returns `undefined` if file in use by another process\n */\nexport function catchEBUSY(error: unknown): undefined {\n if (isError(error)) {\n if ('stderr' in error && typeof error.stderr === 'string') {\n // Normalize colon-like chars: '\\uFF1A'.normalize('NFKC') === ':' === true;\n const normalizedStderr = error.stderr.normalize('NFKC');\n const patternEN = /The process cannot access the file '[^']+' because it is being used by another process\\./gm;\n const hasErrMsgPattern = patternEN.test(normalizedStderr);\n const isCS2012 = /^CSC ?:.+CS2012:/gm.test(normalizedStderr);\n // generic error code; error message must be checked.\n const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr)\n && hasErrMsgPattern;\n if (isCS2012 || isAVLN9999 || hasErrMsgPattern)\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n else throw error;\n }\n else throw new Error('unknown error', { cause: error });\n}\n\n/**\n *\n * Use this in your catch statement or .catch call to return `undefined` when\n * MSBuild error CSC2012 (e.g. \"file in use by another process\") is reported.\n * @param error Probably an Error object\n * @returns `undefined` if CSC2012 (file in use by another process) occurs\n * @deprecated Use {@link catchEBUSY}.\n */\nexport function catchCsc2012(error: unknown): undefined {\n if (isError(error)) {\n // check for error reported when \"file in use by another process\" i.e. EBUSY\n // (UNIX), NTSTATUS.ERROR_SHARING_VIOLATION == 0x20 == 32 (Windows)\n if ('stderr' in error && typeof error.stderr === 'string'\n && /^CSC ?:.+CS2012:/gm.test(\n // '\\uFF1A'.normalize('NFKC') === ':' === true;\n error.stderr.normalize('NFKC'),\n )\n ) {\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n else throw error;\n }\n else throw new Error('unknown error', { cause: error });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,gCAAgC,KAAK;CACzC,YAAY;;CAEZ,UAAU;;CAEV,YAAY;;CAEZ,8BAA8B;CAC9B,0BAA0B;;CAE1B,uBAAuB;CACvB,6BAA6B;;CAE7B,2BAA2B;;CAE3B,sBAAsB;;CAEtB,UAAU;;CAEV,SAAS;;CAET,UAAU;;CAEV,WAAW;;CAEX,aAAa;;CAEb,WAAW;CACX,cAAc;;CAEd,cAAc;;CAEd,aAAa;;CAEb,cAAc;;CAEd,yBAAyB;;CAEzB,0BAA0B;;CAE1B,qBAAqB;;CAErB,0BAA0B;CAC3B,CAAC;AAEF,MAAM,gBAAgB,KAAK;CACzB,QAAQ;CACR,OAAO,8BAA8B,OAAO;CAC7C,CAAC;AAEF,MAAM,gBAAgB,KAAK;CACzB,QAAQ;CACR,OAAO;CACR,CAAC;AAEF,MAAM,0BA0DD,KAAK;CACR,eAAe,KAAK,EAAE,YAAY,UAAU,CAAC;CAC7C,UAAU,KAAK,EAAE,YAAY,8BAA8B,OAAO,EAAE,CAAC;CACrE,kBAAkB,KAAK,EAAE,YAAY,cAAc,GAAG,cAAc,EAAE,CAAC;CACxE,CAAC;AAEF,IAAa,0BAAb,MAAqC;;;;;CAKnC,YAAY,sBAA6G;;EAEvH,MAAM,cAAc,wBAAwB,OAAO,OAAO,yBAAyB,WAAW,KAAK,MAAM,qBAAqB,GAAG,qBAAqB;EAEtJ,KAAK,aAAa,YAAY;EAC9B,KAAK,QAAQ,YAAY;EACzB,KAAK,gBAAgB,YAAY;;;;;;CAOnC;;;;;;CAMA;;;;;;CAMA;;AAGF,MAAa,oBAuBR,OAAO,OACV,KAAK;;;;CAIH,UAAU;;;;;;;;;;;;;;;CAeV,UAAU,KAAK,EAAE,YAAY,UAAU,CAAC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AAwB,IAAI,gBAAgB,CAAC,QAAQ,YAAY,CAAC,OAAO;CAEzF,CAAC;;;;;AAMF,MAAa,kCA4DR,KAAK,MAAM,EACd,yBACD,CAAC;;;;;;AAOF,SAAS,aAAa,OAAe;CACnC,OAAO,KAAK,WAAW,MAAM,GAAG,QAAQ,KAAK,QAAQ,MAAM;;;;;;;;AAS7D,SAAgB,WAAW,OAA2B;CACpD,IAAI,QAAQ,MAAM,EAChB,IAAI,YAAY,SAAS,OAAO,MAAM,WAAW,UAAU;EAEzD,MAAM,mBAAmB,MAAM,OAAO,UAAU,OAAO;EAEvD,MAAM,mBAAmB,6FAAU,KAAK,iBAAiB;EACzD,MAAM,WAAW,qBAAqB,KAAK,iBAAiB;EAE5D,MAAM,aAAa,cAAc,KAAK,iBAAiB,IAClD;EACL,IAAI,YAAY,cAAc,kBAE5B,OAAO,KAAA;QAoBN,MAAM;MAER,MAAM,IAAI,MAAM,iBAAiB,EAAE,OAAO,OAAO,CAAC;;;;;;;;;;AAWzD,SAAgB,aAAa,OAA2B;CACtD,IAAI,QAAQ,MAAM,EAGhB,IAAI,YAAY,SAAS,OAAO,MAAM,WAAW,YAC5C,qBAAqB,KAEtB,MAAM,OAAO,UAAU,OAAO,CAC/B,EAGD;MAoBG,MAAM;MAER,MAAM,IAAI,MAAM,iBAAiB,EAAE,OAAO,OAAO,CAAC"}
1
+ {"version":3,"file":"MSBuildProject.mjs","names":[],"sources":["../../src/dotnet/MSBuildProject.ts"],"sourcesContent":["import { type, type Scope, type Type } from 'arktype';\nimport { warn } from 'node:console';\nimport { type Dirent } from 'node:fs';\nimport { readdir, realpath, stat } from 'node:fs/promises';\n// eslint-disable-next-line unicorn/import-style\nimport * as path from 'node:path';\nimport { setTimeout } from 'node:timers/promises';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport { execAsync } from '../utils/execAsync.ts';\nimport { isError } from '../utils/isError.ts';\nimport { MSBuildProjectProperties } from './MSBuildProjectProperties.ts';\nimport {\n NPPGetterNames,\n NugetProjectProperties,\n} from './NugetProjectProperties.ts';\n\n/**\n * See [MSBuild well-known item metadata](https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-well-known-item-metadata).\n * Additional string-type properties may be present (e.g. `{ SubType: \"designer\" }`).\n */\nconst interface_ItemMetadataBuiltIn = type({\n '[string]': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n Identity: 'string',\n /** @example \"Designer\" */\n 'SubType?': 'string',\n /** @example \".NETCoreApp\" */\n 'TargetFrameworkIdentifier?': 'string',\n 'TargetPlatformMoniker?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ConsoleApp1.csproj.CopyComplete\" */\n 'CopyUpToDateMarker?': 'string',\n 'TargetPlatformIdentifier?': 'string',\n /** @example \"6.0\" */\n 'TargetFrameworkVersion?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\obj\\\\Debug\\\\net6.0\\\\ref\\\\ConsoleApp1.dll\" */\n 'ReferenceAssembly?': 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\ConsoleApp1.dll\" */\n FullPath: 'string',\n /** @example \"c:\\\\\" */\n RootDir: 'string',\n /** @example \"ConsoleApp1\" */\n Filename: 'string',\n /** @example \".dll\" */\n Extension: 'string',\n /** @example \"c:\\\\source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n RelativeDir: 'string',\n /** @example \"source\\\\repos\\\\ConsoleApp1\\\\ConsoleApp1\\\\bin\\\\Debug\\\\net6.0\\\\\" */\n Directory: 'string',\n RecursiveDir: 'string',\n /** @example \"2023-11-30 13:38:06.5084339\" */\n ModifiedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9308716\" */\n CreatedTime: 'string',\n /** @example \"2023-11-30 13:38:06.9318732\" */\n AccessedTime: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\Microsoft.Common.CurrentVersion.targets\" */\n DefiningProjectFullPath: 'string',\n /** @example \"C:\\\\Program Files\\\\Microsoft Visual Studio\\\\2022\\\\Preview\\\\MSBuild\\\\Current\\\\Bin\\\\amd64\\\\\" */\n DefiningProjectDirectory: 'string',\n /** @example \"Microsoft.Common.CurrentVersion\" */\n DefiningProjectName: 'string',\n /** @example \".targets\" */\n DefiningProjectExtension: 'string',\n});\n\nconst targetSuccess = type({\n Result: '\\'Success\\'',\n Items: interface_ItemMetadataBuiltIn.array(),\n});\n\nconst targetFailure = type({\n Result: '\\'Failure\\'',\n Items: 'never[]',\n});\n\nconst msbuildEvaluationOutput: Type<{\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n}> = type({\n 'Properties?': type({ '[string]': 'string' }),\n 'Items?': type({ '[string]': interface_ItemMetadataBuiltIn.array() }),\n 'TargetResults?': type({ '[string]': targetSuccess.or(targetFailure) }),\n});\n\nexport class MSBuildEvaluationOutput {\n /**\n * The specified properties and their values as evaluated by MSBuild Core.\n * `-getProperty:{propertyName,...}`\n */\n Properties?: typeof msbuildEvaluationOutput.infer.Properties;\n /**\n * The specified items and their values and associated metadata as evaluated\n * by MSBuild Core.\n * `-getItem:{itemName,...}`\n */\n Items?: typeof msbuildEvaluationOutput.infer.Items;\n /**\n * The specified Targets and their output values as evaluated by MSBuild\n * Core.\n * `-getTargetResult:{targetName,...}`\n */\n TargetResults?: typeof msbuildEvaluationOutput.infer.TargetResults;\n\n /**\n * @param rawMSBuildEvaluation The output of a CLI MSBuild project evaluation.\n * May be the UTF-8 string-encoded JSON or the object decoded from that JSON.\n */\n constructor(rawMSBuildEvaluation: Parameters<typeof JSON.parse>[0] | Parameters<typeof msbuildEvaluationOutput.from>[0]) {\n /** `.assert` instead of `.from` to allow `unknown` JSON.parse return type */\n const knownObject = msbuildEvaluationOutput.assert(typeof rawMSBuildEvaluation === 'string' ? JSON.parse(rawMSBuildEvaluation) : rawMSBuildEvaluation);\n\n this.Properties = knownObject.Properties;\n this.Items = knownObject.Items;\n this.TargetResults = knownObject.TargetResults;\n }\n}\n\nexport const EvaluationOptions: Type<{\n FullName: string;\n Property: {\n MSBuildProjectFullPath?: string | undefined;\n AssemblyName?: string | undefined;\n BaseIntermediateOutputPath?: string | undefined;\n BaseOutputPath?: string | undefined;\n Description?: string | undefined;\n IntermediateOutput?: string | undefined;\n OutDir?: string | undefined;\n OutputPath?: string | undefined;\n Version?: string | undefined;\n VersionPrefix?: string | undefined;\n VersionSuffix?: string | undefined;\n TargetFramework?: string | undefined;\n TargetFrameworks?: string | undefined;\n RuntimeIdentifier?: string | undefined;\n RuntimeIdentifiers?: string | undefined;\n };\n Targets: readonly string[] | string[];\n GetItem: readonly string[] | string[];\n GetProperty: readonly string[] | string[];\n GetTargetResult: readonly string[] | string[];\n}> = Object.freeze(\n type({\n /**\n * The project file's full path.\n */\n FullName: 'string',\n /**\n * User-defined Properties and their values.\n * { Configuration: \"Release\" } will cause the MSBuild to first set the\n * Configuration property to Release before evaluating the project\n * or the project's Target(s).\n * ```txt\n * -property:<n>=<v> Set or override these project-level properties. <n> is\n * the property name, and <v> is the property value. Use a\n * semicolon or a comma to separate multiple properties, or\n * specify each property separately. (Short form: -p)\n * Example:\n * -property:WarningLevel=2;OutDir=bin\\Debug\\\n * ```\n */\n Property: type({ '[string]': 'string' })\n .as<{ -readonly [P in keyof MSBuildProjectProperties]: MSBuildProjectProperties[P] }>()\n .partial(),\n /**\n * The MSBuild Targets to run for evaluation. [\"Pack\"] is recommended.\n * Property values may be changed by Targets such as those provided by\n * dependencies.\n *\n * ```txt\n * -target:<targets> Build these targets in this project. Use a semicolon or a\n * comma to separate multiple targets, or specify each\n * target separately. (Short form: -t)\n * Example:\n * -target:Resources;Compile\n * ```\n * @default []\n */\n Targets: type.string.array().readonly().or('string[]'),\n /**\n * MSBuild Items to evaluate. `[\"Compile\"]` will result in the MSBuild output\n * including {@link MSBuild}\n */\n GetItem: type.string.array().readonly().or('string[]'),\n GetProperty: type.string.array().readonly().or('string[]'),\n GetTargetResult: type.string.array().readonly().or('string[]'),\n }),\n);\n\nexport class MSBuildProject {\n /**\n * Properties for multi-targeting `dotnet publish` outputs.\n * These are included in {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n public static readonly MatrixProperties: readonly string[] = Object.freeze([\n 'TargetFramework',\n 'TargetFrameworks',\n 'RuntimeIdentifier',\n 'RuntimeIdentifiers',\n ]);\n\n /**\n * @param projectPath The full path of the project file or its directory. A\n * relative path may be passed, but will resolve relative to the current\n * working directory.\n * @param includeNonPublic Include conventionally internal/private MSBuild\n * targets in the result.\n * @returns A string array of the project's MSBuild targets.\n * @todo consider 'file' of -targets[:file]\n * Prints a list of available targets without executing the\n * actual build process. By default the output is written to\n * the console window. If the path to an output file\n * is provided that will be used instead.\n * (Short form: -ts)\n * Example:\n * -ts:out.txt\n */\n static async GetTargets(\n projectPath: string,\n // eslint-disable-next-line unicorn/consistent-boolean-name\n includeNonPublic = false,\n ): Promise<string[]> {\n const stdPair = await execAsync(`dotnet msbuild ${projectPath} -targets`, true);\n\n const targets = stdPair.stdout\n .split('\\n')\n .filter((v, index) => v !== '' && index !== 0)\n .map(v => v.replaceAll('\\r', ''))\n .sort((a, b) => a.localeCompare(b));\n return includeNonPublic\n ? targets\n : targets.filter(v => !v.startsWith('_'));\n }\n\n /**\n * Evaluate {@link Items}, {@link Properties}, and {@link TargetResults},\n * returning them as an instance of {@link MSBuildProject}.\\\n * Note: MSBuild will probably fail if Restore is skipped and another\n * target is specified. If you choose Pack, you must do ['Restore', 'Pack'].\n * @param options The result of {@link EvaluationOptions.from}.\n * @returns A promised {@link MSBuildProject} instance.\n * @throws {Error} if the exec command fails -OR- the JSON parse fails -OR-\n * MSBuildProject's constructor fails.\n * @see {@link PackableProjectsToMSBuildProjects} for most use-cases.\n */\n public static async Evaluate(\n options: typeof EvaluationOptions.inferOut,\n ): Promise<MSBuildProject> {\n if (\n options.GetProperty.length === 0\n && options.GetItem.length === 0\n && options.GetTargetResult.length === 0\n ) {\n throw new Error(\n 'No MSBuild Property, Item, or TargetResult queries were provided.',\n );\n }\n // reminder: args containing spaces and semi-colons MUST be quote-enclosed!\n options.FullName = MSBuildProjectProperties.GetFullPath(options.FullName);\n const _pairs = Object.entries(options.Property).filter(p => typeof p[1] === 'string');\n const string_property\n = _pairs.length === 0\n ? ''\n : `-p:\"${_pairs.map(pair => pair[0] + '=' + pair[1]).join(';')}\"`;\n const string_target\n = options.Targets.length === 0\n ? ''\n : `\"-t:${options.Targets.join(';')}\"`;\n const string_getItem\n = options.GetItem.length === 0\n ? ''\n : `-getItem:\"${options.GetItem.join(',')}\"`;\n const string_getProperty\n = options.GetProperty.length === 0\n ? ''\n : `-getProperty:\"${options.GetProperty.join(',')}\"`;\n const string_getTargetResult\n = options.GetTargetResult.length === 0\n ? ''\n : `-getTargetResult:\"${options.GetTargetResult.join(',')}\"`;\n const commandLine = [\n 'dotnet',\n 'msbuild',\n `\"${options.FullName}\"`,\n '-restore',\n string_property,\n string_target,\n string_getItem,\n string_getProperty,\n string_getTargetResult,\n ]\n .filter(v => v !== '')\n .join(' ');\n let stdio: Awaited<ReturnType<typeof execAsync>> | undefined;\n // may throw\n while (stdio === undefined) {\n try {\n stdio = await setTimeout(\n 1000,\n execAsync(commandLine, true),\n );\n }\n catch (error: unknown) {\n catchEBUSY(error);\n }\n }\n\n // todo: consider -getResultOutputFile:file\n // Redirect output from get* into a file.\n //\n // Example:\n // -getProperty:Bar -getResultOutputFile:Biz.txt\n // This writes the value of property Bar into Biz.txt.\n\n /**\n * The following issues have triggered this code path:\n * - BaseIntermediateOutputPath must use Unix path separators ('/') on all\n * platforms. Even Windows. Otherwise, MSBuild/dotnet will error-exit with\n * \"The BaseIntermediateOutputPath must end with a trailing slash\".\n */\n if (stdio.stdout.startsWith('MSBuild version')) {\n warn(stdio.stdout);\n throw new Error(\n 'dotnet msbuild was expected to output JSON, but output its version header instead.',\n );\n }\n\n let rawOutput: ConstructorParameters<typeof MSBuildEvaluationOutput>[0];\n if (stdio.stdout.startsWith('{')) {\n /** stdout is JSON string */\n rawOutput = stdio.stdout;\n }\n else if (options.GetProperty.length > 0 && options.GetProperty[0] !== undefined) {\n rawOutput = {\n Properties: {\n [options.GetProperty[0]]: String(JSON.parse(stdio.stdout)),\n },\n };\n }\n else {\n throw new Error('Dotnet/MSBuild evaluation output is not a string nor JSON object or array.');\n }\n\n const evaluation = new MSBuildEvaluationOutput(rawOutput);\n\n return new MSBuildProject({\n fullPath: options.FullName,\n projTargets: await this.GetTargets(options.FullName),\n evaluation,\n });\n }\n\n /**\n * Evaluate multiple project paths with some default Evaluate options.\n * @async\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files.\n * See https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns A promised array of {@link MSBuildProject} instances.\n * All known MSBuild and NuGet properties are evaluated.\n * If applicable, a project's \"Pack\" target is evaluated.\n */\n public static async PackableProjectsToMSBuildProjects(\n projectsToPackAndPush: string[],\n ): Promise<Promise<MSBuildProject>[]> {\n const directoryEntriesPromise = await toDirectoryEntries(typeof projectsToPackAndPush === 'string' ? [projectsToPackAndPush] : projectsToPackAndPush);\n const projectPromises: Promise<MSBuildProject>[] = directoryEntriesPromise.map(element => convertDirentToMSBuildProject(element));\n return projectPromises;\n\n /**\n * Map an array of filesystem paths to {@link Dirent} instances representing project files.\n * @param projectsToPackAndPush An array of MSBuild projects' full file\n * paths. If a path is a directory, files in that directory are filtered for\n * `.csproj`, `.fsproj`, and `.vbproj` project files. See\n * https://github.com/dotnet/sdk/blob/497f334b2862bdf98b30c00ede2fd259ea5f624d/src/Cli/dotnet/Commands/New/MSBuildEvaluation/MSBuildEvaluationResult.cs#L19-L32.\\\n * @returns An promised array of Dirent instances for discovered project files.\n */\n async function toDirectoryEntries(\n projectsToPackAndPush: string[],\n ): Promise<Dirent[]> {\n const directoryEntries: (Dirent | Dirent[])[] = await Promise.all(\n projectsToPackAndPush.map(async (proj) => {\n proj = await realpath(makeAbsolute(proj));\n const stats = await stat(proj);\n let entries: Dirent[];\n\n if (stats.isFile()) {\n entries = await readdir(path.dirname(proj), { withFileTypes: true });\n const dirent: Dirent | undefined = entries.find(v =>\n path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in v ? v.path as string | undefined : undefined) ?? (v as unknown as Omit<typeof v, 'path'> & { parentPath: string }).parentPath,\n v.name,\n ) === proj,\n );\n if (dirent)\n return dirent;\n throw new Error(\n `file \"${proj}\" not found. It may have been moved or deleted.`,\n );\n }\n if (!stats.isDirectory())\n throw new Error(`\"${proj}\" is not a file or directory`);\n\n entries = await readdir(proj, { withFileTypes: true });\n return entries.filter(v =>\n v.isFile()\n && (v.name.endsWith('.csproj') || v.name.endsWith('.fsproj') || v.name.endsWith('.vbproj')),\n );\n }),\n );\n\n return directoryEntries.flat();\n }\n\n /**\n * Map a {@link Dirent} instance to an {@link MSBuildProject} instance.\n * @param dirent A {@link Dirent} instance. This instance should be an MSBuild project file.\n * @returns An instance of {@link MSBuildProject} evaluated with the `Pack` target result, if applicable. Evaluated properties will be those whose names are returned by {@link NPPGetterNames.InstanceGettersRecursive}.\n */\n async function convertDirentToMSBuildProject(dirent: Dirent): Promise<MSBuildProject> {\n const fullPath = path.join(\n // condition required for compatibility. `.path` was deprecated, but `.parentPath` is not available in our node minversion\n ('path' in dirent ? dirent.path as string | undefined : undefined) ?? (dirent as unknown as Omit<typeof dirent, 'path'> & { parentPath: string }).parentPath,\n dirent.name,\n );\n const projTargets: string[] = await MSBuildProject.GetTargets(fullPath);\n const evalTargets: string[] = projTargets.includes('Pack') ? ['Pack'] : [];\n // this might be too long for a command line. What was it on Windows?\n // 2^15 (32,768) character limit for command lines?\n const propertiesToEvaluate = NPPGetterNames.InstanceGettersRecursive;\n\n return await MSBuildProject.Evaluate(\n EvaluationOptions.from({\n FullName: fullPath,\n GetItem: [],\n GetProperty: propertiesToEvaluate,\n GetTargetResult: [],\n Property: {},\n Targets: evalTargets,\n }),\n );\n }\n }\n\n public static fromJSON(json: string): MSBuildProject {\n const parsed = T_PseudoMSBPInstance.assert(JSON.parse(json));\n\n type.true.assert(\n Reflect.setPrototypeOf(parsed, this.prototype),\n );\n type.true.assert(\n Reflect.setPrototypeOf(parsed.Properties, NugetProjectProperties.prototype),\n );\n parsed.Properties = T_NPP.assert(parsed.Properties);\n return T_MSBuildProject.assert(parsed);\n }\n\n readonly Items: Readonly<Required<MSBuildEvaluationOutput>['Items']>;\n readonly Properties: Readonly<NugetProjectProperties>;\n readonly Targets: readonly string[];\n /**\n * Allows appending subsequent target results.\n */\n readonly TargetResults: Required<MSBuildEvaluationOutput>['TargetResults'][];\n\n /**\n * Creates an instance of MSBuildProject.\n * @param opts The order-independent arguments for this constructor.\n * Properties may be added or moved around in this definition without\n * breaking compatibility.\n * @param opts.fullPath The full path of the MSBuild project's file. This\n * should have a '.csproj', '.fsproj', or '.vbproj' file extension.\n * @param opts.projTargets A list of MSBuild Targets supported by the project.\n * @param opts.evaluation The output of an MSBuild project evaluation. This\n * comprises MSBuild Properties, Items, and Target results.\n */\n // eslint-disable-next-line unicorn/name-replacements\n public constructor(opts: {\n fullPath: string;\n projTargets: string[];\n evaluation: MSBuildEvaluationOutput;\n }) {\n this.Items = opts.evaluation.Items ?? {};\n this.Properties = new NugetProjectProperties(\n opts.fullPath,\n new CaseInsensitiveMap<string, string>(\n Object.entries(opts.evaluation.Properties ?? {}),\n ),\n );\n this.Targets = opts.projTargets;\n this.TargetResults\n = opts.evaluation.TargetResults === undefined\n ? []\n : [opts.evaluation.TargetResults];\n }\n}\n\nconst T_MSBuildProject = type.instanceOf(MSBuildProject);\nconst T_NPP = type.instanceOf(NugetProjectProperties);\nconst T_PseudoMSBPInstance = type({\n Items: type({\n '[string]': type({\n '[string]': 'string',\n Identity: 'string',\n FullPath: 'string',\n RootDir: 'string',\n Filename: 'string',\n Extension: 'string',\n RelativeDir: 'string',\n Directory: 'string',\n RecursiveDir: 'string',\n ModifiedTime: 'string',\n CreatedTime: 'string',\n AccessedTime: 'string',\n DefiningProjectFullPath: 'string',\n DefiningProjectDirectory: 'string',\n DefiningProjectName: 'string',\n DefiningProjectExtension: 'string',\n 'SubType?': ' string | undefined',\n 'TargetFrameworkIdentifier?': 'string | undefined',\n 'TargetPlatformMoniker?': 'string | undefined',\n 'CopyUpToDateMarker?': 'string | undefined',\n 'TargetPlatformIdentifier?': 'string | undefined',\n 'TargetFrameworkVersion?': 'string | undefined',\n 'ReferenceAssembly?': 'string | undefined',\n }).array(),\n }),\n Properties: type.Record('string', 'string').or(T_NPP),\n Targets: type.string.array(),\n TargetResults: msbuildEvaluationOutput.get('TargetResults').exclude('undefined').array(),\n\n});\n\n/**\n * ArkType type definitions for internal usage, but may be re-used elsewhere\n * @internal\n */\nexport const _InternalMSBuildEvaluationTypes: Scope<{\n msbuildEvaluationOutput: {\n Properties?: Record<string, string> | undefined;\n Items?: Record<string, {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[]> | undefined;\n TargetResults?: Record<string, {\n Result: 'Success';\n Items: {\n [x: string]: string | undefined;\n Identity: string;\n FullPath: string;\n RootDir: string;\n Filename: string;\n Extension: string;\n RelativeDir: string;\n Directory: string;\n RecursiveDir: string;\n ModifiedTime: string;\n CreatedTime: string;\n AccessedTime: string;\n DefiningProjectFullPath: string;\n DefiningProjectDirectory: string;\n DefiningProjectName: string;\n DefiningProjectExtension: string;\n SubType?: string | undefined;\n TargetFrameworkIdentifier?: string | undefined;\n TargetPlatformMoniker?: string | undefined;\n CopyUpToDateMarker?: string | undefined;\n TargetPlatformIdentifier?: string | undefined;\n TargetFrameworkVersion?: string | undefined;\n ReferenceAssembly?: string | undefined;\n }[];\n } | {\n Result: 'Failure';\n Items: never[];\n }> | undefined;\n };\n}> = type.scope({\n msbuildEvaluationOutput,\n});\n\n/**\n * Resolve a path if it is not already absolute.\n * @param _path A filesystem path.\n * @returns A full path to a filesystem entry. The path is unchecked for whether or not the path (or its parts) exist.\n */\nfunction makeAbsolute(_path: string) {\n return path.isAbsolute(_path) ? _path : path.resolve(_path);\n}\n\n/**\n * Use this in your catch statement or .catch call to return `undefined` when\n * a \"file in use by another process\" (i.e. EBUSY/ERROR_SHARING_VIOLATION) error is reported.\n * @param error Probably an Error object\n * @returns `undefined` if file in use by another process\n */\nexport function catchEBUSY(error: unknown): undefined {\n if (isError(error)) {\n if ('stderr' in error && typeof error.stderr === 'string') {\n // Normalize colon-like chars: '\\uFF1A'.normalize('NFKC') === ':' === true;\n const normalizedStderr = error.stderr.normalize('NFKC');\n const patternEN = /The process cannot access the file '[^']+' because it is being used by another process\\./gm;\n const hasErrorMessagePattern = patternEN.test(normalizedStderr);\n const isCS2012 = /^CSC ?:.+CS2012:/gm.test(normalizedStderr);\n // generic error code; error message must be checked.\n const isAVLN9999 = /AVLN9999:/gm.test(normalizedStderr)\n && hasErrorMessagePattern;\n if (isCS2012 || isAVLN9999 || hasErrorMessagePattern)\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n else throw error;\n }\n else throw new Error('unknown error', { cause: error });\n}\n\n/**\n *\n * Use this in your catch statement or .catch call to return `undefined` when\n * MSBuild error CSC2012 (e.g. \"file in use by another process\") is reported.\n * @param error Probably an Error object\n * @returns `undefined` if CSC2012 (file in use by another process) occurs\n * @deprecated Use {@link catchEBUSY}.\n */\nexport function catchCsc2012(error: unknown): undefined {\n if (isError(error)) {\n // check for error reported when \"file in use by another process\" i.e. EBUSY\n // (UNIX), NTSTATUS.ERROR_SHARING_VIOLATION == 0x20 == 32 (Windows)\n if ('stderr' in error && typeof error.stderr === 'string'\n && /^CSC ?:.+CS2012:/gm.test(\n // '\\uFF1A'.normalize('NFKC') === ':' === true;\n error.stderr.normalize('NFKC'),\n )\n ) {\n // eslint-disable-next-line unicorn/no-useless-undefined\n return undefined; /* retry */\n }\n /**\n * some known warnings/errors:\n * - warning MSB3073:\n * The command \"dotnet tool list kuinox.nupkgdeterministicator\"\n * exited with code 145.\n * > $ dotnet tool list kuinox.nupkgdeterministicator\n * > The command could not be loaded, possibly because:\n * > * You intended to execute a .NET application:\n * > The application 'tool' does not exist.\n * > * You intended to execute a .NET SDK command:\n * > No .NET SDKs were found.\n * >\n * > Download a .NET SDK:\n * > https://aka.ms/dotnet/download\n * >\n * > Learn about SDK resolution:\n * > https://aka.ms/dotnet/sdk-not-found\n */\n throw error;\n }\n throw new Error('unknown error', { cause: error });\n}\n"],"mappings":";;;;;;;;;;;;;;;AAoBA,MAAM,gCAAgC,KAAK;CACzC,YAAY;;CAEZ,UAAU;;CAEV,YAAY;;CAEZ,8BAA8B;CAC9B,0BAA0B;;CAE1B,uBAAuB;CACvB,6BAA6B;;CAE7B,2BAA2B;;CAE3B,sBAAsB;;CAEtB,UAAU;;CAEV,SAAS;;CAET,UAAU;;CAEV,WAAW;;CAEX,aAAa;;CAEb,WAAW;CACX,cAAc;;CAEd,cAAc;;CAEd,aAAa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;;;;;;;;;;;;;MAiBA,aAAA;;;;;;;MAUA,eAAA;;;;;;;MAUA,gBAAA;;;;;;;;;MAYA,iBAAA;;;;;;;;;;;MAcA,kBAAA;AAAA;AAAA,KAMM,WAAA,GAAc,SAAA,CAAU,SAAA,QAAiB,wBAAA;EAEnD,YAAA,EAAc,eAAA,QAAuB,wBAAA,CAAyB,YAAA;AAAA;AAAA,KAG3D,eAAA,MAAqB,CAAA"}
@@ -59,7 +59,7 @@ var MSBuildProjectProperties = class {
59
59
  constructor(msbuildProjectFullPath, properties) {
60
60
  strictEqual(typeof msbuildProjectFullPath, "string", /* @__PURE__ */ new TypeError(`msbuildProjectFullPath should be a string, not ${typeof msbuildProjectFullPath}!`));
61
61
  strictEqual(properties instanceof CaseInsensitiveMap, true, `arg 'properties' should be instanceof ${CaseInsensitiveMap.name}`);
62
- strictEqual([...properties.keys()].every((v) => typeof v === "string"), true, "all keys in arg 'properties' should be strings");
62
+ strictEqual(properties.keys().every((v) => typeof v === "string"), true, "all keys in arg 'properties' should be strings");
63
63
  this._msbuildProjectFullPath = MPP.GetFullPath(msbuildProjectFullPath);
64
64
  this._assemblyName = MPP.getAndForget(properties, "AssemblyName");
65
65
  this._description = MPP.getAndForget(properties, "Description");
@@ -1 +1 @@
1
- {"version":3,"file":"MSBuildProjectProperties.mjs","names":[],"sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"sourcesContent":["import { strictEqual } from 'node:assert/strict';\nimport { existsSync } from 'node:fs';\n// eslint-disable-next-line unicorn/import-style\nimport * as node_path from 'node:path';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport type { BaseClass, ClassLike } from '../utils/reflection.ts';\n\n/**\n * Known properties. Additional properties may be added upon request.\n *\n * todo: add Reserved properties, Well-Known properties, Common properties, and more. Maybe as sub classes.\n * See:\n * - {@link https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties?view=vs-2022 MSBuild Reserved and Well-known Properties}\n * - {@link https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-properties?view=vs-2022 Common MSBuild project properties}\n * - {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props Microsoft.NET.Sdk}\n * - {@link https://learn.microsoft.com/en-us/aspnet/core/razor-pages/web-sdk?view=aspnetcore-8.0&toc=%2Fdotnet%2Fnavigate%2Ftools-diagnostics%2Ftoc.json&bc=%2Fdotnet%2Fbreadcrumb%2Ftoc.json#properties Microsoft.NET.Sdk.Web}\n * - {@link https://learn.microsoft.com/en-us/aspnet/core/razor-pages/sdk?view=aspnetcore-8.0&toc=%2Fdotnet%2Fnavigate%2Ftools-diagnostics%2Ftoc.json&bc=%2Fdotnet%2Fbreadcrumb%2Ftoc.json Microsoft.NET.Sdk.Razor}\n * - {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props-desktop Microsoft.NET.Sdk.Desktop}\n */\nexport class MSBuildProjectProperties {\n // #region static\n\n /**\n * Resolve the given path if it is not absolute. If the path exists, it is returned. Else, an Error is thrown.\n * @param path The full file path of an MSBuild project.\n * @returns The absolute path to the MSBuild project file.\n * @throws {Error} if the path cannot be resolved to an existing file.\n */\n static GetFullPath(path: string): string {\n if (!node_path.isAbsolute(path))\n path = node_path.resolve(path);\n if (!existsSync(path))\n throw new Error(`${node_path.basename(path)} could not be found at \"${path}\"`);\n return path;\n }\n\n /**\n * Note: This method may remove elements from {@link properties}.\\\n * Try to get an element from {@link properties} by its {@link key}.\n * If an element is found, it is removed and the value of the element is returned.\n * Otherwise, `undefined` is returned.\n * @param properties The CaseInsensitiveMap of properties passed to the constructor.\n * @param key The key of the property to get from {@link properties}\n * @returns If found, the value of the `[string, string]` tuple found in {@link properties}. Else, `undefined`.\n */\n protected static getAndForget(\n properties: CaseInsensitiveMap<string, string>,\n key: string,\n ): string | undefined {\n const v: string | undefined = properties.get(key);\n if (v !== undefined)\n properties.delete(key);\n return v;\n }\n\n // #endregion static\n // #endregion static\n\n // #region private\n private _msbuildProjectFullPath: string | undefined;\n private _assemblyName: string | undefined;\n private _baseIntermediateOutputPath: string | undefined;\n private _baseOutputPath: string | undefined;\n private _description: string | undefined;\n private _intermediateOutputPath: string | undefined;\n private _outDir: string | undefined;\n private _outputPath: string | undefined;\n private _runtimeIdentifier: string | undefined;\n private _runtimeIdentifiers: string | undefined;\n private _targetFramework: string | undefined;\n private _targetFrameworks: string | undefined;\n private _version: string | undefined;\n private _versionPrefix: string | undefined;\n private _versionSuffix: string | undefined;\n // #endregion private\n\n constructor(\n msbuildProjectFullPath: string,\n properties: CaseInsensitiveMap<string, string>,\n ) {\n // runtime type checks\n strictEqual(\n typeof msbuildProjectFullPath,\n 'string',\n new TypeError(\n `msbuildProjectFullPath should be a string, not ${typeof msbuildProjectFullPath}!`,\n ),\n );\n strictEqual(\n properties instanceof CaseInsensitiveMap,\n true,\n `arg 'properties' should be instanceof ${CaseInsensitiveMap.name}`,\n );\n strictEqual(\n [...properties.keys()].every((v): v is string => typeof v === 'string'),\n true,\n 'all keys in arg \\'properties\\' should be strings',\n );\n\n this._msbuildProjectFullPath = MPP.GetFullPath(msbuildProjectFullPath);\n this._assemblyName = MPP.getAndForget(properties, 'AssemblyName');\n this._description = MPP.getAndForget(properties, 'Description');\n this._outputPath = MPP.getAndForget(properties, 'OutputPath');\n this._runtimeIdentifier = MPP.getAndForget(properties, 'RuntimeIdentifier');\n this._runtimeIdentifiers = MPP.getAndForget(\n properties,\n 'RuntimeIdentifiers',\n );\n this._targetFramework = MPP.getAndForget(properties, 'TargetFramework');\n this._targetFrameworks = MPP.getAndForget(properties, 'TargetFrameworks');\n this._version = MPP.getAndForget(properties, 'Version');\n this._versionPrefix = MPP.getAndForget(properties, 'VersionPrefix');\n this._versionSuffix = MPP.getAndForget(properties, 'VersionSuffix');\n // rest\n for (const key of properties.keys()) {\n const value = MPP.getAndForget(properties, key);\n if (value !== undefined) {\n Object.defineProperty(this, key, {\n value: value,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n }\n }\n }\n\n get MSBuildProjectFullPath(): string {\n return this._msbuildProjectFullPath ??= '';\n }\n\n /**\n * @returns The name of the assembly.\n *\n * Default: {@link https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties#:~:text=MSBuildProjectDirectory,-Reserved MSBuildProjectDirectory}\n */\n get AssemblyName(): string {\n return this._assemblyName ??= '';\n }\n\n /**\n * @returns The top-level folder where all configuration-specific intermediate output\n * folders are created. The default value is `obj\\`.\n * @example\n * ```xml\n * <BaseIntermediateOutputPath>c:\\xyz\\obj\\</BaseIntermediateOutputPath>\n * ```\n */\n get BaseIntermediateOutputPath(): string {\n return this._baseIntermediateOutputPath ??= '';\n }\n\n /**\n * @returns The base path for the output file.\n * If it's set, MSBuild uses `OutputPath = $(BaseOutputPath)\\$(Configuration)\\`.\n * @example ```xml\n * <BaseOutputPath>c:\\xyz\\bin\\</BaseOutputPath>\n * ```\n */\n get BaseOutputPath(): string {\n return this._baseOutputPath ??= '';\n }\n\n /**\n * A long description for the assembly.\n * If {@link NugetProperties.PackageDescription} is not specified, then this property is also used as the description of the package.\n * @returns The value of the `Description` property.\n */\n get Description(): string {\n return this._description ??= '';\n }\n\n /**\n * @returns The full intermediate output path as derived from\n * {@link BaseIntermediateOutputPath}, if no path is specified.\n * @example \"obj\\\\debug\\\\\"\n */\n get IntermediateOutput(): string {\n return this._intermediateOutputPath ??= '';\n }\n\n /**\n * @returns The final output location for the project or solution.\n * When you build a solution, OutDir can be used to gather multiple project outputs in one location.\n * In addition, OutDir is included in AssemblySearchPaths used for resolving references.\n * @example\n * `bin/Debug`\n */\n get OutDir(): string {\n return this._outDir ??= '';\n }\n\n /**\n * @returns The path to the output directory, relative to the project\n * directory.\n * @example\n * `bin/Debug`\n * /// non-AnyCPU builds\n * `bin/Debug/${Platform}`\n */\n get OutputPath(): string {\n return this._outputPath ??= '';\n }\n\n /**\n * Set Version -OR- VersionPrefix.\n * @returns The value of the `Version` property.\n *\n * Default: `\"1.0.0\"`\n */\n get Version(): string {\n return this._version ??= '1.0.0';\n }\n\n /**\n * Set Version -OR- VersionPrefix.\\\n * Setting {@link NugetProperties.PackageVersion} overwrites {@link VersionPrefix}\n * @returns The MAJOR.MINOR.PATCH string of the version.\n * @see {@link VersionSuffix}\n */\n get VersionPrefix(): string {\n return this._versionPrefix ??= '';\n }\n\n /**\n * The effect of this property on the package version depends on the values of the Version and VersionPrefix properties, as shown in the following table:\n * | Properties with values | Package version |\n * | ---------------------- | --------------- |\n * | None | 1.0.0 |\n * | Version | $(Version) |\n * | VersionPrefix only | $(VersionPrefix) |\n * | VersionSuffix only | 1.0.0-$(VersionSuffix) |\n * | VersionPrefix and VersionSuffix | $(VersionPrefix)-$(VersionSuffix) |\n * \\\n * Setting {@link PackageVersion} overwrites {@link VersionSuffix}\n * @returns The string appended to the end of the MAJOR.MINOR.PATCH semver string (i.e. {@link VersionPrefix})\n */\n get VersionSuffix(): string {\n return this._versionSuffix ??= '';\n }\n\n /**\n * @returns The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#targetframework Target Framework}\n * @see\n * https://learn.microsoft.com/en-us/nuget/reference/target-frameworks#supported-frameworks\n * https://learn.microsoft.com/en-us/dotnet/standard/frameworks\n */\n get TargetFramework(): string {\n return this._targetFramework ??= '';\n }\n\n /**\n * @returns The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#targetframeworks Target Frameworks} (plural)\n * @see\n * https://learn.microsoft.com/en-us/nuget/reference/target-frameworks#supported-frameworks\n * https://learn.microsoft.com/en-us/dotnet/standard/frameworks\n */\n get TargetFrameworks(): string {\n return this._targetFrameworks ??= '';\n }\n\n /**\n * @returns\n * > The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#runtimeidentifier `Runtime Identifier`} property lets you specify a single runtime\n * > identifier (RID) for the project. The RID enables publishing a\n * > self-contained deployment.\n * @see\n * https://learn.microsoft.com/en-us/dotnet/core/rid-catalog\n */\n get RuntimeIdentifier(): string {\n return this._runtimeIdentifier ??= '';\n }\n\n /**\n * @returns\n * > The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers `RuntimeIdentifiers`} property lets you specify a\n * > semicolon-delimited list of runtime identifiers (RIDs) for the project.\n * > Use this property if you need to publish for multiple runtimes.\n * > `RuntimeIdentifiers` is used at restore time to ensure the right assets\n * > are in the graph.\n * @see\n * https://learn.microsoft.com/en-us/dotnet/core/rid-catalog\n */\n get RuntimeIdentifiers(): string {\n return this._runtimeIdentifiers ??= '';\n }\n}\n\nconst MPP = MSBuildProjectProperties;\nexport type Class_MSBPP = ClassLike<BaseClass<typeof MSBuildProjectProperties & {\n // @ts-expect-error Property 'getAndForget' is protected and only accessible within class 'MSBuildProjectProperties' and its subclasses. ts(2445)\n getAndForget: ProtectedMember<typeof MSBuildProjectProperties.getAndForget>;\n}>>;\n\ntype ProtectedMember<T> = T;\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,IAAa,2BAAb,MAAsC;;;;;;;CASpC,OAAO,YAAY,MAAsB;EACvC,IAAI,CAAC,UAAU,WAAW,KAAK,EAC7B,OAAO,UAAU,QAAQ,KAAK;EAChC,IAAI,CAAC,WAAW,KAAK,EACnB,MAAM,IAAI,MAAM,GAAG,UAAU,SAAS,KAAK,CAAC,0BAA0B,KAAK,GAAG;EAChF,OAAO;;;;;;;;;;;CAYT,OAAiB,aACf,YACA,KACoB;EACpB,MAAM,IAAwB,WAAW,IAAI,IAAI;EACjD,IAAI,MAAM,KAAA,GACR,WAAW,OAAO,IAAI;EACxB,OAAO;;CAOT;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA,YACE,wBACA,YACA;EAEA,YACE,OAAO,wBACP,0BACA,IAAI,UACF,kDAAkD,OAAO,uBAAuB,GACjF,CACF;EACD,YACE,sBAAsB,oBACtB,MACA,yCAAyC,mBAAmB,OAC7D;EACD,YAC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,IAAI,UAAkB;EACpB,OAAO,KAAK,aAAa;;;;;;;;CAS3B,IAAI,gBAAwB;EAC1B,OAAO,KAAK,mBAAmB;;;;;;;;;;;;;;;CAgBjC,IAAI,gBAAwB;EAC1B,OAAO,KAAK,mBAAmB;;;;;;;;CASjC,IAAI,kBAA0B;EAC5B,OAAO,KAAK,qBAAqB;;;;;;;;CASnC,IAAI,mBAA2B;EAC7B,OAAO,KAAK,sBAAsB;;;;;;;;;;CAWpC,IAAI,oBAA4B;EAC9B,OAAO,KAAK,uBAAuB;;;;;;;;;;;;CAarC,IAAI,qBAA6B;EAC/B,OAAO,KAAK,wBAAwB;;;AAIxC,MAAM,MAAM"}
1
+ {"version":3,"file":"MSBuildProjectProperties.mjs","names":[],"sources":["../../src/dotnet/MSBuildProjectProperties.ts"],"sourcesContent":["import { strictEqual } from 'node:assert/strict';\nimport { existsSync } from 'node:fs';\n// eslint-disable-next-line unicorn/import-style\nimport * as node_path from 'node:path';\nimport { CaseInsensitiveMap } from '../CaseInsensitiveMap.ts';\nimport type { BaseClass, ClassLike } from '../utils/reflection.ts';\n\n/**\n * Known properties. Additional properties may be added upon request.\n *\n * todo: add Reserved properties, Well-Known properties, Common properties, and more. Maybe as sub classes.\n * See:\n * - {@link https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties?view=vs-2022 MSBuild Reserved and Well-known Properties}\n * - {@link https://learn.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-properties?view=vs-2022 Common MSBuild project properties}\n * - {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props Microsoft.NET.Sdk}\n * - {@link https://learn.microsoft.com/en-us/aspnet/core/razor-pages/web-sdk?view=aspnetcore-8.0&toc=%2Fdotnet%2Fnavigate%2Ftools-diagnostics%2Ftoc.json&bc=%2Fdotnet%2Fbreadcrumb%2Ftoc.json#properties Microsoft.NET.Sdk.Web}\n * - {@link https://learn.microsoft.com/en-us/aspnet/core/razor-pages/sdk?view=aspnetcore-8.0&toc=%2Fdotnet%2Fnavigate%2Ftools-diagnostics%2Ftoc.json&bc=%2Fdotnet%2Fbreadcrumb%2Ftoc.json Microsoft.NET.Sdk.Razor}\n * - {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props-desktop Microsoft.NET.Sdk.Desktop}\n */\nexport class MSBuildProjectProperties {\n // #region static\n\n /**\n * Resolve the given path if it is not absolute. If the path exists, it is returned. Else, an Error is thrown.\n * @param path The full file path of an MSBuild project.\n * @returns The absolute path to the MSBuild project file.\n * @throws {Error} if the path cannot be resolved to an existing file.\n */\n static GetFullPath(path: string): string {\n if (!node_path.isAbsolute(path))\n path = node_path.resolve(path);\n if (!existsSync(path))\n throw new Error(`${node_path.basename(path)} could not be found at \"${path}\"`);\n return path;\n }\n\n /**\n * Note: This method may remove elements from {@link properties}.\\\n * Try to get an element from {@link properties} by its {@link key}.\n * If an element is found, it is removed and the value of the element is returned.\n * Otherwise, `undefined` is returned.\n * @param properties The CaseInsensitiveMap of properties passed to the constructor.\n * @param key The key of the property to get from {@link properties}\n * @returns If found, the value of the `[string, string]` tuple found in {@link properties}. Else, `undefined`.\n */\n protected static getAndForget(\n properties: CaseInsensitiveMap<string, string>,\n key: string,\n ): string | undefined {\n const v: string | undefined = properties.get(key);\n if (v !== undefined)\n properties.delete(key);\n return v;\n }\n\n // #endregion static\n // #endregion static\n\n // #region private\n private _msbuildProjectFullPath: string | undefined;\n private _assemblyName: string | undefined;\n private _baseIntermediateOutputPath: string | undefined;\n private _baseOutputPath: string | undefined;\n private _description: string | undefined;\n private _intermediateOutputPath: string | undefined;\n private _outDir: string | undefined;\n private _outputPath: string | undefined;\n private _runtimeIdentifier: string | undefined;\n private _runtimeIdentifiers: string | undefined;\n private _targetFramework: string | undefined;\n private _targetFrameworks: string | undefined;\n private _version: string | undefined;\n private _versionPrefix: string | undefined;\n private _versionSuffix: string | undefined;\n // #endregion private\n\n constructor(\n msbuildProjectFullPath: string,\n properties: CaseInsensitiveMap<string, string>,\n ) {\n // runtime type checks\n strictEqual(\n typeof msbuildProjectFullPath,\n 'string',\n new TypeError(\n `msbuildProjectFullPath should be a string, not ${typeof msbuildProjectFullPath}!`,\n ),\n );\n strictEqual(\n properties instanceof CaseInsensitiveMap,\n true,\n `arg 'properties' should be instanceof ${CaseInsensitiveMap.name}`,\n );\n strictEqual(\n properties.keys().every((v): v is string => typeof v === 'string'),\n true,\n 'all keys in arg \\'properties\\' should be strings',\n );\n\n this._msbuildProjectFullPath = MPP.GetFullPath(msbuildProjectFullPath);\n this._assemblyName = MPP.getAndForget(properties, 'AssemblyName');\n this._description = MPP.getAndForget(properties, 'Description');\n this._outputPath = MPP.getAndForget(properties, 'OutputPath');\n this._runtimeIdentifier = MPP.getAndForget(properties, 'RuntimeIdentifier');\n this._runtimeIdentifiers = MPP.getAndForget(\n properties,\n 'RuntimeIdentifiers',\n );\n this._targetFramework = MPP.getAndForget(properties, 'TargetFramework');\n this._targetFrameworks = MPP.getAndForget(properties, 'TargetFrameworks');\n this._version = MPP.getAndForget(properties, 'Version');\n this._versionPrefix = MPP.getAndForget(properties, 'VersionPrefix');\n this._versionSuffix = MPP.getAndForget(properties, 'VersionSuffix');\n // rest\n for (const key of properties.keys()) {\n const value = MPP.getAndForget(properties, key);\n if (value !== undefined) {\n Object.defineProperty(this, key, {\n value: value,\n writable: false,\n enumerable: true,\n configurable: true,\n });\n }\n }\n }\n\n get MSBuildProjectFullPath(): string {\n return this._msbuildProjectFullPath ??= '';\n }\n\n /**\n * @returns The name of the assembly.\n *\n * Default: {@link https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-reserved-and-well-known-properties#:~:text=MSBuildProjectDirectory,-Reserved MSBuildProjectDirectory}\n */\n get AssemblyName(): string {\n return this._assemblyName ??= '';\n }\n\n /**\n * @returns The top-level folder where all configuration-specific intermediate output\n * folders are created. The default value is `obj\\`.\n * @example\n * ```xml\n * <BaseIntermediateOutputPath>c:\\xyz\\obj\\</BaseIntermediateOutputPath>\n * ```\n */\n get BaseIntermediateOutputPath(): string {\n return this._baseIntermediateOutputPath ??= '';\n }\n\n /**\n * @returns The base path for the output file.\n * If it's set, MSBuild uses `OutputPath = $(BaseOutputPath)\\$(Configuration)\\`.\n * @example ```xml\n * <BaseOutputPath>c:\\xyz\\bin\\</BaseOutputPath>\n * ```\n */\n get BaseOutputPath(): string {\n return this._baseOutputPath ??= '';\n }\n\n /**\n * A long description for the assembly.\n * If {@link NugetProperties.PackageDescription} is not specified, then this property is also used as the description of the package.\n * @returns The value of the `Description` property.\n */\n get Description(): string {\n return this._description ??= '';\n }\n\n /**\n * @returns The full intermediate output path as derived from\n * {@link BaseIntermediateOutputPath}, if no path is specified.\n * @example \"obj\\\\debug\\\\\"\n */\n get IntermediateOutput(): string {\n return this._intermediateOutputPath ??= '';\n }\n\n /**\n * @returns The final output location for the project or solution.\n * When you build a solution, OutDir can be used to gather multiple project outputs in one location.\n * In addition, OutDir is included in AssemblySearchPaths used for resolving references.\n * @example\n * `bin/Debug`\n */\n get OutDir(): string {\n return this._outDir ??= '';\n }\n\n /**\n * @returns The path to the output directory, relative to the project\n * directory.\n * @example\n * `bin/Debug`\n * /// non-AnyCPU builds\n * `bin/Debug/${Platform}`\n */\n get OutputPath(): string {\n return this._outputPath ??= '';\n }\n\n /**\n * Set Version -OR- VersionPrefix.\n * @returns The value of the `Version` property.\n *\n * Default: `\"1.0.0\"`\n */\n get Version(): string {\n return this._version ??= '1.0.0';\n }\n\n /**\n * Set Version -OR- VersionPrefix.\\\n * Setting {@link NugetProperties.PackageVersion} overwrites {@link VersionPrefix}\n * @returns The MAJOR.MINOR.PATCH string of the version.\n * @see {@link VersionSuffix}\n */\n get VersionPrefix(): string {\n return this._versionPrefix ??= '';\n }\n\n /**\n * The effect of this property on the package version depends on the values of the Version and VersionPrefix properties, as shown in the following table:\n * | Properties with values | Package version |\n * | ---------------------- | --------------- |\n * | None | 1.0.0 |\n * | Version | $(Version) |\n * | VersionPrefix only | $(VersionPrefix) |\n * | VersionSuffix only | 1.0.0-$(VersionSuffix) |\n * | VersionPrefix and VersionSuffix | $(VersionPrefix)-$(VersionSuffix) |\n * \\\n * Setting {@link PackageVersion} overwrites {@link VersionSuffix}\n * @returns The string appended to the end of the MAJOR.MINOR.PATCH semver string (i.e. {@link VersionPrefix})\n */\n get VersionSuffix(): string {\n return this._versionSuffix ??= '';\n }\n\n /**\n * @returns The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#targetframework Target Framework}\n * @see\n * https://learn.microsoft.com/en-us/nuget/reference/target-frameworks#supported-frameworks\n * https://learn.microsoft.com/en-us/dotnet/standard/frameworks\n */\n get TargetFramework(): string {\n return this._targetFramework ??= '';\n }\n\n /**\n * @returns The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#targetframeworks Target Frameworks} (plural)\n * @see\n * https://learn.microsoft.com/en-us/nuget/reference/target-frameworks#supported-frameworks\n * https://learn.microsoft.com/en-us/dotnet/standard/frameworks\n */\n get TargetFrameworks(): string {\n return this._targetFrameworks ??= '';\n }\n\n /**\n * @returns\n * > The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#runtimeidentifier `Runtime Identifier`} property lets you specify a single runtime\n * > identifier (RID) for the project. The RID enables publishing a\n * > self-contained deployment.\n * @see\n * https://learn.microsoft.com/en-us/dotnet/core/rid-catalog\n */\n get RuntimeIdentifier(): string {\n return this._runtimeIdentifier ??= '';\n }\n\n /**\n * @returns\n * > The {@link https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props#runtimeidentifiers `RuntimeIdentifiers`} property lets you specify a\n * > semicolon-delimited list of runtime identifiers (RIDs) for the project.\n * > Use this property if you need to publish for multiple runtimes.\n * > `RuntimeIdentifiers` is used at restore time to ensure the right assets\n * > are in the graph.\n * @see\n * https://learn.microsoft.com/en-us/dotnet/core/rid-catalog\n */\n get RuntimeIdentifiers(): string {\n return this._runtimeIdentifiers ??= '';\n }\n}\n\nconst MPP = MSBuildProjectProperties;\nexport type Class_MSBPP = ClassLike<BaseClass<typeof MSBuildProjectProperties & {\n // @ts-expect-error Property 'getAndForget' is protected and only accessible within class 'MSBuildProjectProperties' and its subclasses. ts(2445)\n getAndForget: ProtectedMember<typeof MSBuildProjectProperties.getAndForget>;\n}>>;\n\ntype ProtectedMember<T> = T;\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,IAAa,2BAAb,MAAsC;;;;;;;CASpC,OAAO,YAAY,MAAsB;EACvC,IAAI,CAAC,UAAU,WAAW,IAAI,GAC5B,OAAO,UAAU,QAAQ,IAAI;EAC/B,IAAI,CAAC,WAAW,IAAI,GAClB,MAAM,IAAI,MAAM,GAAG,UAAU,SAAS,IAAI,EAAE,0BAA0B,KAAK,EAAE;EAC/E,OAAO;CACT;;;;;;;;;;CAWA,OAAiB,aACf,YACA,KACoB;EACpB,MAAM,IAAwB,WAAW,IAAI,GAAG;EAChD,IAAI,MAAM,KAAA,GACR,WAAW,OAAO,GAAG;EACvB,OAAO;CACT;CAMA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA,YACE,wBACA,YACA;EAEA,YACE,OAAO,wBACP,0BACA,IAAI,UACF,kDAAkD,OAAO,uBAAuB,EAClF,CACF;EACA,YACE,sBAAsB,oBACtB,MACA,yCAAyC,mBAAmB,MAC9D;EACA,YACE,WAAW,KAAK,CAAC,CAAC,OAAO,MAAmB,OAAO,MAAM,QAAQ,GACjE,MACA,gDACF;EAEA,KAAK,0BAA0B,IAAI,YAAY,sBAAsB;EACrE,KAAK,gBAAgB,IAAI,aAAa,YAAY,cAAc;EAChE,KAAK,eAAe,IAAI,aAAa,YAAY,aAAa;EAC9D,KAAK,cAAc,IAAI,aAAa,YAAY,YAAY;EAC5D,KAAK,qBAAqB,IAAI,aAAa,YAAY,mBAAmB;EAC1E,KAAK,sBAAsB,IAAI,aAC7B,YACA,oBACF;EACA,KAAK,mBA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EAC9B,OAAO,KAAK,uBAAuB;CACrC;;;;;;;;;;;CAYA,IAAI,qBAA6B;EAC/B,OAAO,KAAK,wBAAwB;CACtC;AACF;AAEA,MAAM,MAAM"}
@@ -5,7 +5,7 @@ import { Class_MSBPP, MSBuildProjectProperties } from "./MSBuildProjectPropertie
5
5
  import { type } from "arktype";
6
6
 
7
7
  //#region src/dotnet/NugetProjectProperties.d.ts
8
- declare const Type_RepositoryType: type<"" | "git" | "tfs">;
8
+ declare const Type_RepoType: type<"" | "git" | "tfs">;
9
9
  declare const Type_SymbolPackageFormat: type<"symbols.nupkg" | "snupkg">;
10
10
  /**
11
11
  * A readonly record of a .csproj or .fsproj with NuGet configuration properties in
@@ -246,7 +246,7 @@ declare class NugetProjectProperties extends MSBuildProjectProperties {
246
246
  * Default: `''`
247
247
  * @example "git", "fts"
248
248
  */
249
- get RepositoryType(): typeof Type_RepositoryType.inferOut;
249
+ get RepositoryType(): typeof Type_RepoType.inferOut;
250
250
  /**
251
251
  * @returns The (optional) repository commit or changeset to indicate which
252
252
  * source the package was built against. {@link RepositoryUrl} must also be
@@ -366,11 +366,11 @@ declare class NugetProjectProperties extends MSBuildProjectProperties {
366
366
  type Class_NPP = ClassLike<typeof NugetProjectProperties & WithProto<Class_MSBPP>>;
367
367
  declare class NPPGetterNames {
368
368
  private static _prototypeChain;
369
- private static get PrototypeChain();
370
369
  private static _instanceGetters;
371
370
  private static _instanceGettersRecursive;
372
371
  private static _StaticGetters;
373
372
  private static _StaticGettersRecursive;
373
+ private static get PrototypeChain();
374
374
  static get InstanceGetters(): Exclude<keyof NugetProjectProperties, keyof MSBuildProjectProperties>[];
375
375
  static get InstanceGettersRecursive(): (keyof NugetProjectProperties)[];
376
376
  static get StaticGetters(): never[];
@@ -1 +1 @@
1
- {"version":3,"file":"NugetProjectProperties.d.mts","names":[],"sources":["../../src/dotnet/NugetProjectProperties.ts"],"mappings":";;;;;;;cAiBM,mBAAA,EAAqB,IAAA;AAAA,cACrB,wBAAA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