-
Notifications
You must be signed in to change notification settings - Fork 60
[MAJOR] json format only outputs valid json #260
Conversation
We now have a new spinner and most of the commands that have a table can output data as a pure json structure. To test, pipe the output of a command into Internally, the spinner API is much simpler. All we use now is I also removed a param in Notes:
|
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.
Awesome change! I did a quick test and didn't find any issues. The code is much cleaner now, too!
Sweet! So the downside here is that this is a breaking change, which would require a 6.0 release. I'd love to do that only for CLI and not core/schema, per our discussion. |
Why a breaking change? Is it because we're not printing a context line like "these are your apps:" anymore? |
That was my thought. If they had been parsing json out of the output before, we might break stuff. I like to be defensive about that, but we could also just ping the channel and go for it |
I'm all in favor of just incrementing major. Our public contract is SEMVER, and it's just easier to adhere to it, then to break it. |
In order for command output to be piped into other commands (such as
jq
, a json formatter), it can't print extra helpful lines or other, non-json text.The fix is twofold. The easier side is not printing "these are your apps:" and similar. that's a single check in the
context.line
function.The more complex half is our custom spinner implementation, which prints out hidden characters when it starts and stops (not to mention, it's very complex), invalidating the output. Moved the spinner to an external lib that's well maintained (
ora
). initial results seem awesome but there's still a lot of tire-kicking to do there.fixes #247 and PDE-89