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

Clean up output formatting and support colorizing FQL results #496

Merged
merged 17 commits into from
Dec 10, 2024

Conversation

ecooper
Copy link
Contributor

@ecooper ecooper commented Dec 9, 2024

Problem

We do not support copy-pasta FQL in shell and query.

Solution

Use shiki and port over its codeToANSI function so it can support custom languages.

However by supporting FQL rendering, nearly all the tests broke. So while I was here:

  • Added an argv dev command for testing when you just want to prove argv
  • Delete the key commands since we were going to anyway so I didn't need to update their tests
  • Update shell and query to support data formats for v10.
  • Removed any dead code I came across

Result

When outputting non-text, you can pass it to colorize with a format and it will format it.

Screenshot 2024-12-09 at 2 08 30 PM

Screenshot 2024-12-09 at 2 08 42 PM

Screenshot 2024-12-09 at 2 08 58 PM

Testing

All tests needed to be updated to support fql by default.

@ecooper ecooper marked this pull request as ready for review December 9, 2024 22:24
@ecooper ecooper requested a review from a team as a code owner December 9, 2024 22:24
Conflicts:
	src/commands/query.mjs
	src/commands/shell.mjs
	src/lib/fauna-client.mjs
	src/lib/fauna.mjs
	src/lib/faunadb.mjs
	src/lib/misc.mjs
	test/query.mjs
@ecooper ecooper merged commit 8047c4d into v3 Dec 10, 2024
4 checks passed
@ecooper ecooper deleted the v3-data-formats branch December 10, 2024 20:32
@mwilde345 mwilde345 mentioned this pull request Dec 10, 2024
Copy link
Contributor

@cleve-fauna cleve-fauna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve!

@cleve-fauna cleve-fauna mentioned this pull request Dec 13, 2024
@mwilde345 mwilde345 mentioned this pull request Dec 18, 2024
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.

6 participants