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

Refactor: Add a constants file which exports all constants throughout the application #772

Closed
anshumanv opened this issue Mar 5, 2019 · 1 comment · Fixed by #798
Closed

Comments

@anshumanv
Copy link
Member

anshumanv commented Mar 5, 2019

Do you want to request a feature or report a bug?
Discussion for a possible refactor

What is the current behavior?
We're using a bunch of constants throught the code (

const NON_COMPILATION_ARGS = [
), (
const CONFIG_GROUP = "Config options:";
) and a lot more. I think it makes sense to bunch them all up in a single file (maybe call constants.js?) and use it wherever needed.

What is the expected behavior?
Single file which exports all constants which is imported whereever needed (a possible refactor).

If this is a feature request, what is motivation or use case for changing the behavior?
Not a feature request.

Please paste the results of webpack-cli info here, and mention other relevant information such as programming language.

webpack-cli info

  System:
    OS: macOS 10.14.3
    CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
  Binaries:
    Node: 10.14.1 - /usr/local/bin/node
    Yarn: 1.12.3 - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 72.0.3626.119
    Safari: 12.0.3
  npmPackages:
    webpack: 4.x.x => 4.29.6
    webpack-dev-server: ^3.1.10 => 3.2.1

Will do a quick PR in case we agree to proceed with this. 😄

@anshumanv
Copy link
Member Author

Will do this after #781 goes through.

anshumanv added a commit to anshumanv/webpack-cli that referenced this issue Mar 21, 2019
moved all constants to a separate file for CLI scopre and imported from there.

ISSUES CLOSED: webpack#772
anshumanv added a commit to anshumanv/webpack-cli that referenced this issue Mar 21, 2019
Format all code using prettier, remove console.log

ISSUES CLOSED: webpack#772
ematipico pushed a commit that referenced this issue Mar 23, 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: #772

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

Format all code using prettier, remove console.log

ISSUES CLOSED: #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
anshumanv added a commit to anshumanv/webpack-cli that referenced this issue 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 a pull request may close this issue.

2 participants