/** The svelte the PREVIEWS will run: the project's when it has one. */ export declare function projectSvelteVersion(cwd: string): string | null; /** The svelte sdocs itself was installed with. */ export declare function bundledSvelteVersion(): string | null; /** * Prefer the project's own svelte over the copy next to sdocs when both exist * (e.g. running via npx): previews import the project's components, and two svelte * runtimes in one page don't mix. */ export declare function svelteDedupe(cwd: string): string[]; type SveltePlugin = typeof import('@sveltejs/vite-plugin-svelte').svelte; /** * vite-plugin-svelte from the PROJECT when it has one — which is what makes the * compiler match the runtime, since the plugin binds `svelte/compiler` from beside * itself. Falls back to sdocs' own copy (standalone use, or a project without the * plugin), warning when that leaves the toolchain split. */ export declare function loadSveltePlugin(cwd: string): Promise; /** * Vite from the PROJECT when it has one. * * Alignment is the smaller half of why. The larger half is that `npx sdocs` * cannot count on a vite beside itself at all: npm skips installing a peer into * the npx cache when it decides the surrounding project already satisfies it. * So in any project that has vite — which is every project likely to run this — * the npx cache gets sdocs and its dependencies but no vite, and a static * `import 'vite'` resolves from sdocs' own location under `~/.npm/_npx`, whose * upward walk never reaches the host's `node_modules`. The command then dies * before it starts, on the one dependency npm was sure it already had. * * Resolving from the project first inverts that: the copy npm counted on is the * copy we load. The fallback covers a genuinely bare project, where npm does * install a vite next to sdocs. */ export declare function loadVite(cwd: string): Promise; /** `svelte/compiler` from the project when it has one, for the same reason. */ export declare function loadSvelteCompiler(cwd: string): Promise; /** * Project dependencies that ship components as `.svelte` source, for * `optimizeDeps.exclude`. * * Vite prebundles bare imports with esbuild, which has no `.svelte` loader. A package * like @lucide/svelte re-exports straight into source (`export { default } from * "./arrow-right.svelte"`), so the optimizer dies on it — the import 504s and the * component silently renders without its icons. Such packages announce themselves with * a `svelte` export condition; that's the signal to hand them to the svelte plugin * intact instead of to esbuild. * * vite-plugin-svelte normally derives this during its dependency scan, which sdocs * disables (`optimizeDeps.entries: []`) because Rolldown-based Vite can't crawl * `.svelte` entry graphs — so the list is built here instead. `svelte` itself is never * excluded: it ships compiled runtime code and is deliberately prebundled. */ export declare function svelteSourceDeps(cwd: string): string[]; /** * The unfixable case: the project runs its own svelte but has no vite-plugin-svelte, so * sdocs must compile with its bundled copy. Harmless while the versions agree, fatal * when they drift — so name both versions and the one-line fix. */ export declare function warnIfToolchainSplit(cwd: string): void; export {};