@sentry/cli 3.1.0 → 3.2.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/README.md +4 -0
- package/checksums.txt +10 -10
- package/js/index.d.ts +3 -1
- package/js/index.js +2 -0
- package/js/releases/index.js +1 -0
- package/js/sourceMaps/index.d.ts +45 -0
- package/js/sourceMaps/index.js +83 -0
- package/js/sourceMaps/options/inject.d.ts +21 -0
- package/js/sourceMaps/options/inject.js +24 -0
- package/js/types.d.ts +28 -0
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -62,3 +62,7 @@ Also, there is a Dockerfile that builds an Alpine-based Docker image with
|
|
|
62
62
|
docker build -t sentry-cli .
|
|
63
63
|
docker run --rm -v $(pwd):/work sentry-cli --help
|
|
64
64
|
```
|
|
65
|
+
|
|
66
|
+
## Internal docs
|
|
67
|
+
|
|
68
|
+
Snapshot: [Sentry CLI distribution as of 2026-01-29](docs/snapshots/2026-01-29-sentry-cli-distribution.md).
|
package/checksums.txt
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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-aarch64.exe=
|
|
9
|
-
sentry-cli-Windows-i686.exe=
|
|
10
|
-
sentry-cli-Windows-x86_64.exe=
|
|
1
|
+
sentry-cli-Darwin-arm64=17802017c1a0d76751b4bfdddea4366a84d19e790de86e9675e09f2d4cf9cefd
|
|
2
|
+
sentry-cli-Darwin-universal=a18195af49db6ea455a0d785b5bd392fb8df6f2eaf0078528c6b4653b4ce5799
|
|
3
|
+
sentry-cli-Darwin-x86_64=4018f4162b2f160c01b082d64ac36cce069c81e71a1bae3707324b3d90634415
|
|
4
|
+
sentry-cli-Linux-aarch64=e92b176153f3729b2b4b0d41b9b523df6ebbd49378b45fbbc008052042460f96
|
|
5
|
+
sentry-cli-Linux-armv7=9cde058201958bc53c1ba4deb67fcb76970084522cd5e980ea16791b21757c31
|
|
6
|
+
sentry-cli-Linux-i686=5e08f47c358ee6592bea2a6854a722d7a5512c879e7a0440897e882fdb5b496c
|
|
7
|
+
sentry-cli-Linux-x86_64=cb82525102b8ad9a300bfb55afa3dc2d9ab275caf1dcbfdf431fc11fdf13136f
|
|
8
|
+
sentry-cli-Windows-aarch64.exe=6b88b9e618a00f2f8dd743fb8a44ab250de34fca07e178c2fa36a7d42fce513f
|
|
9
|
+
sentry-cli-Windows-i686.exe=034c756e27768b872ae1bdec1eb3edfb32ec3f7d7576e7373a45ec0784e067ee
|
|
10
|
+
sentry-cli-Windows-x86_64.exe=a417276f00f895659dfa21d0f0e847e056eccf2a457939ccd83424bf99174604
|
package/js/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Releases } from './releases';
|
|
2
|
+
import { SourceMaps } from './sourceMaps';
|
|
2
3
|
import type { SentryCliOptions } from './types';
|
|
3
|
-
export type { SentryCliOptions, SentryCliUploadSourceMapsOptions, SourceMapsPathDescriptor, SentryCliNewDeployOptions, SentryCliCommitsOptions, } from './types';
|
|
4
|
+
export type { SentryCliOptions, SentryCliUploadSourceMapsOptions, SourceMapsPathDescriptor, SentryCliNewDeployOptions, SentryCliCommitsOptions, SentryCliInjectOptions, } from './types';
|
|
4
5
|
/**
|
|
5
6
|
* Interface to and wrapper around the `sentry-cli` executable.
|
|
6
7
|
*
|
|
@@ -20,6 +21,7 @@ export declare class SentryCli {
|
|
|
20
21
|
configFile: string | null;
|
|
21
22
|
options: SentryCliOptions;
|
|
22
23
|
releases: Releases;
|
|
24
|
+
sourceMaps: SourceMaps;
|
|
23
25
|
/**
|
|
24
26
|
* Creates a new `SentryCli` instance.
|
|
25
27
|
*
|
package/js/index.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.SentryCli = void 0;
|
|
|
4
4
|
const pkgInfo = require("../package.json");
|
|
5
5
|
const helper = require("./helper");
|
|
6
6
|
const releases_1 = require("./releases");
|
|
7
|
+
const sourceMaps_1 = require("./sourceMaps");
|
|
7
8
|
/**
|
|
8
9
|
* Interface to and wrapper around the `sentry-cli` executable.
|
|
9
10
|
*
|
|
@@ -40,6 +41,7 @@ class SentryCli {
|
|
|
40
41
|
}
|
|
41
42
|
this.options = options || { silent: false };
|
|
42
43
|
this.releases = new releases_1.Releases(this.options, configFile);
|
|
44
|
+
this.sourceMaps = new sourceMaps_1.SourceMaps(this.options, configFile);
|
|
43
45
|
}
|
|
44
46
|
/**
|
|
45
47
|
* Returns the version of the installed `sentry-cli` binary.
|
package/js/releases/index.js
CHANGED
|
@@ -126,6 +126,7 @@ class Releases {
|
|
|
126
126
|
* @param options Options to configure the source map upload.
|
|
127
127
|
* @returns A promise that resolves when the upload has completed successfully.
|
|
128
128
|
*/
|
|
129
|
+
// TODO: Add `uploadSourceMaps()` to SourceMaps class as `.upload()` (keep it here too for backward compatibility)
|
|
129
130
|
uploadSourceMaps(release, options) {
|
|
130
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
132
|
if (!options || !options.include || !Array.isArray(options.include)) {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { SentryCliInjectOptions, SentryCliOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Manages source map operations on Sentry.
|
|
4
|
+
*/
|
|
5
|
+
export declare class SourceMaps {
|
|
6
|
+
options: SentryCliOptions;
|
|
7
|
+
private configFile;
|
|
8
|
+
constructor(options: SentryCliOptions, configFile: string | null);
|
|
9
|
+
/**
|
|
10
|
+
* Fixes up JavaScript source files and source maps with debug ids.
|
|
11
|
+
*
|
|
12
|
+
* For every minified JS source file, a debug id is generated and
|
|
13
|
+
* inserted into the file. If the source file references a
|
|
14
|
+
* source map and that source map is locally available,
|
|
15
|
+
* the debug id will be injected into it as well.
|
|
16
|
+
* If the referenced source map already contains a debug id,
|
|
17
|
+
* that id is used instead.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* await cli.sourceMaps.inject({
|
|
21
|
+
* // required options:
|
|
22
|
+
* paths: ['./dist'],
|
|
23
|
+
*
|
|
24
|
+
* // default options:
|
|
25
|
+
* ignore: ['node_modules'], // globs for files to ignore
|
|
26
|
+
* ignoreFile: null, // path to a file with ignore rules
|
|
27
|
+
* ext: ['js', 'cjs', 'mjs'], // file extensions to consider
|
|
28
|
+
* dryRun: false, // don't modify files on disk
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* @param options Options to configure the debug id injection.
|
|
32
|
+
* @returns A promise that resolves when the injection has completed successfully.
|
|
33
|
+
*/
|
|
34
|
+
inject(options: SentryCliInjectOptions): Promise<string>;
|
|
35
|
+
/**
|
|
36
|
+
* See {helper.execute} docs.
|
|
37
|
+
* @param args Command line arguments passed to `sentry-cli`.
|
|
38
|
+
* @param live can be set to:
|
|
39
|
+
* - `true` to inherit stdio and reject the promise if the command
|
|
40
|
+
* exits with a non-zero exit code.
|
|
41
|
+
* - `false` to not inherit stdio and return the output as a string.
|
|
42
|
+
* @returns A promise that resolves to the standard output.
|
|
43
|
+
*/
|
|
44
|
+
execute(args: string[], live: boolean): Promise<string>;
|
|
45
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SourceMaps = void 0;
|
|
13
|
+
const inject_1 = require("./options/inject");
|
|
14
|
+
const helper = require("../helper");
|
|
15
|
+
/**
|
|
16
|
+
* Default arguments for the `--ignore` option.
|
|
17
|
+
*/
|
|
18
|
+
const DEFAULT_IGNORE = ['node_modules'];
|
|
19
|
+
/**
|
|
20
|
+
* Manages source map operations on Sentry.
|
|
21
|
+
*/
|
|
22
|
+
class SourceMaps {
|
|
23
|
+
constructor(options = {}, configFile) {
|
|
24
|
+
this.options = options;
|
|
25
|
+
this.configFile = configFile;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Fixes up JavaScript source files and source maps with debug ids.
|
|
29
|
+
*
|
|
30
|
+
* For every minified JS source file, a debug id is generated and
|
|
31
|
+
* inserted into the file. If the source file references a
|
|
32
|
+
* source map and that source map is locally available,
|
|
33
|
+
* the debug id will be injected into it as well.
|
|
34
|
+
* If the referenced source map already contains a debug id,
|
|
35
|
+
* that id is used instead.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await cli.sourceMaps.inject({
|
|
39
|
+
* // required options:
|
|
40
|
+
* paths: ['./dist'],
|
|
41
|
+
*
|
|
42
|
+
* // default options:
|
|
43
|
+
* ignore: ['node_modules'], // globs for files to ignore
|
|
44
|
+
* ignoreFile: null, // path to a file with ignore rules
|
|
45
|
+
* ext: ['js', 'cjs', 'mjs'], // file extensions to consider
|
|
46
|
+
* dryRun: false, // don't modify files on disk
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* @param options Options to configure the debug id injection.
|
|
50
|
+
* @returns A promise that resolves when the injection has completed successfully.
|
|
51
|
+
*/
|
|
52
|
+
inject(options) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
if (!options || !options.paths || !Array.isArray(options.paths)) {
|
|
55
|
+
throw new Error('`options.paths` must be a valid array of paths.');
|
|
56
|
+
}
|
|
57
|
+
if (options.paths.length === 0) {
|
|
58
|
+
throw new Error('`options.paths` must contain at least one path.');
|
|
59
|
+
}
|
|
60
|
+
const newOptions = Object.assign({}, options);
|
|
61
|
+
if (!newOptions.ignoreFile && !newOptions.ignore) {
|
|
62
|
+
newOptions.ignore = DEFAULT_IGNORE;
|
|
63
|
+
}
|
|
64
|
+
const args = helper.prepareCommand(['sourcemaps', 'inject', ...options.paths], inject_1.INJECT_OPTIONS, newOptions);
|
|
65
|
+
return this.execute(args, true);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* See {helper.execute} docs.
|
|
70
|
+
* @param args Command line arguments passed to `sentry-cli`.
|
|
71
|
+
* @param live can be set to:
|
|
72
|
+
* - `true` to inherit stdio and reject the promise if the command
|
|
73
|
+
* exits with a non-zero exit code.
|
|
74
|
+
* - `false` to not inherit stdio and return the output as a string.
|
|
75
|
+
* @returns A promise that resolves to the standard output.
|
|
76
|
+
*/
|
|
77
|
+
execute(args, live) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
return helper.execute(args, live, this.options.silent, this.configFile, this.options);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
exports.SourceMaps = SourceMaps;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema for the `sourcemaps inject` command.
|
|
3
|
+
*/
|
|
4
|
+
export declare const INJECT_OPTIONS: {
|
|
5
|
+
ignore: {
|
|
6
|
+
param: string;
|
|
7
|
+
type: "array";
|
|
8
|
+
};
|
|
9
|
+
ignoreFile: {
|
|
10
|
+
param: string;
|
|
11
|
+
type: "string";
|
|
12
|
+
};
|
|
13
|
+
ext: {
|
|
14
|
+
param: string;
|
|
15
|
+
type: "array";
|
|
16
|
+
};
|
|
17
|
+
dryRun: {
|
|
18
|
+
param: string;
|
|
19
|
+
type: "boolean";
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INJECT_OPTIONS = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Schema for the `sourcemaps inject` command.
|
|
6
|
+
*/
|
|
7
|
+
exports.INJECT_OPTIONS = {
|
|
8
|
+
ignore: {
|
|
9
|
+
param: '--ignore',
|
|
10
|
+
type: 'array',
|
|
11
|
+
},
|
|
12
|
+
ignoreFile: {
|
|
13
|
+
param: '--ignore-file',
|
|
14
|
+
type: 'string',
|
|
15
|
+
},
|
|
16
|
+
ext: {
|
|
17
|
+
param: '--ext',
|
|
18
|
+
type: 'array',
|
|
19
|
+
},
|
|
20
|
+
dryRun: {
|
|
21
|
+
param: '--dry-run',
|
|
22
|
+
type: 'boolean',
|
|
23
|
+
},
|
|
24
|
+
};
|
package/js/types.d.ts
CHANGED
|
@@ -200,3 +200,31 @@ export type SentryCliCommitsOptions = {
|
|
|
200
200
|
*/
|
|
201
201
|
ignoreEmpty?: boolean;
|
|
202
202
|
};
|
|
203
|
+
/**
|
|
204
|
+
* Options for injecting debug IDs into source files and source maps
|
|
205
|
+
*/
|
|
206
|
+
export type SentryCliInjectOptions = {
|
|
207
|
+
/**
|
|
208
|
+
* One or more paths that Sentry CLI should scan recursively for JavaScript source files.
|
|
209
|
+
*/
|
|
210
|
+
paths: string[];
|
|
211
|
+
/**
|
|
212
|
+
* One or more paths to ignore during injection. Overrides entries in ignoreFile file.
|
|
213
|
+
* Defaults to ['node_modules'] if neither ignore nor ignoreFile is specified.
|
|
214
|
+
*/
|
|
215
|
+
ignore?: string[];
|
|
216
|
+
/**
|
|
217
|
+
* Path to a file containing list of files/directories to ignore.
|
|
218
|
+
* Can point to .gitignore or anything with the same format.
|
|
219
|
+
*/
|
|
220
|
+
ignoreFile?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Set the file extensions of JavaScript files that are considered for injection.
|
|
223
|
+
* This overrides the default extensions (js, cjs, mjs).
|
|
224
|
+
*/
|
|
225
|
+
ext?: string[];
|
|
226
|
+
/**
|
|
227
|
+
* Don't modify files on disk.
|
|
228
|
+
*/
|
|
229
|
+
dryRun?: boolean;
|
|
230
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.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,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/node": "^20.10.0",
|
|
25
|
-
"@vercel/nft": "^
|
|
25
|
+
"@vercel/nft": "^1.2.0",
|
|
26
26
|
"eslint": "^7.32.0",
|
|
27
27
|
"eslint-config-prettier": "^8.5.0",
|
|
28
28
|
"jest": "^27.5.1",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"typescript": "5.8.3"
|
|
33
33
|
},
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@sentry/cli-darwin": "3.
|
|
36
|
-
"@sentry/cli-linux-arm": "3.
|
|
37
|
-
"@sentry/cli-linux-arm64": "3.
|
|
38
|
-
"@sentry/cli-linux-i686": "3.
|
|
39
|
-
"@sentry/cli-linux-x64": "3.
|
|
40
|
-
"@sentry/cli-win32-i686": "3.
|
|
41
|
-
"@sentry/cli-win32-x64": "3.
|
|
42
|
-
"@sentry/cli-win32-arm64": "3.
|
|
35
|
+
"@sentry/cli-darwin": "3.2.0",
|
|
36
|
+
"@sentry/cli-linux-arm": "3.2.0",
|
|
37
|
+
"@sentry/cli-linux-arm64": "3.2.0",
|
|
38
|
+
"@sentry/cli-linux-i686": "3.2.0",
|
|
39
|
+
"@sentry/cli-linux-x64": "3.2.0",
|
|
40
|
+
"@sentry/cli-win32-i686": "3.2.0",
|
|
41
|
+
"@sentry/cli-win32-x64": "3.2.0",
|
|
42
|
+
"@sentry/cli-win32-arm64": "3.2.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"postinstall": "node ./scripts/install.js",
|