@sentry/cli 2.7.0 → 2.8.1

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=d9ea5cbb53c3809558007f6b3af809b3ad186d4a2014929d63099633d44d9765
2
- sentry-cli-Darwin-universal=a757a3700bcb16c16485f15d0a187c12ac1edd40b4aa29f5cb955f9a4fa9ae96
3
- sentry-cli-Darwin-x86_64=d56d1a4e793d2cceb4cd9614794241a34332c3bc1a217972c019165c3d146e3d
4
- sentry-cli-Linux-aarch64=9908b947a7a2c393e8c115665d972fbe3eb67e540b1ee0b07fedce78e7a712cf
5
- sentry-cli-Linux-armv7=0f240f47f6b38a3b7c4025cd3d4e53c746e9b6a05f210ecd7d41bc09512e0b77
6
- sentry-cli-Linux-i686=dc08351e062a2d30309cb1f94173f79b2b7cf2e23d122adbfbdd71a1afb88d9c
7
- sentry-cli-Linux-x86_64=6a57a418b34c5ad71b5dddc73b8d63b5662b8a11713ac0d92377b64976507d82
8
- sentry-cli-Windows-i686.exe=f4877fca56d94c56784baca8140dd5e7552db1dae646c0b107be350b3b5f5209
9
- sentry-cli-Windows-x86_64.exe=76f3bf7c8edca9b660b82f53d5b94e9dc0505075d5cfb2ace09d807f9ed22bf0
1
+ sentry-cli-Darwin-arm64=e363c62099ae29a0cb18fca7d1fce11c9d9912a12fdafb6b581d8fa85e3a75dc
2
+ sentry-cli-Darwin-universal=aded269c5e6448bdc18fefdd8bb2e3aafc14d7b62f786f224f1a005320d10fc6
3
+ sentry-cli-Darwin-x86_64=0a2511a1db4df9297efb03d154d3af57c6fac942c64b3d8b494f931d0ced2469
4
+ sentry-cli-Linux-aarch64=8607277dd4e672abec3d1f65a7b108e7f76c506467392141ce7b727f85e8a648
5
+ sentry-cli-Linux-armv7=d472cfe971606d824ec03fb6950e3a7807a55933deaa91199c2b5e8dad59f495
6
+ sentry-cli-Linux-i686=e01b420d9371e29e3796faeb5cb5070de93e2d65deb94dd20d14f4bb90be2032
7
+ sentry-cli-Linux-x86_64=517e07749123f3b30c388a6e9347c6e7f99ed86808110e916c27d6a5638032ad
8
+ sentry-cli-Windows-i686.exe=4eaa6c3d40dc5924b51b05f5a9831cb1136dd8abe51ce45ba921f1d07d32d450
9
+ sentry-cli-Windows-x86_64.exe=e9b90852b0120f00f3462fecf870d8872ec5ee8fa263ba075abd8fcd573c58fb
package/js/helper.js CHANGED
@@ -1,21 +1,29 @@
1
1
  'use strict';
2
2
 
3
+ const path = require('path');
3
4
  const childProcess = require('child_process');
4
5
 
5
6
  /**
6
- * Absolute path to the sentry-cli binary (platform dependent).
7
- * @type {string}
7
+ * This convoluted function resolves the path to the `sentry-cli` binary in a
8
+ * way that can't be analysed by @vercel/nft.
9
+ *
10
+ * Without this, the binary can be detected as an asset and included by bundlers
11
+ * that use @vercel/nft.
12
+ * @returns {string} The path to the sentry-cli binary
8
13
  */
9
- let binaryPath = eval(
10
- "require('path').resolve(__dirname, require('os').platform() === 'win32' ? '..\\sentry-cli.exe' : '../sentry-cli')"
11
- );
14
+ function getBinaryPath() {
15
+ const parts = [];
16
+ parts.push(__dirname);
17
+ parts.push('..');
18
+ parts.push(`sentry-cli${process.platform === 'win32' ? '.exe' : ''}`);
19
+ return path.resolve(...parts);
20
+ }
12
21
 
13
22
  /**
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
23
+ * Absolute path to the sentry-cli binary (platform dependent).
24
+ * @type {string}
18
25
  */
26
+ let binaryPath = getBinaryPath();
19
27
 
20
28
  /**
21
29
  * Overrides the default binary path with a mock value, useful for testing.
@@ -164,6 +172,12 @@ async function execute(args, live, silent, configFile, config = {}) {
164
172
  }
165
173
  if (config.customHeader) {
166
174
  env.CUSTOM_HEADER = config.customHeader;
175
+ } else if (config.headers) {
176
+ const headers = Object.entries(config.headers).flatMap(([key, value]) => [
177
+ '--header',
178
+ `${key}:${value}`,
179
+ ]);
180
+ args = [...headers, ...args];
167
181
  }
168
182
  return new Promise((resolve, reject) => {
169
183
  if (live === true) {
package/js/index.d.ts CHANGED
@@ -47,6 +47,11 @@ declare module '@sentry/cli' {
47
47
  * This value will update `CUSTOM_HEADER` env variable.
48
48
  */
49
49
  customHeader?: string;
50
+ /**
51
+ * Headers added to every outgoing network request.
52
+ * This value does not set any env variable, and is overridden by `customHeader`.
53
+ */
54
+ headers?: Record<string, string>;
50
55
  }
51
56
 
52
57
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cli",
3
- "version": "2.7.0",
3
+ "version": "2.8.1",
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/",
@@ -23,6 +23,7 @@
23
23
  "which": "^2.0.2"
24
24
  },
25
25
  "devDependencies": {
26
+ "@vercel/nft": "^0.22.1",
26
27
  "eslint": "^8.13.0",
27
28
  "eslint-config-prettier": "^8.5.0",
28
29
  "jest": "^27.5.1",
@@ -34,11 +35,12 @@
34
35
  "fix": "npm-run-all fix:eslint fix:prettier",
35
36
  "fix:eslint": "eslint --fix bin/* scripts/**/*.js js/**/*.js",
36
37
  "fix:prettier": "prettier --write bin/* scripts/**/*.js js/**/*.js",
37
- "test": "npm-run-all test:jest test:eslint test:prettier",
38
+ "test": "npm-run-all test:jest test:eslint test:prettier test:vercel-nft",
38
39
  "test:jest": "jest",
39
40
  "test:watch": "jest --watch --notify",
40
41
  "test:eslint": "eslint bin/* scripts/**/*.js js/**/*.js",
41
- "test:prettier": "prettier --check bin/* scripts/**/*.js js/**/*.js"
42
+ "test:prettier": "prettier --check bin/* scripts/**/*.js js/**/*.js",
43
+ "test:vercel-nft": "node scripts/test-vercel-nft.js"
42
44
  },
43
45
  "jest": {
44
46
  "collectCoverage": true,
@@ -0,0 +1,16 @@
1
+ const { nodeFileTrace } = require('@vercel/nft');
2
+
3
+ const entryPoint = require.resolve('..');
4
+
5
+ // Trace the module entrypoint
6
+ nodeFileTrace([entryPoint]).then((result) => {
7
+ console.log('@vercel/nft traced dependencies:', Array.from(result.fileList));
8
+
9
+ // If either binary is picked up, fail the test
10
+ if (result.fileList.has('sentry-cli') || result.fileList.has('sentry-cli.exe')) {
11
+ console.error('ERROR: The sentry-cli binary should not be found by @vercel/nft');
12
+ process.exit(-1);
13
+ } else {
14
+ console.log('The sentry-cli binary was not traced by @vercel/nft');
15
+ }
16
+ });