@sentry/cli 2.0.1 → 2.0.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/checksums.txt CHANGED
@@ -1,9 +1,9 @@
1
- sentry-cli-Darwin-arm64=6bf38158c0b3d198802a22ec2d2021d619e5fe1a125f2d21395c6b0b54f5808d
2
- sentry-cli-Darwin-universal=4ded776b94d1c1e26fbb9e8811fdf003e7f51116bd4720e627a3bc2b9a814e74
3
- sentry-cli-Darwin-x86_64=a3add22156f70fba60c4f2eb47880362c704bd1fbc6f455f7f9f941a3e269754
4
- sentry-cli-Linux-aarch64=d05bf0aba980795fb046c62a693bd6c152421de1f85c1c851f94e206cabbe62f
5
- sentry-cli-Linux-armv7=3e64b3b61dca0cae6c6845dfbfe7ec19a208cc04480ec1dca5a343d2a5a8f3f5
6
- sentry-cli-Linux-i686=2ac8358c52f5a8936bade1729fb85e3b8be604d60bd195f88609cb44e6fb8f06
7
- sentry-cli-Linux-x86_64=4f378d823e03a40560cb0438b3eb3ee54ea828aff6087a9ef63dfeb31fb064ab
8
- sentry-cli-Windows-i686.exe=83965514cc737d6d96cd04d39d0ba91a26fa7881e3bcd325ac89a60d615f4de1
9
- sentry-cli-Windows-x86_64.exe=00df30fa383c90e27a14f8ddb151f8b29a7edb78507e8832350260bd0e131209
1
+ sentry-cli-Darwin-arm64=6ad23605f6e345375a80aeebc5db7dc9e42226abf63e39dd91730b8b831511a8
2
+ sentry-cli-Darwin-universal=283370a6bf7356a422f39ab805094edefe15f087d512c4579b60e584cf4a3e20
3
+ sentry-cli-Darwin-x86_64=f1f3ea7f5d1ed481080e8eb150b3adbf4ab02890f9ec1227e1703f7ec8e25c84
4
+ sentry-cli-Linux-aarch64=e796a2d535cc59c6d72e5e19aa7604e964328b5a7e09a62f695e0d9acde9b07e
5
+ sentry-cli-Linux-armv7=19ea3f1a843b37df82b310ab82e330f6f26e4ff8b20b4c98c2a47c894c2164ff
6
+ sentry-cli-Linux-i686=abb2f9daeb78ba01ae3f2c36e4d64fb54fd3e937683c25f980872331c2a0e1b3
7
+ sentry-cli-Linux-x86_64=46b6d913e3bfeccaf3170493942120a1b7b11b07c04e932b8fa643187c621fdf
8
+ sentry-cli-Windows-i686.exe=7df3c7e672dae7338245a07685a05847dfa8d18daea51bbbab78feb95a7c0199
9
+ sentry-cli-Windows-x86_64.exe=ecbc89c357bf67cfa9a2f937a10253c46f1183e8480a86c688885a0e3017003b
package/js/helper.js CHANGED
@@ -1,19 +1,22 @@
1
1
  'use strict';
2
2
 
3
3
  const childProcess = require('child_process');
4
- const os = require('os');
5
- const path = require('path');
6
4
 
7
5
  /**
8
6
  * Absolute path to the sentry-cli binary (platform dependent).
9
7
  * @type {string}
10
8
  */
11
- // istanbul ignore next
12
- let binaryPath = path.resolve(
13
- __dirname,
14
-
15
- os.platform() === 'win32' ? '..\\sentry-cli.exe' : '../sentry-cli'
9
+ let binaryPath = eval(
10
+ "require('path').resolve(__dirname, require('os').platform() === 'win32' ? '..\\sentry-cli.exe' : '../sentry-cli')"
16
11
  );
12
+
13
+ /**
14
+ * NOTE: `eval` usage is a workaround for @vercel/nft detecting the binary itself as the hard dependency
15
+ * and effectively always including it in the bundle, which is not what we want.
16
+ * ref: https://github.com/getsentry/sentry-javascript/issues/3865
17
+ * ref: https://github.com/vercel/nft/issues/203
18
+ */
19
+
17
20
  /**
18
21
  * Overrides the default binary path with a mock value, useful for testing.
19
22
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.4",
4
4
  "description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/",
5
5
  "repository": "git://github.com/getsentry/sentry-cli.git",
6
6
  "homepage": "https://docs.sentry.io/hosted/learn/cli/",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "https-proxy-agent": "^5.0.0",
19
- "node-fetch": "^3.2.3",
19
+ "node-fetch": "^2.6.7",
20
20
  "npmlog": "^6.0.1",
21
21
  "progress": "^2.0.3",
22
22
  "proxy-from-env": "^1.1.0",
@@ -11,7 +11,7 @@ const zlib = require('zlib');
11
11
  const stream = require('stream');
12
12
  const process = require('process');
13
13
 
14
- const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
14
+ const fetch = require('node-fetch');
15
15
  const HttpsProxyAgent = require('https-proxy-agent');
16
16
  const ProgressBar = require('progress');
17
17
  const Proxy = require('proxy-from-env');
@@ -230,21 +230,19 @@ async function downloadBinary() {
230
230
  redirect: 'follow',
231
231
  });
232
232
  } catch (error) {
233
- if (error instanceof fetch.FetchError) {
234
- throw new Error(
235
- `Unable to download sentry-cli binary from ${downloadUrl}.\nError code: ${error.code}`
236
- );
237
- } else {
238
- throw error;
233
+ let errorMsg = `Unable to download sentry-cli binary from ${downloadUrl}.\nError message: ${error.message}`;
234
+ if (error.code) {
235
+ errorMsg += `\nError code: ${error.code}`;
239
236
  }
237
+ throw new Error(errorMsg);
240
238
  }
241
239
 
242
240
  if (!response.ok) {
243
- throw new Error(
244
- `Unable to download sentry-cli binary from ${downloadUrl}.\nServer returned ${
245
- response.status
246
- }${response.statusText ? `: ${response.statusText}` : ''}.`
247
- );
241
+ let errorMsg = `Unable to download sentry-cli binary from ${downloadUrl}.\nServer returned: ${response.status}`;
242
+ if (response.statusText) {
243
+ errorMsg += ` - ${response.statusText}`;
244
+ }
245
+ throw new Error(errorMsg);
248
246
  }
249
247
 
250
248
  const contentEncoding = response.headers.get('content-encoding');