-
Notifications
You must be signed in to change notification settings - Fork 108
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
Handle keyboard input in child process #186
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). For more information, open the CLA check for this pull request. |
Thanks for the PR! Definitely open to this or something along these lines, it's something I've been thinking we should support. It seems like something that should be a setting. Perhaps like this?: {
"wireit": {
"publish": "release-it",
"interactive": true
}
} There are some details to think about:
|
OK great!
Yes, at first thought it makes sense to me to basically enforce
I guess that should be automatically solved as well by enforcing a single/sequential flow in
Uh, interesting. Not sure, tbh. Since
Using I'll update this PR now with a better fix to use |
I just force-pushed the same (after the refactor between 0.3.1 and 0.4.1), would love to make progress here |
Sorry for the delay, I still need to think carefully through the implications of this and exactly how it should work, to answer some of the questions above, such as ensuring that only one interactive script at a time receives |
Note that as a workaround, which I'm sure you've already discovered, you can probably just chain the build + release scripts in the regular npm script. There may not be any advantage to having wireit execute the final command -- right? {
"scripts": {
"publish": "npm run build && release-it",
"build": "wireit"
}
} |
Alright, that's cool of course. No hurries, I'm just excited for this feature :)
Yes, I'm aware of this. I'm especially interested in this specific feature, so users of release-it can use it for monorepos too. I think adding (something like) the changes in this PR can result in a great combination of both tools: {
"scripts": {
"release": "wireit"
},
"wireit": {
"release": {
"command": "release-it --no-npm",
"dependencies": [
"./packages/bravo:release",
"./packages/mol:release",
"./packages/zen:release"
]
}
}
} This monorepo serves as a demo. Without wireit, this does the same: {
"scripts": {
"release": "npm --prefix packages/bravo run release && npm --prefix packages/bravo run release && npm --prefix packages/zen run release && release-it --no-npm"
}
} Another option would be to build something like this into release-it itself, but that would add complexity that I'd rather prevent. I haven't found great alternatives myself so far, but when wireit ends up without supporting interactive mode I'll definitely consider that. I'd also like to add that roughly 50% of release-it runs happen in CI mode, so without interactivity, which works like a charm today (even without |
Thank you for this PR! I'm still planning to support interactive scripts at some point, but I think there's more design work to do. It can't be as simple as forwarding all stdin (as this PR does), because if there are multiple scripts running at the same time that take stdin, it won't be clear which one is "focused". We also need to disallow interactive scripts from ever being cached, because the input provided by the user won't be tracked, so we can't have a good cache key. I expect we'll need to add an Tracking at #281 |
Yes, that's totally clear and fair. Thanks! |
When wiring release-it up with wireit and create a monorepo setup, I saw interesting use cases.
However, using a process like this would require a way to set
stdio: 'inherit'
, or deal in some other way with keyboard input. Would you be open to something like this? Perhaps as a configuration option of sorts. Maybe this should even work out-of-the-box, although currently I'm not sure how handling this stream fits into the rest of the program.Just to be sure, this first commit is not to be merged as-is, it's just to open this discussion in a draft PR.
Please see the readme and
package.json
of https://github.com/webpro/release-it-monorepo. Also see this screenshot for the working demo to publish three packages in this mini monorepo:By the way, release-it can be used in
--ci
mode as well, eliminating the need for user/keyboard input.