pastoralist
Version:
A tool to watch over node module resolutions and overrides
21 lines (20 loc) • 1.76 kB
TypeScript
import type { PastoralistJSON, OverrideValue, UpdatePackageJSONOptions } from "../types";
import { LRUCache } from "../utils/cache";
export declare const jsonCache: LRUCache<string, PastoralistJSON>;
export declare const getCacheStats: () => {
size: number;
keys: string[];
};
export declare const forceClearCache: () => number;
export declare const detectPackageManager: (root?: string) => "npm" | "yarn" | "pnpm" | "bun";
export declare const getExistingOverrideField: (config: PastoralistJSON) => "resolutions" | "overrides" | "pnpm" | null;
export declare const getOverrideFieldForPackageManager: (packageManager: "npm" | "yarn" | "pnpm" | "bun") => "resolutions" | "overrides" | "pnpm";
export declare const applyOverridesToConfig: (config: PastoralistJSON, overrides: Record<string, OverrideValue> | Record<string, string>, fieldType: "resolutions" | "overrides" | "pnpm" | null) => PastoralistJSON;
export declare const resolveJSON: (path: string) => PastoralistJSON | undefined;
export declare const updatePackageJSON: ({ appendix, path, config, overrides, isTesting, dryRun, silent, }: UpdatePackageJSONOptions) => PastoralistJSON | void;
export declare const parseNpmLsOutput: (stdout: string) => Record<string, boolean>;
export declare const executeNpmLs: (root?: string) => Promise<string>;
export declare const getDependencyTree: (mockExecuteNpmLs?: (root?: string) => Promise<string>, cacheDir?: string, root?: string) => Promise<Record<string, boolean>>;
export declare const clearDependencyTreeCache: () => void;
export declare const getFullDependencyCount: (root?: string) => number;
export declare const findPackageJsonFiles: (depPaths: string[], ignore?: string[], root?: string, logInstance?: import("../utils").Logger) => string[];