@sentry/webpack-plugin
Advanced tools
Comparing version 1.6.2 to 1.7.0
# Changelog | ||
## v1.7.0 | ||
* feat: Add silent option to disable all output to stdout (#127) | ||
## v1.6.2 | ||
@@ -4,0 +8,0 @@ |
@@ -11,3 +11,3 @@ { | ||
"author": "Sentry", | ||
"version": "1.6.2", | ||
"version": "1.7.0", | ||
"license": "MIT", | ||
@@ -21,13 +21,13 @@ "repository": "git@github.com:getsentry/sentry-webpack-plugin.git", | ||
"dependencies": { | ||
"@sentry/cli": "^1.35.5" | ||
"@sentry/cli": "^1.44.4" | ||
}, | ||
"devDependencies": { | ||
"codecov": "^3.0.0", | ||
"eslint": "^4.19.1", | ||
"eslint-config-airbnb-base": "^12.1.0", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-import": "^2.10.0", | ||
"jest": "^22.4.3", | ||
"npm-run-all": "^4.1.2", | ||
"prettier": "^1.11.1", | ||
"codecov": "^3.5.0", | ||
"eslint": "^5.16.0", | ||
"eslint-config-airbnb-base": "^13.1.0", | ||
"eslint-config-prettier": "^4.3.0", | ||
"eslint-plugin-import": "^2.17.3", | ||
"jest": "^24.8.0", | ||
"npm-run-all": "^4.1.5", | ||
"prettier": "^1.18.2", | ||
"prettier-check": "^2.0.0" | ||
@@ -34,0 +34,0 @@ }, |
@@ -109,4 +109,5 @@ <p align="center"> | ||
* `debug [optional]` - `boolean`, print some useful debug information | ||
* `silent [optional]` - `boolean`, if `true`, all logs are suppressed (useful for `--json` option) | ||
You can find more information about these options in our official docs: | ||
https://docs.sentry.io/learn/cli/releases/#upload-source-maps | ||
https://docs.sentry.io/cli/releases/#sentry-cli-sourcemaps |
@@ -15,3 +15,3 @@ /*eslint-disable*/ | ||
const SentryCliMock = jest.fn(configFile => mockCli); | ||
const SentryCliMock = jest.fn((configFile, options) => mockCli); | ||
const SentryCli = jest.mock('@sentry/cli', () => SentryCliMock); | ||
@@ -97,3 +97,5 @@ const SentryCliPlugin = require('..'); | ||
expect(SentryCliMock).toHaveBeenCalledWith('some/sentry.properties'); | ||
expect(SentryCliMock).toHaveBeenCalledWith('some/sentry.properties', { | ||
silent: false, | ||
}); | ||
}); | ||
@@ -100,0 +102,0 @@ |
@@ -77,25 +77,2 @@ const SentryCli = require('@sentry/cli'); | ||
/** | ||
* Pretty-prints debug information | ||
* | ||
* @param {string} label Label to be printed as a prefix for the data | ||
* @param {any} data Input to be pretty-printed | ||
*/ | ||
function outputDebug(label, data) { | ||
if (data !== undefined) { | ||
// eslint-disable-next-line no-console | ||
console.log( | ||
`[Sentry Webpack Plugin] ${label} ${util.inspect( | ||
data, | ||
false, | ||
null, | ||
true | ||
)}` | ||
); | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.log(`[Sentry Webpack Plugin] ${label}`); | ||
} | ||
} | ||
class SentryCliPlugin { | ||
@@ -115,2 +92,32 @@ constructor(options = {}) { | ||
/** | ||
* Pretty-prints debug information | ||
* | ||
* @param {string} label Label to be printed as a prefix for the data | ||
* @param {any} data Input to be pretty-printed | ||
*/ | ||
outputDebug(label, data) { | ||
if (this.isSilent()) { | ||
return; | ||
} | ||
if (data !== undefined) { | ||
// eslint-disable-next-line no-console | ||
console.log( | ||
`[Sentry Webpack Plugin] ${label} ${util.inspect( | ||
data, | ||
false, | ||
null, | ||
true | ||
)}` | ||
); | ||
} else { | ||
// eslint-disable-next-line no-console | ||
console.log(`[Sentry Webpack Plugin] ${label}`); | ||
} | ||
} | ||
isSilent() { | ||
return this.options.silent === true; | ||
} | ||
/** Returns whether this plugin is in dryRun mode. */ | ||
@@ -123,6 +130,8 @@ isDryRun() { | ||
getSentryCli() { | ||
const cli = new SentryCli(this.options.configFile); | ||
const cli = new SentryCli(this.options.configFile, { | ||
silent: this.isSilent(), | ||
}); | ||
if (this.isDryRun()) { | ||
outputDebug('DRY Run Mode'); | ||
this.outputDebug('DRY Run Mode'); | ||
@@ -133,15 +142,15 @@ return { | ||
cli.releases.proposeVersion().then(version => { | ||
outputDebug('Proposed version:\n', version); | ||
this.outputDebug('Proposed version:\n', version); | ||
return version; | ||
}), | ||
new: release => { | ||
outputDebug('Creating new release:\n', release); | ||
this.outputDebug('Creating new release:\n', release); | ||
return Promise.resolve(release); | ||
}, | ||
uploadSourceMaps: (release, config) => { | ||
outputDebug('Calling upload-sourcemaps with:\n', config); | ||
this.outputDebug('Calling upload-sourcemaps with:\n', config); | ||
return Promise.resolve(release, config); | ||
}, | ||
finalize: release => { | ||
outputDebug('Finalizing release:\n', release); | ||
this.outputDebug('Finalizing release:\n', release); | ||
return Promise.resolve(release); | ||
@@ -285,9 +294,9 @@ }, | ||
outputDebug('DEBUG: Injecting release code'); | ||
outputDebug('DEBUG: Loaders:\n', output.loaders); | ||
outputDebug('DEBUG: Added loaders:\n', loaders.added); | ||
outputDebug('DEBUG: Removed loaders:\n', loaders.removed); | ||
outputDebug('DEBUG: Entry:\n', output.entry); | ||
outputDebug('DEBUG: Added entry:\n', entry.added); | ||
outputDebug('DEBUG: Removed entry:\n', entry.removed); | ||
this.outputDebug('DEBUG: Injecting release code'); | ||
this.outputDebug('DEBUG: Loaders:\n', output.loaders); | ||
this.outputDebug('DEBUG: Added loaders:\n', loaders.added); | ||
this.outputDebug('DEBUG: Removed loaders:\n', loaders.removed); | ||
this.outputDebug('DEBUG: Entry:\n', output.entry); | ||
this.outputDebug('DEBUG: Added entry:\n', entry.added); | ||
this.outputDebug('DEBUG: Removed entry:\n', entry.removed); | ||
} | ||
@@ -294,0 +303,0 @@ |
686
113
31378
14
Updated@sentry/cli@^1.44.4