From ebd5f1abec8473d61ff4260b70590d3a4782b458 Mon Sep 17 00:00:00 2001 From: CRT Date: Sun, 11 Oct 2026 19:23:43 +0000 Subject: [PATCH] apple.name: the App Store name when the plain name is taken; console fill, apple listing, pull, check (30-char error, same-name hint), scan use it --- CHANGELOG.md | 6 ++ README.md | 2 +- cli/apple/listing.ts | 5 +- cli/check.ts | 14 ++-- cli/lib/config.ts | 13 ++++ cli/lib/console-answers.ts | 5 +- cli/lib/console-forms.ts | 7 +- cli/lib/copy.ts | 18 +++++ cli/lib/fastlane.ts | 2 +- cli/lib/listing-pull.ts | 8 +- cli/lib/project-files.ts | 4 +- cli/lib/scan/rules.ts | 1 + skills/appstore-first-release/SKILL.md | 5 ++ skills/console-autofill/SKILL.md | 2 +- templates/appstore.md | 2 +- templates/profiles/app/appstore.md | 2 +- templates/profiles/app/storebound.config.ts | 1 + .../profiles/subscription-app/appstore.md | 2 +- .../subscription-app/storebound.config.ts | 1 + templates/storebound.config.ts | 1 + tests/apple-name.test.ts | 77 +++++++++++++++++++ tests/store-ops-text.test.ts | 4 +- 22 files changed, 157 insertions(+), 25 deletions(-) create mode 100644 tests/apple-name.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 63c7a975..40aa9acc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## Unreleased +- `apple.name`: the App Store name in the primary locale (at most 30 characters, validated) for when the plain name is + taken on the App Store ("already being used"). `app.name` stays the Play and on-device name. `console fill + apple-app-record` fills Name from it (else `app.name`), and `apple listing`, `apple listing pull` (a pulled name equal + to it is not written into the file), the listing completeness view, `check --aso`, the console app picker and `scan`'s + beta-wording rule use it for every locale without its own `### name` block. `check` reports an App Store name over 30 + characters in any locale and hints when every locale uses the plain `app.name` (`hints` in `--json`). - `console fill`, from a real run whose App Store Connect session had expired (the add button was "not found" while the window showed the sign-in form): - Sign-in is detected by URL and frame (App Store Connect `/login`, idmsa.apple.com / appleid.apple.com frames, diff --git a/README.md b/README.md index 3cc6ffd9..54a90139 100644 --- a/README.md +++ b/README.md @@ -361,7 +361,7 @@ run in the background with a log (`storebound shots render > .storebound/render. | command | kind | what | |---|---|---| | `apple bundle` | API | register the bundle id, find the app record | -| `apple listing --version x.y.z [--build N]` | API | version (manual release), the build with exactly that number, texts per locale | +| `apple listing --version x.y.z [--build N]` | API | version (manual release), the build with exactly that number, texts per locale (name: the locale's `### name`, else `apple.name`, else `app.name`) | | `apple listing pull [--version x.y.z] [--write]` | API, read-only + local | live texts back into `store/appstore.md`: diff first, writes only with `--write` | | `apple screenshots [--variant b]` | API | 6.9" + 6.5" (+ 13" iPad with `apple.ipad`, + 6.3" with `apple.iphoneMedium`) per locale, MD5-idempotent | | `apple previews [--poster 5]` | API | app preview videos per locale, checked first, MD5-idempotent, poster frame | diff --git a/cli/apple/listing.ts b/cli/apple/listing.ts index 1036646a..490a5a70 100644 --- a/cli/apple/listing.ts +++ b/cli/apple/listing.ts @@ -12,6 +12,7 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs'; import { type AppleCopy, parseAppStoreListing } from '../lib/copy'; import { compactDiff } from '../lib/diff'; import { mergeAppleListing, overLimits } from '../lib/listing-pull'; +import { appleName } from '../lib/config'; import type { Ctx } from '../lib/ctx'; import { need } from '../lib/ctx'; import { done, log, printJson, warn } from '../lib/log'; @@ -65,7 +66,7 @@ async function pull(ctx: Ctx): Promise { } const file = resolve(config.apple?.listing ?? 'store/appstore.md'); const before = existsSync(file) ? readFileSync(file, 'utf8') : '# App Store listing copy\n\nPulled from App Store Connect by `storebound apple listing pull`.\n'; - const r = mergeAppleListing(before, remote); + const r = mergeAppleListing(before, remote, appleName(config)); const over = overLimits(r.changes, 'apple'); const diff = compactDiff(before, r.md); if (a.has('json')) printJson({ version: v.attributes.versionString, state: live, file, write: a.has('write') && !a.has('dry'), changes: r.changes, added: r.added, overLimits: over, diff }); @@ -117,7 +118,7 @@ export async function run(ctx: Ctx): Promise { const info = await c.editableAppInfo(); await upsertLocs(c, `/v1/appInfos/${info.id}/appInfoLocalizations`, 'appInfoLocalizations', 'appInfo', 'appInfos', info.id, - Object.fromEntries(Object.entries(listing).map(([l, f]) => [l, { name: f.name ?? app.name, subtitle: f.subtitle, privacyPolicyUrl: app.privacyPolicyUrl }]))); + Object.fromEntries(Object.entries(listing).map(([l, f]) => [l, { name: f.name ?? appleName(config), subtitle: f.subtitle, privacyPolicyUrl: app.privacyPolicyUrl }]))); await upsertLocs(c, `/v1/appStoreVersions/${v.id}/appStoreVersionLocalizations`, 'appStoreVersionLocalizations', 'appStoreVersion', 'appStoreVersions', v.id, Object.fromEntries(Object.entries(listing).map(([l, f]) => [l, { description: f.description, keywords: f.keywords, promotionalText: f.promotionalText, whatsNew: f.whatsNew, supportUrl: app.supportUrl, marketingUrl: app.marketingUrl ?? app.website }]))); diff --git a/cli/check.ts b/cli/check.ts index 0383b46a..ca1fbdd7 100644 --- a/cli/check.ts +++ b/cli/check.ts @@ -3,12 +3,12 @@ // subscriptions + terms URL) and the files the config points at. No network; credentials are only checked for presence. // storebound check everything above // storebound check --aso keyword audit of both listing files (App Store keyword field, Play stuffing); exit 1 on errors -// --json structured result ({ ok, items, warnings, problems } or { findings, errors }), exit 1 on problems +// --json structured result ({ ok, items, warnings, hints, problems } or { findings, errors }), exit 1 on problems import { existsSync, readFileSync } from 'node:fs'; import { relative } from 'node:path'; import { type AsoFinding, auditAso } from './lib/aso'; -import { playCodes } from './lib/config'; -import { APPLE_IAP_LIMITS, len, parseAppStoreListing, parsePlayListing } from './lib/copy'; +import { appleName, playCodes } from './lib/config'; +import { APPLE_IAP_LIMITS, appleNameIssues, len, parseAppStoreListing, parsePlayListing } from './lib/copy'; import type { Ctx } from './lib/ctx'; import { dataSafetyRows } from './lib/data-safety'; import { reviewDemoAccount } from './lib/credentials'; @@ -21,7 +21,7 @@ function aso(ctx: Ctx): void { const { config, resolve } = ctx.loaded; const apple = config.apple ? parseAppStoreListing(readFileSync(resolve(config.apple.listing ?? 'store/appstore.md'), 'utf8')) : undefined; const play = config.play ? parsePlayListing(readFileSync(resolve(config.play.listing ?? 'store/listing.md'), 'utf8'), config.app.name) : undefined; - const f: AsoFinding[] = auditAso({ apple, play, appName: config.app.name, storefront: ctx.args.get('storefront') ?? 'US' }); + const f: AsoFinding[] = auditAso({ apple, play, appName: appleName(config), storefront: ctx.args.get('storefront') ?? 'US' }); if (ctx.args.has('json')) { const errors = f.filter(x => x.level === 'error').length; printJson({ findings: f, errors }); if (errors) process.exitCode = 1; return; } const tag = { error: 'ERROR', warn: 'warn ', info: 'info ' } as const; for (const x of f) console.log(`${tag[x.level]} [${x.where}] ${x.msg}`); @@ -37,6 +37,7 @@ export async function run(ctx: Ctx): Promise { const problems: string[] = []; const items: { what: string; detail: string }[] = []; const warnings: string[] = []; + const hints: string[] = []; const note = (msg: string): void => { warnings.push(msg); warn('check', msg); }; const tryDo = (what: string, fn: () => string): void => { try { const detail = fn(); items.push({ what, detail }); log('check', `${what}: ${detail}`); } catch (e) { @@ -63,6 +64,9 @@ export async function run(ctx: Ctx): Promise { const copy = parseAppStoreListing(readFileSync(f, 'utf8')); const missing = config.languages.filter(l => l.apple && !copy[l.apple]).map(l => l.apple); if (missing.length) note(`appstore listing has no section for ${missing.join(', ')}`); + for (const i of appleNameIssues(copy, config.languages.flatMap(l => l.apple ? [l.apple] : []), appleName(config), config.app.name)) { + if (i.level === 'error') problems.push(i.msg); else { hints.push(i.msg); log('check', `hint: ${i.msg}`); } + } return `${Object.keys(copy).length} locales`; }); // listing translation drafts (storebound listing translate): fine to keep working on, not to push unreviewed @@ -95,7 +99,7 @@ export async function run(ctx: Ctx): Promise { if (existsSync(resolve('.gitignore')) && !/^\/?\.storebound\/?$/m.test(readFileSync(resolve('.gitignore'), 'utf8'))) problems.push('.gitignore does not ignore .storebound/ (credentials live there)'); - if (ctx.args.has('json')) { printJson({ config: path, ok: !problems.length, items, warnings, problems }); if (problems.length) process.exitCode = 1; return; } + if (ctx.args.has('json')) { printJson({ config: path, ok: !problems.length, items, warnings, hints, problems }); if (problems.length) process.exitCode = 1; return; } if (problems.length) { for (const p of problems) console.error(` - ${p}`); throw new Error(`${problems.length} problems`); } log('check', 'all good'); } diff --git a/cli/lib/config.ts b/cli/lib/config.ts index d5a2ca9a..d5be016d 100644 --- a/cli/lib/config.ts +++ b/cli/lib/config.ts @@ -490,6 +490,10 @@ export interface ShipConfig { }; apple?: { bundleId: string; appId?: string; primaryLocale?: string; listing?: string; info?: AppleAppInfo; reviewShots?: string; + /** App Store name in the primary locale (at most 30 characters) when it differs from app.name, e.g. because the plain + * name is taken on the App Store ("STAR DASH: Stone Age to 2100"). Default app.name. A `### name` block in the + * App Store listing file wins for its locale. app.name stays the Play / on-device name. */ + name?: string; /** Apple Developer Team ID (10 characters, Membership details). apple-app-site-association and ad-hoc export use it. */ teamId?: string; /** Ad-hoc / release-testing export (`storebound apple adhoc`). */ @@ -681,6 +685,12 @@ function validateConsole(c: ConsoleConfig): string[] { } /** Platforms of the app (app identity): app.platforms, else from the store sections. */ +/** App Store name limit (characters). */ +export const APPLE_NAME_MAX = 30; + +/** The App Store name in the primary locale: apple.name, else app.name. Per-locale `### name` blocks win over it. */ +export const appleName = (c: Pick): string => c.apple?.name?.trim() || c.app.name; + export const platformsOf = (c: Pick): Platform[] => c.app.platforms ?? [...(c.apple ? ['ios' as const] : []), ...(c.play ? ['android' as const] : [])]; @@ -754,6 +764,9 @@ export function validateConfig(c: unknown): string[] { e.push(`play.billingPrograms: a list of ${PLAY_BILLING_PROGRAMS.join(' | ')}`); if (cfg.apple) { if (!ID_RE.test(cfg.apple.bundleId ?? '')) e.push('apple.bundleId: not a bundle id (com.example.game)'); + const an = cfg.apple.name; + if (an !== undefined && (typeof an !== 'string' || !an.trim())) e.push('apple.name: the App Store name (text), or leave it out to use app.name'); + else if (an !== undefined && [...an].length > APPLE_NAME_MAX) e.push(`apple.name: ${[...an].length} characters > ${APPLE_NAME_MAX} (App Store limit)`); if (cfg.apple.appId && !/^\d+$/.test(cfg.apple.appId)) e.push('apple.appId: numeric Apple ID of the app (App Store Connect > App Information)'); const enc = cfg.apple.usesNonExemptEncryption; if (enc !== undefined && typeof enc !== 'boolean') e.push('apple.usesNonExemptEncryption: true | false'); diff --git a/cli/lib/console-answers.ts b/cli/lib/console-answers.ts index d13b3c1a..d3b796b1 100644 --- a/cli/lib/console-answers.ts +++ b/cli/lib/console-answers.ts @@ -14,7 +14,7 @@ // https://support.google.com/googleplay/android-developer/answer/9859655 (content ratings) // https://support.google.com/googleplay/android-developer/answer/9867159 (target audience and content) import { AGE_RATING_NONE } from '../apple/appinfo'; -import { type AgeGroup, AGE_GROUPS, IARC_QUESTIONS, type IarcQuestion, profileOf, type ShipConfig } from './config'; +import { type AgeGroup, AGE_GROUPS, appleName, IARC_QUESTIONS, type IarcQuestion, profileOf, type ShipConfig } from './config'; import { APPLE_PRIVACY, applePurpose } from './declarations'; import { maskUser } from './credentials'; @@ -86,7 +86,8 @@ function appRecord(config: ShipConfig): Answer[] { const lang = locale ? LANGUAGE_NAMES[locale] : undefined; return [ a ? ok('platform:ios', 'Platforms: iOS', true, 'apple section') : ask('platform:ios', 'Platforms: iOS', 'config', 'The config has no apple section.'), - ok('name', 'Name', config.app.name, 'app.name', 'Must be unique on the App Store; App Store Connect says so when it is taken.'), + ok('name', 'Name', appleName(config), a?.name?.trim() ? 'apple.name' : 'app.name', + `Must be unique on the App Store (at most 30 characters); when App Store Connect says it is already being used, set apple.name (e.g. "${config.app.name}: ") and fill again.`), lang ? ok('language', 'Primary Language', lang, a?.primaryLocale ? 'apple.primaryLocale' : 'languages[0].apple') : ask('language', 'Primary Language', 'apple.primaryLocale', locale ? `Pick the language of locale "${locale}".` : 'Set apple.primaryLocale (e.g. en-US).'), a?.bundleId ? ok('bundleId', 'Bundle ID', a.bundleId, 'apple.bundleId', 'Register it first if it is not in the list: storebound apple bundle.') diff --git a/cli/lib/console-forms.ts b/cli/lib/console-forms.ts index c0036c55..78a71259 100644 --- a/cli/lib/console-forms.ts +++ b/cli/lib/console-forms.ts @@ -5,7 +5,7 @@ // The names are modeled on Apple's and Google's public help pages (sources in console-answers.ts), not recorded from a // signed-in console: the exact App Privacy dialog titles, the IARC question wording and the Play category names could // not be verified without an account, which is why every field has candidates and the engine falls back on a miss. -import { AGE_GROUPS, type ShipConfig } from './config'; +import { AGE_GROUPS, appleName, type ShipConfig } from './config'; import { AGE_LABELS, type Answer, APPLE_PURPOSES, type FormId } from './console-answers'; /** An accessible name: a string matches exactly, a RegExp matches the name. */ @@ -188,12 +188,13 @@ const POLICY: Name[] = ['Policy and programs', 'Policy', 'Politika ve programlar /** * The steps that open a form after sign-in, built from the config only (apple.appId, apple.bundleId, play.packageName, - * app.name). The last step waits for the form itself. Pure. + * apple.name / app.name). The last step waits for the form itself. Pure. */ export function navPlan(id: FormId, config: ShipConfig, bases: NavBases = NAV_BASES): NavStep[] { const asc = bases.asc.replace(/\/$/, ''), play = bases.play.replace(/\/$/, ''); const name = config.app?.name; const named = name ? { name } : {}; + const appleNamed = name ? { name: appleName(config) } : {}; switch (id) { case 'apple-app-record': return [ { kind: 'goto', label: 'open Apps', url: `${asc}/apps` }, @@ -206,7 +207,7 @@ export function navPlan(id: FormId, config: ShipConfig, bases: NavBases = NAV_BA const appId = config.apple?.appId; const open: NavStep[] = appId ? [{ kind: 'goto', label: 'open App Privacy of the app (apple.appId)', url: `${asc}/apps/${encodeURIComponent(appId)}/distribution/privacy` }] : [ { kind: 'goto', label: 'open Apps', url: `${asc}/apps` }, - { kind: 'pickApp', label: 'the app in the list', tokens: config.apple?.bundleId ? [config.apple.bundleId] : [], ...named }, + { kind: 'pickApp', label: 'the app in the list', tokens: config.apple?.bundleId ? [config.apple.bundleId] : [], ...appleNamed }, { kind: 'click', label: 'App Privacy in the sidebar', roles: ['link', 'tab'], names: ['App Privacy', 'Uygulama Gizliliği', /^app privacy$/i] }, ]; return [...open, { kind: 'wait', label: 'the App Privacy page', roles: ['heading'], names: ['App Privacy', 'Uygulama Gizliliği', /^app privacy$/i] }]; diff --git a/cli/lib/copy.ts b/cli/lib/copy.ts index 32f2f32d..5408fb3a 100644 --- a/cli/lib/copy.ts +++ b/cli/lib/copy.ts @@ -83,3 +83,21 @@ export function parseAppStoreListing(md: string): Record { if (errors.length) throw new Error('appstore listing: ' + errors.join('; ')); return out; } + +export interface NameIssue { level: 'error' | 'info'; msg: string } + +/** + * The App Store name per locale (a `### name` block, else `fallback` = apple.name, else app.name) against the 30-char + * limit, plus a hint when every locale uses the plain app.name: App Store names are unique, so a taken name stops the + * app record ("already being used"). Pure. + */ +export function appleNameIssues(copy: Record, locales: string[], fallback: string, appName: string): NameIssue[] { + const out: NameIssue[] = []; + const all = [...new Set([...locales, ...Object.keys(copy)])]; + const names = all.map(l => ({ l, name: (copy[l]?.name ?? fallback).trim(), own: !!copy[l]?.name })); + for (const n of names) if (len(n.name) > APPLE_LIMITS.name) + out.push({ level: 'error', msg: `App Store name of ${n.l} is ${len(n.name)} > ${APPLE_LIMITS.name} characters: "${n.name}" (${n.own ? 'its ### name block' : fallback === appName ? 'app.name; set apple.name' : 'apple.name'})` }); + if (names.length && names.every(n => n.name === appName)) + out.push({ level: 'info', msg: `the App Store name is "${appName}" in every locale: App Store names are unique, so if it is taken App Store Connect refuses the record ("already being used"). Then set apple.name with a short suffix, e.g. "${appName}: " (30 characters at most); app.name stays the Play and on-device name` }); + return out; +} diff --git a/cli/lib/fastlane.ts b/cli/lib/fastlane.ts index e532d8ea..8e2a2ff7 100644 --- a/cli/lib/fastlane.ts +++ b/cli/lib/fastlane.ts @@ -471,7 +471,7 @@ export function planImport(scan: FastlaneScan, o: PlanOptions): ImportPlan { const md = `# ${appName} · App Store listing copy Imported from fastlane deliver (\`storebound import fastlane\`). Source for \`storebound apple listing\`. One -\`## \` section per locale, one fenced block per \`### \`: \`name\` (optional, defaults to \`app.name\`), +\`## \` section per locale, one fenced block per \`### \`: \`name\` (optional, defaults to \`apple.name\`, else \`app.name\`), \`subtitle\` (30), \`promotionalText\` (170), \`keywords\` (100 bytes, comma separated, no spaces after commas), \`description\` (4000), \`whatsNew\` (optional). Privacy policy, support and marketing URL come from \`storebound.config.ts\`. diff --git a/cli/lib/listing-pull.ts b/cli/lib/listing-pull.ts index 9c1cf6f6..f206ee31 100644 --- a/cli/lib/listing-pull.ts +++ b/cli/lib/listing-pull.ts @@ -29,8 +29,9 @@ function setBlock(sec: string, heading: RegExp, newHeading: string, text: string const APPLE_ORDER: AppleField[] = ['name', 'subtitle', 'promotionalText', 'keywords', 'description', 'whatsNew']; -/** Live App Store texts per locale merged into the App Store listing file. Pure. */ -export function mergeAppleListing(md: string, remote: Record): MergeResult { +/** Live App Store texts per locale merged into the App Store listing file. A name equal to `defaultName` (apple.name, + * else app.name) is only written where the section already has a name block. Pure. */ +export function mergeAppleListing(md: string, remote: Record, defaultName?: string): MergeResult { const parts = md.split(/^(?=## )/m); const res: MergeResult = { md: '', changes: [], added: [], conflicts: [] }; const seen = new Set(); @@ -43,6 +44,7 @@ export function mergeAppleListing(md: string, remote: Record) for (const f of APPLE_ORDER) { const v = r[f]; if (v === undefined || v === null || v === '') continue; + if (f === 'name' && v === defaultName && !BLOCK(/name\b/).test(sec)) continue; const { sec: next, from } = setBlock(sec, new RegExp(`${f}\\b`), f, v); if (from !== v.trim()) res.changes.push({ section: loc, field: f, from, to: v }); sec = next; @@ -52,7 +54,7 @@ export function mergeAppleListing(md: string, remote: Record) let text = out.join(''); for (const [loc, r] of Object.entries(remote).sort(([a], [b]) => a.localeCompare(b))) { if (seen.has(loc)) continue; - const fields = APPLE_ORDER.filter(f => r[f]); + const fields = APPLE_ORDER.filter(f => r[f] && !(f === 'name' && r[f] === defaultName)); if (!fields.length) continue; res.added.push(loc); text = text.replace(/\s*$/, '') + `\n\n## ${loc}\n\n` + fields.map(f => `### ${f}\n${fence(r[f]!)}`).join('\n\n') + '\n'; diff --git a/cli/lib/project-files.ts b/cli/lib/project-files.ts index 03d35390..029d6b21 100644 --- a/cli/lib/project-files.ts +++ b/cli/lib/project-files.ts @@ -3,7 +3,7 @@ // line, never an exception, so one bad section does not hide the rest ("unknown, never false"). import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'; import { extname, isAbsolute, join, resolve } from 'node:path'; -import { type ShipConfig, playCodes } from './config'; +import { appleName, type ShipConfig, playCodes } from './config'; import { APPLE_LIMITS, len, PLAY_LIMITS } from './copy'; import type { DraftsResult, IconResult, ListingField, ListingLocale, ListingsResult, ListingText, RenderImage, ReplyDraft } from './desktop-protocol'; import { parseFrontMatter, stringifyFrontMatter } from './frontmatter'; @@ -136,7 +136,7 @@ export function listingCompleteness(config: ShipConfig, root: string): ListingsR const applePart = config.apple ? { code: ac, fields: tally([ - field('name', as?.name ?? (as ? config.app.name : undefined), APPLE_LIMITS.name, true), + field('name', as?.name ?? (as ? appleName(config) : undefined), APPLE_LIMITS.name, true), field('subtitle', as?.subtitle, APPLE_LIMITS.subtitle, true), field('promotionalText', as?.promotionalText, APPLE_LIMITS.promotionalText, true), field('keywords', as?.keywords, APPLE_LIMITS.keywords, true), diff --git a/cli/lib/scan/rules.ts b/cli/lib/scan/rules.ts index 11084274..96af1ac2 100644 --- a/cli/lib/scan/rules.ts +++ b/cli/lib/scan/rules.ts @@ -333,6 +333,7 @@ export function scanRules(inp: ScanInput): ScanFinding[] { const BETA = /\b(beta|demo|trial version|test (version|build|app)|testing build|early access|prototype|preview (build|version)|alpha (build|version))\b/i; const betaName: Hit[] = []; if (c?.app?.name && BETA.test(c.app.name)) betaName.push(...cfg(c.app.name, `app.name: ${c.app.name}`)); + if (c?.apple?.name && c.apple.name !== c.app?.name && BETA.test(c.apple.name)) betaName.push(...cfg(c.apple.name, `apple.name: ${c.apple.name}`)); for (const k of ['CFBundleDisplayName', 'CFBundleName']) { const v = plistVal(k); if (typeof v?.value === 'string' && BETA.test(v.value) && !/\$\(/.test(v.value)) betaName.push({ ...v.at, text: `${k}: ${v.value}` }); diff --git a/skills/appstore-first-release/SKILL.md b/skills/appstore-first-release/SKILL.md index 2b979b7d..c896c4e0 100644 --- a/skills/appstore-first-release/SKILL.md +++ b/skills/appstore-first-release/SKILL.md @@ -20,6 +20,11 @@ of a first version is the owner's click. Shared agent rules: `docs/agents-core.m Key ID and Issuer ID. The same key signs builds (`-allowProvisioningUpdates`). 2. **API · Bundle id.** `storebound apple bundle` registers it (Certificates, Identifiers & Profiles). 3. **UI · App record.** Apps > + > New App: iOS, name, primary language, the bundle id, SKU. **No API for this.** + The name is unique on the App Store: when App Store Connect says it is "already being used", ask the owner for a + longer App Store name (30 characters at most, e.g. "STAR DASH: Stone Age to 2100"), set it as `apple.name` and + fill again (`storebound console fill apple-app-record`). `app.name` stays the Play and on-device name; `apple + listing` sends `apple.name` for every locale without its own `### name` block, and `storebound check` flags a name + over 30 characters. Then `storebound apple status` finds it (put the Apple ID in `apple.appId` to skip the lookup). 4. **Local · Info.plist.** `ITSAppUsesNonExemptEncryption` with the true answer (`export-compliance` skill; `NO` only when the app uses nothing beyond OS / HTTPS encryption) so builds arrive answered; diff --git a/skills/console-autofill/SKILL.md b/skills/console-autofill/SKILL.md index 182b1c07..afbbb95d 100644 --- a/skills/console-autofill/SKILL.md +++ b/skills/console-autofill/SKILL.md @@ -18,7 +18,7 @@ It is not available over MCP. | form | where | filled from | |---|---|---| -| `apple-app-record` | App Store Connect > Apps > + > New App | app.name, apple.primaryLocale, apple.bundleId, console.appRecord (SKU, user access) | +| `apple-app-record` | App Store Connect > Apps > + > New App | apple.name (else app.name), apple.primaryLocale, apple.bundleId, console.appRecord (SKU, user access) | | `apple-age-rating` | App Information > Age Ratings | guide only: `storebound apple appinfo` sets every question through the API | | `apple-app-privacy` | the app > App Privacy | dataSafety (types and purposes); linked to identity and tracking are always the owner's | | `play-content-rating` | Policy > App content > Content rating | app.contactEmail, app.profile, products, console.contentRating | diff --git a/templates/appstore.md b/templates/appstore.md index 3cd7bcff..e66df248 100644 --- a/templates/appstore.md +++ b/templates/appstore.md @@ -2,7 +2,7 @@ Source for `storebound apple listing`. One `## ` section per locale (the first word is the locale code: `en-US`, `tr`, `de-DE`, `ja`, `zh-Hans`, `ar-SA`, ...), one fenced block per `### `, field names exactly: -`name` (optional, defaults to `app.name`), `subtitle` (30), `promotionalText` (170), `keywords` (100 bytes, comma +`name` (optional, defaults to `apple.name`, else `app.name`), `subtitle` (30), `promotionalText` (170), `keywords` (100 bytes, comma separated, no spaces after commas, do not repeat the app name), `description` (4000), `whatsNew` (optional; not allowed on the first version). Shared values (privacy policy, support and marketing URL) come from `storebound.config.ts`. diff --git a/templates/profiles/app/appstore.md b/templates/profiles/app/appstore.md index af579bfb..649f9f80 100644 --- a/templates/profiles/app/appstore.md +++ b/templates/profiles/app/appstore.md @@ -2,7 +2,7 @@ Source for `storebound apple listing`. One `## ` section per locale (the first word is the locale code: `en-US`, `tr`, `de-DE`, `ja`, `zh-Hans`, `ar-SA`, ...), one fenced block per `### `, field names exactly: -`name` (optional, defaults to `app.name`), `subtitle` (30), `promotionalText` (170), `keywords` (100 bytes, comma +`name` (optional, defaults to `apple.name`, else `app.name`), `subtitle` (30), `promotionalText` (170), `keywords` (100 bytes, comma separated, no spaces after commas, do not repeat the app name), `description` (4000), `whatsNew` (optional; not allowed on the first version). Shared values (privacy policy, support and marketing URL) come from `storebound.config.ts`. diff --git a/templates/profiles/app/storebound.config.ts b/templates/profiles/app/storebound.config.ts index 499da67a..e4d5dbf3 100644 --- a/templates/profiles/app/storebound.config.ts +++ b/templates/profiles/app/storebound.config.ts @@ -51,6 +51,7 @@ const config: ShipConfig = { apple: { bundleId: 'com.example.app', + // name: 'Example: Short Tagline', // App Store name (max 30) when app.name is taken there ("already being used"); default app.name listing: 'store/appstore.md', // Export compliance (export-compliance skill): decide it, then uncomment. false ONLY if the app uses no encryption // beyond the OS (HTTPS through the system, standard sign-in). diff --git a/templates/profiles/subscription-app/appstore.md b/templates/profiles/subscription-app/appstore.md index 6af5110b..8f8cd3c5 100644 --- a/templates/profiles/subscription-app/appstore.md +++ b/templates/profiles/subscription-app/appstore.md @@ -2,7 +2,7 @@ Source for `storebound apple listing`. One `## ` section per locale (the first word is the locale code: `en-US`, `tr`, `de-DE`, `ja`, `zh-Hans`, `ar-SA`, ...), one fenced block per `### `, field names exactly: -`name` (optional, defaults to `app.name`), `subtitle` (30), `promotionalText` (170), `keywords` (100 bytes, comma +`name` (optional, defaults to `apple.name`, else `app.name`), `subtitle` (30), `promotionalText` (170), `keywords` (100 bytes, comma separated, no spaces after commas, do not repeat the app name), `description` (4000), `whatsNew` (optional; not allowed on the first version). Shared values (privacy policy, support and marketing URL) come from `storebound.config.ts`. diff --git a/templates/profiles/subscription-app/storebound.config.ts b/templates/profiles/subscription-app/storebound.config.ts index c9638545..f77ac4a4 100644 --- a/templates/profiles/subscription-app/storebound.config.ts +++ b/templates/profiles/subscription-app/storebound.config.ts @@ -51,6 +51,7 @@ const config: ShipConfig = { apple: { bundleId: 'com.example.app', + // name: 'Example: Short Tagline', // App Store name (max 30) when app.name is taken there ("already being used"); default app.name listing: 'store/appstore.md', // Export compliance (export-compliance skill): decide it, then uncomment. false ONLY if the app uses no encryption // beyond the OS (HTTPS through the system, standard sign-in). diff --git a/templates/storebound.config.ts b/templates/storebound.config.ts index 0f742d73..3b56ec25 100644 --- a/templates/storebound.config.ts +++ b/templates/storebound.config.ts @@ -37,6 +37,7 @@ const config: ShipConfig = { apple: { bundleId: 'com.example.game', + // name: 'Example: Short Tagline', // App Store name (max 30) when app.name is taken there ("already being used"); default app.name // appId: '1234567890', // Apple ID of the app record; looked up by bundle id when left out listing: 'store/appstore.md', reviewShots: 'store/iap-review', diff --git a/tests/apple-name.test.ts b/tests/apple-name.test.ts new file mode 100644 index 00000000..66c2d3b2 --- /dev/null +++ b/tests/apple-name.test.ts @@ -0,0 +1,77 @@ +// apple.name: the App Store name when the plain app.name is taken on the App Store. Fallback order (### name block > +// apple.name > app.name), validation, the console answer, check's length error and same-name hint, listing pull. +import { afterEach, describe, expect, test } from 'bun:test'; +import { run as check } from '../cli/check'; +import { appleName, type ShipConfig, validateConfig } from '../cli/lib/config'; +import { consoleAnswers } from '../cli/lib/console-answers'; +import { navPlan } from '../cli/lib/console-forms'; +import { appleNameIssues } from '../cli/lib/copy'; +import { mergeAppleListing } from '../cli/lib/listing-pull'; +import { listingCompleteness } from '../cli/lib/project-files'; +import { BASE, capture, jsonOut, project, restore } from './helpers/store-mock'; + +afterEach(restore); + +const NAMED: ShipConfig = { ...BASE, app: { ...BASE.app, name: 'STAR DASH' }, apple: { ...BASE.apple!, name: 'STAR DASH: Stone Age to 2100', primaryLocale: 'en-US' } }; +const PLAIN: ShipConfig = { ...BASE, app: { ...BASE.app, name: 'STAR DASH' }, apple: { ...BASE.apple!, primaryLocale: 'en-US' } }; +const sec = (loc: string, name?: string) => `## ${loc}\n\n${name ? `### name\n\`\`\`\n${name}\n\`\`\`\n\n` : ''}### subtitle\n\`\`\`\nSub\n\`\`\`\n\n### promotionalText\n\`\`\`\nPromo\n\`\`\`\n\n### keywords\n\`\`\`\nrun,time\n\`\`\`\n\n### description\n\`\`\`\nText.\n\`\`\`\n\n`; + +describe('apple.name', () => { + test('fallback order: apple.name, else app.name', () => { + expect(appleName(NAMED)).toBe('STAR DASH: Stone Age to 2100'); + expect(appleName(PLAIN)).toBe('STAR DASH'); + expect(appleName({ ...PLAIN, apple: { ...PLAIN.apple!, name: ' ' } })).toBe('STAR DASH'); + }); + test('validated: at most 30 characters, text', () => { + expect(validateConfig(NAMED)).toEqual([]); + expect(validateConfig({ ...NAMED, apple: { ...NAMED.apple!, name: 'STAR DASH: Stone Age to the Year 2100' } }).join('\n')).toContain('apple.name: 37 characters > 30'); + expect(validateConfig({ ...NAMED, apple: { ...NAMED.apple!, name: '' } }).join('\n')).toContain('apple.name: the App Store name'); + }); + test('console fill apple-app-record answers Name from apple.name, else app.name', () => { + const a = new Map(consoleAnswers('apple-app-record', NAMED).map(x => [x.id, x])); + expect(a.get('name')).toMatchObject({ value: 'STAR DASH: Stone Age to 2100', source: 'apple.name', certain: true }); + const b = new Map(consoleAnswers('apple-app-record', PLAIN).map(x => [x.id, x])); + expect(b.get('name')).toMatchObject({ value: 'STAR DASH', source: 'app.name' }); + expect(b.get('name')!.note).toContain('apple.name'); + const pick = navPlan('apple-app-privacy', { ...NAMED, apple: { ...NAMED.apple!, appId: undefined } }).find(s => s.kind === 'pickApp') as { name?: string } | undefined; + expect(pick?.name).toBe('STAR DASH: Stone Age to 2100'); + }); + test('name issues: length error per locale, same-name hint only without apple.name or own names', () => { + const long = 'A Name That Is Way Too Long For Apple'; + expect(appleNameIssues({}, ['en-US'], long, long)).toEqual([expect.objectContaining({ level: 'error', msg: expect.stringContaining('app.name; set apple.name') }), expect.objectContaining({ level: 'info' })]); + expect(appleNameIssues({ 'de-DE': { name: long } }, ['en-US'], 'Short', 'Short').map(i => `${i.level} ${i.msg.slice(0, 31)}`)).toEqual(['error App Store name of de-DE is 37 >']); + const hint = appleNameIssues({ 'en-US': {} , 'de-DE': {} }, ['en-US', 'de-DE'], 'STAR DASH', 'STAR DASH'); + expect(hint).toHaveLength(1); + expect(hint[0]!.msg).toContain('already being used'); + expect(appleNameIssues({}, ['en-US', 'de-DE'], 'STAR DASH: Stone Age to 2100', 'STAR DASH')).toEqual([]); + expect(appleNameIssues({ 'de-DE': { name: 'STAR DASH: Steinzeit bis 2100' } }, ['en-US', 'de-DE'], 'STAR DASH', 'STAR DASH')).toEqual([]); + }); + test('check: hint with the plain name, error when the fallback is too long', async () => { + const files = { 'store/appstore.md': `# App Store\n\n${sec('en-US')}${sec('de-DE')}${sec('tr')}`, '.gitignore': '.storebound/\n' }; + let p = project({ ...PLAIN, play: undefined }, files); + let j = jsonOut((await capture(() => check(p.ctx(['--json'], ['json'])))).out); + expect(j.ok).toBe(true); + expect((j.hints as string[]).join('\n')).toContain('already being used'); + p = project({ ...NAMED, play: undefined }, files); + j = jsonOut((await capture(() => check(p.ctx(['--json'], ['json'])))).out); + expect(j.hints).toEqual([]); + p = project({ ...PLAIN, app: { ...PLAIN.app, name: 'STAR DASH Stone Age to the Year 2100' }, play: undefined }, files); + const r = await capture(() => check(p.ctx(['--json'], ['json']))); + j = jsonOut(r.out); + expect(j.ok).toBe(false); + expect((j.problems as string[]).filter(x => x.includes('App Store name of'))).toHaveLength(3); + }); + test('listing completeness and listing pull use apple.name as the default name', () => { + const p = project({ ...NAMED, play: undefined }, { 'store/appstore.md': `# App Store\n\n${sec('en-US')}${sec('de-DE', 'STAR DASH: Steinzeit bis 2100')}` }); + const l = listingCompleteness(p.loaded.config, p.root); + const name = (code: string) => l.locales.find(x => x.apple?.code === code)!.apple!.fields.find(f => f.field === 'name'); + expect(name('en-US')).toMatchObject({ length: 28, state: 'ok' }); + expect(name('de-DE')).toMatchObject({ length: 29, state: 'ok' }); + const md = `# App Store\n\n${sec('en-US')}`; + const r = mergeAppleListing(md, { 'en-US': { name: 'STAR DASH: Stone Age to 2100' }, 'fr-FR': { name: 'STAR DASH: Stone Age to 2100', subtitle: 'Sous-titre' } }, 'STAR DASH: Stone Age to 2100'); + expect(r.changes.map(c => `${c.section} ${c.field}`)).toEqual(['fr-FR subtitle']); + expect(r.md).not.toContain('### name'); + const own = mergeAppleListing(`# App Store\n\n${sec('en-US', 'Old')}`, { 'en-US': { name: 'STAR DASH: Stone Age to 2100' } }, 'STAR DASH: Stone Age to 2100'); + expect(own.changes.map(c => c.field)).toEqual(['name']); + }); +}); diff --git a/tests/store-ops-text.test.ts b/tests/store-ops-text.test.ts index 03302abf..d3969532 100644 --- a/tests/store-ops-text.test.ts +++ b/tests/store-ops-text.test.ts @@ -80,12 +80,12 @@ describe('listing pull commands', () => { let r = await capture(() => appleListing(p.ctx(['pull', '--json']))); const j = jsonOut(r.out); expect(j).toMatchObject({ version: '1.1.0', write: false, added: [] }); - expect((j.changes as { field: string }[]).map(c => c.field)).toEqual(['name', 'description', 'whatsNew']); + expect((j.changes as { field: string }[]).map(c => c.field)).toEqual(['description', 'whatsNew']); // the live name equals app.name: not written into the file expect(j.diff).toContain('-Old text.'); expect(readFileSync(join(p.root, 'store/appstore.md'), 'utf8')).toBe(APPLE_MD); r = await capture(() => appleListing(p.ctx(['pull', '--write']))); expect(readFileSync(join(p.root, 'store/appstore.md'), 'utf8')).toContain('### whatsNew\n```\nFaster sync.\n```'); - expect(r.out).toContain('3 change(s) written'); + expect(r.out).toContain('2 change(s) written'); }); test('play listing pull: one read-only edit, deleted; --write updates the file', async () => { playEnv();