Files
pnpm/workspace/pkgs-graph
Khải 9b4f73caaf chore(scripts): typecheck-only (#8395)
* 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>
2024-08-11 08:26:01 +02:00
..
2024-08-05 13:45:55 +02:00
2024-08-05 13:45:55 +02:00

@pnpm/workspace.pkgs-graph

Create a graph from an array of packages

npm version

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',
//      },
//    },
//  }

License

MIT © Zoltan Kochan