From 526dfd3b09589224703074e3541fe88e513d9f4e Mon Sep 17 00:00:00 2001 From: CRT Date: Sun, 11 Oct 2026 17:24:21 +0000 Subject: [PATCH] flows, listing translate, scan 2.2 + --originality, prices export with subscriptions, site sections - storebound flow list|validate|run: repo-local workflows (store/workflows/*.yml, storebound.workflows.*), writes dry unless --apply, owner steps never run, --from / --resume; init templates for app and game; MCP flow_list + dry flow_run; release-flows skill - storebound listing translate|check|reviewed: per-language listing drafts with store limits and keyword rules, agent or --translate hook, marked until reviewed; MCP listing_translate / listing_check; listing-localization skill - scan: Apple 2.2 beta/demo/test wording rule; scan --originality [--against] - prices export includes subscriptions; prices import skips their rows - site: rejection scan section, Desktop app section with fixture-mode screenshots, Everything else grid, FAQ 4.3 answer - README, CHANGELOG, adapters, API tables --- .cursor/rules/storebound.mdc | 2 + .github/copilot-instructions.md | 2 + AGENTS.md | 2 + CHANGELOG.md | 18 ++ GEMINI.md | 2 + README.md | 90 +++++- cli/api/wrapped.gen.ts | 7 +- cli/check.ts | 8 + cli/flow.ts | 220 +++++++++++++ cli/index.ts | 2 + cli/init.ts | 4 +- cli/lib/args.ts | 2 +- cli/lib/flow.ts | 320 +++++++++++++++++++ cli/lib/listing-translate.ts | 158 +++++++++ cli/lib/scan/index.ts | 34 +- cli/lib/scan/rules.ts | 15 +- cli/lib/subscriptions.ts | 15 +- cli/lib/template-files.ts | 8 + cli/lib/yaml.ts | 171 ++++++++++ cli/listing.ts | 214 +++++++++++++ cli/mcp-tools.ts | 26 +- cli/originality.ts | 29 +- cli/prices.ts | 40 ++- cli/scan.ts | 19 +- cli/text-modules.d.ts | 1 + docs/api-coverage.md | 10 +- media/teaser/site-shots.ts | 23 ++ site/desktop/index.html | 2 +- site/img/desktop/checks.webp | Bin 0 -> 65816 bytes site/img/desktop/portfolio.webp | Bin 0 -> 54904 bytes site/img/desktop/releases.webp | Bin 0 -> 35568 bytes site/index.html | 115 ++++++- site/sitemap.xml | 6 +- site/style.css | 28 ++ skills/listing-localization/SKILL.md | 45 +++ skills/release-flows/SKILL.md | 60 ++++ templates/profiles/app/workflows/beta.yml | 36 +++ templates/profiles/app/workflows/release.yml | 43 +++ templates/workflows/beta.yml | 37 +++ templates/workflows/release.yml | 46 +++ tests/flow.test.ts | 205 ++++++++++++ tests/listing-translate.test.ts | 99 ++++++ tests/originality.test.ts | 17 + tests/prices.test.ts | 29 ++ tests/scan.test.ts | 19 ++ 45 files changed, 2176 insertions(+), 53 deletions(-) create mode 100644 cli/flow.ts create mode 100644 cli/lib/flow.ts create mode 100644 cli/lib/listing-translate.ts create mode 100644 cli/lib/yaml.ts create mode 100644 cli/listing.ts create mode 100644 media/teaser/site-shots.ts create mode 100644 site/img/desktop/checks.webp create mode 100644 site/img/desktop/portfolio.webp create mode 100644 site/img/desktop/releases.webp create mode 100644 skills/listing-localization/SKILL.md create mode 100644 skills/release-flows/SKILL.md create mode 100644 templates/profiles/app/workflows/beta.yml create mode 100644 templates/profiles/app/workflows/release.yml create mode 100644 templates/workflows/beta.yml create mode 100644 templates/workflows/release.yml create mode 100644 tests/flow.test.ts create mode 100644 tests/listing-translate.test.ts diff --git a/.cursor/rules/storebound.mdc b/.cursor/rules/storebound.mdc index 513e5dc0..73fdbf99 100644 --- a/.cursor/rules/storebound.mdc +++ b/.cursor/rules/storebound.mdc @@ -53,12 +53,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t - `skills/build-and-sign/SKILL.md`: Sign, build and upload a mobile app or game from the terminal - `skills/console-autofill/SKILL.md`: AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes - `skills/export-compliance/SKILL.md`: Answer App Store export compliance (encryption) for a mobile app or game correctly +- `skills/listing-localization/SKILL.md`: Translate the store listing of a mobile app or game into more languages - `skills/migrate-from-fastlane/SKILL.md`: Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` - `skills/play-first-release/SKILL.md`: Step-by-step first (and later) Google Play release of a mobile app or game - `skills/portfolio-originality/SKILL.md`: Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) - `skills/ppp-pricing/SKILL.md`: Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` - `skills/privacy-manifest/SKILL.md`: Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game - `skills/privacy-policy/SKILL.md`: Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games +- `skills/release-flows/SKILL.md`: Repo-local workflows for a mobile app or game - `skills/release-management/SKILL.md`: Ship updates safely after the first release - `skills/revenuecat-sync/SKILL.md`: Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config - `skills/review-access/SKILL.md`: Give App Store and Google Play reviewers working access to an app behind a sign-in diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 8578ec88..6140ffc5 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -55,12 +55,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t | `build-and-sign` | Sign, build and upload a mobile app or game from the terminal | | `console-autofill` | AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes | | `export-compliance` | Answer App Store export compliance (encryption) for a mobile app or game correctly | +| `listing-localization` | Translate the store listing of a mobile app or game into more languages | | `migrate-from-fastlane` | Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` | | `play-first-release` | Step-by-step first (and later) Google Play release of a mobile app or game | | `portfolio-originality` | Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) | | `ppp-pricing` | Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` | | `privacy-manifest` | Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game | | `privacy-policy` | Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games | +| `release-flows` | Repo-local workflows for a mobile app or game | | `release-management` | Ship updates safely after the first release | | `revenuecat-sync` | Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config | | `review-access` | Give App Store and Google Play reviewers working access to an app behind a sign-in | diff --git a/AGENTS.md b/AGENTS.md index a3f77daf..ee4b215b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -54,12 +54,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t - `skills/build-and-sign/SKILL.md`: Sign, build and upload a mobile app or game from the terminal - `skills/console-autofill/SKILL.md`: AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes - `skills/export-compliance/SKILL.md`: Answer App Store export compliance (encryption) for a mobile app or game correctly +- `skills/listing-localization/SKILL.md`: Translate the store listing of a mobile app or game into more languages - `skills/migrate-from-fastlane/SKILL.md`: Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` - `skills/play-first-release/SKILL.md`: Step-by-step first (and later) Google Play release of a mobile app or game - `skills/portfolio-originality/SKILL.md`: Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) - `skills/ppp-pricing/SKILL.md`: Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` - `skills/privacy-manifest/SKILL.md`: Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game - `skills/privacy-policy/SKILL.md`: Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games +- `skills/release-flows/SKILL.md`: Repo-local workflows for a mobile app or game - `skills/release-management/SKILL.md`: Ship updates safely after the first release - `skills/revenuecat-sync/SKILL.md`: Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config - `skills/review-access/SKILL.md`: Give App Store and Google Play reviewers working access to an app behind a sign-in diff --git a/CHANGELOG.md b/CHANGELOG.md index 69330e33..80927883 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ ## Unreleased +- `storebound flow list | validate | run `: repo-local workflows in `store/workflows/*.yml` (or + `storebound.workflows.yml|json|ts`): named steps run in order with progress, `${VAR}` params and captures, `if:` + conditions, sub-flows, before / after / onError hooks. Writes run as dry runs unless `--apply`; owner steps (submit, + release, rollout ...) are listed as "your click" and never run; `--from ` and `--resume` continue after a + failure. `init` writes `release.yml` and `beta.yml` for the app and game profiles. A small YAML subset reader keeps + zero runtime dependencies. MCP: `flow_list`, `flow_run` (dry mode). Skill: `release-flows`. +- `storebound listing translate --to `: per-language listing drafts in both listing files (App Store name, + subtitle, promotional text, keywords, description; Play title, short, full) for the agent to translate, or a + `--translate ""` hook per field; store limits and keyword rules (commas, duplicates, name words, 100) are + enforced, drafts stay marked until `listing reviewed`; `listing check`, and `check` warns about drafts. No LLM call + in the CLI. MCP: `listing_translate`, `listing_check`. Skill: `listing-localization`. +- `scan`: Apple 2.2 "beta / demo / trial / test" wording in the app name and the App Store text (`beta-wording`); + `scan --originality [--against ]` puts the 4.3 / Play repetitive content check into the scan report. +- `prices export` includes auto-renewable subscriptions (Apple current and scheduled prices, Play base plan regional + prices; `--no-subscriptions` leaves them out); `prices import` skips those rows and names the subscription commands. +- Site: "Catch rejections before you submit", a Desktop app section with real fixture-mode screenshots, an "Everything + else" command grid and the FAQ on `storebound originality`. + - Growth extras, each with `--dry`, `--json`, tests on sanitized fixtures and a skill: - `prices ppp`: purchasing power price sheets from a bundled, dated World Bank ICP PPP dataset (CC BY 4.0, `tools/update-ppp.ts` refreshes it), the Big Mac index or a CSV; clamped, snapped to store price points, written diff --git a/GEMINI.md b/GEMINI.md index 3c502b4a..5420d619 100644 --- a/GEMINI.md +++ b/GEMINI.md @@ -54,12 +54,14 @@ These rules apply to every AI tool that uses storebound (skills, MCP server or t | `build-and-sign` | Sign, build and upload a mobile app or game from the terminal | | `console-autofill` | AI-assisted autofill of App Store Connect and Google Play Console forms that have no API (the New App dialog, App Privacy, the Play IARC content rating questionnaire, Target audience and content plus the Ads declaration; the App Store age rating is shown as guidance because the API sets it) in a visible Chromium the owner signs in to. Answers come only from storebound.config.ts; anything the config does not prove stays empty and highlighted. storebound never signs in, never saves, submits or publishes | | `export-compliance` | Answer App Store export compliance (encryption) for a mobile app or game correctly | +| `listing-localization` | Translate the store listing of a mobile app or game into more languages | | `migrate-from-fastlane` | Move a mobile app or game from fastlane (deliver, supply, snapshot / screengrab, Appfile, Deliverfile) to storebound with `storebound import fastlane` | | `play-first-release` | Step-by-step first (and later) Google Play release of a mobile app or game | | `portfolio-originality` | Originality gate for studios and developers that ship many similar mobile apps or games (templates, white-label apps, reskins) | | `ppp-pricing` | Propose purchasing power parity (PPP) prices for a mobile app's or game's in-app products in every App Store territory and Google Play region with `storebound prices ppp` | | `privacy-manifest` | Add and check Apple privacy manifests (PrivacyInfo.xcprivacy) for an iOS app or game | | `privacy-policy` | Write and host one studio-wide privacy policy page for all of a developer's mobile apps and games | +| `release-flows` | Repo-local workflows for a mobile app or game | | `release-management` | Ship updates safely after the first release | | `revenuecat-sync` | Optional adapter that keeps a RevenueCat project's catalog in step with the storebound config | | `review-access` | Give App Store and Google Play reviewers working access to an app behind a sign-in | diff --git a/README.md b/README.md index 699b83f1..b5ecc19c 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ your own click. | 2 | **App records and bundle id** | `apple bundle` registers the bundle id, `apple status` finds the app record | App Store Connect > New App (no API); Play Console > Create app; the very first AAB upload when Play needs it from the Console | the declarations you accept when creating the Play app | | 3 | **Builds and testers** | `play next-version-code`, `play build`, `play upload --track internal`, `apple signing ensure`, `apple build`, `apple upload` (waits for processing), `apple encryption`, `apple testflight groups / what-to-test / info / distribute` (internal groups) | Play internal testers list, Apple sandbox testers (`play-first-release`, `testflight`) | `apple testflight testers` (Apple emails the invitations), external groups and Beta App Review (`distribute --submit-review`) | | 4 | **In-app products and subscriptions** | `play products` (regional prices from USD + your overrides, activated), `apple iap` (consumable, non-consumable, non-renewing; localizations, price schedule, availability), `apple iap-review`, `apple subscriptions` (groups, levels, equalized prices, intro and promotional offers, offer codes), `play subscriptions` (base plans, regional prices, offers), `catalog diff` (both stores against one catalog) | Play license testers, Apple sandbox testers, "Add for Review" of the first IAPs and subscriptions into the version's submission, Play promo codes (`store-iap-setup`, `store-subscriptions`) | custom offer codes (`apple subscriptions --codes` asks first) | -| 5 | **Store listings, every language** | `play listing` (title, short / full description, contact email + website, promo video URL), `apple listing --version x --build N` (name, subtitle, description, keywords, promo text, URLs, privacy URL, manual release), `whats-new`, `check` (limits), `check --aso` | Play store settings: category and tags (`play-first-release`) | | +| 5 | **Store listings, every language** | `play listing` (title, short / full description, contact email + website, promo video URL), `apple listing --version x --build N` (name, subtitle, description, keywords, promo text, URLs, privacy URL, manual release), `listing translate` (drafts per language), `whats-new`, `check` (limits), `check --aso` | Play store settings: category and tags (`play-first-release`) | | | 6 | **Play questionnaires** | `play data-safety`: the whole Data safety form from `dataSafety` in the config (CSV import through the API) | Policy and programs > App content, answers prepared in `store/declarations.md` (`store-declarations`): privacy policy, app access with the demo account (`review-access`), delete-account URL (`account-deletion`), ads, content rating (IARC), target audience and content, advertising ID, news, government, financial and health features; Data safety summary check | the answers themselves are your statements: the agent asks when the code does not prove them | | 7 | **App Store questionnaires** | `apple appinfo` (categories, age rating declaration, content rights, Free price, availability), `apple encryption` (export compliance from `apple.usesNonExemptEncryption`, never guessed), `apple review-details` (contact, demo account from `.storebound/`, notes) | App Privacy nutrition labels from `store/app-privacy.md`, then **Publish** (`store-declarations`); encryption documentation when the answer is yes (`export-compliance`); the first availability record if the API refuses it | the export compliance answer (a legal statement, set once in the config) | | 8 | **Privacy and accounts** | privacy policy page template (`init`), `privacy-manifest --ios ` (PrivacyInfo.xcprivacy, required-reason APIs, SDK manifests), `validate` checks the policy, delete-account and terms URLs answer | host the pages, link them in both consoles and inside the app; in-app account deletion (`privacy-policy`, `privacy-manifest`, `account-deletion`) | | @@ -158,6 +158,8 @@ app shows them on the Checks tab. A finding you decided is fine goes into the co | `metadata-keywords`, `kids-terms`, `play-metadata` | 2.3.7, 2.3.8 | Metadata | other apps' names, prices and "best / #1" in name, subtitle or keywords; keyword lists; "For Kids" outside the Kids Category. Play title over 30 characters, emoji, ALL CAPS, rank / price / promotion terms; other apps in the title or short description; repeated keywords or keyword lists in the full description | | `play-impersonation` | | Impersonation | a well-known brand in the package name or app name (low: a check, not a verdict) | | `placeholder-text` | 2.1(a) | Metadata | lorem ipsum, TODO, template lines in the listings | +| `beta-wording` | 2.2 | | "beta", "demo", "trial version", "test build", "early access" in the app name (config, CFBundleDisplayName) or the App Store name, subtitle, keywords, promotional text and description ("demo account" is fine) | +| `originality` (with `--originality`) | 4.3 | Repetitive content | a near-duplicate of one of your own apps (`storebound originality` scores: name, listing text, icon and screenshot hashes, project structure) | | `min-functionality` | 4.2 | | Capacitor `server.url` / Cordova `` on a remote site; a few native files around a remote WKWebView | | `deprecated-api`, `private-api` | 2.5.1 (ITMS-90809) | | UIWebView; `App-Prefs:` / `prefs:root` URL schemes | | `ipv6`, `ats` | 2.5.5, App Transport Security | | IPv4 literals in server URLs; NSAllowsArbitraryLoads | @@ -166,6 +168,10 @@ app shows them on the Checks tab. A finding you decided is fine goes into the co | `play-target-sdk` | | Target API level | below API 36 (Wear OS / Automotive 35, TV / XR 34) for new apps and updates since 2026-08-31 | | `play-package-name` | | Play Console upload | the reserved `com.example` prefix | +`storebound scan --originality [--against ]` adds the Guideline 4.3 / Play repetitive content check against +your other apps to the same report (folders default to `originality.against` in the config; `storebound originality` +stays the command with every score and suggestion). + Rules cite Apple's App Review Guidelines and the Play Policy Center / Play Console Help pages they come from (checked 2026-10-11, in the code comments of `cli/lib/scan/rules.ts` and `cli/lib/scan/play-rules.ts`); the SDK table with each vendor's data disclosure page and Google's Families self-certified ads SDK list is `cli/lib/scan/sdks.ts`. Play config @@ -311,11 +317,14 @@ run in the background with a log (`storebound shots render > .storebound/render. | `check` | local | config, copy limits, data safety, products, subscriptions, profile (delete-account URL, demo account, terms URL), files; warns on untranslated release notes | | `catalog diff [--store] [--threshold 10]` | API, read-only | one catalog vs both stores: missing / extra / mismatched products and subscriptions, US and override prices, locales, offers, per-region price differences between the stores; exit 1 on mismatches | | `check --aso` | local | keyword audit: App Store keyword field rules, Play stuffing / claims | -| `scan [--store apple\|play] [--json] [--write]` | local, read-only | rejection risks in the project itself (stack, SDKs, Info.plist, manifest, listings) with guideline, evidence file:line, fix and skill; Data safety / App Privacy / ATT / privacy manifest proposal as a diff (`--write` adds the detected answers to the config); exit 1 on blockers | +| `scan [--store apple\|play] [--json] [--write] [--originality --against ]` | local, read-only | rejection risks in the project itself (stack, SDKs, Info.plist, manifest, listings) with guideline, evidence file:line, fix and skill; Data safety / App Privacy / ATT / privacy manifest proposal as a diff (`--write` adds the detected answers to the config); exit 1 on blockers | | `validate [--apple] [--play]` | API, read-only | readiness report with ordered blockers plus the local renders checks (`--no-local` skips); exit 1 while any blocker is left | | `originality --against [--json]` | local, read-only | Guideline 4.3 check vs your other apps: name, listing text, icon and screenshot perceptual hashes, project structure; scores, near-duplicate flags, suggestions; exit 1 when flagged | | `whats-new [--since ]` | local | draft player-facing release notes from git log into both listing files | | `whats-new --languages en,de,tr` / `check` / `apply` | local | one file per language (`store/whats-new/`) for your agent (or a `--translate` hook of yours) to translate, per-store limits (Play 500, App Store 4000), then into both listing files | +| `listing translate --to de,ja [--from en] [--translate ""]` | local | per-language listing sections in both listing files (App Store name, subtitle, promotional text, keywords, description; Play title, short, full) for your agent (or a hook) to translate, marked as drafts until reviewed; keywords cleaned up | +| `listing check` / `listing reviewed --lang ` | local | every language section against the store limits and keyword rules, untranslated and unreviewed drafts (exit 1 on a problem) / remove the draft marker after a human read it | +| `flow list \| validate \| run [NAME=value] [--dry \| --apply] [--from \| --resume]` | local + whatever the steps call | repo-local workflows (`store/workflows/*.yml`): steps in order with progress; writes run as dry runs unless `--apply`, owner steps are listed as your click and never run (see [Repo-local workflows](#repo-local-workflows)) | | `catalog pull [--write]` | API, read-only + local | IAP and subscription texts on the stores vs the config: a proposal diff (`.storebound/pull/catalog.json`); the config is never rewritten | | `ads scan --ios ` | local | AdAttributionKit / SKAdNetwork: ad network ids, postback copy endpoints, attribution windows and cooldown, conversion value updates; exit 1 on a blocker | | `privacy-manifest --ios ` | local | PrivacyInfo.xcprivacy, required-reason APIs, SDKs without manifests | @@ -405,7 +414,7 @@ run in the background with a log (`storebound shots render > .storebound/render. | `reviews list [--unanswered]` | API, read-only | recent reviews of both stores | | `reviews draft` | API + local | one reply draft per unanswered review in `.storebound/replies/` | | `reviews send` | API | sends drafts with `approved: true` (checks length and incentives, asks first) | -| `prices export` | API + local | current prices of every product, both stores, as `store/prices.csv` | +| `prices export [--no-subscriptions]` | API + local | current prices of every product and subscription (Apple current + scheduled, Play base plan regions), both stores, as `store/prices.csv`; subscription rows feed `apple subscriptions --csv` / `play subscriptions --csv` | | `prices import [--reconvert]` | API | diff table, then (asks first) Apple price schedules incl. future-dated changes and Play regional prices | | `analytics setup` | API | App Store analytics report request (once, Admin key) | | `analytics snapshot [--days 28]` | API + local | impressions, page views, downloads (App Store), visitors, acquisitions, installs (Play reports bucket) -> `.storebound/analytics/` | @@ -558,6 +567,75 @@ submitted), the next move and the warnings. Owner steps (submit for review, prom version, raise or complete a rollout) are named with where the owner does them; storebound does not do them. A store it cannot read is "unknown", never "not there". Both commands work in an app folder (that app) and in a workspace (every app, or `--app a,b`); `--json` gives the structured result. MCP: `release_status`, `release_plan` (read-only). +## Repo-local workflows + +Your release routine as a file in the repo, run step by step. `storebound init` writes two to start from +(`store/workflows/release.yml`, `beta.yml`; app and game versions): + +```yaml +# store/workflows/release.yml (app profile, shortened) +params: + VERSION: "1.0.0" +steps: + - id: next-build + if: apple + run: apple next-build + capture: BUILD + - id: build + if: apple + run: apple build --version ${VERSION} --build-number ${BUILD} + - id: upload + if: apple + run: apple upload --no-wait + # wait, play-build, play-upload, whats-new, listing, validate, scan, plan ... + - id: submit + owner: "App Store Connect: Submit for Review (version ${VERSION}, build ${BUILD}) ..." +``` + +The plan of that file (`--dry`: nothing runs; without it the reads run and `${BUILD}` is filled in): + +``` +$ storebound flow run release VERSION=1.2.0 --dry +[flow] 1/12 next-build: storebound apple next-build (plan only) +[flow] 2/12 build: storebound apple build --version 1.2.0 --build-number ${BUILD} --dry (plan only) +[flow] 3/12 upload: storebound apple upload --no-wait --dry (plan only) +[flow] 4/12 wait: storebound apple testflight wait --build ${BUILD} --version 1.2.0 --dry (plan only) +[flow] 5/12 play-build: storebound play build --version-name 1.2.0 --dry (plan only) +[flow] 6/12 play-upload: storebound play upload --track internal --dry (plan only) +[flow] 7/12 whats-new: storebound whats-new apply (if exists store/whats-new: false) +[flow] 8/12 listing: storebound apple listing --version 1.2.0 --build ${BUILD} --dry (plan only) +[flow] 9/12 validate: storebound validate (plan only) +[flow] 10/12 scan: storebound scan (plan only) +[flow] 11/12 plan: storebound release plan 1.2.0 (plan only) +[flow] 12/12 submit: YOUR CLICK App Store Connect: Submit for Review (version 1.2.0, build ${BUILD}). Play Console: promote the internal release and Send changes for review +``` + +- Read steps (check, validate, scan, release plan, next-build, status) run; **write steps run with `--dry`** unless + `--apply`, and even then each command asks its own confirmation; wait steps check once; `sh:` steps (your own build + commands) run only with `--apply`. `--dry` prints the plan without running anything. +- Owner steps (submit, release, phased release, rollout, review replies, price imports, tester invitations, Beta App + Review) are never executed, also when written as `run:`; the flow ends with the list of your clicks. +- `capture:` turns a step's last output line into a variable (`${BUILD}`), `if:` skips a step (`apple`, `play`, + `exists `, `${VAR} == x`), `flow:` reuses another flow (`private: true` sub-flows), `before` / `after` / + `onError` are hooks, `continueOnError` keeps going. +- A failed step stops the flow; `--resume` starts again at that step with the captured variables + (`.storebound/flows/.json`), `--from ` anywhere. `flow validate` checks commands, variables, duplicate ids + and sub-flow cycles. Several flows can also live in `storebound.workflows.yml|json|ts`. +- MCP: `flow_list` and `flow_run` (the dry mode only; `--apply` stays a terminal command). Skill: `release-flows`. + +## Listing in more languages + +`storebound listing translate --to de,ja` adds a section per language to `store/appstore.md` (name, subtitle, +promotional text, keywords, description) and `store/listing.md` (title, short and full description) with the source +text and a marker, ``. Your agent translates in place +(`listing-localization` skill: native wording, researched keywords, the store limits) and sets `status=draft`; or +`--translate ""` runs a command of yours once per field (source text on stdin, `STOREBOUND_TARGET_LANG`, +`STOREBOUND_FIELD`, `STOREBOUND_LIMIT` in the environment). storebound itself calls no translation service. +`listing check` enforces each store's limits (App Store subtitle 30, promotional text 170, keywords 100 without +duplicates or name words, description 4000; Play title 30, short 80, full 4000) and lists drafts; `storebound check` +warns while one is left. After a human read a draft, `listing reviewed --lang de` removes the marker. Reviewed sections +are never overwritten without `--force`. MCP: `listing_translate`, `listing_check`. + ## Every endpoint The commands above cover the journey. For anything else, `storebound api` calls **every operation** of the App Store @@ -672,6 +750,8 @@ navigation. | `review-replies` | reply drafts, tone, no incentives, store limits, the owner approves and sends | | `store-analytics` | App Store analytics reports, Play reports bucket, before / after listing changes, sales / finance / earnings reports | | `whats-new` | player-facing release notes from git, one file per language for your agent to translate, store limits checked | +| `listing-localization` | the listing in more languages: drafts per language, native wording and keyword research, store limits, review before push | +| `release-flows` | repo-local workflows (`store/workflows/*.yml`): release and beta routines with dry runs, resume and the owner's clicks | | `review-rejections` | triage a rejection (fix / clarify / push back / appeal), reply template, the guidelines apps and games hit | | `ads-mediation-checks` | AdMob, AppLovin MAX and LevelPlay: ids, debug tools, adapters, app-ads.txt, SKAdNetwork, AdAttributionKit (`ads scan`), no-fill (`ads-levelplay-checks` stays as a pointer) | | `portfolio-originality` | Guideline 4.3 gate for developers shipping many similar apps or games, with `storebound originality` scores | @@ -686,7 +766,7 @@ per-request `_meta`, `resultType`, cacheable `tools/list`) and, on the same proc - One tool per command. Read-only: `scan`, `check`, `check_aso`, `validate`, `catalog_diff`, `health`, `reviews_list`, `prices_diff`, `analytics_compare`, `apple_status`, `apple_next_build`, `apple_testflight_status`, `apple_ppo_status`, `play_status`, `play_next_version_code`, `privacy_manifest`, `shots_check`, `workspace_list`, `workspace_status`, - `release_status`, `release_plan`. Local writes: `import_fastlane`, `whats_new`, `icons`, + `release_status`, `release_plan`, `flow_list`, `flow_run` (dry mode only), `listing_check`. Local writes: `import_fastlane`, `whats_new`, `listing_translate`, `icons`, `play_status`, `play_next_version_code`, `privacy_manifest`, `shots_check`, `api_get` (any App Store Connect or Google Play GET operation by id). Local writes: `import_fastlane`, `whats_new`, `icons`, `health_report`, `reviews_draft`, `prices_export`, `analytics_snapshot`, `shots_capture`, `shots_render`, @@ -792,7 +872,7 @@ in 0.4.0. 0.5.0 made storebound app-first (profiles, app screenshot style, accou brought the full in-app catalog: subscriptions on both stores with offers and offer codes, non-renewing products and the cross-store `catalog diff`. Next, roughly in this order: -- Play prepaid base plans for `non_renewing`, and a `prices export` that includes subscriptions. +- Play prepaid base plans for `non_renewing`. - The App Asset Library (API 4.5.1) for screenshots, custom product pages and in-app events once the screenshot sets it replaces stop working. - Play store listing experiments and their results, as soon as Google offers an API. diff --git a/cli/api/wrapped.gen.ts b/cli/api/wrapped.gen.ts index dfee270e..4db77ef6 100644 --- a/cli/api/wrapped.gen.ts +++ b/cli/api/wrapped.gen.ts @@ -81,7 +81,7 @@ export const WRAPPED: { apple: Record; play: Record; play: Record; play: Record; play: Record { if (missing.length) note(`appstore listing has no section for ${missing.join(', ')}`); return `${Object.keys(copy).length} locales`; }); + // listing translation drafts (storebound listing translate): fine to keep working on, not to push unreviewed + for (const f of [config.apple ? resolve(config.apple.listing ?? 'store/appstore.md') : '', config.play ? resolve(config.play.listing ?? 'store/listing.md') : ''].filter(Boolean)) { + if (!existsSync(f)) continue; + const marks = [...readFileSync(f, 'utf8').matchAll(/^## (\S+)[^\n]*\n(?: source text copied in, still to translate +// machine-translated: review, then `listing reviewed` +// Limits per store field (characters; App Store keywords also 100 bytes, as the existing listing check counts them): +// App Store (appStoreVersionLocalizations / appInfoLocalizations): name 30, subtitle 30, promotionalText 170, +// keywords 100, description 4000. https://developer.apple.com/help/app-store-connect/reference/app-information +// Google Play (edits.listings): title 30, shortDescription 80, fullDescription 4000. +// https://support.google.com/googleplay/android-developer/answer/9859152 +// Keyword rules (App Store): comma separated, no spaces around commas, no duplicates, no words already in the name or +// subtitle (they are indexed anyway), whole keywords cut at the limit. +import { APPLE_LIMITS, len, PLAY_LIMITS } from './copy'; + +export type TStatus = 'translate' | 'draft'; +export const MARK_RE = /^\s*$/m; +export const mark = (from: string, status: TStatus): string => ``; + +export const APPLE_FIELDS = ['name', 'subtitle', 'promotionalText', 'keywords', 'description'] as const; +export type AppleTField = typeof APPLE_FIELDS[number]; +export const PLAY_FIELDS = ['title', 'short', 'full'] as const; +export type PlayTField = typeof PLAY_FIELDS[number]; +export const FIELD_LIMITS = { + apple: Object.fromEntries(APPLE_FIELDS.map(f => [f, APPLE_LIMITS[f]])) as Record, + play: { title: PLAY_LIMITS.title, short: PLAY_LIMITS.short, full: PLAY_LIMITS.full } as Record, +}; + +const fence = (t: string) => '```\n' + t + '\n```'; + +/** "## " sections of a listing file (index 0 = the preamble). */ +export const sections = (md: string): string[] => md.split(/^(?=## )/m); + +/** "### heading" -> first fenced block text, in order. */ +export function blocksOf(sec: string): { heading: string; text: string }[] { + const out: { heading: string; text: string }[] = []; + for (const part of sec.split(/^### /m).slice(1)) { + const heading = part.split('\n')[0]!.trim(); + const m = /^```[^\n]*\n([\s\S]*?)\n```/m.exec(part); + if (m) out.push({ heading, text: m[1]!.trim() }); + } + return out; +} + +export const appleLocaleOf = (sec: string): string | null => { + if (!sec.startsWith('## ')) return null; + const l = sec.slice(3).split(/[\s·]/)[0]!.trim(); + return /^[a-z]{2,3}(-[A-Za-z]{2,4})?$/.test(l) ? l : null; +}; +export const playCodesOf = (sec: string): string[] => { + const m = /^$/m.exec(sec); + return m ? m[1]!.split(',').map(s => s.trim()).filter(Boolean) : []; +}; +export function markerOf(sec: string): { from: string; status: TStatus } | null { + const m = MARK_RE.exec(sec); + return m ? { from: m[1]!, status: m[2] as TStatus } : null; +} + +export function appleFields(sec: string): Partial> { + const out: Partial> = {}; + for (const b of blocksOf(sec)) if ((APPLE_FIELDS as readonly string[]).includes(b.heading) || b.heading === 'whatsNew') out[b.heading as AppleTField] = b.text; + return out; +} + +export function playFields(sec: string): Partial> { + const out: Partial> = {}; + for (const b of blocksOf(sec)) { + const k = /what'?s new|release notes/i.test(b.heading) ? 'whatsNew' : /\btitle\b/i.test(b.heading) ? 'title' : /\bshort\b/i.test(b.heading) ? 'short' : /\bfull\b/i.test(b.heading) ? 'full' : null; + if (k && out[k] === undefined) out[k] = b.text; + } + return out; +} + +export const findAppleSection = (md: string, locale: string): string | undefined => sections(md).find(s => appleLocaleOf(s) === locale); +export const findPlaySection = (md: string, codes: string[]): string | undefined => sections(md).find(s => playCodesOf(s).some(c => codes.includes(c))); + +export function appleSectionText(locale: string, label: string, f: Partial>, marker: string | null): string { + const parts = [`## ${locale}${label ? ` · ${label}` : ''}`, ...(marker ? [marker] : []), '']; + for (const k of [...APPLE_FIELDS, 'whatsNew'] as const) if (f[k] !== undefined && f[k] !== '') parts.push(`### ${k}`, fence(f[k]!), ''); + return parts.join('\n') + '\n'; +} + +const PLAY_HEAD: Record = { title: 'Play title (max 30)', short: 'Play short description (max 80)', full: 'Play full description (max 4000)', whatsNew: 'What\'s new (max 500)' }; +export function playSectionText(codes: string[], label: string, f: Partial>, marker: string | null): string { + const parts = [`## ${label || codes[0]} (${codes.join(', ')})`, ``, ...(marker ? [marker] : []), '']; + for (const k of [...PLAY_FIELDS, 'whatsNew'] as const) if (f[k] !== undefined && f[k] !== '') parts.push(`### ${PLAY_HEAD[k]}`, fence(f[k]!), ''); + return parts.join('\n') + '\n'; +} + +/** Replaces the section `old` (exact text) with `text`, or appends `text` at the end. */ +export function putSection(md: string, old: string | undefined, text: string): string { + if (old !== undefined) { + const parts = sections(md); + const i = parts.indexOf(old); + // keep what ended the old section (blank lines, a --- rule) + let body = old.replace(/\s+$/, ''); + while (/\n---$/.test(body)) body = body.slice(0, -4).replace(/\s+$/, ''); + const tail = old.slice(body.length); + parts[i] = text.replace(/\s+$/, '') + (tail || '\n'); + return parts.join(''); + } + return md.replace(/\s*$/, '') + '\n\n' + text; +} + +/** Removes the translation marker of one section (after review). */ +export const unmark = (sec: string): string => sec.replace(/^[ \t]*\n/m, ''); + +// ---- keyword rules ---- + +/** App Store keywords: split on commas (also 、,،), trimmed, deduplicated (case-insensitive), words of the name / + * subtitle dropped, joined with "," and cut at whole keywords to fit 100 characters and 100 bytes. Pure. */ +export function normalizeKeywords(text: string, o: { name?: string; subtitle?: string; limit?: number } = {}): { text: string; dropped: { kw: string; why: string }[] } { + const limit = o.limit ?? APPLE_LIMITS.keywords; + const taken = new Set(`${o.name ?? ''} ${o.subtitle ?? ''}`.toLocaleLowerCase().split(/[\s,.:;!?·|/–-]+/).filter(w => w.length > 1)); + const seen = new Set(); + const dropped: { kw: string; why: string }[] = []; + const kept: string[] = []; + for (const raw of text.split(/[,、,،;\n]/)) { + const kw = raw.trim().replace(/\s+/g, ' '); + if (!kw) continue; + const key = kw.toLocaleLowerCase(); + if (seen.has(key)) { dropped.push({ kw, why: 'duplicate' }); continue; } + seen.add(key); + if (taken.has(key)) { dropped.push({ kw, why: 'already in the name or subtitle' }); continue; } + const next = [...kept, kw].join(','); + if (len(next) > limit || Buffer.byteLength(next) > limit) { dropped.push({ kw, why: `over ${limit}` }); continue; } + kept.push(kw); + } + return { text: kept.join(','), dropped }; +} + +export interface FieldCheck { store: 'apple' | 'play'; field: string; chars: number; limit: number; problems: string[] } + +/** Limits and rules of one translated section. `source` = the source language's fields (identical text is flagged). */ +export function checkFields(store: 'apple' | 'play', f: Record, source: Record = {}, status?: TStatus): FieldCheck[] { + const fields = store === 'apple' ? APPLE_FIELDS : PLAY_FIELDS; + const out: FieldCheck[] = []; + for (const k of fields) { + const v = f[k]; + if (v === undefined) continue; + const limit = (FIELD_LIMITS[store] as Record)[k]!; + const c: FieldCheck = { store, field: k, chars: len(v), limit, problems: [] }; + if (len(v) > limit) c.problems.push(`${len(v)} > ${limit} characters`); + if (store === 'apple' && k === 'keywords') { + if (Buffer.byteLength(v) > limit) c.problems.push(`${Buffer.byteLength(v)} bytes > ${limit}`); + if (/,\s|\s,/.test(v)) c.problems.push('spaces around commas'); + const words = v.split(',').map(w => w.trim().toLocaleLowerCase()).filter(Boolean); + const dup = words.filter((w, i) => words.indexOf(w) !== i); + if (dup.length) c.problems.push(`duplicates: ${[...new Set(dup)].join(', ')}`); + if (/,,|^,|,$/.test(v)) c.problems.push('empty keyword'); + } + if (!v.trim() && k !== 'title' && k !== 'name') c.problems.push('empty'); + if (status === 'translate') c.problems.push('not translated yet (status=translate)'); + else if (source[k] !== undefined && v.trim() === source[k]!.trim() && v.trim().length > 12) c.problems.push('identical to the source language'); + out.push(c); + } + return out; +} diff --git a/cli/lib/scan/index.ts b/cli/lib/scan/index.ts index f20d8470..004c7f9a 100644 --- a/cli/lib/scan/index.ts +++ b/cli/lib/scan/index.ts @@ -6,7 +6,8 @@ import { CONFIG_NAMES, loadConfig, type ShipConfig } from '../config'; import { reviewDemoAccount } from '../credentials'; import { proposeDeclarations, type Proposal } from './declare'; import { detectProject, ECO_LABEL, type ProjectFacts, type Stack, where } from './project'; -import { type ScanFinding, scanRules, type Severity } from './rules'; +import type { OriginalityReport } from '../originality'; +import { APPLE_GUIDELINES, type ScanFinding, scanRules, type Severity, sortScan } from './rules'; import type { SdkCategory } from './sdks'; export interface ScanReport { @@ -23,6 +24,8 @@ export interface ScanReport { declarations: Proposal; scanned: number; notes: string[]; + /** `scan --originality`: the 4.3 / repetitive content comparison with the owner's other apps. */ + originality?: { compared: number; flagged: number; threshold: number; pairs: { app: string; folder: string; overall: number; flagged: boolean }[] } | { error: string }; } export interface ScanRun { report: ScanReport; facts: ProjectFacts; config: ShipConfig | null; configPath: string | null } @@ -122,7 +125,34 @@ export function formatScan(r: ScanReport, o: { declarations?: boolean } = {}): s if (d.appPrivacyChange) L.push(` ~ appPrivacy.tracking: ${d.appPrivacyChange.from ?? 'unset'} -> ${d.appPrivacyChange.to}`); } else if (r.config) L.push('', ` No changes to ${r.config}: the dataSafety / appPrivacy blocks already cover what was detected.`); } + if (r.originality) { + if ('error' in r.originality) L.push('', `Originality (4.3): not run: ${r.originality.error}`); + else L.push('', `Originality (4.3 / Play repetitive content): ${r.originality.compared} app(s) compared, ${r.originality.flagged} near-duplicate(s) at ${r.originality.threshold}${r.originality.pairs.length ? ` · ${r.originality.pairs.map(p => `${p.app} ${Math.round(p.overall * 100)}%`).join(', ')}` : ''}`); + } if (r.notes.length) L.push('', ...r.notes.map(n => `note: ${n}`)); - L.push('', 'Checked at review, not by scan: crashes and bugs on the reviewer\'s device, broken links (storebound validate checks the URLs), screenshots that do not match the app, minimum functionality and spam judgement (4.2, 4.3), local law (5.2). See the review-rejections skill.'); + L.push('', 'Checked at review, not by scan: crashes and bugs on the reviewer\'s device, broken links (storebound validate checks the URLs), screenshots that do not match the app, minimum functionality and spam judgement (4.2, 4.3: scan --originality compares your own apps), local law (5.2). See the review-rejections skill.'); return L.join('\n'); } + +/** + * `scan --originality`: the near-duplicates of an originality report as scan findings (App Store 4.3 spam, Google + * Play repetitive content), owner-accepted through `scan.ignore` like every rule (rule id "originality"). Pure. + */ +export function addOriginality(r: ScanReport, o: OriginalityReport, stores: { apple: boolean; play: boolean }, config: ShipConfig | null, rel: (p: string) => string): void { + const ignore = config?.scan?.ignore ?? []; + for (const p of o.pairs.filter(x => x.flagged)) { + const evidence = [{ file: rel(p.other.dir) || '.', line: 1, text: `${p.other.name}: ${Math.round(p.overall * 100)}% overall (${p.reasons.slice(0, 2).join('; ')})` }]; + const fix = `${p.suggestions.slice(0, 2).join(' ') || 'Make the app different in mechanic, content and listing.'} Run storebound originality --against ${rel(p.other.dir) || '.'} for every axis; the portfolio-originality skill has the checklist.`; + const base = { rule: 'originality', severity: 'high' as const, title: `Near-duplicate of your app ${p.other.name} (${Math.round(p.overall * 100)}% similar)`, evidence, fix, skill: 'portfolio-originality' }; + if (stores.apple) r.findings.push({ ...base, guideline: '4.3', store: 'apple', ref: APPLE_GUIDELINES }); + if (stores.play) r.findings.push({ ...base, guideline: 'Play: Repetitive content', store: 'play', ref: 'https://support.google.com/googleplay/android-developer/answer/9898783' }); + } + for (const f of r.findings) if (f.rule === 'originality' && !f.accepted) { + const hit = ignore.find(i => i.rule === f.rule && (!i.store || i.store === f.store)); + if (hit) f.accepted = hit.reason; + } + r.findings = sortScan(r.findings); + r.counts = { blocker: 0, high: 0, medium: 0, low: 0, accepted: 0 }; + for (const f of r.findings) { if (f.accepted) r.counts.accepted++; else r.counts[f.severity]++; } + r.originality = { compared: o.pairs.length, flagged: o.flagged, threshold: o.threshold, pairs: o.pairs.map(p => ({ app: p.other.name, folder: rel(p.other.dir) || '.', overall: Math.round(p.overall * 1000) / 1000, flagged: p.flagged })) }; +} diff --git a/cli/lib/scan/rules.ts b/cli/lib/scan/rules.ts index bdd3615b..f2263199 100644 --- a/cli/lib/scan/rules.ts +++ b/cli/lib/scan/rules.ts @@ -5,7 +5,7 @@ // // Sources, checked 2026-10-11: // - Apple App Review Guidelines: https://developer.apple.com/app-store/review/guidelines/ -// 2.1(a) app completeness (demo account, placeholder text), 2.3.7 metadata (names, keywords, no prices or other +// 2.1(a) app completeness (demo account, placeholder text), 2.2 betas, demos and trial versions (TestFlight), 2.3.7 metadata (names, keywords, no prices or other // apps' names), 2.3.8 ("For Kids" is reserved for the Kids Category), 2.3.10 other mobile platforms, 2.5.1 public // APIs, 2.5.5 IPv6-only networks, 3.1.1 restore mechanism, 3.1.2(c) subscription information (+ Schedule 2 of the // Developer Program License Agreement: Terms of Use and privacy policy links), 4.2 minimum functionality @@ -324,6 +324,19 @@ export function scanRules(inp: ScanInput): ScanFinding[] { const stuffed = listingHits(inp.listings.apple, /^([^,|]{1,24}[,|]){5,}/, { field: /^(name|subtitle)$/ }); if (stuffed.length) add({ rule: 'metadata-keywords', guideline: '2.3.7', store: 'apple', severity: 'medium', title: 'Keyword list in the name or subtitle', evidence: stuffed.slice(0, 2), fix: 'Name and subtitle are a short phrase; keywords belong in the keywords field.', skill: 'aso-basics' }); + // 2.2: demos, betas and trial versions belong on TestFlight, not on the App Store (the name and the listing say so) + 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}`)); + 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}` }); + } + const betaText = listingHits(inp.listings.apple, BETA, { field: /^(name|subtitle|promotionalText|keywords|description)$/ }) + .filter(h => !/\bdemo account\b|\bdemo (video|mode)\b/i.test(h.text)); + if (betaName.length || betaText.length) + add({ rule: 'beta-wording', guideline: '2.2', store: 'apple', severity: betaName.length ? 'high' : 'medium', title: '"Beta", "demo", "trial" or "test" wording in the app name or App Store text', evidence: [...betaName, ...betaText].slice(0, 4), + fix: 'Apple 2.2: demos, betas and trial versions do not belong on the App Store (use TestFlight). Remove the word from the name, subtitle, keywords and description; a free tier or a trial of a subscription is fine when it is described as such ("free trial of Pro").', skill: 'review-rejections' }); const kids = [...listingHits(inp.listings.apple, /\bfor (kids|children|toddlers)\b/i), ...listingHits(inp.listings.captions, /\bfor (kids|children|toddlers)\b/i, { fenced: false })]; const kidsBand = c?.apple?.info?.ageRating?.kidsAgeBand; if (kids.length && !kidsBand) diff --git a/cli/lib/subscriptions.ts b/cli/lib/subscriptions.ts index 8dcee0a6..70ac790d 100644 --- a/cli/lib/subscriptions.ts +++ b/cli/lib/subscriptions.ts @@ -19,7 +19,7 @@ import type { IntroOffer, Language, OfferCodeDef, PriceOverride, Subscription, SubscriptionGroup, SubscriptionOfferDef, SubscriptionPeriod } from './config'; import { playCodes } from './config'; import { ALPHA3, fromMoney, type Money, toMoney } from './money'; -import type { PriceRow } from './prices'; +import { alpha2, type PriceRow } from './prices'; // ---- mappings ---- @@ -505,3 +505,16 @@ export function pickPoint(points: ApplePoint[], territory: string, price: number const near = [...inT].sort((a, b) => Math.abs(a.price - price) - Math.abs(b.price - price)).slice(0, 3).map(p => p.price); throw new Error(`${territory} has no subscription price point ${price}${near.length ? ` (nearest ${near.join(', ')})` : ''}`); } + +// ---- the prices sheet (storebound prices export) ---- + +/** App Store prices of one subscription (in effect today + scheduled) as price sheet rows. Pure. */ +export function appleSubPriceRows(product: string, resp: JsonApi, today?: string): PriceRow[] { + return appleSubPrices(resp, today).map(p => ({ product, store: 'apple' as const, region: alpha2(p.territory), territory: p.territory, currency: p.currency ?? '', price: p.price, ...(p.startDate ? { startDate: p.startDate } : {}) })); +} + +/** Google Play regional prices of one subscription's base plan as price sheet rows. Pure. */ +export function playSubPriceRows(sub: PlaySubscription, basePlan: string): PriceRow[] { + const bp = sub.basePlans?.find(b => b.basePlanId === basePlan) ?? sub.basePlans?.[0]; + return (bp?.regionalConfigs ?? []).filter(r => r.price).map(r => ({ product: sub.productId, store: 'play' as const, region: r.regionCode, currency: r.price!.currencyCode, price: fromMoney(r.price!) })); +} diff --git a/cli/lib/template-files.ts b/cli/lib/template-files.ts index 45ca37e2..7610c67b 100644 --- a/cli/lib/template-files.ts +++ b/cli/lib/template-files.ts @@ -26,6 +26,10 @@ import t21 from '../../templates/testers.csv' with { type: 'text' }; import tWebAppstore from '../../templates/web/appstore.svg' with { type: 'text' }; import tWebGoogleplay from '../../templates/web/googleplay.svg' with { type: 'text' }; import tWebLanding from '../../templates/web/landing.html' with { type: 'text' }; +import tWfAppRelease from '../../templates/profiles/app/workflows/release.yml' with { type: 'text' }; +import tWfAppBeta from '../../templates/profiles/app/workflows/beta.yml' with { type: 'text' }; +import tWfRelease from '../../templates/workflows/release.yml' with { type: 'text' }; +import tWfBeta from '../../templates/workflows/beta.yml' with { type: 'text' }; /** Template text by its path under templates/ (forward slashes). */ export const TEMPLATE_TEXT: Record = { @@ -54,4 +58,8 @@ export const TEMPLATE_TEXT: Record = { 'web/appstore.svg': tWebAppstore as unknown as string, 'web/googleplay.svg': tWebGoogleplay as unknown as string, 'web/landing.html': tWebLanding as unknown as string, + 'profiles/app/workflows/release.yml': tWfAppRelease as unknown as string, + 'profiles/app/workflows/beta.yml': tWfAppBeta as unknown as string, + 'workflows/release.yml': tWfRelease as unknown as string, + 'workflows/beta.yml': tWfBeta as unknown as string, }; diff --git a/cli/lib/yaml.ts b/cli/lib/yaml.ts new file mode 100644 index 00000000..d6ea4efd --- /dev/null +++ b/cli/lib/yaml.ts @@ -0,0 +1,171 @@ +// A small YAML subset reader for repo-local files (store/workflows/*.yml), so storebound stays at zero runtime +// dependencies. Pure. Supported: block maps (`key: value`), block lists (`- item`, `- key: value` with the rest of the +// map indented below), nested by indentation (spaces only), plain / 'single' / "double" quoted scalars, inline lists +// `[a, b]`, `#` comments, `|` and `>` block scalars, true / false / null / numbers. Not supported (an error names the +// line): anchors, aliases, tags, multi-document files, inline maps `{...}`, tabs for indentation. + +export type YamlValue = string | number | boolean | null | YamlValue[] | { [k: string]: YamlValue }; + +interface Line { n: number; indent: number; text: string } + +function stripComment(s: string): string { + let q: string | null = null; + for (let i = 0; i < s.length; i++) { + const c = s[i]!; + if (q) { if (c === q && !(q === '"' && s[i - 1] === '\\')) q = null; continue; } + if (c === '"' || c === '\'') { if (i === 0 || /[\s:[,-]/.test(s[i - 1]!)) q = c; continue; } + if (c === '#' && (i === 0 || /\s/.test(s[i - 1]!))) return s.slice(0, i).trimEnd(); + } + return s.trimEnd(); +} + +function scalar(raw: string, n: number): YamlValue { + const s = raw.trim(); + if (s === '' || s === '~' || s === 'null') return s === '' ? '' : null; + if (s.startsWith('"')) { + if (!s.endsWith('"') || s.length < 2) throw new Error(`line ${n}: unterminated "string"`); + try { return JSON.parse(s) as string; } catch { throw new Error(`line ${n}: bad "string"`); } + } + if (s.startsWith('\'')) { + if (!s.endsWith('\'') || s.length < 2) throw new Error(`line ${n}: unterminated 'string'`); + return s.slice(1, -1).replace(/''/g, '\''); + } + if (s.startsWith('[')) { + if (!s.endsWith(']')) throw new Error(`line ${n}: unterminated [list]`); + const inner = s.slice(1, -1).trim(); + if (!inner) return []; + const parts: string[] = []; + let q: string | null = null, cur = ''; + for (const c of inner) { + if (q) { cur += c; if (c === q) q = null; continue; } + if (c === '"' || c === '\'') { q = c; cur += c; continue; } + if (c === ',') { parts.push(cur); cur = ''; continue; } + cur += c; + } + parts.push(cur); + return parts.map(p => scalar(p, n)); + } + if (s.startsWith('{')) throw new Error(`line ${n}: inline maps {...} are not supported; use one key per line`); + if (/^[&*!]/.test(s)) throw new Error(`line ${n}: anchors, aliases and tags are not supported`); + if (s === 'true') return true; + if (s === 'false') return false; + if (/^-?\d+(\.\d+)?$/.test(s) && !/^0\d/.test(s)) return Number(s); + return s; +} + +/** Index of the `:` that separates a map key from its value (outside quotes), or -1. */ +function keyColon(s: string): number { + let q: string | null = null; + for (let i = 0; i < s.length; i++) { + const c = s[i]!; + if (q) { if (c === q) q = null; continue; } + if ((c === '"' || c === '\'') && i === 0) { q = c; continue; } + if (c === ':' && (i === s.length - 1 || s[i + 1] === ' ')) return i; + } + return -1; +} + +export function parseYaml(text: string): YamlValue { + const lines: Line[] = []; + const raw = text.replace(/\r\n?/g, '\n').split('\n'); + for (let i = 0; i < raw.length; i++) { + const l = raw[i]!; + if (/^\t/.test(l) || /^ *\t/.test(l)) throw new Error(`line ${i + 1}: tabs are not allowed for indentation`); + if (/^(---|\.\.\.)\s*$/.test(l)) { if (lines.length) throw new Error(`line ${i + 1}: one document per file`); continue; } + lines.push({ n: i + 1, indent: l.length - l.trimStart().length, text: l.trim() }); + } + let pos = 0; + const content = (l: Line) => l.text !== '' && !l.text.startsWith('#'); + const skip = () => { while (pos < lines.length && !content(lines[pos]!)) pos++; }; + + /** Block scalar (| or >) below a key at `parentIndent`. */ + function block(style: string, parentIndent: number): string { + const out: string[] = []; + let ind = -1; + while (pos < lines.length) { + const l = lines[pos]!; + const rawLine = raw[l.n - 1]!; + if (l.text === '') { out.push(''); pos++; continue; } + if (l.indent <= parentIndent) break; + if (ind < 0) ind = l.indent; + out.push(rawLine.slice(Math.min(ind, l.indent))); + pos++; + } + while (out.length && out[out.length - 1] === '') out.pop(); + const keep = style.endsWith('-') ? '' : '\n'; + return (style.startsWith('>') ? out.join('\n').replace(/([^\n])\n(?=[^\n])/g, '$1 ') : out.join('\n')) + (out.length ? keep : ''); + } + + function value(indent: number): YamlValue { + skip(); + if (pos >= lines.length) return null; + const first = lines[pos]!; + if (first.indent < indent) return null; + return first.text.startsWith('- ') || first.text === '-' ? list(first.indent) : map(first.indent); + } + + function entry(rest: string, n: number, ownIndent: number): [string, YamlValue] { + const c = keyColon(rest); + if (c < 0) throw new Error(`line ${n}: expected "key: value"`); + const key = String(scalar(rest.slice(0, c), n)); + const v = stripComment(rest.slice(c + 1)).trim(); + if (v === '') { + skip(); + const next = lines[pos]; + // a list may sit at the key's own indentation ("steps:\n- id: a") + if (next && next.indent === ownIndent && (next.text.startsWith('- ') || next.text === '-')) return [key, list(ownIndent)]; + return [key, value(ownIndent + 1) ?? null]; + } + if (/^[|>][+-]?$/.test(v)) return [key, block(v, ownIndent)]; + return [key, scalar(v, n)]; + } + + function map(indent: number): { [k: string]: YamlValue } { + const out: { [k: string]: YamlValue } = {}; + for (;;) { + skip(); + if (pos >= lines.length) break; + const l = lines[pos]!; + if (l.indent < indent) break; + if (l.indent > indent) throw new Error(`line ${l.n}: unexpected indentation`); + if (l.text.startsWith('- ')) throw new Error(`line ${l.n}: a list item where a "key: value" was expected`); + pos++; + const [k, v] = entry(stripComment(l.text), l.n, indent); + if (k in out) throw new Error(`line ${l.n}: "${k}" twice`); + out[k] = v; + } + return out; + } + + function list(indent: number): YamlValue[] { + const out: YamlValue[] = []; + for (;;) { + skip(); + if (pos >= lines.length) break; + const l = lines[pos]!; + if (l.indent < indent) break; + if (l.indent > indent) throw new Error(`line ${l.n}: expected a list item "- ..."`); + if (!(l.text.startsWith('- ') || l.text === '-')) break; + pos++; + const rest = stripComment(l.text.slice(1)).trim(); + if (rest === '') { out.push(value(indent + 1)); continue; } + const itemIndent = indent + (l.text.length - l.text.slice(1).trimStart().length); + if (keyColon(rest) >= 0 && !/^["'[]/.test(rest)) { + // "- key: value" starts a map whose other keys are indented to the item's text column + const [k, v] = entry(rest, l.n, itemIndent); + const m: { [k: string]: YamlValue } = { [k]: v }; + skip(); + if (pos < lines.length && lines[pos]!.indent === itemIndent && !lines[pos]!.text.startsWith('- ')) { + for (const [k2, v2] of Object.entries(map(itemIndent))) { if (k2 in m) throw new Error(`line ${l.n}: "${k2}" twice`); m[k2] = v2; } + } + out.push(m); + } else out.push(scalar(rest, l.n)); + } + return out; + } + + const v = value(0); + skip(); + if (pos < lines.length) throw new Error(`line ${lines[pos]!.n}: unexpected content`); + return v; +} diff --git a/cli/listing.ts b/cli/listing.ts new file mode 100644 index 00000000..b1d59a18 --- /dev/null +++ b/cli/listing.ts @@ -0,0 +1,214 @@ +// Listing localization: translation drafts of the listing fields in both listing files (rules: lib/listing-translate.ts). +// storebound listing translate --to de-DE,ja [--from en-US] [--store apple|play] [--translate ""] [--force] [--dry] [--json] +// per target language: the App Store section (name, subtitle, promotionalText, keywords, description) in +// store/appstore.md and the Play section (title, short, full) in store/listing.md. Without --translate the source +// text is copied in with status=translate for your agent to translate in place (listing-localization skill); with +// --translate your command runs once per field with the source text on stdin and STOREBOUND_SOURCE_LANG, +// STOREBOUND_TARGET_LANG, STOREBOUND_STORE, STOREBOUND_FIELD, STOREBOUND_LIMIT in the environment; its stdout is +// the translation (status=draft). Keywords are cleaned up (commas, duplicates, name / subtitle words, 100 limit). +// Reviewed sections (no marker) are kept unless --force; a section's What's new is kept. +// storebound listing check [--json] limits, keyword rules, untranslated and draft sections; exit 1 on a problem +// storebound listing reviewed --lang de-DE[,ja] | --all [--dry] a human read the draft: remove its marker +// --to / --from / --lang take config language ids, App Store locales or Play codes. Local files only: nothing is sent +// to a store (apple listing / play listing push them after `storebound check`). +import { existsSync, readFileSync, writeFileSync } from 'node:fs'; +import type { Language } from './lib/config'; +import { playCodes } from './lib/config'; +import type { Ctx } from './lib/ctx'; +import { done, log, printJson, warn } from './lib/log'; +import { + APPLE_FIELDS, appleFields, appleLocaleOf, appleSectionText, checkFields, FIELD_LIMITS, type FieldCheck, findAppleSection, findPlaySection, mark, + markerOf, normalizeKeywords, PLAY_FIELDS, playCodesOf, playFields, playSectionText, putSection, sections, unmark, +} from './lib/listing-translate'; +import { textTable } from './lib/table'; +import { resolveLanguages } from './lib/whats-new'; + +const TAG = 'listing'; +const storeCode = (l: Language): string => l.apple ?? playCodes(l)[0] ?? l.id; + +interface Files { apple?: { path: string; md: string }; play?: { path: string; md: string } } + +function readFiles(ctx: Ctx, store?: string): Files { + const { config, resolve } = ctx.loaded; + const out: Files = {}; + if (config.apple && store !== 'play') { const p = resolve(config.apple.listing ?? 'store/appstore.md'); if (existsSync(p)) out.apple = { path: p, md: readFileSync(p, 'utf8') }; else warn(TAG, `${p} missing: App Store skipped`); } + if (config.play && store !== 'apple') { const p = resolve(config.play.listing ?? 'store/listing.md'); if (existsSync(p)) out.play = { path: p, md: readFileSync(p, 'utf8') }; else warn(TAG, `${p} missing: Google Play skipped`); } + if (!out.apple && !out.play) throw new Error('no listing file to work on (store/appstore.md, store/listing.md; storebound init creates them)'); + return out; +} + +function sourceLanguage(ctx: Ctx): Language { + const { config } = ctx.loaded; + const want = ctx.args.get('from'); + if (want) return resolveLanguages(config.languages, [want])[0]!; + const primary = config.apple?.primaryLocale ?? config.play?.defaultLanguage; + return config.languages.find(l => l.apple === primary || playCodes(l).includes(primary ?? '')) ?? config.languages[0]!; +} + +interface Row { lang: string; store: 'apple' | 'play'; action: string; checks: FieldCheck[] } + +async function translate(ctx: Ctx): Promise { + const { config } = ctx.loaded; + const a = ctx.args; + const store = a.get('store'); + if (store && store !== 'apple' && store !== 'play') throw new Error('--store apple | play'); + const targets = resolveLanguages(config.languages, a.list('to')); + if (!targets.length) throw new Error('--to : config language ids, App Store locales or Play codes (add a language to languages[] in the config first)'); + const src = sourceLanguage(ctx); + const files = readFiles(ctx, store); + const hook = a.get('translate'); + const dry = a.has('dry'); + const rows: Row[] = []; + const runHook = (text: string, l: Language, st: 'apple' | 'play', field: string, limit: number): string | null => { + const r = Bun.spawnSync(['sh', '-c', hook!], { stdin: new TextEncoder().encode(text), stdout: 'pipe', stderr: 'pipe', + env: { ...process.env, STOREBOUND_SOURCE_LANG: storeCode(src), STOREBOUND_TARGET_LANG: st === 'apple' ? l.apple ?? l.id : playCodes(l)[0] ?? l.id, STOREBOUND_TARGET_LANG_ID: l.id, + STOREBOUND_STORE: st, STOREBOUND_FIELD: field, STOREBOUND_LIMIT: String(limit) } }); + const out = r.stdout.toString().trim(); + if (r.exitCode !== 0 || !out) { warn(TAG, `${l.id} ${st}.${field}: --translate failed (exit ${r.exitCode}): ${r.stderr.toString().trim().slice(0, 200)}`); return null; } + return out; + }; + + for (const l of targets) { + if (l === src) { warn(TAG, `${l.id} is the source language: skipped`); continue; } + // ---- App Store ---- + if (files.apple && l.apple && src.apple) { + const srcSec = findAppleSection(files.apple.md, src.apple); + const cur = findAppleSection(files.apple.md, l.apple); + if (!srcSec) warn(TAG, `${files.apple.path}: no ${src.apple} section to translate from`); + else if (cur && !markerOf(cur) && !a.has('force')) rows.push({ lang: l.id, store: 'apple', action: 'kept (reviewed; --force replaces it)', checks: [] }); + else { + const s = appleFields(srcSec); + const f: Record = {}; + let failed = false; + for (const k of APPLE_FIELDS) { + if (s[k] === undefined) continue; + if (hook && !dry) { const t = runHook(s[k]!, l, 'apple', k, FIELD_LIMITS.apple[k]); if (t === null) failed = true; f[k] = t ?? s[k]!; } + else f[k] = s[k]!; + } + const status = hook && !dry && !failed ? 'draft' : 'translate'; + if (f.keywords && status === 'draft') { + const n = normalizeKeywords(f.keywords, { name: f.name, subtitle: f.subtitle }); + for (const d of n.dropped) log(TAG, `${l.apple} keywords: dropped "${d.kw}" (${d.why})`); + f.keywords = n.text; + } + const keep = cur ? appleFields(cur).whatsNew : undefined; + const text = appleSectionText(l.apple, l.id, { ...f, ...(keep ? { whatsNew: keep } : {}) }, mark(src.apple, status)); + files.apple.md = putSection(files.apple.md, cur, text); + rows.push({ lang: l.id, store: 'apple', action: `${cur ? 'replaced' : 'added'} (status=${status})`, checks: checkFields('apple', f, s, status) }); + } + } + // ---- Google Play ---- + const codes = playCodes(l), srcCodes = playCodes(src); + if (files.play && codes.length && srcCodes.length) { + const srcSec = findPlaySection(files.play.md, srcCodes); + const cur = findPlaySection(files.play.md, codes); + if (!srcSec) warn(TAG, `${files.play.path}: no ${srcCodes.join(', ')} section to translate from`); + else if (cur && !markerOf(cur) && !a.has('force')) rows.push({ lang: l.id, store: 'play', action: 'kept (reviewed; --force replaces it)', checks: [] }); + else { + const s = playFields(srcSec); + const f: Record = {}; + let failed = false; + for (const k of PLAY_FIELDS) { + if (s[k] === undefined) continue; + if (hook && !dry) { const t = runHook(s[k]!, l, 'play', k, FIELD_LIMITS.play[k]); if (t === null) failed = true; f[k] = t ?? s[k]!; } + else f[k] = s[k]!; + } + const status = hook && !dry && !failed ? 'draft' : 'translate'; + const keep = cur ? playFields(cur).whatsNew : undefined; + // the section keeps serving every Play code it served (es-ES, es-419), plus the language's own + const allCodes = [...new Set([...(cur ? playCodesOf(cur) : []), ...codes])]; + const text = playSectionText(allCodes, l.id, { ...f, ...(keep ? { whatsNew: keep } : {}) }, mark(srcCodes[0]!, status)); + files.play.md = putSection(files.play.md, cur, text); + rows.push({ lang: l.id, store: 'play', action: `${cur ? 'replaced' : 'added'} (status=${status})`, checks: checkFields('play', f, s, status) }); + } + } + } + const problemsOf = (r: Row) => r.checks.flatMap(c => c.problems.filter(p => !p.startsWith('not translated')).map(p => `${c.field}: ${p}`)); + if (a.has('json')) printJson({ source: src.id, dryRun: dry, hook: !!hook, files: { apple: files.apple?.path ?? null, play: files.play?.path ?? null }, results: rows.map(r => ({ ...r, problems: problemsOf(r) })) }); + else { + console.log(textTable(['language', 'store', 'section', 'fields', 'problems'], rows.map(r => [r.lang, r.store === 'apple' ? 'App Store' : 'Google Play', r.action, + r.checks.map(c => `${c.field} ${c.chars}/${c.limit}`).join(', '), problemsOf(r).join('; ')]))); + } + const json = a.has('json'); + if (dry) { if (!json) done(TAG, 'dry run: listing files not written'); return; } + if (files.apple) writeFileSync(files.apple.path, files.apple.md); + if (files.play) writeFileSync(files.play.path, files.play.md); + if (json) return; + const todo = rows.filter(r => r.action.includes('status=translate')).length; + done(TAG, todo ? `${todo} section(s) to translate in place (keep the marker line, set status=draft), then storebound listing check` : 'drafts written: review them, storebound listing check, then storebound listing reviewed --lang '); +} + +interface SecReport { file: string; store: 'apple' | 'play'; lang: string; status: 'reviewed' | 'translate' | 'draft'; from: string | null; checks: FieldCheck[] } + +function report(files: Files): SecReport[] { + const out: SecReport[] = []; + if (files.apple) for (const sec of sections(files.apple.md)) { + const loc = appleLocaleOf(sec); + if (!loc) continue; + const m = markerOf(sec); + const srcSec = m ? findAppleSection(files.apple.md, m.from) : undefined; + out.push({ file: files.apple.path, store: 'apple', lang: loc, status: m?.status ?? 'reviewed', from: m?.from ?? null, checks: checkFields('apple', appleFields(sec), srcSec ? appleFields(srcSec) : {}, m?.status) }); + } + if (files.play) for (const sec of sections(files.play.md)) { + const codes = playCodesOf(sec); + if (!codes.length) continue; + const m = markerOf(sec); + const srcSec = m ? findPlaySection(files.play.md, [m.from]) : undefined; + out.push({ file: files.play.path, store: 'play', lang: codes.join(', '), status: m?.status ?? 'reviewed', from: m?.from ?? null, checks: checkFields('play', playFields(sec), srcSec ? playFields(srcSec) : {}, m?.status) }); + } + return out; +} + +function check(ctx: Ctx): void { + const files = readFiles(ctx); + const r = report(files); + const bad = r.filter(x => x.checks.some(c => c.problems.length)); + const drafts = r.filter(x => x.status === 'draft'); + if (ctx.args.has('json')) printJson({ sections: r, ok: !bad.length, drafts: drafts.map(d => `${d.store}:${d.lang}`) }); + else { + console.log(textTable(['store', 'language', 'status', 'fields', 'problems'], r.map(x => [x.store === 'apple' ? 'App Store' : 'Google Play', x.lang, + x.status === 'draft' ? 'DRAFT (review)' : x.status === 'translate' ? 'TO TRANSLATE' : 'reviewed', x.checks.map(c => `${c.field} ${c.chars}/${c.limit}`).join(', '), + x.checks.flatMap(c => c.problems.map(p => `${c.field}: ${p}`)).join('; ')]))); + if (drafts.length) warn(TAG, `${drafts.length} machine-translated draft(s) not reviewed yet: ${drafts.map(d => `${d.store}:${d.lang}`).join(', ')} (storebound listing reviewed --lang after reading them)`); + done(TAG, bad.length ? `${bad.length} section(s) with problems` : `${r.length} section(s) within the store limits`); + } + if (bad.length) process.exitCode = 1; +} + +function reviewed(ctx: Ctx): void { + const { config } = ctx.loaded; + const a = ctx.args; + const files = readFiles(ctx); + const all = a.has('all'); + const langs = all ? [] : resolveLanguages(config.languages, a.list('lang')); + if (!all && !langs.length) throw new Error('--lang | --all'); + const changed: string[] = [], refused: string[] = []; + const pick = (sec: string, store: 'apple' | 'play'): boolean => { + if (all) return true; + return store === 'apple' ? langs.some(l => l.apple && appleLocaleOf(sec) === l.apple) : langs.some(l => playCodes(l).some(c => playCodesOf(sec).includes(c))); + }; + for (const store of ['apple', 'play'] as const) { + const f = files[store]; + if (!f) continue; + f.md = sections(f.md).map(sec => { + const m = markerOf(sec); + if (!m || !pick(sec, store)) return sec; + const label = `${store}:${store === 'apple' ? appleLocaleOf(sec) : playCodesOf(sec).join(',')}`; + if (m.status === 'translate') { refused.push(label); return sec; } + changed.push(label); + return unmark(sec); + }).join(''); + } + for (const r of refused) warn(TAG, `${r}: still status=translate (translate it first)`); + if (a.has('dry')) { done(TAG, `dry run: would mark ${changed.length} section(s) reviewed: ${changed.join(', ') || 'none'}`); return; } + for (const store of ['apple', 'play'] as const) if (files[store]) writeFileSync(files[store]!.path, files[store]!.md); + done(TAG, `${changed.length} section(s) marked reviewed${changed.length ? `: ${changed.join(', ')}` : ''}`); +} + +export async function run(ctx: Ctx): Promise { + const sub = ctx.args._[0]; + if (sub === 'translate') return translate(ctx); + if (sub === 'check') return check(ctx); + if (sub === 'reviewed') return reviewed(ctx); + throw new Error('usage: storebound listing translate --to [--from ] [--translate ""] [--dry] | check | reviewed --lang '); +} diff --git a/cli/mcp-tools.ts b/cli/mcp-tools.ts index b9adbac3..e43bbe0f 100644 --- a/cli/mcp-tools.ts +++ b/cli/mcp-tools.ts @@ -41,8 +41,10 @@ export const TOOLS: ToolDef[] = [ args: i => ['--aso', ...opt('storefront', i.storefront)] }, { name: 'scan', title: 'Rejection-risk scan of the project', command: ['scan'], write: false, network: false, description: 'Offline, read-only scan of the project itself before submitting: detects the stack (iOS, Android, React Native, Expo, Capacitor, Cordova, Flutter, Unity, Godot) and SDKs (ads, analytics, crash, sign-in, payments, push) with versions and file:line, then reports App Store and Google Play rejection risks with the guideline, evidence, fix, severity and skill (demo account 2.1, account deletion 5.1.1(v), Sign in with Apple 4.8, Restore Purchases 3.1.1, subscription info 3.1.2, ATT 5.1.2, purpose strings, privacy manifest, other platforms 2.3.10, keywords 2.3.7, placeholder text, web wrappers 4.2, UIWebView, ATS, IPv6, export compliance, kids ads, Play target SDK, delete-account URL, restricted permissions and their declarations (background location, photo / video, All files access, accessibility, install packages, Health Connect, full-screen intent, VPN, foreground services, exact alarms, QUERY_ALL_PACKAGES, SMS / call log), prominent disclosure, Families, AD_ID, 16 KB page sizes, testing for personal accounts, Play metadata, ads at launch, payments, impersonation) and proposes the Data safety / App Privacy / ATT / privacy manifest answers as a diff against the config. Never writes (the owner runs `storebound scan --write` in a terminal).', - props: { store: { type: 'string', enum: ['apple', 'play'], description: 'Only this store\'s findings (default: both)' } }, - args: i => opt('store', i.store) }, + props: { store: { type: 'string', enum: ['apple', 'play'], description: 'Only this store\'s findings (default: both)' }, + originality: { type: 'boolean', default: false, description: 'Also the 4.3 / Play repetitive content check against your other apps (folders from against, else originality.against in the config)' }, + against: { type: 'string', description: 'Comma-separated folders of your other apps (with originality)' } }, + args: i => [...opt('store', i.store), ...flag('originality', i.originality), ...(i.originality ? opt('against', i.against) : [])] }, { name: 'validate', title: 'Store readiness report', command: ['validate'], write: false, network: true, description: 'Read-only readiness report for App Store Connect and/or Google Play with ordered blockers (build, encryption, metadata, screenshots, review details and demo account, age rating, prices, IAPs, subscriptions, privacy, delete-account and terms URLs, app-ads.txt, tracks, products, base plans).', props: { store: { type: 'string', enum: ['both', 'apple', 'play'], default: 'both' } }, @@ -283,6 +285,18 @@ export const TOOLS: ToolDef[] = [ no_validate: { type: 'boolean', default: false, description: 'Skip the store readiness read' }, json: { type: 'boolean', default: false } }, required: ['version'], args: i => [String(i.version), ...opt('app', i.app), ...flag('no-validate', i.no_validate), ...flag('json', i.json)] }, + { name: 'flow_list', title: 'Repo-local workflows', command: ['flow', 'list'], write: false, network: false, + description: 'The named workflows of this project (store/workflows/*.yml, storebound.workflows.*) with their params and steps, each step classified as read, write (runs as a dry run), wait, shell or "your click" (owner steps such as Submit for Review, never run).', + args: () => ['--json'] }, + { name: 'flow_run', title: 'Run a workflow as a dry run', command: ['flow', 'run'], write: false, network: true, + description: 'Run one workflow step by step: read steps run, every write step runs with --dry (nothing changes on a store or in files), wait steps check once, shell steps are skipped, owner steps are listed as the owner\'s clicks. plan_only shows the plan without running anything. Running the writes for real is a terminal command the owner runs (storebound flow run --apply).', + props: { name: { type: 'string', pattern: '^[a-z0-9][a-z0-9._-]{0,62}$', description: 'Flow name (flow_list)' }, + params: { type: 'object', additionalProperties: { type: 'string' }, description: 'Flow params, e.g. {"VERSION": "1.2.0"}' }, + from: { type: 'string', pattern: '^[a-z0-9][a-z0-9._-]{0,62}$', description: 'Start at this step id' }, + plan_only: { type: 'boolean', default: false } }, + required: ['name'], + args: i => [String(i.name), ...Object.entries((i.params ?? {}) as Record).filter(([k]) => /^[A-Z][A-Z0-9_]{0,40}$/.test(k)).map(([k, v]) => `${k}=${String(v)}`), ...opt('from', i.from), ...flag('dry', i.plan_only), '--json'] }, + // ---- store operations (read-only plans, local pulls and reports; submits, codes, offers and pre-orders stay terminal-only) ---- { name: 'apple_testflight_wait', title: 'Wait for a TestFlight build', command: ['apple', 'testflight', 'wait'], write: false, network: true, description: 'Poll one uploaded build (exact number) until processing ends: exit 0 VALID, 1 FAILED / INVALID, 7 timeout. Read-only. check_once reads the state once without waiting.', @@ -313,6 +327,14 @@ export const TOOLS: ToolDef[] = [ { name: 'whats_new_apply', title: 'Apply release notes per language', command: ['whats-new', 'apply'], write: true, network: false, idempotent: true, description: 'Write the checked per-language release notes into both listing files (Play "What\'s new" per Play code, App Store whatsNew per locale). Refuses while a language is over a limit or untranslated. Local files only; nothing is sent to a store.', args: () => ['--json'] }, + { name: 'listing_translate', title: 'Listing translation drafts', command: ['listing', 'translate'], write: true, network: false, idempotent: true, + description: 'Add a section per target language to both listing files (App Store: name, subtitle, promotionalText, keywords, description; Google Play: title, short, full) with the source language\'s text and a status=translate marker. Then translate each field in place within the store limits (App Store subtitle 30, promotional text 170, keywords 100 comma-separated without duplicates or name words, description 4000; Play title 30, short 80, full 4000), set the marker to status=draft and run listing_check. The owner reviews the drafts (storebound listing reviewed). Reviewed sections are kept. Local files only.', + props: { to: { type: 'string', pattern: '^[A-Za-z0-9_-]+(,[A-Za-z0-9_-]+)*$', description: 'Comma-separated target languages (config ids, App Store locales or Play codes)' }, + from: { type: 'string', pattern: '^[A-Za-z0-9_-]+$', description: 'Source language (default: the primary one)' }, store: { type: 'string', enum: ['apple', 'play'] } }, + required: ['to'], args: i => [...opt('to', i.to), ...opt('from', i.from), ...opt('store', i.store), '--json'] }, + { name: 'listing_check', title: 'Check listing translations', command: ['listing', 'check'], write: false, network: false, + description: 'Offline: every language section of both listing files against the store limits and keyword rules, with untranslated (status=translate) and unreviewed machine-translated (status=draft) sections.', + args: () => ['--json'] }, { name: 'reports', title: 'Sales and finance reports', command: ['reports'], write: true, network: true, idempotent: true, description: 'Download a sales or finance report into .storebound/reports/ (gitignored) and print a summary per product and currency (amounts never added across currencies) plus a summary CSV. Apple needs ASC_VENDOR_NUMBER and a team key; Play needs play.reportsBucket and "View financial data". dry_run shows the request only.', props: { kind: { type: 'string', enum: ['apple-sales', 'apple-finance', 'play-earnings', 'play-sales'] }, month: { type: 'string', pattern: '^\\d{4}-\\d{2}$', description: 'YYYY-MM (apple-finance: Apple fiscal month; Play reports)' }, diff --git a/cli/originality.ts b/cli/originality.ts index 249c2398..4266a0a8 100644 --- a/cli/originality.ts +++ b/cli/originality.ts @@ -7,35 +7,42 @@ // (mechanic, content, differentiator sentence) is the portfolio-originality skill. import { realpathSync } from 'node:fs'; import { relative } from 'node:path'; -import { loadConfig } from './lib/config'; +import { loadConfig, type ShipConfig } from './lib/config'; import type { Ctx } from './lib/ctx'; import { done, log, printJson, warn } from './lib/log'; -import { DEFAULT_THRESHOLD, findApps, fingerprint, report } from './lib/originality'; +import { type AppFingerprint, DEFAULT_THRESHOLD, findApps, fingerprint, type OriginalityReport, report } from './lib/originality'; import { textTable } from './lib/table'; const TAG = 'originality'; -export async function run(ctx: Ctx): Promise { - const { config, root, resolve } = ctx.loaded; - const a = ctx.args; - const folders = (a.list('against').length ? a.list('against') : config.originality?.against ?? []).map(f => resolve(f)); +/** The 4.3 comparison of one app against the apps in `against` (also used by `storebound scan --originality`). */ +export async function compareAgainst(o: { config: ShipConfig; root: string; resolve(p: string): string }, against: string[], thresholdArg?: number, onSkip: (msg: string) => void = () => {}): Promise<{ report: OriginalityReport; me: AppFingerprint; others: number }> { + const { config, root, resolve } = o; + const folders = (against.length ? against : config.originality?.against ?? []).map(f => resolve(f)); if (!folders.length) throw new Error('nothing to compare with: --against (or originality.against in the config)'); - const threshold = a.has('threshold') ? a.num('threshold', DEFAULT_THRESHOLD) : config.originality?.threshold ?? DEFAULT_THRESHOLD; + const threshold = thresholdArg ?? config.originality?.threshold ?? DEFAULT_THRESHOLD; if (!(threshold > 0 && threshold < 1)) throw new Error('--threshold: between 0 and 1'); const self = realpathSync(root); const configs = findApps(folders.map(f => { try { return realpathSync(f); } catch { return f; } }), self); if (!configs.length) throw new Error(`no other app (storebound.config.ts) in ${folders.map(f => relative(root, f) || '.').join(', ')}`); - const json = a.has('json'); - if (!json) log(TAG, `${config.app.name} vs ${configs.length} app(s), offline`); const me = fingerprint(config, root); const others = []; for (const p of configs) { try { const l = await loadConfig(p); others.push(fingerprint(l.config, l.root)); - } catch (e) { warn(TAG, `${p}: skipped (${(e as Error).message.split('\n')[0]?.slice(0, 160)})`); } + } catch (e) { onSkip(`${p}: skipped (${(e as Error).message.split('\n')[0]?.slice(0, 160)})`); } } - const r = report(me, others, threshold); + return { report: report(me, others, threshold), me, others: configs.length }; +} + +export async function run(ctx: Ctx): Promise { + const { config, root } = ctx.loaded; + const a = ctx.args; + const json = a.has('json'); + const { report: r, me, others } = await compareAgainst(ctx.loaded, a.list('against'), a.has('threshold') ? a.num('threshold', DEFAULT_THRESHOLD) : undefined, m => warn(TAG, m)); + if (!json) log(TAG, `${config.app.name} vs ${others} app(s), offline`); + const threshold = r.threshold; if (json) { printJson(r); if (r.flagged) process.exitCode = 1; return; } for (const n of me.notes) warn(TAG, `${config.app.name}: ${n}`); const pct = (x: number | null) => (x === null ? '-' : `${Math.round(x * 100)}%`); diff --git a/cli/prices.ts b/cli/prices.ts index ea76a7b0..2460bf4c 100644 --- a/cli/prices.ts +++ b/cli/prices.ts @@ -1,5 +1,8 @@ // In-app product prices for many products and regions from one CSV (both stores). -// storebound prices export [--out store/prices.csv] [--store apple|play] [--only ids] [--with-automatic] [--dry] [--json] +// storebound prices export [--out store/prices.csv] [--store apple|play] [--only ids] [--with-automatic] [--no-subscriptions] [--dry] [--json] +// one-time products and (unless --no-subscriptions) auto-renewable subscriptions: Apple's current and scheduled +// subscription prices per territory, Play's regional prices of the base plan. Subscription rows use the same +// columns; `apple subscriptions --csv` / `play subscriptions --csv` read them back (prices import skips them). // storebound prices import [--csv store/prices.csv] [--store apple|play] [--only ids] [--reconvert] [--all] [--dry] [--yes] // storebound prices ppp [--base ] [...] purchasing power price sheet (prices-ppp.ts) // CSV columns: product, store (apple | play | both), region (ISO alpha-2), currency, price, start_date (App Store @@ -21,6 +24,7 @@ import { pointKey, type PriceRow, pricesCsv, sameSchedule, } from './lib/prices'; import { playClient, type PlayClient } from './play/client'; +import { allSubscriptions, appleSubPriceRows, basePlanId, type PlaySubscription, playSubPriceRows } from './lib/subscriptions'; const TAG = 'prices'; @@ -60,7 +64,9 @@ export async function run(ctx: Ctx): Promise { const useApple = (!store || store === 'apple') && !!config.apple; const usePlay = (!store || store === 'play') && !!config.play; const only = a.list('only'); - const products = need(config.products, 'products').filter(p => !only.length || only.includes(p.id)); + const products = (config.products ?? []).filter(p => !only.length || only.includes(p.id)); + const subs = sub === 'export' && !a.has('no-subscriptions') ? allSubscriptions(config.subscriptions).map(x => x.sub).filter(s => !only.length || only.includes(s.id)) : []; + if (!products.length && !subs.length) need(undefined, sub === 'export' ? 'products or subscriptions' : 'products'); const csvPath = resolve(a.get(sub === 'export' ? 'out' : 'csv') ?? config.prices?.csv ?? 'store/prices.csv'); const dry = a.has('dry'); @@ -87,22 +93,46 @@ export async function run(ctx: Ctx): Promise { } } + if (sub === 'export' && subs.length) { + const appleSubs = new Map(); + if (c) for (const g of await c.all(`/v1/apps/${appId}/subscriptionGroups?limit=200`)) + for (const x of await c.all(`/v1/subscriptionGroups/${g.id}/subscriptions?limit=200`)) appleSubs.set(String(x.attributes.productId), x.id); + for (const [i, s] of subs.entries()) { + log(TAG, `${step(i + 1, subs.length, s.id)}: reading subscription prices`); + if (c) { + const id = appleSubs.get(s.id); + if (!id) { warn(TAG, `${s.id}: subscription not on App Store Connect (storebound apple subscriptions creates it)`); missing.push({ product: s.id, store: 'apple' }); } + else current.push(...appleSubPriceRows(s.id, await pages(c, `/v1/subscriptions/${id}/prices?include=subscriptionPricePoint,territory&limit=200`))); + } + if (play) { + let ps: PlaySubscription | null = null; + try { ps = await play.call('GET', `${play.API}/subscriptions/${encodeURIComponent(s.id)}`); } catch (e) { if (!/-> 404/.test(String(e))) throw e; } + if (!ps) { warn(TAG, `${s.id}: subscription not on Google Play (storebound play subscriptions creates it)`); missing.push({ product: s.id, store: 'play' }); } + else current.push(...playSubPriceRows(ps, basePlanId(s))); + } + } + } + if (sub === 'export') { // --json: the current prices as data (the desktop price view); read-only, never writes the CSV if (a.has('json')) { - printJson({ csv: csvPath, products: products.map(p => p.id), stores: [...(useApple ? ['apple'] : []), ...(usePlay ? ['play'] : [])], missing, + printJson({ csv: csvPath, products: products.map(p => p.id), subscriptions: subs.map(s => s.id), stores: [...(useApple ? ['apple'] : []), ...(usePlay ? ['play'] : [])], missing, rows: current.map(({ pointId: _p, ...r }) => r) }); return; } const csv = pricesCsv(current); if (dry) { console.log(csv); done(TAG, `dry run: would write ${current.length} rows to ${csvPath}`); return; } writeFileSync(csvPath, csv); - done(TAG, `${current.length} rows -> ${csvPath} (edit, then storebound prices import --dry)`); + done(TAG, `${current.length} rows -> ${csvPath} (edit, then storebound prices import --dry${subs.length ? '; subscription rows: apple subscriptions --csv / play subscriptions --csv' : ''})`); return; } if (!existsSync(csvPath)) throw new Error(`no prices CSV at ${csvPath} (storebound prices export writes one)`); - const wantedAll = parsePriceCsv(readFileSync(csvPath, 'utf8'), { products: config.products!.map(p => p.id) }) + const subIds = allSubscriptions(config.subscriptions).map(x => x.sub.id); + const sheet = parsePriceCsv(readFileSync(csvPath, 'utf8'), { products: [...(config.products ?? []).map(p => p.id), ...subIds] }); + const subRows = sheet.filter(r => subIds.includes(r.product)); + if (subRows.length) log(TAG, `${subRows.length} subscription row(s) skipped here: storebound apple subscriptions --csv ${a.get('csv') ?? config.prices?.csv ?? 'store/prices.csv'} --dry (and play subscriptions --csv) apply them`); + const wantedAll = sheet .filter(r => products.some(p => p.id === r.product) && ((r.store === 'apple' && useApple) || (r.store === 'play' && usePlay))); const diff = diffPrices(current, wantedAll); const changed = new Set(diff.filter(d => d.change !== 'same').map(d => `${d.product}|${d.store}`)); diff --git a/cli/scan.ts b/cli/scan.ts index 6237c982..11d4f2d0 100644 --- a/cli/scan.ts +++ b/cli/scan.ts @@ -1,6 +1,8 @@ // Offline, read-only scan of the project itself for App Store and Google Play rejection risks, before you submit. // storebound scan [--dir ] [--config ] [--store apple|play] [--json] [--no-declarations] // storebound scan --write also write the detected dataSafety / appPrivacy answers into the config +// storebound scan --originality [--against ] [--threshold 0.7] also the 4.3 / Play repetitive content +// check against your other apps (storebound originality; folders default to originality.against in the config) // Reads the project files (Xcode project, Info.plist, entitlements, privacy manifests, Podfile.lock, Package.resolved, // Gradle files, AndroidManifest.xml and a local build's merged manifest, res/xml and strings.xml, CMake / ndk-build // files, package.json, app.json, capacitor.config, pubspec, Unity and Godot settings and ProjectVersion.txt), the @@ -9,12 +11,13 @@ // answers as a diff against the config. Nothing is written without --write (and --dry always wins). No network. // Exit 1 while an open blocker is left. import { existsSync, readFileSync, writeFileSync } from 'node:fs'; -import { dirname, join, resolve } from 'node:path'; +import { dirname, join, relative, resolve } from 'node:path'; import type { Args } from './lib/args'; import { CONFIG_NAMES } from './lib/config'; import { log, printJson, warn } from './lib/log'; import { upsertBlock } from './lib/scan/config-edit'; -import { formatScan, runScan } from './lib/scan'; +import { addOriginality, formatScan, runScan } from './lib/scan'; +import { compareAgainst } from './originality'; /** Project folder: --dir, else the folder of the nearest storebound.config.* above the working directory, else it. */ function projectDir(args: Args): string { @@ -28,7 +31,17 @@ function projectDir(args: Args): string { export async function run(args: Args): Promise { const dir = projectDir(args); if (!existsSync(dir)) throw new Error(`${dir} does not exist`); - const { report, configPath } = await runScan(dir, { config: args.get('config') }); + const { report, configPath, config } = await runScan(dir, { config: args.get('config') }); + if (args.has('originality')) { + if (!config || !configPath) report.originality = { error: 'no storebound.config.ts loaded in this project' }; + else { + const base = dirname(configPath); + try { + const { report: o } = await compareAgainst({ config, root: base, resolve: p => resolve(base, p) }, args.list('against'), args.has('threshold') ? args.num('threshold', 0.7) : undefined, m => warn('scan', m)); + addOriginality(report, o, { apple: !!config.apple, play: !!config.play }, config, p => relative(dir, p)); + } catch (e) { report.originality = { error: (e as Error).message }; } + } + } const store = args.get('store'); if (store === 'apple' || store === 'play') { report.findings = report.findings.filter(f => f.store === store); diff --git a/cli/text-modules.d.ts b/cli/text-modules.d.ts index 0411e38b..371dfaa9 100644 --- a/cli/text-modules.d.ts +++ b/cli/text-modules.d.ts @@ -3,3 +3,4 @@ declare module '*.md' { const text: string; export default text; } declare module '*.csv' { const text: string; export default text; } declare module '*.html' { const text: string; export default text; } declare module '*.svg' { const text: string; export default text; } +declare module '*.yml' { const text: string; export default text; } diff --git a/docs/api-coverage.md b/docs/api-coverage.md index f27fd4f9..1b78f4e2 100644 --- a/docs/api-coverage.md +++ b/docs/api-coverage.md @@ -13,7 +13,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co | API | operations | GET | other | wrapped by a command | owner only | |---|---:|---:|---:|---:|---:| | App Store Connect API 4.5.1 | 1303 | 826 | 477 | 186 | 166 | -| Google Play Android Developer API v3 (revision 20261008) | 145 | 45 | 100 | 33 | 49 | +| Google Play Android Developer API v3 (revision 20261008) | 145 | 45 | 100 | 34 | 49 | | Google Play Developer Reporting API v1beta1 (revision 20261008) | 25 | 15 | 10 | 6 | 0 | ## App Store Connect API 4.5.1 @@ -479,7 +479,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co | `apps_searchKeywords_getToManyRelationship` | GET | `/v1/apps/{id}/relationships/searchKeywords` | read | | | `apps_subscriptionGracePeriod_getToOneRelated` | GET | `/v1/apps/{id}/subscriptionGracePeriod` | read | | | `apps_subscriptionGracePeriod_getToOneRelationship` | GET | `/v1/apps/{id}/relationships/subscriptionGracePeriod` | read | | -| `apps_subscriptionGroups_getToManyRelated` | GET | `/v1/apps/{id}/subscriptionGroups` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, validate | +| `apps_subscriptionGroups_getToManyRelated` | GET | `/v1/apps/{id}/subscriptionGroups` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, prices, validate | | `apps_subscriptionGroups_getToManyRelationship` | GET | `/v1/apps/{id}/relationships/subscriptionGroups` | read | | | `apps_updateInstance` | PATCH | `/v1/apps/{id}` | write (dry by default) | apple/appinfo | | `apps_webhooks_getToManyRelated` | GET | `/v1/apps/{id}/webhooks` | read | | @@ -1377,7 +1377,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co | `subscriptionGroups_getInstance` | GET | `/v1/subscriptionGroups/{id}` | read | | | `subscriptionGroups_subscriptionGroupLocalizations_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/subscriptionGroupLocalizations` | read | apple/subscriptions, validate | | `subscriptionGroups_subscriptionGroupLocalizations_getToManyRelationship` | GET | `/v1/subscriptionGroups/{id}/relationships/subscriptionGroupLocalizations` | read | | -| `subscriptionGroups_subscriptions_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/subscriptions` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, validate | +| `subscriptionGroups_subscriptions_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/subscriptions` | read | apple/iap-submit, apple/promoted, apple/subscriptions, apple/win-back, catalog, prices, validate | | `subscriptionGroups_subscriptions_getToManyRelationship` | GET | `/v1/subscriptionGroups/{id}/relationships/subscriptions` | read | | | `subscriptionGroups_updateInstance` | PATCH | `/v1/subscriptionGroups/{id}` | write (dry by default) | | | `subscriptionGroups_versions_getToManyRelated` | GET | `/v1/subscriptionGroups/{id}/versions` | read | apple/iap-submit | @@ -1474,7 +1474,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co | `subscriptions_pricePoints_getToManyRelated` | GET | `/v1/subscriptions/{id}/pricePoints` | read | apple/subscriptions, apple/win-back | | `subscriptions_pricePoints_getToManyRelationship` | GET | `/v1/subscriptions/{id}/relationships/pricePoints` | read | | | `subscriptions_prices_deleteToManyRelationship` | DELETE | `/v1/subscriptions/{id}/relationships/prices` | owner only (typed confirm) | | -| `subscriptions_prices_getToManyRelated` | GET | `/v1/subscriptions/{id}/prices` | read | apple/subscriptions, apple/win-back, catalog | +| `subscriptions_prices_getToManyRelated` | GET | `/v1/subscriptions/{id}/prices` | read | apple/subscriptions, apple/win-back, catalog, prices | | `subscriptions_prices_getToManyRelationship` | GET | `/v1/subscriptions/{id}/relationships/prices` | read | | | `subscriptions_promotedPurchase_getToOneRelated` | GET | `/v1/subscriptions/{id}/promotedPurchase` | read | | | `subscriptions_promotedPurchase_getToOneRelationship` | GET | `/v1/subscriptions/{id}/relationships/promotedPurchase` | read | | @@ -1663,7 +1663,7 @@ Specs: Apple [App Store Connect API 4.5.1](https://developer.apple.com/sample-co | `androidpublisher.monetization.subscriptions.batchUpdate` | POST | `androidpublisher/v3/applications/{packageName}/subscriptions:batchUpdate` | write (dry by default) | | | `androidpublisher.monetization.subscriptions.create` | POST | `androidpublisher/v3/applications/{packageName}/subscriptions` | write (dry by default) | play/subscriptions | | `androidpublisher.monetization.subscriptions.delete` | DELETE | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | owner only (typed confirm) | | -| `androidpublisher.monetization.subscriptions.get` | GET | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | read | | +| `androidpublisher.monetization.subscriptions.get` | GET | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | read | prices | | `androidpublisher.monetization.subscriptions.list` | GET | `androidpublisher/v3/applications/{packageName}/subscriptions` | read | catalog, play/subscriptions, validate | | `androidpublisher.monetization.subscriptions.patch` | PATCH | `androidpublisher/v3/applications/{packageName}/subscriptions/{productId}` | write (dry by default) | play/subscriptions | | **androidpublisher.monetization.subscriptions.basePlans** (6) | | | | | diff --git a/media/teaser/site-shots.ts b/media/teaser/site-shots.ts new file mode 100644 index 00000000..76efc0ea --- /dev/null +++ b/media/teaser/site-shots.ts @@ -0,0 +1,23 @@ +#!/usr/bin/env bun +// The home page's "Desktop app" screenshots (site/img/desktop/*.webp) from the same headless fixture-mode capture as +// the teaser (desktop.ts: Vite dev server of apps/desktop with VITE_FIXTURES=1, dev markers hidden), scaled to 1280 px +// and encoded with cwebp (quality 75). Run after a desktop UI change: bun media/teaser/site-shots.ts +import { existsSync, mkdirSync, statSync } from 'node:fs'; +import { join } from 'node:path'; +import { captureDesktop } from './desktop'; + +const ROOT = join(import.meta.dir, '../..'); +const SRC = join(import.meta.dir, 'out/desktop'); +const OUT = join(ROOT, 'site/img/desktop'); +const NAMES = ['portfolio', 'releases', 'checks']; + +if (process.argv.includes('--fresh') || !NAMES.every(n => existsSync(join(SRC, `${n}.jpg`)))) await captureDesktop(); +mkdirSync(OUT, { recursive: true }); +for (const n of NAMES) { + const out = join(OUT, `${n}.webp`); + const p = Bun.spawnSync(['cwebp', '-quiet', '-q', '75', '-m', '6', '-resize', '1280', '0', join(SRC, `${n}.jpg`), '-o', out]); + if (p.exitCode !== 0) throw new Error(`cwebp ${n}: ${p.stderr.toString()}`); + const kb = statSync(out).size / 1024; + if (kb > 150) throw new Error(`${n}.webp is ${kb.toFixed(0)} KB (limit 150)`); + console.log(`${n}.webp ${kb.toFixed(0)} KB`); +} diff --git a/site/desktop/index.html b/site/desktop/index.html index c06dd5e1..2f6b97a2 100644 --- a/site/desktop/index.html +++ b/site/desktop/index.html @@ -18,7 +18,7 @@ - +