Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,16 @@ module.exports = function(grunt) {
// Custom Grunt tasks
grunt.registerTask('version', function() {
var pkg = grunt.config.get('pkg');

// Verify version string in source code matches what's in package.json
var Raven = require('./src/raven');
if (Raven.prototype.VERSION !== pkg.version) {
return grunt.util.error('Mismatched version in src/raven.js: ' + Raven.prototype.VERSION +
' (should be ' + pkg.version + ')');
}

if (grunt.option('dev')) {
pkg.release = 'dev';
pkg.version = grunt.config.get('gitinfo').local.branch.current.shortSHA;
} else {
pkg.release = pkg.version;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "git://github.com/getsentry/raven-js.git"
},
"main": "dist/raven.js",
"main": "src/singleton.js",
"devDependencies": {
"browserify-versionify": "^1.0.6",
"chai": "2.3.0",
Expand Down
6 changes: 5 additions & 1 deletion src/raven.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ function Raven() {
*/

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

debug: false,

Expand Down