For publishing Infusion as an NPM module, it would be useful to provide a script for automating the task. Publishing a release to npm should be as easy as running npm publish, however publishing a dev build will take some more work, which is why the script is needed.
The script should be able to do the following:
1) Update the package.json to have the correct version number
2) publish to NPM
3) add the "dev" dist-tag
4) clean up package.json (reset to head).
Unfortunately NPM doesn't respect semver's notion of build releases (+buildID). To work around this we will publish dev builds using the following version format.
The date portion is to ensure that the builds are ordered correctly as the commit hash is random. The date format use the ISO8601 format at yyyymmddThhmmssZ where time is in UTC.
To get the shorthand of the commit hash use
git rev-parse --verify --short HEAD
To get the UNIX timestamp
git show -s --format=%ct <mytagname>^