Socket
Socket
Sign inDemoInstall

@pnpm/pnpmfile

Package Overview
Dependencies
Maintainers
2
Versions
147
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/pnpmfile - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

lib/Hooks.d.ts

1

lib/index.d.ts
import type { CookedHooks } from './requireHooks';
export { requireHooks } from './requireHooks';
export { requirePnpmfile, BadReadPackageHookError } from './requirePnpmfile';
export type { HookContext } from './Hooks';
export type Hooks = CookedHooks;

15

lib/requireHooks.d.ts

@@ -1,17 +0,4 @@

import type { PreResolutionHook } from '@pnpm/hooks.types';
import type { Lockfile } from '@pnpm/lockfile-types';
import type { Log } from '@pnpm/core-loggers';
import type { CustomFetchers } from '@pnpm/fetcher-base';
import { type ImportIndexedPackageAsync } from '@pnpm/store-controller-types';
interface HookContext {
log: (message: string) => void;
}
interface Hooks {
readPackage?: (pkg: any, context: HookContext) => any;
preResolution?: PreResolutionHook;
afterAllResolved?: (lockfile: Lockfile, context: HookContext) => Lockfile | Promise<Lockfile>;
filterLog?: (log: Log) => boolean;
importPackage?: ImportIndexedPackageAsync;
fetchers?: CustomFetchers;
}
import { type Hooks } from './Hooks';
type Cook<T extends (...args: any[]) => any> = (arg: Parameters<T>[0], ...otherArgs: any[]) => ReturnType<T>;

@@ -18,0 +5,0 @@ export interface CookedHooks {

@@ -13,3 +13,3 @@ "use strict";

function requireHooks(prefix, opts) {
const globalPnpmfile = opts.globalPnpmfile && (0, requirePnpmfile_1.requirePnpmfile)((0, path_absolute_1.default)(opts.globalPnpmfile, prefix), prefix);
const globalPnpmfile = opts.globalPnpmfile ? (0, requirePnpmfile_1.requirePnpmfile)((0, path_absolute_1.default)(opts.globalPnpmfile, prefix), prefix) : undefined;
let globalHooks = globalPnpmfile?.hooks;

@@ -22,4 +22,4 @@ const pnpmfilePath = (0, getPnpmfilePath_1.getPnpmfilePath)(prefix, opts.pnpmfile);

const calculatePnpmfileChecksum = hooks ? () => (0, crypto_base32_hash_1.createBase32HashFromFile)(pnpmfilePath) : undefined;
globalHooks = globalHooks || {};
hooks = hooks || {};
globalHooks = globalHooks ?? {};
hooks = hooks ?? {};
const cookedHooks = {

@@ -26,0 +26,0 @@ afterAllResolved: [],

import { PnpmError } from '@pnpm/error';
import { type Hooks } from './Hooks';
export declare class BadReadPackageHookError extends PnpmError {

@@ -6,2 +7,6 @@ readonly pnpmfile: string;

}
export declare function requirePnpmfile(pnpmFilePath: string, prefix: string): any;
export interface Pnpmfile {
hooks?: Hooks;
filename: string;
}
export declare function requirePnpmfile(pnpmFilePath: string, prefix: string): Pnpmfile | undefined;

@@ -41,3 +41,3 @@ "use strict";

if (pnpmfile?.hooks?.readPackage) {
const readPackage = pnpmfile.hooks.readPackage;
const readPackage = pnpmfile.hooks.readPackage; // eslint-disable-line
pnpmfile.hooks.readPackage = async function (pkg, ...args) {

@@ -44,0 +44,0 @@ pkg.dependencies = pkg.dependencies ?? {};

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

@@ -25,4 +25,4 @@ "main": "lib/index.js",

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

@@ -34,3 +34,3 @@ "dependencies": {

"@pnpm/crypto.base32-hash": "3.0.0",
"@pnpm/error": "6.0.0",
"@pnpm/error": "6.0.1",
"@pnpm/lockfile-types": "6.0.0",

@@ -37,0 +37,0 @@ "@pnpm/hooks.types": "2.0.0",

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc