Contributing
Want to make a pull request? Here are some good things to know.
Setting up your editor
It’s much easier to work on this project if your editor can run these tools for you:
- TypeScript
- ESLint
- Prettier
Adding a new version
-
Add a new entry in
src/KnownTools.ts
.There’s a script that can help you do it.
npx ts-node scripts/HashUrls.ts URL...
Example:
npx ts-node scripts/HashUrls.ts https://github.com/mpizenberg/elm-test-rs/releases/download/v1.0/elm-test-rs_{linux.tar.gz,macos.tar.gz,windows.zip}
The above example assumes your shell has brace expansion. Either way, it expects several URLs: One for each platform you support. It downloads the files to memory (verifying that they exist) and hashes them. When done, it prints some JSON that you can paste into the code. Run Prettier afterwards.
-
Run
npx jest -u
to update snapshots and look them through quickly to see if they seem legit. -
Run
npx ts-node scripts/TestAllDownloads.ts update
to update one more snapshot. -
Run
npm test
to check that everything looks good. -
Make a pull request. CI will verify that your added version can be downloaded and executed on all platforms.
Adding a new tool
This is roughly the same steps as for adding a new version, but it also needs to be decided whether the tool should be included by default in elm-tooling init
. There might also be special needs for the tool that needs extra code to handle somewhere.
Making a release of elm-tooling
This is only done by people with commit access.
-
Update the version in
package-real.json
. -
Add a changelog entry in
CHANGELOG.md
. -
Run
npm test
. This is both to double-check that everything works, but also to trigger a build. The build also updates the documentation with the latest version number. -
Commit:
git commit -am 'elm-tooling-cli v1.2.3'
. -
Make a pull request, and merge it.
-
Update
main
locally and tag:git tag v1.2.3 -am 'elm-tooling-cli v1.2.3'
-
Push the tag:
git push origin v1.2.3
-
Publish to npm:
cd build && npm publish