Skip to content

Instantly share code, notes, and snippets.

@m00s
Last active October 12, 2015 21:28
Show Gist options
  • Save m00s/368fcedcca6b3e84cfbc to your computer and use it in GitHub Desktop.
Save m00s/368fcedcca6b3e84cfbc to your computer and use it in GitHub Desktop.
Bower and npm package versioning

Versioning

Bower / Node

Bower Npm (semver) version
bower version <X.Y.Z> npm version <X.Y.Z> X.Y.Z
bower version patch npm version patch 0.0.X
bower version minor npm version minor 0.X.0
bower version major npm version major X.0.0

This will also create a version commit and tag, and fail if the repo is not clean.

NOTES:

  • Given a version number MAJOR.MINOR.PATCH, increment the:

    • MAJOR version when you make incompatible API changes
    • MINOR version when you add functionality in a backwards-compatible manner
    • PATCH version when you make backwards-compatible bug fixes.
  • Version 1.0.0 defines the public API. The way in which the version number is incremented after this release is dependent on this public API and how it changes.

  • A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version.

Flow

  • Bower Issue a version command, then public with git push --tags
  • Node Issue a version command, then npm publish
  • Bower and Node
    1. Manually update version in bower.json and package.json files and commit the changes
    2. Tag the repo git tag -a vX.Y.Z -m 'Release version X.Y.Z'
    3. Then git push --tags and npm publish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment