Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No colors for prefixes when using prefixColors: "auto" via concurrent API #437

Closed
OnkelTem opened this issue Sep 2, 2023 · 3 comments
Closed

Comments

@OnkelTem
Copy link

OnkelTem commented Sep 2, 2023

concurrently: 8.2.1
node: v16.17.0

I use the following script to run concurrent processes:

const fs = require('fs')
const path = require('path')
const concurrently = require('concurrently')

const workspacePaths = JSON.parse(fs.readFileSync('./package.json')).workspaces

const { result } = concurrently(
  workspacePaths.map((wp) => ({
    command: 'npm:dev',
    name: path.basename(wp),
    cwd: path.resolve(__dirname, '../', wp),
  })),
  {
    prefix: 'name',
    killOthers: ['failure', 'success'],
    restartTries: 0,
    prefixColors: 'auto',
  }
)

result.then(
  () => {
    console.log('Success')
  },
  () => {
    console.log('Failed')
  }
)

However, when I run in the terminal, it doesn't show any colors in the prefixes:

image

yet other colors are displayed. What could be the problem?

Thanks in advance.

@OnkelTem OnkelTem changed the title No colors at the output when using prefixColors: "auto" No colors for prefixes at the output when using prefixColors: "auto" Sep 2, 2023
@OnkelTem OnkelTem changed the title No colors for prefixes at the output when using prefixColors: "auto" No colors for prefixes when using prefixColors: "auto" via concurrent API Sep 2, 2023
@SeiwonPark
Copy link
Contributor

Check out API's prefixColors. It says

Docs

prefixColors: a list of colors as supported by chalk or auto for an automatically picked color.

Definition

prefixColors?: string[]

So change it to

prefixColors: ['auto'],

@paescuj
Copy link
Collaborator

paescuj commented Sep 7, 2023

I think @SeiwonPark is right! (Thanks!)
Therefore I'm closing this issue for now, but let me know if that doesn't work either and we'll reopen it.

@paescuj paescuj closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
@OnkelTem
Copy link
Author

Thanks @SeiwonPark

However, an update to the docs was made:

prefixColors: a list of colors or a string as supported by chalk and additional style auto for an automatically picked color.

And I support it. Now it sounds much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants