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

Add colors #365

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Add colors #365

merged 3 commits into from
Sep 26, 2024

Conversation

macmv
Copy link
Contributor

@macmv macmv commented Sep 24, 2024

Ticket(s): ENG-6785

Core is adding support for colors as query parameters from schema endpoints. This PR adds colors to all the schema commands.

This uses a library to check if colors are enabled, which will detect things like if we're in a TTY, and it'll detect common CI environments for us.

Additionally, new global --color and --no-color flags have been added. The library supports-color will parse sys.argv, and enable/disable colors accordingly. Because oclif makes it difficult to check if an optional flag is set, I'm going to leave this as-is, but it is currently quite brittle.

Testing has been manual, oclif doesn't provide a way to unit test with colors.

package.json Show resolved Hide resolved
src/lib/color.ts Outdated Show resolved Hide resolved
src/lib/fauna-command.js Outdated Show resolved Hide resolved
@macmv macmv merged commit 1231c36 into main Sep 26, 2024
1 check passed
@macmv macmv deleted the request-colors branch September 26, 2024 21:26
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

Successfully merging this pull request may close these issues.

2 participants