TL;DR - it is not ready for use yet, I would not.
Use it in your project now, via:
yarn add archijs
and you can write a test like this
const project = Archijs.parseFromPath("src"); const rule = Archijs .defineThat() .folder() .withNameMatching('actions') .should() .matchChildrensName('actions') expect(project).toMatchArch(rule);
Under the Hood
I have opened the hood a bit. The core file "Archijs.js" is a bit less than 100 lines and does currently only focus on directory structures as far as I understand it. So the use seems to be very limitted at the moment.
The test in arhcijs/test
are quite basic. They do only run this one example that is also listed in the README file.
Except for the
index.spec.js all files are just fixtures for the tests to "see" them, this
is a bit irritating.
The things I would want to start with:
- file X must never import a file from directory Y to ensure that a module from inside the hexagon never imports a file from "outside"
- files X must be type-checked (relevant in JS)
I don't want to have adapters that just fail because of not adhering to the ports interface