This document describes the process for contributing and releasing features to vanilla-tree-viewer
.
This project uses semantic versioning. Example:
v1.2.5
Larger releases may also be released as a beta
release (also called "pre-release") to preview changes before they are committed to master
. beta
releases are numbered sequentially for a specific version.
Example:
v1.2.5-beta.1
v1.2.5-beta.2
v1.2.5-beta.3
...
All MAJOR
and MINOR
versions use a version development branch.
E.g.
dev-v2.0.0
dev-v2.1.0
If one does not exist, you may create a new one branched from master
, and then further branch your feature from that.
git checkout master
git pull
git checkout -b dev-v2.1.1
git push origin dev-v2.1.1
git checkout -b my-feature-branch
Any new feature you add should
- branch from the
dev-*
branch and - target the
dev-*
as the merge target for Pull Requests
Features containing PATCH
releases can be branched directly from master
and can be merged directly into master
.
git checkout master
git pull
git checkout -b my-feature-branch
This project uses np
to publish
to npm
.
Install np
globally:
yarn global add np
On the dev-*
branch:
- Search the project for all references to the current version. Manually update
README.md
and other files to the new version (e.g.2.1.2
,2.1.3-beta.3
) - Ignore the
dist/*
,docs/*
, andyarn.lock
files/directories. This will be regenerated. - Ignore
package.json
as well. That will be updated bynp
itself when it publishes tonpm
- Run
yarn run build
to update the build - Commit all the above changes with the message "Preparing to update to
X.Y.Z
". (example commit) - Push up the branch:
git push origin dev-v2.1.0
Merge the dev-*
to master
if you are NOT deploying a beta-*
version.
git checkout master
git merge --no-ff dev-v2.1.0 -m 'Merging changes for `2.1.0`'
git push origin master
Create a new version from the dev-*
branch by running:
git checkout dev-v2.0.0
git pull
np 2.1.0-beta.1 --any-branch
Prepare release notes for this version, following the guide of previous notes on the Changelog. You can ignore non-code related changes like updates to the README
or other documentation.
Create a new version from master
by running:
git checkout master
git push origin master
np 2.1.0
At the end it will open up a window to compose a new release. Use the release notes generated above to create a new release.
Update the codepen to reference the newly released version (non-beta
versions only).