Skip to content

Sync theme asset binaries and list content changes#4

Closed
mikel wants to merge 1 commit into
feature/content-api-alignmentfrom
feature/theme-assets-and-changes
Closed

Sync theme asset binaries and list content changes#4
mikel wants to merge 1 commit into
feature/content-api-alignmentfrom
feature/theme-assets-and-changes

Conversation

@mikel

@mikel mikel commented Jun 12, 2026

Copy link
Copy Markdown

Dependencies & PR Stack

This is a chain of PRs on the CLI:

develop
└ feature/content-api-alignment (#3)
  └ feature/theme-assets-and-changes (#4) (this PR)
    └ feature/theme-diff (#5)

Server side (core-gem): consumes the Store Management REST API from the gem chain, https://github.com/GetStoreConnect/core-gem/pull/8062 through #8072.


Summary

Stacked on #3. Completes the git-native theme workflow from the store-go-live audit: asset binaries now round-trip, and drafts are discoverable from any machine.

Theme assets

  • sc theme pull downloads each asset binary into assets/<key> (slash-aware keys become subdirectories) alongside the existing assets.json. Download failures warn on stderr and skip rather than failing the pull, keeping --json stdout clean.
  • sc theme push hash-diffs local assets/ files (SHA-256) against the server theme's content_hash values, uploads only new/changed binaries through the media upload flow (POST /api/v1/media/upload_url → multipart to Cloudinary → secure_url), and registers them on the draft via the content change PATCH assets array. Unchanged binaries are never re-uploaded.
  • api.ThemeAsset aligned to the server contract: key (was filename) + content_hash.

Draft resume

  • New sc change list [--status draft|review|approved|published] consuming GET /api/v1/content_changes — partners and teammates can find and resume drafts from any machine. Table output for humans, --json for automation.

Server counterpart: core-gem#8068 (asset staging endpoint + hash fields on theme GET), stacked on core-gem#8066.

Tests

httptest coverage for upload_url, the multipart upload (params + file field assertions), ContentChanges.List, the PATCH body including assets, and pure-function hash-diff selection. make fmt && make test && make build all green across all packages.

theme pull downloads asset files into assets/; theme push hash-diffs
them against the server theme, uploads new or changed binaries through
the media upload flow, and registers them on the draft content change.
sc change list shows the store's content changes so drafts can be
resumed from any machine.
@mikel

mikel commented Jun 22, 2026

Copy link
Copy Markdown
Author

Superseded by #6 — the CLI agent-platform work collapsed into one PR off develop. Reopen if anything was missed.

@mikel mikel closed this Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant