pkgs-graph
Advanced tools
Comparing version 5.1.5 to 5.2.0
@@ -22,3 +22,5 @@ export declare type Manifest = { | ||
}; | ||
export default function <T>(pkgs: Array<Package & T>): { | ||
export default function <T>(pkgs: Array<Package & T>, opts?: { | ||
linkWorkspacePackages?: boolean; | ||
}): { | ||
graph: { | ||
@@ -25,0 +27,0 @@ [id: string]: PackageNode<T>; |
@@ -7,3 +7,3 @@ "use strict"; | ||
const R = require("ramda"); | ||
function default_1(pkgs) { | ||
function default_1(pkgs, opts) { | ||
const pkgMap = createPkgMap(pkgs); | ||
@@ -26,4 +26,5 @@ const unmatched = []; | ||
let rawSpec = dependencies[depName]; | ||
const isWorkspaceSpec = rawSpec.startsWith('workspace:'); | ||
try { | ||
if (rawSpec.startsWith('workspace:')) { | ||
if (isWorkspaceSpec) { | ||
rawSpec = rawSpec.substr(10); | ||
@@ -50,2 +51,8 @@ } | ||
.map(pkg => pkg.manifest.version); | ||
// explicitly check if false, backwards-compatibility (can be undefined) | ||
const strictWorkspaceMatching = (opts === null || opts === void 0 ? void 0 : opts.linkWorkspacePackages) === false && !isWorkspaceSpec; | ||
if (strictWorkspaceMatching) { | ||
unmatched.push({ pkgName: depName, range: rawSpec }); | ||
return ''; | ||
} | ||
if (versions.includes(rawSpec)) { | ||
@@ -52,0 +59,0 @@ const matchedPkg = pkgs.find(pkg => pkg.manifest.name === depName && pkg.manifest.version === rawSpec); |
{ | ||
"name": "pkgs-graph", | ||
"version": "5.1.5", | ||
"version": "5.2.0", | ||
"description": "Create a graph from an array of packages", | ||
@@ -29,3 +29,3 @@ "main": "lib/index.js", | ||
"devDependencies": { | ||
"@types/ramda": "^0.27.3", | ||
"@types/ramda": "^0.27.6", | ||
"better-path-resolve": "1.0.0", | ||
@@ -38,3 +38,4 @@ "pkgs-graph": "link:" | ||
"ramda": "^0.27.0" | ||
} | ||
}, | ||
"funding": "https://opencollective.com/pnpm" | ||
} |
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
7657
6
109