Release notes v0.0.180

Quite a big release after the holiday season. Packed with features, breaking changes and the most likely bugs. Looking back at the past year of Compas features, we see a bunch of additions to existing features, making them more complete, a bunch of bug fixes, better docs and, of course, some new features. We started to promote development with the TypeScript Language Server even for JavaScript only projects. Cleaned up code generation by outputting each group in its own directory. Got an OpenAPI exporter, parallelized the test runner, added a config loader. And now start the new year fresh with a CLI refactor.

CLI

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.

Breaking changes

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 generate is 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 run should use --script-args "--arg 1 --foo".
  • Removed --watch completely and thus any export of cliWatchOptions can 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 migrate instead of compas docker migrate.
  • compas docker reset is removed and instead compas docker clean --project should be used.
  • compas coverage is removed in favor of compas test --coverage. It also doesn't accept C8 arguments anymore. See compas test --help for 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.

In closing

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 😃