4.0.1 • Published 8 years ago

@quarterto/heroku-version-infer v4.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

heroku-version-infer

infers app versions for automatic heroku deploys

npm install --save @quarterto/heroku-version-infer
{
  "name": "my-awesome-heroku-app",
  "version": "0.0.0-development",
  "scripts": {
    "postinstall": "heroku-version-infer"
  }
}

why

because you want to tag versions for things like error reporting, QA, Tim writing on whiteboards, but you don't want to manually tag things. heroku-version-infer comes up with an arbitrary monotonically increasing version number automatically, so you don't have to.

how

the version number is the number of merge commits into the history of the deployed commit. if you have Github branch protection, there will be no code changes on master without an associated merge, so a particular version will always contain the same code. this number will increase if and only if there are code changes, which is exactly what we need from a version number.

this assumption breaks down with Heroku review apps, where multiple concurrent branches with the same number of merges may be deployed at the same time. to disambiguate in this case, the first 7 characters of the commit hash are appended to the version.

the inferred version is written to the version field in package.json. you're probably already used to writing require('../package.json').version.

licence

mit

4.0.1

8 years ago

4.0.0

8 years ago

3.2.3

8 years ago

3.2.2

8 years ago

3.2.1

8 years ago

3.2.0

8 years ago

3.1.0

8 years ago

3.0.0

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

1.0.0-pre

8 years ago