Open History to see the last commit
1import {
2 MOBILE_DEFAULT_THEME_ID,
3 MOBILE_THEME_IDS,
4 type MobileThemeId,
5} from "@t3tools/shared/themePalettes";
6
7import { SHOWCASE_SCENES, type ShowcaseScene } from "./mobile-showcase-environment.ts";
8
9export { SHOWCASE_SCENES };
10export type { ShowcaseScene };
11
12export type ShowcaseAppearance = "light" | "dark";
13
14export const SHOWCASE_THEMES = MOBILE_THEME_IDS;
15const DEFAULT_SHOWCASE_THEME = MOBILE_DEFAULT_THEME_ID;
16export type ShowcaseTheme = MobileThemeId;
17
18export interface ShowcaseStoreAssetSpec {
19 readonly store: "apple" | "google-play";
20 readonly directory: string;
21 readonly width: number;
22 readonly height: number;
23 readonly minimumUploadCount: number;
24 readonly maximumUploadCount: number;
25 readonly maximumFileSizeBytes?: number;
26}
27
28export interface ShowcaseIosDevice {
29 readonly id: string;
30 readonly platform: "ios";
31 readonly simulator: string;
32 readonly simulatorDeviceType?: string;
33 readonly appearance: ShowcaseAppearance;
34 readonly theme: ShowcaseTheme;
35 readonly orientation?: "portrait" | "landscape";
36 readonly scenes: ReadonlyArray<ShowcaseScene>;
37 readonly storeAsset: ShowcaseStoreAssetSpec;
38}
39
40export interface ShowcaseAndroidDevice {
41 readonly id: string;
42 readonly platform: "android";
43 readonly avd: string;
44 readonly appearance: ShowcaseAppearance;
45 readonly theme: ShowcaseTheme;
46 readonly abi?: "arm64-v8a" | "x86_64" | "x86" | "armeabi-v7a";
47 readonly scenes: ReadonlyArray<ShowcaseScene>;
48 readonly viewport?: {
49 readonly width: number;
50 readonly height: number;
51 readonly density?: number;
52 };
53 readonly storeAsset: ShowcaseStoreAssetSpec;
54}
55
56export type ShowcaseDevice = ShowcaseIosDevice | ShowcaseAndroidDevice;
57
58export interface ShowcaseConfig {
59 readonly outputDirectory: string;
60 readonly metroPort: number;
61 readonly settleDelayMs: number;
62 readonly devices: ReadonlyArray<ShowcaseDevice>;
63}
64
65const ANDROID_ABIS = ["arm64-v8a", "x86_64", "x86", "armeabi-v7a"] as const;
66
67export function resolveShowcaseAndroidAbi(
68 value: string | undefined,
69): NonNullable<ShowcaseAndroidDevice["abi"]> {
70 if (!value) return "arm64-v8a";
71 if (ANDROID_ABIS.some((abi) => abi === value)) {
72 return value as NonNullable<ShowcaseAndroidDevice["abi"]>;
73 }
74 throw new Error(
75 `Unsupported T3_SHOWCASE_ANDROID_ABI '${value}'. Use ${ANDROID_ABIS.join(", ")}.`,
76 );
77}
78
79const config: ShowcaseConfig = {
80 outputDirectory: "artifacts/app-store/screenshots",
81 // Dedicated port so the harness cannot attach to a normal mobile dev server
82 // (or a second worktree) and capture the wrong bundle.
83 metroPort: 8199,
84 settleDelayMs: 2_500,
85 devices: [
86 {
87 id: "iphone-6.9",
88 platform: "ios",
89 simulator: "T3 Showcase iPhone 17 Pro Max",
90 simulatorDeviceType: "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro-Max",
91 appearance: "dark",
92 theme: DEFAULT_SHOWCASE_THEME,
93 scenes: ["thread", "terminal", "review", "threads", "environments", "agent-activity"],
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 theme: DEFAULT_SHOWCASE_THEME,
110 scenes: ["thread", "terminal", "review", "threads", "environments", "agent-activity"],
111 storeAsset: {
112 store: "apple",
113 directory: "apple/iphone-6.5",
114 width: 1284,
115 height: 2778,
116 minimumUploadCount: 1,
117 maximumUploadCount: 10,
118 },
119 },
120 {
121 id: "ipad-13",
122 platform: "ios",
123 simulator: "iPad Pro 13-inch (M5)",
124 simulatorDeviceType: "com.apple.CoreSimulator.SimDeviceType.iPad-Pro-13-inch-M5-16GB",
125 appearance: "dark",
126 theme: DEFAULT_SHOWCASE_THEME,
127 orientation: "landscape",
128 // The lock screen does not follow the app's self-rotation, so a
129 // headless landscape capture of it would come out sideways.
130 scenes: ["thread", "terminal", "review", "threads", "environments"],
131 storeAsset: {
132 store: "apple",
133 directory: "apple/ipad-13",
134 width: 2752,
135 height: 2064,
136 minimumUploadCount: 1,
137 maximumUploadCount: 10,
138 },
139 },
140 {
141 id: "pixel",
142 platform: "android",
143 avd: "Pixel_10_Pro",
144 // Apple Silicon uses ARM64 locally; CI overrides this with x86_64 so its
145 // Blacksmith Linux runner can use KVM acceleration.
146 abi: resolveShowcaseAndroidAbi(process.env.T3_SHOWCASE_ANDROID_ABI),
147 appearance: "dark",
148 theme: DEFAULT_SHOWCASE_THEME,
149 viewport: {
150 width: 1080,
151 height: 1920,
152 density: 420,
153 },
154 scenes: ["thread", "terminal", "review", "threads", "environments", "agent-activity"],
155 storeAsset: {
156 store: "google-play",
157 directory: "google-play/phone",
158 width: 1080,
159 height: 1920,
160 minimumUploadCount: 2,
161 maximumUploadCount: 8,
162 maximumFileSizeBytes: 8 * 1024 * 1024,
163 },
164 },
165 {
166 id: "android-tablet-7",
167 platform: "android",
168 avd: "Pixel_10_Pro",
169 abi: resolveShowcaseAndroidAbi(process.env.T3_SHOWCASE_ANDROID_ABI),
170 appearance: "dark",
171 theme: DEFAULT_SHOWCASE_THEME,
172 viewport: {
173 width: 1080,
174 height: 1920,
175 density: 288,
176 },
177 scenes: ["thread", "terminal", "review", "threads", "environments", "agent-activity"],
178 storeAsset: {
179 store: "google-play",
180 directory: "google-play/tablet-7",
181 width: 1080,
182 height: 1920,
183 minimumUploadCount: 4,
184 maximumUploadCount: 8,
185 maximumFileSizeBytes: 8 * 1024 * 1024,
186 },
187 },
188 {
189 id: "android-tablet-10",
190 platform: "android",
191 avd: "Pixel_10_Pro",
192 abi: resolveShowcaseAndroidAbi(process.env.T3_SHOWCASE_ANDROID_ABI),
193 appearance: "dark",
194 theme: DEFAULT_SHOWCASE_THEME,
195 viewport: {
196 width: 1440,
197 height: 2560,
198 density: 288,
199 },
200 scenes: ["thread", "terminal", "review", "threads", "environments", "agent-activity"],
201 storeAsset: {
202 store: "google-play",
203 directory: "google-play/tablet-10",
204 width: 1440,
205 height: 2560,
206 minimumUploadCount: 4,
207 maximumUploadCount: 8,
208 maximumFileSizeBytes: 8 * 1024 * 1024,
209 },
210 },
211 ],
212};
213
214export default config;