@sentry/cli 1.74.4 → 1.74.6

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
@@ -2,6 +2,19 @@
2
2
 
3
3
  "You know what they say. Fool me once, strike one, but fool me twice... strike three." — Michael Scott
4
4
 
5
+ ## 1.74.6
6
+
7
+ ### Various fixes & improvements
8
+
9
+ - feat: Replace usage of eval to obfuscate binary path from bundlers (#1375)
10
+
11
+ ## 1.74.5
12
+
13
+ ### Various fixes & improvements
14
+
15
+ - deps: Add resolution to bump `ansi-regex` to version `^3.0.1` (#1281)
16
+ - ref: Increase `TempFile` robustness on Windows (#1256)
17
+
5
18
  ## 1.74.4
6
19
 
7
20
  ### Various fixes & improvements
package/checksums.txt CHANGED
@@ -1,9 +1,9 @@
1
- sentry-cli-Darwin-arm64=119413778b03d10c38b0d132d27c011aa2ef33e90a563ab0f300fd334d65d23e
2
- sentry-cli-Darwin-universal=2a68d4d8bde9c8288bdbf36972af0750c5283ef72c9d1ec3145611a3c63d8263
3
- sentry-cli-Darwin-x86_64=21e2d1291b8a912b36c998aa0947bc06c8de124ba3bac9aa8979db1dcd87d133
4
- sentry-cli-Linux-aarch64=3fdf9ff93fc5daca3f78dcb48c3da2f45051c368ee85bdf29358222489a6bcd4
5
- sentry-cli-Linux-armv7=d6ff4881f688c130f937a8f8633bfb31dfbefe927adb10c22d8cb34342fd73af
6
- sentry-cli-Linux-i686=389c56a06a936a12f42a09827ffdda738fd8a761b87452664207515dde44d774
7
- sentry-cli-Linux-x86_64=7d0310369055eff794e0e22d43461b95e9d72b20a3d84c5d18b3270d105dadd0
8
- sentry-cli-Windows-i686.exe=1fbc59485119c4c419b8272eed9ba5bfdc73d41521d80636aef69ce52d33f338
9
- sentry-cli-Windows-x86_64.exe=880346096dcd033d613112a325ce3361c99923c09d87cb60d582be9648eba690
1
+ sentry-cli-Darwin-arm64=0b0f0bfc1c7a5115c869b054291787a942a82e9c9a7bbca43f425e4f1f6d8e28
2
+ sentry-cli-Darwin-universal=fd667d9f5f89f2e5f2b7bb0287a009cadddb3d200bffa09c1fa8b0887c207fc3
3
+ sentry-cli-Darwin-x86_64=ec23e87d4c7eb7ed9cb42082f9a65d046fb62eb3c4005f360db721344cf63dcd
4
+ sentry-cli-Linux-aarch64=fc6c4c0fbe2d2aad4fa8a65f363665e16ced56a3372e09d6c51ff080c2472a76
5
+ sentry-cli-Linux-armv7=84d9b76284c6c9ef1950dadfa0c2aa0e8f77be083536117082c9da81457eb9e3
6
+ sentry-cli-Linux-i686=d75b8c876ee86718c918c47b72c86c21db14598ce2d953e73d7f94e02e54043b
7
+ sentry-cli-Linux-x86_64=ee4bd836f4fcc51bb3d7a05003d42e04f874e6ae1578877112acdb97181efd71
8
+ sentry-cli-Windows-i686.exe=0a84ea06a83d40aa0f85e54e72d6596b65f672f5eb51e57cd3cb25ebeca28837
9
+ sentry-cli-Windows-x86_64.exe=284e25b1bf8f5c14262baca5e315613c3856e71eff4f85c3f99483cf1c37582f
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cli",
3
- "version": "1.74.4",
3
+ "version": "1.74.6",
4
4
  "description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/",
5
5
  "homepage": "https://docs.sentry.io/hosted/learn/cli/",
6
6
  "license": "BSD-3-Clause",
@@ -28,11 +28,12 @@
28
28
  "fix": "npm-run-all fix:eslint fix:prettier",
29
29
  "fix:eslint": "eslint --fix bin/* scripts/**/*.js js/**/*.js",
30
30
  "fix:prettier": "prettier --write bin/* scripts/**/*.js js/**/*.js",
31
- "test": "npm-run-all test:jest test:eslint test:prettier",
31
+ "test": "npm-run-all test:jest test:eslint test:prettier test:vercel-nft",
32
32
  "test:jest": "jest",
33
33
  "test:watch": "jest --watch --notify",
34
34
  "test:eslint": "eslint bin/* scripts/**/*.js js/**/*.js",
35
- "test:prettier": "prettier --check bin/* scripts/**/*.js js/**/*.js"
35
+ "test:prettier": "prettier --check bin/* scripts/**/*.js js/**/*.js",
36
+ "test:vercel-nft": "node scripts/test-vercel-nft.js"
36
37
  },
37
38
  "dependencies": {
38
39
  "https-proxy-agent": "^5.0.0",
@@ -44,6 +45,7 @@
44
45
  "which": "^2.0.2"
45
46
  },
46
47
  "devDependencies": {
48
+ "@vercel/nft": "^0.22.1",
47
49
  "eslint": "^6.8.0",
48
50
  "eslint-config-airbnb-base": "^14.1.0",
49
51
  "eslint-config-prettier": "^6.10.1",
@@ -52,6 +54,9 @@
52
54
  "npm-run-all": "^4.1.5",
53
55
  "prettier": "^1.19.1"
54
56
  },
57
+ "resolutions": {
58
+ "npmlog/**/ansi-regex": "^3.0.1"
59
+ },
55
60
  "jest": {
56
61
  "collectCoverage": true,
57
62
  "testEnvironment": "node",
@@ -0,0 +1,27 @@
1
+ const major = process.versions.node.split('.')[0];
2
+
3
+ // @vercel/nft doe not support Node.js v8
4
+ if (major < 10) {
5
+ process.exit(0);
6
+ }
7
+
8
+ // eslint-disable-next-line import/no-extraneous-dependencies
9
+ const { nodeFileTrace } = require('@vercel/nft');
10
+
11
+ const entryPoint = require.resolve('..');
12
+
13
+ // Trace the module entrypoint
14
+ nodeFileTrace([entryPoint]).then(result => {
15
+ // eslint-disable-next-line no-console
16
+ console.log('@vercel/nft traced dependencies:', Array.from(result.fileList));
17
+
18
+ // If either binary is picked up, fail the test
19
+ if (result.fileList.has('sentry-cli') || result.fileList.has('sentry-cli.exe')) {
20
+ // eslint-disable-next-line no-console
21
+ console.error('ERROR: The sentry-cli binary should not be found by @vercel/nft');
22
+ process.exit(-1);
23
+ } else {
24
+ // eslint-disable-next-line no-console
25
+ console.log('The sentry-cli binary was not traced by @vercel/nft');
26
+ }
27
+ });