Socket
Socket
Sign inDemoInstall

@sentry/cli

Package Overview
Dependencies
Maintainers
9
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/cli - npm Package Compare versions

Comparing version 1.26.1 to 1.27.0

7

CHANGELOG.md
# Changelog
## sentry-cli 1.27.0
* Support all options in the JS binding for `upload-sourcemaps`, courtesy of @montogeek
* Enable automatic IP addresses when sending events with `send-event`, courtesy of @kirkins
* No longer require secret keys to send events with `send-event`
* Improve and speed up debug symbol handling in `upload-dsym`
## sentry-cli 1.26.1

@@ -4,0 +11,0 @@

105

js/index.js

@@ -11,2 +11,40 @@ 'use strict';

var DEFAULT_IGNORE = ['node_modules'];
var SOURCEMAPS_OPTIONS = {
ignore: {
param: '--ignore',
type: 'array'
},
ignoreFile: {
param: '--ignore-file',
type: 'string'
},
rewrite: {
param: '--rewrite',
type: 'boolean'
},
sourceMapReference: {
param: '--no-sourcemap-reference',
type: 'inverted-boolean'
},
stripPrefix: {
param: '--strip-prefix',
type: 'array'
},
stripCommonPrefix: {
param: '--strip-common-prefix',
type: 'array'
},
validate: {
param: '--validate',
type: 'boolean'
},
urlPrefix: {
param: '--url-prefix',
type: 'string'
},
ext: {
param: '--ext',
type: 'string'
}
};

@@ -18,7 +56,7 @@ var binaryPath =

function transformIgnore(ignore) {
if (Array.isArray(ignore)) {
return ignore
function transformOption(option, values) {
if (Array.isArray(values)) {
return values
.map(function(value) {
return ['--ignore', value];
return [option.param, value];
})

@@ -29,5 +67,37 @@ .reduce(function(acc, value) {

}
return ['--ignore', ignore];
return [option.param, values];
}
function normalizeOptions(options) {
return Object.keys(SOURCEMAPS_OPTIONS).reduce(function(newOptions, sourceMapOption) {
var paramValue = options[sourceMapOption];
if (paramValue === undefined) {
return newOptions;
}
var paramType = SOURCEMAPS_OPTIONS[sourceMapOption].type;
var paramName = SOURCEMAPS_OPTIONS[sourceMapOption].param;
if (paramType === 'array') {
if (!Array.isArray(paramValue)) {
throw new Error(sourceMapOption + ' should be an array');
}
return newOptions.concat(
transformOption(SOURCEMAPS_OPTIONS[sourceMapOption], paramValue)
);
} else if (paramType === 'boolean' || paramType === 'inverted-boolean') {
if (typeof paramValue !== 'boolean') {
throw new Error(sourceMapOption + ' should be a bool');
}
if (paramType === 'boolean' && paramValue) {
return newOptions.concat([paramName]);
} else if (paramType === 'inverted-boolean' && paramValue === false) {
return newOptions.concat([paramName]);
}
return newOptions;
}
return newOptions.concat(paramName, paramValue);
}, []);
}
function SentryCli(configFile) {

@@ -70,21 +140,18 @@ this.env = {};

'upload-sourcemaps',
sourcemapPath,
'--rewrite'
sourcemapPath
];
if (options.ignoreFile) {
command = command.concat(['--ignore-file', options.ignoreFile]);
}
return this.execute(this.prepareCommand(command, options));
}, this)
);
};
if (options.ignore) {
command = command.concat(transformIgnore(options.ignore));
}
SentryCli.prototype.prepareCommand = function(command, options) {
var newOptions = options || {};
if (!options.ignoreFile && !options.ignore) {
command = command.concat(transformIgnore(DEFAULT_IGNORE));
}
if (!newOptions.ignoreFile && !newOptions.ignore) {
newOptions.ignore = DEFAULT_IGNORE;
}
return this.execute(command);
}, this)
);
return command.concat(normalizeOptions(newOptions));
};

@@ -91,0 +158,0 @@

2

package.json
{
"name": "@sentry/cli",
"version": "1.26.1",
"version": "1.27.0",
"description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/",

@@ -5,0 +5,0 @@ "scripts": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc