zarro 1.171.2 โ†’ 1.172.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.
@@ -17,6 +17,7 @@
17
17
  const log = requireModule("log");
18
18
  const env = requireModule("env");
19
19
  const Version = requireModule("version");
20
+ const SystemError = requireModule("system-error");
20
21
  const emojiLabels = {
21
22
  testing: `๐Ÿงช Testing`,
22
23
  packing: `๐Ÿ“ฆ Packing`,
@@ -669,8 +670,9 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
669
670
  }
670
671
  }
671
672
  async function runDotNetWith(args, opts) {
673
+ let result;
672
674
  try {
673
- return await system("dotnet", args, {
675
+ result = await system("dotnet", args, {
674
676
  stdout: opts.stdout,
675
677
  stderr: opts.stderr,
676
678
  suppressOutput: opts.suppressOutput,
@@ -684,6 +686,11 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
684
686
  }
685
687
  throw e;
686
688
  }
689
+ const errors = result.stderr || [], hasDiedFromException = !!errors.find(s => s.toLowerCase().includes("unhandled exception"));
690
+ if (!hasDiedFromException) {
691
+ return result;
692
+ }
693
+ throw new SystemError(`dotnet exit code is zero, but stdout contains logging about an unhandled exception:\n${errors.join("\n")}`, result.exe, result.args, result.exitCode || Number.MIN_VALUE, result.stdout, result.stderr);
687
694
  }
688
695
  function pushMsbuildProperties(args, opts) {
689
696
  if (!opts.msbuildProperties) {
@@ -777,9 +784,19 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
777
784
  const stdout = [];
778
785
  opts.stdout = (s) => stdout.push(s);
779
786
  opts.suppressOutput = true;
780
- const rawResult = await runDotNetWith(args, opts);
787
+ let rawResult;
788
+ try {
789
+ rawResult = await runDotNetWith(args, opts);
790
+ }
791
+ catch (e) {
792
+ if (SystemError.isError(e)) {
793
+ throw wrapSearchError(e);
794
+ }
795
+ throw e;
796
+ }
781
797
  if (system.isError(rawResult)) {
782
- throw rawResult;
798
+ const systemError = rawResult;
799
+ throw wrapSearchError(systemError);
783
800
  }
784
801
  const allText = stdout.join(" "), parsed = JSON.parse(allText);
785
802
  const finalResult = [];
@@ -808,6 +825,23 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
808
825
  }
809
826
  return finalResult;
810
827
  }
828
+ function wrapSearchError(e) {
829
+ return new Error(`Unable to perform package search (check your access token if necessary): ${e}`);
830
+ }
831
+ function parsePackageSearchResult(stdout) {
832
+ const allText = stdout.join(" ");
833
+ let parsed;
834
+ try {
835
+ parsed = JSON.parse(allText);
836
+ }
837
+ catch (e) {
838
+ throw new Error(`Unable to parse json from:\n${allText}`);
839
+ }
840
+ if (parsed.problems && parsed.problems.length) {
841
+ throw new Error(`unable to perform package search (check your access token):\n${parsed.problems.join("\n")}`);
842
+ }
843
+ return parsed;
844
+ }
811
845
  async function installPackage(opts) {
812
846
  if (!opts) {
813
847
  throw new Error(`no options passed to 'installPackage' - target project and package name not specified`);
@@ -33,9 +33,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
33
  this._logLevels = new LogLevels();
34
34
  this._threshold = INFO;
35
35
  this._timestamp = true;
36
+ this._outputDisabled = false;
36
37
  const logLevel = (process.env.LOG_LEVEL || "").toUpperCase();
37
38
  this.setThreshold(levels[logLevel] || INFO);
38
39
  }
40
+ get outputDisabled() {
41
+ return this._outputDisabled;
42
+ }
43
+ disableOutput() {
44
+ this._outputDisabled = true;
45
+ }
46
+ enableOutput() {
47
+ this._outputDisabled = false;
48
+ }
39
49
  get threshold() {
40
50
  return this._threshold;
41
51
  }
@@ -94,6 +104,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
94
104
  this._timestamp = true;
95
105
  }
96
106
  _print(args, ...styles) {
107
+ if (this.outputDisabled) {
108
+ return;
109
+ }
97
110
  let message;
98
111
  if (typeof args[0] === "string") {
99
112
  message = args[0];
@@ -34,9 +34,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
34
34
  const pre = isWindows
35
35
  ? "@echo off"
36
36
  : "";
37
- const tempFile = await createTempFile(`
38
- ${pre}
39
- ${tempFileContents}
37
+ const tempFile = await createTempFile(`
38
+ ${pre}
39
+ ${tempFileContents}
40
40
  `.trim());
41
41
  programArgs.splice(0, programArgs.length);
42
42
  if (isWindows) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.171.2",
3
+ "version": "1.172.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"
@@ -68,6 +68,7 @@
68
68
  "gulp-dotnet-cli": "^1.1.0",
69
69
  "gulp-edit-xml": "^3.1.1",
70
70
  "gulp-filter": "^6.0.0",
71
+ "gulp-msbuild": "^0.11.0",
71
72
  "lodash.kebabcase": "^4.1.1",
72
73
  "node-nuget-client": "^0.12.0",
73
74
  "npm-run-all": "^4.1.5",
@@ -126,7 +127,6 @@
126
127
  "debugger-is-attached": "^1.2.0",
127
128
  "expect-even-more-jest": "^1.15.0",
128
129
  "filesystem-sandbox": "^1.20.0",
129
- "gulp-msbuild": "^0.11.0",
130
130
  "ioredis": "^5.3.2",
131
131
  "jest": "^29.6.2",
132
132
  "nodemon": "^3.0.1",
package/types.d.ts CHANGED
@@ -114,6 +114,10 @@ declare global {
114
114
 
115
115
  threshold: LogThreshold;
116
116
 
117
+ outputDisabled: boolean;
118
+ enableOutput(): void;
119
+ disableOutput(): void;
120
+
117
121
  }
118
122
 
119
123