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

@ -5,7 +5,8 @@ import { appIdentity, applePhase, appleProductIds, appleReleases, catalogParity,
const summary: ProjectSummary = {
dir: '/games/demo', config: '/games/demo/storebound.config.ts', name: 'Demo', languages: ['en'],
play: { packageName: 'com.example.demo' }, apple: { bundleId: 'com.example.demo', appId: null },
products: 2, productIds: ['coins', 'no_ads'], subscriptions: 0, shots: false, testflightGroups: 0,
platforms: ['ios', 'android'], products: 2, productIds: ['coins', 'no_ads'], subscriptions: 1, subscriptionIds: ['pro_monthly'],
catalog: { ios: ['coins', 'no_ads', 'pro_monthly'], android: ['coins', 'no_ads', 'pro_monthly'] }, shots: false, testflightGroups: 0,
};
const apple = {
@ -29,6 +30,7 @@ describe('portfolio (apps, release trains, catalog parity)', () => {
test('identity: one app, both platforms', () => {
expect(appIdentity(summary)).toEqual({ id: '/games/demo', name: 'Demo', platforms: { ios: { bundleId: 'com.example.demo', ascAppId: null }, android: { packageName: 'com.example.demo' } } });
expect(appIdentity({ ...summary, apple: null }).platforms.ios).toBeNull();
expect(appIdentity({ ...summary, platforms: ['android'] }).platforms.ios).toBeNull();
});
test('versions and phases', () => {
expect(cmpVersion('2.10.0', '2.9.1')).toBeGreaterThan(0);
@ -59,9 +61,11 @@ describe('portfolio (apps, release trains, catalog parity)', () => {
expect(onlyNext.next?.version).toBe('2.3.0');
});
test('catalog parity: config only offline, both stores live', () => {
expect(catalogParity(summary)).toEqual({ checked: 'config', products: 2, subscriptions: 0, onlyIos: [], onlyAndroid: [], missingIos: [], missingAndroid: [], ok: true });
expect(catalogParity(summary)).toEqual({ checked: 'config', products: 2, subscriptions: 1, onlyIos: [], onlyAndroid: [], missingIos: [], missingAndroid: [], ok: true });
const live = catalogParity(summary, appleProductIds(apple), playProductIds(play));
expect(live).toMatchObject({ checked: 'live', onlyIos: ['ios_only'], onlyAndroid: ['no_ads', 'android_only'], missingIos: ['no_ads'], missingAndroid: [], ok: false });
// an item sold on Android only is not missing on iOS
expect(catalogParity({ ...summary, catalog: { ios: ['coins'], android: ['coins', 'no_ads'] } }, appleProductIds(apple), playProductIds(play)).missingIos).toEqual([]);
// one store unreadable: no cross-store claims
expect(catalogParity(summary, undefined, playProductIds(play))).toMatchObject({ onlyIos: [], onlyAndroid: [], missingIos: [], missingAndroid: [] });
});

View file

@ -163,7 +163,7 @@ describe('serve --stdio: session', () => {
expect(errOf(await pending).code).toBe(ERR.cancelled);
});
test('portfolio.status: apps across platforms, release trains, catalog parity, per-app errors, progress n/total', async () => {
const summary = { dir: DEMO, name: 'Demo', apple: { bundleId: 'com.example.demo', appId: null }, play: { packageName: 'com.example.demo' }, products: 2, productIds: ['coins', 'no_ads'], subscriptions: 0 };
const summary = { dir: DEMO, name: 'Demo', apple: { bundleId: 'com.example.demo', appId: null }, play: { packageName: 'com.example.demo' }, platforms: ['ios', 'android'], products: 2, productIds: ['coins', 'no_ads'], subscriptions: 0, subscriptionIds: [], catalog: { ios: ['coins', 'no_ads'], android: ['coins', 'no_ads'] } };
const { call, sent } = await session(argv => argv[0] === 'inspect' ? { data: summary }
: argv[0] === 'check' ? { data: { ok: true, problems: [], warnings: ['w'] } }
: argv[0] === 'apple' ? { code: 1, out: 'error: ASC_KEY_ID and ASC_ISSUER_ID are not set' }