Skip to content

Commit d69f074

Browse files
committed
Merge pull request #470 from getsentry/GH-465
Hardcode version string in src/raven.js (fixes GH-465)
2 parents f2a64bd + fb407bc commit d69f074

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Diff for: Gruntfile.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,16 @@ module.exports = function(grunt) {
258258
// Custom Grunt tasks
259259
grunt.registerTask('version', function() {
260260
var pkg = grunt.config.get('pkg');
261+
262+
// Verify version string in source code matches what's in package.json
263+
var Raven = require('./src/raven');
264+
if (Raven.prototype.VERSION !== pkg.version) {
265+
return grunt.util.error('Mismatched version in src/raven.js: ' + Raven.prototype.VERSION +
266+
' (should be ' + pkg.version + ')');
267+
}
268+
261269
if (grunt.option('dev')) {
262270
pkg.release = 'dev';
263-
pkg.version = grunt.config.get('gitinfo').local.branch.current.shortSHA;
264271
} else {
265272
pkg.release = pkg.version;
266273
}

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"type": "git",
1212
"url": "git://github.com./getsentry/raven-js.git"
1313
},
14-
"main": "dist/raven.js",
14+
"main": "src/singleton.js",
1515
"devDependencies": {
1616
"browserify-versionify": "^1.0.6",
1717
"chai": "2.3.0",

Diff for: src/raven.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ function Raven() {
7171
*/
7272

7373
Raven.prototype = {
74-
VERSION: '__VERSION__',
74+
// Hardcode version string so that raven source can be loaded directly via
75+
// webpack (using a build step causes webpack #1617). Grunt verifies that
76+
// this value matches package.json during build.
77+
// See: https://github.com./getsentry/raven-js/issues/465
78+
VERSION: '2.0.0',
7579

7680
debug: false,
7781

0 commit comments

Comments
 (0)