/** * Bare npm packages that only ever run server-side (Node/Deno) and must never * be bundled for the browser via esm.sh. * * These are database / cache / messaging drivers that pull Node built-ins * (net, tls, dns, fs) and cannot produce a working browser bundle. esm.sh * either 500s while building them (e.g. `redis` under `external=react`) or * returns a bundle whose Node built-ins are stubbed — a client that can never * connect. The framework's own adapters import them behind a lazy, guarded * `import()` that only runs when the corresponding backend is configured, so * the correct treatment is to leave the specifier external and let the runtime * resolve it from `node_modules` (Node) or `npm:` (Deno). * * This list backs Fix A of the cold-cache redis transform issue. It pairs with * the defense-in-depth degraded-stub fallback in the SSR framework transform: * anything server-only that slips past this list still degrades gracefully * instead of aborting the whole framework module graph. */ declare const SERVER_ONLY_PACKAGES: ReadonlySet; /** * True if a bare package specifier's package name is a known server-only * package that must be left external rather than routed through esm.sh. * * Accepts a `packageName` as produced by `parseBarePackageSpecifier` (which may * carry an `npm:` prefix, e.g. `npm:redis`). The `npm:` prefix is stripped * before matching so both `redis` and `npm:redis@5.11.0` are recognized. */ export declare function isServerOnlyPackage(packageName: string, configuredPackages?: readonly string[]): boolean; /** True only when the project explicitly declared this package as server-only. */ export declare function isConfiguredServerExternalPackage(packageName: string, configuredPackages?: readonly string[]): boolean; /** Return the configured package root matched by a complete import specifier. */ export interface ConfiguredServerExternalMatch { readonly packageName: string; readonly runtimeSpecifier: string; } /** Classify a configured import and its server-runtime form. */ export declare function matchConfiguredServerExternalSpecifier(specifier: string, configuredPackages?: readonly string[]): ConfiguredServerExternalMatch | undefined; /** Return the configured package root matched by a complete import specifier. */ export declare function getConfiguredServerExternalPackage(specifier: string, configuredPackages?: readonly string[]): string | undefined; /** * Return the server-runtime form of a matched configured external import. * * Installed Node-style packages cannot resolve inline versions or the `npm:` * protocol. Deno may retain an `npm:` specifier because its resolver owns the * declared version. */ export declare function getConfiguredServerExternalRuntimeSpecifier(specifier: string, configuredPackages?: readonly string[], supportsNpmSpecifiers?: boolean): string | undefined; /** Safe, actionable diagnostic for an explicitly declared server package crossing into a client build. */ export declare function describeServerExternalBrowserViolation(specifier: string, sourceModule?: string, projectDir?: string): { message: string; sourceIdentity?: string; }; export { SERVER_ONLY_PACKAGES }; //# sourceMappingURL=server-only-packages.d.ts.map