Socket
Socket
Sign inDemoInstall

@pnpm/pnpmfile

Package Overview
Dependencies
35
Maintainers
2
Versions
141
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.0.21 to 6.0.0

lib/getPnpmfilePath.d.ts

1

lib/requireHooks.d.ts

@@ -25,2 +25,3 @@ import type { PreResolutionHook } from '@pnpm/hooks.types';

fetchers?: CustomFetchers;
calculatePnpmfileChecksum?: () => Promise<string | undefined>;
}

@@ -27,0 +28,0 @@ export declare function requireHooks(prefix: string, opts: {

9

lib/requireHooks.js

@@ -7,5 +7,6 @@ "use strict";

exports.requireHooks = void 0;
const path_1 = __importDefault(require("path"));
const core_loggers_1 = require("@pnpm/core-loggers");
const crypto_base32_hash_1 = require("@pnpm/crypto.base32-hash");
const path_absolute_1 = __importDefault(require("path-absolute"));
const getPnpmfilePath_1 = require("./getPnpmfilePath");
const requirePnpmfile_1 = require("./requirePnpmfile");

@@ -15,7 +16,8 @@ function requireHooks(prefix, opts) {

let globalHooks = globalPnpmfile?.hooks;
const pnpmFile = opts.pnpmfile && (0, requirePnpmfile_1.requirePnpmfile)((0, path_absolute_1.default)(opts.pnpmfile, prefix), prefix) ||
(0, requirePnpmfile_1.requirePnpmfile)(path_1.default.join(prefix, '.pnpmfile.cjs'), prefix);
const pnpmfilePath = (0, getPnpmfilePath_1.getPnpmfilePath)(prefix, opts.pnpmfile);
const pnpmFile = (0, requirePnpmfile_1.requirePnpmfile)(pnpmfilePath, prefix);
let hooks = pnpmFile?.hooks;
if (!globalHooks && !hooks)
return { afterAllResolved: [], filterLog: [], readPackage: [] };
const calculatePnpmfileChecksum = hooks ? () => (0, crypto_base32_hash_1.createBase32HashFromFile)(pnpmfilePath) : undefined;
globalHooks = globalHooks || {};

@@ -27,2 +29,3 @@ hooks = hooks || {};

readPackage: [],
calculatePnpmfileChecksum,
};

@@ -29,0 +32,0 @@ for (const hookName of ['readPackage', 'afterAllResolved']) {

@@ -7,3 +7,5 @@ "use strict";

exports.requirePnpmfile = exports.BadReadPackageHookError = void 0;
const assert_1 = __importDefault(require("assert"));
const fs_1 = __importDefault(require("fs"));
const util_1 = __importDefault(require("util"));
const error_1 = require("@pnpm/error");

@@ -62,3 +64,3 @@ const logger_1 = require("@pnpm/logger");

}
catch (err) { // eslint-disable-line
catch (err) {
if (err instanceof SyntaxError) {

@@ -69,3 +71,5 @@ console.error(chalk_1.default.red('A syntax error in the .pnpmfile.cjs\n'));

}
if (err.code !== 'MODULE_NOT_FOUND' || pnpmFileExistsSync(pnpmFilePath)) {
(0, assert_1.default)(util_1.default.types.isNativeError(err));
if (!('code' in err && err.code === 'MODULE_NOT_FOUND') ||
pnpmFileExistsSync(pnpmFilePath)) {
throw new PnpmFileFailError(pnpmFilePath, err);

@@ -72,0 +76,0 @@ }

{
"name": "@pnpm/pnpmfile",
"version": "5.0.21",
"version": "6.0.0",
"description": "Reading a .pnpmfile.cjs",

@@ -12,7 +12,7 @@ "main": "lib/index.js",

"engines": {
"node": ">=16.14"
"node": ">=18.12"
},
"repository": "https://github.com/pnpm/pnpm/blob/main/hooks/pnpmfile",
"keywords": [
"pnpm8",
"pnpm9",
"pnpm"

@@ -26,4 +26,4 @@ ],

"devDependencies": {
"@pnpm/fetcher-base": "15.0.7",
"@pnpm/pnpmfile": "5.0.21"
"@pnpm/fetcher-base": "16.0.0",
"@pnpm/pnpmfile": "6.0.0"
},

@@ -33,8 +33,9 @@ "dependencies": {

"path-absolute": "^1.0.1",
"@pnpm/core-loggers": "9.0.6",
"@pnpm/hooks.types": "1.0.6",
"@pnpm/lockfile-types": "5.1.5",
"@pnpm/error": "5.0.3",
"@pnpm/store-controller-types": "17.2.0",
"@pnpm/types": "9.4.2"
"@pnpm/core-loggers": "10.0.0",
"@pnpm/crypto.base32-hash": "3.0.0",
"@pnpm/error": "6.0.0",
"@pnpm/lockfile-types": "6.0.0",
"@pnpm/hooks.types": "2.0.0",
"@pnpm/store-controller-types": "18.0.0",
"@pnpm/types": "10.0.0"
},

@@ -41,0 +42,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc