Giter Club home page Giter Club logo

monorepo-run's Introduction

monorepo-run

Run scripts in monorepo with colors, streaming and separated panes

Mono run screenshot

Installation

yarn global add monorepo-run

Or locally in your project:

yarn add -D monorepo-run

Usage

Execute mono-run <script> to run a NPM script in your monorepo packages.

By default it will understand Yarn workspaces.

To display the command help, use:

mono-run --help

UI

Enable UI layouts with the --ui flag:

mono-run lint --ui row

Mono run UI screenshot

Streaming

By default, mono-run will wait for scripts to complete before displaying the outputs. If you want to get the output as soon as it's written instead, specify the --stream flag:

mono-run dev --stream

You can throttle the output so it's less overwelming in case there are a lot of writes:

# Throttle every 500ms
mono-run dev --stream 500

Examples

In your package.json:

{
  "scripts": {
    "dev": "mono-run dev --stream 500",
    "lint": "mono-run lint",
    "test": "mono-run test"
  }
}

Sponsors

sponsors logos

monorepo-run's People

Contributors

akryum avatar chriscalo avatar erjanmx avatar laquasicinque avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

monorepo-run's Issues

Scrolling sensitivity with --ui flag

The scrolling sensitivity with the --ui flag should be reduced.

It is difficult to scroll through the output of many mono repos because the scroll is too fast.

Handle terminal resize

Currently resizing the terminal when using the UI breaks the layout and boxes are not resized.

Doesnt work on Windows

I have 10 team members who all use Windows laptops for development and all of them are getting the same error message when trying to run the mono-run test command. I am the only dev with a Mac and all of the mono-run commands work fine for me. Any idea on why the Windows machines cant run the library?

error:
Error: spawn UNKNOWN

stacktrace:
λ yarn run-test-all
yarn run v1.19.1
$ mono-run test --ui column
internal/child_process.js:366
throw errnoException(err, 'spawn');
^
Error: spawn UNKNOWN
at ChildProcess.spawn (internal/child_process.js:366:11)
at Object.spawn (child_process.js:551:9)
at Object. (C:\Users\jahuja\AppData\Roaming\npm\node_modules\monorepo-run\src\bin\mono-run.js:9:18)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
error Command failed with exit code 1.

How to pass arguments to child scripts?

For example, I run the lint script without any arguments and I want to able to pass the --fix argument directly from CLI. I try to configure it:

  "scripts": {
    "lint": "mono-run lint --"
  },

and use:

yarn lint --fix

but it has no effect.

Now I use wsrun for this case and it works. But how can I use monorepo-run for this?

P.S.: Even though wsrun works, but your UI looks better for me! Great job, thank you!

monorepo-run exits with 0 even if script failed

I have 3 commits in this PR that demonstrate the problem:

mAAdhaTTah/brookjs#757

  • The first commit has everything passing.
  • The second commit switches to lerna to run the tests & they fail.
  • The third commit is the a fix. (The remaining problem is caused by the loss of colors in the output, which monorepo-run fixes)

The tests for brookjs-desalinate failed but the script still exited with code 0.

dependency-ordered incremental execution of scripts

It'd be nice to have depnedency-ordered incremental runs. F.e. having multiple packages where a command needs to be ran in certain packages first in order for subsequent run in dependent packages to succeed. And on second run of mono-run of a specific script, it'd be nice for it not to run the script for packages that haven't changed (perhaps by supplying mono-run an option like --incremental).

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.