Skip to content

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

Merged
ematipico merged 6 commits into
webpack:masterfrom
anshumanv:772
Mar 23, 2019
Merged

chore(cli): move constants to a separate file#798
ematipico merged 6 commits into
webpack:masterfrom
anshumanv:772

Conversation

@anshumanv

@anshumanv anshumanv commented Mar 21, 2019

Copy link
Copy Markdown
Contributor

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
Copy Markdown

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

@rishabh3112 rishabh3112 left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread bin/config/config-yargs.js Outdated
Comment thread bin/utils/errorHelpers.js Outdated
split constants destructuring to multiple lines in config-yargs
@anshumanv

Copy link
Copy Markdown
Contributor Author

@rishabh3112 done with the quick fixes. 💯

Comment thread bin/cli.js Outdated
Comment thread bin/cli.js Outdated
Comment thread bin/opencollective.js Outdated
Comment thread bin/constants.js Outdated
update var name, revert oc
@webpack-bot

Copy link
Copy Markdown

@anshumanv Thanks for your update.

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

@ematipico Please review the new changes.

Comment thread bin/constants.js
moved constants to utils directory
Comment thread bin/utils/constants.js
const OPTIMIZE_GROUP = "Optimizing options:";
const DISPLAY_GROUP = "Stats options:";
const GROUPS = {
CONFIG_GROUP,

Copy link
Copy Markdown
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
Copy Markdown
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