Socket
Socket
Sign inDemoInstall

@pnpm/directory-fetcher

Package Overview
Dependencies
Maintainers
2
Versions
69
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 6.1.0 to 7.0.0

2

lib/index.d.ts
import type { DirectoryFetcher, DirectoryFetcherOptions } from '@pnpm/fetcher-base';
import { type DependencyManifest } from '@pnpm/types';
export interface CreateDirectoryFetcherOptions {

@@ -14,3 +15,4 @@ includeOnlyPackageFiles?: boolean;

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

38

lib/index.js

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

const path_1 = __importDefault(require("path"));
const exportable_manifest_1 = require("@pnpm/exportable-manifest");
const logger_1 = require("@pnpm/logger");
const read_project_manifest_1 = require("@pnpm/read-project-manifest");
const write_project_manifest_1 = require("@pnpm/write-project-manifest");
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
const npm_packlist_1 = __importDefault(require("npm-packlist"));

@@ -39,5 +36,8 @@ const directoryFetcherLogger = (0, logger_1.logger)('directory-fetcher');

const filesIndex = await _fetchAllFilesFromDir(readFileStat, dir);
const manifest = await safeReadProjectManifestAndMakeExportable(dir, filesIndex) ?? {};
if (opts.manifest) {
opts.manifest.resolve(manifest); // eslint-disable-line @typescript-eslint/no-explicit-any
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;
}

@@ -48,2 +48,3 @@ return {

packageImportMethod: 'hardlink',
manifest,
};

@@ -109,5 +110,8 @@ }

const filesIndex = Object.fromEntries(files.map((file) => [file, path_1.default.join(dir, file)]));
const manifest = await safeReadProjectManifestAndMakeExportable(dir, filesIndex) ?? {};
if (opts.manifest) {
opts.manifest.resolve(manifest); // eslint-disable-line @typescript-eslint/no-explicit-any
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;
}

@@ -118,19 +122,5 @@ return {

packageImportMethod: 'hardlink',
manifest,
};
}
async function safeReadProjectManifestAndMakeExportable(dir, filesIndex) {
const manifest = await (0, read_project_manifest_1.safeReadProjectManifestOnly)(dir);
// 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
if (!manifest)
return null;
const exportableManifest = await (0, exportable_manifest_1.createExportableManifest)(dir, manifest);
if ((0, fast_deep_equal_1.default)(manifest, exportableManifest))
return manifest;
const manifestPathOverride = path_1.default.join(dir, 'node_modules/.pnpm/package.json');
await (0, write_project_manifest_1.writeProjectManifest)(manifestPathOverride, exportableManifest);
filesIndex['package.json'] = manifestPathOverride;
return manifest;
}
//# sourceMappingURL=index.js.map
{
"name": "@pnpm/directory-fetcher",
"version": "6.1.0",
"version": "7.0.0",
"description": "A fetcher for local directory packages",

@@ -30,10 +30,7 @@ "funding": "https://opencollective.com/pnpm",

"dependencies": {
"fast-deep-equal": "^3.1.3",
"npm-packlist": "^5.1.3",
"@pnpm/exportable-manifest": "5.0.6",
"@pnpm/fetcher-base": "15.0.0",
"@pnpm/fetcher-base": "15.0.1",
"@pnpm/read-project-manifest": "5.0.5",
"@pnpm/resolver-base": "10.0.2",
"@pnpm/types": "9.2.0",
"@pnpm/write-project-manifest": "5.0.2"
"@pnpm/types": "9.2.0"
},

@@ -43,4 +40,4 @@ "devDependencies": {

"@zkochan/rimraf": "^2.1.3",
"@pnpm/directory-fetcher": "6.1.0",
"@pnpm/test-fixtures": "0.1.6"
"@pnpm/directory-fetcher": "7.0.0",
"@pnpm/test-fixtures": "0.1.7"
},

@@ -47,0 +44,0 @@ "exports": {

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