// Dev fixtures of the editors (made up): project.editable of the fixture folders and listing.live of store-only apps. import type { EditableResult, ProjectSummary } from '../api'; import type { LiveListings } from '../../../../cli/listing-store'; const PLAY_LIMITS = { title: 30, short: 80, full: 4000, whatsNew: 500 }; const APPLE_LIMITS = { name: 30, subtitle: 30, promotionalText: 170, keywords: 100, description: 4000, whatsNew: 4000 }; const PLAY_CODE: Record = { en: 'en-US', tr: 'tr-TR', ja: 'ja-JP', ar: 'ar' }; const APPLE_CODE: Record = { en: 'en-US', tr: 'tr', ja: 'ja', ar: 'ar-SA' }; export function editableFixture(s: ProjectSummary | undefined): EditableResult | undefined { if (!s) return undefined; const langs = s.languages.map(id => ({ id, play: s.play ? [PLAY_CODE[id] ?? id] : [], apple: s.apple ? APPLE_CODE[id] ?? id : null, rtl: id === 'ar' })); const text = (lang: string) => ({ title: s.name, short: `${s.name}: a calm, short promise (${lang})`, full: `${s.name} in ${lang}. What it does and why it feels good.\n\nFEATURES\n• One-thumb controls\n• Works offline`, whatsNew: 'Smoother sync and a darker dark mode.', }); return { root: s.dir, files: { config: 'storebound.config.ts', play: s.play ? 'store/listing.md' : null, apple: s.apple ? 'store/appstore.md' : null, contact: '.storebound/' }, format: 'ts', git: { repo: true, uncommitted: ['store/appstore.md'] }, appName: s.name, appleName: s.name, languages: langs, play: s.play ? langs.map(l => ({ lang: l.play[0]!, language: l.id, codes: l.play, status: null, exists: l.id !== 'ar', values: l.id === 'ar' ? {} : text(l.play[0]!) })) : null, apple: s.apple ? langs.map(l => ({ lang: l.apple!, language: l.id, status: l.id === 'ja' ? 'draft' : null, exists: true, values: { subtitle: 'Tidy lists, calm days', promotionalText: 'New: shared lists.', keywords: 'lists,todo,planner,groceries,checklist,tasks,organize,shopping,reminders,family', description: `${s.name} keeps what matters in order.`, whatsNew: 'Smoother sync.', whatToTest: 'Shared lists on two devices.', } })) : null, config: { app: { name: s.name, privacyPolicyUrl: 'https://example.com/privacy', supportUrl: 'https://example.com/support', website: 'https://example.com', contactEmail: 'support@example.com', copyright: '2026 Example Studio' }, apple: s.apple ? { bundleId: s.apple.bundleId, info: { categories: { primary: s.profile === 'game' ? 'GAMES' : 'PRODUCTIVITY', ...(s.profile === 'game' ? { primarySubOne: 'GAMES_PUZZLE' } : {}) }, ageRating: {}, contentRights: 'DOES_NOT_USE_THIRD_PARTY_CONTENT', free: true, reviewNotes: 'Sign in with the demo account.' }, testflight: { groups: [{ name: 'Studio team', internal: true }], description: { en: 'Thanks for testing!' } } } : null, play: s.play ? { packageName: s.play.packageName, category: s.profile === 'game' ? 'Puzzle' : 'Productivity' } : null, products: s.productIds.map(id => ({ id, type: 'consumable', usd: 0.99, listings: Object.fromEntries(s.languages.map(l => [l, { title: id.replace(/_/g, ' '), description: 'A handful of coins.' }])) })), subscriptions: s.subscriptionIds.length ? [{ name: `${s.name} VIP`, listings: { en: { name: 'VIP' } }, subscriptions: s.subscriptionIds.map(id => ({ id, period: 'P1M', level: 1, usd: 4.99, listings: { en: { title: 'VIP monthly', description: 'Every level, no ads.' } } })) }] : [], dataSafety: { collectsData: true, encryptedInTransit: true, data: { PSL_CRASH_LOGS: { shared: false, collect: ['analytics'] } } }, appPrivacy: null, reviewAccess: { signInRequired: false }, accounts: null, social: null, shots: s.shots ? { scenes: [{ id: 'hero', frames: [{ src: 'hero.png' }] }, { id: 'levels', frames: [{ src: 'levels.png' }] }, { id: 'shop', frames: [{ src: 'shop.png' }] }], feature: null } : null, }, contact: { firstName: 'A***', lastName: 'L***', phone: '+15***', email: 'a***@example.com' }, demoAccount: null, limits: { play: PLAY_LIMITS, apple: APPLE_LIMITS, iap: { name: 30, description: 45 }, appleSub: { name: 30, description: 45 }, playSub: { description: 200, benefits: 4, benefit: 40 }, reviewNotesBytes: 4000 }, }; } export function liveFixture(target: string): LiveListings { const play = /android:/.test(target), ios = /ios:/.test(target); return { play: play ? [{ language: 'en-US', title: 'Store Only App', short: 'A store-only app read live', full: 'Read straight from Google Play.' }, { language: 'tr-TR', title: 'Mağaza Uygulaması', short: 'Canlı okunan bir uygulama', full: 'Doğrudan Google Play\'den okundu.' }] : null, apple: ios ? { version: '1.4.0', state: 'READY_FOR_SALE', editable: false, locales: [{ locale: 'en-US', values: { name: 'Store Only App', subtitle: 'Read live', promotionalText: 'Fresh from App Store Connect.', keywords: 'store,live', description: 'Read straight from App Store Connect.', whatsNew: 'Fixes.' } }] } : null, errors: {}, }; }