@zedtech/zedkit-quality
Enforce feature-folder ports and adapters
Ban UI→adapter imports, keep the model pure, and leave adapter injection to the composition root.
beta
Usage
At a glance
- Who: Teams that colocate each feature as
features/<name>/{ui,ports,adapters,model}. - What: Ban UI→adapter imports, keep the model pure, and leave adapter injection to the composition root.
- Use when: When each feature owns ui/ports/adapters/model folders and bypasses must fail the gate.
- Avoid when: When the repo maps onto route/view/data folders (use
Enforce route, view and data layer boundaries). - See also: Enforce route, view and data layer boundaries
Install
pnpm add @zedtech/zedkit-qualityLatest: 0.3.2 (via changesets).
Example
import { defineLayers } from "@zedtech/zedkit-quality/eslint";
export default [
...defineLayers({
preset: "feature-folders",
kitPackage: "@acme/ui",
featureRoot: "features",
}),
];Wraps: eslint
Live example
The docs app ships a note-list feature at apps/docs/features/note-list. Open
/examples/note-list to run it with the fixture adapter
and no backend.
ui/imports the kit and talks to the world throughports/adapters/fixture.tsis injected fromindex.tsx(composition root)model/is a pure reducer (no I/O, no React)i18n/is a typed copy object passed ascopy