Release notes v0.0.180
The CLI got quite the overhaul, with a few focus areas.
Improve discovery and documentation:
The new Compas CLI is now fully explorable by using
compas help [...command] or
compas [...command] --help. Resulting in a list of available sub commands and a list of flags with their types and descriptions. This also allowed us to create a full CLI reference.
Improve command and flag parsing:
Invalid inputs are now consistently handled by the command and flag parser. Giving suggestions of available sub commands, and allowing custom validators to directly validate flag values, so we can guide the user in successfully executing the command they need.
Restructure commands to be more focused:
Over time, we added quite a bunch of features. But sometimes they were not logically grouped. Take for example
compas docker migrate. Migration doesn't have anything to do with the management of docker containers, so we refactored it in a
compas migrate. Which also allows better documentation of the
--connection-settings flag. Another notable change here is that
compas coverage is now
compast test --coverage, since it is executing in exactly the same way.
This is an incomplete list of breaking changes of the Compas CLI. Please verify all your usages.
- Implicit run of scripts is removed. So
compas generateis now
compas run generate. To get the old behaviour, upgrade your script to a project level CLI command via extending the CLI.
- Passing arguments to scripts via
compas runshould use
--script-args "--arg 1 --foo".
--watchcompletely and thus any export of
cliWatchOptionscan be removed as well. This will come back in a future version of Compas, but most likely in another format.
- Migrating should be done via
compas migrateinstead of
compas docker migrate.
compas docker resetis removed and instead
compas docker clean --projectshould be used.
compas coverageis removed in favor of
compas test --coverage. It also doesn't accept C8 arguments anymore. See
compas test --helpfor more information.
Other notable features
We now support react-query@v4. It requires all (parts of) query keys to be an array. To do this, the
.baseKey function on generated hooks now also returns an array.
The default log middleware injected by
getApp from @compas/server, now has some options to log the event name if available. Since all communications of routes are based on the route group and name, this should make it easier to find logs about that route.
The generated query builder now uses a generator helper provided by @compas/store. This makes the generated output much cleaner, and improves the maintainability of the generator. It also migrated to use correlated sub-queries which should be as fast or even faster than the lateral joins used previously. This change is however breaking for if you used
execRaw, so make sure to check the query output and update your code accordingly.
I am quite happy with the progress last year, and in the last weeks with the new CLI. The docs are getting slowly but surely some more content, so the experience should only get better. All the best for the new year and as always, keep on generating 😃