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 @@ -258,9 +258,16 @@ module.exports = function(grunt) {
258
258
// Custom Grunt tasks
259
259
grunt . registerTask ( 'version' , function ( ) {
260
260
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
+
261
269
if ( grunt . option ( 'dev' ) ) {
262
270
pkg . release = 'dev' ;
263
- pkg . version = grunt . config . get ( 'gitinfo' ) . local . branch . current . shortSHA ;
264
271
} else {
265
272
pkg . release = pkg . version ;
266
273
}
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 @@ -71,7 +71,11 @@ function Raven() {
71
71
*/
72
72
73
73
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' ,
75
79
76
80
debug : false ,
77
81
You can’t perform that action at this time.
0 commit comments