@sentry/cli
Advanced tools
Comparing version 1.36.4 to 1.37.0
# Changelog | ||
## sentry-cli 1.37.0 | ||
* Support React Native >= 0.46 (@stephan-nordnes-eriksen, #377) | ||
* Cache binaries to speed up NPM package installation (@timfish, #425) | ||
* Check for successful upload of debug files (#429) | ||
* Limit debug file uploads to 2GB (maximum allowed by Sentry) (#432) | ||
## sentry-cli 1.36.4 | ||
@@ -4,0 +11,0 @@ |
{ | ||
"name": "@sentry/cli", | ||
"version": "1.36.4", | ||
"version": "1.37.0", | ||
"description": "A command line utility to work with Sentry. https://docs.sentry.io/hosted/learn/cli/", | ||
"scripts": { | ||
"install": "node scripts/install.js", | ||
"fix:eslint": "eslint --fix 'bin/*' js", | ||
"fix:prettier": "prettier --write 'bin/*' 'scripts/*.js' 'js/**/*.js'", | ||
"fix:eslint": "eslint --fix \"bin/*\" js", | ||
"fix:prettier": "prettier --write \"bin/*\" \"scripts/*.js\" \"js/**/*.js\"", | ||
"fix": "npm-run-all fix:eslint fix:prettier", | ||
"test:jest": "jest", | ||
"test:eslint": "eslint bin scripts js", | ||
"test:prettier": "prettier-check 'bin/*' 'scripts/*.js' 'js/**/*.js'", | ||
"test:prettier": "prettier-check \"bin/*\" \"scripts/*.js\" \"js/**/*.js\"", | ||
"test": "npm-run-all test:jest test:eslint test:prettier", | ||
@@ -33,3 +33,5 @@ "test:watch": "jest --watch --notify" | ||
"dependencies": { | ||
"fs-copy-file-sync": "^1.1.1", | ||
"https-proxy-agent": "^2.2.1", | ||
"mkdirp": "^0.5.1", | ||
"node-fetch": "^2.1.2", | ||
@@ -36,0 +38,0 @@ "progress": "2.0.0", |
@@ -9,2 +9,3 @@ #!/usr/bin/env node | ||
const path = require('path'); | ||
const crypto = require('crypto'); | ||
@@ -15,2 +16,4 @@ const HttpsProxyAgent = require('https-proxy-agent'); | ||
const Proxy = require('proxy-from-env'); | ||
const copyFileSync = require('fs-copy-file-sync'); | ||
const mkdirp = require('mkdirp'); | ||
@@ -70,2 +73,31 @@ const helper = require('../js/helper'); | ||
function npmCache() { | ||
const env = process.env; | ||
return ( | ||
env.npm_config_cache || | ||
env.npm_config_yarn_offline_mirror || | ||
(env.APPDATA ? path.join(env.APPDATA, 'npm-cache') : path.join(os.homedir(), '.npm')) | ||
); | ||
} | ||
function getCachedPath(url) { | ||
const digest = crypto | ||
.createHash('md5') | ||
.update(url) | ||
.digest('hex') | ||
.slice(0, 6); | ||
return path.join( | ||
npmCache(), | ||
'sentry-cli', | ||
`${digest}-${path.basename(url).replace(/[^a-zA-Z0-9.]+/g, '-')}` | ||
); | ||
} | ||
function getTempFile(cached) { | ||
return `${cached}.${process.pid}-${Math.random() | ||
.toString(16) | ||
.slice(2)}.tmp`; | ||
} | ||
function downloadBinary() { | ||
@@ -88,2 +120,8 @@ const arch = os.arch(); | ||
const cachedPath = getCachedPath(downloadUrl); | ||
if (fs.existsSync(cachedPath)) { | ||
copyFileSync(cachedPath, outputPath); | ||
return Promise.resolve(); | ||
} | ||
const proxyUrl = Proxy.getProxyForUrl(downloadUrl); | ||
@@ -106,2 +144,5 @@ const agent = proxyUrl ? new HttpsProxyAgent(proxyUrl) : null; | ||
const tempPath = getTempFile(cachedPath); | ||
mkdirp.sync(path.dirname(tempPath)); | ||
return new Promise((resolve, reject) => { | ||
@@ -111,5 +152,9 @@ response.body | ||
.on('data', chunk => progressBar.tick(chunk.length)) | ||
.pipe(fs.createWriteStream(outputPath, { mode: '0755' })) | ||
.pipe(fs.createWriteStream(tempPath, { mode: '0755' })) | ||
.on('error', e => reject(e)) | ||
.on('close', () => resolve()); | ||
}).then(() => { | ||
copyFileSync(tempPath, cachedPath); | ||
copyFileSync(tempPath, outputPath); | ||
fs.unlinkSync(tempPath); | ||
}); | ||
@@ -116,0 +161,0 @@ }); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
44607
510
6
11
+ Addedfs-copy-file-sync@^1.1.1
+ Addedmkdirp@^0.5.1
+ Addedfs-copy-file-sync@1.1.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)