Skip to content

Commit 34a87d0

Browse files
committed
Hardcode version string in src/raven.js (fixes GH-465)
1 parent f2a64bd commit 34a87d0

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

Gruntfile.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,11 @@ module.exports = function(grunt) {
258258
// Custom Grunt tasks
259259
grunt.registerTask('version', function() {
260260
var pkg = grunt.config.get('pkg');
261-
if (grunt.option('dev')) {
262-
pkg.release = 'dev';
263-
pkg.version = grunt.config.get('gitinfo').local.branch.current.shortSHA;
264-
} else {
265-
pkg.release = pkg.version;
261+
var Raven = require('./src/raven');
262+
if (Raven.prototype.VERSION !== pkg.version) {
263+
return grunt.util.error('Mismatched version in src/raven.js: ' + Raven.prototype.VERSION +
264+
' (should be ' + pkg.version + ')');
266265
}
267-
grunt.config.set('pkg', pkg);
268266
});
269267

270268
grunt.registerMultiTask('fixSourceMaps', function () {

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",

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)