Fix positional argument handling and clarify path resolution in Zeus CLI#423
Open
PlayingWithClouds wants to merge 2 commits into
Open
Fix positional argument handling and clarify path resolution in Zeus CLI#423PlayingWithClouds wants to merge 2 commits into
PlayingWithClouds wants to merge 2 commits into
Conversation
|
@PlayingWithClouds is attempting to deploy a commit to the aexol-studio Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi, any update on this? this is a blocker for upgrading the package. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I don’t know if I’m on the wrong track here or if this is intended behavior, but while trying to use the Zeus CLI I found the current argument and path resolution massively confusing.
Context
I started using
graphql-zeusrecently and noticed that invoking the CLI using positional arguments (as implied by usage and examples) did not work as expected. While investigating, I found that path resolution involved multiple overlapping mechanisms, some of which were undocumented.Changes & Rationale
1. Fix positional argument handling (
<path> [output_path])The CLI is structured around positional arguments:
However, positional arguments were not being correctly consumed by
yargs, which resulted inargs._being empty at runtime. This meant that:<path>and[output_path]did not work when passed positionally2. Reduce ambiguity between positional args and config file
Before this change, the schema path could also be sourced from a config file, even though:
This made the CLI behavior difficult to reason about.
This PR ensures that:
<path>,[output_path]) is the primary source of truthurlOrPath3. Respect the provided output path
Previously, the CLI always appended
zeusto the output directory. As a result, even when[output_path]was explicitly provided, output was written to:This PR updates the behavior so the provided output path is respected as-is, without implicit directory modification.
Notes
I’m not sure whether the previous behavior was intentional or relied on older usage patterns, but these changes reflect how the CLI appears to be intended to work based on its interface and usage.