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
This commit is contained in:
parent
8186b25575
commit
5afe4613c4
22 changed files with 157 additions and 25 deletions
|
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
## Unreleased
|
## 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
|
- `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):
|
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,
|
- Sign-in is detected by URL and frame (App Store Connect `/login`, idmsa.apple.com / appleid.apple.com frames,
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@ run in the background with a log (`storebound shots render > .storebound/render.
|
||||||
| command | kind | what |
|
| command | kind | what |
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
| `apple bundle` | API | register the bundle id, find the app record |
|
| `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 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 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 |
|
| `apple previews [--poster 5]` | API | app preview videos per locale, checked first, MD5-idempotent, poster frame |
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
||||||
import { type AppleCopy, parseAppStoreListing } from '../lib/copy';
|
import { type AppleCopy, parseAppStoreListing } from '../lib/copy';
|
||||||
import { compactDiff } from '../lib/diff';
|
import { compactDiff } from '../lib/diff';
|
||||||
import { mergeAppleListing, overLimits } from '../lib/listing-pull';
|
import { mergeAppleListing, overLimits } from '../lib/listing-pull';
|
||||||
|
import { appleName } from '../lib/config';
|
||||||
import type { Ctx } from '../lib/ctx';
|
import type { Ctx } from '../lib/ctx';
|
||||||
import { need } from '../lib/ctx';
|
import { need } from '../lib/ctx';
|
||||||
import { done, log, printJson, warn } from '../lib/log';
|
import { done, log, printJson, warn } from '../lib/log';
|
||||||
|
|
@ -65,7 +66,7 @@ async function pull(ctx: Ctx): Promise<void> {
|
||||||
}
|
}
|
||||||
const file = resolve(config.apple?.listing ?? 'store/appstore.md');
|
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 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 over = overLimits(r.changes, 'apple');
|
||||||
const diff = compactDiff(before, r.md);
|
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 });
|
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<void> {
|
||||||
|
|
||||||
const info = await c.editableAppInfo();
|
const info = await c.editableAppInfo();
|
||||||
await upsertLocs(c, `/v1/appInfos/${info.id}/appInfoLocalizations`, 'appInfoLocalizations', 'appInfo', 'appInfos', info.id,
|
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,
|
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,
|
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 }])));
|
whatsNew: f.whatsNew, supportUrl: app.supportUrl, marketingUrl: app.marketingUrl ?? app.website }])));
|
||||||
|
|
|
||||||
14
cli/check.ts
14
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.
|
// subscriptions + terms URL) and the files the config points at. No network; credentials are only checked for presence.
|
||||||
// storebound check everything above
|
// storebound check everything above
|
||||||
// storebound check --aso keyword audit of both listing files (App Store keyword field, Play stuffing); exit 1 on errors
|
// 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 { existsSync, readFileSync } from 'node:fs';
|
||||||
import { relative } from 'node:path';
|
import { relative } from 'node:path';
|
||||||
import { type AsoFinding, auditAso } from './lib/aso';
|
import { type AsoFinding, auditAso } from './lib/aso';
|
||||||
import { playCodes } from './lib/config';
|
import { appleName, playCodes } from './lib/config';
|
||||||
import { APPLE_IAP_LIMITS, len, parseAppStoreListing, parsePlayListing } from './lib/copy';
|
import { APPLE_IAP_LIMITS, appleNameIssues, len, parseAppStoreListing, parsePlayListing } from './lib/copy';
|
||||||
import type { Ctx } from './lib/ctx';
|
import type { Ctx } from './lib/ctx';
|
||||||
import { dataSafetyRows } from './lib/data-safety';
|
import { dataSafetyRows } from './lib/data-safety';
|
||||||
import { reviewDemoAccount } from './lib/credentials';
|
import { reviewDemoAccount } from './lib/credentials';
|
||||||
|
|
@ -21,7 +21,7 @@ function aso(ctx: Ctx): void {
|
||||||
const { config, resolve } = ctx.loaded;
|
const { config, resolve } = ctx.loaded;
|
||||||
const apple = config.apple ? parseAppStoreListing(readFileSync(resolve(config.apple.listing ?? 'store/appstore.md'), 'utf8')) : undefined;
|
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 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; }
|
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;
|
const tag = { error: 'ERROR', warn: 'warn ', info: 'info ' } as const;
|
||||||
for (const x of f) console.log(`${tag[x.level]} [${x.where}] ${x.msg}`);
|
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<void> {
|
||||||
const problems: string[] = [];
|
const problems: string[] = [];
|
||||||
const items: { what: string; detail: string }[] = [];
|
const items: { what: string; detail: string }[] = [];
|
||||||
const warnings: string[] = [];
|
const warnings: string[] = [];
|
||||||
|
const hints: string[] = [];
|
||||||
const note = (msg: string): void => { warnings.push(msg); warn('check', msg); };
|
const note = (msg: string): void => { warnings.push(msg); warn('check', msg); };
|
||||||
const tryDo = (what: string, fn: () => string): void => {
|
const tryDo = (what: string, fn: () => string): void => {
|
||||||
try { const detail = fn(); items.push({ what, detail }); log('check', `${what}: ${detail}`); } catch (e) {
|
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<void> {
|
||||||
const copy = parseAppStoreListing(readFileSync(f, 'utf8'));
|
const copy = parseAppStoreListing(readFileSync(f, 'utf8'));
|
||||||
const missing = config.languages.filter(l => l.apple && !copy[l.apple]).map(l => l.apple);
|
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(', ')}`);
|
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`;
|
return `${Object.keys(copy).length} locales`;
|
||||||
});
|
});
|
||||||
// listing translation drafts (storebound listing translate): fine to keep working on, not to push unreviewed
|
// 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<void> {
|
||||||
if (existsSync(resolve('.gitignore')) && !/^\/?\.storebound\/?$/m.test(readFileSync(resolve('.gitignore'), 'utf8')))
|
if (existsSync(resolve('.gitignore')) && !/^\/?\.storebound\/?$/m.test(readFileSync(resolve('.gitignore'), 'utf8')))
|
||||||
problems.push('.gitignore does not ignore .storebound/ (credentials live there)');
|
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`); }
|
if (problems.length) { for (const p of problems) console.error(` - ${p}`); throw new Error(`${problems.length} problems`); }
|
||||||
log('check', 'all good');
|
log('check', 'all good');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -490,6 +490,10 @@ export interface ShipConfig {
|
||||||
};
|
};
|
||||||
apple?: {
|
apple?: {
|
||||||
bundleId: string; appId?: string; primaryLocale?: string; listing?: string; info?: AppleAppInfo; reviewShots?: string;
|
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. */
|
/** Apple Developer Team ID (10 characters, Membership details). apple-app-site-association and ad-hoc export use it. */
|
||||||
teamId?: string;
|
teamId?: string;
|
||||||
/** Ad-hoc / release-testing export (`storebound apple adhoc`). */
|
/** 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. */
|
/** 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<ShipConfig, 'app' | 'apple'>): string => c.apple?.name?.trim() || c.app.name;
|
||||||
|
|
||||||
export const platformsOf = (c: Pick<ShipConfig, 'app' | 'apple' | 'play'>): Platform[] =>
|
export const platformsOf = (c: Pick<ShipConfig, 'app' | 'apple' | 'play'>): Platform[] =>
|
||||||
c.app.platforms ?? [...(c.apple ? ['ios' as const] : []), ...(c.play ? ['android' as const] : [])];
|
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(' | ')}`);
|
e.push(`play.billingPrograms: a list of ${PLAY_BILLING_PROGRAMS.join(' | ')}`);
|
||||||
if (cfg.apple) {
|
if (cfg.apple) {
|
||||||
if (!ID_RE.test(cfg.apple.bundleId ?? '')) e.push('apple.bundleId: not a bundle id (com.example.game)');
|
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)');
|
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;
|
const enc = cfg.apple.usesNonExemptEncryption;
|
||||||
if (enc !== undefined && typeof enc !== 'boolean') e.push('apple.usesNonExemptEncryption: true | false');
|
if (enc !== undefined && typeof enc !== 'boolean') e.push('apple.usesNonExemptEncryption: true | false');
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// https://support.google.com/googleplay/android-developer/answer/9859655 (content ratings)
|
// https://support.google.com/googleplay/android-developer/answer/9859655 (content ratings)
|
||||||
// https://support.google.com/googleplay/android-developer/answer/9867159 (target audience and content)
|
// https://support.google.com/googleplay/android-developer/answer/9867159 (target audience and content)
|
||||||
import { AGE_RATING_NONE } from '../apple/appinfo';
|
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 { APPLE_PRIVACY, applePurpose } from './declarations';
|
||||||
import { maskUser } from './credentials';
|
import { maskUser } from './credentials';
|
||||||
|
|
||||||
|
|
@ -86,7 +86,8 @@ function appRecord(config: ShipConfig): Answer[] {
|
||||||
const lang = locale ? LANGUAGE_NAMES[locale] : undefined;
|
const lang = locale ? LANGUAGE_NAMES[locale] : undefined;
|
||||||
return [
|
return [
|
||||||
a ? ok('platform:ios', 'Platforms: iOS', true, 'apple section') : ask('platform:ios', 'Platforms: iOS', 'config', 'The config has no apple section.'),
|
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}: <short tagline>") and fill again.`),
|
||||||
lang ? ok('language', 'Primary Language', lang, a?.primaryLocale ? 'apple.primaryLocale' : 'languages[0].apple')
|
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).'),
|
: 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.')
|
a?.bundleId ? ok('bundleId', 'Bundle ID', a.bundleId, 'apple.bundleId', 'Register it first if it is not in the list: storebound apple bundle.')
|
||||||
|
|
|
||||||
|
|
@ -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
|
// 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
|
// 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.
|
// 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';
|
import { AGE_LABELS, type Answer, APPLE_PURPOSES, type FormId } from './console-answers';
|
||||||
|
|
||||||
/** An accessible name: a string matches exactly, a RegExp matches the name. */
|
/** 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,
|
* 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[] {
|
export function navPlan(id: FormId, config: ShipConfig, bases: NavBases = NAV_BASES): NavStep[] {
|
||||||
const asc = bases.asc.replace(/\/$/, ''), play = bases.play.replace(/\/$/, '');
|
const asc = bases.asc.replace(/\/$/, ''), play = bases.play.replace(/\/$/, '');
|
||||||
const name = config.app?.name;
|
const name = config.app?.name;
|
||||||
const named = name ? { name } : {};
|
const named = name ? { name } : {};
|
||||||
|
const appleNamed = name ? { name: appleName(config) } : {};
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case 'apple-app-record': return [
|
case 'apple-app-record': return [
|
||||||
{ kind: 'goto', label: 'open Apps', url: `${asc}/apps` },
|
{ 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 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` }] : [
|
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: '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] },
|
{ 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] }];
|
return [...open, { kind: 'wait', label: 'the App Privacy page', roles: ['heading'], names: ['App Privacy', 'Uygulama Gizliliği', /^app privacy$/i] }];
|
||||||
|
|
|
||||||
|
|
@ -83,3 +83,21 @@ export function parseAppStoreListing(md: string): Record<string, AppleCopy> {
|
||||||
if (errors.length) throw new Error('appstore listing: ' + errors.join('; '));
|
if (errors.length) throw new Error('appstore listing: ' + errors.join('; '));
|
||||||
return out;
|
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<string, AppleCopy>, 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}: <tagline>" (30 characters at most); app.name stays the Play and on-device name` });
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -471,7 +471,7 @@ export function planImport(scan: FastlaneScan, o: PlanOptions): ImportPlan {
|
||||||
const md = `# ${appName} · App Store listing copy
|
const md = `# ${appName} · App Store listing copy
|
||||||
|
|
||||||
Imported from fastlane deliver (\`storebound import fastlane\`). Source for \`storebound apple listing\`. One
|
Imported from fastlane deliver (\`storebound import fastlane\`). Source for \`storebound apple listing\`. One
|
||||||
\`## <ASC locale>\` section per locale, one fenced block per \`### <field>\`: \`name\` (optional, defaults to \`app.name\`),
|
\`## <ASC locale>\` section per locale, one fenced block per \`### <field>\`: \`name\` (optional, defaults to \`apple.name\`, else \`app.name\`),
|
||||||
\`subtitle\` (30), \`promotionalText\` (170), \`keywords\` (100 bytes, comma separated, no spaces after commas),
|
\`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
|
\`description\` (4000), \`whatsNew\` (optional). Privacy policy, support and marketing URL come from
|
||||||
\`storebound.config.ts\`.
|
\`storebound.config.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'];
|
const APPLE_ORDER: AppleField[] = ['name', 'subtitle', 'promotionalText', 'keywords', 'description', 'whatsNew'];
|
||||||
|
|
||||||
/** Live App Store texts per locale merged into the App Store listing file. Pure. */
|
/** Live App Store texts per locale merged into the App Store listing file. A name equal to `defaultName` (apple.name,
|
||||||
export function mergeAppleListing(md: string, remote: Record<string, AppleCopy>): MergeResult {
|
* else app.name) is only written where the section already has a name block. Pure. */
|
||||||
|
export function mergeAppleListing(md: string, remote: Record<string, AppleCopy>, defaultName?: string): MergeResult {
|
||||||
const parts = md.split(/^(?=## )/m);
|
const parts = md.split(/^(?=## )/m);
|
||||||
const res: MergeResult = { md: '', changes: [], added: [], conflicts: [] };
|
const res: MergeResult = { md: '', changes: [], added: [], conflicts: [] };
|
||||||
const seen = new Set<string>();
|
const seen = new Set<string>();
|
||||||
|
|
@ -43,6 +44,7 @@ export function mergeAppleListing(md: string, remote: Record<string, AppleCopy>)
|
||||||
for (const f of APPLE_ORDER) {
|
for (const f of APPLE_ORDER) {
|
||||||
const v = r[f];
|
const v = r[f];
|
||||||
if (v === undefined || v === null || v === '') continue;
|
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);
|
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 });
|
if (from !== v.trim()) res.changes.push({ section: loc, field: f, from, to: v });
|
||||||
sec = next;
|
sec = next;
|
||||||
|
|
@ -52,7 +54,7 @@ export function mergeAppleListing(md: string, remote: Record<string, AppleCopy>)
|
||||||
let text = out.join('');
|
let text = out.join('');
|
||||||
for (const [loc, r] of Object.entries(remote).sort(([a], [b]) => a.localeCompare(b))) {
|
for (const [loc, r] of Object.entries(remote).sort(([a], [b]) => a.localeCompare(b))) {
|
||||||
if (seen.has(loc)) continue;
|
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;
|
if (!fields.length) continue;
|
||||||
res.added.push(loc);
|
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';
|
text = text.replace(/\s*$/, '') + `\n\n## ${loc}\n\n` + fields.map(f => `### ${f}\n${fence(r[f]!)}`).join('\n\n') + '\n';
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
// line, never an exception, so one bad section does not hide the rest ("unknown, never false").
|
// 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 { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
|
||||||
import { extname, isAbsolute, join, resolve } from 'node:path';
|
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 { APPLE_LIMITS, len, PLAY_LIMITS } from './copy';
|
||||||
import type { DraftsResult, IconResult, ListingField, ListingLocale, ListingsResult, ListingText, RenderImage, ReplyDraft } from './desktop-protocol';
|
import type { DraftsResult, IconResult, ListingField, ListingLocale, ListingsResult, ListingText, RenderImage, ReplyDraft } from './desktop-protocol';
|
||||||
import { parseFrontMatter, stringifyFrontMatter } from './frontmatter';
|
import { parseFrontMatter, stringifyFrontMatter } from './frontmatter';
|
||||||
|
|
@ -136,7 +136,7 @@ export function listingCompleteness(config: ShipConfig, root: string): ListingsR
|
||||||
const applePart = config.apple ? {
|
const applePart = config.apple ? {
|
||||||
code: ac,
|
code: ac,
|
||||||
fields: tally([
|
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('subtitle', as?.subtitle, APPLE_LIMITS.subtitle, true),
|
||||||
field('promotionalText', as?.promotionalText, APPLE_LIMITS.promotionalText, true),
|
field('promotionalText', as?.promotionalText, APPLE_LIMITS.promotionalText, true),
|
||||||
field('keywords', as?.keywords, APPLE_LIMITS.keywords, true),
|
field('keywords', as?.keywords, APPLE_LIMITS.keywords, true),
|
||||||
|
|
|
||||||
|
|
@ -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 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[] = [];
|
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?.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']) {
|
for (const k of ['CFBundleDisplayName', 'CFBundleName']) {
|
||||||
const v = plistVal(k);
|
const v = plistVal(k);
|
||||||
if (typeof v?.value === 'string' && BETA.test(v.value) && !/\$\(/.test(v.value)) betaName.push({ ...v.at, text: `${k}: ${v.value}` });
|
if (typeof v?.value === 'string' && BETA.test(v.value) && !/\$\(/.test(v.value)) betaName.push({ ...v.at, text: `${k}: ${v.value}` });
|
||||||
|
|
|
||||||
|
|
@ -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`).
|
Key ID and Issuer ID. The same key signs builds (`-allowProvisioningUpdates`).
|
||||||
2. **API · Bundle id.** `storebound apple bundle` registers it (Certificates, Identifiers & Profiles).
|
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.**
|
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).
|
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
|
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;
|
when the app uses nothing beyond OS / HTTPS encryption) so builds arrive answered;
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ It is not available over MCP.
|
||||||
|
|
||||||
| form | where | filled from |
|
| 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-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 |
|
| `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 |
|
| `play-content-rating` | Policy > App content > Content rating | app.contactEmail, app.profile, products, console.contentRating |
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Source for `storebound apple listing`. One `## <ASC locale>` section per locale (the first word is the locale code:
|
Source for `storebound apple listing`. One `## <ASC locale>` 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>`, field names exactly:
|
`en-US`, `tr`, `de-DE`, `ja`, `zh-Hans`, `ar-SA`, ...), one fenced block per `### <field>`, 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
|
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`.
|
on the first version). Shared values (privacy policy, support and marketing URL) come from `storebound.config.ts`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Source for `storebound apple listing`. One `## <ASC locale>` section per locale (the first word is the locale code:
|
Source for `storebound apple listing`. One `## <ASC locale>` 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>`, field names exactly:
|
`en-US`, `tr`, `de-DE`, `ja`, `zh-Hans`, `ar-SA`, ...), one fenced block per `### <field>`, 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
|
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`.
|
on the first version). Shared values (privacy policy, support and marketing URL) come from `storebound.config.ts`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ const config: ShipConfig = {
|
||||||
|
|
||||||
apple: {
|
apple: {
|
||||||
bundleId: 'com.example.app',
|
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',
|
listing: 'store/appstore.md',
|
||||||
// Export compliance (export-compliance skill): decide it, then uncomment. false ONLY if the app uses no encryption
|
// 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).
|
// beyond the OS (HTTPS through the system, standard sign-in).
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
Source for `storebound apple listing`. One `## <ASC locale>` section per locale (the first word is the locale code:
|
Source for `storebound apple listing`. One `## <ASC locale>` 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>`, field names exactly:
|
`en-US`, `tr`, `de-DE`, `ja`, `zh-Hans`, `ar-SA`, ...), one fenced block per `### <field>`, 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
|
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`.
|
on the first version). Shared values (privacy policy, support and marketing URL) come from `storebound.config.ts`.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ const config: ShipConfig = {
|
||||||
|
|
||||||
apple: {
|
apple: {
|
||||||
bundleId: 'com.example.app',
|
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',
|
listing: 'store/appstore.md',
|
||||||
// Export compliance (export-compliance skill): decide it, then uncomment. false ONLY if the app uses no encryption
|
// 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).
|
// beyond the OS (HTTPS through the system, standard sign-in).
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ const config: ShipConfig = {
|
||||||
|
|
||||||
apple: {
|
apple: {
|
||||||
bundleId: 'com.example.game',
|
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
|
// appId: '1234567890', // Apple ID of the app record; looked up by bundle id when left out
|
||||||
listing: 'store/appstore.md',
|
listing: 'store/appstore.md',
|
||||||
reviewShots: 'store/iap-review',
|
reviewShots: 'store/iap-review',
|
||||||
|
|
|
||||||
77
tests/apple-name.test.ts
Normal file
77
tests/apple-name.test.ts
Normal file
|
|
@ -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']);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
@ -80,12 +80,12 @@ describe('listing pull commands', () => {
|
||||||
let r = await capture(() => appleListing(p.ctx(['pull', '--json'])));
|
let r = await capture(() => appleListing(p.ctx(['pull', '--json'])));
|
||||||
const j = jsonOut(r.out);
|
const j = jsonOut(r.out);
|
||||||
expect(j).toMatchObject({ version: '1.1.0', write: false, added: [] });
|
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(j.diff).toContain('-Old text.');
|
||||||
expect(readFileSync(join(p.root, 'store/appstore.md'), 'utf8')).toBe(APPLE_MD);
|
expect(readFileSync(join(p.root, 'store/appstore.md'), 'utf8')).toBe(APPLE_MD);
|
||||||
r = await capture(() => appleListing(p.ctx(['pull', '--write'])));
|
r = await capture(() => appleListing(p.ctx(['pull', '--write'])));
|
||||||
expect(readFileSync(join(p.root, 'store/appstore.md'), 'utf8')).toContain('### whatsNew\n```\nFaster sync.\n```');
|
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 () => {
|
test('play listing pull: one read-only edit, deleted; --write updates the file', async () => {
|
||||||
playEnv();
|
playEnv();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue