Open History to see the last commit
1import { SHOWCASE_SCENES, type ShowcaseScene } from "./mobile-showcase-environment.ts";
2
3export { SHOWCASE_SCENES };
4export type { ShowcaseScene };
5
6export type ShowcaseAppearance = "light" | "dark";
7
8export interface ShowcaseStoreAssetSpec {
9 readonly store: "apple" | "google-play";
10 /** Device directory relative to ShowcaseConfig.outputDirectory. */
11 readonly directory: string;
12 readonly width: number;
13 readonly height: number;
14 readonly minimumUploadCount: number;
15 readonly maximumUploadCount: number;
16 readonly maximumFileSizeBytes?: number;
17}
18
19export interface ShowcaseIosDevice {
20 readonly id: string;
21 readonly platform: "ios";
22 /** Exact name from `xcrun simctl list devices available`. */
23 readonly simulator: string;
24 /** Device type used to create a disposable simulator when the named one is absent. */
25 readonly simulatorDeviceType?: string;
26 /** Appearance used when the CLI does not pass --appearance. */
27 readonly appearance: ShowcaseAppearance;
28 /** Orientation applied by the capture harness. Defaults to portrait. */
29 readonly orientation?: "portrait" | "landscape";
30 readonly scenes: ReadonlyArray<ShowcaseScene>;
31 readonly storeAsset: ShowcaseStoreAssetSpec;
32}
33
34export interface ShowcaseAndroidDevice {
35 readonly id: string;
36 readonly platform: "android";
37 /** Exact name from `emulator -list-avds`. */
38 readonly avd: string;
39 /** Appearance used when the CLI does not pass --appearance. */
40 readonly appearance: ShowcaseAppearance;
41 /** Native ABI used by the AVD, from its config.ini `abi.type`. */
42 readonly abi?: "arm64-v8a" | "x86_64" | "x86" | "armeabi-v7a";
43 readonly scenes: ReadonlyArray<ShowcaseScene>;
44 /** Optional capture viewport. Omit to use the AVD's native size and density. */
45 readonly viewport?: {
46 readonly width: number;
47 readonly height: number;
48 readonly density?: number;
49 };
50 readonly storeAsset: ShowcaseStoreAssetSpec;
51}
52
53export type ShowcaseDevice = ShowcaseIosDevice | ShowcaseAndroidDevice;
54
55export interface ShowcaseConfig {
56 readonly outputDirectory: string;
57 readonly metroPort: number;
58 readonly settleDelayMs: number;
59 readonly devices: ReadonlyArray<ShowcaseDevice>;
60}
61
62const ANDROID_ABIS = ["arm64-v8a", "x86_64", "x86", "armeabi-v7a"] as const;
63
64export function resolveShowcaseAndroidAbi(
65 value: string | undefined,
66): NonNullable<ShowcaseAndroidDevice["abi"]> {
67 if (!value) return "arm64-v8a";
68 if (ANDROID_ABIS.some((abi) => abi === value)) {
69 return value as NonNullable<ShowcaseAndroidDevice["abi"]>;
70 }
71 throw new Error(
72 `Unsupported T3_SHOWCASE_ANDROID_ABI '${value}'. Use ${ANDROID_ABIS.join(", ")}.`,
73 );
74}
75
76/**
77 * The defaults cover every App Store Connect and Google Play upload slot used
78 * by the mobile app. Edit this matrix (or pass --device / --scene) without
79 * changing the runner. Every target declares and validates its exact upload
80 * dimensions so SDK or emulator changes cannot silently produce invalid files.
81 */
82const config: ShowcaseConfig = {
83 outputDirectory: "artifacts/app-store/screenshots",
84 // Dedicated port so the harness cannot attach to a normal mobile dev server
85 // (or a second worktree) and capture the wrong bundle.
86 metroPort: 8199,
87 settleDelayMs: 2_500,
88 devices: [
89 {
90 id: "iphone-6.9",
91 platform: "ios",
92 simulator: "iPhone 17 Pro Max",
93 simulatorDeviceType: "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro-Max",
94 appearance: "dark",
95 scenes: ["thread", "terminal", "review", "threads", "environments"],
96 storeAsset: {
97 store: "apple",
98 directory: "apple/iphone-6.9",
99 width: 1320,
100 height: 2868,
101 minimumUploadCount: 1,
102 maximumUploadCount: 10,
103 },
104 },
105 {
106 id: "iphone-6.5",
107 platform: "ios",
108 simulator: "T3 Showcase iPhone 14 Plus",
109 simulatorDeviceType: "com.apple.CoreSimulator.SimDeviceType.iPhone-14-Plus",
110 appearance: "dark",
111 scenes: ["thread", "terminal", "review", "threads", "environments"],
112 storeAsset: {
113 store: "apple",
114 directory: "apple/iphone-6.5",
115 width: 1284,
116 height: 2778,
117 minimumUploadCount: 1,
118 maximumUploadCount: 10,
119 },
120 },
121 {
122 id: "ipad-13",
123 platform: "ios",
124 simulator: "iPad Pro 13-inch (M5)",
125 simulatorDeviceType: "com.apple.CoreSimulator.SimDeviceType.iPad-Pro-13-inch-M5-16GB",
126 appearance: "dark",
127 orientation: "landscape",
128 scenes: ["thread", "terminal", "review", "threads", "environments"],
129 storeAsset: {
130 store: "apple",
131 directory: "apple/ipad-13",
132 width: 2752,
133 height: 2064,
134 minimumUploadCount: 1,
135 maximumUploadCount: 10,
136 },
137 },
138 {
139 id: "pixel",
140 platform: "android",
141 avd: "Pixel_10_Pro",
142 // Apple Silicon uses ARM64 locally; CI overrides this with x86_64 so its
143 // Blacksmith Linux runner can use KVM acceleration.
144 abi: resolveShowcaseAndroidAbi(process.env.T3_SHOWCASE_ANDROID_ABI),
145 appearance: "dark",
146 viewport: {
147 width: 1080,
148 height: 1920,
149 density: 420,
150 },
151 scenes: ["thread", "terminal", "review", "threads", "environments"],
152 storeAsset: {
153 store: "google-play",
154 directory: "google-play/phone",
155 width: 1080,
156 height: 1920,
157 minimumUploadCount: 2,
158 maximumUploadCount: 8,
159 maximumFileSizeBytes: 8 * 1024 * 1024,
160 },
161 },
162 {
163 id: "android-tablet-7",
164 platform: "android",
165 avd: "Pixel_10_Pro",
166 abi: resolveShowcaseAndroidAbi(process.env.T3_SHOWCASE_ANDROID_ABI),
167 appearance: "dark",
168 viewport: {
169 width: 1080,
170 height: 1920,
171 density: 288,
172 },
173 scenes: ["thread", "terminal", "review", "threads", "environments"],
174 storeAsset: {
175 store: "google-play",
176 directory: "google-play/tablet-7",
177 width: 1080,
178 height: 1920,
179 minimumUploadCount: 4,
180 maximumUploadCount: 8,
181 maximumFileSizeBytes: 8 * 1024 * 1024,
182 },
183 },
184 {
185 id: "android-tablet-10",
186 platform: "android",
187 avd: "Pixel_10_Pro",
188 abi: resolveShowcaseAndroidAbi(process.env.T3_SHOWCASE_ANDROID_ABI),
189 appearance: "dark",
190 viewport: {
191 width: 1440,
192 height: 2560,
193 density: 288,
194 },
195 scenes: ["thread", "terminal", "review", "threads", "environments"],
196 storeAsset: {
197 store: "google-play",
198 directory: "google-play/tablet-10",
199 width: 1440,
200 height: 2560,
201 minimumUploadCount: 4,
202 maximumUploadCount: 8,
203 maximumFileSizeBytes: 8 * 1024 * 1024,
204 },
205 },
206 ],
207};
208
209export default config;