To offer built-in color output as option
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the enhancement
After color output improvements (link and https://github.com/actions/toolkit/pull/583) I think it could be interesting to integrate to this toolkit, as an option disabled by default, color output for the following methods
Code Snippet
Current
Change Proposal
import { red, yellow } from 'whatever-lib-to-color-output'
const logColors = {
error: red,
warning: yellow
}
...
function issue(name: string, message: string = '', useColoredMessage: boolean = false): void {
if(!useColoredMessage) issueCommand(name, {}, message)
else {
const paintMessage = logColors[name]
const paintedMessage = paintMessage? paintMessage(message) : message
issueCommand(name, {}, paintMessage(paintedMessage))
}
}
Additional information
Here are some comparisons for some packages for coloring the output:
- https://www.npmtrends.com/colorette-vs-kleur-vs-chalk-vs-colors-vs-ansi-colors
- https://npmcompare.com/compare/ansi-colors,chalk,colorette,colors,kleur
In case this feature has sense, I guess it will need to be discussed how and which external package or internal utility to use.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with packages/core/src/core.ts lines 144-170 and packages/core/src/command.ts lines 32-34 to map the affected methods and current command output. Review the proposed optional coloring behavior and compare the listed package choices or an internal utility. Done means color output is available as a disabled-by-default option for the specified methods.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100