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

chore(cli): move constants to a separate file #798

Merged
merged 6 commits into from
Mar 23, 2019

Conversation

anshumanv
Copy link
Member

@anshumanv anshumanv commented Mar 21, 2019

What kind of change does this PR introduce?
Refactor constants

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
Not relevant

Summary

  • Moved constants to a separate file, imported from there elsewhere.

Does this PR introduce a breaking change?
No

Other information
Fixes #772

moved all constants to a separate file for CLI scopre and imported from there.

ISSUES CLOSED: webpack#772
Format all code using prettier, remove console.log

ISSUES CLOSED: webpack#772
@webpack-bot
Copy link

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

Copy link
Member

@rishabh3112 rishabh3112 left a comment

Choose a reason for hiding this comment

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

This refactor is shining 💯
Few suggestions for you.

bin/config/config-yargs.js Outdated Show resolved Hide resolved
bin/utils/errorHelpers.js Outdated Show resolved Hide resolved
split constants destructuring to multiple lines in config-yargs
@anshumanv
Copy link
Member Author

@rishabh3112 done with the quick fixes. 💯

bin/cli.js Outdated Show resolved Hide resolved
bin/cli.js Outdated Show resolved Hide resolved
bin/opencollective.js Outdated Show resolved Hide resolved
bin/constants.js Outdated Show resolved Hide resolved
update var name, revert oc
@webpack-bot
Copy link

@anshumanv Thanks for your update.

I labeled the Pull Request so reviewers will review it again.

@ematipico Please review the new changes.

bin/constants.js Outdated Show resolved Hide resolved
moved constants to utils directory
const OPTIMIZE_GROUP = "Optimizing options:";
const DISPLAY_GROUP = "Stats options:";
const GROUPS = {
CONFIG_GROUP,
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't be more compact to initialize the constants inside the JSON? :)

const GROUPS = {
	CONFIG_GROUP: "Config options:"

Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean by "compact"?

@ematipico ematipico merged commit 0a2274e into webpack:master Mar 23, 2019
anshumanv added a commit to anshumanv/webpack-cli that referenced this pull request Mar 26, 2019
* chore(cli): move constants to a separate file

moved all constants to a separate file for CLI scopre and imported from there.

ISSUES CLOSED: webpack#772

* chore(cli): lint files, rm console.log

Format all code using prettier, remove console.log

ISSUES CLOSED: webpack#772

* chore(cli): codacy fix

codacy fix

* chore(cli): split destructuring into multiple lines

split constants destructuring to multiple lines in config-yargs

* chore(cli): update var name, revert oc

update var name, revert oc

* chore(cli): moved constants to utils

moved constants to utils directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor: Add a constants file which exports all constants throughout the application
7 participants