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:
CRTkafa 2026-10-10 18:15:48 +00:00
parent 7fab0a5b03
commit 9320d64f46
12 changed files with 60 additions and 24 deletions

View file

@ -78,11 +78,16 @@ export interface ProjectSummary {
languages: string[];
play: { packageName: string } | null;
apple: { bundleId: string; appId: string | null } | null;
/** One-time in-app products in the config (shared by both stores). */
/** app.platforms (default: from the apple / play sections). */
platforms: ('ios' | 'android')[];
/** One-time in-app products in the config (one shared catalog). */
products: number;
productIds: string[];
/** Subscriptions in the config (0 until the config defines them). */
/** Auto-renewable subscriptions in the config (all groups). */
subscriptions: number;
subscriptionIds: string[];
/** Product and subscription ids each store should sell (items may be limited to one platform). */
catalog: { ios: string[]; android: string[] };
shots: boolean;
testflightGroups: number;
}

View file

@ -10,8 +10,8 @@ export function appIdentity(s: ProjectSummary): AppIdentity {
id: s.dir,
name: s.name,
platforms: {
ios: s.apple ? { bundleId: s.apple.bundleId, ascAppId: s.apple.appId } : null,
android: s.play ? { packageName: s.play.packageName } : null,
ios: s.apple && s.platforms.includes('ios') ? { bundleId: s.apple.bundleId, ascAppId: s.apple.appId } : null,
android: s.play && s.platforms.includes('android') ? { packageName: s.play.packageName } : null,
},
};
}
@ -86,12 +86,13 @@ export const playProductIds = (data: unknown): string[] => (((data as J)?.produc
* and config ids missing from a store the app is on.
*/
export function catalogParity(s: ProjectSummary, apple?: string[], play?: string[]): CatalogParity {
const ids = s.productIds;
const live = apple !== undefined || play !== undefined;
const onlyIos = apple && play ? apple.filter(x => !play.includes(x)) : [];
const onlyAndroid = apple && play ? play.filter(x => !apple.includes(x)) : [];
const missingIos = s.apple && apple ? ids.filter(x => !apple.includes(x)) : [];
const missingAndroid = s.play && play ? ids.filter(x => !play.includes(x)) : [];
// the status reads list one-time products; subscriptions are compared by `catalog diff` (catalog.diff method)
const sold = (ids: string[]) => ids.filter(x => s.productIds.includes(x));
const missingIos = apple ? sold(s.catalog.ios).filter(x => !apple.includes(x)) : [];
const missingAndroid = play ? sold(s.catalog.android).filter(x => !play.includes(x)) : [];
return {
checked: live ? 'live' : 'config', products: s.products, subscriptions: s.subscriptions,
onlyIos, onlyAndroid, missingIos, missingAndroid,