Summary
An entrypoint pattern that reaches above the root writes its declaration outside outdir:
generate({ root: 'src', outdir: 'dist', entrypoints: ['../*.ts'] })writes outside.d.ts next to outside.ts, and entrypoints: ['../outside.ts'] does the same.
Changes
findFiles already skips an absolute entrypoint outside the root with a warning, as the re-export auto-inclusion does, but a glob or relative pattern goes through its glob branch, which did not check. That branch now skips such files the same way, with the same Skipping entrypoint outside root warning. A flat output structure still takes them, into outdir under their file name. A run left with no files fails with "No source files matched" after the warnings. The configuration docs' Entry Points section describes the rule.
Testing
New test/entrypoint-outside-root.test.ts:
['../*.ts']and['../outside.ts']must write nothing outsideoutdirand fail with "No source files matched";['*.ts', '../*.ts']must write onlydist/inside.d.ts;- the flat structure must write
dist/outside.d.ts; - an
excludethat leaves nothing must still fail.
On main the first three fail, with the file written outside outdir.
bun test (Zig library built with the pinned Zig, so its tests run too), typecheck, lint and zig build test pass.