also exported from index.ts
(options: DiscoverSourceFilesOptions): Promise<DiscoverSourceFilesResult> import {discoverSourceFiles} from 'svelte-docinfo/discovery.js'; Discover source files from a project root.
Used internally by analyzeFromFiles for the discovery step. Standalone consumers can call it directly when they want the discovered file list without running full analysis.
Strategy is selected by discovery:
'auto'(default) — tryexportsfirst, fall back to glob.'exports'—exportsonly; throws ifexportsis missing or resolves to no source files. Combining withincludeis a configuration error and also throws.'glob'— glob only;includeparameterizes the search.
Exclusion globs come from sourceOptions.exclude (the single source of
truth, also applied at analysis time by isSource()).
options
discovery configuration
returns
Promise<DiscoverSourceFilesResult> discovered files (content loaded) and any diagnostics from the exports step
throws
Error- in strict `'exports'` mode when `exports` is missing or
examples
const sourceOptions = createSourceOptions(process.cwd());
const {files, diagnostics} = await discoverSourceFiles({sourceOptions});