-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Revert 100 #139
Comments
ping @kwelch who did some work to make things a little easier. Your work is still appreciated, but I think it will be unnecessary after these changes. |
That said, if anyone would like to work on implementing this, please, be my guest! |
No worries. I actually thought about building a variation of this last night. I think this proposal works better than I was thinking. To be clear, there will only ever be one script called? So usage would look like: |
Correct 👍 |
I'm not sure how to accomplish this with yargs, but I hope it's straightforward! |
Is |
I like yargs a lot, but what you're saying makes sense. We don't need most of the features of I wouldn't worry about the emoji vote count. I've been thinking that this would be better for a while. The more I think about it the more I think that this should happen anyway. Thanks for whatever you can do :) |
Ok, so I reeeally want this now. In fact I also really want to get the |
Sorry, I want to but I had a few things come up and have not been able to get to it. If anything changes I will let you know. 👍 |
@kentcdodds Why not just use environment variables for this? I've been doing this:
The environment variables are automatically passed through the process (and they can be used in multiple steps that are run in series or parallel). |
Another thing that would be useful is having the parsed arguments available in the package-scripts.js file, for example nps --silent build.doc --fast Could define a global global.nps = {script: 'build.doc', args: ['--fast'], options: {verbose: 0}} |
FYI, I created yargs/yargs-parser#130 to help with the parsing |
That PR seems like it will have to wait a while though - last activity in yargs-parser was june :-( |
In the meantime the PR got merged and yargs-parser has |
@wmertens would you like to take the lead on this? 😄 |
To do this in a backwards-compatible way, how about having to set a flag in package-scripts.js? E.g. if the returned object contains |
Ok, so #100 had good intentions, but it turns out that it's a little more frustrating to deal with things now that you have to wrap things in quotes. I don't know about anyone else, but it's been annoying for me. Also it's pretty rare that I want to run a series of scripts in a single
nps
invocation. And if I wanted to do that I could just donps script1 && nps script2
for the rare cases I even want to do that. It's much more common for me to want to do:nps script1 arg1
. So I'd like to basically revert what we did in #101, but with a slight change to things...We still need to deal with this:
Does the
--silent
flag get forwarded to thefoo
script or used as the--silent
flag fornps
? Here's my proposal:nps will forward
--silent
and--bar
tofoo
.--silent
will not be used as a flag fornps
.nps will forward only
--bar
tofoo
.--silent
will be used as a flag tonps
.nps
will forwardbar
andbaz
tofoo
.--silent
will be used as a flag tonps
. This differs from the current situation in whichnps
will attempt to run three scripts serially:foo
,bar
,baz
. As mentioned, it's not common to want to even do this. Making this change will make things much more usable/predictable.I think that's pretty straightforward. I would love to see some emoji reactions to this before I start working on it...
The text was updated successfully, but these errors were encountered: