Skip to content

Latest commit

 

History

History
80 lines (54 loc) · 1.81 KB

CONTRIBUTING.md

File metadata and controls

80 lines (54 loc) · 1.81 KB

Contributing to Lerna

First, ensure you have the latest yarn.

To get started with the repo:

$ git clone [email protected]:lerna/lerna.git && cd lerna
$ yarn

Code Structure

Currently, the source is split up into a few categories:

  • Utilities: methods to run git, npm, fs, and more.
  • Abstractions for packages
  • Lerna Commands: each command has an initialize and execute function.

Commands

In order to run the tests:

$ yarn test

# If you want to watch for changes
$ yarn test:watch

# If you want to watch individual files (e.g., in test/Command.js)
$ yarn test:watch test.command

To run the integration tests:

$ yarn test:watch-integration

# For a specific file
$ yarn test:watch-integration lerna-publish

Or the linter:

$ yarn lint

If you want to test out Lerna on local repos:

$ yarn build
$ yarn link

This will set your global lerna command to the local version.

Note that Lerna needs to be built after changes are made. So you can either run yarn build to run it once, or you can run:

$ yarn dev

Which will start a watch task that will continuously re-build Lerna while you are working on it.

If you would like to check test coverage, run the coverage script, then open coverage/lcov-report/index.html in your favorite browser.

$ yarn test --coverage

# OS X
$ open coverage/lcov-report/index.html

# Linux
$ xdg-open coverage/lcov-report/index.html