Hi all!
I’ve mentioned this in a few places already, and now it’s time for a more official announcement!
I’ve been working on elm-json
, a tool for making elm.json
management a little easier. Most of the current features are based on having a good version constraint solver, so it can offer somewhat helpful information when things go wrong.
Quick overview
USAGE:
elm-json [FLAGS] <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
-v, --verbose Sets the level of verbosity
SUBCOMMANDS:
help Prints this message or the help of the given subcommand(s)
install Install a package
new Create a new elm.json file
uninstall Uninstall a package
upgrade Bring your dependencies up to date
Installation
npm i -g elm-json
What does it do?
It aims to make it easier to do fairly common things:
- installing a specific version of a dependency (e.g.
elm-json install elm/http@2.0.0
) - removing dependencies and their indirect dependencies (e.g.
elm-json uninstall foo/bar
) - upgrading all your dependencies to their latest version with the same major version number (
elm-json upgrade
) - or upgrading while crossing major version boundaries (
elm-json upgrade --unsafe
)
Additionally, it also exposes some of the version solver for reuse in other tools. Specifically node-test-runner
could benefit from this, to create a complete dependency graph given an elm.json
for either a package or application, and ending up with a concrete set of direct
and indirect
dependencies with the test-dependencies
in there as well.
It can also choose versions to be minimal rather than the default “newest versions that satisfy the constraints”, which could enable elm-test
to test packages with both version at the lower end of the bounds as well as the higher end!
Show me the goods!
Okay, demoing a CLI isn’t that exciting. But hey, let’s see what happens when I try to upgrade the elm.json
for an app!
Cool! How about major upgrades?
That seems to work, too!
Disclaimer
It’s still pretty new, and I’m still pretty new to Rust. It should not write to your files (except its own cache file) without permission, so it should be relatively safe to use, but if it ends up breaking in to your freezer and eating all your ice cream, please don’t scream at me. However, do log issues when things go wrong! -> https://github.com/zwilias/elm-json