@sentry/webpack-plugin 1.20.1 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -4
- package/README.md +40 -40
- package/index.d.ts +2 -1
- package/package.json +2 -2
- package/src/index.js +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
- "Would I rather be feared or loved? Easy. Both. I want people to be afraid of
|
|
3
|
+
- "Would I rather be feared or loved? Easy. Both. I want people to be afraid of
|
|
4
|
+
how much they love me." — Michael Scott
|
|
5
|
+
|
|
6
|
+
## 1.21.0
|
|
7
|
+
|
|
8
|
+
- feat: Add function to download CLI binary (#456)
|
|
4
9
|
|
|
5
10
|
## 1.20.1
|
|
6
11
|
|
|
@@ -25,8 +30,10 @@
|
|
|
25
30
|
|
|
26
31
|
## 1.18.9
|
|
27
32
|
|
|
28
|
-
- ref: Update sentry-cli to latest v1 version and refresh GH actions (#368) by
|
|
29
|
-
|
|
33
|
+
- ref: Update sentry-cli to latest v1 version and refresh GH actions (#368) by
|
|
34
|
+
@kamilogorek
|
|
35
|
+
- docs: Update dryRun documentation to reflect auto-configuration. (#366) by
|
|
36
|
+
@fiveable-jferg
|
|
30
37
|
|
|
31
38
|
## 1.18.8
|
|
32
39
|
|
|
@@ -34,7 +41,8 @@
|
|
|
34
41
|
|
|
35
42
|
## 1.18.7
|
|
36
43
|
|
|
37
|
-
- deps: Remove webpack from peerDep and move info about ver to readme (#354) by
|
|
44
|
+
- deps: Remove webpack from peerDep and move info about ver to readme (#354) by
|
|
45
|
+
@kamilogorek
|
|
38
46
|
- misc: Correct 1.18.6 changelog (#353) by @kamilogorek
|
|
39
47
|
|
|
40
48
|
## 1.18.6
|
package/README.md
CHANGED
|
@@ -4,23 +4,23 @@
|
|
|
4
4
|
</a>
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Moved!
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
> ⚠️ Notice: The repository for the `@sentry/webpack-plugin` package moved to
|
|
10
|
+
> https://github.com/getsentry/sentry-javascript-bundler-plugins.
|
|
11
|
+
>
|
|
12
|
+
> Please open any issues and PRs over there, as this repository is no longer
|
|
13
|
+
> maintained!
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
[](https://david-dm.org/getsentry/sentry-webpack-plugin?type=dev&view=list)
|
|
16
|
-
[](https://david-dm.org/getsentry/sentry-webpack-plugin?type=peer&view=list)
|
|
15
|
+
# Sentry Webpack Plugin
|
|
17
16
|
|
|
18
17
|
A webpack plugin acting as an interface to
|
|
19
18
|
[Sentry CLI](https://docs.sentry.io/learn/cli/).
|
|
20
19
|
|
|
21
20
|
### Installation
|
|
22
21
|
|
|
23
|
-
`@sentry/webpack-plugin` requires at least `webpack@4.41.31` or any `webpack@5`
|
|
22
|
+
`@sentry/webpack-plugin` requires at least `webpack@4.41.31` or any `webpack@5`
|
|
23
|
+
version to be installed.
|
|
24
24
|
|
|
25
25
|
Using npm:
|
|
26
26
|
|
|
@@ -60,37 +60,37 @@ Also, check the [example](example) directory.
|
|
|
60
60
|
|
|
61
61
|
#### Options
|
|
62
62
|
|
|
63
|
-
| Option | Type | Required | Description
|
|
64
|
-
| ------------------ | ----------------------------------------------------------------------------------- | -------- |
|
|
65
|
-
| include | `string`/`array`/`object` | required | One or more paths that Sentry CLI should scan recursively for sources. It will upload all `.map` files and match associated `.js` files. Each path can be given as an object with path-specific options. See [table below](#include) for details.
|
|
66
|
-
| org | `string` | optional | The slug of the Sentry organization associated with the app. Can also be specified via `process.env.SENTRY_ORG`.
|
|
67
|
-
| project | `string` | optional | The slug of the Sentry project associated with the app. Can also be specified via `process.env.SENTRY_PROJECT`.
|
|
68
|
-
| authToken | `string` | optional | The authentication token to use for all communication with Sentry. Can be obtained from https://sentry.io/settings/account/api/auth-tokens/. Required scopes: `project:releases` (and `org:read` if `setCommits` option is used).
|
|
69
|
-
| url | `string` | optional | The base URL of your Sentry instance. Defaults to https://sentry.io/, which is the correct value for SAAS customers.
|
|
70
|
-
| customHeader | `string` | optional | A header added to all outgoing requests. A string in the format `header-key: header-value`
|
|
71
|
-
| vcsRemote | `string` | optional | The name of the remote in the version control system. Defaults to `origin`.
|
|
72
|
-
| release | `string` | optional | Unique identifier for the release. Can also be specified via `process.env.SENTRY_RELEASE`. Defaults to the output of the `sentry-cli releases propose-version` command, which automatically detects values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses `HEAD`'s commit SHA. (**For `HEAD` option, requires access to `git` CLI and for the root directory to be a valid repository**).
|
|
73
|
-
| dist | `string` | optional | Unique identifier for the distribution, used to further segment your release. Usually your build number.
|
|
74
|
-
| entries | `array`/`RegExp`/`function(key: string): bool` | optional | Filter for entry points that should be processed. By default, the release will be injected into all entry points.
|
|
75
|
-
| ignoreFile | `string` | optional | Path to a file containing list of files/directories to ignore. Can point to `.gitignore` or anything with the same format.
|
|
76
|
-
| ignore | `string`/`array` | optional | One or more paths to ignore during upload. Overrides entries in `ignoreFile` file. If neither `ignoreFile` nor `ignore` is present, defaults to `['node_modules']`.
|
|
77
|
-
| configFile | `string` | optional | Path to Sentry CLI config properties, as described in https://docs.sentry.io/product/cli/configuration/#configuration-file. By default, the config file is looked for upwards from the current path, and defaults from `~/.sentryclirc` are always loaded
|
|
78
|
-
| ext | `array` | optional | The file extensions to be considered. By default the following file extensions are processed: `js`, `map`, `jsbundle`, and `bundle`.
|
|
79
|
-
| urlPrefix | `string` | optional | URL prefix to add to the beginning of all filenames. 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'`.
|
|
80
|
-
| urlSuffix | `string` | optional | URL suffix to add to the end of all filenames. Useful for appending query parameters.
|
|
81
|
-
| validate | `boolean` | optional | When `true`, attempts source map validation before upload if rewriting is not enabled. It will spot a variety of issues with source maps and cancel the upload if any are found. Defaults to `false` to prevent false positives canceling upload.
|
|
82
|
-
| stripPrefix | `array` | optional | When paired with `rewrite`, will remove a prefix from filename references inside of sourcemaps. Useful for removing a path that is build-machine-specific. Note that this will NOT change the names of uploaded files.
|
|
83
|
-
| stripCommonPrefix | `boolean` | optional | When paired with `rewrite`, will add `~` to the `stripPrefix` array. Defaults to `false`.
|
|
84
|
-
| sourceMapReference | `boolean` | optional | Determines whether sentry-cli should attempt to link minified files with their corresponding maps. By default, it will match files and maps based on name, and add a `Sourcemap` header to each minified file for which it finds a map. Can be disabled if all minified files contain `sourceMappingURL`. Defaults to `true`.
|
|
85
|
-
| rewrite | `boolean` | optional | Enables rewriting of matching source maps so that indexed maps are flattened and missing sources are inlined if possible. Defaults to `true`
|
|
86
|
-
| finalize | `boolean` | optional | Determines whether Sentry release record should be automatically finalized (`date_released` timestamp added) after artifact upload. Defaults to `true`
|
|
87
|
-
| dryRun | `boolean` | optional | Attempts a dry run (useful for dev environments). Defaults to `false`, but may be automatically set to true in development environments by some framework integrations (Next.JS, possibly others).
|
|
88
|
-
| debug | `boolean` | optional | Print useful debug information. Defaults to `false`.
|
|
89
|
-
| silent | `boolean` | optional | Suppresses all logs (useful for `--json` option). Defaults to `false`.
|
|
90
|
-
| cleanArtifacts | `boolean` | optional | Remove all the artifacts in the release before the upload. Defaults to `false`.
|
|
91
|
-
| errorHandler | `function(err: Error, invokeErr: function(): void, compilation: Compilation): void` | optional | Function to call a when CLI error occurs. Webpack compilation failure can be triggered by calling `invokeErr` callback. Can emit a warning rather than an error (allowing compilation to continue) by setting this to `(err, invokeErr, compilation) => { compilation.warnings.push('Sentry CLI Plugin: ' + err.message) }`. Defaults to `(err, invokeErr) => { invokeErr() }`.
|
|
92
|
-
| setCommits | `Object` | optional | Adds commits to Sentry. See [table below](#optionssetcommits) for details.
|
|
93
|
-
| deploy | `Object` | optional | Creates a new release deployment in Sentry. See [table below](#deploy) for details.
|
|
63
|
+
| Option | Type | Required | Description |
|
|
64
|
+
| ------------------ | ----------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
65
|
+
| include | `string`/`array`/`object` | required | One or more paths that Sentry CLI should scan recursively for sources. It will upload all `.map` files and match associated `.js` files. Each path can be given as an object with path-specific options. See [table below](#include) for details. |
|
|
66
|
+
| org | `string` | optional | The slug of the Sentry organization associated with the app. Can also be specified via `process.env.SENTRY_ORG`. |
|
|
67
|
+
| project | `string` | optional | The slug of the Sentry project associated with the app. Can also be specified via `process.env.SENTRY_PROJECT`. |
|
|
68
|
+
| authToken | `string` | optional | The authentication token to use for all communication with Sentry. Can be obtained from https://sentry.io/settings/account/api/auth-tokens/. Required scopes: `project:releases` (and `org:read` if `setCommits` option is used). |
|
|
69
|
+
| url | `string` | optional | The base URL of your Sentry instance. Defaults to https://sentry.io/, which is the correct value for SAAS customers. |
|
|
70
|
+
| customHeader | `string` | optional | A header added to all outgoing requests. A string in the format `header-key: header-value` |
|
|
71
|
+
| vcsRemote | `string` | optional | The name of the remote in the version control system. Defaults to `origin`. |
|
|
72
|
+
| release | `string` | optional | Unique identifier for the release. Can also be specified via `process.env.SENTRY_RELEASE`. Defaults to the output of the `sentry-cli releases propose-version` command, which automatically detects values for Cordova, Heroku, AWS CodeBuild, CircleCI, Xcode, and Gradle, and otherwise uses `HEAD`'s commit SHA. (**For `HEAD` option, requires access to `git` CLI and for the root directory to be a valid repository**). |
|
|
73
|
+
| dist | `string` | optional | Unique identifier for the distribution, used to further segment your release. Usually your build number. |
|
|
74
|
+
| entries | `array`/`RegExp`/`function(key: string): bool` | optional | Filter for entry points that should be processed. By default, the release will be injected into all entry points. |
|
|
75
|
+
| ignoreFile | `string` | optional | Path to a file containing list of files/directories to ignore. Can point to `.gitignore` or anything with the same format. |
|
|
76
|
+
| ignore | `string`/`array` | optional | One or more paths to ignore during upload. Overrides entries in `ignoreFile` file. If neither `ignoreFile` nor `ignore` is present, defaults to `['node_modules']`. |
|
|
77
|
+
| configFile | `string` | optional | Path to Sentry CLI config properties, as described in https://docs.sentry.io/product/cli/configuration/#configuration-file. By default, the config file is looked for upwards from the current path, and defaults from `~/.sentryclirc` are always loaded |
|
|
78
|
+
| ext | `array` | optional | The file extensions to be considered. By default the following file extensions are processed: `js`, `map`, `jsbundle`, and `bundle`. |
|
|
79
|
+
| urlPrefix | `string` | optional | URL prefix to add to the beginning of all filenames. 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'`. |
|
|
80
|
+
| urlSuffix | `string` | optional | URL suffix to add to the end of all filenames. Useful for appending query parameters. |
|
|
81
|
+
| validate | `boolean` | optional | When `true`, attempts source map validation before upload if rewriting is not enabled. It will spot a variety of issues with source maps and cancel the upload if any are found. Defaults to `false` to prevent false positives canceling upload. |
|
|
82
|
+
| stripPrefix | `array` | optional | When paired with `rewrite`, will remove a prefix from filename references inside of sourcemaps. Useful for removing a path that is build-machine-specific. Note that this will NOT change the names of uploaded files. |
|
|
83
|
+
| stripCommonPrefix | `boolean` | optional | When paired with `rewrite`, will add `~` to the `stripPrefix` array. Defaults to `false`. |
|
|
84
|
+
| sourceMapReference | `boolean` | optional | Determines whether sentry-cli should attempt to link minified files with their corresponding maps. By default, it will match files and maps based on name, and add a `Sourcemap` header to each minified file for which it finds a map. Can be disabled if all minified files contain `sourceMappingURL`. Defaults to `true`. |
|
|
85
|
+
| rewrite | `boolean` | optional | Enables rewriting of matching source maps so that indexed maps are flattened and missing sources are inlined if possible. Defaults to `true` |
|
|
86
|
+
| finalize | `boolean` | optional | Determines whether Sentry release record should be automatically finalized (`date_released` timestamp added) after artifact upload. Defaults to `true` |
|
|
87
|
+
| dryRun | `boolean` | optional | Attempts a dry run (useful for dev environments). Defaults to `false`, but may be automatically set to true in development environments by some framework integrations (Next.JS, possibly others). |
|
|
88
|
+
| debug | `boolean` | optional | Print useful debug information. Defaults to `false`. |
|
|
89
|
+
| silent | `boolean` | optional | Suppresses all logs (useful for `--json` option). Defaults to `false`. |
|
|
90
|
+
| cleanArtifacts | `boolean` | optional | Remove all the artifacts in the release before the upload. Defaults to `false`. |
|
|
91
|
+
| errorHandler | `function(err: Error, invokeErr: function(): void, compilation: Compilation): void` | optional | Function to call a when CLI error occurs. Webpack compilation failure can be triggered by calling `invokeErr` callback. Can emit a warning rather than an error (allowing compilation to continue) by setting this to `(err, invokeErr, compilation) => { compilation.warnings.push('Sentry CLI Plugin: ' + err.message) }`. Defaults to `(err, invokeErr) => { invokeErr() }`. |
|
|
92
|
+
| setCommits | `Object` | optional | Adds commits to Sentry. See [table below](#optionssetcommits) for details. |
|
|
93
|
+
| deploy | `Object` | optional | Creates a new release deployment in Sentry. See [table below](#deploy) for details. |
|
|
94
94
|
|
|
95
95
|
#### <a name="include"></a>options.include:
|
|
96
96
|
|
package/index.d.ts
CHANGED
|
@@ -130,7 +130,8 @@ declare namespace SentryCliPlugin {
|
|
|
130
130
|
declare class SentryCliPlugin implements WebpackPluginInstance {
|
|
131
131
|
options: SentryCliPlugin.SentryCliPluginOptions;
|
|
132
132
|
constructor(options: SentryCliPlugin.SentryCliPluginOptions);
|
|
133
|
-
static cliBinaryExists():
|
|
133
|
+
static cliBinaryExists(): boolean;
|
|
134
|
+
static downloadCliBinary(logger: { log(...args: unknown[]) }): Promise<void>;
|
|
134
135
|
apply(compiler: Compiler): void;
|
|
135
136
|
}
|
|
136
137
|
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"source-map"
|
|
9
9
|
],
|
|
10
10
|
"author": "Sentry",
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.21.0",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"repository": "git@github.com:getsentry/sentry-webpack-plugin.git",
|
|
14
14
|
"homepage": "https://github.com/getsentry/sentry-webpack-plugin",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"node": ">= 8"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@sentry/cli": "^1.
|
|
21
|
+
"@sentry/cli": "^1.77.1",
|
|
22
22
|
"webpack-sources": "^2.0.0 || ^3.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
package/src/index.js
CHANGED
|
@@ -202,6 +202,10 @@ class SentryCliPlugin {
|
|
|
202
202
|
return fs.existsSync(SentryCli.getPath());
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
static downloadCliBinary(logger) {
|
|
206
|
+
return SentryCli.downloadBinary(logger);
|
|
207
|
+
}
|
|
208
|
+
|
|
205
209
|
/** Creates a new Sentry CLI instance. */
|
|
206
210
|
getSentryCli() {
|
|
207
211
|
const cli = new SentryCli(this.options.configFile, {
|