-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Handling node cli options. #4
Comments
I believe you may be correct! That being said, we have not seen this problem in the wild and |
I would absolutely write a PR, I however don't believe the solution is trivial. The format in which the arguments are passed does not shed enough light on how they are to be parsed. For example, imagine the following args:
There is no way to determine if I looked at how v8flags operates under the hood (haha I know you are not a huge fan of this lib), and it parses the I have a few ideas regarding how to proceed but nothing I would consider a "good" solution. I do have one additional question as I explore how to proceed. Why was the decision made to require the user to specify v8flags? Why not hide this complexity from the user? Including v8flags, I am assuming, is the desired behavior of 99% of users who consume this module. |
I hear you loud and clear RE: the complexity of dealing with all the possible permutations of arguments to the node binary. I don't envy you the task of figuring out how to deal with this! I left v8flags out because I thought it would be useful in other contexts. I don't think it has been (yet), though. |
So I have been battling with ideas of how to best solve this for a little while now. I've done a few things:
I am curious if the general strategy applied to inspect-process, of using yargs to pluck the properties is a valid strategy that could be used in js-flagged-respawn. It would obviously add quite a large dependency to the project. I am at a point where I am trying to determine if the functionality I have built so far should move into js-flagged-respawn (pending your approval), or if I should continue this work in a library that sits somewhat parallel in functionality. |
Hey @jaridmargolin--this is really great work! I would be interested in deprecating v8flags and replacing it with I also think we could offer a new minor version of Assuming we did all of that, would it be possible for |
@tkellen - There is to my knowledge not a clear path forward on autogenerating all of the flags. For example I attempt to fix what gets included by utilizing the version in which the flag was added. So if you are using node 5.X, nodeflags won't return flags added in node 7.X. Additionally, the api of nodeflags manually separates "commands" from "options". In all of the use cases I have, I do not need/want "commands" returned. This is all just a long way of saying, I think it needs to be manual unless work is done in nodejs to provide a better interface for exposing them. As for inspect-process, It will not ever use flagged-respawn. It is doing more than just forwarding stdio and returning the status code. It works by listening to the stdout/stderrr of the child_process and acting accordingly. My interest in flagged-respawn stems from a different project I am working on. Additionally, I just think it should be a solved problem. Mocha for example implements this on there own. And then something like this happens. Having one relied upon solution would be better for everyone. |
I believe this was solved by gulpjs/v8flags#55 which landed in v8flags 3.2.0 |
So the examples clearly show (with the exception of displaying an outdated interface) how to account for v8flags. I may be overlooking something, but wouldn't it be important to handle node options as well?
Looking at the reorder function it looks like the reordering only takes into account ARG=VAL format, however node options can behave differently. For example: https://nodejs.org/api/cli.html#cli_r_require_module.
Are these intentional decisions? Perhaps I am misunderstanding or overlooking something?
The text was updated successfully, but these errors were encountered: