@pnpm/lockfile.types 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +3 -0
- package/lib/index.d.ts +140 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/lockfileFileTypes.d.ts +37 -0
- package/lib/lockfileFileTypes.js +3 -0
- package/lib/lockfileFileTypes.js.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
|
|
4
|
+
Copyright (c) 2016-2024 Zoltan Kochan and other contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { type DependenciesMeta, type DepPath, type PatchFile, type ProjectId } from '@pnpm/types';
|
|
2
|
+
export type { PatchFile, ProjectId };
|
|
3
|
+
export * from './lockfileFileTypes';
|
|
4
|
+
export interface LockfileSettings {
|
|
5
|
+
autoInstallPeers?: boolean;
|
|
6
|
+
excludeLinksFromLockfile?: boolean;
|
|
7
|
+
peersSuffixMaxLength?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface Lockfile {
|
|
10
|
+
importers: Record<ProjectId, ProjectSnapshot>;
|
|
11
|
+
lockfileVersion: string;
|
|
12
|
+
time?: Record<string, string>;
|
|
13
|
+
catalogs?: CatalogSnapshots;
|
|
14
|
+
packages?: PackageSnapshots;
|
|
15
|
+
overrides?: Record<string, string>;
|
|
16
|
+
packageExtensionsChecksum?: string;
|
|
17
|
+
ignoredOptionalDependencies?: string[];
|
|
18
|
+
patchedDependencies?: Record<string, PatchFile>;
|
|
19
|
+
pnpmfileChecksum?: string;
|
|
20
|
+
settings?: LockfileSettings;
|
|
21
|
+
}
|
|
22
|
+
export interface LockfileV9 {
|
|
23
|
+
importers: Record<string, ProjectSnapshot>;
|
|
24
|
+
lockfileVersion: string;
|
|
25
|
+
time?: Record<string, string>;
|
|
26
|
+
snapshots?: Record<string, PackageSnapshotV7>;
|
|
27
|
+
packages?: Record<string, PackageInfo>;
|
|
28
|
+
neverBuiltDependencies?: string[];
|
|
29
|
+
onlyBuiltDependencies?: string[];
|
|
30
|
+
overrides?: Record<string, string>;
|
|
31
|
+
packageExtensionsChecksum?: string;
|
|
32
|
+
patchedDependencies?: Record<string, PatchFile>;
|
|
33
|
+
settings?: LockfileSettings;
|
|
34
|
+
}
|
|
35
|
+
export interface ProjectSnapshot {
|
|
36
|
+
specifiers: ResolvedDependencies;
|
|
37
|
+
dependencies?: ResolvedDependencies;
|
|
38
|
+
optionalDependencies?: ResolvedDependencies;
|
|
39
|
+
devDependencies?: ResolvedDependencies;
|
|
40
|
+
dependenciesMeta?: DependenciesMeta;
|
|
41
|
+
publishDirectory?: string;
|
|
42
|
+
}
|
|
43
|
+
export type ResolvedDependenciesOfImporters = Record<string, {
|
|
44
|
+
version: string;
|
|
45
|
+
specifier: string;
|
|
46
|
+
}>;
|
|
47
|
+
export interface PackageSnapshots {
|
|
48
|
+
[packagePath: DepPath]: PackageSnapshot;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* tarball hosted remotely
|
|
52
|
+
*/
|
|
53
|
+
export interface TarballResolution {
|
|
54
|
+
type?: undefined;
|
|
55
|
+
tarball: string;
|
|
56
|
+
integrity?: string;
|
|
57
|
+
path?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* directory on a file system
|
|
61
|
+
*/
|
|
62
|
+
export interface DirectoryResolution {
|
|
63
|
+
type: 'directory';
|
|
64
|
+
directory: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Git repository
|
|
68
|
+
*/
|
|
69
|
+
export interface GitRepositoryResolution {
|
|
70
|
+
type: 'git';
|
|
71
|
+
repo: string;
|
|
72
|
+
commit: string;
|
|
73
|
+
path?: string;
|
|
74
|
+
}
|
|
75
|
+
export type Resolution = TarballResolution | GitRepositoryResolution | DirectoryResolution;
|
|
76
|
+
export type LockfileResolution = Resolution | {
|
|
77
|
+
integrity: string;
|
|
78
|
+
};
|
|
79
|
+
export type PackageSnapshotV7 = Pick<PackageSnapshot, 'optional' | 'dependencies' | 'optionalDependencies' | 'transitivePeerDependencies'>;
|
|
80
|
+
export type PackageInfo = Pick<PackageSnapshot, 'id' | 'patched' | 'hasBin' | 'name' | 'version' | 'resolution' | 'peerDependencies' | 'peerDependenciesMeta' | 'bundledDependencies' | 'engines' | 'cpu' | 'os' | 'libc' | 'deprecated'>;
|
|
81
|
+
export interface PackageSnapshot {
|
|
82
|
+
id?: string;
|
|
83
|
+
optional?: true;
|
|
84
|
+
patched?: true;
|
|
85
|
+
hasBin?: true;
|
|
86
|
+
name?: string;
|
|
87
|
+
version?: string;
|
|
88
|
+
resolution: LockfileResolution;
|
|
89
|
+
dependencies?: ResolvedDependencies;
|
|
90
|
+
optionalDependencies?: ResolvedDependencies;
|
|
91
|
+
peerDependencies?: {
|
|
92
|
+
[name: string]: string;
|
|
93
|
+
};
|
|
94
|
+
peerDependenciesMeta?: {
|
|
95
|
+
[name: string]: {
|
|
96
|
+
optional: true;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
transitivePeerDependencies?: string[];
|
|
100
|
+
bundledDependencies?: string[] | boolean;
|
|
101
|
+
engines?: Record<string, string> & {
|
|
102
|
+
node: string;
|
|
103
|
+
};
|
|
104
|
+
os?: string[];
|
|
105
|
+
cpu?: string[];
|
|
106
|
+
libc?: string[];
|
|
107
|
+
deprecated?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface Dependencies {
|
|
110
|
+
[name: string]: string;
|
|
111
|
+
}
|
|
112
|
+
export type PackageBin = string | {
|
|
113
|
+
[name: string]: string;
|
|
114
|
+
};
|
|
115
|
+
/** @example
|
|
116
|
+
* {
|
|
117
|
+
* "foo": "registry.npmjs.org/foo/1.0.1"
|
|
118
|
+
* }
|
|
119
|
+
*/
|
|
120
|
+
export type ResolvedDependencies = Record<string, string>;
|
|
121
|
+
export interface CatalogSnapshots {
|
|
122
|
+
[catalogName: string]: {
|
|
123
|
+
[dependencyName: string]: ResolvedCatalogEntry;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
export interface ResolvedCatalogEntry {
|
|
127
|
+
/**
|
|
128
|
+
* The real specifier that should be used for this dependency's catalog entry.
|
|
129
|
+
* This would be the ^1.2.3 portion of:
|
|
130
|
+
*
|
|
131
|
+
* @example
|
|
132
|
+
* catalog:
|
|
133
|
+
* foo: ^1.2.3
|
|
134
|
+
*/
|
|
135
|
+
readonly specifier: string;
|
|
136
|
+
/**
|
|
137
|
+
* The concrete version that the requested specifier resolved to. Ex: 1.2.3
|
|
138
|
+
*/
|
|
139
|
+
readonly version: string;
|
|
140
|
+
}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lockfileFileTypes"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,sDAAmC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Lockfile, PackageSnapshot, ProjectSnapshot } from '.';
|
|
2
|
+
import type { DependenciesMeta } from '@pnpm/types';
|
|
3
|
+
export type LockfileFile = Omit<InlineSpecifiersLockfile, 'importers'> & Partial<InlineSpecifiersProjectSnapshot> & Partial<Pick<InlineSpecifiersLockfile, 'importers'>>;
|
|
4
|
+
export type LockfileFileV9 = Omit<InlineSpecifiersLockfile, 'importers' | 'packages'> & Partial<InlineSpecifiersProjectSnapshot> & Partial<Pick<InlineSpecifiersLockfile, 'importers'>> & {
|
|
5
|
+
packages?: Record<string, Pick<PackageSnapshot, 'resolution' | 'engines' | 'cpu' | 'os' | 'hasBin' | 'name' | 'version' | 'bundledDependencies' | 'peerDependencies' | 'peerDependenciesMeta' | 'deprecated'>>;
|
|
6
|
+
snapshots?: Record<string, Pick<PackageSnapshot, 'dependencies' | 'optionalDependencies' | 'patched' | 'optional' | 'transitivePeerDependencies' | 'id'>>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Similar to the current Lockfile importers format (lockfile version 5.4 at
|
|
10
|
+
* time of writing), but specifiers are moved to each ResolvedDependencies block
|
|
11
|
+
* instead of being declared on its own dictionary.
|
|
12
|
+
*
|
|
13
|
+
* This is an experiment to reduce one flavor of merge conflicts in lockfiles.
|
|
14
|
+
* For more info: https://github.com/pnpm/pnpm/issues/4725.
|
|
15
|
+
*/
|
|
16
|
+
export interface InlineSpecifiersLockfile extends Omit<Lockfile, 'lockfileVersion' | 'importers'> {
|
|
17
|
+
lockfileVersion: string;
|
|
18
|
+
importers?: Record<string, InlineSpecifiersProjectSnapshot>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Similar to the current ProjectSnapshot interface, but omits the "specifiers"
|
|
22
|
+
* field in favor of inlining each specifier next to its version resolution in
|
|
23
|
+
* dependency blocks.
|
|
24
|
+
*/
|
|
25
|
+
export type InlineSpecifiersProjectSnapshot = Omit<ProjectSnapshot, 'dependencies' | 'devDependencies' | 'optionalDependencies' | 'dependenciesMeta' | 'specifiers'> & {
|
|
26
|
+
dependencies?: InlineSpecifiersResolvedDependencies;
|
|
27
|
+
devDependencies?: InlineSpecifiersResolvedDependencies;
|
|
28
|
+
optionalDependencies?: InlineSpecifiersResolvedDependencies;
|
|
29
|
+
dependenciesMeta?: DependenciesMeta;
|
|
30
|
+
};
|
|
31
|
+
export interface InlineSpecifiersResolvedDependencies {
|
|
32
|
+
[depName: string]: SpecifierAndResolution;
|
|
33
|
+
}
|
|
34
|
+
export interface SpecifierAndResolution {
|
|
35
|
+
specifier: string;
|
|
36
|
+
version: string;
|
|
37
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lockfileFileTypes.js","sourceRoot":"","sources":["../src/lockfileFileTypes.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pnpm/lockfile.types",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Types for the pnpm-lock.yaml lockfile",
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"types": "lib/index.d.ts",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18.12"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"lib",
|
|
12
|
+
"!*.map"
|
|
13
|
+
],
|
|
14
|
+
"repository": "https://github.com/pnpm/pnpm/blob/main/lockfile/types",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"pnpm9",
|
|
17
|
+
"pnpm",
|
|
18
|
+
"types",
|
|
19
|
+
"lockfile"
|
|
20
|
+
],
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "https://github.com/pnpm/pnpm/issues"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/pnpm/pnpm/blob/main/lockfile/types#readme",
|
|
26
|
+
"funding": "https://opencollective.com/pnpm",
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@pnpm/types": "11.1.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@pnpm/lockfile.types": "1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"exports": {
|
|
34
|
+
".": "./lib/index.js"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"lint": "eslint \"src/**/*.ts\"",
|
|
38
|
+
"compile": "tsc --build && pnpm run lint --fix"
|
|
39
|
+
}
|
|
40
|
+
}
|