This repository has been archived by the owner on Jul 7, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most npm packages that run as a binary have also the ability to be imported in a project and run as a library.
It would be great if
watchman-processor
worked the same way, so that developers could extend its functionality and create new UIs or integrate it with other tools if needed. Seewatchman-processor-tray-icon
[1] as an example that useswatchman-processor
as a library to create a bitbar plugin [2] and send notifications to the notification center (see also this better implementation of a tray icon using electron [3]).Changes summary:
WatchmanProcessor.ts
to emit node events instead of calling directlyTerminal.ts
;bin/watchman-processor
listen to these events and call the correspondingTerminal.ts
methods;@markis, let me know if you like this idea, I think it would be a pretty powerful extension to this great package. More than happy to switch to more a appropriate architecture if needed, I kind of wanted to write down the code to convey the idea better.
[1] https://github.com/ventuno/watchman-processor-tray-icon/blob/f73d873463a3f682c649a1ca80b8b76cb2cbb11e/bitbar-plugin.js
[2] https://github.com/matryer/bitbar#writing-plugins
[3] ventuno/watchman-processor-tray-icon#1