UNPKG

histoire

Version:

A fast story book powered by Vite

26 lines • 2.17 kB
import type { Plugin } from '@histoire/shared'; /** Resolved public package identity; no filesystem locations cross the channel. */ export interface InstalledPackage { /** Installed npm identity, when resolvable. */ packageName?: string; /** Installed package version, or local for authored/workspace code. */ version?: string; /** Authored or workspace dependency, excluded from registry updates. */ local: boolean; /** Bundled identity under the first-party npm scope. */ official: boolean; /** Exact dependency version, still eligible for update notifications. */ pinned: boolean; /** Builtin or framework support matching this project. */ required: boolean; } /** Admit exact npm identities, excluding path traversal and URL specifiers. */ export declare function packageNameFromSpecifier(value: string): string | undefined; /** Read the nearest installed copy, requiring its manifest to match the lookup identity. */ export declare function readInstalledPackage(root: string, name: string): Promise<Record<string, any>>; /** Nearest declaration wins, including workspace-root declarations inherited by child packages. */ export declare function projectDependencies(root: string): Promise<Record<string, string>>; /** Resolve aliases through source specifiers, keeping project ranges separate from installed bytes. */ export declare function resolvePluginPackage(root: string, name: string, specifier?: string, frameworks?: readonly string[], inputs?: PackageResolutionInputs): Promise<InstalledPackage>; /** Inventory-scoped evidence avoids rereading dependencies and installed JSON per projection. */ export interface PackageResolutionInputs { /** Nearest project declarations, captured once for all inventory rows. */ dependencies?: Readonly<Record<string, string>>; /** Identity-checked package JSON, shared with metadata projection. */ package?: Record<string, any>; } /** Synchronous fallback for callers rendering a virtual module without a captured inventory. */ export declare function pluginInventoryFlags(plugin: Plugin): Pick<InstalledPackage, 'local' | 'required' | 'official'>; //# sourceMappingURL=package-resolve.d.ts.map