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

Replace yargs with commander to reduce dependencies #1253

Merged
merged 1 commit into from
Mar 15, 2020
Merged

Replace yargs with commander to reduce dependencies #1253

merged 1 commit into from
Mar 15, 2020

Conversation

AlynxZhou
Copy link
Contributor

Summary

Replace yargs with commander, which is only used in bin/precompile. This PR does not break command interface, because they have the same logic and options.

Both yargs and commander can implement the same options for bin/compile, but commander pulls in 0 dependency while yargs pulls in 11 dependencies directly and maybe many others indirectly.

It seems most users of nunjucks use it as an library, not a cli-program, and they may not like many dependencies pulled in by yargs in their projects (like me).

Checklist

I've completed the checklist below to ensure I didn't forget anything. This makes reviewing this PR as easy as possible for the maintainers. And it gets this change released as soon as possible.

@nikku
Copy link
Contributor

nikku commented Mar 4, 2020

If you really want to go lightweight, consider going for mri instead of commander.

@AlynxZhou
Copy link
Contributor Author

AlynxZhou commented Mar 4, 2020 via email

@nikku
Copy link
Contributor

nikku commented Mar 4, 2020

mri is a drop-in replacement for yargs in most cases and it is zero dependency, too.

@AlynxZhou
Copy link
Contributor Author

mri is a drop-in replacement for yargs in most cases and it is zero dependency, too.

Thank you for your advice. I'm just not familiar with mri, and I am familiar with commander, so I write patch with what I can do better. I'm just not sure whether I can make patch with library that I never use.

Last commit of mri happened in Dec 24, 2018, it makes people unsure whether it's still maintaining. Also when we refer to 0 dependency command-line arguments parser, commander has been used widely, but mri is not compared with commander. That's the reason why I choose commander.

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.

None yet

4 participants