check blocks an apple app without app.copyright (App Store Connect requires it; never filled in automatically); validate reads the live version's copyright and says whether the store has one; round-trip test that the config writers (upsertBlock, upsertNestedString, removeKeyPath) keep unknown keys and comments; tests
This commit is contained in:
parent
73db689386
commit
e9507d8884
5 changed files with 79 additions and 3 deletions
|
|
@ -43,7 +43,9 @@ export function rendersFindings(store: 'apple' | 'play', r: RendersCheck | undef
|
|||
}
|
||||
|
||||
export interface AppleSnapshot {
|
||||
version: { versionString: string; state: string } | null;
|
||||
version: { versionString: string; state: string; copyright?: string | null } | null;
|
||||
/** app.copyright from the config (undefined: not set). */
|
||||
configCopyright?: string;
|
||||
build: { number: string; processingState: string; usesNonExemptEncryption: boolean | null; declarationState: string | null } | null;
|
||||
/** Locales the config expects (apple: entries of `languages`). */
|
||||
expectedLocales: string[];
|
||||
|
|
@ -140,6 +142,17 @@ const ageOpen = (r: Record<string, unknown>): { open: string[]; soft: string[] }
|
|||
const urlOk = (u: UrlCheck) => u.status !== null && u.status >= 200 && u.status < 300;
|
||||
const urlMsg = (u: UrlCheck) => (u.status === null ? `unreachable (${u.error ?? 'no answer'})` : `HTTP ${u.status}`);
|
||||
|
||||
export const COPYRIGHT_MISSING = "app.copyright is missing: App Store Connect requires it. Use your public brand (e.g. '2026 <brand>'); never a company name you keep private.";
|
||||
|
||||
/** Copyright: App Store Connect refuses to submit a version without one; storebound never fills it in. */
|
||||
export function copyrightRules(s: Pick<AppleSnapshot, 'version' | 'configCopyright'>): Finding[] {
|
||||
if (!s.version || s.version.copyright === undefined) return [];
|
||||
const live = s.version.copyright?.trim();
|
||||
const cfg = s.configCopyright?.trim();
|
||||
if (live) return [{ store: 'apple', level: cfg ? 'ok' : 'warn', code: 'copyright', msg: cfg ? `copyright on the store: ${live}` : `copyright on the store: ${live}; ${COPYRIGHT_MISSING}`, fix: cfg ? undefined : 'set app.copyright in storebound.config.ts' }];
|
||||
return [{ store: 'apple', level: 'blocker', code: 'copyright', msg: `version ${s.version.versionString} has no copyright on the store${cfg ? ` (config has '${cfg}': storebound apple listing sends it)` : `; ${COPYRIGHT_MISSING}`}`, fix: cfg ? 'storebound apple listing --version x.y.z' : 'set app.copyright in storebound.config.ts, then storebound apple listing' }];
|
||||
}
|
||||
|
||||
export function appleRules(s: AppleSnapshot): Finding[] {
|
||||
const f: Finding[] = [];
|
||||
const add = (level: Level, code: string, msg: string, fix?: string) => f.push({ store: 'apple', level, code, msg, fix });
|
||||
|
|
@ -148,6 +161,7 @@ export function appleRules(s: AppleSnapshot): Finding[] {
|
|||
else if (EDITABLE.includes(s.version.state)) add('ok', 'version', `version ${s.version.versionString}: ${s.version.state}`);
|
||||
else if (IN_FLIGHT.includes(s.version.state)) add('warn', 'version', `version ${s.version.versionString} is ${s.version.state} (nothing to prepare)`);
|
||||
else add('warn', 'version', `version ${s.version.versionString}: ${s.version.state}`);
|
||||
f.push(...copyrightRules(s));
|
||||
|
||||
if (!s.build) add('blocker', 'build', 'no build attached to the version', 'storebound apple listing --version x.y.z --build N (pick the build number you just uploaded)');
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue