Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@sentry/cli

Package Overview
Dependencies
Maintainers
9
Versions
231
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.27.1 to 1.28.1

js/helper.js

9

CHANGELOG.md
# Changelog
## sentry-cli 1.28.1
* Expose getPath() to not break setups
## sentry-cli 1.28.0
* Change JS bindings to be conform with the cli interface
Please note that this is a breaking change if you used the JS interface before.
## sentry-cli 1.27.1

@@ -4,0 +13,0 @@

151

js/index.js
'use strict';
/* global Promise */
var childProcess = require('child_process');
var os = require('os');
var path = require('path');
var pkgInfo = require('../package.json');
var helper = require('./helper');
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'
}
};
var binaryPath =
os.platform() === 'win32'
? path.resolve(__dirname, '..\\bin\\sentry-cli.exe')
: path.resolve(__dirname, '../sentry-cli');
function transformOption(option, values) {
if (Array.isArray(values)) {
return values
.map(function(value) {
return [option.param, value];
})
.reduce(function(acc, value) {
return acc.concat(value);
}, []);
}
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) {
this.env = {};
if (typeof configFile === 'string') this.env.SENTRY_PROPERTIES = configFile;
if (typeof configFile === 'string') process.env.SENTRY_PROPERTIES = configFile;
}
SentryCli.prototype.execute = function(args) {
var env = Object.assign({}, process.env, this.env);
return new Promise(function(resolve, reject) {
childProcess.execFile(SentryCli.getPath(), args, { env: env }, function(err, stdout) {
if (err) return reject(err);
// eslint-disable-next-line
console.log(stdout);
return resolve();
});
});
};
SentryCli.prototype.getConfigStatus = function() {
return this.execute(['info', '--config-status-json']);
return helper.execute(['info', '--config-status-json']);
};
SentryCli.prototype.createRelease = function(release) {
return this.execute(['releases', 'new', release]);
};
SentryCli.prototype.finalizeRelease = function(release) {
return this.execute(['releases', 'finalize', release]);
};
SentryCli.prototype.uploadSourceMaps = function(options) {
return Promise.all(
options.include.map(function(sourcemapPath) {
var command = [
'releases',
'files',
options.release,
'upload-sourcemaps',
sourcemapPath
];
return this.execute(this.prepareCommand(command, options));
}, this)
);
};
SentryCli.prototype.prepareCommand = function(command, options) {
var newOptions = options || {};
if (!newOptions.ignoreFile && !newOptions.ignore) {
newOptions.ignore = DEFAULT_IGNORE;
}
return command.concat(normalizeOptions(newOptions));
};
SentryCli.getVersion = function() {

@@ -160,5 +19,7 @@ return pkgInfo.version;

SentryCli.getPath = function() {
return binaryPath;
return helper.getPath();
};
SentryCli.prototype.releases = require('./releases');
module.exports = SentryCli;
{
"name": "@sentry/cli",
"version": "1.27.1",
"version": "1.28.1",
"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