-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quality of Life Improvements for Development and Publication Workflow #14
Conversation
Thanks for PR. Overall it looks great! But I'll need some to read it through and setup env vars. It will probably take a couple of days |
@11bit thanks for checking. Take your time. |
Thanks @vnphanquang! This is really helpful! The only thing I changed is removing codecov and test matrix for now |
Excellent @11bit. Thanks a lot. Looks like the changeset worflow is in order. FYI the "Releases" section isn't switched on for the repo but if that's by choice please ignore my comment. |
Hello all, this PR adds a handful of things with the hope of improving the dev and publication workflow. Please note:
Note
Everything is just a proposal. Please feel free to reject or comment. I am happy to follow up / drop unwanted changes.
Each commit is well scoped to a particular change so please feel free to review one individual commit at a time. Some notable changes are as follow.
Development Workflow
4f3d621 sets up lefthook (quite fitting as it is also from @evilmartians), and some explicit fmt rules in
deno.json
. This will help keeping code style consistent going forward.Versioning & Publication
9c98741 sets up changesets for versioning and automatic publication to NPM. I also added to README a reference for a suggested dev & publication workflow.
Important
The new
changesets
workflow requires 2 updates to the repo settings:NPM_TOKEN
repo secret, which might already be there judging by thepublish.yml.disabled
workflow. Anyway this token requires sufficient permission, i suggest a "classic" token of "Automation" type from NPM settings.Additionally, 1419ab0 sets up package provenance, which should give it a bit more credibility in the npm registry.
Tests
376f9e6 adds a test workflow that triggers by changes to relevant files on
push
or PR tomain
. It also uploads code coverage report and test results to Codecov. The project is simple enough for now that I don't think this is strictly necessary, but I figured while I was at it, might as well set it up anyway. Added via f5b7352 is a badge showing code coverage percentage - helpful as a quick glance indicator of project health.Happy to remove this out if you think it's unnecessary. Just let me know.
Important
If you decide to keep the Codecov upload, the new
tests
workflow requires aCODECOV_TOKEN
which you can get after setting up Codecov for the repo.Package Exports
290fcd9 adds publint to check against package exports. I also made some changes to the exports, specifically setting package as ESM-first (type: module) since the ecosystem is going that way. Some changes are also based on recommendation from publint: https://publint.dev/@evilmartians/[email protected]
Deno 2
Along the way, especially in 7cd1365, I updated the dependency strategy to utilize Deno 2 support for JSR and Node-compat.
Thanks all.