@pnpm/lockfile.utils 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 +13 -0
- package/lib/extendProjectsWithTargetDirs.d.ts +13 -0
- package/lib/extendProjectsWithTargetDirs.js +34 -0
- package/lib/extendProjectsWithTargetDirs.js.map +1 -0
- package/lib/index.d.ts +9 -0
- package/lib/index.js +35 -0
- package/lib/index.js.map +1 -0
- package/lib/nameVerFromPkgSnapshot.d.ts +9 -0
- package/lib/nameVerFromPkgSnapshot.js +38 -0
- package/lib/nameVerFromPkgSnapshot.js.map +1 -0
- package/lib/packageIdFromSnapshot.d.ts +3 -0
- package/lib/packageIdFromSnapshot.js +34 -0
- package/lib/packageIdFromSnapshot.js.map +1 -0
- package/lib/packageIsIndependent.d.ts +2 -0
- package/lib/packageIsIndependent.js +8 -0
- package/lib/packageIsIndependent.js.map +1 -0
- package/lib/pkgSnapshotToResolution.d.ts +4 -0
- package/lib/pkgSnapshotToResolution.js +71 -0
- package/lib/pkgSnapshotToResolution.js.map +1 -0
- package/lib/refIsLocalTarball.d.ts +2 -0
- package/lib/refIsLocalTarball.js +12 -0
- package/lib/refIsLocalTarball.js.map +1 -0
- package/lib/satisfiesPackageManifest.d.ts +9 -0
- package/lib/satisfiesPackageManifest.js +96 -0
- package/lib/satisfiesPackageManifest.js.map +1 -0
- package/package.json +52 -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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Lockfile } from '@pnpm/lockfile.types';
|
|
2
|
+
import { type ProjectId, type DepPath } from '@pnpm/types';
|
|
3
|
+
export declare function extendProjectsWithTargetDirs<T>(projects: Array<T & {
|
|
4
|
+
id: ProjectId;
|
|
5
|
+
}>, lockfile: Lockfile, ctx: {
|
|
6
|
+
virtualStoreDir: string;
|
|
7
|
+
pkgLocationsByDepPath?: Record<DepPath, string[]>;
|
|
8
|
+
virtualStoreDirMaxLength: number;
|
|
9
|
+
}): Array<T & {
|
|
10
|
+
id: ProjectId;
|
|
11
|
+
stages: string[];
|
|
12
|
+
targetDirs: string[];
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.extendProjectsWithTargetDirs = void 0;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const dependency_path_1 = require("@pnpm/dependency-path");
|
|
9
|
+
const packageIdFromSnapshot_1 = require("./packageIdFromSnapshot");
|
|
10
|
+
const nameVerFromPkgSnapshot_1 = require("./nameVerFromPkgSnapshot");
|
|
11
|
+
function extendProjectsWithTargetDirs(projects, lockfile, ctx) {
|
|
12
|
+
const getLocalLocations = ctx.pkgLocationsByDepPath != null
|
|
13
|
+
? (depPath) => ctx.pkgLocationsByDepPath[depPath]
|
|
14
|
+
: (depPath, pkgName) => [path_1.default.join(ctx.virtualStoreDir, (0, dependency_path_1.depPathToFilename)(depPath, ctx.virtualStoreDirMaxLength), 'node_modules', pkgName)];
|
|
15
|
+
const projectsById = Object.fromEntries(projects.map((project) => [project.id, { ...project, targetDirs: [] }]));
|
|
16
|
+
Object.entries(lockfile.packages ?? {})
|
|
17
|
+
.forEach(([depPath, pkg]) => {
|
|
18
|
+
if (pkg.resolution?.type !== 'directory')
|
|
19
|
+
return;
|
|
20
|
+
const pkgId = (0, packageIdFromSnapshot_1.packageIdFromSnapshot)(depPath, pkg);
|
|
21
|
+
const { name: pkgName } = (0, nameVerFromPkgSnapshot_1.nameVerFromPkgSnapshot)(depPath, pkg);
|
|
22
|
+
const importerId = pkgId.replace(/^file:/, '');
|
|
23
|
+
if (projectsById[importerId] == null)
|
|
24
|
+
return;
|
|
25
|
+
const localLocations = getLocalLocations(depPath, pkgName);
|
|
26
|
+
if (!localLocations)
|
|
27
|
+
return;
|
|
28
|
+
projectsById[importerId].targetDirs.push(...localLocations);
|
|
29
|
+
projectsById[importerId].stages = ['preinstall', 'install', 'postinstall', 'prepare', 'prepublishOnly'];
|
|
30
|
+
});
|
|
31
|
+
return Object.values(projectsById);
|
|
32
|
+
}
|
|
33
|
+
exports.extendProjectsWithTargetDirs = extendProjectsWithTargetDirs;
|
|
34
|
+
//# sourceMappingURL=extendProjectsWithTargetDirs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extendProjectsWithTargetDirs.js","sourceRoot":"","sources":["../src/extendProjectsWithTargetDirs.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AAEvB,2DAAyD;AAEzD,mEAA+D;AAC/D,qEAAiE;AAIjE,SAAgB,4BAA4B,CAC1C,QAAsC,EACtC,QAAkB,EAClB,GAIC;IAED,MAAM,iBAAiB,GAAsB,GAAG,CAAC,qBAAqB,IAAI,IAAI;QAC5E,CAAC,CAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,GAAG,CAAC,qBAAsB,CAAC,OAAO,CAAC;QAC3D,CAAC,CAAC,CAAC,OAAgB,EAAE,OAAe,EAAE,EAAE,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,IAAA,mCAAiB,EAAC,OAAO,EAAE,GAAG,CAAC,wBAAwB,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC,CAAA;IAC9J,MAAM,YAAY,GAChB,MAAM,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,EAAE,UAAU,EAAE,EAAc,EAAE,CAAC,CAAC,CAAC,CAAA;IACzG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC;SACpC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,EAAE;QAC1B,IAAK,GAAG,CAAC,UAAgC,EAAE,IAAI,KAAK,WAAW;YAAE,OAAM;QACvE,MAAM,KAAK,GAAG,IAAA,6CAAqB,EAAC,OAAkB,EAAE,GAAG,CAAC,CAAA;QAC5D,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAA,+CAAsB,EAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QAC9D,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAc,CAAA;QAC3D,IAAI,YAAY,CAAC,UAAU,CAAC,IAAI,IAAI;YAAE,OAAM;QAC5C,MAAM,cAAc,GAAG,iBAAiB,CAAC,OAAkB,EAAE,OAAO,CAAC,CAAA;QACrE,IAAI,CAAC,cAAc;YAAE,OAAM;QAC3B,YAAY,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAA;QAC3D,YAAY,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,gBAAgB,CAAC,CAAA;IACzG,CAAC,CAAC,CAAA;IACJ,OAAO,MAAM,CAAC,MAAM,CAAC,YAAY,CAAyE,CAAA;AAC5G,CAAC;AA3BD,oEA2BC"}
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { refToRelative } from '@pnpm/dependency-path';
|
|
2
|
+
export { extendProjectsWithTargetDirs } from './extendProjectsWithTargetDirs';
|
|
3
|
+
export { nameVerFromPkgSnapshot } from './nameVerFromPkgSnapshot';
|
|
4
|
+
export { packageIdFromSnapshot } from './packageIdFromSnapshot';
|
|
5
|
+
export { packageIsIndependent } from './packageIsIndependent';
|
|
6
|
+
export { pkgSnapshotToResolution } from './pkgSnapshotToResolution';
|
|
7
|
+
export { refIsLocalTarball, refIsLocalDirectory } from './refIsLocalTarball';
|
|
8
|
+
export * from '@pnpm/lockfile.types';
|
|
9
|
+
export declare const getPkgShortId: typeof refToRelative;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
exports.getPkgShortId = exports.refIsLocalDirectory = exports.refIsLocalTarball = exports.pkgSnapshotToResolution = exports.packageIsIndependent = exports.packageIdFromSnapshot = exports.nameVerFromPkgSnapshot = exports.extendProjectsWithTargetDirs = void 0;
|
|
18
|
+
const dependency_path_1 = require("@pnpm/dependency-path");
|
|
19
|
+
var extendProjectsWithTargetDirs_1 = require("./extendProjectsWithTargetDirs");
|
|
20
|
+
Object.defineProperty(exports, "extendProjectsWithTargetDirs", { enumerable: true, get: function () { return extendProjectsWithTargetDirs_1.extendProjectsWithTargetDirs; } });
|
|
21
|
+
var nameVerFromPkgSnapshot_1 = require("./nameVerFromPkgSnapshot");
|
|
22
|
+
Object.defineProperty(exports, "nameVerFromPkgSnapshot", { enumerable: true, get: function () { return nameVerFromPkgSnapshot_1.nameVerFromPkgSnapshot; } });
|
|
23
|
+
var packageIdFromSnapshot_1 = require("./packageIdFromSnapshot");
|
|
24
|
+
Object.defineProperty(exports, "packageIdFromSnapshot", { enumerable: true, get: function () { return packageIdFromSnapshot_1.packageIdFromSnapshot; } });
|
|
25
|
+
var packageIsIndependent_1 = require("./packageIsIndependent");
|
|
26
|
+
Object.defineProperty(exports, "packageIsIndependent", { enumerable: true, get: function () { return packageIsIndependent_1.packageIsIndependent; } });
|
|
27
|
+
var pkgSnapshotToResolution_1 = require("./pkgSnapshotToResolution");
|
|
28
|
+
Object.defineProperty(exports, "pkgSnapshotToResolution", { enumerable: true, get: function () { return pkgSnapshotToResolution_1.pkgSnapshotToResolution; } });
|
|
29
|
+
var refIsLocalTarball_1 = require("./refIsLocalTarball");
|
|
30
|
+
Object.defineProperty(exports, "refIsLocalTarball", { enumerable: true, get: function () { return refIsLocalTarball_1.refIsLocalTarball; } });
|
|
31
|
+
Object.defineProperty(exports, "refIsLocalDirectory", { enumerable: true, get: function () { return refIsLocalTarball_1.refIsLocalDirectory; } });
|
|
32
|
+
__exportStar(require("@pnpm/lockfile.types"), exports);
|
|
33
|
+
// for backward compatibility
|
|
34
|
+
exports.getPkgShortId = dependency_path_1.refToRelative;
|
|
35
|
+
//# 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":";;;;;;;;;;;;;;;;;AAAA,2DAAqD;AAErD,+EAA6E;AAApE,4IAAA,4BAA4B,OAAA;AACrC,mEAAiE;AAAxD,gIAAA,sBAAsB,OAAA;AAC/B,iEAA+D;AAAtD,8HAAA,qBAAqB,OAAA;AAC9B,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAC7B,qEAAmE;AAA1D,kIAAA,uBAAuB,OAAA;AAChC,yDAA4E;AAAnE,sHAAA,iBAAiB,OAAA;AAAE,wHAAA,mBAAmB,OAAA;AAC/C,uDAAoC;AAEpC,6BAA6B;AAChB,QAAA,aAAa,GAAG,+BAAa,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PackageSnapshot } from '@pnpm/lockfile.types';
|
|
2
|
+
import { type PkgResolutionId } from '@pnpm/types';
|
|
3
|
+
export interface NameVer {
|
|
4
|
+
name: string;
|
|
5
|
+
peersSuffix: string | undefined;
|
|
6
|
+
version: string;
|
|
7
|
+
nonSemverVersion?: PkgResolutionId;
|
|
8
|
+
}
|
|
9
|
+
export declare function nameVerFromPkgSnapshot(depPath: string, pkgSnapshot: PackageSnapshot): NameVer;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.nameVerFromPkgSnapshot = void 0;
|
|
27
|
+
const dp = __importStar(require("@pnpm/dependency-path"));
|
|
28
|
+
function nameVerFromPkgSnapshot(depPath, pkgSnapshot) {
|
|
29
|
+
const pkgInfo = dp.parse(depPath);
|
|
30
|
+
return {
|
|
31
|
+
name: pkgInfo.name,
|
|
32
|
+
peersSuffix: pkgInfo.peersSuffix,
|
|
33
|
+
version: pkgSnapshot.version ?? pkgInfo.version,
|
|
34
|
+
nonSemverVersion: pkgInfo.nonSemverVersion,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
exports.nameVerFromPkgSnapshot = nameVerFromPkgSnapshot;
|
|
38
|
+
//# sourceMappingURL=nameVerFromPkgSnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nameVerFromPkgSnapshot.js","sourceRoot":"","sources":["../src/nameVerFromPkgSnapshot.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0DAA2C;AAU3C,SAAgB,sBAAsB,CACpC,OAAe,EACf,WAA4B;IAE5B,MAAM,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACjC,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAc;QAC5B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,OAAO,EAAE,WAAW,CAAC,OAAO,IAAI,OAAO,CAAC,OAAiB;QACzD,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;KAC3C,CAAA;AACH,CAAC;AAXD,wDAWC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.packageIdFromSnapshot = void 0;
|
|
27
|
+
const dp = __importStar(require("@pnpm/dependency-path"));
|
|
28
|
+
function packageIdFromSnapshot(depPath, pkgSnapshot) {
|
|
29
|
+
if (pkgSnapshot.id)
|
|
30
|
+
return pkgSnapshot.id;
|
|
31
|
+
return dp.tryGetPackageId(depPath) ?? depPath;
|
|
32
|
+
}
|
|
33
|
+
exports.packageIdFromSnapshot = packageIdFromSnapshot;
|
|
34
|
+
//# sourceMappingURL=packageIdFromSnapshot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageIdFromSnapshot.js","sourceRoot":"","sources":["../src/packageIdFromSnapshot.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,0DAA2C;AAE3C,SAAgB,qBAAqB,CACnC,OAAgB,EAChB,WAA4B;IAE5B,IAAI,WAAW,CAAC,EAAE;QAAE,OAAO,WAAW,CAAC,EAAW,CAAA;IAClD,OAAO,EAAE,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,OAAO,CAAA;AAC/C,CAAC;AAND,sDAMC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.packageIsIndependent = void 0;
|
|
4
|
+
function packageIsIndependent({ dependencies, optionalDependencies }) {
|
|
5
|
+
return dependencies === undefined && optionalDependencies === undefined;
|
|
6
|
+
}
|
|
7
|
+
exports.packageIsIndependent = packageIsIndependent;
|
|
8
|
+
//# sourceMappingURL=packageIsIndependent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageIsIndependent.js","sourceRoot":"","sources":["../src/packageIsIndependent.ts"],"names":[],"mappings":";;;AAEA,SAAgB,oBAAoB,CAAE,EAAE,YAAY,EAAE,oBAAoB,EAAmB;IAC3F,OAAO,YAAY,KAAK,SAAS,IAAI,oBAAoB,KAAK,SAAS,CAAA;AACzE,CAAC;AAFD,oDAEC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type PackageSnapshot } from '@pnpm/lockfile.types';
|
|
2
|
+
import { type Resolution } from '@pnpm/resolver-base';
|
|
3
|
+
import { type Registries } from '@pnpm/types';
|
|
4
|
+
export declare function pkgSnapshotToResolution(depPath: string, pkgSnapshot: PackageSnapshot, registries: Registries): Resolution;
|
|
@@ -0,0 +1,71 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.pkgSnapshotToResolution = void 0;
|
|
30
|
+
const url_1 = __importDefault(require("url"));
|
|
31
|
+
const dp = __importStar(require("@pnpm/dependency-path"));
|
|
32
|
+
const get_npm_tarball_url_1 = __importDefault(require("get-npm-tarball-url"));
|
|
33
|
+
const pick_fetcher_1 = require("@pnpm/pick-fetcher");
|
|
34
|
+
const nameVerFromPkgSnapshot_1 = require("./nameVerFromPkgSnapshot");
|
|
35
|
+
function pkgSnapshotToResolution(depPath, pkgSnapshot, registries) {
|
|
36
|
+
if (Boolean(pkgSnapshot.resolution.type) ||
|
|
37
|
+
pkgSnapshot.resolution.tarball?.startsWith('file:') ||
|
|
38
|
+
(0, pick_fetcher_1.isGitHostedPkgUrl)(pkgSnapshot.resolution.tarball ?? '')) {
|
|
39
|
+
return pkgSnapshot.resolution;
|
|
40
|
+
}
|
|
41
|
+
const { name } = (0, nameVerFromPkgSnapshot_1.nameVerFromPkgSnapshot)(depPath, pkgSnapshot);
|
|
42
|
+
let registry = '';
|
|
43
|
+
if (name != null) {
|
|
44
|
+
if (name.startsWith('@')) {
|
|
45
|
+
registry = registries[name.split('/')[0]];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (!registry) {
|
|
49
|
+
registry = registries.default;
|
|
50
|
+
}
|
|
51
|
+
let tarball;
|
|
52
|
+
if (!pkgSnapshot.resolution.tarball) {
|
|
53
|
+
tarball = getTarball(registry);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
tarball = new url_1.default.URL(pkgSnapshot.resolution.tarball, registry.endsWith('/') ? registry : `${registry}/`).toString();
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
...pkgSnapshot.resolution,
|
|
60
|
+
tarball,
|
|
61
|
+
};
|
|
62
|
+
function getTarball(registry) {
|
|
63
|
+
const { name, version } = dp.parse(depPath);
|
|
64
|
+
if (!name || !version) {
|
|
65
|
+
throw new Error(`Couldn't get tarball URL from dependency path ${depPath}`);
|
|
66
|
+
}
|
|
67
|
+
return (0, get_npm_tarball_url_1.default)(name, version, { registry });
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.pkgSnapshotToResolution = pkgSnapshotToResolution;
|
|
71
|
+
//# sourceMappingURL=pkgSnapshotToResolution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pkgSnapshotToResolution.js","sourceRoot":"","sources":["../src/pkgSnapshotToResolution.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqB;AAIrB,0DAA2C;AAC3C,8EAAkD;AAClD,qDAAsD;AACtD,qEAAiE;AAEjE,SAAgB,uBAAuB,CACrC,OAAe,EACf,WAA4B,EAC5B,UAAsB;IAEtB,IACE,OAAO,CAAE,WAAW,CAAC,UAAgC,CAAC,IAAI,CAAC;QAC1D,WAAW,CAAC,UAAgC,CAAC,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC;QAC1E,IAAA,gCAAiB,EAAE,WAAW,CAAC,UAAgC,CAAC,OAAO,IAAI,EAAE,CAAC,EAC9E,CAAC;QACD,OAAO,WAAW,CAAC,UAAwB,CAAA;IAC7C,CAAC;IACD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAA,+CAAsB,EAAC,OAAO,EAAE,WAAW,CAAC,CAA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|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refIsLocalDirectory = exports.refIsLocalTarball = void 0;
|
|
4
|
+
function refIsLocalTarball(ref) {
|
|
5
|
+
return ref.startsWith('file:') && (ref.endsWith('.tgz') || ref.endsWith('.tar.gz') || ref.endsWith('.tar'));
|
|
6
|
+
}
|
|
7
|
+
exports.refIsLocalTarball = refIsLocalTarball;
|
|
8
|
+
function refIsLocalDirectory(ref) {
|
|
9
|
+
return ref.startsWith('file:') && !refIsLocalTarball(ref);
|
|
10
|
+
}
|
|
11
|
+
exports.refIsLocalDirectory = refIsLocalDirectory;
|
|
12
|
+
//# sourceMappingURL=refIsLocalTarball.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refIsLocalTarball.js","sourceRoot":"","sources":["../src/refIsLocalTarball.ts"],"names":[],"mappings":";;;AAAA,SAAgB,iBAAiB,CAAE,GAAW;IAC5C,OAAO,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAA;AAC7G,CAAC;AAFD,8CAEC;AAED,SAAgB,mBAAmB,CAAE,GAAW;IAC9C,OAAO,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAA;AAC3D,CAAC;AAFD,kDAEC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ProjectSnapshot } from '@pnpm/lockfile-types';
|
|
2
|
+
import { type ProjectManifest } from '@pnpm/types';
|
|
3
|
+
export declare function satisfiesPackageManifest(opts: {
|
|
4
|
+
autoInstallPeers?: boolean;
|
|
5
|
+
excludeLinksFromLockfile?: boolean;
|
|
6
|
+
}, importer: ProjectSnapshot | undefined, pkg: ProjectManifest): {
|
|
7
|
+
satisfies: boolean;
|
|
8
|
+
detailedReason?: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.satisfiesPackageManifest = void 0;
|
|
7
|
+
const types_1 = require("@pnpm/types");
|
|
8
|
+
const equals_1 = __importDefault(require("ramda/src/equals"));
|
|
9
|
+
const pickBy_1 = __importDefault(require("ramda/src/pickBy"));
|
|
10
|
+
const omit_1 = __importDefault(require("ramda/src/omit"));
|
|
11
|
+
function satisfiesPackageManifest(opts, importer, pkg) {
|
|
12
|
+
if (!importer)
|
|
13
|
+
return { satisfies: false, detailedReason: 'no importer' };
|
|
14
|
+
let existingDeps = { ...pkg.devDependencies, ...pkg.dependencies, ...pkg.optionalDependencies };
|
|
15
|
+
if (opts?.autoInstallPeers) {
|
|
16
|
+
pkg = {
|
|
17
|
+
...pkg,
|
|
18
|
+
dependencies: {
|
|
19
|
+
...pkg.peerDependencies && (0, omit_1.default)(Object.keys(existingDeps), pkg.peerDependencies),
|
|
20
|
+
...pkg.dependencies,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
existingDeps = {
|
|
24
|
+
...pkg.peerDependencies,
|
|
25
|
+
...existingDeps,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
const pickNonLinkedDeps = (0, pickBy_1.default)((spec) => !spec.startsWith('link:'));
|
|
29
|
+
let specs = importer.specifiers;
|
|
30
|
+
if (opts?.excludeLinksFromLockfile) {
|
|
31
|
+
existingDeps = pickNonLinkedDeps(existingDeps);
|
|
32
|
+
specs = pickNonLinkedDeps(specs);
|
|
33
|
+
}
|
|
34
|
+
if (!(0, equals_1.default)(existingDeps, specs)) {
|
|
35
|
+
return {
|
|
36
|
+
satisfies: false,
|
|
37
|
+
detailedReason: `specifiers in the lockfile (${JSON.stringify(specs)}) don't match specs in package.json (${JSON.stringify(existingDeps)})`,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (importer.publishDirectory !== pkg.publishConfig?.directory) {
|
|
41
|
+
return {
|
|
42
|
+
satisfies: false,
|
|
43
|
+
detailedReason: `"publishDirectory" in the lockfile (${importer.publishDirectory ?? 'undefined'}) doesn't match "publishConfig.directory" in package.json (${pkg.publishConfig?.directory ?? 'undefined'})`,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (!(0, equals_1.default)(pkg.dependenciesMeta ?? {}, importer.dependenciesMeta ?? {})) {
|
|
47
|
+
return {
|
|
48
|
+
satisfies: false,
|
|
49
|
+
detailedReason: `importer dependencies meta (${JSON.stringify(importer.dependenciesMeta)}) doesn't match package manifest dependencies meta (${JSON.stringify(pkg.dependenciesMeta)})`,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
for (const depField of types_1.DEPENDENCIES_FIELDS) {
|
|
53
|
+
const importerDeps = importer[depField] ?? {};
|
|
54
|
+
let pkgDeps = pkg[depField] ?? {};
|
|
55
|
+
if (opts?.excludeLinksFromLockfile) {
|
|
56
|
+
pkgDeps = pickNonLinkedDeps(pkgDeps);
|
|
57
|
+
}
|
|
58
|
+
let pkgDepNames;
|
|
59
|
+
switch (depField) {
|
|
60
|
+
case 'optionalDependencies':
|
|
61
|
+
pkgDepNames = Object.keys(pkgDeps);
|
|
62
|
+
break;
|
|
63
|
+
case 'devDependencies':
|
|
64
|
+
pkgDepNames = Object.keys(pkgDeps)
|
|
65
|
+
.filter((depName) => !pkg.optionalDependencies?.[depName] && !pkg.dependencies?.[depName]);
|
|
66
|
+
break;
|
|
67
|
+
case 'dependencies':
|
|
68
|
+
pkgDepNames = Object.keys(pkgDeps)
|
|
69
|
+
.filter((depName) => !pkg.optionalDependencies?.[depName]);
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
throw new Error(`Unknown dependency type "${depField}"`);
|
|
73
|
+
}
|
|
74
|
+
if (pkgDepNames.length !== Object.keys(importerDeps).length &&
|
|
75
|
+
pkgDepNames.length !== countOfNonLinkedDeps(importerDeps)) {
|
|
76
|
+
return {
|
|
77
|
+
satisfies: false,
|
|
78
|
+
detailedReason: `"${depField}" in the lockfile (${JSON.stringify(importerDeps)}) doesn't match the same field in package.json (${JSON.stringify(pkgDeps)})`,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
for (const depName of pkgDepNames) {
|
|
82
|
+
if (!importerDeps[depName] || importer.specifiers?.[depName] !== pkgDeps[depName]) {
|
|
83
|
+
return {
|
|
84
|
+
satisfies: false,
|
|
85
|
+
detailedReason: `importer ${depField}.${depName} specifier ${importer.specifiers[depName]} don't match package manifest specifier (${pkgDeps[depName]})`,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return { satisfies: true };
|
|
91
|
+
}
|
|
92
|
+
exports.satisfiesPackageManifest = satisfiesPackageManifest;
|
|
93
|
+
function countOfNonLinkedDeps(lockfileDeps) {
|
|
94
|
+
return Object.values(lockfileDeps).filter((ref) => !ref.includes('link:') && !ref.includes('file:')).length;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=satisfiesPackageManifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"satisfiesPackageManifest.js","sourceRoot":"","sources":["../src/satisfiesPackageManifest.ts"],"names":[],"mappings":";;;;;;AACA,uCAGoB;AACpB,8DAAqC;AACrC,8DAAqC;AACrC,0DAAiC;AAEjC,SAAgB,wBAAwB,CACtC,IAGC,EACD,QAAqC,EACrC,GAAoB;IAEpB,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,CAAA;IACzE,IAAI,YAAY,GAA2B,EAAE,GAAG,GAAG,CAAC,eAAe,EAA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1
|
+
{
|
|
2
|
+
"name": "@pnpm/lockfile.utils",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Utils for dealing with pnpm-lock.yaml",
|
|
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/utils",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"pnpm9",
|
|
17
|
+
"pnpm",
|
|
18
|
+
"shrinkwrap",
|
|
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/utils#readme",
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/ramda": "0.29.12",
|
|
28
|
+
"tempy": "^1.0.1",
|
|
29
|
+
"write-yaml-file": "^5.0.0",
|
|
30
|
+
"yaml-tag": "1.1.0",
|
|
31
|
+
"@pnpm/lockfile.utils": "1.0.0"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"get-npm-tarball-url": "^2.1.0",
|
|
35
|
+
"ramda": "npm:@pnpm/ramda@0.28.1",
|
|
36
|
+
"@pnpm/lockfile.types": "1.0.0",
|
|
37
|
+
"@pnpm/pick-fetcher": "3.0.0",
|
|
38
|
+
"@pnpm/dependency-path": "5.1.3",
|
|
39
|
+
"@pnpm/resolver-base": "13.0.1",
|
|
40
|
+
"@pnpm/types": "11.1.0"
|
|
41
|
+
},
|
|
42
|
+
"funding": "https://opencollective.com/pnpm",
|
|
43
|
+
"exports": {
|
|
44
|
+
".": "./lib/index.js"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
48
|
+
"_test": "jest",
|
|
49
|
+
"test": "pnpm run compile && pnpm run _test",
|
|
50
|
+
"compile": "tsc --build && pnpm run lint --fix"
|
|
51
|
+
}
|
|
52
|
+
}
|