I have a monorepo when I am introducing more an more reasonml (to replace slowly js+flow).
I am currently using babel watch mode in development to transpile and use the code almost instantly (for unit test and/or tool itself that is using itself to built its doc website).
In addition to babel, I also now need bsb (reasonml -> javascript "transpiler" to make it short) and it's watch mode, for the same reason I transpile modern ES.
tl;dr
lerna exec --parallel -- bsb -make-world -w
is impossible to use.
According to my investigation, it's probably due to something in bsb itself, looking for stdin or crashing but in practice, changing this line
|
options.stdio = ["ignore", "pipe", "pipe"]; |
with "inherit", "pipe", "pipe" or "pipe" (just NOT using ignore for stdin), bsb watch mode (bsb -make-world -w) works with lerna exec --parallel (or --stream I guess, according to the codebase).
Expected Behavior
I would expect that lerna exec --parallel -- bsb -make-world -w works like lerna exec --parallel -- babel -w src --optional runtime --out-dir lib
Current Behavior
Currently, as soon as I use --parallel or --stream, one of the first bsb process crash
~/Sync/Development/phenomic master* ⇡ 10s
❯ lerna exec --parallel -- bsb -make-world -w
lerna notice cli v3.4.3
lerna info filter [ '!website', '!@phenomic/example-*' ]
lerna info Executing command in 16 packages: "bsb -make-world -w"
@phenomic/api-client: >>>> Start compiling
@phenomic/api-client: Rebuilding since just got started
@phenomic/api-client: ninja: Entering directory `lib/bs'
@phenomic/babel-preset: >>>> Start compiling
@phenomic/babel-preset: Rebuilding since just got started
@phenomic/api-client: [1/2] Building src/phenomicApiClient.mlast
@phenomic/api-client: [2/2] Building src/phenomicApiClient.mlast.d
@phenomic/cli: >>>> Start compiling
@phenomic/cli: Rebuilding since just got started
@phenomic/core: ninja: no work to do.
@phenomic/babel-preset: ninja: Entering directory `lib/bs'
@phenomic/babel-preset: ninja: no work to do.
@phenomic/api-client: [1/1] Building src/phenomicApiClient.cmj
lerna ERR! bsb -make-world -w exited 2 in '@phenomic/api-client'
lerna ERR! bsb -make-world -w stdout:
>>>> Start compiling
Rebuilding since just got started
ninja: Entering directory `lib/bs'
[1/2] Building src/phenomicApiClient.mlast
[2/2] Building src/phenomicApiClient.mlast.d
[1/1] Building src/phenomicApiClient.cmj
lerna ERR! bsb -make-world -w exited 2 in '@phenomic/api-client'
lerna WARN complete Waiting for 15 child processes to exit. CTRL-C to exit immediately.
Possible Solution
I am not sure if not ignoring stdin for streamed spawned process is a good thing or not, but if that's an option that would fix my issue.
Steps to Reproduce (for bugs)
git clone https://github.com/phenomic/phenomic
cd phenomic
yarn
lerna exec --parallel -- bsb -make-world
lerna exec --parallel -- bsb -make-world -w
The last line will fail
Context
You got enough with the previous informations.
Your Environment
| Executable |
Version |
lerna --version |
3.4.3 |
npm --version |
6.1.0 |
yarn --version |
1.10.1 |
node --version |
v10.7.0 |
I have a monorepo when I am introducing more an more reasonml (to replace slowly js+flow).
I am currently using babel watch mode in development to transpile and use the code almost instantly (for unit test and/or tool itself that is using itself to built its doc website).
In addition to babel, I also now need
bsb(reasonml -> javascript "transpiler" to make it short) and it's watch mode, for the same reason I transpile modern ES.tl;dr
is impossible to use.
According to my investigation, it's probably due to something in
bsbitself, looking for stdin or crashing but in practice, changing this linelerna/core/child-process/index.js
Line 35 in 8e86e1e
with
"inherit", "pipe", "pipe"or"pipe"(just NOT usingignorefor stdin), bsb watch mode (bsb -make-world -w) works withlerna exec --parallel(or--streamI guess, according to the codebase).Expected Behavior
I would expect that
lerna exec --parallel -- bsb -make-world -wworks likelerna exec --parallel -- babel -w src --optional runtime --out-dir libCurrent Behavior
Currently, as soon as I use --parallel or --stream, one of the first bsb process crash
Possible Solution
I am not sure if not ignoring stdin for streamed spawned process is a good thing or not, but if that's an option that would fix my issue.
Steps to Reproduce (for bugs)
The last line will fail
Context
You got enough with the previous informations.
Your Environment
lerna --versionnpm --versionyarn --versionnode --version