@sentry/webpack-plugin 1.18.9 → 1.19.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 CHANGED
@@ -2,29 +2,27 @@
2
2
 
3
3
  - "Would I rather be feared or loved? Easy. Both. I want people to be afraid of how much they love me." — Michael Scott
4
4
 
5
- ## 1.18.9
5
+ ## 1.19.0
6
+
7
+ - feat(config): Support reading release from environment (#389)
8
+ - docs: Add example to `options.include` (#384)
6
9
 
7
- ### Various fixes & improvements
10
+ ## 1.18.9
8
11
 
9
- - ref: Update sentry-cli and refresh GH actions (#368) by @kamilogorek
12
+ - ref: Update sentry-cli to latest v1 version and refresh GH actions (#368) by @kamilogorek
10
13
  - docs: Update dryRun documentation to reflect auto-configuration. (#366) by @fiveable-jferg
11
- - chore: update @sentry/cli to latest major version (#363) by @sawilde
12
14
 
13
15
  ## 1.18.8
14
16
 
15
- ### Various fixes & improvements
16
-
17
17
  - deps: Bump sentry-cli to 1.73.0 (#356) by @kamilogorek
18
18
 
19
19
  ## 1.18.7
20
20
 
21
- ### Various fixes & improvements
22
-
23
21
  - deps: Remove webpack from peerDep and move info about ver to readme (#354) by @kamilogorek
24
22
  - misc: Correct 1.18.6 changelog (#353) by @kamilogorek
25
23
 
26
24
  ## 1.18.6
27
-
25
+
28
26
  - ci: Change changelogPolicy to auto for Craft releases (#351)
29
27
  - deps: Mark Webpack as optional peerDependency via peerDependenciesMeta ( #350)
30
28
 
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  <p align="center">
2
- <a href="https://sentry.io" target="_blank" align="center">
3
- <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
4
- </a>
5
- <br/>
6
- <h1>Sentry Webpack Plugin</h1>
2
+ <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4
+ </a>
7
5
  </p>
8
6
 
7
+ # Sentry Webpack Plugin
8
+
9
9
  [![codecov](https://codecov.io/gh/getsentry/sentry-webpack-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/getsentry/sentry-webpack-plugin)
10
10
  [![npm version](https://img.shields.io/npm/v/@sentry/webpack-plugin.svg)](https://www.npmjs.com/package/@sentry/webpack-plugin)
11
11
  [![npm dm](https://img.shields.io/npm/dm/@sentry/webpack-plugin.svg)](https://www.npmjs.com/package/@sentry/webpack-plugin)
@@ -63,13 +63,13 @@ Also, check the [example](example) directory.
63
63
  | Option | Type | Required | Description |
64
64
  | ------------------ | ----------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
65
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. |
67
- | project | `string` | optional | The slug of the Sentry project associated with the app. |
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
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
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
70
  | customHeader | `string` | optional | A header added to all outgoing requests. A string in the format `header-key: header-value` |
71
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. 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**). |
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
73
  | dist | `string` | optional | Unique identifier for the distribution, used to further segment your release. Usually your build number. |
74
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
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. |
@@ -107,6 +107,32 @@ Also, check the [example](example) directory.
107
107
  | sourceMapReference | `boolean` | optional | See above. |
108
108
  | rewrite | `boolean` | optional | See above. |
109
109
 
110
+ Example:
111
+
112
+ ```js
113
+ const SentryCliPlugin = require('@sentry/webpack-plugin');
114
+
115
+ const config = {
116
+ plugins: [
117
+ new SentryCliPlugin({
118
+ include: [
119
+ {
120
+ paths: ['./packages'],
121
+ urlPrefix: '~/path/to/packages',
122
+ },
123
+ {
124
+ paths: ['./client'],
125
+ urlPrefix: '~/path/to/client',
126
+ },
127
+ ],
128
+ ignoreFile: '.sentrycliignore',
129
+ ignore: ['node_modules', 'webpack.config.js'],
130
+ configFile: 'sentry.properties',
131
+ }),
132
+ ],
133
+ };
134
+ ```
135
+
110
136
  #### <a name="setCommits"></a>options.setCommits:
111
137
 
112
138
  | Option | Type | Required | Description |
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "source-map"
9
9
  ],
10
10
  "author": "Sentry",
11
- "version": "1.18.9",
11
+ "version": "1.19.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",
package/src/index.js CHANGED
@@ -120,7 +120,7 @@ function attachAfterCodeGenerationHook(compiler, options) {
120
120
  sourceMap.set(
121
121
  'javascript',
122
122
  new RawSource(
123
- `${rawSource.source()}
123
+ `${rawSource.source()}
124
124
  (function (){
125
125
  var globalThis = (typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {});
126
126
  globalThis.SENTRY_RELEASES = globalThis.SENTRY_RELEASES || {};
@@ -260,8 +260,10 @@ class SentryCliPlugin {
260
260
  * Returns undefined if proposeVersion failed.
261
261
  */
262
262
  getReleasePromise() {
263
- return (this.options.release
264
- ? Promise.resolve(this.options.release)
263
+ const userSpecifiedRelease =
264
+ this.options.release || process.env.SENTRY_RELEASE;
265
+ return (userSpecifiedRelease
266
+ ? Promise.resolve(userSpecifiedRelease)
265
267
  : this.cli.releases.proposeVersion()
266
268
  )
267
269
  .then(version => `${version}`.trim())
@@ -398,6 +400,9 @@ class SentryCliPlugin {
398
400
  {
399
401
  loader: SENTRY_LOADER,
400
402
  options: {
403
+ // We check for `process.env.SENTRY_RELEASE` earlier, which is why
404
+ // it's not used here the way `process.env.SENTRY_ORG` and
405
+ // `process.env.SENTRY_PROJECT` are
401
406
  releasePromise: this.release,
402
407
  org: this.options.org || process.env.SENTRY_ORG,
403
408
  project: this.options.project || process.env.SENTRY_PROJECT,
@@ -570,6 +575,9 @@ class SentryCliPlugin {
570
575
  }
571
576
 
572
577
  attachAfterCodeGenerationHook(compiler, {
578
+ // We check for `process.env.SENTRY_RELEASE` earlier, which is why it's
579
+ // not used here the way `process.env.SENTRY_ORG` and
580
+ // `process.env.SENTRY_PROJECT` are
573
581
  releasePromise: this.release,
574
582
  org: this.options.org || process.env.SENTRY_ORG,
575
583
  project: this.options.project || process.env.SENTRY_PROJECT,