Skip to content

Align the Platform contract with the spec port table #36

Description

@zealsprince

The prototype already has most of this: the contract lives in packages/platform/src/types.ts and the web adapter covers notifications, audio enumeration, and file download. Two gaps against the spec. The contract marks notifications, audioDevices, and fileTransfer nullable where the spec's interface has every target providing them, and no test pins the contract, so a port can drift without anything failing.

Tighten the interface so null strictly means "this target can't do this". Then write a mock adapter with plain stubs, like the spec's Testability example, and a headless test that runs app code against it with no DOM involved. Last, move the per-target port mapping into the contract as doc comments, so someone reading types.ts can tell designed-null from not-built-yet without opening the spec.

Spec

  • Platform - the port table and the Testability mock example

Acceptance criteria

  • notifications, audioDevices, and fileTransfer are non-nullable in the contract; only tray, deepLinks, and dns stay nullable, matching the spec interface
  • A mock Platform adapter exists and a headless test exercises app code through it
  • Every port in types.ts has a doc comment naming which targets provide it and where null is by design

Out of scope

No blockers.

Activity

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

Metadata

Metadata

Assignees

Labels

clientClient apps: UI, platform adapters, cache, PWA

Type

Fields

Size

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions