mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-25 03:27:07 -05:00
* chore(scripts): typecheck-only * feat: change all configuration * feat: include pnpm/ and pnpm/test/ * chore(deps): remove unused dependency * refactor(typescript-only): use find-packages * refactor(typescript-only): refactor paths * fix: typescript-only * fix: update compile-only * fix: compile pnpm * fix: windows * fix: windows * chore: meta-updater * refactor(tsconfig): remove explicit composite * fix: path in windows * feat: don't depend on cwd --------- Co-authored-by: Zoltan Kochan <z@kochan.io>
@pnpm/workspace.pkgs-graph
Create a graph from an array of packages
Installation
pnpm add @pnpm/workspace.pkgs-graph
Usage
import createPkgsGraph from 'pkgs-graph'
const {graph} = createPkgsGraph([
{
dir: '/home/zkochan/src/foo',
manifest: {
name: 'foo',
version: '1.0.0',
dependencies: {
bar: '^1.0.0',
},
},
},
{
dir: '/home/zkochan/src/bar',
manifest: {
name: 'bar',
version: '1.1.0',
},
}
])
console.log(graph)
//> {
// '/home/zkochan/src/foo': {
// dependencies: ['/home/zkochan/src/bar'],
// manifest: {
// name: 'foo',
// version: '1.0.0',
// dependencies: {
// bar: '^1.0.0',
// },
// },
// },
// '/home/zkochan/src/bar': {
// dependencies: [],
// manifest: {
// name: 'bar',
// version: '1.1.0',
// },
// },
// }