-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(server): add stdin for API #2106
Conversation
@@ -58,6 +59,8 @@ class Server { | |||
this.compiler = compiler; | |||
this.options = options; | |||
|
|||
handleStdin(options); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, why we need it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evilebottnawi Do you think no helper would be better? I just thought having helper would be cleaner
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we need this inside server file, it is logic for CLI only
lib/Server.js
Outdated
}); | ||
|
||
process.stdin.resume(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, i don't mean we don't need help, i just answer why we use this here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@evilebottnawi The goal is to make this option not CLI-only. As mentioned in #1712 it is desired for this to be possible.
Also this is beneficial because I want to reduce what the CLI does as much as possible for the refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @hiroppy
Codecov Report
@@ Coverage Diff @@
## master #2106 +/- ##
==========================================
+ Coverage 92.56% 92.76% +0.19%
==========================================
Files 33 34 +1
Lines 1265 1271 +6
Branches 361 362 +1
==========================================
+ Hits 1171 1179 +8
+ Misses 87 85 -2
Partials 7 7
Continue to review full report at Codecov.
|
I think tests on Mac will be broken by these changes.
|
@Loonride since you are testing after calling the helper, that ensures that |
/cc @Loonride |
@EslamHiko I'm not seeing the Edit: also it would time out without |
I stuck with a solution of waiting for a timeout, because working with child process |
Oddly inconsistent behavior with |
@Loonride looks like problem on execa side? Can you try next version of execa, maybe they fixed this, if it is works we can minimum required nodejs version for devDependcies to |
@evilebottnawi why node Edit: or possibly not, some MacOS still not passing |
/cc @hiroppy @evilebottnawi I finally resolved the hanging test issues. I found that on some OS/node versions |
@Loonride Thanks. Yep, so don't worry. |
Closing in favor of #2186 |
For Bugs and Features; did you add new tests?
Yes
Motivation / Use-Case
fixes #1712
This makes
stdin
an option for both CLI and API, and helps in moving configuration changes out of the CLI for CLI refactor.Breaking Changes
None
Additional Info