diff --git a/CHANGELOG.md b/CHANGELOG.md index a0bcd5e..a82a57b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ ## Unreleased +- **apple build:** the device-family stop prints short `fix:` lines first (e.g. `fix: apple.ipad: true in storebound.config.ts`); a test proves a stopped build exits non-zero through the ship-step path. + ## 0.8.77 ยท 2026-11-08 - **iPhone Duo:** outer and inner files are no longer cut to the first 10: the limit comes from Apple's reference data, and over it nothing changes and nothing is dropped. `apple screenshots --duo-only` writes only the Duo set. `apple cpp` no longer lists creative-assets flags. diff --git a/cli/apple/build.ts b/cli/apple/build.ts index 1655081..c70fdc2 100644 --- a/cli/apple/build.ts +++ b/cli/apple/build.ts @@ -201,7 +201,7 @@ export async function run(ctx: Ctx): Promise { const familyBlockers = deviceFamilies.filter(d => d.level === 'blocker'); for (const d of deviceFamilies) if (d.level === 'warn' || (d.level === 'blocker' && (dry || a.has('allow-device-gap')))) warn(TAG, `${d.msg}${d.fix ? ` -> ${d.fix}` : ''}`); if (familyBlockers.length && !dry && !a.has('allow-device-gap')) - throw new Error(`stopped before the archive: ${familyBlockers.map(d => `${d.msg}. Fix: ${d.fix}`).join('\n')}\n(--allow-device-gap builds anyway)`); + throw new Error(`${familyFixLines(familyBlockers, config.apple?.ipad).join('\n')}\nstopped before the archive: ${familyBlockers.map(d => `${d.msg}. Fix: ${d.fix}`).join('\n')}\n(--allow-device-gap builds anyway)`); const scan = discoverTargets(root, config); const ids = [bundleId, ...scan.extensions.map(t => t.bundleId)]; @@ -313,3 +313,13 @@ export async function run(ctx: Ctx): Promise { if (json) printJson(result); done(TAG, `${relative(root, result.ipa)}: ${info.bundleId} ${info.version} (${info.build}). Next: storebound apple upload ${relative(root, result.ipa)} --dry`); } + +/** Short "fix:" lines put first in the device-family stop, so a truncated or piped log still shows the fix. Pure. */ +export function familyFixLines(blockers: { msg: string }[], ipad: boolean | undefined): string[] { + const out = new Set(); + for (const b of blockers) { + if (/TARGETED_DEVICE_FAMILY = 1\b|no iPad\)/.test(b.msg)) out.add('fix: TARGETED_DEVICE_FAMILY "1,2" in the Xcode project (Supported Destinations: add iPad)'); + if (ipad !== true && /iPad/.test(b.msg)) out.add('fix: apple.ipad: true in storebound.config.ts'); + } + return [...out]; +} diff --git a/tests/apple-release-gaps.test.ts b/tests/apple-release-gaps.test.ts index 14fd382..1c4b2e7 100644 --- a/tests/apple-release-gaps.test.ts +++ b/tests/apple-release-gaps.test.ts @@ -302,6 +302,10 @@ describe('device families (fake App Store Connect + project)', () => { // the escape hatch passes the check (the run then stops later: no Xcode on this machine) const gap = await capture(() => appleBuild(p.ctx([...argv, '--allow-device-gap']))).catch(e => ({ out: '', err: String((e as Error).message ?? e), exit: 1 })); expect(gap.err).not.toContain('stopped before the archive'); + // the ship-step path (apple build --yes): a stopped build never exits 0, and the fix is its own short line + const sr = await ship('apple build', [...argv, '--yes'], a => appleBuild({ ...p.ctx(argv), args: a })); + expect(sr.code).not.toBe(0); + expect(sr.err).toMatch(/^fix: apple\.ipad: true in storebound\.config\.ts$/m); }); test('apple build passes the check with iPad in the project and apple.ipad true; an iPhone-only live version never blocks', async () => {