r/learnjavascript • u/Accurate-Screen8774 • 14d 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?
View all comments
1
u/DickBrainTime 13d ago
The part I'd decide before automating releases is your public compatibility contract: which import paths are supported (package exports), ESM-only vs ESM+CJS, whether TypeScript types resolve correctly, and your minimum Node/browser versions. If this framework wraps another library, think about whether it belongs in peerDependencies so consumers don't end up with two copies of the runtime.
CI can build and test every commit, but I wouldn't publish to npm on every merge while the API is still moving. Make publishing a deliberate, versioned release step. Add a small consumer fixture that imports the package and type-checks it in each module format you claim to support. That tends to catch compatibility breaks earlier than tests inside the framework repo. Is this meant for Node, browsers, or both?