bugsnag-sourcemaps
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -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 @@ |
@@ -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", |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33291
708
2