From 5abeb298e94eb080ff06f4c337778a231f5d7f98 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 15 May 2026 12:52:33 +0200 Subject: [PATCH] Guard Soma morfo component coverage --- src/uix/contracts.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/uix/contracts.test.ts b/src/uix/contracts.test.ts index 4d9a5cb7d..17e6c97ea 100644 --- a/src/uix/contracts.test.ts +++ b/src/uix/contracts.test.ts @@ -128,6 +128,18 @@ function collectPublicSomaComponentDirs(): string[] { .sort(); } +function collectMorfoComponentNamesByScope(scope: string): string[] { + const root = join(HERE, 'morfo', 'components'); + return readdirSync(root) + .filter((file) => file.endsWith('.ts') && !file.endsWith('.test.ts')) + .filter((file) => { + const source = stripComments(readFileSync(join(root, file), 'utf8')); + return new RegExp(`scope:\\s*\\[[^\\]]*'${scope}'`).test(source); + }) + .map((file) => file.replace(/\.ts$/, '')) + .sort(); +} + function collectComponentLangPathViolations(source: string, file: string): string[] { const clean = stripComments(source); const violations: string[] = []; @@ -306,6 +318,10 @@ describe('UIX layer contracts', () => { expect(missingExports).toEqual([]); }); + it('guards Soma public component modules against Morfo soma scope', () => { + expect(collectPublicSomaComponentDirs()).toEqual(collectMorfoComponentNamesByScope('soma')); + }); + it('guards Soma public component modules with local README docs', () => { const missingReadmes = collectPublicSomaComponentDirs().filter( (dir) => !existsSync(join(HERE, 'soma', 'components', dir, 'README.md'))