-
Notifications
You must be signed in to change notification settings - Fork 171
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
精简cli模块的cli声明方式 #183
Labels
Milestone
Comments
|
做成对象以后还能加help之类的东西呢
|
我写错了,是这样 exports.description = '...';
exports.main = function () {};
//..... |
那还是exports.cli = cli吧,这样子require之后只需要判断是不是有cli对象就知道是不是一个cmd模块了。 |
难道cli目录下的js有可能不是command模块? |
这个比较难说,以后的 |
好吧,那就维持老样子吧 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
按照之前讨论的结论,对cli模块进行分离和抽取。但是,现在的cli模块声明有些冗余。
比如build,现在声明方式如下:
但是抽取后,cli模块应该就只包含command运行相关信息,无需暴露其他api。所以,建议抽取成下面这样,少一级,不用以
cli
property暴露:The text was updated successfully, but these errors were encountered: