Versioning and Publishing Packages

Publishing a new version of an existing module

To publish a new version, you need to a maintainer in both GitHub and on npm.

 

npm version <major|minor|patch> # see https://semver.org/ git push origin master --tags npm publish

Then go to GitHub and create a release. Document features, fixes, and maintenance. Consider using a tool like github-changelog-generator to help with this.

Publishing a new module

In npm, a "scope" is a prefix like "@openmrs/" or "@pih/" that goes in front of the names of your packages. So a scoped package is one named like "@openmrs/foo", whereas a package named "foo" would be unscoped.

See the documentation for scoped and unscoped packages, according to what you're trying to publish.

Creating a new organization/scope

"But wait," you wonder, "what makes PIH so special that they get their own package scope!?"

Rest easy: you too can have a package scope. You just need to create an npm organization.