Socket
Socket
Sign inDemoInstall

@sentry/webpack-plugin

Package Overview
Dependencies
2
Maintainers
12
Versions
91
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.9.0 to 1.9.1

5

CHANGELOG.md
# Changelog
## v1.9.1
- ref: Allow for nested setCommits (#142)
- fix: Fixed TS definitions export error (#145)
## v1.9.0

@@ -4,0 +9,0 @@

2

index.d.ts

@@ -117,2 +117,2 @@ import { Plugin, Compiler } from 'webpack';

export = SentryCliPlugin;
export default SentryCliPlugin;

@@ -11,3 +11,3 @@ {

"author": "Sentry",
"version": "1.9.0",
"version": "1.9.1",
"license": "MIT",

@@ -14,0 +14,0 @@ "repository": "git@github.com:getsentry/sentry-webpack-plugin.git",

@@ -62,59 +62,35 @@ <p align="center">

* `release [optional]` - unique name of a release, must be a `string`, should
uniquely identify your release, defaults to
`sentry-cli releases propose-version` command which should always return the
correct version (**requires access to `git` CLI and root directory to be a valid
repository**).
* `include [required]` - `string` or `array`, one or more paths that Sentry CLI
should scan recursively for sources. It will upload all `.map` files and match
associated `.js` files
* `entries [optional]` - `array` or `RegExp` or `function(key: string): bool`, a
filter for entry points that should be processed. By default, the release will
be injected into all entry points.
* `ignoreFile [optional]` - `string`, path to a file containing list of
files/directories to ignore. Can point to `.gitignore` or anything with same
format
* `ignore [optional]` - `string` or `array`, one or more paths to ignore during
upload. Overrides entries in `ignoreFile` file. If neither `ignoreFile` or
`ignore` are present, defaults to `['node_modules']`
* `configFile [optional]` - `string`, path to Sentry CLI config properties, as
described in https://docs.sentry.io/learn/cli/configuration/#properties-files.
By default, the config file is looked for upwards from the current path and
defaults from `~/.sentryclirc` are always loaded
* `ext [optional]` - `array`, this sets the file extensions to be
considered. By default the following file extensions are processed: js, map,
jsbundle and bundle.
* `urlPrefix [optional]` - `string`, this sets an URL prefix at the beginning
of all files. This defaults to `~/` but you might want to set this to the
full URL. This is also useful if your files are stored in a sub folder. eg:
`url-prefix '~/static/js'`
* `urlSuffix [optional]` - `string`, this sets an URL suffix at the end of all
files. Useful for appending query parameters.
* `validate [optional]` - `boolean`, this attempts sourcemap validation before
upload when rewriting is not enabled. It will spot a variety of issues with
source maps and cancel the upload if any are found. This is not the default as
this can cause false positives.
* `stripPrefix [optional]` - `array`, when paired with `rewrite` this will
chop-off a prefix from uploaded files. For instance you can use this to remove
a path that is build machine specific.
* `stripCommonPrefix [optional]` - `boolean`, when paired with `rewrite` this
will add `~` to the `stripPrefix` array.
* `sourceMapReference [optional]` - `boolean`, this prevents the automatic
detection of sourcemap references.
* `rewrite [optional]` - `boolean`, enables rewriting of matching sourcemaps so
that indexed maps are flattened and missing sources are inlined if possible.,
defaults to `true`
* `dryRun [optional]` - `boolean`, attempts a dry run (useful for dev
environments)
* `debug [optional]` - `boolean`, print some useful debug information
* `silent [optional]` - `boolean`, if `true`, all logs are suppressed (useful for `--json` option)
* `errorHandler [optional]` - `function(err: Error, invokeErr: function(): void): void`, when Cli error occurs, plugin calls this function. webpack compilation failure can be chosen by calling `invokeErr` callback or not. default `(err, invokeErr) => { invokeErr() }`
| Option | Type | Required | Description |
---------|------|----------|-------------
release | `string` | optional | unique name of a release, must be a `string`, should uniquely identify your release, defaults to `sentry-cli releases propose-version` command which should always return the correct version (**requires access to `git` CLI and root directory to be a valid repository**).
include | `string`/`array` | required | one or more paths that Sentry CLI should scan recursively for sources. It will upload all `.map` files and match associated `.js` files |
entries | `array`/`RegExp`/`function(key: string): bool` | optional | a filter for entry points that should be processed. By default, the release will be injected into all entry points. |
| ignoreFile | `string` | optional | path to a file containing list of files/directories to ignore. Can point to `.gitignore` or anything with same format |
| ignore | `string`/`array` | optional | one or more paths to ignore during upload. Overrides entries in `ignoreFile` file. If neither `ignoreFile` or `ignore` are present, defaults to `['node_modules']` |
| configFile | `string` | optional | path to Sentry CLI config properties, as described in https://docs.sentry.io/learn/cli/configuration/#properties-files. By default, the config file is looked for upwards from the current path and defaults from `~/.sentryclirc` are always loaded |
| ext | `array` | optional | this sets the file extensions to be considered. By default the following file extensions are processed: js, map, jsbundle and bundle. |
| urlPrefix | `string` | optional | this sets an URL prefix at the beginning of all files. This defaults to `~/` but you might want to set this to the full URL. This is also useful if your files are stored in a sub folder. eg: `url-prefix '~/static/js'` |
| urlSuffix | `string` | optional | this sets an URL suffix at the end of all files. Useful for appending query parameters. |
| validate | `boolean` | optional | this attempts sourcemap validation before upload when rewriting is not enabled. It will spot a variety of issues with source maps and cancel the upload if any are found. This is not the default as this can cause false positives. |
| stripPrefix | `array` | optional | when paired with `rewrite` this will chop-off a prefix from uploaded files. For instance you can use this to remove a path that is build machine specific. |
| stripCommonPrefix | `boolean` | optional | when paired with `rewrite` this will add `~` to the `stripPrefix` array. |
| sourceMapReference | `boolean` | optional | this prevents the automatic detection of sourcemap references. |
| rewrite | `boolean` | optional | enables rewriting of matching sourcemaps so that indexed maps are flattened and missing sources are inlined if possible. defaults to `true` |
| dryRun | `boolean` | optional | attempts a dry run (useful for dev environments) |
| debug | `boolean` | optional | print some useful debug information |
| 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()}` |
| setCommits | `Object` | optional | Adds commits to sentry - [see own table below](#setCommits) for more details |
set-commits options:
* `commit [optional]` - `string`, the current (last) commit in the release
* `previousCommit [optional]` - `string`, the commit before the beginning of this release (in other words, the last commit of the previous release). If omitted, this will default to the last commit of the previous release in Sentry. If there was no previous release, the last 10 commits will be used
* `repo [optional]` - `string`, the full repo name as defined in Sentry
* `auto [optional]` - `boolean`, automatically choose the associated commit (uses the current commit). Overrides other options
#### <a name="setCommits"></a>options.setCommits:
| Option | Type | Required | Description |
---------|------|----------|-------------
| repo | `string` | required | the full git repo name as defined in Sentry |
| commit | `string` | optional/required | the current (last) commit in the release |
| previousCommit | `string` | optional | the commit before the beginning of this release (in other words, the last commit of the previous release). If omitted, this will default to the last commit of the previous release in Sentry. If there was no previous release, the last 10 commits will be used |
| auto | `boolean` | optional/required | automatically choose the associated commit (uses the current commit). Overrides other options |
You can find more information about these options in our official docs:
https://docs.sentry.io/cli/releases/#sentry-cli-sourcemaps

@@ -231,3 +231,3 @@ /*eslint-disable*/

test('test setCommits with commits range', done => {
test('test setCommits with flat options', done => {
const sentryCliPlugin = new SentryCliPlugin({

@@ -239,3 +239,3 @@ include: 'src',

repo: 'group / repo',
// auto,
auto: false,
});

@@ -250,2 +250,3 @@

previousCommit: 'b6b0e11e74fd55836d3299cef88531b2a34c2514',
auto: false,
});

@@ -257,8 +258,12 @@ expect(compilationDoneCallback).toBeCalled();

test('test setCommits with auto option', done => {
test('test setCommits with grouped options', done => {
const sentryCliPlugin = new SentryCliPlugin({
include: 'src',
release: '42',
repo: 'group / repo',
auto: true,
setCommits: {
commit: '4d8656426ca13eab19581499da93408e30fdd9ef',
previousCommit: 'b6b0e11e74fd55836d3299cef88531b2a34c2514',
repo: 'group / repo',
auto: false,
},
});

@@ -271,3 +276,5 @@

repo: 'group / repo',
auto: true,
commit: '4d8656426ca13eab19581499da93408e30fdd9ef',
previousCommit: 'b6b0e11e74fd55836d3299cef88531b2a34c2514',
auto: false,
});

@@ -274,0 +281,0 @@ expect(compilationDoneCallback).toBeCalled();

@@ -325,3 +325,4 @@ const SentryCli = require('@sentry/cli');

.then(() => {
const { commit, previousCommit, repo, auto } = this.options;
const { commit, previousCommit, repo, auto } =
this.options.setCommits || this.options;

@@ -328,0 +329,0 @@ if (repo && (commit || auto)) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc