File tree 3 files changed +14
-3
lines changed
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) {
261
261
// Custom Grunt tasks
262
262
grunt . registerTask ( 'version' , function ( ) {
263
263
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
+
264
272
if ( grunt . option ( 'dev' ) ) {
265
273
pkg . release = 'dev' ;
266
- pkg . version = grunt . config . get ( 'gitinfo' ) . local . branch . current . shortSHA ;
267
274
} else {
268
275
pkg . release = pkg . version ;
269
276
}
Original file line number Diff line number Diff line change 11
11
"type" : " git" ,
12
12
"url" : " git://github.com/getsentry/raven-js.git"
13
13
},
14
- "main" : " dist/raven .js" ,
14
+ "main" : " src/singleton .js" ,
15
15
"devDependencies" : {
16
16
"browserify-versionify" : " ^1.0.6" ,
17
17
"chai" : " 2.3.0" ,
Original file line number Diff line number Diff line change @@ -68,7 +68,11 @@ function Raven() {
68
68
*/
69
69
70
70
Raven . 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' ,
72
76
73
77
debug : false ,
74
78
You can’t perform that action at this time.
0 commit comments