Expand description
Canonical source-file discovery for extensions and BDD step files.
Both hosts (the MCP server’s plugin loader and the BDD runner’s
extension/step discovery) must agree on which file extensions count
as loadable source and must walk directories the same way — otherwise
a .tsx extension visible to the test runner is invisible to the MCP
server, which is exactly the inconsistency this module removes.
Constants§
- SOURCE_
EXTENSIONS - Extensions rolldown can bundle as an ESM entry. Superset of what
either host accepted before:
.cts/.cjs/.tsx/.jsx/.mts/.mjsare all valid rolldown entries, so all hosts accept them.
Functions§
- is_
source_ file - True when
pathhas a bundleable source extension. - walk_
source_ files - Recursively collect every source file under
dir(sorted, stable). A non-directory or unreadable entry yields an empty result rather than an error — discovery is best-effort; the caller surfaces “no files found” once, with context.