open-cli-tools / concurrently

Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.
https://www.npmjs.com/package/concurrently
MIT License
6.98k stars 227 forks source link

API (concurrently) not printing to stdout unless raw=true #478

Closed rr326 closed 3 months ago

rr326 commented 3 months ago

Using the concurrently() API, it is not printing to stdout, unless raw:true.

test.js

import { concurrently } from "concurrently"

const build = {
    command: "ls -al",
    name: "TSC",
},
servDev = {
    command: "ls -al ",  
    name: "SERVER",
},
cmds =  [build, servDev]

const {result} = concurrently(cmds, {raw:false})

node test.js No output.

Set raw:true ==> expected output

# macos

node --version
v21.7.2

npx concurrently -v
8.2.2
gustavohenke commented 3 months ago

I think you might've hit the same issue as #399.

- import { concurrently } from "concurrently"
+ import concurrently from "concurrently"

should fix it.

rr326 commented 3 months ago

@gustavohenke Thank you! That makes sense.

CodeSmith32 commented 2 months ago

@rr326, Just fyi, this is really confusing, esp. since VSCode / TypeScript likes to import the named version automatically by default.

I'm so glad I stumbled across this closed issue; otherwise I would've given up.

Is this really not something that could be fixed or at least clarified? Is there ever even a reason to import the named version / does any project actually rely on it?

rr326 commented 2 months ago

@gustavohenke Is there a way to throw a warning (console.log) if it is imported and used improperly? Or even just if it is imported this way? That might strike the right balance between not breaking anything, and preventing people from making this very hard to spot mistake.

As someone who uses tons of open source projects of which I just skim the docs, I really value when they print a warning saying, "Hmmm... are you really intending to use this in this really dumb way?"

gustavohenke commented 2 months ago

Hey folks, your concerns should be fixed on the main branch by #456, it's just that there are a few other major/breaking changes coming along too.

rr326 commented 2 months ago

@gustavohenke That's awesome. Thank you Gustavo.