pkgs-graph
Advanced tools
Comparing version 3.0.0 to 4.0.0
@@ -0,1 +1,2 @@ | ||
/// <reference path="../typings/index.d.ts" /> | ||
export declare type Manifest = { | ||
@@ -18,8 +19,9 @@ name: string; | ||
}; | ||
export declare type PackageNode = Package & { | ||
export declare type PackageNode<T> = { | ||
package: Package & T; | ||
dependencies: string[]; | ||
}; | ||
export default function (pkgs: Package[]): { | ||
export default function <T>(pkgs: Array<Package & T>): { | ||
graph: { | ||
[id: string]: PackageNode; | ||
[id: string]: PackageNode<T>; | ||
}; | ||
@@ -26,0 +28,0 @@ unmatched: Array<{ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
///<reference path="../typings/index.d.ts"/> | ||
const npa = require("@zkochan/npm-package-arg"); | ||
const path = require("path"); | ||
const R = require("ramda"); | ||
const semver = require("semver"); | ||
const R = require("ramda"); | ||
const npa = require("@zkochan/npm-package-arg"); | ||
function default_1(pkgs) { | ||
@@ -12,4 +14,4 @@ const pkgMap = createPkgMap(pkgs); | ||
acc[pkgSpec] = { | ||
manifest: pkgMap[pkgSpec].manifest, | ||
dependencies: createNode(pkgMap[pkgSpec]) | ||
dependencies: createNode(pkgMap[pkgSpec]), | ||
package: pkgMap[pkgSpec], | ||
}; | ||
@@ -31,3 +33,3 @@ return acc; | ||
if (spec.type === 'directory') { | ||
const matchedPkg = R.values(pkgMap).find(pkg => pkg.path === spec.fetchSpec); | ||
const matchedPkg = R.values(pkgMap).find(pkg => path.relative(pkg.path, spec.fetchSpec) === ''); | ||
if (!matchedPkg) { | ||
@@ -34,0 +36,0 @@ return ''; |
{ | ||
"name": "pkgs-graph", | ||
"version": "3.0.0", | ||
"version": "4.0.0", | ||
"description": "Create a graph from an array of packages", | ||
@@ -11,10 +11,8 @@ "main": "lib/index.js", | ||
"scripts": { | ||
"test": "preview && ts-node test --type-check", | ||
"lint": "tslint -c tslint.json src/**/*.ts test/**/*.ts", | ||
"test": "npm run tsc && pnpm run lint && ts-node test --type-check", | ||
"tsc": "tsc", | ||
"prepublishOnly": "npm run tsc" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/zkochan/pkgs-graph.git" | ||
}, | ||
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/pkgs-graph", | ||
"author": { | ||
@@ -27,19 +25,22 @@ "name": "Zoltan Kochan", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=8.15" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/zkochan/pkgs-graph/issues" | ||
"url": "https://github.com/pnpm/pnpm/issues" | ||
}, | ||
"homepage": "https://github.com/zkochan/pkgs-graph#readme", | ||
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/pkgs-graph#readme", | ||
"devDependencies": { | ||
"@pnpm/tslint-config": "0.0.0", | ||
"@types/node": "*", | ||
"@types/ramda": "^0.26.0", | ||
"@types/semver": "^6.0.0", | ||
"@types/tape": "^4.2.29", | ||
"package-preview": "^2.0.0", | ||
"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" | ||
}, | ||
"dependencies": { | ||
"@types/node": "*", | ||
"@types/ramda": "^0.26.0", | ||
"@types/semver": "^5.3.31", | ||
"@zkochan/npm-package-arg": "^1.0.0", | ||
@@ -46,0 +47,0 @@ "ramda": "^0.26.0", |
@@ -5,3 +5,3 @@ # pkgs-graph | ||
[![Build Status](https://img.shields.io/travis/zkochan/pkgs-graph/master.svg)](https://travis-ci.org/zkochan/pkgs-graph) [![npm version](https://img.shields.io/npm/v/pkgs-graph.svg)](https://www.npmjs.com/package/pkgs-graph) | ||
[![npm version](https://img.shields.io/npm/v/pkgs-graph.svg)](https://www.npmjs.com/package/pkgs-graph) | ||
@@ -11,3 +11,3 @@ ## Installation | ||
``` | ||
npm i -g pkgs-graph | ||
<npm|yarn|pnpm> add pkgs-graph | ||
``` | ||
@@ -14,0 +14,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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
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
9429
3
98
11
1
1
- Removed@types/node@*
- Removed@types/ramda@^0.26.0
- Removed@types/semver@^5.3.31
- Removed@types/node@22.10.2(transitive)
- Removed@types/ramda@0.26.44(transitive)
- Removed@types/semver@5.5.0(transitive)
- Removedts-toolbelt@6.15.5(transitive)
- Removedundici-types@6.20.0(transitive)