Desktop: adapt to 0.5.0 (app.platforms, subscriptions, catalog diff), Dependencies polish, ~ for the home folder
- inspect reports platforms, subscription ids and the catalog each store should sell; app identity and parity follow app.platforms and per-item platforms; catalog.diff joins the JSON methods - Portfolio: one Platforms column, compact catalog, paths truncated and shown with ~; the confirm dialog and run logs show ~ instead of the home folder
This commit is contained in:
parent
7fab0a5b03
commit
9320d64f46
12 changed files with 60 additions and 24 deletions
|
|
@ -1,11 +1,13 @@
|
|||
// Offline summary of the project config: app name, store ids, languages, products, shots. No network, no credentials.
|
||||
// storebound inspect [--json]
|
||||
import { platformsOf, sellsOn } from './lib/config';
|
||||
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;
|
||||
const subs = (config.subscriptions ?? []).flatMap(g => g.subscriptions);
|
||||
return {
|
||||
dir: root,
|
||||
config: path,
|
||||
|
|
@ -13,10 +15,16 @@ export function summarize(ctx: Ctx): ProjectSummary {
|
|||
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,
|
||||
platforms: platformsOf(config),
|
||||
products: config.products?.length ?? 0,
|
||||
productIds: (config.products ?? []).map(p => p.id),
|
||||
// subscriptions arrive in the config schema separately; counted when present
|
||||
subscriptions: ((config as { subscriptions?: unknown[] }).subscriptions ?? []).length,
|
||||
subscriptions: subs.length,
|
||||
subscriptionIds: subs.map(s => s.id),
|
||||
// the catalog each store should sell (items can be limited to one platform)
|
||||
catalog: {
|
||||
ios: config.apple ? [...(config.products ?? []), ...subs].filter(x => sellsOn(config, x, 'apple')).map(x => x.id) : [],
|
||||
android: config.play ? [...(config.products ?? []), ...subs].filter(x => sellsOn(config, x, 'play')).map(x => x.id) : [],
|
||||
},
|
||||
shots: !!config.shots,
|
||||
testflightGroups: config.apple?.testflight?.groups?.length ?? 0,
|
||||
};
|
||||
|
|
@ -25,7 +33,7 @@ export function summarize(ctx: Ctx): ProjectSummary {
|
|||
export async function run(ctx: Ctx): Promise<void> {
|
||||
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', `${s.name} · ${s.platforms.join(' + ')} · ${s.languages.length} languages · ${s.products} products · ${s.subscriptions} subscriptions`);
|
||||
log('inspect', `play ${s.play?.packageName ?? '-'} · apple ${s.apple?.bundleId ?? '-'}${s.apple?.appId ? ` (${s.apple.appId})` : ''}`);
|
||||
log('inspect', `config ${s.config}`);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue