//#region src/lib/native-detect.d.ts /** * Why a package looks like it needs its files shipped. Carried through to the message so the * report states the evidence rather than a prediction about what will happen at invoke. */ type NativeEvidence = { kind: "binary"; file: string; } | { kind: "platformDependency"; dependency: string; file: string; } | { kind: "buildsFromSource"; script: string; } | { kind: "prebuiltManifest"; }; type NativeFinding = { /** The package as it appears in the user's tree. */ name: string; evidence: NativeEvidence; }; /** * The packages a bundle pulled in that carry native code and were not declared in * `externalPackages`. * * **This is evidence, not a verdict.** It proves the package contains or depends on compiled * code, never that this function's code path reaches it — a package with an optional native * accelerator and a working JavaScript fallback (`ws` with `bufferutil`, a Prisma client with * no Rust engine) looks identical from here and deploys fine today. So the caller reports it * and continues; it must not fail a deploy. * * Only reachable after a successful build. A package esbuild could not resolve, or a `.node` * it has no loader for, throws before any metafile exists — those already fail loudly with * esbuild's own diagnostic. */ declare function findUndeclaredNativePackages(options: { metafile: { inputs?: Record; } | undefined; declared: readonly string[]; projectDir: string; /** What metafile input paths are relative to. Defaults to the process working directory. */ cwd?: string; }): NativeFinding[]; /** * The package an esbuild metafile input belongs to, or `undefined` for the user's own source. * * Keyed off the **last** `node_modules/` segment, which is what makes pnpm's * `node_modules/.pnpm/sharp@0.35.3/node_modules/sharp/lib/x.js` resolve to `sharp` rather * than `.pnpm`. Yarn PnP resolves out of zip archives with no `node_modules` segment at all * and yields nothing here, which is the safe direction: a missed package is a missing * warning, not a wrong one. */ declare function packageNameFromInput(input: string): string | undefined; /** * The report a user sees. States what was found and both ways to act on it, with the * shipping form first because it is the one that produces a working function. */ declare function describeNativeFinding(slug: string, finding: NativeFinding): string; //#endregion export { NativeEvidence, NativeFinding, describeNativeFinding, findUndeclaredNativePackages, packageNameFromInput }; //# sourceMappingURL=native-detect.d.ts.map