@storm-software/workspace-tools 1.66.6 → 1.66.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,27 @@
1
+ ## 1.66.8 (2024-03-28)
2
+
3
+
4
+ ### 🩹 Fixes
5
+
6
+ - **workspace-tools:** Correctly handle all value types in error logging ([4b072154](https://github.com/storm-software/storm-ops/commit/4b072154))
7
+
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - Patrick Sullivan
12
+
13
+ ## 1.66.7 (2024-03-28)
14
+
15
+
16
+ ### 🩹 Fixes
17
+
18
+ - **workspace-tools:** Enhance error formatting and handling in `cargo-publish` executor ([a0423bc6](https://github.com/storm-software/storm-ops/commit/a0423bc6))
19
+
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - Patrick Sullivan
24
+
1
25
  ## 1.66.6 (2024-03-28)
2
26
 
3
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/workspace-tools",
3
- "version": "1.66.6",
3
+ "version": "1.66.8",
4
4
  "private": false,
5
5
  "description": "⚡ A Nx plugin package that contains various executors and generators used in a Storm workspaces.",
6
6
  "keywords": [
@@ -70,10 +70,14 @@ export default async function runExecutor(
70
70
  };
71
71
  } catch (error: any) {
72
72
  if (
73
- error?.cause?.message &&
74
- typeof error.cause.message === "string" &&
75
- error.cause.message.includes("crate version") &&
76
- error.cause.message.includes("is already uploaded")
73
+ (error?.message &&
74
+ typeof error.message === "string" &&
75
+ error.message.toLowerCase().includes("crate version") &&
76
+ error.message.toLowerCase().includes("is already uploaded")) ||
77
+ (error?.cause?.message &&
78
+ typeof error.cause.message === "string" &&
79
+ error.cause.message.toLowerCase().includes("crate version") &&
80
+ error.cause.message.toLowerCase().includes("is already uploaded"))
77
81
  ) {
78
82
  console.log(
79
83
  `Skipped package "${cargoToml.package.name}" from project "${cargoToml.package.name}" because v${cargoToml.package.version} already exists in https://crates.io with tag "latest"`
@@ -86,9 +90,27 @@ export default async function runExecutor(
86
90
 
87
91
  console.error("Failed to publish to https://crates.io");
88
92
  console.error(error);
93
+ console.log("");
94
+ console.error(formatLog(error));
89
95
 
90
96
  return {
91
97
  success: false
92
98
  };
93
99
  }
94
100
  }
101
+
102
+ const formatLog = (message?: any, name?: string): string =>
103
+ typeof message === "boolean"
104
+ ? String(message)
105
+ : !message
106
+ ? "<None>"
107
+ : typeof message === "string"
108
+ ? `"${message}"`
109
+ : typeof message === "number"
110
+ ? message.toString()
111
+ : typeof message === "object"
112
+ ? (name ? ` --- ${name} ---\n` : "") +
113
+ Object.keys(message)
114
+ .map((key) => ` - ${key}=${formatLog(message[key])}`)
115
+ .join("\n")
116
+ : JSON.stringify(message);