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

Implement modular approach to commands. #46

Merged
merged 6 commits into from
Jul 8, 2018

Conversation

armansujoyan
Copy link
Contributor

Description of new feature, or changes

Commands are moved to their corresponding files. This modular approach will make it more clear and easy to use.

Link to YARGS

Official documentation of modular approach.

Related Issues and Discussions

Enhancement: Separate commands into modules. #41

People to notify

@manrajgrover

All the commands are now located in their corresponding files
under the cmds directory.
All files under cmds directory will be checked for
linting.
@manrajgrover manrajgrover self-requested a review July 1, 2018 09:49
Copy link
Owner

@manrajgrover manrajgrover left a comment

Choose a reason for hiding this comment

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

@armansujoyan I've left a few comments which need attention. Overall looks great!

const updateMessage = helpers.updateMessage;
const standingsHelper = helpers.standingsHelper;

const footballRequest = request.defaults({
Copy link
Owner

Choose a reason for hiding this comment

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

Let's move this to separate utility file for scores, standings and fixtures.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean creating separate files for scores, fixtures and standings instead of having one helper.js right?

Copy link
Owner

@manrajgrover manrajgrover Jul 7, 2018

Choose a reason for hiding this comment

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

No, let's keep one request_utils.js which exports this object.

const leagueIds = require('../leagueIds');

const updateMessage = helpers.updateMessage;
const standingsHelper = helpers.standingsHelper;
Copy link
Owner

Choose a reason for hiding this comment

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

helpers.standingsHelper -> helpers.standings

cmds/config.js Outdated
obj.API_KEY = answers.API_KEY;
}

fs.writeFileSync(path.resolve(__dirname, 'config.json'), JSON.stringify(obj, null, 2), 'utf8');
Copy link
Owner

Choose a reason for hiding this comment

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

This config file should be written in root directory and not in cmds. Please fix the same.

Copy link
Owner

@manrajgrover manrajgrover left a comment

Choose a reason for hiding this comment

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

@armansujoyan Thanks @armansujoyan! LGTM! Merging! 😄

@manrajgrover manrajgrover merged commit 5f28e08 into manrajgrover:master Jul 8, 2018
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.

2 participants