batr — A “bundle and test … and repeat” library.
I’ve been tired of Webpacks excessive updates since version 5 got released, and have also been looking for a solution to do real UI browser testing for some small JavaScript and web modules. So far I’ve used Webpack for bundling scripts, tape as a test runner, and tape-run to run the same test-scripts in a browser (electron) console. But that started to halt and have issues too. So I decided to have a look at all the issues and see if I could fix some, or hopefully all. The issues I figured out I had:
I’ve seen some discussions, and even a group of people doing research on the noise that GitHub’s dependabot creates. Maybe there are better ways for this, but not having dependabot means that suddenly you have too many dependencies to fix, and the changes are too big, so you won’t manage to catch up. The noise dependabot creates is a hassle, but without it or similar stuff, your code will die. I’m learning to have less dependencies, and also archiving pet projects that has de facto died.
In addition I wanted some other features as well. Most would be possible with Webpack I guess, but I wasn’t too happy making a fragile setup even more fragile.
batr — “bundle and test … and repeat”. It’s just a collection of dependencies that I need for testing, wrapped in one dependency. That I update approximately once a month. It becomes a lightning rod for all my other libraries, limiting the exposure to dependenies version bumps. The library also holds the documentation on how you can use the different parts in combination.
So far the list contains:
And then some rollup plugins I need to make rollup do what I want:
batr-example: Small example library on the usage of batr, that also doubles as automated tests for batr. I’ve kept it separate so that all code would be as close to real life use as possible.
I’m not saying batr and batr-example is the solution, it’s just mine, and it turned out just as good as I hoped and a lot better than I feared. And it makes maintenance of my other libraries simpler. But it’s opinionated and tuned to fix my needs for my libraries which may not be yours. Just make your own that fit your needs and reuse it for all your libraries or projects that needs it.
Or maybe you have a pretty good setup already. Post the link in a comment, so I can learn some more. I’m sure I’m not the only one with this problem and a solution. And there may be far better solutions than mine =)