-
Notifications
You must be signed in to change notification settings - Fork 66
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
New cli #167
New cli #167
Conversation
This needs some testing on windows before it's ready. |
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.
In general very good, but test file should be read after the parser generation and changing output type from source
to parser
can lead to some unintended results. I think, that this should be fixed.
The other stuff are minor but it will be great if you look at them.
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.
This two changes fixes the Windows build
Sorry it's taken so long, but I'm finally addressing all of these comments. @Mingun, you said "changing output type from source to parser can lead to some unintended results". Can you say more about that? My thought was that if you're supplying a test, we should get a parser back instead of source, so that we can call that generated code. |
…adding runtime dependencies
…n't create output file until input processing succeeds, correct the --allowed-start-rules error text, ensure -O throws an error if it doesn't get a parameter.
… whose name ends in .js or .cjs
I can see this point of view. There have been a few times where I've wanted to save the output of the test, but I suppose I can always just capture stdout or add another option later if it becomes important. |
After thinking about it some more, I don't want to add variadic options because it would break backward-compatibility for some uses of the command line. |
Yes, I also thinking about this after you write this . So may be later. I think it is almost done, but I don't like the way how the options combined from the config file, command line JSON and command line parameters -- it is too sophisticated and non-obvious. I suggest to change handling, as I did in hildjj/peggy@new-cli...Mingun:new-cli (and also fix couple of other issues). Also, If I understood correctly, do you agree with me that it is worth reworking the way the |
I have reworked how I agree that the config file stuff is a little subtle, but I think it was always that way. Can you explain a little more about how you changed it? I'm not seeing how yours is different from mine in the link above. |
Conceptually I did the following:
Object.assign({}, DEFAULTS, extraOptionsFile, extraOptions, cliOptions) To clarify: I just made forming options a little more straightforward (at least it looks so for me) |
That makes sense. I'll work in something like that. |
As a compromise on variadic options, and to make everything consistent, you can now specify a comma-separated list for |
As for dancing around config, I've just create an issue in the commander, so, if it will be implemented, we could switch to the built-in solution: tj/commander.js#1584 |
… edge cases in the cli. Ensure that cli options are documented consistently. Make 'bare' a valid cli output type. Make multi-options all take comma-separated lists. Parser got generated with fix from peggyjs#170. Ensure map files get cleaned up.
I think I have all of the requested changes in now. The defaults handling is better than what I had before, but wasn't able to be as clean as you had, because I wanted arrays and objects in the options to be additive instead of replacing what the earlier option was. |
…st, which is waiting on an update to ts-jest. Fix tests to await results.
Ok, it seems good. LGTM |
Split into several chunks: