r/learnjavascript • • 15d ago

Publishing a JS framework

Im working on a project for myself. Its an unreviewed, unaudited and far from finished. It started of as a person curiosity and evolved from there.

Im asking because if i publish something on NPM, there are strict controls around versioning for which i havent burdened myself on my own projects (but clearly important when making something for a wider community). I also wonder if im overlooking any other details.

I wonder what best practices there are for something like this. Should i be publishing new versions with CI/CD? Are there any tips or advice on doing this in the modern js package ecosystem?

6 Upvotes

8 comments sorted by

View all comments

3

u/GiggleSamurai 15d ago

Publish it as 0.x: under semver a 0.y.z version means the API can still change at any time, so you aren't locking yourself in, and check `npm pack --dry-run` (or set the `files` field) so only the built code ships. A version number can only ever be published once, so publishing from CI on a git tag (GitHub Actions with npm trusted publishing) keeps your tags, changelog and npm in sync.

1

u/Shamonda-Pflugpeil 7d ago

automating the publish on git tags saves so many headaches down the road tbh.