-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
refactor: use sql-highlight instead of cli-highlight #11221
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
Conversation
42645a2 to
11b176d
Compare
|
Love this - reducing dependencies AND package size is very good. Would it be possible to get before/after screenshots so we can see how it looks? |
|
Looking at the I am currently considering creating a better wrapper for |
|
sexy |
|
what about treesitter sql? |
@hinogi Do you have a link to the npm package? One is 4 years old, so I'd avoid it. Another one is using NAPI which I'd avoid as well. |
|
Seems it's quite complex for a feature of lower importance, the point of this PR was to reduce unnecessary complexity :) |


Description of change
Replace
cli-highlight@2.1.11which is using an older version ofhighlight.jswithsql-highlight@6.0.0.sql-highlighthas no dependencies and only 15Kb (see https://npmgraph.js.org/?q=sql-highlight@6.0.0)cli-highlighthas 28 (sub-)dependencies which total 3MB (see https://npmgraph.js.org/?q=cli-highlight@2.1.11). It useshighlight.jsto parse SQL and convert to HTML, then it usesparse5to parse the HTML and convert to ANSI colored text.cli-highlightwas also used to highlight JSON, but that can be done by the built-inconsole.dir, again much simpler.Pull-Request Checklist
masterbranchnpm run formatto apply prettier formattingnpm run testpasses with this changeFixes #0000