client: add upload progress callback to PublishSite#118
Merged
Conversation
PublishSite now accepts an optional Progress callback on SitePublishOptions so CLI/MCP callers can render an upload progress bar. The callback is invoked once up front (Done 0 of Total, with the total file count and byte size) and once after each file is processed, carrying running uploaded/skipped/bytes counts and the current request path. To give the callback a real Total up front, PublishSite now walks the directory in two passes: it first collects the regular files (and their sizes), then opens the session and uploads. Collecting first also lets an empty publish fail without a server round-trip. The callback defaults to a no-op, so existing callers are unaffected.
This was referenced Jun 26, 2026
acoshift
added a commit
to deploys-app/deploys
that referenced
this pull request
Jun 26, 2026
acoshift
added a commit
to deploys-app/deploys
that referenced
this pull request
Jun 26, 2026
* site: add `site deploy` and an upload progress bar `site deploy` publishes a local directory and deploys it as a permanent (non-TTL) Static deployment in one command, then prints the deployment (url + releaseUrl). It is the permanent counterpart of `site preview`: the differences are that the release environment defaults to production and that it clears any TTL (so a same-named throwaway preview is promoted to a non-expiring deployment). `site publish` is unchanged and still just prints a site:// ref, keeping it composable. publish/deploy/preview now share a deployPublishedStatic helper, and all three render a single-line upload progress bar while files upload. The bar is driven by the new PublishSite Progress callback, drawn on stderr (so it never corrupts -output json/yaml on stdout), and suppressed when stderr is not a terminal (pipes, redirects, CI). ASCII-only and TTY-detected via the char-device mode bit, so no new dependency. Re-pins github.com/deploys-app/api to the commit adding the Progress callback (deploys-app/api#118). * go.mod: re-pin api to main after deploys-app/api#118 merged
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.
What
Adds an optional
Progress func(SitePublishProgress)callback toclient.SitePublishOptions, plus aSitePublishProgressstruct, so CLI/MCP callers can render an upload progress bar forPublishSite.The callback is invoked once up front (
Done == 0, with the finalTotalfile count andBytesTotal) and once after each file is processed, carrying runningUploaded/Skipped/BytesDonecounts and the current request path. A nil callback is a no-op, so existing callers are unaffected.How
To give the callback a real
Totalup front,PublishSitenow walks the directory in two passes:The
Files/Uploaded/Skippedcounting semantics are preserved exactly (including duplicate-content-within-run dedup and the "no files" error).Consumer
The
deploysCLI uses this to render an upload progress bar forsite publish/site deploy/site preview(separate PR, which re-pins to this commit).