@sentry/webpack-plugin
Advanced tools
Comparing version 1.9.2 to 1.9.3
# Changelog | ||
## v1.9.3 | ||
- chore: Bump sentry-cli to `1.49.0` | ||
- fix: Dont fail compilation if there is no release available (#155) | ||
- fix: Update auto/repo logic for `setCommit` option (#156) | ||
## v1.9.2 | ||
@@ -4,0 +10,0 @@ |
@@ -11,3 +11,3 @@ { | ||
"author": "Sentry", | ||
"version": "1.9.2", | ||
"version": "1.9.3", | ||
"license": "MIT", | ||
@@ -22,3 +22,3 @@ "repository": "git@github.com:getsentry/sentry-webpack-plugin.git", | ||
"dependencies": { | ||
"@sentry/cli": "^1.48.0" | ||
"@sentry/cli": "^1.49.0" | ||
}, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
@@ -81,3 +81,3 @@ <p align="center"> | ||
| silent | `boolean` | optional | if `true`, all logs are suppressed (useful for `--json` option) | | ||
| errorHandler | `function(err: Error, invokeErr: function(): void): void` | optional | when Cli error occurs, plugin calls this function. webpack compilation failure can be chosen by calling `invokeErr` callback or not. default `(err, invokeErr) => { invokeErr()}` | | ||
| errorHandler | `function(err: Error, invokeErr: function(): void, compilation: Compilation): void` | optional | when Cli error occurs, plugin calls this function. webpack compilation failure can be chosen by calling `invokeErr` callback or not. If you don't want this plugin to prevent further compilation, you can use a compilation warning instead by setting this option to `(err, invokeErr, compilation) => { compilation.warnings.push('Sentry CLI Plugin: ' + err.message) }` instead. defaults to `(err, invokeErr) => { invokeErr() }` | | ||
| setCommits | `Object` | optional | Adds commits to sentry - [see own table below](#setCommits) for more details | | ||
@@ -84,0 +84,0 @@ |
@@ -72,7 +72,2 @@ const SentryCli = require('@sentry/cli'); | ||
/** Convenience function to add a webpack compilation error. */ | ||
function addCompilationError(compilation, message) { | ||
compilation.errors.push(`Sentry CLI Plugin: ${message}`); | ||
} | ||
class SentryCliPlugin { | ||
@@ -118,2 +113,3 @@ constructor(options = {}) { | ||
/** Returns whether this plugin should emit any data to stdout. */ | ||
isSilent() { | ||
@@ -170,4 +166,5 @@ return this.options.silent === true; | ||
* | ||
* If no release is specified, it uses Sentry CLI to propose a version. The | ||
* release string is always trimmed. | ||
* If no release is specified, it uses Sentry CLI to propose a version. | ||
* The release string is always trimmed. | ||
* Returns undefined if proposeVersion failed. | ||
*/ | ||
@@ -178,3 +175,5 @@ getReleasePromise() { | ||
: this.cli.releases.proposeVersion() | ||
).then(version => `${version}`.trim()); | ||
) | ||
.then(version => `${version}`.trim()) | ||
.catch(() => undefined); | ||
} | ||
@@ -311,3 +310,3 @@ | ||
include, | ||
errorHandler = (err, invokeErr) => { | ||
errorHandler = (_, invokeErr) => { | ||
invokeErr(); | ||
@@ -317,7 +316,2 @@ }, | ||
if (!include) { | ||
addCompilationError(compilation, '`include` option is required'); | ||
return Promise.resolve(); | ||
} | ||
let release; | ||
@@ -327,2 +321,13 @@ return this.release | ||
release = proposedVersion; | ||
if (!include) { | ||
throw new Error(`\`include\` option is required`); | ||
} | ||
if (!release) { | ||
throw new Error( | ||
`Unabled to determine version. Make sure to include \`release\` option or use the environment that supports auto-detection https://docs.sentry.io/cli/releases/#creating-releases` | ||
); | ||
} | ||
return this.cli.releases.new(release); | ||
@@ -335,3 +340,3 @@ }) | ||
if (repo && (commit || auto)) { | ||
if (auto || (repo && commit)) { | ||
this.cli.releases.setCommits(release, { | ||
@@ -347,3 +352,7 @@ commit, | ||
.catch(err => | ||
errorHandler(err, () => addCompilationError(compilation, err.message)) | ||
errorHandler( | ||
err, | ||
() => compilation.errors.push(`Sentry CLI Plugin: ${err.message}`), | ||
compilation | ||
) | ||
); | ||
@@ -350,0 +359,0 @@ } |
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
40305
879
Updated@sentry/cli@^1.49.0