Contributing
Thanks for contributing!
Development
We manage dependencies using npm. Note that for the time being, our development tools assume a Unix-like environment, which means Mac, Linux, or something like the Windows Subsystem for Linux.
Get set up with:
$ npm run test:install
to install the root project and our test fixtures.
Checks
Run these often -- unit tests and lint:
$ npm run test
# ... or all together ...
$ npm run check
Before submitting a PR...
Before you go ahead and submit a PR, make sure that you have done the following:
$ npm run build
# Run lint and unit tests
$ npm run check
# After this, you can run the CLI tests which use real fixtures in E2E scenarios
# They're relatively slow (several seconds a test).
$ npm run test:cli
Using changesets
Our official release path is to use automation to perform the actual publishing of our packages. The steps are to:
- A human developer adds a changeset. Ideally this is as a part of a PR that will have a version impact on a package.
- On merge of a PR our automation system opens a "Version Packages" PR.
- On merging the "Version Packages" PR, the automation system publishes the packages.
Here are more details:
Add a changeset
When you would like to add a changeset (which creates a file indicating the type of change), in your branch/PR issue this command:
to produce an interactive menu. Navigate the packages with arrow keys and hit to select 1+ packages. Hit when done. Select semver versions for packages and add appropriate messages. From there, you'll be prompted to enter a summary of the change. Some tips for this summary:
- Aim for a single line, 1+ sentences as appropriate.
- Include issue links in GH format (e.g.
#123). - You don't need to reference the current pull request or whatnot, as that will be added later automatically.
After this, you'll see a new uncommitted file in .changesets like:
# ....
Untracked files:
(use "git add
.changeset/flimsy-pandas-marry.md
Review the file, make any necessary adjustments, and commit it to source. When we eventually do a package release, the changeset notes and version will be incorporated!
Creating versions
On a merge of a feature PR, the changesets GitHub action will open a new PR titled "Version Packages". This PR is automatically kept up to date with additional PRs with changesets. So, if you're not ready to publish yet, just keep merging feature PRs and then merge the version packages PR later.
Publishing packages
On the merge of a version packages PR, the changesets GitHub action will publish the packages to npm.
Manually Releasing a new version to NPM
Only for project administrators
- Update
CHANGELOG.md, following format for previous versions - Commit as "Changes for version VERSION"
- Run
npm version patch(orminor|major|VERSION) to run tests and lint, build published directories, then updatepackage.json+ add a git tag. - Run
npm publishand publish to NPM if all is well. - Run
git push && git push --tags