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

Add compilation status and error/warning count to the error message formatter #68

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

astorije
Copy link
Contributor

In many cases, displaying the error message is not helpful. In our case, we barely display enough of the filepath to help use figure out what is failing, so an error count would actually be a lot more concise and helpful, indicating the developer to take a look to their console.

This change allows for the following notifications:

Screen Shot 2021-04-25 at 9 06 54 PM Screen Shot 2021-04-25 at 9 12 39 PM

Using the following configuration:

// webpack.config.ts
import WebpackBuildNotifierPlugin from 'webpack-build-notifier';

let address: string;

export default {
  // ... snip ...
  plugins: [
    // ... snip ...
    new WebpackBuildNotifierPlugin({
      formatMessage(_error, _filepath, status, errorCount) {
        return `${errorCount} ${status}${errorCount === 1 ? '' : 's'}`;
      },
    }),
  ],
  // ... snip ...
};

This will conflict with #67 but I'm happy to rebase either PR on merge of the other one should you be happy with them :)

@coveralls
Copy link

coveralls commented Apr 26, 2021

Pull Request Test Coverage Report for Build 144

  • 14 of 14 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 93.636%

Totals Coverage Status
Change from base Build 118: 0.5%
Covered Lines: 130
Relevant Lines: 134

💛 - Coveralls

@astorije astorije force-pushed the astorije/message-formatter-count branch 5 times, most recently from ac4e2fb to aeaff56 Compare April 26, 2021 11:22
@astorije astorije force-pushed the astorije/message-formatter-count branch from aeaff56 to daab7fe Compare April 26, 2021 16:16
@RoccoC
Copy link
Owner

RoccoC commented Apr 28, 2021

Thanks for the PR! Approved and merged. I'll release a new version with your change shortly.

@RoccoC RoccoC merged commit 51a607d into RoccoC:master Apr 28, 2021
@astorije astorije deleted the astorije/message-formatter-count branch April 28, 2021 14:24
@astorije
Copy link
Contributor Author

Excellent, thanks! I'm going to fix conflicts on my other PRs then 🙏

@RoccoC
Copy link
Owner

RoccoC commented Apr 28, 2021

Released in 2.2.0

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.

None yet

3 participants