-
Notifications
You must be signed in to change notification settings - Fork 36
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
Deno runtime not supported #40
Comments
Hi, could you send some simple instructions on how to reproduce this please.. |
Sure thing. Would you prefer a sandbox or instructions how to reproduce it locally? |
instructions on how to reproduce it locally please..
|
Got it! I'll get back to you. |
import cliUsage from "npm:command-line-usage";
if (import.meta.main) {
console.log(cliUsage([
{
header: "Deno CLI usage",
content: "Best thing ever"
}
]));
}
Let me know if you get stuck on something. |
Let me know if a PR would help. |
I had a look last night, chalk v5 is ESM only, meaning the command-line-usage project would need to be upgraded to a ESM project ( |
also, the tagged template support was removed from chalk v5.. this library uses that feature to give users the ability to colour usage docs, e.g. |
Right, which is why I wrote:
From the Chalk README:
and
I.e v4 should solve the problem equally well. |
Moved to a separate package, though, so shouldn't be too bad? |
i thought the Deno fix was from chalk v5.2 onward.. may be wrong.. |
To my understanding, this is the crucial fix, introduced in 4.0.0. If so, 4.1.2 should cut it. Other problems might show up further down the road, though. I can give it a try, if you'd like. |
since implementing this fix will introduce a breaking change to command-line-usage, we might as upgrade all deps to all latest versions (v5, not v4 chalk) and rewrite the project as ESM.. that way we can squeeze as many breaking upgrades into the next release as possible.. since this update will result in changes right across the project (in /examples and /test too) I will do it this time.. otherwise, yes I'd welcome your PR.. |
All right, by all means. Thank you for taking the leap. You know where to find me. Good luck! |
I've published a beta version for testing.. please update your
|
Hey, look at that! For unknown reason, the formatting is not displayed in Warp, but that is on them (works in Hyper and Terminal.app)... https://app.warp.dev/block/nvpi0MT2iXS45OmFaVQyjT Is it erroneously thinking it's piped and strips the formatting? Idk. Don't bother. |
I'm about to move this out of beta and make it live, please let me know if there are any further deno issues I might not know about.. Cheers! |
Released in v7.0.0 |
Cool! Will do 👍 |
Due to denoland/deno#13321, the library fails with
The version of
chalk
used is really old. Please consider upgrading to at least 4.X, where the issue above is fixed. If you want to take the step to ESM, you might want to take it to 5.X+ even.If you're up for it, let me know if you want me to help out in any way.
PS. Even if you have no intention of supporting Deno, I think it would still be worth to upgrade Chalk to a more modern (and safer) version.
The text was updated successfully, but these errors were encountered: