Nine Parsecs from Milwaukee

    @semrel-extra/topo
    TypeScript icon, indicating that this package has built-in type declarations

    1.4.4 • Public • Published

    @semrel-extra/topo

    CI Maintainability Test Coverage

    Helper to resolve monorepo dependencies graph by workspaces

    Install

    yarn add @semrel-extra/topo

    Usage

    import { topo } from '@semrel-extra/topo'
    
    const graph = topo({
      workspaces: ['packages/*'],
      cwd: '/path/to/project/root'
    })
    
    {
      queue: ['pkg-a', 'pkg-b', 'pkg-z', 'pkg-y', 'pkg-x'],
      nodes: ['pkg-a', 'pkg-b', 'pkg-x', 'pkg-y', 'pkg-z'],
      edges: [
        ['pkg-a', 'pkg-b'],
        ['pkg-z', 'pkg-y'],
        ['pkg-y', 'pkg-x'],
      ],
      // packages entries map
      packages: {
        'pkg-a': {
          manifest: {
            name: 'pkg-a',
            dependencies: {}
          },
          manifestPath: '/path/to/project/root/packages/a/package.json',
          path: 'packages/a', // legacy
          relPath: 'packages/a',
          absPath: '/path/to/project/root/packages/a'
        },
        'pkg-b': {...},
        ...
      }
    }

    filter()

    Filter option is a function: gets IPackageEntry as argument, returns boolean

    const graph = topo({
      workspaces: ['packages/*'],
      cwd: '/path/to/project/root',
      filter: ({manifest}) => !manifest.private // to omit private packages from graph
    })

    License

    MIT

    Install

    npm i @semrel-extra/topo

    DownloadsWeekly Downloads

    1,918

    Version

    1.4.4

    License

    MIT

    Unpacked Size

    18.4 kB

    Total Files

    8

    Last publish

    Collaborators

    • dhoulb
    • semrel-extra-bot
    • antongolub