Closed SeiwonPark closed 11 months ago
Regarding prefixColors's default value, and the issue #437, though the document specified as below,
prefixColors
a list of colors as supported by chalk or auto for an automatically picked color.
still the behavior for using API doesn't look quite neat. Here's an example:
// referred code from README const concurrently = require('concurrently'); const { result } = concurrently( [ 'npm:watch-*', { command: 'nodemon', name: 'server' }, { command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } }, { command: 'watch', name: 'watch', cwd: path.resolve(__dirname, 'scripts/watchers'), }, ], { prefix: 'name', killOthers: ['failure', 'success'], restartTries: 3, cwd: path.resolve(__dirname, 'scripts'), prefixColors: ['auto'], // <--------- To use 'auto' option, it needs to be wrapped in a list }, ); result.then(success, failure);
and as the option is prefixColor"s", it makes sense.
prefixColor"s"
But it's literally an auto so rather than wrapping it in a list,
auto
prefixColors: 'auto' // or 'bgMagenta', 'red', 'underline', ... for other available styles
just give it a string like above might not hurt the philosophy of prefixColors's default value.
So it might be another handy option for users I guess. Or how do you think about this?
So I'm suggesting the string type to be able to embrace all the behaviors from users.
string
// src/concurrently.ts - prefixColors?: string[]; + prefixColors?: string | string[];
and updated document for more details.
coverage: 99.197% (-0.1%) from 99.31% when pulling 1add5d6bb0015f1a21eb3773574e829b2931098b on SeiwonPark:fix/prefix-api-type into 16182089336827900ef2fc943b353c14b850cc9b on open-cli-tools:main.
Purpose of this PR
Regarding
prefixColors
's default value, and the issue #437, though the document specified as below,still the behavior for using API doesn't look quite neat. Here's an example:
example
and as the option is
prefixColor"s"
, it makes sense.But it's literally an
auto
so rather than wrapping it in a list,just give it a string like above might not hurt the philosophy of
prefixColors
's default value.So it might be another handy option for users I guess. Or how do you think about this?
What's been updated
So I'm suggesting the
string
type to be able to embrace all the behaviors from users.and updated document for more details.