@sentry/cli 2.47.1 → 2.48.0

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,10 +1,10 @@
1
- sentry-cli-Darwin-arm64=8fe16710e3b6a377541f9697d430810b46fda5caef15c07086184427051d78c5
2
- sentry-cli-Darwin-universal=08d43e66fabade2d3b385c74f78e3be50f96846c5f8702400d7b81b3c672e4b2
3
- sentry-cli-Darwin-x86_64=02319109c31868c04e31ae3d701715dc76d57cb90569bc08ecc4ab830facbff5
4
- sentry-cli-Linux-aarch64=6ce920ff84c68d2c7b7cfd093adc35cf731adcdc5ccb2dc962505b44f31a3429
5
- sentry-cli-Linux-armv7=bc97edf7f5b776ca4f034a6d35b18934eb5fef3b4a030933bbdb3d6d38e10c4c
6
- sentry-cli-Linux-i686=a627aa2d4a985ff8d6ec4f01b27bdd411893b673c86d6446c23fbba18db80b7f
7
- sentry-cli-Linux-x86_64=6613872f1b21240fb5732be62620ef2bb40a436ce93955ca96393e6046947951
8
- sentry-cli-Windows-aarch64.exe=0bfcf84f8ce9aaa0ebfa4d87f1cec47b09193e307bdeb5f5555d81fc6e34bb0c
9
- sentry-cli-Windows-i686.exe=410f622253c1faa5e6991ad76790db4068db4e2ffd5e20cad1aa15343776c00e
10
- sentry-cli-Windows-x86_64.exe=23f5a4d98931729af8cc46eab49ad5defc5d2567c6ce9306673200e87b0d2ddc
1
+ sentry-cli-Darwin-arm64=4055005b478b9af96d67dd63f0821c85505e4a6f08ab5a1b9b0c3941ea542a8f
2
+ sentry-cli-Darwin-universal=583fe0f18651e219969f0a47698b522354b0ac0fb296764c67ea36850a99d39d
3
+ sentry-cli-Darwin-x86_64=5c2707c5d965be755c0200be19e6f9ebe924b135f79201858d375adb751eee7d
4
+ sentry-cli-Linux-aarch64=61ed4b287492919fb30bd96511169650a88c5004f31fcce5490541b8e0d4d4bf
5
+ sentry-cli-Linux-armv7=672049db50efd2cf28d0172cea8aff670f6f16b31a0444dc471209df1c6c0578
6
+ sentry-cli-Linux-i686=fbad1830295a11697d3c0ee9d17819bd35872bf86539d719795afb79ba4137fd
7
+ sentry-cli-Linux-x86_64=fdb0ee7a426cdd1b1bbae35ff4835af6fa55f0647fe558c7e8705df61b279f30
8
+ sentry-cli-Windows-aarch64.exe=37c91959e56a704264da6595357e8412d33602d764ddf0fb2cfef4a05bd872ee
9
+ sentry-cli-Windows-i686.exe=29ae42121c757fc7d473c458dc70deb06d9288e6ec31c15db41f6af0a557f5c3
10
+ sentry-cli-Windows-x86_64.exe=2015a5c425fe33101c1e922c79fc6440398ee7ce328053dfb06e4839abe2d497
package/js/helper.js CHANGED
@@ -186,6 +186,7 @@ function mockBinaryPath(mockPath) {
186
186
  * @typedef {object} OptionSchema
187
187
  * @prop {string} param The flag of the command line option including dashes.
188
188
  * @prop {OptionType} type The value type of the command line option.
189
+ * @prop {string} [invertedParam] The flag of the command line option including dashes (optional).
189
190
  */
190
191
 
191
192
  /**
@@ -245,7 +246,7 @@ function serializeOptions(schema, options) {
245
246
  /**
246
247
  * Serializes the command and its options into an arguments array.
247
248
  *
248
- * @param {string} command The literal name of the command.
249
+ * @param {string[]} command The literal name of the command.
249
250
  * @param {OptionsSchema} [schema] An options schema required by the command.
250
251
  * @param {object} [options] An options object according to the schema.
251
252
  * @returns {string[]} An arguments array that can be passed via command line.
@@ -280,7 +281,11 @@ function getPath() {
280
281
  * expect(output.trim()).toBe('sentry-cli x.y.z');
281
282
  *
282
283
  * @param {string[]} args Command line arguments passed to `sentry-cli`.
283
- * @param {boolean} live We inherit stdio to display `sentry-cli` output directly.
284
+ * @param {boolean | 'rejectOnError'} live can be set to:
285
+ * - `true` to inherit stdio to display `sentry-cli` output directly.
286
+ * - `false` to not inherit stdio and return the output as a string.
287
+ * - `'rejectOnError'` to inherit stdio and reject the promise if the command
288
+ * exits with a non-zero exit code.
284
289
  * @param {boolean} silent Disable stdout for silents build (CI/Webpack Stats, ...)
285
290
  * @param {string} [configFile] Relative or absolute path to the configuration file.
286
291
  * @param {Object} [config] More configuration to pass to the CLI
@@ -321,15 +326,27 @@ async function execute(args, live, silent, configFile, config = {}) {
321
326
  ]);
322
327
  args = [...headers, ...args];
323
328
  }
329
+
324
330
  return new Promise((resolve, reject) => {
325
- if (live === true) {
331
+ if (live === true || live === 'rejectOnError') {
326
332
  const output = silent ? 'ignore' : 'inherit';
327
333
  const pid = childProcess.spawn(getPath(), args, {
328
334
  env,
329
335
  // stdin, stdout, stderr
330
336
  stdio: ['ignore', output, output],
331
337
  });
332
- pid.on('exit', () => {
338
+ pid.on('exit', (exitCode) => {
339
+ if (live === 'rejectOnError') {
340
+ if (exitCode === 0) {
341
+ resolve('success (live mode)');
342
+ }
343
+ reject(new Error(`Command ${args.join(' ')} failed with exit code ${exitCode}`));
344
+ }
345
+ // According to the type definition, resolving with void is not allowed.
346
+ // However, for backwards compatibility, we resolve void here to
347
+ // avoid a behaviour-breaking change.
348
+ // TODO (v3): Clean this up and always resolve a string (or change the type definition)
349
+ // @ts-expect-error - see comment above
333
350
  resolve();
334
351
  });
335
352
  } else {
@@ -10,13 +10,13 @@ const DEFAULT_IGNORE = ['node_modules'];
10
10
 
11
11
  /**
12
12
  * Schema for the `upload-sourcemaps` command.
13
- * @type {OptionsSchema}
13
+ * @type {import('../helper').OptionsSchema}
14
14
  */
15
15
  const SOURCEMAPS_SCHEMA = require('./options/uploadSourcemaps');
16
16
 
17
17
  /**
18
18
  * Schema for the `deploys new` command.
19
- * @type {OptionsSchema}
19
+ * @type {import('../helper').OptionsSchema}
20
20
  */
21
21
  const DEPLOYS_SCHEMA = require('./options/deploys');
22
22
 
@@ -95,7 +95,7 @@ class Releases {
95
95
  commitFlags.push('--ignore-missing');
96
96
  }
97
97
 
98
- return this.execute(['releases', 'set-commits', release].concat(commitFlags));
98
+ return this.execute(['releases', 'set-commits', release].concat(commitFlags), false);
99
99
  }
100
100
 
101
101
  /**
@@ -199,7 +199,10 @@ class Releases {
199
199
 
200
200
  return uploadPaths.map((path) =>
201
201
  // `execute()` is async and thus we're returning a promise here
202
- this.execute(helper.prepareCommand([...args, path], SOURCEMAPS_SCHEMA, newOptions), true)
202
+ this.execute(
203
+ helper.prepareCommand([...args, path], SOURCEMAPS_SCHEMA, newOptions),
204
+ options.live != null ? options.live : true
205
+ )
203
206
  );
204
207
  });
205
208
 
@@ -255,7 +258,11 @@ class Releases {
255
258
  /**
256
259
  * See {helper.execute} docs.
257
260
  * @param {string[]} args Command line arguments passed to `sentry-cli`.
258
- * @param {boolean} live We inherit stdio to display `sentry-cli` output directly.
261
+ * @param {boolean | 'rejectOnError'} live can be set to:
262
+ * - `true` to inherit stdio to display `sentry-cli` output directly.
263
+ * - `false` to not inherit stdio and return the output as a string.
264
+ * - `'rejectOnError'` to inherit stdio and reject the promise if the command
265
+ * exits with a non-zero exit code.
259
266
  * @returns {Promise.<string>} A promise that resolves to the standard output.
260
267
  */
261
268
  async execute(args, live) {
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @type {import('../../helper').OptionsSchema}
3
+ */
1
4
  module.exports = {
2
5
  env: {
3
6
  param: '--env',
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @type {import('../../helper').OptionsSchema}
3
+ */
1
4
  module.exports = {
2
5
  ignore: {
3
6
  param: '--ignore',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/cli",
3
- "version": "2.47.1",
3
+ "version": "2.48.0",
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/",
@@ -22,22 +22,24 @@
22
22
  "which": "^2.0.2"
23
23
  },
24
24
  "devDependencies": {
25
+ "@types/node": "^20.10.0",
25
26
  "@vercel/nft": "^0.22.1",
26
27
  "eslint": "^7.32.0",
27
28
  "eslint-config-prettier": "^8.5.0",
28
29
  "jest": "^27.5.1",
29
30
  "npm-run-all": "^4.1.5",
30
- "prettier": "2.8.8"
31
+ "prettier": "2.8.8",
32
+ "typescript": "~5.8.3"
31
33
  },
32
34
  "optionalDependencies": {
33
- "@sentry/cli-darwin": "2.47.1",
34
- "@sentry/cli-linux-arm": "2.47.1",
35
- "@sentry/cli-linux-arm64": "2.47.1",
36
- "@sentry/cli-linux-i686": "2.47.1",
37
- "@sentry/cli-linux-x64": "2.47.1",
38
- "@sentry/cli-win32-i686": "2.47.1",
39
- "@sentry/cli-win32-x64": "2.47.1",
40
- "@sentry/cli-win32-arm64": "2.47.1"
35
+ "@sentry/cli-darwin": "2.48.0",
36
+ "@sentry/cli-linux-arm": "2.48.0",
37
+ "@sentry/cli-linux-arm64": "2.48.0",
38
+ "@sentry/cli-linux-i686": "2.48.0",
39
+ "@sentry/cli-linux-x64": "2.48.0",
40
+ "@sentry/cli-win32-i686": "2.48.0",
41
+ "@sentry/cli-win32-x64": "2.48.0",
42
+ "@sentry/cli-win32-arm64": "2.48.0"
41
43
  },
42
44
  "scripts": {
43
45
  "postinstall": "node ./scripts/install.js",
@@ -49,6 +51,7 @@
49
51
  "test:watch": "jest --watch --notify",
50
52
  "test:eslint": "eslint bin/* scripts/**/*.js js/**/*.js",
51
53
  "test:prettier": "prettier --check bin/* scripts/**/*.js js/**/*.js",
54
+ "check:types": "tsc --noEmit",
52
55
  "test:vercel-nft": "node scripts/test-vercel-nft.js"
53
56
  },
54
57
  "jest": {