Skip to content

[codex] Add Microsoft Store PWA target - #17

Merged
imjlk merged 5 commits into
mainfrom
codex/microsoft-store-web-target
Jul 6, 2026
Merged

imjlk merged 5 commits into
mainfrom
codex/microsoft-store-web-target

Conversation

@imjlk

@imjlk imjlk commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add a microsoft-store PWA release target that reuses the browser PlatformGateway and writes artifacts/microsoft-store.
  • Add microsoft-store-pwa effective target metadata, smoke coverage, CLI generated-game target support, and Microsoft Store CI/release workflow hooks.
  • Document the Microsoft Store path as PWABuilder/Partner Center PWA packaging, with Digital Goods API and Payment Request commerce left disabled until a dedicated ledger-backed integration is added.

Validation

  • pnpm validate:target-config
  • pnpm validate:targets
  • pnpm validate:effective-config
  • pnpm validate:starter-workflow
  • pnpm smoke:target-config
  • pnpm smoke:effective-config
  • pnpm smoke:adapter-effective-config
  • MPGD_SKIP_BUILD_TARGET_PREFLIGHT=1 pnpm build:microsoft-store
  • pnpm smoke:target microsoft-store
  • pnpm check
  • pnpm test
  • pnpm pack:packages:prepared
  • ocr review --audience agent --background ... and patched the single actionable assertion-message issue

Notes

  • pnpm sampo:release:dry-run was not runnable on this feature branch because Sampo release config only allows main for release dry-runs.

Summary by CodeRabbit

  • New Features

    • Added Microsoft Store as a selectable build and release target (including msstore alias).
    • Introduced Microsoft Store-specific build, smoke, and release automation with dedicated CI/artifacts and PWA output (includes manifest.webmanifest).
  • Bug Fixes

    • Improved Microsoft Store inclusion in CI and expanded target validation to ensure required PWA manifest artifacts are present.
    • Updated target selection so all/default can follow the configured platform targets list.
  • Documentation

    • Updated setup, release, and checklist docs (plus templates) to cover Microsoft Store packaging and submission steps, including manifest.webmanifest.

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk I'll review the changes now.

✅ 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.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@imjlk, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 39 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a6c4b3d-f23e-44e8-90cf-0c71443ea754

📥 Commits

Reviewing files that changed from the base of the PR and between fdff0ac and ba2229c.

📒 Files selected for processing (2)
  • tools/graph/local-graph-runtime.mjs
  • tools/smoke/verify-target-artifacts.ts
📝 Walkthrough

Walkthrough

This PR adds microsoft-store as a new target across config, CLI, runtime, validation, workflows, and docs. It also wires PWA packaging for the Phaser app and updates smoke checks to verify the new artifact shape.

Changes

Microsoft Store target support

Layer / File(s) Summary
Target definitions
packages/target-config/src/runtime.ts, packages/target-config/targets.json, platform.targets.json, packages/cli/templates/phaser-game/mpgd.targets.json, examples/phaser-starter/agent/game.manifest.json, packages/cli/templates/phaser-game/agent/game-manifest.json
Extends the runtime/release unions and adds microsoft-store target entries to the config and manifest files.
Runtime and platform propagation
apps/game-phaser/src/platform/runtimeDetector.ts, apps/game-phaser/src/platform/installPlatform.ts, apps/game-phaser/vite.config.ts, apps/game-phaser/src/vite-env.d.ts, apps/game-phaser/src/platform/runtimeDetector.test.ts, packages/cli/templates/phaser-game/src/platform/runtimeDetector.ts, packages/cli/templates/phaser-game/src/platform/installPlatform.ts, packages/cli/templates/phaser-game/vite.config.ts, packages/cli/templates/phaser-game/src/env.d.ts
Adds configTarget runtime plumbing, Vite build-time defines, install-time target selection, and matching tests.
CLI and build plumbing
packages/cli/src/index.ts, tools/target/build-target.ts, tools/target/effective-config.ts, tools/validate-effective-target-config.ts, package.json, packages/cli/templates/phaser-game/package.json
Updates target parsing/aliasing, configuration-driven target expansion, build environment selection, and adds Microsoft Store build/smoke scripts.
Smoke and validation coverage
tools/smoke/*.ts, tools/validate-starter-workflow.ts, tools/validate-target-config.ts
Adds Microsoft Store artifact checks, runtime/effective-config coverage, and validator updates for target filtering and store-review policy.
Workflows and release docs
.github/workflows/*.yml, .sampo/changesets/microsoft-store-pwa-target.md, README.md, docs/*.md, examples/phaser-starter/agent/*, packages/cli/templates/phaser-game/**, .github/ISSUE_TEMPLATE/bug_report.yml
Adds workflow choices, a dedicated release workflow, a changeset entry, and documentation/template updates for Microsoft Store commands and packaging.

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

Possibly related PRs

  • imjlk/mpgd-kit#1: Shares the same starter-workflow validation area that now requires microsoft-store in manifest.targets.
  • imjlk/mpgd-kit#7: Touches the same CLI target parsing and normalization code in packages/cli/src/index.ts.
  • imjlk/mpgd-kit#9: Also adjusts CLI target matrix/default handling in the shared target-selection path.

Poem

A browser bunny packed with care,
hopped into the Microsoft Store square.
PWA pages, manifest bright,
smoke tests blinked green through the night,
and carrots rained in build-debug light 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly names the main change: adding a Microsoft Store PWA target.
Description check ✅ Passed The description follows the required template with Summary, Validation, and Notes sections and covers the main changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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/microsoft-store-web-target

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tools/target/build-target.ts (1)

225-228: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Helper implicitly depends on outer-scope targetName instead of an explicit parameter.

appTargetForBuild takes target but falls back to the enclosing function's targetName variable rather than a value tied to target itself. This works only because the single call site always passes the pair together; extracting/reusing this helper elsewhere would silently break.

Consider passing the name explicitly:

♻️ Proposed refactor
-function appTargetForBuild(target: BuildTargetConfig): string {
-  return target.kind === 'web' ? 'browser' : targetName;
+function appTargetForBuild(target: BuildTargetConfig, name: string): string {
+  return target.kind === 'web' ? 'browser' : name;
 }

And update the call site to appTargetForBuild(target, targetName).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/target/build-target.ts` around lines 225 - 228, The helper
appTargetForBuild currently relies on the outer-scope targetName instead of
using only its own inputs, which makes it fragile and non-reusable. Update
appTargetForBuild to accept targetName as an explicit parameter, use that value
for the non-web branch, and adjust its call site in the build-target flow to
pass both target and targetName so the function is self-contained.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tools/target/build-target.ts`:
- Around line 225-228: The helper appTargetForBuild currently relies on the
outer-scope targetName instead of using only its own inputs, which makes it
fragile and non-reusable. Update appTargetForBuild to accept targetName as an
explicit parameter, use that value for the non-web branch, and adjust its call
site in the build-target flow to pass both target and targetName so the function
is self-contained.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 94e0a26d-5fcb-4754-8917-8786fa9b0226

📥 Commits

Reviewing files that changed from the base of the PR and between 33f2598 and e29a60e.

📒 Files selected for processing (29)
  • .github/ISSUE_TEMPLATE/bug_report.yml
  • .github/workflows/build-target.yml
  • .github/workflows/ci.yml
  • .github/workflows/release-microsoft-store.yml
  • .sampo/changesets/microsoft-store-pwa-target.md
  • README.md
  • docs/GAME_DEVELOPMENT.md
  • docs/PUBLIC_RELEASE_CHECKLIST.md
  • examples/phaser-starter/agent/brief.template.md
  • examples/phaser-starter/agent/game.manifest.json
  • package.json
  • packages/cli/src/index.ts
  • packages/cli/templates/phaser-game/README.md
  • packages/cli/templates/phaser-game/agent/acceptance.md
  • packages/cli/templates/phaser-game/agent/brief.md
  • packages/cli/templates/phaser-game/agent/game-manifest.json
  • packages/cli/templates/phaser-game/mpgd.targets.json
  • packages/cli/templates/phaser-game/package.json
  • packages/target-config/src/runtime.ts
  • packages/target-config/targets.json
  • platform.targets.json
  • tools/smoke/adapter-effective-config.ts
  • tools/smoke/build-target-artifacts.ts
  • tools/smoke/effective-target-config.ts
  • tools/smoke/target-config-runtime.ts
  • tools/target/build-target.ts
  • tools/target/effective-config.ts
  • tools/validate-starter-workflow.ts
  • tools/validate-target-config.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e29a60e1bc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/target/build-target.ts Outdated
}

function appTargetForBuild(target: BuildTargetConfig): string {
return target.kind === 'web' ? 'browser' : targetName;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the Microsoft Store config target at runtime

When pnpm build:microsoft-store reaches this branch, it sets APP_TARGET=browser; the game runtime then calls targetConfigKeyForPlatform(runtime.target) in apps/game-phaser/src/platform/installPlatform.ts and the generated template, which maps browser back to web-preview. As a result the Microsoft Store bundle's in-game effective config, release profile, and policy metadata are computed as web-preview even though the copied artifact contains microsoft-store, so any Store-specific gating such as requiresStoreReview is invisible to the running app.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fe8c7de. Web-kind builds now inject MPGD_CONFIG_TARGET separately from APP_TARGET, so Microsoft Store keeps configTarget: "microsoft-store" while still using the browser adapter/runtime target.

"requiresAitReview": false
}
},
"microsoft-store": {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep legacy target files buildable

Adding this matrix entry makes writeEffectiveTargetConfigs() validate microsoft-store on every run, even when only a requested target such as web-preview is being written. Existing generated games' mpgd.targets.json files do not define a microsoft-store platform target, so upgrading the kit/CLI and running mpgd target build web against those files fails during effective-config validation because sources.platformTargetKind is undefined; make this target opt-in/migrate missing target files or validate only requested targets so existing generated games can still build.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fe8c7de. Build preflight and effective config artifact generation now validate requested targets only, so legacy generated target files that do not yet define microsoft-store can still build web-preview/other requested targets. I also reproduced this with a temporary legacy target file missing microsoft-store.

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Patched the new review feedback in fe8c7de:

  • Preserved microsoft-store as the runtime config target while still using the browser adapter for web-kind builds.
  • Added MPGD_CONFIG_TARGET injection for app/template builds and runtime detector coverage.
  • Made target/effective config validation target-scoped during builds so older generated mpgd.targets.json files without microsoft-store can still build requested targets.
  • Addressed CodeRabbit's helper nit by passing the target name explicitly.

Validation run:

  • pnpm validate:target-config
  • pnpm validate:effective-config
  • pnpm smoke:target-config
  • MPGD_SKIP_BUILD_TARGET_PREFLIGHT=1 pnpm build:microsoft-store
  • pnpm smoke:target microsoft-store
  • Microsoft Store artifact grep confirmed microsoft-store / microsoft-store-pwa in embedded config and bundle
  • Legacy target-file reproduction without microsoft-store: target-scoped config validation plus MPGD_SKIP_BUILD_TARGET_PREFLIGHT=1 pnpm build:target web-preview production
  • pnpm check
  • pnpm --dir apps/game-phaser test
  • pnpm smoke:effective-config
  • pnpm smoke:adapter-effective-config

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the detailed update and validation run. I'll review the new changes in fe8c7de now.

✅ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fe8c7de56a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/cli/src/index.ts Outdated
const gameTemplateDir = path.resolve(packageRoot, 'templates/phaser-game');
const cliVersion = readPackageVersion(packageRoot);
const defaultMatrixTargets = 'web,ait,reddit';
const defaultMatrixTargets = 'web,microsoft-store,ait,reddit';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep build-all defaults compatible with older target files

When the published CLI is used from an existing generated game whose mpgd.targets.json predates the new microsoft-store entry, running mpgd target build-all or smoke-all without --targets now expands to microsoft-store and then invokes the kit scripts for a target that is absent from that file, failing as an unknown target. This bypasses the target-scoped validation fallback added for legacy target files; please derive the default from the configured targets or keep the implicit default to targets present in older templates.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fdff0ac. Matrix defaults now derive from the configured target file: omitted --targets uses the recommended target order filtered by configured targets, while --targets all uses all configured targets. I reproduced this with a temporary legacy target file missing microsoft-store; mpgd target build-all selected web-preview, ait, and reddit without trying the absent Store target.

Comment thread platform.targets.json
Comment on lines +9 to +13
"microsoft-store": {
"kind": "web",
"gameApp": "apps/game-phaser",
"adapter": "browser",
"output": "artifacts/microsoft-store"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add PWA manifest before shipping the Store target

When this new target is selected, build-target copies apps/game-phaser/dist directly to artifacts/microsoft-store, but a repo search found no linked web app manifest or manifest.webmanifest/manifest.json under apps/game-phaser. Microsoft’s PWA docs describe the web app manifest as the piece that makes a web app installable as a PWA (https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps/how-to/), so PWABuilder’s Store readiness check won’t have the required app metadata/icons to package; please add and link a manifest for this artifact before treating it as a Microsoft Store PWA target.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in fdff0ac. The game app and generated Phaser template now ship a linked manifest.webmanifest plus app icon metadata, and smoke:target microsoft-store verifies the artifact has the manifest link, manifest metadata, and local icon file. I also checked Microsoft's PWA guidance while applying this.

@imjlk

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Patched the latest Codex feedback in fdff0ac:

  • Derived default mpgd target build-all / smoke-all target lists from the configured targets file so older generated games without microsoft-store do not try to build that absent target by default.
  • Added linked PWA manifest.webmanifest metadata for the game app and generated Phaser template, including local icon metadata for Microsoft Store/PWABuilder readiness.
  • Extended smoke:target microsoft-store to verify the artifact has the manifest link, required manifest metadata, and local icon file.
  • Updated docs and the existing Sampo changeset to reflect the manifest/readiness behavior.

Validation run:

  • pnpm validate:target-config
  • pnpm validate:effective-config
  • MPGD_SKIP_BUILD_TARGET_PREFLIGHT=1 pnpm build:microsoft-store
  • pnpm smoke:target microsoft-store
  • Legacy target-file reproduction without microsoft-store: MPGD_SKIP_BUILD_TARGET_PREFLIGHT=1 pnpm mpgd target build-all --targets-file ./.mpgd.legacy.targets.test.json --kit-path . --ait-variant wrapper
  • pnpm check
  • Microsoft Store artifact grep confirmed the manifest link and microsoft-store / microsoft-store-pwa embedded config.

I also verified the Microsoft PWA manifest requirement against the official Edge PWA guidance. OCR connectivity passed, but the workspace review run produced no output for several minutes and was cancelled after local validation completed.

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the update — I'll review the new changes from fdff0ac now, including the derived target-list logic, the PWA manifest additions, and the extended smoke test coverage.

✅ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (3)
apps/game-phaser/src/platform/runtimeDetector.test.ts (1)

16-23: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Missing test for non-browser passthrough branch.

Coverage only exercises the target === 'browser' branch of normalizeConfigTarget. Add a case for a non-browser target (e.g. 'android') to confirm value falls back to target unchanged.

✅ Suggested additional test
   it('maps browser config to web-preview when no config target is injected', () => {
     expect(normalizeConfigTarget('', 'browser')).toBe('web-preview');
   });
+
+  it('falls back to the runtime target for non-browser platforms', () => {
+    expect(normalizeConfigTarget('', 'android')).toBe('android');
+  });
 });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/game-phaser/src/platform/runtimeDetector.test.ts` around lines 16 - 23,
Add a test case in runtimeDetector.test.ts for the normalizeConfigTarget
function that covers a non-browser target such as android. The current tests
only verify the browser branch, so add a passthrough assertion confirming that
when the target is not browser and no explicit config target is provided,
normalizeConfigTarget returns the target unchanged.
apps/game-phaser/src/platform/runtimeDetector.ts (1)

30-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate mapping logic with targetConfigKeyForPlatform.

normalizeConfigTarget's fallback branch (target === 'browser' ? 'web-preview' : target) reimplements the same rule already defined in packages/target-config/src/runtime.ts (targetConfigKeyForPlatform). Consider reusing that function here instead of duplicating the mapping, so both stay in sync if the default target-key rule ever changes.

♻️ Proposed refactor
+import { targetConfigKeyForPlatform } from '`@mpgd/target-config`';
+
 export function normalizeConfigTarget(value: string, target: PlatformTarget): string {
-  return value.length > 0 ? value : target === 'browser' ? 'web-preview' : target;
+  return value.length > 0 ? value : targetConfigKeyForPlatform(target);
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/game-phaser/src/platform/runtimeDetector.ts` around lines 30 - 33, The
fallback mapping in normalizeConfigTarget duplicates the browser-to-web-preview
rule already defined by targetConfigKeyForPlatform. Update normalizeConfigTarget
to reuse targetConfigKeyForPlatform from packages/target-config/src/runtime.ts
for the empty-value fallback instead of hardcoding target === 'browser' ?
'web-preview' : target, so the runtimeDetector logic stays aligned with the
shared target-key mapping.
tools/validate-effective-target-config.ts (1)

17-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Duplicate readTargetFilterFromEnv helper across two files.

This helper is byte-for-byte identical to the one added in tools/validate-target-config.ts (Lines 52-63 there). Consider extracting it into a shared module (e.g. tools/env.ts or similar) to avoid drift between the two copies.

♻️ Proposed refactor
-function readTargetFilterFromEnv(name: string): readonly string[] | undefined {
-  const raw = process.env[name];
-
-  if (raw === undefined || raw.trim().length === 0) {
-    return undefined;
-  }
-
-  return raw
-    .split(',')
-    .map((target) => target.trim())
-    .filter((target) => target.length > 0);
-}
+export { readTargetFilterFromEnv } from './env'; // shared implementation
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/validate-effective-target-config.ts` around lines 17 - 29, The
readTargetFilterFromEnv helper is duplicated in
tools/validate-effective-target-config.ts and tools/validate-target-config.ts,
so move that logic into a shared utility module and have both scripts import it.
Keep the existing behavior of trimming, splitting, and filtering env values, but
centralize it under a single helper name so changes only need to be made once.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@apps/game-phaser/src/platform/runtimeDetector.test.ts`:
- Around line 16-23: Add a test case in runtimeDetector.test.ts for the
normalizeConfigTarget function that covers a non-browser target such as android.
The current tests only verify the browser branch, so add a passthrough assertion
confirming that when the target is not browser and no explicit config target is
provided, normalizeConfigTarget returns the target unchanged.

In `@apps/game-phaser/src/platform/runtimeDetector.ts`:
- Around line 30-33: The fallback mapping in normalizeConfigTarget duplicates
the browser-to-web-preview rule already defined by targetConfigKeyForPlatform.
Update normalizeConfigTarget to reuse targetConfigKeyForPlatform from
packages/target-config/src/runtime.ts for the empty-value fallback instead of
hardcoding target === 'browser' ? 'web-preview' : target, so the runtimeDetector
logic stays aligned with the shared target-key mapping.

In `@tools/validate-effective-target-config.ts`:
- Around line 17-29: The readTargetFilterFromEnv helper is duplicated in
tools/validate-effective-target-config.ts and tools/validate-target-config.ts,
so move that logic into a shared utility module and have both scripts import it.
Keep the existing behavior of trimming, splitting, and filtering env values, but
centralize it under a single helper name so changes only need to be made once.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 9345250e-7bf4-4163-9c88-d343be4e2ac0

📥 Commits

Reviewing files that changed from the base of the PR and between e29a60e and fdff0ac.

⛔ Files ignored due to path filters (1)
  • packages/cli/templates/phaser-game/public/icon.svg is excluded by !**/*.svg
📒 Files selected for processing (22)
  • .sampo/changesets/microsoft-store-pwa-target.md
  • README.md
  • apps/game-phaser/index.html
  • apps/game-phaser/public/manifest.webmanifest
  • apps/game-phaser/src/platform/installPlatform.ts
  • apps/game-phaser/src/platform/runtimeDetector.test.ts
  • apps/game-phaser/src/platform/runtimeDetector.ts
  • apps/game-phaser/src/vite-env.d.ts
  • apps/game-phaser/vite.config.ts
  • packages/cli/src/index.ts
  • packages/cli/templates/phaser-game/README.md
  • packages/cli/templates/phaser-game/index.html
  • packages/cli/templates/phaser-game/public/manifest.webmanifest
  • packages/cli/templates/phaser-game/src/env.d.ts
  • packages/cli/templates/phaser-game/src/platform/installPlatform.ts
  • packages/cli/templates/phaser-game/src/platform/runtimeDetector.ts
  • packages/cli/templates/phaser-game/vite.config.ts
  • tools/smoke/verify-target-artifacts.ts
  • tools/target/build-target.ts
  • tools/target/effective-config.ts
  • tools/validate-effective-target-config.ts
  • tools/validate-target-config.ts
✅ Files skipped from review due to trivial changes (5)
  • packages/cli/templates/phaser-game/index.html
  • .sampo/changesets/microsoft-store-pwa-target.md
  • apps/game-phaser/index.html
  • packages/cli/templates/phaser-game/src/env.d.ts
  • packages/cli/templates/phaser-game/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • README.md

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fdff0ac4ad

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/smoke/verify-target-artifacts.ts Outdated
return linkTags.some(
(tag) =>
/\brel=["']manifest["']/iu.test(tag)
&& /\bhref=["']\/?manifest\.webmanifest["']/iu.test(tag),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Accept relative manifest links in Store smoke

For generated games, the starter Vite config uses base: './', so Vite can rewrite HTML asset references in the built artifact to href="./manifest.webmanifest". This check only accepts /manifest.webmanifest or manifest.webmanifest, which means mpgd target smoke microsoft-store can fail on a valid generated Microsoft Store artifact even though the manifest exists and is linked. Please allow the ./ form or parse and resolve the href instead of matching only these two spellings.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ba2229c. The Microsoft Store smoke check now normalizes local web hrefs, so /manifest.webmanifest, manifest.webmanifest, and ./manifest.webmanifest all resolve to the expected artifact manifest link.

Comment thread tools/smoke/verify-target-artifacts.ts Outdated
assertString(icon.src, `Microsoft Store PWA manifest icon ${index} src`);
assertString(icon.sizes, `Microsoft Store PWA manifest icon ${index} sizes`);

const iconPath = resolve(dirname(manifestPath), icon.src);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve root-relative PWA icon URLs under the artifact

When a game manifest uses a root-relative local icon such as /icon.svg, this resolves it as the filesystem path /icon.svg instead of as artifactPath/icon.svg, so the Microsoft Store smoke test fails the inside-artifact/file-exists checks even though the built PWA contains a valid local icon at the web root. Please treat web-root-relative icon URLs as relative to the artifact root before checking the file.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in ba2229c. Manifest icon paths now resolve as artifact web paths: root-relative icon URLs such as /icon.svg are checked under the artifact root, while relative paths still resolve from the manifest directory.

@imjlk

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

CI fix pushed in 4109ee5.

Root cause: pnpm graph:preflight was failing because the target-release preset anchored tools/target/ only through nested graph evidence (primaryFlow.reached), while the local preflight helper only counted top-level result anchors.

Fix: graphResultFiles() now walks the graph result recursively and collects every file field, so expectedFiles checks include nested evidence as well.

Validated locally:

  • pnpm graph:preflight
  • pnpm check

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the update on the CI fix. I'll review the new changes in 4109ee5 now, including the recursive graphResultFiles() fix for nested graph evidence.

✅ 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.

@imjlk

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

Addressed the latest Codex smoke feedback in ba2229c.

Changes:

  • Accept relative Microsoft Store manifest links such as ./manifest.webmanifest.
  • Resolve root-relative PWA icon URLs such as /icon.svg under the artifact root instead of the filesystem root.

Validated locally:

  • MPGD_SKIP_BUILD_TARGET_PREFLIGHT=1 pnpm build:microsoft-store
  • pnpm smoke:target microsoft-store
  • temporary artifact check with href="./manifest.webmanifest" + pnpm smoke:target microsoft-store
  • pnpm check

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the update — I'll review the new changes in ba2229c now, including the relative manifest link handling and the root-relative PWA icon resolution under the artifact root.

✅ 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

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: ba2229ccf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@imjlk
imjlk merged commit bb96043 into main Jul 6, 2026
6 checks passed
@imjlk
imjlk deleted the codex/microsoft-store-web-target branch July 15, 2026 13:41
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