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

remove wrap-cli-callback #1209

Merged
merged 1 commit into from
Sep 22, 2021
Merged

remove wrap-cli-callback #1209

merged 1 commit into from
Sep 22, 2021

Conversation

ricardo-devis-agullo
Copy link
Collaborator

From what I can see wrap-cli-callback was only used for CLI commands where we didn't pass a callback. We can just pass it explicitly on cli/index.js when calling yargs, and then we don't need to wrap every command. This also makes it easier to be able to universalify those functions (it would get confused thinking it's a promise if sometimes they get called without a callback).

@@ -3,7 +3,6 @@
const read = require('read');

const strings = require('../../resources/index');
const wrapCliCallback = require('../wrap-cli-callback');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by doing this aren't we breaking contract for things like this:
https://github.com/opencomponents/grunt-oc/blob/master/tasks/oc-mock.js

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how? in that file it's explicitly passing a callback.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we've chatted about this, the difference is about programmatic api, however we think that the use-case of not passing a callback in programmatic api does not make any sense. @matteofigus we're thinking of treating this as a non breaking change - is that ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah makes sense, thanks

@ricardo-devis-agullo ricardo-devis-agullo merged commit 79e1efd into master Sep 22, 2021
@ricardo-devis-agullo ricardo-devis-agullo deleted the remove-wrap-cli-cb branch September 22, 2021 13:22
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.

3 participants