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