@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 +9 -9
- package/js/helper.js +23 -9
- package/js/index.d.ts +5 -0
- package/package.json +5 -3
- package/scripts/test-vercel-nft.js +16 -0
package/checksums.txt
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
sentry-cli-Darwin-arm64=
|
|
2
|
-
sentry-cli-Darwin-universal=
|
|
3
|
-
sentry-cli-Darwin-x86_64=
|
|
4
|
-
sentry-cli-Linux-aarch64=
|
|
5
|
-
sentry-cli-Linux-armv7=
|
|
6
|
-
sentry-cli-Linux-i686=
|
|
7
|
-
sentry-cli-Linux-x86_64=
|
|
8
|
-
sentry-cli-Windows-i686.exe=
|
|
9
|
-
sentry-cli-Windows-x86_64.exe=
|
|
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
|
-
*
|
|
7
|
-
* @
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
*
|
|
15
|
-
*
|
|
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.
|
|
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
|
+
});
|