zarro 1.174.0 → 1.174.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -442,7 +442,7 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
442
442
  if (!opts.nuspec) {
443
443
  return opts.nuspec;
444
444
  }
445
- const { isOptional, resolvedPath } = parseNuspecPath(opts.nuspec);
445
+ const { resolvedPath } = parseNuspecPath(opts.nuspec);
446
446
  if (path.isAbsolute(resolvedPath) && await fileExists(resolvedPath)) {
447
447
  return opts.nuspec;
448
448
  }
@@ -457,7 +457,7 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
457
457
  return opts.nuspec;
458
458
  }
459
459
  async function resolveAbsoluteNuspecPath(opts) {
460
- const { resolvedPath, isOptional } = parseNuspecPath(opts.nuspec);
460
+ const { resolvedPath } = parseNuspecPath(opts.nuspec);
461
461
  if (!resolvedPath) {
462
462
  throw new ZarroError(`unable to resolve path to nuspec: no nuspec provided`);
463
463
  }
@@ -1064,6 +1064,21 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
1064
1064
  throw new ZarroError(failMessage);
1065
1065
  }
1066
1066
  }
1067
+ let DotNetCache;
1068
+ (function (DotNetCache) {
1069
+ DotNetCache["all"] = "all";
1070
+ DotNetCache["httpCache"] = "http-cache";
1071
+ DotNetCache["globalPackages"] = "global-packages";
1072
+ DotNetCache["temp"] = "temp";
1073
+ })(DotNetCache || (DotNetCache = {}));
1074
+ async function clearCaches(cacheType) {
1075
+ const args = ["nuget", "locals", `${cacheType}`, "--clear"];
1076
+ await runDotNetWith(args);
1077
+ }
1078
+ clearCaches.all = DotNetCache.all;
1079
+ clearCaches.httpCache = DotNetCache.httpCache;
1080
+ clearCaches.globalPackages = DotNetCache.globalPackages;
1081
+ clearCaches.temp = DotNetCache.temp;
1067
1082
  module.exports = {
1068
1083
  test,
1069
1084
  build,
@@ -1083,6 +1098,8 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
1083
1098
  searchPackages,
1084
1099
  installPackage,
1085
1100
  upgradePackages,
1101
+ clearCaches,
1102
+ DotNetCache,
1086
1103
  create,
1087
1104
  listProjects,
1088
1105
  addProjectToSolution
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  INFO,
8
8
  NOTICE,
9
9
  WARNING
10
- };
10
+ }, ZarroError = requireModule("zarro-error");
11
11
  class LogLevels {
12
12
  get Debug() {
13
13
  return DEBUG;
@@ -50,13 +50,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
50
50
  return this._threshold;
51
51
  }
52
52
  setThreshold(value) {
53
+ const originalValue = value;
54
+ let translated = false;
53
55
  if (levels[value] !== undefined) {
56
+ translated = true;
54
57
  value = levels[value];
55
58
  }
56
59
  const intValue = parseInt(`${value}`);
57
60
  if (isNaN(intValue) || intValue < 1 || intValue > 5) {
58
- throw value +
59
- " is not a valid integer value. Try use one of (logger).LogLevels.{Debug|Info|Notice|Warning|Error}";
61
+ const pre = translated
62
+ ? `'${originalValue}' is not a known log level`
63
+ : `${originalValue} is not a value integer value`;
64
+ throw new ZarroError(`${pre}. Try use one of (logger).LogLevels.{Debug|Info|Notice|Warning|Error}`);
60
65
  }
61
66
  this._threshold = intValue;
62
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.174.0",
3
+ "version": "1.174.2",
4
4
  "description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
5
5
  "bin": {
6
6
  "zarro": "index.js"
package/types.d.ts CHANGED
@@ -1647,6 +1647,13 @@ declare global {
1647
1647
  showProgress?: boolean;
1648
1648
  }
1649
1649
 
1650
+ enum DotNetCache {
1651
+ all = "all",
1652
+ httpCache = "http-cache",
1653
+ globalPackages = "global-packages",
1654
+ temp = "temp"
1655
+ }
1656
+
1650
1657
  type DotNetTestFunction = (opts: DotNetTestOptions) => Promise<SystemResult | SystemError>;
1651
1658
  type DotNetBuildFunction = (opts: DotNetBuildOptions) => Promise<SystemResult | SystemError>;
1652
1659
  type DotNetPackFunction = (opts: DotNetPackOptions) => Promise<SystemResult | SystemError>;
@@ -1667,6 +1674,13 @@ declare global {
1667
1674
  type DotNetCreateFunction = (opts: DotNetCreateOptions) => Promise<string>;
1668
1675
  type DotNetListProjectsFunction = (solutionFile: string) => Promise<string[]>;
1669
1676
  type DotNetAddProjectToSolutionFunction = (opts: DotNetAddProjectToSolutionOptions) => Promise<void>;
1677
+ type DotNetClearCachesFunction = (opts: DotNetCache | string) => Promise<void>;
1678
+ type DotNetClearCachesFunctionWithEnumValues = DotNetClearCachesFunction & {
1679
+ all: DotNetCache;
1680
+ httpCache: DotNetCache;
1681
+ globalPackages: DotNetCache;
1682
+ temp: DotNetCache;
1683
+ }
1670
1684
 
1671
1685
  interface DotNetCli {
1672
1686
  clean: DotNetCleanFunction;
@@ -1690,6 +1704,7 @@ declare global {
1690
1704
  create: DotNetCreateFunction;
1691
1705
  listProjects: DotNetListProjectsFunction;
1692
1706
  addProjectToSolution: DotNetAddProjectToSolutionFunction;
1707
+ clearCaches: DotNetClearCachesFunctionWithEnumValues;
1693
1708
  }
1694
1709
 
1695
1710
  type ReadCsProjNode = (csproj: string) => Promise<string>;