Closed dirkdev98 closed 5 months ago
The time has come, we are going full steam ahead in to framework mode. Starting a new Compas project from scratch currently involves a lot of boilerplate. Looking at the with-auth template, 7 folders and many more files just to run code generation, an api, a queue worker and of course tests. Most of it is just wiring things up in one of the few ways possible. We can do that automatically as well.
What if you could just run compas
in your terminal and get all manual labor done automatically. It will do the correct thing for libraries, backends and even in frontend projects. Managing the required docker containers. Automatically generating, without busting lint and build caches. Keeping track of which order of tests fail when running compas test --randomize-rounds 3
so you can debug that flaky situation.
Not every backend is the same of course. Some require a different Postgres version. Others connect to external api's and would prefer to use code-gen compatible with OpenAPI specs. And we understand that you don't want to rewrite your existing backends to folder based routing. This means that we are slowly going move things in to the compas
package and keep a lot of things configurable with sensible defaults.
The first change in this direction has already been started. We are going to purpose the compas
package for the new CLI. It will contain a new (temporary) CLI called zakmes
, which will directly showcase the new terminal user interface (TUI) of the dev server. We will slowly expand its functionality, either by using the existing CLI or taking over it's functionality.
We are aiming for the following behaviour...
... in development
> compas
Loaded config...
Generating...
Launching prerequisites...
Starting watcher...
Waiting on syntax error in `src/foo/bar.js`...
Files are waiting to be linted...
# Input: L
Running the linter for 5 files...
All files are up-to-date.
... in CI
> compas
Loaded config...
Generating...
Launching prerequisites...
Running linter...
Running tets...
Done!
... in production
> compas prod
Loaded config...
Generating...
Starting api...
Starting queue...
# Or
> compas prod api
Loaded config...
Generating...
Starting api...
The road up ahead is exciting! There will be some bumps and breaking changes for sure. But the result should be faster, better integrated and most importantly more stable to build on.
Tracking issue to make a Compas framework. For the why and how, check out https://github.com/compasjs/compas/issues/2774#issuecomment-1666451372
zakmes
CLI kind-of usablecompas
as dev dependencynpx -p compas zakmes init
auto-install as prod dependency$pkg install
compas docker
commandszakmes init docker
and related commands. We want people to use thezakmes
CLI in a variety of scenario's. So we shouldn't automatically boot up Docker in any scenario, like for example a frontend project.compas lint
zakmes init lint
zakmes init migrations
to add@compas/store
&migrations/.gitkeep
@compas/store
is installed and amigrations
dir exists.sql
&.js
files in the migrations directories.zakmes ci
zakmes init github
should add some default workflow fileszakmes prod
&zakmes prod queue
scripts/queue.js
override behaviour?create-compas
zakmes verify
load everything, without executing anythingcompas migrate
compas run ...
compas test
zakmes prod