pkgs-graph
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -1,2 +0,1 @@ | ||
/// <reference path="../typings/index.d.ts" /> | ||
export declare type Manifest = { | ||
@@ -3,0 +2,0 @@ name: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
///<reference path="../typings/index.d.ts"/> | ||
const npa = require("@zkochan/npm-package-arg"); | ||
@@ -25,4 +24,8 @@ const path = require("path"); | ||
let spec; | ||
let rawSpec = dependencies[depName]; | ||
try { | ||
spec = npa.resolve(depName, dependencies[depName], pkg.path); | ||
if (rawSpec.startsWith('workspace:')) { | ||
rawSpec = rawSpec.substr(10); | ||
} | ||
spec = npa.resolve(depName, rawSpec, pkg.path); | ||
} | ||
@@ -41,3 +44,2 @@ catch (err) { | ||
return ''; | ||
const range = dependencies[depName]; | ||
const pkgs = R.values(pkgMap).filter(pkg => pkg.manifest.name === depName); | ||
@@ -47,9 +49,9 @@ if (!pkgs.length) | ||
const versions = pkgs.map(pkg => pkg.manifest.version); | ||
if (versions.indexOf(range) !== -1) { | ||
const matchedPkg = pkgs.find(pkg => pkg.manifest.name === depName && pkg.manifest.version === range); | ||
if (versions.indexOf(rawSpec) !== -1) { | ||
const matchedPkg = pkgs.find(pkg => pkg.manifest.name === depName && pkg.manifest.version === rawSpec); | ||
return matchedPkg.path; | ||
} | ||
const matched = semver.maxSatisfying(versions, range); | ||
const matched = semver.maxSatisfying(versions, rawSpec); | ||
if (!matched) { | ||
unmatched.push({ pkgName: depName, range }); | ||
unmatched.push({ pkgName: depName, range: rawSpec }); | ||
return ''; | ||
@@ -71,2 +73,1 @@ } | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "pkgs-graph", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"description": "Create a graph from an array of packages", | ||
@@ -12,5 +12,5 @@ "main": "lib/index.js", | ||
"lint": "tslint -c tslint.json src/**/*.ts test/**/*.ts", | ||
"test": "npm run tsc && pnpm run lint && ts-node test --type-check", | ||
"test": "pnpm run tsc && pnpm run lint && ts-node test --type-check", | ||
"tsc": "tsc", | ||
"prepublishOnly": "npm run tsc" | ||
"prepublishOnly": "pnpm run tsc" | ||
}, | ||
@@ -32,13 +32,7 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/pkgs-graph", | ||
"devDependencies": { | ||
"@pnpm/tslint-config": "0.0.0", | ||
"@types/node": "*", | ||
"@types/ramda": "^0.26.0", | ||
"@types/semver": "^6.0.0", | ||
"@types/tape": "^4.2.29", | ||
"@types/semver": "6", | ||
"better-path-resolve": "1.0.0", | ||
"pkgs-graph": "link:", | ||
"tape": "^4.6.3", | ||
"ts-node": "^8.0.3", | ||
"tslint": "5.16.0", | ||
"typescript": "^3.0.0" | ||
"tape": "4.11.0" | ||
}, | ||
@@ -48,4 +42,4 @@ "dependencies": { | ||
"ramda": "^0.26.0", | ||
"semver": "^6.0.0" | ||
"semver": "6.3.0" | ||
} | ||
} |
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
5
99
6753
5
+ Addedsemver@6.3.0(transitive)
- Removedsemver@6.3.1(transitive)
Updatedsemver@6.3.0