Build Status


Tidepool data visualization for diabetes device data.

This README is focused on just the nuts & bolts of getting the code in this repository ready to develop locally in blip or with React Storybook. For more detailed information about the code in this repository, please see the developer guide.

Table of contents

Getting started

After cloning this repository to your local machine, first make sure that you have a version of npm that is recent enough - at least 3.x. We are still using node 0.12.x for our engine, and a 3.x version of npm does not get installed by default if you are installing node 0.12.x through a mechanism like nvm. In this case, you will need to manually update with:

$ npm install -g npm

Then, install the dependencies:

$ npm install


Running locally with blip

To work on code in this repository within blip, first do the following from your local blip repository (assuming blip/ and viz/ are sister directories):

$ npm link ../viz/

In this repository, start the build in watch mode:

$ npm start

Finally, back in your local blip repository, follow the instructions for starting blip locally.

Running locally in React Storybook

If you're working at the component or view level outside of blip, you can work on component and view rendering code with React Storybook. Just start up the storybook with:

$ npm run storybook

Running the tests

To run the unit tests in PhantomJS (as they run on Travis CI):

$ npm test

To have the tests run continuously with source and test code changes rebundled as you work:

$ npm run test-watch

To run the unit tests in your local Chrome browser (recommended for Tidepool developers before merging or publishing a release):

$ npm run browser-tests

Running the linter

To run the code linter from the command line:

$ npm run lint


Publishing examples to GitHub Pages with React Storybook

Coming soon!

Building and publishing to npm

When a new feature(s) is/are complete (i.e., branch is synchronized with master, reviewed with a sign-off from another developer), it's time to publish the package to npm! Since this is one of our most recently created repositories, any member of the "developers" team in the @tidepool npm organization will be able to publish the package using his or her npm login. Steps to publishing are as follows:

  1. create a tag on the approved pull request using the mversion tool with the -m option to auto-commit the version bump and tag (e.g., $ mversion patch -m for a patch version bump)
  2. push the new commit and tag to the GitHub remote with $ git push origin <branch-name> and $ git push origin --tags
  3. check that the tag build has passed on TravisCI
  4. $ npm whoami to check if you are logged in as yourself; if you are, skip to 8.
  5. if you are logged in as tidepool-robot, log out with $ npm logout
  6. then log in as yourself with $ npm login
  7. publish the new version with $ npm publish; before the actual publish happens, the linter, tests, and packaging webpack build will run since we have set those up through the prepublish npm hook in the package.json
  8. merge the approved pull request to master
  9. remember to bump the version appropriately in the package.json for the app (e.g., blip) requiring @tidepool/viz as a dependency!