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

Support --build-delimiter for opt-in output delimiter #340

Merged
merged 1 commit into from
Mar 14, 2018
Merged

Support --build-delimiter for opt-in output delimiter #340

merged 1 commit into from
Mar 14, 2018

Conversation

bitpshr
Copy link
Member

@bitpshr bitpshr commented Mar 12, 2018

What kind of change does this PR introduce?
Feature

Did you add tests for your changes?
Yes

If relevant, did you update the documentation?
N/A

Summary
This PR introduces a new --build-delimiter CLI option to add opt-in support for custom text after normal build output. This feature is useful for tooling that parses stdout, originally arose from webpack/webpack#6002, and resolves #192.

Does this PR introduce a breaking change?
No

Other information
I was unsure of the purpose of bin/process-options.js as it doesn't appear to be used anywhere. I noticed this file has been recently updated, so I added the CLI option to both bin/process-options.js and bin/webpack.js.

@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.

Looks good, any tools that are good to use this with? Would be nice to know!

@bitpshr
Copy link
Member Author

bitpshr commented Mar 12, 2018

Thanks for another quick review @ev1stensberg and @ematipico.

As far as tooling, here's one slightly contrived use case: we wrote an internal tool that pipes build output to individual Slack messages for a particularly important build that sits in watch mode. This was difficult to do; we either had to use --json and manually construct our own Slack message, or just directly pipe stdout, which was difficult since Hash: xxxx is the only true delimiter that currently exists, and it shows before builds, not after. We ended up using stdout, but the logic involved will now be much simpler with a custom delimiter between runs. I'm unaware of major public tools that would use this feature. But still, even beyond such tooling, it's nice to be able to more-easily distinguish one build from another with something like --build-delimiter="\n\n---completed---\n\n", for example.

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.

Print distinct end line to support better output error parsing in watch mode
4 participants