-
-
Notifications
You must be signed in to change notification settings - Fork 933
/
InlineSpecifiersLockfile.ts
38 lines (33 loc) · 1.35 KB
/
InlineSpecifiersLockfile.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import type { Lockfile } from '@pnpm/lockfile-types'
import type { DependenciesMeta } from '@pnpm/types'
export const INLINE_SPECIFIERS_FORMAT_LOCKFILE_VERSION_SUFFIX = '-inlineSpecifiers'
/**
* Similar to the current Lockfile importers format (lockfile version 5.4 at
* time of writing), but specifiers are moved to each ResolvedDependencies block
* instead of being declared on its own dictionary.
*
* This is an experiment to reduce one flavor of merge conflicts in lockfiles.
* For more info: https://github.com/pnpm/pnpm/issues/4725.
*/
export interface InlineSpecifiersLockfile extends Omit<Lockfile, 'lockfileVersion' | 'importers'> {
lockfileVersion: string
importers: Record<string, InlineSpecifiersProjectSnapshot>
}
/**
* Similar to the current ProjectSnapshot interface, but omits the "specifiers"
* field in favor of inlining each specifier next to its version resolution in
* dependency blocks.
*/
export interface InlineSpecifiersProjectSnapshot {
dependencies?: InlineSpecifiersResolvedDependencies
devDependencies?: InlineSpecifiersResolvedDependencies
optionalDependencies?: InlineSpecifiersResolvedDependencies
dependenciesMeta?: DependenciesMeta
}
export interface InlineSpecifiersResolvedDependencies {
[depName: string]: SpecifierAndResolution
}
export interface SpecifierAndResolution {
specifier: string
version: string
}