feat: advance FreeCAD parity verification and runtime boundaries
This commit is contained in:
@@ -21,7 +21,8 @@ async function walk(relative = '') {
|
||||
}
|
||||
|
||||
const violations = []
|
||||
for (const file of await walk()) {
|
||||
const sourceFiles = await walk()
|
||||
for (const file of sourceFiles) {
|
||||
if (allowDirectRuntime.has(file)) continue
|
||||
const content = await readFile(new URL(file, sourceRoot), 'utf8')
|
||||
for (const pattern of forbidden) {
|
||||
@@ -30,9 +31,18 @@ for (const file of await walk()) {
|
||||
}
|
||||
}
|
||||
|
||||
const productionFacade = await readFile(new URL('facade/productionFacade.ts', sourceRoot), 'utf8')
|
||||
const application = await readFile(new URL('App.tsx', sourceRoot), 'utf8')
|
||||
const runtimeProfile = await readFile(new URL('facade/runtimeProfile.ts', sourceRoot), 'utf8')
|
||||
if (/from\s+["']\.\/mockFacade["']/.test(productionFacade)) violations.push('facade/productionFacade.ts: production entry imports mockFacade directly')
|
||||
if (/createMockFacade|facade\/mockFacade/.test(application)) violations.push('App.tsx: production application references the mock Facade')
|
||||
for (const declaration of ['bitbybit-occt', 'optional-worker', 'not-exposed', 'sqlite-opfs-with-memory-fallback', 'three-webgl2']) {
|
||||
if (!runtimeProfile.includes(declaration)) violations.push(`facade/runtimeProfile.ts: missing explicit runtime boundary '${declaration}'`)
|
||||
}
|
||||
|
||||
if (violations.length) {
|
||||
console.error('Facade-only boundary failed:')
|
||||
violations.forEach((violation) => console.error(`- ${violation}`))
|
||||
process.exit(1)
|
||||
}
|
||||
console.log(`Facade-only boundary passed (${(await walk()).length} TypeScript source files checked).`)
|
||||
console.log(`Facade-only boundary passed (${sourceFiles.length} TypeScript source files checked).`)
|
||||
|
||||
Reference in New Issue
Block a user