Skip to content

Isolate platform gateway bundles by target - #49

Merged
imjlk merged 1 commit into
mainfrom
codex/target-bundle-purity
Jul 12, 2026
Merged

imjlk merged 1 commit into
mainfrom
codex/target-bundle-purity

Conversation

@imjlk

@imjlk imjlk commented Jul 12, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • select one physical platform gateway module at build time
  • keep production adapters separate from sandbox gateway implementations
  • reject Microsoft Store artifacts containing AIT, Capacitor, Devvit, or sandbox code markers
  • keep the reference starter and generated Phaser template in parity

Validation

  • pnpm check
  • pnpm build:microsoft-store
  • pnpm smoke:target microsoft-store
  • pnpm build:target ait staging
  • pnpm build:target reddit staging
  • pnpm smoke:target ait reddit

Release

  • Adds a minor Sampo changeset for @mpgd/cli.

Summary by CodeRabbit

  • New Features

    • Builds now include only the platform-specific adapter selected for the target.
    • Added support for isolated gateway builds across browser, Android, iOS, AIT, Reddit, and sandbox targets.
    • Starter templates now automatically select the appropriate platform gateway during builds.
  • Bug Fixes

    • Added Microsoft Store bundle checks to detect and prevent inclusion of adapters for unrelated platforms.
    • Improved validation that starter templates maintain consistent platform build behavior.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@imjlk

imjlk commented Jul 12, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: efc5933e-ff8f-4753-92c8-5fa1f4bbeb96

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Target-specific gateway factories are added to the Phaser starter and CLI template. Vite selects and aliases the appropriate factory, platform installation consumes it, and validation checks template parity plus Microsoft Store bundle purity.

Changes

Target-isolated gateway flow

Layer / File(s) Summary
Gateway factory modules
examples/phaser-starter/src/platform/buildGatewayModule.ts, examples/phaser-starter/src/platform/buildGateways/*, packages/cli/templates/phaser-game/src/platform/buildGatewayModule.ts, packages/cli/templates/phaser-game/src/platform/buildGateways/*
Adds typed gateway contracts and platform-specific factories for browser, AIT, Capacitor, and Reddit targets, including sandbox variants.
Build-time gateway selection
examples/phaser-starter/vite.config.ts, packages/cli/templates/phaser-game/vite.config.ts
Resolves gateway modules from target, debug mode, and build ID, then aliases #mpgd-platform-gateway to the selected module.
Platform installation integration
examples/phaser-starter/src/platform/installStarterPlatform.ts, packages/cli/templates/phaser-game/src/platform/installPlatform.ts
Replaces runtime adapter switches and sandbox helpers with a single createBuildGateway(runtime) call.
Bundle and template validation
tools/smoke/verify-target-artifacts.ts, tools/validate-starter-workflow.ts, .sampo/changesets/target-bundle-purity.md
Adds Microsoft Store JavaScript purity checks, starter/template gateway parity validation, and a CLI minor-release changeset.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ViteConfig
  participant GatewayResolver
  participant PlatformInstaller
  participant SelectedGateway
  participant PlatformAdapter
  ViteConfig->>GatewayResolver: resolve target, debug, and buildId
  GatewayResolver->>SelectedGateway: alias `#mpgd-platform-gateway`
  PlatformInstaller->>SelectedGateway: createBuildGateway(runtime)
  SelectedGateway->>PlatformAdapter: create target gateway
  PlatformAdapter-->>PlatformInstaller: return PlatformGateway
Loading

Possibly related PRs

  • imjlk/mpgd-kit#1: Introduces the validator structure extended here for gateway parity checks.
  • imjlk/mpgd-kit#2: Adds related Reddit/Devvit target wiring used by the gateway selection flow.
  • imjlk/mpgd-kit#17: Updates Microsoft Store artifact validation alongside this purity check.

Poem

A bunny hops through gateways bright,
Picking one for every flight.
Browser, AIT, and Reddit too,
Clean bundles bloom in targets true.
Templates match—what a view! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: target-based isolation of platform gateway bundles.
Description check ✅ Passed The description covers the required Summary and Validation sections and is detailed enough, with only the optional Notes section missing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/target-bundle-purity

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@imjlk
imjlk merged commit 2a60e46 into main Jul 12, 2026
6 checks passed
@imjlk
imjlk deleted the codex/target-bundle-purity branch July 12, 2026 18:47
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