@sentry/webpack-plugin
Advanced tools
Comparing version 1.8.1 to 1.9.0
# Changelog | ||
## v1.9.0 | ||
- feat: Add `setCommits` options (#139) | ||
- chore: Add `TypeScript` definition file (#137) | ||
- meta: Bump sentry-cli to `1.48.0` | ||
## v1.8.1 | ||
@@ -4,0 +10,0 @@ |
@@ -11,3 +11,3 @@ { | ||
"author": "Sentry", | ||
"version": "1.8.1", | ||
"version": "1.9.0", | ||
"license": "MIT", | ||
@@ -17,2 +17,3 @@ "repository": "git@github.com:getsentry/sentry-webpack-plugin.git", | ||
"main": "src/index.js", | ||
"types": "index.d.ts", | ||
"engines": { | ||
@@ -22,3 +23,4 @@ "node": ">= 6.0.0" | ||
"dependencies": { | ||
"@sentry/cli": "^1.47.1" | ||
"@sentry/cli": "^1.48.0", | ||
"snyk": "^1.231.0" | ||
}, | ||
@@ -34,3 +36,4 @@ "devDependencies": { | ||
"prettier": "^1.18.2", | ||
"prettier-check": "^2.0.0" | ||
"prettier-check": "^2.0.0", | ||
"webpack": "^4.39.3" | ||
}, | ||
@@ -47,4 +50,7 @@ "scripts": { | ||
"test:watch": "jest --watch --notify", | ||
"codecov": "codecov" | ||
} | ||
"codecov": "codecov", | ||
"snyk-protect": "snyk protect", | ||
"prepublish": "npm run snyk-protect" | ||
}, | ||
"snyk": true | ||
} |
@@ -112,3 +112,9 @@ <p align="center"> | ||
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 | ||
You can find more information about these options in our official docs: | ||
https://docs.sentry.io/cli/releases/#sentry-cli-sourcemaps |
@@ -12,2 +12,3 @@ /*eslint-disable*/ | ||
proposeVersion: jest.fn(() => Promise.resolve()), | ||
setCommits: jest.fn(() => Promise.resolve()), | ||
}, | ||
@@ -230,2 +231,45 @@ }; | ||
}); | ||
test('test setCommits with commits range', done => { | ||
const sentryCliPlugin = new SentryCliPlugin({ | ||
include: 'src', | ||
release: '42', | ||
commit: '4d8656426ca13eab19581499da93408e30fdd9ef', | ||
previousCommit: 'b6b0e11e74fd55836d3299cef88531b2a34c2514', | ||
repo: 'group / repo', | ||
// auto, | ||
}); | ||
sentryCliPlugin.apply(compiler); | ||
setImmediate(() => { | ||
expect(mockCli.releases.setCommits).toBeCalledWith('42', { | ||
repo: 'group / repo', | ||
commit: '4d8656426ca13eab19581499da93408e30fdd9ef', | ||
previousCommit: 'b6b0e11e74fd55836d3299cef88531b2a34c2514', | ||
}); | ||
expect(compilationDoneCallback).toBeCalled(); | ||
done(); | ||
}); | ||
}); | ||
test('test setCommits with auto option', done => { | ||
const sentryCliPlugin = new SentryCliPlugin({ | ||
include: 'src', | ||
release: '42', | ||
repo: 'group / repo', | ||
auto: true, | ||
}); | ||
sentryCliPlugin.apply(compiler); | ||
setImmediate(() => { | ||
expect(mockCli.releases.setCommits).toBeCalledWith('42', { | ||
repo: 'group / repo', | ||
auto: true, | ||
}); | ||
expect(compilationDoneCallback).toBeCalled(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -232,0 +276,0 @@ |
@@ -154,2 +154,6 @@ const SentryCli = require('@sentry/cli'); | ||
}, | ||
setCommits: (release, config) => { | ||
this.outputDebug('Calling set-commits with:\n', config); | ||
return Promise.resolve(release, config); | ||
}, | ||
}, | ||
@@ -321,2 +325,14 @@ }; | ||
.then(() => this.cli.releases.uploadSourceMaps(release, this.options)) | ||
.then(() => { | ||
const { commit, previousCommit, repo, auto } = this.options; | ||
if (repo && (commit || auto)) { | ||
this.cli.releases.setCommits(release, { | ||
commit, | ||
previousCommit, | ||
repo, | ||
auto, | ||
}); | ||
} | ||
}) | ||
.then(() => this.cli.releases.finalize(release)) | ||
@@ -323,0 +339,0 @@ .catch(err => |
38952
16
863
120
2
10
+ Addedsnyk@^1.231.0
+ Added@sentry-internal/tracing@7.118.0(transitive)
+ Added@sentry/core@7.118.0(transitive)
+ Added@sentry/integrations@7.118.0(transitive)
+ Added@sentry/node@7.118.0(transitive)
+ Added@sentry/types@7.118.0(transitive)
+ Added@sentry/utils@7.118.0(transitive)
+ Addedboolean@3.2.0(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addeddetect-node@2.1.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes6-error@4.1.1(transitive)
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedglobal-agent@3.0.0(transitive)
+ Addedglobalthis@1.0.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedimmediate@3.0.6(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedlie@3.1.1(transitive)
+ Addedlocalforage@1.10.0(transitive)
+ Addedmatcher@3.0.0(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedroarr@2.15.4(transitive)
+ Addedsemver@7.6.2(transitive)
+ Addedsemver-compare@1.0.0(transitive)
+ Addedserialize-error@7.0.1(transitive)
+ Addedsnyk@1.1292.1(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedtype-fest@0.13.1(transitive)
Updated@sentry/cli@^1.48.0