Skip to content

Commit c47ae76

Browse files
authored
feat: add onion architecture preset to boundary rules (#229)
Add onion preset with layers: domain-model → domain-services → application → infrastructure. Enforces inward-only dependency direction like the other presets.
1 parent 35bfa3c commit c47ae76

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/boundaries.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ export const PRESETS = {
5858
layers: ['entities', 'usecases', 'interfaces', 'frameworks'],
5959
description: 'Inward-only dependency direction',
6060
},
61+
onion: {
62+
layers: ['domain-model', 'domain-services', 'application', 'infrastructure'],
63+
description: 'Inward-only dependency direction',
64+
},
6165
};
6266

6367
// ─── Module Resolution ───────────────────────────────────────────────

tests/unit/boundaries.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ describe('validateBoundaryConfig', () => {
184184
// ─── PRESETS ─────────────────────────────────────────────────────────
185185

186186
describe('PRESETS', () => {
187-
test('all three presets defined', () => {
187+
test('all four presets defined', () => {
188188
expect(PRESETS.hexagonal).toBeDefined();
189189
expect(PRESETS.layered).toBeDefined();
190190
expect(PRESETS.clean).toBeDefined();
191+
expect(PRESETS.onion).toBeDefined();
191192
});
192193

193194
test('each preset has layers array', () => {

0 commit comments

Comments
 (0)