snyk
Version:
snyk library and cli utility
34 lines (33 loc) • 1.49 kB
TypeScript
import { MultiProjectResultCustom } from '../get-multi-plugin-result';
export declare function processYarnWorkspaces(root: string, settings: {
strictOutOfSync?: boolean;
dev?: boolean;
yarnWorkspaces?: boolean;
showNpmScope?: boolean;
}, targetFiles: string[]): Promise<MultiProjectResultCustom>;
interface YarnWorkspacesMap {
[packageJsonName: string]: {
workspaces: string[];
};
}
export declare function getWorkspacesMap(file: {
content: string;
fileName: string;
}): YarnWorkspacesMap;
export declare function packageJsonBelongsToWorkspace(packageJsonFileName: string, yarnWorkspacesMap: YarnWorkspacesMap, workspaceRoot: string): boolean;
export interface WorkspacePackageManifest {
dependencies?: Record<string, string>;
devDependencies?: Record<string, string>;
optionalDependencies?: Record<string, string>;
peerDependencies?: Record<string, string>;
}
/**
* Build a map of workspace package name -> its package.json dependency groups.
*
* Yarn Berry merges a workspace member's dependencies + devDependencies into a single
* `dependencies` block in yarn.lock, dropping the dev marker. When a workspace package is
* consumed as a production dependency, this map lets the lockfile parser re-derive which of
* its transitive deps are dev-only and prune them from the production graph.
*/
export declare function collectYarnWorkspacePackages(manifestContents: string[]): Record<string, WorkspacePackageManifest>;
export {};