Coder Social home page Coder Social logo

purple-technology / lerna-smart-run Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 1.0 43 KB

Lerna add-on for only running npm script for packages changed since previous tag

Home Page: https://blog.purple-technology.com/make-your-lerna-smarter/

License: MIT License

JavaScript 100.00%
monorepo lerna optimization

lerna-smart-run's Introduction

lerna-smart-run

Lerna add-on for only running npm scripts for packages changed since previous tag

About: https://blog.purple-technology.com/make-your-lerna-smarter/

Background

This package is a glorified wrapper around ordinary lerna run <script> commands, but it implements a system to control the order of execution and an automated, opionated tagging system (based on git branches) that takes advantage of lerna's --since option.

This package is intended for use in CI and CD pipelines, especially where sequential deploys are necessary, i.e., where one serverless resource needs to be deployed before the rest.

Usage

Invoke with smartRun <npm script>, where <npm script> is a script from the scripts section of the package.json of one of your lerna packages.

Example:

smartRun test

Optional arguments

Pass --tagOnSuccess to generate a tag from the successful execution of the smart run. This tag will be used on the following execution.

Pass --deleteTagOnSuccess to delete the previous tag on the successful execution of the smart run. If there was no previous tag this has no effect.

Pass --runFirst to run a package's script before any others. If multiple packages are passed to this option, they're run in sequence as well. Supports glob patterns.

Pass --runLast to run a package's script after any others. If multiple packages are passed to this option, they're run in sequence as well. Supports glob patterns.

Pass --scope if you want to run the command for a package even if it hasn't changed, but one of its dependencies has.

Pass --ignore if you want to ignore a package, but you still want to run the command for any of its dependents if they've changed.

Special arguments

If --deleteTag is passed, this simply looks for the most recent tag generated by this package and deletes it. After which the script exists. Example:

smartRun --deleteTag

Disclaimer

This package is in an early, experimental stage, and is likely to change dramatically between different versions.

lerna-smart-run's People

Contributors

brno32 avatar filippyrek avatar

Stargazers

Tuan Duc Tran avatar  avatar Bronislav Sedlák avatar Andrejs Agejevs avatar Benoît Bouré avatar Roman Hossain Shaon avatar David Wells avatar

Watchers

David Wells avatar James Cloos avatar  avatar

Forkers

davidwells

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.