feat(cli): port supabase storage ls/cp/mv/rm to native TypeScript#5667
Open
Coly010 wants to merge 1 commit into
Open
feat(cli): port supabase storage ls/cp/mv/rm to native TypeScript#5667Coly010 wants to merge 1 commit into
Coly010 wants to merge 1 commit into
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Replaces the Phase 0 Go-proxy shims for `storage ls/cp/mv/rm` with native Effect implementations that talk to the Storage gateway directly, mirroring `apps/cli-go/internal/storage` byte-for-byte in text mode and adding TS-only `--output-format json|stream-json` structured output. Per the hoist-before-duplicate policy, the storage gateway, credential derivation, bucket-config helpers, content-type sniffing, the gateway runtime layer, and the yes/no prompt are promoted out of `seed buckets` into `legacy/shared/`; `seed buckets` is refactored to consume them (regression covered by its existing suite). `--linked`/`--local` are declared per-leaf rather than as `storage`-group scoped globals: Effect CLI requires global-flag names to be unique tree-wide and `seed` already owns `linked`/`local` with opposite defaults. The only behavioural cost vs Go's persistent flags is that they must follow the subcommand token (`storage ls --local`), the same shape the `db` family uses. Flips `storage ls/cp/mv/rm` to `ported` in the porting-status tracker and removes the bogus `--copy-metadata` cp note.
9f57951 to
3fe148c
Compare
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@3fe148c9950e3da8b114ab41aff233ac1ec47f6ePreview package for commit |
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 changed
Replaces the Phase 0
LegacyGoProxyshims forstorage ls/cp/mv/rmwith native Effect implementations that talk to the Storage gateway directly (apps/cli-go/internal/storageas the reference), and adds TS-only--output-format json|stream-jsonon top of byte-faithful Go text output.ls— pagination + recursive BFS over buckets/objects.cp— 4-way scheme branch (download/upload, single/recursive), dst-key resolution, bucket auto-create onBucket not found, content-type sniff/refine,--cache-control/--content-type/--jobs.mv— single move with recursive per-object BFS fallback onnot_found.rm— group-by-bucket, confirm prompt, chunked deletes (1000), recursive directory + bucket removal.Shared-infra promotion (hoist-before-duplicate)
The Storage gateway, credential derivation, bucket-config helpers, content-type sniffing, the gateway runtime layer, and the yes/no prompt are promoted out of
seed bucketsintolegacy/shared/.seed bucketsis refactored to consume them in the same change (its existing suite covers the regression).Reviewer notes
--linked/--localare per-leaf, not group scoped globals. Effect CLI requires global-flag names to be unique tree-wide andseedalready ownslinked/localwith opposite Go defaults, so two groups can't both declare them (caught by the bundled-binary smoke test). Cost vs Go's persistent flags: the flags must follow the subcommand token (storage ls --local, notstorage --local ls) — the same shape thedbfamily uses. Documented instorage.flags.ts+ eachSIDE_EFFECTS.md.filepath.Joinhas no boundary guard, so adding one would diverge from the strict 1:1 port; left identical to Go (noted for a future, explicit hardening).ported; the bogus--copy-metadatacp note removed (no such Go flag).Related
CLI-1321