Skip to content

feat(targets): add mobile-amazon target (Amazon Appstore, Android phones & tablets)#466

Open
Alexander-Sorrell-IT wants to merge 2 commits into
profullstack:masterfrom
Alexander-Sorrell-IT:feat/target-mobile-amazon
Open

feat(targets): add mobile-amazon target (Amazon Appstore, Android phones & tablets)#466
Alexander-Sorrell-IT wants to merge 2 commits into
profullstack:masterfrom
Alexander-Sorrell-IT:feat/target-mobile-amazon

Conversation

@Alexander-Sorrell-IT
Copy link
Copy Markdown

Add mobile-amazon target — Amazon Appstore (Android phones & tablets)

Implements the mobile-amazon distribution target, the general Android channel for the Amazon Appstore (phones & tablets). This fills the — not started row in TARGETS.md; Fire TV / Firestick already ships via tv-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 (mirrors tv-firetv).
  • build() writes an inspectable amazon-appstore-package-plan.json (device targeting, manifest requirements, and the exact amazon-appstore CLI commands ship would run).
  • ship() is dry-run-safe (no secrets/network in dryRun); live path is stubbed with the Amazon App Submission API flow + manualSetup credential guidance.
  • Manifest checks tuned for phone/tablet (LAUNCHER intent, touchscreen required, no hard Play-Services dependency). deviceTargeting is phone-only | phone-and-tablet (default phone-and-tablet) — Fire TV / Firestick stays the exclusive concern of tv-firetv, so there's no scope overlap.
  • Registered mobile-amazon in packages/cli/src/adapter-registry.ts.
  • TARGETS.md: mobile-amazon flipped .

Tests

  • smokeTest (id/kind contract) + two unit tests covering the package plan and dry-run ship output, including the explicit phone-only targeting branch.
  • pnpm --filter @profullstack/sh1pt-target-mobile-amazon typecheck and pnpm vitest run packages/targets/mobile-amazon/src/index.test.ts pass locally.

No external CLI or secrets required for build/test (dry-run only).

…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-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR adds the mobile-amazon target adapter for the Amazon Appstore (Android phones & tablets), completing Amazon coverage alongside the existing tv-firetv adapter. It improves on the tv-firetv template by fixing two previously-identified correctness issues: creating the <outDir>/amazon/ subdirectory in build() and anchoring the ship() upload command to ctx.artifact so the reported artifact and the CLI command can never diverge.

  • New adapter (packages/targets/mobile-amazon/src/index.ts): build() writes an inspectable amazon-appstore-package-plan.json with phone/tablet manifest checks; ship() is dry-run-safe with a stub for the App Submission API live path.
  • Tests (index.test.ts): three focused unit tests cover the plan structure, explicit phone-only targeting, and the no-apkPath artifact-sync invariant.
  • Registry & docs: mobile-amazon added to adapter-registry.ts in sorted order; TARGETS.md updated to ✅.

Confidence Score: 5/5

Safe 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

Filename Overview
packages/targets/mobile-amazon/src/index.ts New adapter implementing build/ship for Amazon Appstore (phones & tablets); properly fixes both the missing-subdir mkdir and the artifact-divergence issues over the tv-firetv template it was based on.
packages/targets/mobile-amazon/src/index.test.ts Three unit tests covering the package plan structure, phone-only targeting dry-run, and the no-apkPath artifact-sync invariant — comprehensive coverage of the new code paths.
packages/cli/src/adapter-registry.ts Adds mobile-amazon to the sorted adapters list in alphabetical order; no issues.
packages/targets/mobile-amazon/package.json Standard workspace package definition; mirrors other target packages in the monorepo.
TARGETS.md mobile-amazon row updated from — to ✅ with the phones & tablets clarification; accurate.

Sequence Diagram

sequenceDiagram
    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
Loading

Reviews (2): Last reviewed commit: "fix(mobile-amazon): create artifact dir ..." | Re-trigger Greptile

Comment thread packages/targets/mobile-amazon/src/index.ts
Comment thread packages/targets/mobile-amazon/src/index.ts
…+ 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.
@Alexander-Sorrell-IT
Copy link
Copy Markdown
Author

Thanks for the review. Addressed both P2s in 58156e7:

  • mkdir for the artifact subdirbuild() now mkdirs dirname(plan.artifact) (e.g. <outDir>/amazon/) alongside outDir, so the downstream APK build can write to the reported path.
  • ship() artifact/command divergenceship() now builds its plan against ctx.artifact (buildPlan(ctx, config, ctx.artifact)), so meta.artifact and the apk.upload command reference the same path even when apkPath is omitted. Added a test for that no-apkPath path plus one asserting the artifact dir is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant