Thumbprint is a collection of small packages that are versioned independently and follow Semantic Versioning. We use Lerna to automate most of the package release process, but there are still some manual steps.
The following users have credentials to publish packages to npm:
This list ordered based on experience releasing packages and contributing to Thumbprint.
Run yarn npm whoami
. You’ll be able to publish packages if the user npm returns is a collaborator for the packages on Thumbtack’s npm org.
git checkout master && git pull
Checks out master
and pulls latest code.
yarn updated
Shows which packages have unreleased changes.
This command will occasionally list private packages such as www
. It is a bug in Lerna, the tool we use to publish our packages. You can safely ignore the packages that are listed as private.
Open the CHANGELOG.md
files for each package with unreleased changes.
For each package, add the new version number and the date above the list of unreleased changes. Use the Semantic Versioning specification to determine the new version number. The new version number will be based on the highest severity unreleased change.
It is possible that a developer forgot to add a changelog entry in their PR or, more likely, one of the package's dependencies is going to receive a version bump. A change to the @thumbtack/thumbprint-scss
package, for example, will trigger a version bump in @thumbtack/thumbprint-atomic
since Thumbprint Atomic depends on Thumbprint SCSS. In that case, add a new entry to the changelog that addresses the version bump in the dependency.
You should also look at the folder's git history to ensure that a developer did not forget to list their change in the changelog. If they did, you should go ahead and add the change to the changelog.
git add .
Stage all changes.
git commit -m "Update CHANGELOG for package release"
Commit all changes.
yarn publish
You'll be prompted to select the new version numbers for each package.
Use the version numbers that you chose in step #3.
yarn install && git add yarn.lock && git commit -m "Update lockfile" && git push
For some reason the lockfile gets out of sync after publishing, so run this command to update it, or the build will start failing.
Private packages such as www
will occasionally appear here. It is a bug in Lerna, the tool we use to publish our packages. Choose "Patch" for these packages.
The documentation is automatically deployed to Netlify when a PR is merged into the master
branch.
Run yarn npm whoami
. You’ll be able to publish if the user npm returns is a collaborator for the packages on Thumbtack’s npm org.
- Run
git checkout [branch-name]
to navigate to the branch that contains the changes you'd like to release. - Navigate to the package with
cd packages/[package-name]
. - Edit the
version
in the package'spackage.json
file. A package that is currently at2.1.3
which includes aMinor
beta change would become2.2.0-beta.0
. If2.2.0-beta.0
was already published, then increment the final digit. Save the file. - Run
yarn npm publish --tag beta
. It will use the version number you just added topackage.json
. - Undo the
package.json
version number change.