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

bugsnag-sourcemaps

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bugsnag-sourcemaps - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

6

CHANGELOG.md

@@ -0,1 +1,7 @@

# 1.2.1 (2019-05-23)
## Bug fixes
* Fix a bug with `--upload-sources`, and ensure it works in conjunction with directory mode [#43](https://github.com/bugsnag/bugsnag-sourcemaps/pull/43)
# 1.2.0 (2019-05-22)

@@ -2,0 +8,0 @@

4

cli.js

@@ -103,4 +103,6 @@ #!/usr/bin/env node

upload(conf, logger).catch(err => {
logger.error(`Error uploading source maps: ${err.message}`)
const stack = (err && err.stack) ? err.stack : err
const apiResponse = (err && err.errors) ? `\n\n API response:\n ${err.errors.join(', ')}\n` : ''
logger.error(`Error uploading source maps: ${stack}${apiResponse}`)
process.exitCode = 1
})

@@ -96,3 +96,3 @@ 'use strict'

return cb => {
const opts = Object.assign({}, options, { sourceMap: f, minifiedUrl: minifiedUrl, minifiedFile: minifiedFile })
const opts = Object.assign({}, options, { sourceMap: f, minifiedUrl: minifiedUrl, minifiedFile: minifiedFile, sources: {} })
uploadOne(opts, logger)

@@ -99,0 +99,0 @@ .then(() => {

@@ -106,6 +106,4 @@ 'use strict'

mapSources(sourceMap, p => {
// resolve a relative path in the sources array if it begins with a ".." e.g. "../../src/index.js"
const resolvedPath = /^\.\./.test(p)
? path.resolve(path.dirname(options.sourceMap), p)
: p
// resolve a relative path in the sources array
const resolvedPath = path.resolve(path.dirname(options.sourceMap), p)

@@ -115,10 +113,10 @@ // then make it relative to the project root

return doesFileExist(p).then(exists => {
return doesFileExist(resolvedPath).then(exists => {
if (exists && options.uploadSources) {
if (p.indexOf('node_modules') !== -1) {
if (resolvedPath.indexOf('node_modules') !== -1) {
if (options.uploadNodeModules) {
options.sources[relativePath] = p
options.sources[relativePath] = resolvedPath
}
} else {
options.sources[relativePath] = p
options.sources[relativePath] = resolvedPath
}

@@ -125,0 +123,0 @@ }

@@ -76,7 +76,7 @@ 'use strict'

*
* @param {string|Buffer} path The path of the file, or the file Buffer
* @param {string|Buffer} pathOrBuffer The path of the file, or the file Buffer
* @returns {fs.ReadStream|Buffer}
*/
function getSendableSource (pathOrBuffer) {
if (typeof path === 'string') {
if (typeof pathOrBuffer === 'string') {
return createReadStream(pathOrBuffer)

@@ -83,0 +83,0 @@ } else if (Buffer.isBuffer(pathOrBuffer)) {

@@ -54,2 +54,3 @@ 'use strict'

const e = new Error(`HTTP status ${res.statusCode} received from upload API`)
e.errors = [ body.toString() ]
e.isRetryable = false

@@ -56,0 +57,0 @@ return onError(e)

{
"name": "bugsnag-sourcemaps",
"version": "1.2.0",
"version": "1.2.1",
"keywords": [

@@ -5,0 +5,0 @@ "bugsnag",

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