Skip to content

Instantly share code, notes, and snippets.

@fedecarg
Last active November 26, 2019 10:56
Show Gist options
  • Save fedecarg/65410cd7aae1768b048dc48d652b61f5 to your computer and use it in GitHub Desktop.
Save fedecarg/65410cd7aae1768b048dc48d652b61f5 to your computer and use it in GitHub Desktop.
Lerna: validate only the packages that have changed since the last tagged release
function lerna_lint() {
npx lerna exec $(for package_dir in `npx lerna changed -p`; do echo -n " --scope $(basename ${package_dir})"; done) -- yarn lint
}
function lerna_test() {
npx lerna exec $(for package_dir in `npx lerna changed -p`; do echo -n " --scope $(basename ${package_dir})"; done) -- yarn test
}
function validate() {
lerna_lint
lerna_test
}
# ------------------------------------------------------------
# Aliases
# ------------------------------------------------------------
alias lerna_validate=lerna_validate
alias lerna_lint=lerna_lint
alias lerna_test=lerna_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment