1 | import { PackageLock } from './package-lock-parser';
|
2 | import { YarnLock } from './yarn-lock-parser';
|
3 | import { Yarn2Lock } from './yarn2-lock-parser';
|
4 | export interface Dep {
|
5 | name: string;
|
6 | version: string;
|
7 | dev?: boolean;
|
8 | }
|
9 | interface WorkspacesAlternateConfig {
|
10 | packages?: string[];
|
11 | }
|
12 | export declare type ManifestDependencies = {
|
13 | [dep: string]: string;
|
14 | };
|
15 | export declare type PeerDependenciesMeta = {
|
16 | [dep: string]: {
|
17 | optional: boolean;
|
18 | };
|
19 | };
|
20 | export interface ManifestFile {
|
21 | name: string;
|
22 | private?: string;
|
23 | engines?: {
|
24 | node?: string;
|
25 | };
|
26 | workspaces?: string[] | WorkspacesAlternateConfig;
|
27 | dependencies?: ManifestDependencies;
|
28 | devDependencies?: ManifestDependencies;
|
29 | optionalDependencies?: ManifestDependencies;
|
30 | peerDependencies?: ManifestDependencies;
|
31 | peerDependenciesMeta?: PeerDependenciesMeta;
|
32 | resolutions?: ManifestDependencies;
|
33 | version?: string;
|
34 | }
|
35 | export interface DepTreeDep {
|
36 | name?: string;
|
37 | version?: string;
|
38 | dependencies?: {
|
39 | [depName: string]: DepTreeDep;
|
40 | };
|
41 | labels?: {
|
42 | [key: string]: string | undefined;
|
43 | scope?: 'dev' | 'prod';
|
44 | pruned?: 'cyclic' | 'true';
|
45 | missingLockFileEntry?: 'true';
|
46 | };
|
47 | }
|
48 | export interface PkgTree extends DepTreeDep {
|
49 | type?: string;
|
50 | packageFormatVersion?: string;
|
51 | dependencies: {
|
52 | [depName: string]: DepTreeDep;
|
53 | };
|
54 | meta?: {
|
55 | nodeVersion?: string;
|
56 | lockfileVersion?: number;
|
57 | packageManager?: string;
|
58 | };
|
59 | hasDevDependencies?: boolean;
|
60 | cyclic?: boolean;
|
61 | size?: number;
|
62 | }
|
63 | export declare enum Scope {
|
64 | prod = "prod",
|
65 | dev = "dev"
|
66 | }
|
67 | export declare enum LockfileType {
|
68 | npm = "npm",
|
69 | npm7 = "npm7",
|
70 | yarn = "yarn",
|
71 | yarn2 = "yarn2",
|
72 | pnpm = "pnpm"
|
73 | }
|
74 | export interface LockfileParser {
|
75 | parseLockFile: (lockFileContents: string) => Lockfile;
|
76 | getDependencyTree: (manifestFile: ManifestFile, lockfile: Lockfile, includeDev?: boolean, strictOutOfSync?: boolean) => Promise<PkgTree>;
|
77 | }
|
78 | export declare type Lockfile = PackageLock | YarnLock | Yarn2Lock;
|
79 | export declare function parseManifestFile(manifestFileContents: string): ManifestFile;
|
80 | export declare function getTopLevelDeps({ targetFile, includeDev, includePeerDeps, applyYarn2Resolutions, }: {
|
81 | targetFile: ManifestFile;
|
82 | includeDev: boolean;
|
83 | includePeerDeps?: boolean;
|
84 | applyYarn2Resolutions?: boolean;
|
85 | }): Dep[];
|
86 | export declare function createDepTreeDepFromDep(dep: Dep): DepTreeDep;
|
87 | export declare function getYarnWorkspaces(targetFile: string): string[] | false;
|
88 | export declare function getPnpmWorkspaces(workspacesYamlFile: string): string[];
|
89 | export {};
|