File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -261,9 +261,16 @@ module.exports = function(grunt) {
261261 // Custom Grunt tasks
262262 grunt . registerTask ( 'version' , function ( ) {
263263 var pkg = grunt . config . get ( 'pkg' ) ;
264+
265+ // Verify version string in source code matches what's in package.json
266+ var Raven = require ( './src/raven' ) ;
267+ if ( Raven . prototype . VERSION !== pkg . version ) {
268+ return grunt . util . error ( 'Mismatched version in src/raven.js: ' + Raven . prototype . VERSION +
269+ ' (should be ' + pkg . version + ')' ) ;
270+ }
271+
264272 if ( grunt . option ( 'dev' ) ) {
265273 pkg . release = 'dev' ;
266- pkg . version = grunt . config . get ( 'gitinfo' ) . local . branch . current . shortSHA ;
267274 } else {
268275 pkg . release = pkg . version ;
269276 }
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -68,7 +68,11 @@ function Raven() {
6868 */
6969
7070Raven . prototype = {
71- VERSION : '__VERSION__' ,
71+ // Hardcode version string so that raven source can be loaded directly via
72+ // webpack (using a build step causes webpack #1617). Grunt verifies that
73+ // this value matches package.json during build.
74+ // See: https://github.com/getsentry/raven-js/issues/465
75+ VERSION : '2.0.0' ,
7276
7377 debug : false ,
7478
You can’t perform that action at this time.
0 commit comments