Socket
Socket
Sign inDemoInstall

@pnpm/directory-fetcher

Package Overview
Dependencies
Maintainers
2
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pnpm/directory-fetcher - npm Package Compare versions

Comparing version 7.0.12 to 8.0.0

3

lib/index.d.ts

@@ -15,4 +15,5 @@ import type { DirectoryFetcher, DirectoryFetcherOptions } from '@pnpm/fetcher-base';

packageImportMethod: "hardlink";
manifest: DependencyManifest | undefined;
manifest: DependencyManifest;
requiresBuild: boolean;
}>;
export {};

@@ -9,2 +9,4 @@ "use strict";

const path_1 = __importDefault(require("path"));
const util_1 = __importDefault(require("util"));
const exec_pkg_requires_build_1 = require("@pnpm/exec.pkg-requires-build");
const logger_1 = require("@pnpm/logger");

@@ -19,3 +21,3 @@ const fs_packlist_1 = require("@pnpm/fs.packlist");

const dir = path_1.default.join(opts.lockfileDir, resolution.directory);
return fetchFromDir(dir, opts);
return fetchFromDir(dir);
};

@@ -29,17 +31,15 @@ return {

if (opts.includeOnlyPackageFiles) {
return fetchPackageFilesFromDir(dir, opts);
return fetchPackageFilesFromDir(dir);
}
const readFileStat = opts?.resolveSymlinks === true ? realFileStat : fileStat;
return fetchAllFilesFromDir(readFileStat, dir, opts);
return fetchAllFilesFromDir(readFileStat, dir);
}
exports.fetchFromDir = fetchFromDir;
async function fetchAllFilesFromDir(readFileStat, dir, opts) {
async function fetchAllFilesFromDir(readFileStat, dir) {
const filesIndex = await _fetchAllFilesFromDir(readFileStat, dir);
let manifest;
if (opts.readManifest) {
// In a regular pnpm workspace it will probably never happen that a dependency has no package.json file.
// Safe read was added to support the Bit workspace in which the components have no package.json files.
// Related PR in Bit: https://github.com/teambit/bit/pull/5251
manifest = await (0, read_project_manifest_1.safeReadProjectManifestOnly)(dir) ?? undefined;
}
// In a regular pnpm workspace it will probably never happen that a dependency has no package.json file.
// Safe read was added to support the Bit workspace in which the components have no package.json files.
// Related PR in Bit: https://github.com/teambit/bit/pull/5251
const manifest = await (0, read_project_manifest_1.safeReadProjectManifestOnly)(dir) ?? undefined;
const requiresBuild = (0, exec_pkg_requires_build_1.pkgRequiresBuild)(manifest, filesIndex);
return {

@@ -50,2 +50,3 @@ local: true,

manifest,
requiresBuild,
};

@@ -83,5 +84,5 @@ }

}
catch (err) { // eslint-disable-line @typescript-eslint/no-explicit-any
catch (err) {
// Broken symlinks are skipped
if (err.code === 'ENOENT') {
if (util_1.default.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') {
directoryFetcherLogger.debug({ brokenSymlink: filePath });

@@ -100,5 +101,5 @@ return { filePath: null, stat: null };

}
catch (err) { // eslint-disable-line @typescript-eslint/no-explicit-any
catch (err) {
// Broken symlinks are skipped
if (err.code === 'ENOENT') {
if (util_1.default.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') {
directoryFetcherLogger.debug({ brokenSymlink: filePath });

@@ -110,12 +111,10 @@ return { filePath: null, stat: null };

}
async function fetchPackageFilesFromDir(dir, opts) {
async function fetchPackageFilesFromDir(dir) {
const files = await (0, fs_packlist_1.packlist)(dir);
const filesIndex = Object.fromEntries(files.map((file) => [file, path_1.default.join(dir, file)]));
let manifest;
if (opts.readManifest) {
// In a regular pnpm workspace it will probably never happen that a dependency has no package.json file.
// Safe read was added to support the Bit workspace in which the components have no package.json files.
// Related PR in Bit: https://github.com/teambit/bit/pull/5251
manifest = await (0, read_project_manifest_1.safeReadProjectManifestOnly)(dir) ?? undefined;
}
// In a regular pnpm workspace it will probably never happen that a dependency has no package.json file.
// Safe read was added to support the Bit workspace in which the components have no package.json files.
// Related PR in Bit: https://github.com/teambit/bit/pull/5251
const manifest = await (0, read_project_manifest_1.safeReadProjectManifestOnly)(dir) ?? undefined;
const requiresBuild = (0, exec_pkg_requires_build_1.pkgRequiresBuild)(manifest, filesIndex);
return {

@@ -126,4 +125,5 @@ local: true,

manifest,
requiresBuild,
};
}
//# sourceMappingURL=index.js.map
{
"name": "@pnpm/directory-fetcher",
"version": "7.0.12",
"version": "8.0.0",
"description": "A fetcher for local directory packages",

@@ -14,6 +14,6 @@ "funding": "https://opencollective.com/pnpm",

"engines": {
"node": ">=16.14"
"node": ">=18.12"
},
"keywords": [
"pnpm8",
"pnpm9",
"pnpm",

@@ -31,11 +31,12 @@ "fetcher"

"dependencies": {
"@pnpm/fetcher-base": "15.0.7",
"@pnpm/fs.packlist": "1.0.3",
"@pnpm/read-project-manifest": "5.0.11",
"@pnpm/resolver-base": "11.1.0",
"@pnpm/types": "9.4.2"
"@pnpm/exec.pkg-requires-build": "1.0.0",
"@pnpm/fetcher-base": "16.0.0",
"@pnpm/fs.packlist": "2.0.0",
"@pnpm/read-project-manifest": "6.0.0",
"@pnpm/resolver-base": "12.0.0",
"@pnpm/types": "10.0.0"
},
"devDependencies": {
"@zkochan/rimraf": "^2.1.3",
"@pnpm/directory-fetcher": "7.0.12",
"@pnpm/directory-fetcher": "8.0.0",
"@pnpm/test-fixtures": "0.1.20"

@@ -42,0 +43,0 @@ },

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