Something went wrong. Try again.
Monorepo for the nibling.run platform
Something went wrong. Try again.
123456789101112131415161718import assert from 'node:assert/strict';import { readdirSync, readFileSync } from 'node:fs';import { join } from 'node:path';import { test } from 'node:test';
const src = new URL('../src/', import.meta.url).pathname;
function sources(dir: string): string[] { return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => entry.isDirectory() ? sources(join(dir, entry.name)) : entry.name.endsWith('.ts') ? [join(dir, entry.name)] : [], );}
test('the worker imports only dependency-free @nibling/sdk entry points, never the browser SDK root', () => { const offenders = sources(src).filter((file) => /from ['"]@nibling\/sdk['"]/.test(readFileSync(file, 'utf8'))); assert.deepEqual(offenders.map((file) => file.slice(src.length)), []);});