feat: zero new --json envelope with order-independent args#73
Open
gke0op wants to merge 1 commit into
Open
Conversation
|
@gke0op is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
| ZBuf entry_path; | ||
| zbuf_init(&entry_path); | ||
| zbuf_append(&entry_path, command->input); | ||
| zbuf_append(&entry_path, "/src/main.0"); |
Comment on lines
+5177
to
+5185
| zbuf_append(&buf, "\"zero check "); | ||
| zbuf_append(&buf, command->input); | ||
| zbuf_append(&buf, "\", \"zero test "); | ||
| zbuf_append(&buf, command->input); | ||
| zbuf_append(&buf, "\""); | ||
| if (strcmp(command->kind, "lib") != 0) { | ||
| zbuf_append(&buf, ", \"zero run "); | ||
| zbuf_append(&buf, command->input); | ||
| zbuf_append(&buf, "\""); |
Author
Rebase complete ✅Rebased onto latest origin/main (v0.1.2, post borrow-provenance + HTTP client merge). All conflicts resolved. Each branch now has a clean linear history on top of current main. |
Author
|
Rebased onto latest origin/main (v0.1.2). All conflicts resolved. Clean linear history. |
Adds --json flag to zero new, outputting structured JSON with: - schemaVersion, ok, kind, name, path - manifest, entry paths - nextSteps (lib omits 'zero run') Arg parser rewritten to be order-independent: - --json can appear before or after positional args - --json can appear between kind and name Plain-text output unchanged. Tested: - zero new --json cli mycli → correct JSON envelope - zero new lib mylib --json → lib omits run from nextSteps - zero new --json package test-pkg → package includes run - Plain text output unchanged - All 11 CLI tests pass Closes vercel-labs#22
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.
Summary
Adds
--jsonflag tozero new, outputting structured JSON with:schemaVersion,ok,kind,name,pathmanifest,entrypathsnextSteps(lib omitszero run)Arg parser rewritten to be order-independent:
--jsoncan appear before or after positional args--jsoncan appear between kind and namePlain-text output unchanged.
Testing
zero new --json cli mycli→ correct JSON envelopezero new lib mylib --json→ lib omits run from nextStepszero new --json package test-pkg→ package includes runCloses #22