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

program.emit behavior seems to be broken in 2.11.0 #659

Closed
Flackus opened this issue Jul 11, 2017 · 6 comments
Closed

program.emit behavior seems to be broken in 2.11.0 #659

Flackus opened this issue Jul 11, 2017 · 6 comments

Comments

@Flackus
Copy link

Flackus commented Jul 11, 2017

-    "commander": "2.10.0",
+    "commander": "2.11.0",

Somewhere between those two versions the following case was broken. We have two subcommands, let's name them start and download. Inside the code for the start command we do program.emit('download');.

It works for 2.10.0, but in 2.11.0 download subcommand will not be triggered.

@abetomo
Copy link
Collaborator

abetomo commented Jul 12, 2017

Could you give me sample code that does not work as expected so that there is no discrepancy in recognition?

@Flackus
Copy link
Author

Flackus commented Jul 12, 2017

I'll try to make a PR addressing this issue today.
If I won't be able to fix it myself, code snippet will be posted, no worries :)

@Flackus
Copy link
Author

Flackus commented Jul 12, 2017

Discussed issue was introduced in https://github.com/tj/commander.js/pull/494/files

In user code program.emit('some_command') now should be changed to program.emit('command:some_command').
This change seems reasonable for me, but it happened in minor release, which is a pitfall.

@abetomo, what do you think?

@roman-vanesyan
Copy link
Collaborator

Yep, @Flackus you are right, we should merge it in major release, but instead break compatibility in minor release. As things already done, we cannot rollback updates, but instead we can add notice to README.md about the breakage between 2.10 and 2.11 versions.

@Flackus
Copy link
Author

Flackus commented Jul 12, 2017

@vanesyan yeah, you're right, no reason to break things twice.
Thanks!

fengmk2 added a commit to cnpm/cnpm that referenced this issue Aug 7, 2017
commander@2.11.0 is a broken change release
see tj/commander.js#659

closes #210
fengmk2 added a commit to cnpm/cnpm that referenced this issue Aug 7, 2017
commander@2.11.0 is a broken change release
see tj/commander.js#659

closes #210

pick from #211
fengmk2 added a commit to cnpm/cnpm that referenced this issue Aug 7, 2017
commander@2.11.0 is a broken change release
see tj/commander.js#659

closes #210
fengmk2 added a commit to cnpm/cnpm that referenced this issue Aug 7, 2017
commander@2.11.0 is a broken change release
see tj/commander.js#659

closes #210

pick from #211
@shadowspawn
Copy link
Collaborator

This issue has not had any activity in over six months. It isn't likely to get acted on due to this report.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

Thank you for your contributions.

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

No branches or pull requests

4 participants