Publishing

Types of Versions

Semver versioning is used. As an overview:

  • A major version is when a incompatible API change is made.
  • A minor version is when a functionality is added in a backwards-compatible manner.
  • A patch version is when a backward-compatible bug fix is made.

Version numbers should follow the pattern MAJOR.MINOR.PATCH

Branching Strategy

There is 1 main branch master where changes should be published from.

Pull Request process:

  • Open Pull Request in Github
  • Have 2 people (a member each from Core and Continuum) review and approve the changes
  • Use Github to merge Pull Request

How to Publish

The library publishes to npmjs.com. Login is required, either with the VersionOne account or with an existing account that is linked to our org.

Be sure to Login using npm login before attempting to publish.

Publishing Major, Minor, and Patch Versions

Feature branches should be merged into master before publishing from master. Upon merging to master, create a production build and publish with the following:

NODE_ENV=production yarn build
yarn lerna publish {major|minor|patch}

If you forget to Login using npm login before the above, you can publish directly from the current commit.

yarn lerna publish from-git

Canary Releases

Occassionaly there may be changes that we want sooner than waiting for a new version publish. These "canary" releases (read more) may be made for any given version and provide a way to release experimental features to consumers before an official publish. An example of publishing a canary release:

NODE_ENV=production yarn build
yarn lerna publish --canary {preminor|prepatch}
# or for a major version
yarn lerna publish --canary premajor

Publishing the Site

This step is currently set to Deploy Automatically

A deployment preview of the docs site gets published on every Pull Request as well as every merge to master and next.

You can find a link to the build site in the Pull Request details (upon successfully passing all tests)

However, to publish a new release of the site, instead of a preview deployment, you'll need to follow these steps:

  1. Log into netlify.
  2. Navigate to the versionone-components project
  3. On project overview, scroll to "Production Deploys" and click on the desired production build.
  4. Click the "Publish Deploy" button in the first box

Trouble Shooting Common Issues

Unsucessful Publish to NPM

If you forget to Login using npm login before the above, you can publish directly from the current commit.

yarn lerna publish from-git

Remove git tag

git tag -d v0.0.1

git push origin :refs/tags/v0.0.1

Revert a Publsh to the NPM Registry

This can only be done within 72 hours. See this article for more details.

Netlify site is down

While publishing the site, the current netlify site (https://versionone-components.netlify.com) will be down for approximately 30 minutes.

Additional Resources