@pnpm/link-bins
Advanced tools
Comparing version 6.0.2 to 6.0.3
# @pnpm/link-bins | ||
## 6.0.3 | ||
### Patch Changes | ||
- a1a03d145: Import only the required functions from ramda. | ||
## 6.0.2 | ||
@@ -4,0 +10,0 @@ |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -39,3 +20,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const p_settle_1 = __importDefault(require("p-settle")); | ||
const R = __importStar(require("ramda")); | ||
const fromPairs_1 = __importDefault(require("ramda/src/fromPairs")); | ||
const isEmpty_1 = __importDefault(require("ramda/src/isEmpty")); | ||
const union_1 = __importDefault(require("ramda/src/union")); | ||
const unnest_1 = __importDefault(require("ramda/src/unnest")); | ||
const partition_1 = __importDefault(require("ramda/src/partition")); | ||
const IS_WINDOWS = is_windows_1.default(); | ||
@@ -53,3 +38,3 @@ const EXECUTABLE_SHEBANG_SUPPORTED = !IS_WINDOWS; | ||
}; | ||
const allCmds = R.unnest((await Promise.all(allDeps | ||
const allCmds = unnest_1.default((await Promise.all(allDeps | ||
.map((depName) => path_1.default.resolve(modulesDir, depName)) | ||
@@ -65,3 +50,3 @@ .filter((depDir) => !is_subdir_1.default(depDir, binsDir)) // Don't link own bins | ||
return []; | ||
const allCmds = R.unnest((await Promise.all(pkgs | ||
const allCmds = unnest_1.default((await Promise.all(pkgs | ||
.map(async (pkg) => getPackageBinsFromManifest(pkg.manifest, pkg.location)))) | ||
@@ -76,5 +61,5 @@ .filter((cmds) => cmds.length)); | ||
await fs_1.promises.mkdir(binsDir, { recursive: true }); | ||
const [cmdsWithOwnName, cmdsWithOtherNames] = R.partition(({ ownName }) => ownName, allCmds); | ||
const [cmdsWithOwnName, cmdsWithOtherNames] = partition_1.default(({ ownName }) => ownName, allCmds); | ||
const results1 = await p_settle_1.default(cmdsWithOwnName.map(async (cmd) => linkBin(cmd, binsDir))); | ||
const usedNames = R.fromPairs(cmdsWithOwnName.map((cmd) => [cmd.name, cmd.name])); | ||
const usedNames = fromPairs_1.default(cmdsWithOwnName.map((cmd) => [cmd.name, cmd.name])); | ||
const results2 = await p_settle_1.default(cmdsWithOtherNames.map(async (cmd) => { | ||
@@ -109,3 +94,3 @@ if (usedNames[cmd.name]) { | ||
} | ||
if (R.isEmpty(manifest.bin) && !await isFromModules(target)) { | ||
if (isEmpty_1.default(manifest.bin) && !await isFromModules(target)) { | ||
opts.warn(`Package in ${target} must have a non-empty bin field to get bin linked.`, 'EMPTY_BIN'); | ||
@@ -135,3 +120,3 @@ } | ||
if (path_1.default.relative(cmd.path, binsParentDir) !== '') { | ||
nodePath = R.union(nodePath, await getBinNodePaths(binsParentDir)); | ||
nodePath = union_1.default(nodePath, await getBinNodePaths(binsParentDir)); | ||
} | ||
@@ -146,3 +131,3 @@ return cmd_shim_1.default(cmd.path, externalBinPath, { | ||
const targetRealPath = await fs_1.promises.realpath(targetDir); | ||
return R.union(module_1.default['_nodeModulePaths'](targetRealPath), module_1.default['_nodeModulePaths'](targetDir)); | ||
return union_1.default(module_1.default['_nodeModulePaths'](targetRealPath), module_1.default['_nodeModulePaths'](targetDir)); | ||
} | ||
@@ -149,0 +134,0 @@ async function safeReadPkgJson(pkgDir) { |
{ | ||
"name": "@pnpm/link-bins", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "Link bins to node_modules/.bin", | ||
@@ -31,3 +31,3 @@ "main": "lib/index.js", | ||
"@pnpm/types": "7.1.0", | ||
"@zkochan/cmd-shim": "^5.0.0", | ||
"@zkochan/cmd-shim": "^5.1.1", | ||
"is-subdir": "^1.1.1", | ||
@@ -34,0 +34,0 @@ "is-windows": "^1.0.2", |
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
20209
151
Updated@zkochan/cmd-shim@^5.1.1