@sentry/cli 2.8.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=772a45b9e9935f1105bdd3bd63f448bd78432fc4616c253cc6aa295f743c364c
2
- sentry-cli-Darwin-universal=a2aadaf804fad99ac70f52a32bf1f0ff53327ed52c2a723fea04bbe9cbde3485
3
- sentry-cli-Darwin-x86_64=eb4f04ad6c577fcf397a46c58e9d9a7073d777237f70a25af5c30c3f00060e55
4
- sentry-cli-Linux-aarch64=652b0a6fb992fac95b80bcc6d2f59868750ac22eb2ff4156d3c8bd646c934c3b
5
- sentry-cli-Linux-armv7=0c41f307f3f2a69270150b1b8fd41acbbcfbe8730610d3a7dd8bdd7aecac6613
6
- sentry-cli-Linux-i686=b543cf7394a0516fa85d69a63a8f0a91a5aa3ccceb5d40355193f8491224b1bf
7
- sentry-cli-Linux-x86_64=bbbd739afc0d8a6736ae45e5f6fcd6db87f7abf45de9fa76e5621834f2dfd15d
8
- sentry-cli-Windows-i686.exe=760d313eddd0f1dd5b23301635dc7c4512b021d9dc01067eb7fa6b54e4789078
9
- sentry-cli-Windows-x86_64.exe=a89a4ca913be1e5ff9ccb456b5bde221bb59128eb5ca2de0f6bcd09a119471ee
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.
@@ -165,7 +173,10 @@ async function execute(args, live, silent, configFile, config = {}) {
165
173
  if (config.customHeader) {
166
174
  env.CUSTOM_HEADER = config.customHeader;
167
175
  } else if (config.headers) {
168
- const headers = Object.entries(config.headers).flatMap(([key, value]) => ['--header', `${key}:${value}`]);
176
+ const headers = Object.entries(config.headers).flatMap(([key, value]) => [
177
+ '--header',
178
+ `${key}:${value}`,
179
+ ]);
169
180
  args = [...headers, ...args];
170
181
  }
171
182
  return new Promise((resolve, reject) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cli",
3
- "version": "2.8.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
+ });