feat(targets): add mobile-amazon target (Amazon Appstore, Android phones & tablets)#466
Conversation
…nes & tablets) Adds the general Android distribution channel for the Amazon Appstore (phones & tablets); Fire TV / Firestick remains handled by tv-firetv. - New @profullstack/sh1pt-target-mobile-amazon package (adapter + tests) - build() emits an inspectable amazon-appstore-package-plan.json - ship() is dry-run-safe; live path stubbed via Amazon App Submission API - Register mobile-amazon in cli adapter-registry - TARGETS.md: mobile-amazon - -> done
Greptile SummaryThis PR adds the
Confidence Score: 5/5Safe to merge — new self-contained adapter that does not touch any existing runtime logic. The adapter is well-isolated, follows the established monorepo convention, and the two previously-flagged correctness gaps (missing subdirectory creation and artifact/command divergence) are both addressed in this revision with dedicated test coverage. No existing code is modified beyond the sorted adapter list entry. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant CLI
participant Adapter as mobile-amazon adapter
participant FS as Filesystem
participant Amazon as Amazon App Submission API
CLI->>Adapter: build(ctx, config)
Adapter->>FS: mkdir(ctx.outDir, recursive)
Adapter->>FS: mkdir(dirname(artifact), recursive)
Note over FS: Creates <outDir>/amazon/ subdirectory
Adapter->>FS: writeFile(amazon-appstore-package-plan.json)
Adapter-->>CLI: "{ artifact, meta: { planFile, deviceTargeting, manifestChecks } }"
CLI->>Adapter: ship(ctx, config)
Note over Adapter: buildPlan(ctx, config, ctx.artifact)<br/>anchors commands to ctx.artifact
alt dryRun
Adapter-->>CLI: "{ id: 'dry-run', meta: { commands[] } }"
else live
Adapter->>Amazon: "edits.create appSku=..."
Adapter->>Amazon: "apk.upload artifact=..."
Adapter->>Amazon: "targeting.update device=..."
Adapter->>Amazon: edits.submit
Adapter-->>CLI: "{ id: 'sku@version', url }"
end
Reviews (2): Last reviewed commit: "fix(mobile-amazon): create artifact dir ..." | Re-trigger Greptile |
…+ command in sync Addresses Greptile review on profullstack#466: - build() now mkdirs the artifact directory (e.g. <outDir>/amazon/) so the downstream APK build can write to the reported path. - ship() builds its plan against ctx.artifact, so meta.artifact and the apk.upload command reference the same path even when apkPath is omitted. - Adds tests for the artifact-dir creation and the no-apkPath ship path.
|
Thanks for the review. Addressed both P2s in 58156e7:
|
Add
mobile-amazontarget — Amazon Appstore (Android phones & tablets)Implements the
mobile-amazondistribution target, the general Android channel for the Amazon Appstore (phones & tablets). This fills the— not startedrow inTARGETS.md; Fire TV / Firestick already ships viatv-firetv, so this completes Amazon coverage for the non-TV form factors.What's included
packages/targets/mobile-amazon/— adapter, package.json, tsconfig, README, following the existing target-adapter convention (mirrorstv-firetv).build()writes an inspectableamazon-appstore-package-plan.json(device targeting, manifest requirements, and the exactamazon-appstoreCLI commandsshipwould run).ship()is dry-run-safe (no secrets/network indryRun); live path is stubbed with the Amazon App Submission API flow +manualSetupcredential guidance.deviceTargetingisphone-only | phone-and-tablet(defaultphone-and-tablet) — Fire TV / Firestick stays the exclusive concern oftv-firetv, so there's no scope overlap.mobile-amazoninpackages/cli/src/adapter-registry.ts.TARGETS.md:mobile-amazonflipped—→✅.Tests
smokeTest(id/kind contract) + two unit tests covering the package plan and dry-run ship output, including the explicitphone-onlytargeting branch.pnpm --filter @profullstack/sh1pt-target-mobile-amazon typecheckandpnpm vitest run packages/targets/mobile-amazon/src/index.test.tspass locally.No external CLI or secrets required for build/test (dry-run only).