-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SDK version into volatile #232
Conversation
samniisan
commented
Jun 16, 2017
- Adds the current version of the SDK into volatile for every Kuzzle query.
- Modified webpack config to integrate the version at build time.
Codecov Report
@@ Coverage Diff @@
## 5.x #232 +/- ##
==========================================
+ Coverage 98.41% 98.69% +0.28%
==========================================
Files 17 17
Lines 2142 2449 +307
Branches 609 725 +116
==========================================
+ Hits 2108 2417 +309
+ Misses 34 32 -2
Continue to review full report at Codecov.
|
src/Kuzzle.js
Outdated
@@ -198,6 +198,10 @@ function Kuzzle (host, options, cb) { | |||
value: undefined, | |||
enumerable: true, | |||
writable: true | |||
}, | |||
sdkVersion: { | |||
value: (typeof SDKVERSION === 'undefined') ? JSON.parse(require('fs').readFileSync('package.json', {encoding: 'utf-8'})).version : SDKVERSION, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can require a JSON file directly:
value: (typeof SDKVERSION === 'undefined') ? require('../package.json').version : SDKVERSION
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
63ec213
to
9a1db7e
Compare