@pnpm/link-bins
Advanced tools
Comparing version 4.1.0 to 4.2.0
import { DependencyManifest } from '@pnpm/types'; | ||
declare const _default: (modules: string, binPath: string, opts: { | ||
allowExoticManifests?: boolean | undefined; | ||
warn: (msg: string) => void; | ||
@@ -4,0 +5,0 @@ }) => Promise<void>; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const package_bins_1 = require("@pnpm/package-bins"); | ||
const read_importer_manifest_1 = require("@pnpm/read-importer-manifest"); | ||
const read_package_json_1 = require("@pnpm/read-package-json"); | ||
@@ -20,6 +21,7 @@ const cmdShim = require("@zkochan/cmd-shim"); | ||
const pkgDirs = await getPkgDirs_1.default(modules, opts.warn); | ||
const pkgBinOpts = Object.assign({ allowExoticManifests: false }, opts); | ||
const allCmds = R.unnest((await Promise.all(pkgDirs | ||
.filter((dir) => !isSubdir(dir, binPath)) // Don't link own bins | ||
.map(normalizePath) | ||
.map((target) => getPackageBins(target, opts.warn)))) | ||
.map((target) => getPackageBins(target, pkgBinOpts)))) | ||
.filter((cmds) => cmds.length)); | ||
@@ -53,6 +55,6 @@ return linkBins(allCmds, binPath, opts); | ||
} | ||
async function getPackageBins(target, warn) { | ||
const pkg = await safeReadPkg(target); | ||
async function getPackageBins(target, opts) { | ||
const pkg = opts.allowExoticManifests ? await safeReadImporterManifestOnly(target) : await safeReadPkg(target); | ||
if (!pkg) { | ||
warn(`There's a directory in node_modules without package.json: ${target}`); | ||
opts.warn(`There's a directory in node_modules without package.json: ${target}`); | ||
return []; | ||
@@ -92,2 +94,13 @@ } | ||
} | ||
async function safeReadImporterManifestOnly(importerDir) { | ||
try { | ||
return await read_importer_manifest_1.readImporterManifestOnly(importerDir); | ||
} | ||
catch (err) { | ||
if (err.code === 'ENOENT') { | ||
return null; | ||
} | ||
throw err; | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@pnpm/link-bins", | ||
"version": "4.1.0", | ||
"version": "4.2.0", | ||
"description": "Link bins to node_modules/.bin", | ||
@@ -37,2 +37,3 @@ "main": "lib/index.js", | ||
"@pnpm/package-bins": "^3.1.0", | ||
"@pnpm/read-importer-manifest": "^1.0.0", | ||
"@pnpm/read-package-json": "^2.0.0", | ||
@@ -57,3 +58,2 @@ "@pnpm/types": "^3.0.0", | ||
"@types/tape": "^4.2.31", | ||
"@types/tempy": "^0.3.0", | ||
"mos": "^2.0.0-alpha.3", | ||
@@ -60,0 +60,0 @@ "mos-plugin-readme": "^1.0.4", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15393
18
158
13
+ Added@babel/code-frame@7.25.7(transitive)
+ Added@babel/helper-validator-identifier@7.25.7(transitive)
+ Added@babel/highlight@7.25.7(transitive)
+ Added@pnpm/error@1.0.0(transitive)
+ Added@pnpm/read-importer-manifest@1.0.9(transitive)
+ Added@pnpm/write-importer-manifest@3.0.0(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addeddetect-indent@6.0.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedfast-deep-equal@2.0.1(transitive)
+ Addedgraceful-fs@4.2.1(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedimurmurhash@0.1.4(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-plain-obj@2.1.0(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedjson5@2.1.0(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedmake-dir@3.1.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedparse-json@5.0.0(transitive)
+ Addedpicocolors@1.1.0(transitive)
+ Addedpify@4.0.1(transitive)
+ Addedread-yaml-file@1.1.0(transitive)
+ Addedsemver@6.3.1(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsort-keys@3.0.04.0.0(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedstrip-bom@3.0.04.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedwrite-file-atomic@2.4.3(transitive)
+ Addedwrite-json-file@4.0.0(transitive)
+ Addedwrite-json5-file@2.1.2(transitive)
+ Addedwrite-yaml-file@3.0.1(transitive)