DEV Community

Tally Barak
Tally Barak

Posted on

Lerna Graph

If you are using Lerna or have a monorepo that is compliant with Lerna structure - this is a Github Action you would love.

The action generates a graph for all the Lerna packages in the repo and their current version.

Alt Text

Important!!!
Even if you do not use Lerna, you can simply add a lerna.json file with minimal configuration (packages, version) and the action will work!

You can find this action in the marketplace

Submission Category:

Maintainer Must-Haves

Yaml File or Link to Code

GitHub logo Tallyb / lerna-graph-action

Github action to generate a lerna graph

Lerna Graph Action

This action generates a graph of all Lerna packages in their current version:

Lerna Graph


Usage:

See parametes in action.yml

Persist the graph on Github artifacts to view them later

steps:
- uses: actions/checkout@v2

- run: mkdir -p graph

- name: Lerna Graph
- uses: lerdajs/lerna-graph-action
  with: 
    rootPath: .
    path: graph/image.png

- uses: actions/upload-artifact@v2
  with:
    name: lerna graph
    path: graph/image.png

FAQ

Do I need to use Lerna for this action?

This action can work with any repository that is compliant with Lerna structure (i.e. multiple package.json files). You do not have to use Lerna to install or publish the packages. The only requirement is have a lerna.json file that marks your packages folders.




Additional Resources / Info

You cannot go more meta than this: Lerna project graph generated by this action

Top comments (0)