// Offline summary of the project config: app name, store ids, languages, products, shots. No network, no credentials. // storebound inspect [--json] import type { Ctx } from './lib/ctx'; import type { ProjectSummary } from './lib/desktop-protocol'; import { log, printJson } from './lib/log'; export function summarize(ctx: Ctx): ProjectSummary { const { config, root, path } = ctx.loaded; return { dir: root, config: path, name: config.app.name, languages: config.languages.map(l => l.id), play: config.play ? { packageName: config.play.packageName } : null, apple: config.apple ? { bundleId: config.apple.bundleId, appId: config.apple.appId ?? null } : null, products: config.products?.length ?? 0, shots: !!config.shots, testflightGroups: config.apple?.testflight?.groups?.length ?? 0, }; } export async function run(ctx: Ctx): Promise { const s = summarize(ctx); if (ctx.args.has('json')) { printJson(s); return; } log('inspect', `${s.name} · ${s.languages.length} languages · ${s.products} products`); log('inspect', `play ${s.play?.packageName ?? '-'} · apple ${s.apple?.bundleId ?? '-'}${s.apple?.appId ? ` (${s.apple.appId})` : ''}`); log('inspect', `config ${s.config}`); }