@sentry/webpack-plugin 1.19.1 → 2.0.0-alpha.1

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/LICENSE CHANGED
@@ -1,21 +1,29 @@
1
- The MIT License (MIT)
1
+ # MIT License
2
2
 
3
- Copyright (c) 2017 Sentry
3
+ Copyright (c) 2022, Sentry
4
+ All rights reserved.
4
5
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
11
8
 
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
9
+ - Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
14
11
 
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
12
+ - Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ - Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/README.md CHANGED
@@ -6,21 +6,14 @@
6
6
 
7
7
  # Sentry Webpack Plugin
8
8
 
9
- [![codecov](https://codecov.io/gh/getsentry/sentry-webpack-plugin/branch/master/graph/badge.svg)](https://codecov.io/gh/getsentry/sentry-webpack-plugin)
10
- [![npm version](https://img.shields.io/npm/v/@sentry/webpack-plugin.svg)](https://www.npmjs.com/package/@sentry/webpack-plugin)
11
- [![npm dm](https://img.shields.io/npm/dm/@sentry/webpack-plugin.svg)](https://www.npmjs.com/package/@sentry/webpack-plugin)
12
- [![npm dt](https://img.shields.io/npm/dt/@sentry/webpack-plugin.svg)](https://www.npmjs.com/package/@sentry/webpack-plugin)
9
+ A Webpack plugin that provides release management features for Sentry:
13
10
 
14
- [![deps](https://david-dm.org/getsentry/sentry-webpack-plugin/status.svg)](https://david-dm.org/getsentry/sentry-webpack-plugin?view=list)
15
- [![deps dev](https://david-dm.org/getsentry/sentry-webpack-plugin/dev-status.svg)](https://david-dm.org/getsentry/sentry-webpack-plugin?type=dev&view=list)
16
- [![deps peer](https://david-dm.org/getsentry/sentry-webpack-plugin/peer-status.svg)](https://david-dm.org/getsentry/sentry-webpack-plugin?type=peer&view=list)
11
+ - Sourcemap upload
12
+ - Release creation
13
+ - Automatic release name discovery (based on CI environment - Vercel, AWS, Heroku, CircleCI, or current Git SHA)
14
+ - Automatically association of errors with releases (Release injection)
17
15
 
18
- A webpack plugin acting as an interface to
19
- [Sentry CLI](https://docs.sentry.io/learn/cli/).
20
-
21
- ### Installation
22
-
23
- `@sentry/webpack-plugin` requires at least `webpack@4.41.31` or any `webpack@5` version to be installed.
16
+ ## Installation
24
17
 
25
18
  Using npm:
26
19
 
@@ -34,100 +27,100 @@ Using yarn:
34
27
  $ yarn add @sentry/webpack-plugin --dev
35
28
  ```
36
29
 
37
- ### CLI Configuration
38
-
39
- You can use either `.sentryclirc` file or ENV variables described here
40
- https://docs.sentry.io/cli/configuration.
41
-
42
- ### Usage
30
+ ## Usage
43
31
 
44
32
  ```js
45
- const SentryCliPlugin = require('@sentry/webpack-plugin');
33
+ // webpack.config.js
34
+ const { sentryWebpackPlugin } = require("@sentry/webpack-plugin");
46
35
 
47
- const config = {
36
+ module.exports = {
48
37
  plugins: [
49
- new SentryCliPlugin({
50
- include: '.',
51
- ignoreFile: '.sentrycliignore',
52
- ignore: ['node_modules', 'webpack.config.js'],
53
- configFile: 'sentry.properties',
38
+ sentryWebpackPlugin({
39
+ include: ".",
40
+ ignore: ["node_modules", "webpack.config.js"],
41
+ org: process.env.SENTRY_ORG,
42
+ project: process.env.SENTRY_PROJECT,
43
+ authToken: process.env.SENTRY_AUTH_TOKEN,
54
44
  }),
55
45
  ],
56
46
  };
57
47
  ```
58
48
 
59
- Also, check the [example](example) directory.
60
-
61
- #### Options
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](#setCommits) for details. |
93
- | deploy | `Object` | optional | Creates a new release deployment in Sentry. See [table below](#deploy) for details. |
49
+ As an alternative to passing options explicitly, you can also use a `.sentryclirc` file or environment variables as described in https://docs.sentry.io/product/cli/configuration/.
50
+
51
+ ### Configuration
52
+
53
+ The Sentry Webpack Plugin takes an options argument with the following properties:
54
+
55
+ | Option | Type | Required | Description |
56
+ | ----------------------- | -------------------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
57
+ | include | `string`/`array`/`object` | required | One or more paths that the plugin should scan recursively for sources. It will upload all `.map` files and match associated `.js` files. Other file types can be uploaded by using the `ext` option. Each path can be given as a string or an object with path-specific options. See [table below](#include) for details. |
58
+ | org | `string` | optional | The slug of the Sentry organization associated with the app. Can also be specified via the `SENTRY_ORG` environment variable. |
59
+ | project | `string` | optional | The slug of the Sentry project associated with the app. Can also be specified via the `SENTRY_PROJECT` environment variable. |
60
+ | 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). Can also be specified via the `SENTRY_AUTH_TOKEN` env variable. |
61
+ | url | `string` | optional | The base URL of your Sentry instance. Use this if you are using a self-hosted or Sentry instance other than sentry.io. This value can also be set via the `SENTRY_URL` environment variable. Defaults to https://sentry.io/, which is the correct value for SaaS customers. |
62
+ | headers | `Record<string, string>` | optional | Headers added to every outgoing network request. |
63
+ | vcsRemote | `string` | optional | Version control system remote name. This value can also be specified via the `SENTRY_VSC_REMOTE` environment variable. Defaults to `'origin'`. |
64
+ | release | `string` | optional | Unique identifier for the release. This value can also be specified via the `SENTRY_RELEASE` environment variable. 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 the git `HEAD`'s commit SHA. (**the latter requires access to `git` CLI and for the root directory to be a valid repository**). |
65
+ | dist | `string` | optional | Unique identifier for the distribution, used to further segment your release. Usually your build number. |
66
+ | releaseInjectionTargets | `array`/`RegExp`/`(string \| RegExp)[]`/`function(filePath: string): bool` | optional | Filter for modules that the release should be injected in. This option takes a string, a regular expression, or an array containing strings, regular expressions, or both. It's also possible to provide a filter function that takes the absolute path of a processed module. It should return `true` if the release should be injected into the module and `false` otherwise. String values of this option require a full match with the absolute path of the module. By default, the release will be injected into all modules - however, bundlers will include the injected release code only once per entrypoint. If release injection should be disabled, provide an empty array here. |
67
+ | ignoreFile | `string` | optional | Path to a file containing list of files/directories to ignore. Can point to `.gitignore` or anything with the same format. |
68
+ | ignore | `string`/`array` | optional | One or more paths to ignore during upload. Overrides entries in `ignoreFile` file. Defaults to `['node_modules']` if neither `ignoreFile` nor `ignore` is set. |
69
+ | 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. |
70
+ | ext | `array` | optional | Array of file extensions of files to be collected for the file upload. By default the following file extensions are processed: js, map, jsbundle and bundle. |
71
+ | 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'`. |
72
+ | urlSuffix | `string` | optional | URL suffix to add to the end of all filenames. Useful for appending query parameters. |
73
+ | 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` as this can cause false positives. |
74
+ | stripPrefix | `array` | optional | When paired with the `rewrite` option, this will remove a prefix from filename references inside of sourcemaps. For instance you can use this to remove a path that is build machine specific. Note that this will NOT change the names of uploaded files. |
75
+ | stripCommonPrefix | `boolean` | optional | When paired with the `rewrite` option, this will add `~` to the `stripPrefix` array. |
76
+ | 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 a `sourceMappingURL`. Defaults to `true`. |
77
+ | 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` |
78
+ | finalize | `boolean` | optional | Determines if the Sentry release record should be automatically finalized (meaning a date_released timestamp is added) after artifact upload. Defaults to `true`. |
79
+ | dryRun | `boolean` | optional | Attempts a dry run (useful for dev environments), making release creation a no-op. Defaults to `false`. |
80
+ | debug | `boolean` | optional | Print useful debug information. Defaults to `false`. |
81
+ | silent | `boolean` | optional | Suppresses all logs. Defaults to `false`. |
82
+ | cleanArtifacts | `boolean` | optional | Remove all the artifacts in the release before the upload. Defaults to `false`. |
83
+ | errorHandler | `function(err: Error): void` | optional | When an error occurs during rlease creation or sourcemaps upload, the plugin will call this function. By default, the plugin will simply throw an error, thereby stopping the bundling process. If an `errorHandler` callback is provided, compilation will continue, unless an error is thrown in the provided callback. |
84
+ | setCommits | `Object` | optional | Associates the release with its commits in Sentry. See [table below](#setCommits) for details. |
85
+ | deploy | `Object` | optional | Adds deployment information to the release in Sentry. See [table below](#deploy) for details. |
86
+ | injectReleasesMap | `boolean` | optional | If set to true, the plugin will inject an additional `SENTRY_RELEASES` variable that maps from `{org}@{project}` to the `release` value. This might be helpful for webpack module federation or micro frontend setups. Defaults to `false`. |
87
+ | telemetry | `boolean` | optional | If set to true, internal plugin errors and performance data will be sent to Sentry. At Sentry we like to use Sentry ourselves to deliver faster and more stable products. We're very careful of what we're sending. We won't collect anything other than error and high-level performance data. We will never collect your code or any details of the projects in which you're using this plugin. Defaults to `true`. |
94
88
 
95
89
  #### <a name="include"></a>options.include:
96
90
 
97
- | Option | Type | Required | Description |
98
- | ------------------ | ---------------- | -------- | ---------------------------------------------- |
99
- | paths | `array` | required | One or more paths to scan for files to upload. |
100
- | ignoreFile | `string` | optional | See above. |
101
- | ignore | `string`/`array` | optional | See above. |
102
- | ext | `array` | optional | See above. |
103
- | urlPrefix | `string` | optional | See above. |
104
- | urlSuffix | `string` | optional | See above. |
105
- | stripPrefix | `array` | optional | See above. |
106
- | stripCommonPrefix | `boolean` | optional | See above. |
107
- | sourceMapReference | `boolean` | optional | See above. |
108
- | rewrite | `boolean` | optional | See above. |
91
+ | Option | Type | Required | Description |
92
+ | ------------------ | ------------------- | -------- | ---------------------------------------------- |
93
+ | paths | `string[]` | required | One or more paths to scan for files to upload. |
94
+ | ignoreFile | `string` | optional | See above. |
95
+ | ignore | `string`/`string[]` | optional | See above. |
96
+ | ext | `array` | optional | See above. |
97
+ | urlPrefix | `string` | optional | See above. |
98
+ | urlSuffix | `string` | optional | See above. |
99
+ | stripPrefix | `array` | optional | See above. |
100
+ | stripCommonPrefix | `boolean` | optional | See above. |
101
+ | sourceMapReference | `boolean` | optional | See above. |
102
+ | rewrite | `boolean` | optional | See above. |
109
103
 
110
104
  Example:
111
105
 
112
106
  ```js
113
- const SentryCliPlugin = require('@sentry/webpack-plugin');
107
+ // webpack.config.js
108
+ const sentryWebpackPlugin = require("@sentry/webpack-plugin");
114
109
 
115
- const config = {
110
+ module.exports = {
116
111
  plugins: [
117
- new SentryCliPlugin({
112
+ sentryWebpackPlugin({
113
+ // ...
118
114
  include: [
119
115
  {
120
- paths: ['./packages'],
121
- urlPrefix: '~/path/to/packages',
116
+ paths: ["./packages"],
117
+ urlPrefix: "~/path/to/packages",
122
118
  },
123
119
  {
124
- paths: ['./client'],
125
- urlPrefix: '~/path/to/client',
120
+ paths: ["./client"],
121
+ urlPrefix: "~/path/to/client",
126
122
  },
127
123
  ],
128
- ignoreFile: '.sentrycliignore',
129
- ignore: ['node_modules', 'webpack.config.js'],
130
- configFile: 'sentry.properties',
131
124
  }),
132
125
  ],
133
126
  };
@@ -135,24 +128,32 @@ const config = {
135
128
 
136
129
  #### <a name="setCommits"></a>options.setCommits:
137
130
 
138
- | Option | Type | Required | Description |
139
- | -------------- | --------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
140
- | repo | `string` | see notes | The full git repo name as defined in Sentry. Required if `auto` option is not `true`, otherwise optional. |
141
- | commit | `string` | see notes | The current (most recent) commit in the release. Required if `auto` option is not `true`, otherwise optional. |
142
- | previousCommit | `string` | optional | The last commit of the previous release. Defaults to the most recent commit of the previous release in Sentry, or if no previous release is found, 10 commits back from `commit`. |
143
- | auto | `boolean` | optional | Automatically set `commit` and `previousCommit`. Defaults `commit` to `HEAD` and `previousCommit` as described above. Overrides other options |
144
- | ignoreMissing | `boolean` | optional | When the flag is set and the previous release commit was not found in the repository, will create a release with the default commits count (or the one specified with `--initial-depth`) instead of failing the command. |
131
+ | Option | Type | Required | Description |
132
+ | -------------- | --------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
133
+ | repo | `string` | see notes | The full git repo name as defined in Sentry. Required if the `auto` option is not `true`, otherwise optional. |
134
+ | commit | `string` | see notes | The current (most recent) commit in the release. Required if the `auto` option is not `true`, otherwise optional. |
135
+ | previousCommit | `string` | optional | The commit before the beginning of this release (in other words, the last commit of the previous release). Defaults to the last commit of the previous release in Sentry. If there was no previous release, the last 10 commits will be used. |
136
+ | auto | `boolean` | optional | Automatically sets `commit` and `previousCommit`. Sets `commit` to `HEAD` and `previousCommit` as described in the option's documentation. If you set this to `true`, manually specified `commit` and `previousCommit` options will be overridden. It is best to not specify them at all if you set this option to `true`. |
137
+ | ignoreMissing | `boolean` | optional | If the flag is to `true` and the previous release commit was not found in the repository, the plugin creates a release with the default commits count instead of failing the command. Defaults to `false`. |
145
138
 
146
139
  #### <a name="deploy"></a>options.deploy:
147
140
 
148
141
  | Option | Type | Required | Description |
149
142
  | -------- | -------- | -------- | -------------------------------------------------------------------------------- |
150
143
  | env | `string` | required | Environment value for the release, for example `production` or `staging`. |
151
- | started | `number` | optional | UNIX timestamp for deployment start. |
152
- | finished | `number` | optional | UNIX timestamp for deployment finish. |
144
+ | started | `number` | optional | Deployment start time in Unix timestamp (in seconds) or ISO 8601 format. |
145
+ | finished | `number` | optional | Deployment finish time in Unix timestamp (in seconds) or ISO 8601 format. |
153
146
  | time | `number` | optional | Deployment duration in seconds. Can be used instead of `started` and `finished`. |
154
147
  | name | `string` | optional | Human-readable name for this deployment. |
155
148
  | url | `string` | optional | URL that points to the deployment. |
156
149
 
157
150
  You can find more information about these options in our official docs:
158
151
  https://docs.sentry.io/product/cli/releases/#sentry-cli-sourcemaps.
152
+
153
+ ## More information
154
+
155
+ - [Sentry Documentation](https://docs.sentry.io/quickstart/)
156
+ - [Troubleshooting Sourcemaps](https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/)
157
+ - [Sentry CLI](https://docs.sentry.io/learn/cli/)
158
+ - [Sentry Discord](https://discord.gg/Ww9hbqr)
159
+ - [Sentry Stackoverflow](http://stackoverflow.com/questions/tagged/sentry)
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var bundlerPluginCore = require('@sentry/bundler-plugin-core');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, 'sentryWebpackPlugin', {
10
+ enumerable: true,
11
+ get: function () { return bundlerPluginCore.sentryWebpackPlugin; }
12
+ });
13
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export { sentryWebpackPlugin } from '@sentry/bundler-plugin-core';
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export { sentryWebpackPlugin } from "@sentry/bundler-plugin-core";
2
+ export type { Options as SentryWebpackPluginOptions } from "@sentry/bundler-plugin-core";
package/package.json CHANGED
@@ -1,49 +1,77 @@
1
1
  {
2
2
  "name": "@sentry/webpack-plugin",
3
- "description": "Official webpack plugin for Sentry",
4
- "keywords": [
5
- "sentry",
6
- "sentry-cli",
7
- "webpack",
8
- "source-map"
9
- ],
3
+ "version": "2.0.0-alpha.1",
4
+ "description": "Official Sentry Webpack plugin",
5
+ "repository": "git://github.com/getsentry/sentry-javascript-bundler-plugins.git",
6
+ "homepage": "https://github.com/getsentry/sentry-javascript-bundler-plugins/tree/main/packages/webpack-plugin",
10
7
  "author": "Sentry",
11
- "version": "1.19.1",
12
8
  "license": "MIT",
13
- "repository": "git@github.com:getsentry/sentry-webpack-plugin.git",
14
- "homepage": "https://github.com/getsentry/sentry-webpack-plugin",
15
- "main": "src/cjs.js",
16
- "types": "index.d.ts",
17
- "engines": {
18
- "node": ">= 8"
9
+ "keywords": [
10
+ "Sentry",
11
+ "Webpack",
12
+ "bundler",
13
+ "plugin"
14
+ ],
15
+ "publishConfig": {
16
+ "access": "public"
17
+ },
18
+ "files": [
19
+ "dist"
20
+ ],
21
+ "exports": {
22
+ ".": {
23
+ "import": "./dist/esm/index.mjs",
24
+ "require": "./dist/cjs/index.js"
25
+ }
26
+ },
27
+ "main": "dist/cjs/index.js",
28
+ "module": "dist/esm/index.mjs",
29
+ "types": "dist/types/index.d.ts",
30
+ "scripts": {
31
+ "build": "rimraf ./out && run-p build:rollup build:types",
32
+ "build:watch": "run-p build:rollup:watch build:types:watch",
33
+ "build:rollup": "rollup --config rollup.config.js",
34
+ "build:rollup:watch": "rollup --config rollup.config.js --watch --no-watch.clearScreen",
35
+ "build:types": "tsc --project types.tsconfig.json",
36
+ "build:types:watch": "tsc --project types.tsconfig.json --watch --preserveWatchOutput",
37
+ "build:npm": "npm pack",
38
+ "check:types": "run-p check:types:src check:types:test",
39
+ "check:types:src": "tsc --project ./src/tsconfig.json --noEmit",
40
+ "check:types:test": "tsc --project ./test/tsconfig.json --noEmit",
41
+ "clean": "run-s clean:build",
42
+ "clean:all": "run-p clean clean:deps",
43
+ "clean:build": "rimraf ./dist *.tgz",
44
+ "clean:deps": "rimraf node_modules",
45
+ "test": "jest",
46
+ "lint": "eslint ./src ./test"
19
47
  },
20
48
  "dependencies": {
21
- "@sentry/cli": "^1.74.4",
22
- "webpack-sources": "^2.0.0 || ^3.0.0"
49
+ "@sentry/bundler-plugin-core": "2.0.0-alpha.1"
23
50
  },
24
51
  "devDependencies": {
25
- "@types/webpack": "^4.41.31 || ^5.0.0",
26
- "codecov": "^3.5.0",
27
- "eslint": "^5.16.0",
28
- "eslint-config-airbnb-base": "^13.1.0",
29
- "eslint-config-prettier": "^4.3.0",
30
- "eslint-plugin-import": "^2.17.3",
31
- "jest": "^24.8.0",
32
- "npm-run-all": "^4.1.5",
33
- "prettier": "^1.18.2",
34
- "prettier-check": "^2.0.0",
35
- "webpack": "^4.41.31 || ^5.0.0"
52
+ "@babel/core": "7.18.5",
53
+ "@babel/preset-env": "7.18.2",
54
+ "@babel/preset-typescript": "7.17.12",
55
+ "@rollup/plugin-babel": "5.3.1",
56
+ "@rollup/plugin-commonjs": "22.0.1",
57
+ "@rollup/plugin-json": "4.1.0",
58
+ "@rollup/plugin-node-resolve": "13.3.0",
59
+ "@sentry-internal/eslint-config": "2.0.0-alpha.1",
60
+ "@sentry-internal/sentry-bundler-plugin-tsconfig": "2.0.0-alpha.1",
61
+ "@swc/core": "^1.2.205",
62
+ "@swc/jest": "^0.2.21",
63
+ "@types/jest": "^28.1.3",
64
+ "@types/node": "^18.6.3",
65
+ "eslint": "^8.18.0",
66
+ "jest": "^28.1.1",
67
+ "rimraf": "^3.0.2",
68
+ "rollup": "2.75.7",
69
+ "typescript": "^4.7.4"
36
70
  },
37
- "scripts": {
38
- "lint": "run-s lint:prettier lint:eslint",
39
- "lint:prettier": "prettier-check 'src/**/*.js'",
40
- "lint:eslint": "eslint src",
41
- "fix": "run-s fix:eslint fix:prettier",
42
- "fix:prettier": "prettier --write 'src/**/*.js'",
43
- "fix:eslint": "eslint --fix src",
44
- "test": "jest",
45
- "test:integration": "cd example && yarn && yarn test",
46
- "test:watch": "jest --watch --notify",
47
- "codecov": "codecov"
71
+ "volta": {
72
+ "extends": "../../package.json"
73
+ },
74
+ "engines": {
75
+ "node": ">= 10"
48
76
  }
49
77
  }
package/.craft.yml DELETED
@@ -1,13 +0,0 @@
1
- github:
2
- owner: getsentry
3
- repo: sentry-webpack-plugin
4
- changelogPolicy: auto
5
- preReleaseCommand: bash scripts/craft-pre-release.sh
6
- statusProvider:
7
- name: github
8
- artifactProvider:
9
- name: github
10
- targets:
11
- - name: npm
12
- - name: github
13
- tagPrefix: v
package/.eslintrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "extends": ["airbnb-base", "prettier"],
3
- "settings": {
4
- "excludedFiles": "*.spec.js"
5
- }
6
- }
package/.prettierrc DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "trailingComma": "es5",
3
- "singleQuote": true,
4
- "proseWrap": "always",
5
- "printWidth": 80
6
- }