@sanity/export 3.37.3 → 3.37.4

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2016 - 2024 Sanity.io
3
+ Copyright (c) 2024 - 2024 Sanity.io
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/export",
3
- "version": "3.37.3",
3
+ "version": "3.37.4",
4
4
  "description": "Export Sanity documents and assets",
5
5
  "keywords": [
6
6
  "sanity",
@@ -42,6 +42,7 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@jest/globals": "^29.7.0",
45
+ "@sanity/semantic-release-preset": "^4.1.7",
45
46
  "eslint": "^8.57.0",
46
47
  "eslint-config-prettier": "^9.1.0",
47
48
  "eslint-config-sanity": "^7.1.2",
@@ -55,6 +56,7 @@
55
56
  "node": ">=18"
56
57
  },
57
58
  "publishConfig": {
58
- "access": "public"
59
+ "access": "public",
60
+ "provenance": true
59
61
  }
60
62
  }
@@ -180,6 +180,13 @@ class AssetHandler {
180
180
  try {
181
181
  stream = await requestStream(options)
182
182
  } catch (err) {
183
+ const message = 'Failed to create asset stream'
184
+ if (typeof err.message === 'string') {
185
+ // try to re-assign the error message so the stack trace is more visible
186
+ err.message = `${message}: ${err.message}`
187
+ throw err
188
+ }
189
+
183
190
  throw new Error('Failed create asset stream', {cause: err})
184
191
  }
185
192
 
@@ -194,7 +201,14 @@ class AssetHandler {
194
201
 
195
202
  throw new Error(errMsg)
196
203
  } catch (err) {
197
- throw new Error('Failed to parse error response from asset stream', {cause: err})
204
+ const message = 'Failed to parse error response from asset stream'
205
+ if (typeof err.message === 'string') {
206
+ // try to re-assign the error message so the stack trace is more visible
207
+ err.message = `${message}: ${err.message}`
208
+ throw err
209
+ }
210
+
211
+ throw new Error(message, {cause: err})
198
212
  }
199
213
  }
200
214
 
@@ -211,7 +225,14 @@ class AssetHandler {
211
225
  md5 = res.md5
212
226
  size = res.size
213
227
  } catch (err) {
214
- throw new Error('Failed to write asset stream to filesystem', {cause: err})
228
+ const message = 'Failed to write asset stream to filesystem'
229
+
230
+ if (typeof err.message === 'string') {
231
+ err.message = `${message}: ${err.message}`
232
+ throw err
233
+ }
234
+
235
+ throw new Error(message, {cause: err})
215
236
  }
216
237
 
217
238
  // Verify it against our downloaded stream to make sure we have the same copy