Skip to content

feat(metadata): allow up to 3 previews per device type#3593

Draft
EvanBacon wants to merge 1 commit intomainfrom
@bacon/metadata-multi-previews
Draft

feat(metadata): allow up to 3 previews per device type#3593
EvanBacon wants to merge 1 commit intomainfrom
@bacon/metadata-multi-previews

Conversation

@EvanBacon
Copy link
Copy Markdown
Contributor

Summary

  • Lift the hard-coded single-preview-per-PreviewType limit in metadata:push/metadata:pull. Apple supports up to 3 video previews per device type; we now sync all of them.
  • ApplePreviews accepts either a single ApplePreviewConfig (legacy form, still works) or an array of configs. Existing store.config.json files using the single-object form continue to parse and push without changes.
  • metadata:pull mirrors how screenshots are emitted: 0 -> omitted, 1 -> single object (back-compat), 2+ -> array. Order is preserved.
  • metadata:push now mirrors the screenshots sync pipeline for previews: match existing previews by fileName + fileSize + completion state, upload only changed entries, delete removed ones, and reorder via AppPreviewSet.reorderPreviewsAsync to match config order. Existing previews with only a previewFrameTimeCode change are patched in place.
  • JSON schema (schema/metadata-0.json) updated to allow either form for each preview type.

Test plan

  • yarn jest src/metadata/apple/tasks/__tests__/previews.test.ts — 16 passing, including new cases:
    • single string preview (legacy)
    • single object preview with previewFrameTimeCode (legacy)
    • multi-preview array with mixed string + object entries
    • reorder when ASC ordering differs from config
    • empty array short-circuits without uploading
    • downloadAsync emits an array when a set has multiple previews
  • yarn jest src/metadata/apple/config — reader/writer tests still pass (63)
  • yarn lint on changed files — no errors (only the same pre-existing no-unnecessary-type-assertion warning that already exists in screenshots.ts)
  • yarn fmt applied
  • Manual metadata:pull against an app that has multiple previews per device type
  • Manual metadata:push with both single-object and array forms in store.config.json

🤖 Generated with Claude Code

Apple supports up to 3 video previews per device type, but the
metadata:push/pull pipeline previously hard-coded a single preview per
PreviewType. Lift that limitation by accepting an array of preview
configs alongside the existing single-config form (which still works
for backwards compat). Sync semantics now mirror screenshots: match by
filename + size, upload only changed entries, delete removed ones, and
reorder the set to match config order.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

✅ Thank you for adding the changelog entry!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Subscribed to pull request

File Patterns Mentions
**/* @douglowder
packages/eas-cli/schema/** @byCedric
packages/eas-cli/src/metadata/** @byCedric

Generated by CodeMention

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 72.22222% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.30%. Comparing base (8c170af) to head (608bb66).

Files with missing lines Patch % Lines
...ckages/eas-cli/src/metadata/apple/config/writer.ts 0.00% 17 Missing ⚠️
...kages/eas-cli/src/metadata/apple/tasks/previews.ts 89.05% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3593      +/-   ##
==========================================
+ Coverage   54.26%   54.30%   +0.05%     
==========================================
  Files         821      821              
  Lines       35327    35383      +56     
  Branches     7363     7381      +18     
==========================================
+ Hits        19166    19212      +46     
- Misses      16074    16084      +10     
  Partials       87       87              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@EvanBacon EvanBacon marked this pull request as draft April 10, 2026 00:13
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