Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pnpm/pnpmfile

Package Overview
Dependencies
Maintainers
3
Versions
149
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 0.1.15 to 0.1.16

7

CHANGELOG.md
# @pnpm/pnpmfile
## 0.1.16
### Patch Changes
- Updated dependencies [75a36deba]
- @pnpm/error@1.3.1
## 0.1.15

@@ -4,0 +11,0 @@

7

lib/index.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.requirePnpmfile = exports.requireHooks = void 0;
const requireHooks_1 = require("./requireHooks");
const requireHooks_1 = __importDefault(require("./requireHooks"));
exports.requireHooks = requireHooks_1.default;
const requirePnpmfile_1 = require("./requirePnpmfile");
const requirePnpmfile_1 = __importDefault(require("./requirePnpmfile"));
exports.requirePnpmfile = requirePnpmfile_1.default;
//# sourceMappingURL=index.js.map
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const core_loggers_1 = require("@pnpm/core-loggers");
const logger_1 = require("@pnpm/logger");
const logger_1 = __importDefault(require("@pnpm/logger"));
const requirePnpmfile_1 = __importDefault(require("./requirePnpmfile"));
const path = require("path");
const pathAbsolute = require("path-absolute");
const R = require("ramda");
const requirePnpmfile_1 = require("./requirePnpmfile");
function requireHooks(prefix, opts) {
const globalPnpmfile = opts.globalPnpmfile && requirePnpmfile_1.default(pathAbsolute(opts.globalPnpmfile, prefix), prefix);
let globalHooks = globalPnpmfile === null || globalPnpmfile === void 0 ? void 0 : globalPnpmfile.hooks;
const pnpmFile = opts.pnpmfile && requirePnpmfile_1.default(pathAbsolute(opts.pnpmfile, prefix), prefix)
|| requirePnpmfile_1.default(path.join(prefix, 'pnpmfile.js'), prefix);
const pnpmFile = opts.pnpmfile && requirePnpmfile_1.default(pathAbsolute(opts.pnpmfile, prefix), prefix) ||
requirePnpmfile_1.default(path.join(prefix, 'pnpmfile.js'), prefix);
let hooks = pnpmFile === null || pnpmFile === void 0 ? void 0 : pnpmFile.hooks;

@@ -15,0 +18,0 @@ if (!globalHooks && !hooks)

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const error_1 = require("@pnpm/error");
const logger_1 = require("@pnpm/logger");
const error_1 = __importDefault(require("@pnpm/error"));
const logger_1 = __importDefault(require("@pnpm/logger"));
const fs = require("fs");
const chalk = require("chalk");
const fs = require("fs");
class BadReadPackageHookError extends error_1.default {

@@ -23,3 +26,3 @@ constructor(pnpmfile, message) {

try {
const pnpmfile = require(pnpmFilePath);
const pnpmfile = require(pnpmFilePath); // eslint-disable-line
logger_1.default.info({

@@ -42,6 +45,7 @@ message: `Using hooks from: ${pnpmFilePath}`,

pnpmfile.hooks.readPackage = function (pkg, ...args) {
pkg.dependencies = pkg.dependencies || {};
pkg.devDependencies = pkg.devDependencies || {};
pkg.optionalDependencies = pkg.optionalDependencies || {};
pkg.peerDependencies = pkg.peerDependencies || {};
var _a, _b, _c, _d;
pkg.dependencies = (_a = pkg.dependencies) !== null && _a !== void 0 ? _a : {};
pkg.devDependencies = (_b = pkg.devDependencies) !== null && _b !== void 0 ? _b : {};
pkg.optionalDependencies = (_c = pkg.optionalDependencies) !== null && _c !== void 0 ? _c : {};
pkg.peerDependencies = (_d = pkg.peerDependencies) !== null && _d !== void 0 ? _d : {};
const newPkg = readPackage(pkg, ...args);

@@ -52,3 +56,3 @@ if (!newPkg) {

const dependencies = ['dependencies', 'optionalDependencies', 'peerDependencies'];
for (let dep of dependencies) {
for (const dep of dependencies) {
if (newPkg[dep] && typeof newPkg[dep] !== 'object') {

@@ -69,3 +73,2 @@ throw new BadReadPackageHookError(pnpmFilePath, `readPackage hook returned package manifest object's property '${dep}' must be an object.`);

process.exit(1);
return;
}

@@ -72,0 +75,0 @@ if (err.code !== 'MODULE_NOT_FOUND' || pnpmFileExistsSync(pnpmFilePath)) {

{
"name": "@pnpm/pnpmfile",
"version": "0.1.15",
"version": "0.1.16",
"description": "Reading a pnpmfile.js",

@@ -15,3 +15,3 @@ "main": "lib/index.js",

"scripts": {
"lint": "tslint -c ../../tslint.json src/**/*.ts test/**/*.ts",
"lint": "eslint -c ../../eslint.json src/**/*.ts test/**/*.ts",
"_test": "cd ../.. && c8 --reporter lcov --reports-dir packages/pnpmfile/coverage ts-node packages/pnpmfile/test --type-check",

@@ -39,3 +39,3 @@ "test": "pnpm run compile && pnpm run _test",

"@pnpm/core-loggers": "4.2.0",
"@pnpm/error": "1.3.0",
"@pnpm/error": "1.3.1",
"@pnpm/types": "6.2.0",

@@ -42,0 +42,0 @@ "chalk": "^4.1.0",

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