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

Improvement: add an option to watch messaging. Add .idea to .gitignore #200

Merged
merged 8 commits into from
Jan 23, 2018

Conversation

EugeneHlushko
Copy link
Member

@EugeneHlushko EugeneHlushko commented Dec 12, 2017

What kind of change does this PR introduce?

Adds infoVerbosity option which is set to info by default. In order for user to be able to control the amount of extra messaging output.

Provides clear indication of when compilation had started and when it had finished if such verbosity is requested

Fixes webpack/webpack#6051 and webpack/webpack#5895

Did you add tests for your changes?
Yes
Also added PR for json schema validation of the option: webpack/webpack#6332
UPD: we wont add these to webpkac/webpack's schema, instead we can create our own in webpack-cli

If relevant, did you update the documentation?
Not yet had been approved

Summary

See webpack/webpack#6051 and webpack/webpack#5895

Does this PR introduce a breaking change?

no

Other information

@EugeneHlushko
Copy link
Member Author

Hi @sokra, here's is migrated pr to webpack-cli. Couple of tests are now failing due to message being off by default. Should i turn it on by default or should i change the tests to not expect the messages when the param is not there?

@evenstensberg
Copy link
Member

@EugeneHlushko update the tests, would be convenient if you add a way to test this locally, not just via tests too / screenshot 👍

@EugeneHlushko
Copy link
Member Author

Hi @ev1stensberg

i've updated the tests with config to expect the string and default ones to not expect it. Do you think that is enough or should i just add this option to all old tests and create a separate test case to see that string?

@EugeneHlushko
Copy link
Member Author

Any update on this one @ev1stensberg ?

@evenstensberg
Copy link
Member

evenstensberg commented Dec 14, 2017

Is there an issue on this? If not , you'd have to open one and @sokra must approve the feature
Edit: Could you link the absolute URL of the bugs you're fixing?

@sokra
Copy link
Member

sokra commented Dec 14, 2017

See also webpack/webpack#766

I guess it should be on by default.

See also webpack/webpack#5895

I guess it would a a good idea to combine these features into something more general like info-verbosity...

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

A few things here. Don't modify a binTestCase test, create a new one for your feature. For the alias, it should be more discussed per @sokra 's saying, maybe we can combine some logic

@EugeneHlushko
Copy link
Member Author

EugeneHlushko commented Dec 14, 2017

Got your point @sokra
info-verbosity sounds more like a level setting rather than a bool. In that case i would make it: verbose and silent in this PR, and in future we could always add third option and so on. Otherwise vote for a bool^^

And by default it would be set to verbose per @ev1stensberg 's request.

If you are ok with that the plan for me would be adding that option within the scope of this PR, adding additional test case for silent mode. And the next PR would then cover more messages like Build started... and Build finished in the watch mode.

Please comment or approve the course.

P.S. Updating the description with permalinks to issues

@evenstensberg
Copy link
Member

@EugeneHlushko @sokra I actually think that we should try to align this with #22 , as this is the same issue?

@EugeneHlushko
Copy link
Member Author

EugeneHlushko commented Dec 14, 2017

Not exactly the same but similar @ev1stensberg . If you read the issues, its more about being able to not see extra text except for the compilation output, and another one wants to see clear messages on start and end of the compilation process. But we indeed can also respect this flag for hash and version etc. Can include it into the scope of current PR, what you think?

Just to be clear, i think templates of the stats output is out of scope.

@evenstensberg
Copy link
Member

I think you should consult with @sokra, it would be nice if we'd combine these features into one alias

@EugeneHlushko
Copy link
Member Author

Ok lets see what @sokra can say on this thread after what i've wrote yesterday: #200 (comment)

@EugeneHlushko
Copy link
Member Author

Hi @sokra , @ev1stensberg
As this isnt getting additional comments i've implemented the last suggested solution and added a new test case. Please review

@EugeneHlushko
Copy link
Member Author

Any updates on this PR? the two issues opened are not getting closed if this is freezed. @sokra @ev1stensberg

@sokra
Copy link
Member

sokra commented Dec 22, 2017

info-verbosity sounds more like a level setting rather than a bool.

yep, in my opinion it should be a level setting.

I would default it to "info".

In "verbose" you could add the messages for start, end invalid...

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

Tobias left some comments, also the .gitignore should be removed from commit, as the idea ignore has been implemented already

@EugeneHlushko
Copy link
Member Author

Hi @ev1stensberg and @sokra
I did update the PR accordingly

@EugeneHlushko
Copy link
Member Author

Should i rebase or is this still under discussion @sokra ?

bin/webpack.js Outdated
@@ -378,6 +384,10 @@ yargs.parse(process.argv.slice(2), (err, argv, output) => {
}
});

ifArg("info-verbosity", function(value) {
outputOptions.infoVerbosity = value;
Copy link
Member

Choose a reason for hiding this comment

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

You don't have to put this into outputOptions. A local variable would be fine.

@evenstensberg
Copy link
Member

Could you rebase? @EugeneHlushko

@EugeneHlushko
Copy link
Member Author

Yup, on it. I will leave it in outputOptions as i thought to use it in the plugins too, but if you insist i can change to local var

@EugeneHlushko
Copy link
Member Author

done @ev1stensberg

@EugeneHlushko
Copy link
Member Author

EugeneHlushko commented Jan 18, 2018

But i did add that, or do you mean anything else?
Here:
https://github.com/webpack/webpack-cli/pull/200/files#diff-877a99a662829398e8136ee938cf1c93R443

@EugeneHlushko
Copy link
Member Author

Hi @ev1stensberg
Forgot to mention you in the last comment.
Verbose is already added in previous commits:
https://github.com/webpack/webpack-cli/pull/200/files#diff-877a99a662829398e8136ee938cf1c93R443

@evenstensberg
Copy link
Member

Let me take another look later tonight

@EugeneHlushko
Copy link
Member Author

Sure thing mate, looking forward to feedback if any @ev1stensberg

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

One small tweak and we're set

bin/webpack.js Outdated
@@ -399,6 +405,12 @@
}
});

ifArg("info-verbosity", function(value) {
if (typeof value !== "string" || !["none", "info", "verbose"].includes(value))
throw new Error("Invalid configuration object. \n configuration['info-verbosity'] should be one of these:\n \"none\" | \"info\" | \"verbose\"");
Copy link
Member

Choose a reason for hiding this comment

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

I think we've got a error helper for this

Copy link
Member Author

Choose a reason for hiding this comment

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

I maybe misunderstood, but couldnt find the usage in codebase of error helper, could you please point me into the right direction here? All i've found is bin/errorHelpers.js which basically works with existing error but doesnt throw one for me

Copy link
Member

Choose a reason for hiding this comment

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

Hm, okay, so if you look in the function inside the bin folder that I believe is called convert-argv, there's a processing of the options, and if it's not matching the schema, it throws. At least that is what I think it's doing under the hood. I'm not on a computer right now, so let me get back to you in a bit

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah but seems it doesnt support enum which could substitue ![].includes call as jsonschema does?

Copy link
Member

Choose a reason for hiding this comment

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

It should only be a string

@@ -399,6 +405,12 @@
}
});

ifArg("info-verbosity", function(value) {
if (!["none", "info", "verbose"].includes(value))
Copy link
Member Author

Choose a reason for hiding this comment

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

@ev1stensberg can we keep this check until schema lands so there is no misuse?

Copy link
Member

Choose a reason for hiding this comment

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

Could you create an issue for it? Mergeable after

Copy link
Member Author

Choose a reason for hiding this comment

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

@evenstensberg
Copy link
Member

Do you mind adding webpack-dev-server as the same dependency as webpack? Seems to get linting errors

@EugeneHlushko
Copy link
Member Author

@ev1stensberg added webpack-dev-server to allowModules section

@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

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

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

Superb! Thanks! LGTM

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.

silent mode
5 participants