-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add format option to workspace.list #12
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
Conversation
|
Thanks @ilyichv, |
|
Of course! What do you think of |
|
I prefer the
|
|
Yeah, i'd say also that we can remove --json and in general what concern saving files. Once you have a formatted json you can just
|
|
Pipe is not guaranteed to yield a valid json file, if something needs to be compiled first it will also include the compilation output. |
|
Agreed, i'll proceed as you suggested then! |
|
@pnezis Done! I soft-deprecated |
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.
Looks good @ilyichv, a few nits and we are good to merge.
May I ask how a json output in the console will help your CI pipeline?
We're building a pipeline that leverages on affected packages. - name: Detect changes
id: changes
run: |
mix workspace.list --show-status --json --tag scope:app --base "HEAD" --head "HEAD~1"
echo "workspace.json: $(cat workspace.json)"
CHANGED_APPS=$(jq -c '[.projects[] | select(.status == "affected" or .status == "modified") | .app]' workspace.json)
echo "changed-apps=$CHANGED_APPS" >> $GITHUB_OUTPUTSince we fixed Besides that I was about to open a discussion in this repo but we may chat on X. In any case having a convo about that would be great! |
|
Thanks for the explanation, makes sense.
Glad to discuss about it (both X or here is fine) |
I just texted you on X! |
Add
--formatoption toworkspace.list. It can be set to:pretty(default) - retains the current behaviorjson- outputs the following format:{ "projects": { "count": 1, "projects": [ { "app": "core", "path": "packages/core" } ] }, "workspace_path": "/Users/user/Workspace/myworkspace" }This feature was inspired by Turborepo’s approach, and in my opinion, it can take this library a step further toward being more useful in CI environments.