@sentry/webpack-plugin
Advanced tools
Comparing version 1.17.1 to 1.17.2
@@ -7,2 +7,10 @@ # Changelog | ||
## v1.17.2 | ||
- docs: Fix description and default value for sourceMapReferences (#318) | ||
- fix: Increase stack size of errors in CI (#319) | ||
- fix: Enable plugin to be imported under ES6 (#316) | ||
- fix: Add `options` to main plugin type (#314) | ||
- fix: Update types of SentryCliPluginOptions.errorHandler (#308) | ||
## v1.17.1 | ||
@@ -9,0 +17,0 @@ |
193
index.d.ts
@@ -1,2 +0,2 @@ | ||
import { Compiler, WebpackPluginInstance } from 'webpack'; | ||
import { Compiler, WebpackPluginInstance, Compilation } from 'webpack'; | ||
import { | ||
@@ -10,102 +10,127 @@ SentryCliCommitsOptions, | ||
export interface SentryCliPluginOptions | ||
extends Pick< | ||
SentryCliOptions, | ||
'url' | 'authToken' | 'org' | 'project' | 'vscRemote' | 'dist' | 'silent' | ||
>, | ||
Pick< | ||
SentryCliUploadSourceMapsOptions, | ||
| 'ignoreFile' | ||
| 'rewrite' | ||
| 'sourceMapReference' | ||
| 'stripPrefix' | ||
| 'stripCommonPrefix' | ||
| 'validate' | ||
| 'urlPrefix' | ||
| 'urlSuffix' | ||
| 'ext' | ||
> { | ||
/** | ||
* Filepaths to scan recursively for source and source map files | ||
*/ | ||
include: | ||
| string | ||
| SourceMapsPathDescriptor | ||
| Array<string | SourceMapsPathDescriptor>; | ||
declare namespace SentryCliPlugin { | ||
export interface SentryCliPluginOptions | ||
extends Pick< | ||
SentryCliOptions, | ||
| 'url' | ||
| 'authToken' | ||
| 'org' | ||
| 'project' | ||
| 'vscRemote' | ||
| 'dist' | ||
| 'silent' | ||
>, | ||
Pick< | ||
SentryCliUploadSourceMapsOptions, | ||
| 'ignoreFile' | ||
| 'rewrite' | ||
| 'sourceMapReference' | ||
| 'stripPrefix' | ||
| 'stripCommonPrefix' | ||
| 'validate' | ||
| 'urlPrefix' | ||
| 'urlSuffix' | ||
| 'ext' | ||
> { | ||
/** | ||
* Filepaths to scan recursively for source and source map files | ||
*/ | ||
include: | ||
| string | ||
| SourceMapsPathDescriptor | ||
| Array<string | SourceMapsPathDescriptor>; | ||
/** | ||
* Filepaths to ignore when scanning for sources and source maps | ||
*/ | ||
ignore?: string | Array<string>; | ||
/** | ||
* Filepaths to ignore when scanning for sources and source maps | ||
*/ | ||
ignore?: string | Array<string>; | ||
/** | ||
* 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). | ||
*/ | ||
release?: string; | ||
/** | ||
* 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). | ||
*/ | ||
release?: string; | ||
/** | ||
* A filter for entry points that should be processed. | ||
* By default, the release will be injected into all entry points. | ||
*/ | ||
entries?: string[] | RegExp | ((key: string) => boolean); | ||
/** | ||
* A filter for entry points that should be processed. | ||
* By default, the release will be injected into all entry points. | ||
*/ | ||
entries?: string[] | RegExp | ((key: string) => boolean); | ||
/** | ||
* 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. | ||
*/ | ||
configFile?: 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. | ||
*/ | ||
configFile?: string; | ||
/** | ||
* Determines whether processed release should be automatically finalized after artifacts upload. | ||
* Defaults to `true`. | ||
*/ | ||
finalize?: boolean; | ||
/** | ||
* Determines whether processed release should be automatically finalized after artifacts upload. | ||
* Defaults to `true`. | ||
*/ | ||
finalize?: boolean; | ||
/** | ||
* Determines whether plugin should be applied not more than once during whole webpack run. | ||
* Useful when the process is performing multiple builds using the same config. | ||
* Defaults to `false`. | ||
*/ | ||
runOnce?: boolean; | ||
/** | ||
* Determines whether plugin should be applied not more than once during whole webpack run. | ||
* Useful when the process is performing multiple builds using the same config. | ||
* Defaults to `false`. | ||
*/ | ||
runOnce?: boolean; | ||
/** | ||
* Attempts a dry run (useful for dev environments). | ||
*/ | ||
dryRun?: boolean; | ||
/** | ||
* Attempts a dry run (useful for dev environments). | ||
*/ | ||
dryRun?: boolean; | ||
/** | ||
* Print some useful debug information. | ||
*/ | ||
debug?: boolean; | ||
/** | ||
* Print some useful debug information. | ||
*/ | ||
debug?: boolean; | ||
/** | ||
* If true, will remove all previously uploaded artifacts from the configured release. | ||
*/ | ||
cleanArtifacts?: boolean; | ||
/** | ||
* If true, will remove all previously uploaded artifacts from the configured release. | ||
*/ | ||
cleanArtifacts?: boolean; | ||
/** | ||
* when Cli error occurs, plugin calls this function. | ||
* webpack compilation failure can be chosen by calling invokeErr callback or not. | ||
* defaults to `(err, invokeErr) => { invokeErr() }` | ||
*/ | ||
errorHandler?: (err: Error, invokeErr: () => void) => void; | ||
/** | ||
* when Cli error occurs, plugin calls this function. | ||
* webpack compilation failure can be chosen by calling invokeErr callback or not. | ||
* defaults to `(err, invokeErr) => { invokeErr() }` | ||
*/ | ||
errorHandler?: ( | ||
err: Error, | ||
invokeErr: () => void, | ||
compilation: Compilation | ||
) => void; | ||
/** | ||
* Adds commits to sentry | ||
*/ | ||
setCommits?: SentryCliCommitsOptions; | ||
/** | ||
* Adds commits to sentry | ||
*/ | ||
setCommits?: SentryCliCommitsOptions; | ||
/** | ||
* Creates a new release deployment | ||
*/ | ||
deploy?: SentryCliNewDeployOptions; | ||
/** | ||
* Creates a new release deployment | ||
*/ | ||
deploy?: SentryCliNewDeployOptions; | ||
} | ||
} | ||
declare class SentryCliPlugin implements WebpackPluginInstance { | ||
constructor(options: SentryCliPluginOptions); | ||
options: SentryCliPlugin.SentryCliPluginOptions; | ||
constructor(options: SentryCliPlugin.SentryCliPluginOptions); | ||
apply(compiler: Compiler): void; | ||
} | ||
export default SentryCliPlugin; | ||
// We need to use this older format (over `export default SentryCliPlugin`) | ||
// because we don't want people using the plugin in their TS projects to be | ||
// forced to set `esmoduleinterop` to `true`, which the newer syntax requires. | ||
// See | ||
// https://github.com/microsoft/TypeScript-Website/blob/6a36b3137182084c76cdf133c812fe3a5626dbf0/packages/documentation/copy/en/declaration-files/templates/module.d.ts.md#L95-L106 | ||
// (linking to the docs in their raw form on GH rather than on the TS docs site | ||
// in case the docs site ever moves things around). | ||
// | ||
// Note that with this older format, no other top-level exports can exist, which | ||
// is why the exported interface above is wrapped in a namespace. See the | ||
// example in the above link and | ||
// https://github.com/microsoft/TypeScript-Website/blob/6a36b3137182084c76cdf133c812fe3a5626dbf0/packages/documentation/copy/en/declaration-files/templates/module.d.ts.md#L195-L214. | ||
export = SentryCliPlugin; |
@@ -11,3 +11,3 @@ { | ||
"author": "Sentry", | ||
"version": "1.17.1", | ||
"version": "1.17.2", | ||
"license": "MIT", | ||
@@ -25,2 +25,3 @@ "repository": "git@github.com:getsentry/sentry-webpack-plugin.git", | ||
"devDependencies": { | ||
"@types/webpack": "^4.0.0 || ^5.0.0", | ||
"codecov": "^3.5.0", | ||
@@ -27,0 +28,0 @@ "eslint": "^5.16.0", |
@@ -81,3 +81,3 @@ <p align="center"> | ||
| stripCommonPrefix | `boolean` | optional | When paired with `rewrite`, will add `~` to the `stripPrefix` array. Defaults to `false`. | | ||
| sourceMapReference | `boolean` | optional | Prevents the automatic detection of sourcemap references. Defaults to `false`. | | ||
| 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`. | | ||
| 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` | | ||
@@ -84,0 +84,0 @@ | finalize | `boolean` | optional | Determines whether Sentry release record should be automatically finalized (`date_released` timestamp added) after artifact upload. Defaults to `true` | |
module.exports = require('./index').default; | ||
// The assignment to `default` below saves us from having to use | ||
// `esModuleInterop` (which then would force our users to set the same option), | ||
// by manually doing the one part of `esModuleInterop`'s job we actually need. | ||
// | ||
// (In order to avoid a breaking change, we need to stick with default-exporting | ||
// `SentryCliPlugin`. This means that if we want to use ES6 imports (in our own | ||
// use of the plugin), our options are: | ||
// | ||
// `import * as x from y`, | ||
// `import x from y`, and | ||
// `import {default as x} from y`. | ||
// | ||
// If we use the first option, it correctly pulls in the above `module.exports` | ||
// value, but it treats it as a namespace, not a class, and therefore refuses to | ||
// let it be used with `new`. If we use either of the other two, it looks for | ||
// `module.exports.default`, which will be undefined unless either we do (or | ||
// `esModuleInterop` does) the below.) | ||
module.exports.default = module.exports; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47713
615
11