Skip to content

feat: add Phaser asset manifests and target artifact doctor - #15

Merged
imjlk merged 9 commits into
mainfrom
codex/ios-sync-game-output
Jul 6, 2026
Merged

imjlk merged 9 commits into
mainfrom
codex/ios-sync-game-output

Conversation

@imjlk

@imjlk imjlk commented Jul 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • copy iOS sync artifacts into the game app release-output directory before writing the release manifest
  • add public @mpgd/phaser-assets helpers for Phaser asset manifests and target-portable loader wiring
  • generate starter asset manifests, marker asset loading, and relative Vite base config from @mpgd/create-game
  • keep AIT wrapper smoke output game-owned via release-output/ait/wrapper-web
  • add mpgd target doctor to verify existing target artifacts and reject manifest artifacts outside the game target config directory
  • register @mpgd/phaser-assets in the Sampo fixed release group after local initial publish

Local publish

  • @mpgd/phaser-assets@0.3.2 initial-published locally with maintainer npm auth loaded through mise
  • verified npm pack @mpgd/phaser-assets@0.3.2 works without auth
  • verified registry access reports @mpgd/phaser-assets: public and dist-tag latest: 0.3.2
  • note: npm view @mpgd/phaser-assets version still returned 404 immediately after publish, while pack/dist-tag/access endpoints were already visible

Validation

  • pnpm --dir packages/phaser-assets check
  • pnpm --dir packages/phaser-assets test
  • pnpm --dir packages/cli check
  • pnpm validate:starter-workflow
  • generated /tmp/mpgd-template-smoke with local kit path
  • generated starter: pnpm install -w
  • generated starter: pnpm check
  • generated starter: pnpm build
  • generated starter: mpgd target build-all --targets web,ait --ait-variant wrapper
  • generated starter: mpgd target smoke-all --targets web,ait
  • generated starter: mpgd target doctor --targets web,ait
  • pnpm validate:public
  • pnpm check
  • pnpm test
  • pnpm graph:preflight
  • pnpm pack:packages (passed when run standalone; avoid parallel package builds in the same worktree)
  • pnpm build:web
  • pnpm build:ait
  • pnpm smoke:target web-preview
  • pnpm smoke:target ait

Open Code Review

  • commit ec8ee18 reviewed; addressed exhaustiveness and binary asset dataType feedback, rerun clean except repo-supported ttsc fix/format false positive
  • commit 8923efe reviewed; 0 comments
  • commit 48c216a reviewed; 0 comments
  • commit 0b73628 reviewed; 0 comments

Summary by CodeRabbit

  • New Features

    • Added a mpgd target doctor check to validate target artifacts and release paths.
    • Introduced a reusable Phaser asset manifest/loader, and updated the starter template to load assets through it.
  • Bug Fixes

    • Improved release artifact handling so iOS sync outputs and related dependencies are copied into game-owned output folders.
    • Tightened artifact verification to keep paths inside the game directory and catch invalid layouts earlier.
  • Documentation

    • Updated setup and build docs to reflect the new install commands, artifact flow, and target ownership guidance.

@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: 23 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: 637efa6c-c086-403c-a6b3-124e162bf0ac

📥 Commits

Reviewing files that changed from the base of the PR and between 07d2c34 and ea7851a.

📒 Files selected for processing (7)
  • .sampo/changesets/ios-sync-game-artifact.md
  • .sampo/changesets/phaser-assets-package.md
  • packages/cli/templates/phaser-game/README.md
  • packages/phaser-assets/src/index.ts
  • packages/phaser-assets/test/index.test.ts
  • tools/smoke/verify-target-artifacts.ts
  • tools/target/build-target.ts
📝 Walkthrough

Walkthrough

This PR introduces a new @mpgd/phaser-assets package providing typed Phaser asset manifest definition and loading helpers, wires it into the Phaser starter template (BootScene, PlayScene, manifest module), adds a target doctor CLI subcommand for smoke verification, hardens artifact path validation against directory traversal, updates iOS/AIT release artifact copying to release-output/, and revises related documentation and Changesets entries.

Changes

Release artifact copy and target doctor validation

Layer / File(s) Summary
Release artifact copy to release-output
tools/target/build-target.ts, .sampo/changesets/ios-sync-game-artifact.md
The capacitor-ios and apps-in-toss build paths now copy synced/built outputs into release-output/ (including iOS Swift package dependencies), and manifests are written from the copied location.
Target artifact path validation
tools/smoke/verify-target-artifacts.ts
Adds assertPathInsideTargetBase and requireStringMatch, splits extra-required-resource resolution into file/path helpers, and reads apps-in-toss embedded config from a game/ subdirectory.
Target doctor CLI command
packages/cli/src/index.ts, .sampo/changesets/target-artifact-ownership.md
Adds a mpgd target doctor subcommand running smoke verification via runTargetMatrix, and updates the generated "Next steps" install command to pnpm install -w.
Docs for artifact ownership
README.md, docs/GAME_DEVELOPMENT.md
Clarifies that smoke and release artifacts are copied into the game app's artifacts/ and release-output/ directories.

Phaser assets package and starter template wiring

Layer / File(s) Summary
Phaser asset manifest package
packages/phaser-assets/src/index.ts, packages/phaser-assets/package.json, packages/phaser-assets/test/index.test.ts, packages/phaser-assets/tsconfig.json, .sampo/config.toml, .sampo/changesets/phaser-assets-package.md
New @mpgd/phaser-assets package with typed asset kinds, manifest definition/validation, and scene loading helpers, plus tests and config.
Starter template asset wiring
packages/cli/templates/phaser-game/src/assets/manifest.ts, .../scenes/BootScene.ts, .../scenes/PlayScene.ts, .../vite.config.ts, .../package.json, .../agent/game-manifest.json, .../README.md, .../agent/acceptance.md, apps/target-devvit/README.md, .sampo/changesets/create-game-phaser-assets.md
Template adds an asset manifest module, loads it in BootScene, switches PlayScene's marker to an image asset, and updates install commands to pnpm install -w plus supporting docs.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Possibly related PRs

  • imjlk/mpgd-kit#4: Both PRs make code-level changes to the same artifact-handling pipeline in tools/target/build-target.ts and tools/smoke/verify-target-artifacts.ts.
  • imjlk/mpgd-kit#7: Both PRs modify packages/cli/src/index.ts around doctor/target build and smoke orchestration.

Poem

A rabbit hops through release-output's door,
With markers as images now, not circles anymore. 🐇
Manifests loaded, assets in place,
Target doctor checks every base and space.
Hop, copy, validate — the build is set free!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: Phaser asset manifests plus the new target artifact doctor command.
Description check ✅ Passed The description is mostly complete and covers Summary and Validation in detail, though it omits the template's explicit Notes section.
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/ios-sync-game-output

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.

@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: 40465c4e0e

ℹ️ 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".

'ios: cap sync completed; set MPGD_RUN_IOS_SIMULATOR_BUILD=1 for a simulator .app or MPGD_RUN_IOS_ARCHIVE=1 for an xcarchive.',
);
releaseArtifact = 'release-output/ios/capacitor-sync';
replaceDirectory(`${shellApp}/ios`, targetPath(releaseArtifact));

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 copied iOS sync projects buildable

When the default iOS sync variant copies only ${shellApp}/ios into release-output/ios/capacitor-sync, the copied Xcode project loses the relative package layout that cap sync generated in the shell. In this repo the synced apps/mobile-capacitor/ios/App/CapApp-SPM/Package.swift references ../../../node_modules/@mpgd/capacitor-game-services, which is valid under apps/mobile-capacitor/ios but resolves to release-output/ios/node_modules/... after this copy. Any consumer opening or building the manifest artifact from the game output will fail to resolve the local Swift package even though smoke verification can still find the embedded config.

Useful? React with 👍 / 👎.

@imjlk imjlk changed the title fix: copy iOS sync artifacts to game output feat: add Phaser asset manifests and target artifact doctor Jul 6, 2026

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

Actionable comments posted: 1

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

Inline comments:
In `@packages/cli/templates/phaser-game/pnpm-workspace.yaml`:
- Line 2: The pnpm workspace entry is pointing at a package file instead of the
template root directory. Update the pnpm-workspace.yaml template to use the root
directory entry for the workspace package rather than the package.json path, so
the workspace correctly treats this template root as a directory.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fbb92c35-51cf-4948-b8b6-3fbb9c271b8a

📥 Commits

Reviewing files that changed from the base of the PR and between 40465c4 and 0b73628.

⛔ Files ignored due to path filters (2)
  • packages/cli/templates/phaser-game/src/assets/marker.svg is excluded by !**/*.svg
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (21)
  • .sampo/changesets/create-game-phaser-assets.md
  • .sampo/changesets/phaser-assets-package.md
  • .sampo/changesets/target-artifact-ownership.md
  • .sampo/config.toml
  • 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/game-manifest.json
  • packages/cli/templates/phaser-game/apps/target-devvit/README.md
  • packages/cli/templates/phaser-game/package.json
  • packages/cli/templates/phaser-game/pnpm-workspace.yaml
  • packages/cli/templates/phaser-game/src/assets/manifest.ts
  • packages/cli/templates/phaser-game/src/scenes/BootScene.ts
  • packages/cli/templates/phaser-game/src/scenes/PlayScene.ts
  • packages/cli/templates/phaser-game/vite.config.ts
  • packages/phaser-assets/package.json
  • packages/phaser-assets/src/index.ts
  • packages/phaser-assets/test/index.test.ts
  • packages/phaser-assets/tsconfig.json
  • tools/smoke/verify-target-artifacts.ts
  • tools/target/build-target.ts
✅ Files skipped from review due to trivial changes (10)
  • packages/cli/templates/phaser-game/agent/acceptance.md
  • packages/phaser-assets/tsconfig.json
  • packages/phaser-assets/test/index.test.ts
  • .sampo/changesets/phaser-assets-package.md
  • .sampo/changesets/create-game-phaser-assets.md
  • .sampo/changesets/target-artifact-ownership.md
  • packages/cli/templates/phaser-game/vite.config.ts
  • .sampo/config.toml
  • packages/cli/templates/phaser-game/apps/target-devvit/README.md
  • packages/cli/templates/phaser-game/README.md

@imjlk

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review
@coderabbitai review

Patched the outstanding review threads:

  • Fixed copied iOS sync artifacts so the local Swift package dependency resolves under release-output/ios/node_modules/@mpgd/capacitor-game-services; pnpm smoke:target ios now validates local Swift package paths from Package.swift.
  • Updated the generated Phaser starter pnpm-workspace.yaml to use the workspace root directory entry . instead of ./package.json.

Validation run locally:

  • pnpm exec ttsc --noEmit -p tsconfig.tools.json
  • pnpm --dir packages/cli check
  • pnpm validate:starter-workflow
  • generated starter install/check/build smoke with pnpm install -w
  • pnpm build:ios && pnpm smoke:target ios
  • pnpm check
  • ocr review --commit cc7324c (0 comments)

@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: cc7324c379

ℹ️ 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".

{
kind: 'image',
key: starterAssetKeys.marker,
url: createPhaserAssetUrl('./marker.svg', import.meta.url),

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 marker asset in production builds

In generated starters after pnpm build or any target build, this is the only reference to marker.svg, but it is just a string passed into createPhaserAssetUrl; Vite cannot see a call-site new URL('./marker.svg', import.meta.url) or ?url import, so it will not emit/copy the SVG into the production bundle. The helper then computes a URL relative to the JS chunk and Phaser loads a missing marker asset, breaking the new asset-manifest starter sample outside the dev server; use a Vite-visible URL/import here and pass that emitted URL into the manifest.

Useful? React with 👍 / 👎.

Comment thread tools/target/build-target.ts Outdated
} else {
console.warn('ait: package build skipped; release manifest points to wrapper webDir.');
releaseArtifact = 'release-output/ait/wrapper-web';
replaceDirectory(webDir, targetPath(releaseArtifact));

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 Copy the built AIT wrapper artifact

When MPGD_AIT_PACKAGE_MODE=skip is set (the template's --ait-variant wrapper path), the wrapper Vite build has just produced wrapperApp/dist, but this copies webDir, which is only the game's public/game payload. The release manifest then points at release-output/ait/wrapper-web even though that directory lacks the Apps in Toss wrapper/bridge bundle, so the target smoke/doctor path validates a plain game web build rather than the wrapper artifact users are trying to inspect.

Useful? React with 👍 / 👎.

Comment thread tools/smoke/verify-target-artifacts.ts Outdated
Comment on lines +68 to +69
for (const extraArtifact of extraRequiredArtifactsForTarget(targetConfig, artifactPath)) {
assertFileExists(extraArtifact, `${target} required artifact`);
assertPathExists(extraArtifact, `${target} required artifact`);

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 Require Devvit server entry to be a file

For devvit-web targets, extraRequiredArtifactsForTarget() still returns server/index.cjs, but this changed the check from file-only to assertPathExists, which also accepts directories. If a broken Devvit build leaves server/index.cjs/ as a directory or otherwise not a file, smoke:target, smoke-all, and the new doctor command now pass the server-entry validation even though the generated Devvit artifact cannot load the server module.

Useful? React with 👍 / 👎.

Comment on lines +141 to +142
if (!existsSync(packageFile)) {
return [];

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 Fail sync artifacts without the Swift package manifest

For the default iOS sync artifact (release-output/ios/capacitor-sync), App/CapApp-SPM/Package.swift is what records the local Swift package dependencies that make the copied Xcode project portable. Returning an empty list when that file is missing means smoke:target ios and target doctor can still pass a copied sync directory that lacks the SPM manifest entirely, as long as the web effective-config file is present; this should only be optional for built .app/.xcarchive artifacts, not for the sync project copy.

Useful? React with 👍 / 👎.

@imjlk

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review
@coderabbitai review

Patched the new review feedback in 07d2c34:

  • Phaser starter marker asset now uses a Vite-visible ./marker.svg?url import, so production builds include the asset URL/data URL.
  • AIT MPGD_AIT_PACKAGE_MODE=skip now copies the wrapper Vite dist, not just the game webDir. Smoke now verifies wrapper index.html, game/index.html, and embedded target config under game/.
  • Devvit server entry validation is file-only again for server/index.cjs.
  • iOS sync smoke now fails copied sync projects that lack App/CapApp-SPM/Package.swift, while still allowing built .app/.xcarchive artifacts.

Validation run locally:

  • pnpm exec ttsc --noEmit -p tsconfig.tools.json
  • pnpm --dir packages/cli check
  • pnpm validate:starter-workflow
  • generated starter pnpm install -w, pnpm check, pnpm build; verified marker SVG is bundled as a Vite data URL
  • MPGD_AIT_PACKAGE_MODE=skip pnpm build:ait && pnpm smoke:target ait
  • pnpm build:ios && pnpm smoke:target ios
  • pnpm build:devvit && pnpm smoke:target reddit
  • root pnpm build:ait && pnpm smoke:target ait
  • generated starter mpgd target build-all/smoke-all/doctor --targets web,ait --ait-variant wrapper
  • pnpm check
  • pnpm test
  • ocr review --commit 07d2c34 (0 comments)

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the detailed rundown of the fixes and validation steps in 07d2c34. Kicking off a fresh review of the latest 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.

@imjlk

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review
@coderabbitai review

Follow-up patch pushed in 883ef2e after local OCR feedback:

  • capacitor-sync detection now uses path.basename(...), so trailing slashes still fail missing App/CapApp-SPM/Package.swift as intended.

Additional validation:

  • pnpm exec ttsc --noEmit -p tsconfig.tools.json
  • pnpm smoke:target ios
  • ocr review --commit 883ef2e (0 comments)

The earlier 07d2c34 patch also covered the new Codex review threads for marker asset bundling, AIT wrapper dist copy, Devvit server file-only validation, and iOS sync Package.swift validation.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the update — good catch on normalizing the path with path.basename(...) to keep the trailing-slash case correctly failing the missing App/CapApp-SPM/Package.swift check. Kicking off a fresh review of 883ef2e 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 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tools/smoke/verify-target-artifacts.ts (1)

60-62: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Guard effectiveConfigPath with the target-base check too. resolveArtifactPath() preserves absolute paths, so a manifest-controlled entry.effectiveConfig.path can still point outside loadedPlatformTargets.baseDir and get read here.

🤖 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/smoke/verify-target-artifacts.ts` around lines 60 - 62, The artifact
verification logic currently validates only artifactPath against the target
base, but effectiveConfigPath can still be absolute and escape
loadedPlatformTargets.baseDir. Update verify-target-artifacts.ts so the
effectiveConfigPath used in the target check is also passed through
assertPathInsideTargetBase before assertPathExists, using the same target-based
guard pattern already applied to artifactPath; this should be done in the
verification flow around resolveArtifactPath and effectiveConfigPath handling.
🤖 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.

Outside diff comments:
In `@tools/smoke/verify-target-artifacts.ts`:
- Around line 60-62: The artifact verification logic currently validates only
artifactPath against the target base, but effectiveConfigPath can still be
absolute and escape loadedPlatformTargets.baseDir. Update
verify-target-artifacts.ts so the effectiveConfigPath used in the target check
is also passed through assertPathInsideTargetBase before assertPathExists, using
the same target-based guard pattern already applied to artifactPath; this should
be done in the verification flow around resolveArtifactPath and
effectiveConfigPath handling.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 27f83510-e9cb-40ea-aa62-2a8c8fa95b4d

📥 Commits

Reviewing files that changed from the base of the PR and between 0b73628 and 07d2c34.

📒 Files selected for processing (6)
  • .sampo/changesets/create-game-phaser-assets.md
  • .sampo/changesets/ios-sync-game-artifact.md
  • .sampo/changesets/target-artifact-ownership.md
  • packages/cli/templates/phaser-game/src/assets/manifest.ts
  • tools/smoke/verify-target-artifacts.ts
  • tools/target/build-target.ts
✅ Files skipped from review due to trivial changes (2)
  • .sampo/changesets/target-artifact-ownership.md
  • .sampo/changesets/create-game-phaser-assets.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .sampo/changesets/ios-sync-game-artifact.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: 883ef2ef2b

ℹ️ 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/phaser-assets/src/index.ts Outdated
Comment on lines +60 to +61
export function createPhaserAssetUrl(path: string, baseUrl: string | URL): string {
return new URL(path, baseUrl).href;

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 Do not hide Vite asset URLs behind a helper

When callers follow the new asset guidance and pass createPhaserAssetUrl('./file', import.meta.url), Vite cannot statically analyze this new URL because the relative path is now a function parameter. Dev may work from /src, but production builds leave the runtime URL relative to the emitted JS chunk and do not emit/hash the asset, so manifest entries can 404 on built targets; require callers to pass a Vite-emitted ?url import or keep the static new URL('./file', import.meta.url) at the call site.

Useful? React with 👍 / 👎.

Comment thread tools/target/build-target.ts Outdated
Comment on lines +200 to +202
releaseArtifact = 'release-output/ios/capacitor-sync';
replaceDirectory(`${shellApp}/ios`, targetPath(releaseArtifact));
copyIosSyncSwiftPackage(shellApp, '@mpgd/capacitor-game-services');

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 iOS sync dependencies inside the manifest artifact

In the iOS sync fallback, the release manifest points at release-output/ios/capacitor-sync, but copyIosSyncSwiftPackage writes the SwiftPM package to the sibling release-output/ios/node_modules path required by App/CapApp-SPM/Package.swift. Any handoff or automation that consumes entry.artifact as the artifact root gets a copied Xcode project with a broken local package reference; either make the manifest artifact the common release-output/ios root or copy/rewrite the Swift package dependency so it is contained in the advertised artifact.

Useful? React with 👍 / 👎.

@imjlk

imjlk commented Jul 6, 2026

Copy link
Copy Markdown
Owner Author

@codex review
@coderabbitai review

Patched the latest review feedback in ea7851a:

  • Removed createPhaserAssetUrl from @mpgd/phaser-assets so generated games use Vite-visible ?url imports or static call-site new URL('./file', import.meta.url) patterns instead of hiding asset paths behind a helper.
  • Kept iOS capacitor-sync handoff artifacts self-contained by copying the local Swift package dependency under release-output/ios/capacitor-sync/node_modules/... and rewriting App/CapApp-SPM/Package.swift to resolve it inside the advertised manifest artifact root.
  • Hardened target artifact smoke checks so effectiveConfig.path is guarded under the target base and iOS sync local Swift package paths must stay inside the artifact root.

Validation run locally:

  • pnpm --dir packages/phaser-assets check
  • pnpm --dir packages/phaser-assets test
  • pnpm exec ttsc --noEmit -p tsconfig.tools.json
  • pnpm --dir packages/cli check
  • pnpm validate:starter-workflow
  • pnpm build:ios
  • pnpm smoke:target ios
  • Verified release-output/ios/capacitor-sync/App/CapApp-SPM/Package.swift now points at ../../node_modules/@mpgd/capacitor-game-services and that dependency exists inside capacitor-sync.
  • pnpm check
  • pnpm test
  • ocr review --audience agent ... on the workspace diff (0 comments)
  • ocr review --commit ea7851a (0 comments)

@coderabbitai

coderabbitai Bot commented Jul 6, 2026 •

Copy link
Copy Markdown

@imjlk Thanks for the thorough update on ea7851a — removing createPhaserAssetUrl in favor of Vite-visible ?url imports/new URL(...) call sites is a good call for keeping asset paths statically analyzable by the bundler, and the additional hardening on the iOS capacitor-sync Swift package path resolution and effectiveConfig.path guarding looks like solid defense-in-depth. Kicking off a fresh review of the latest commit 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

Copy link
Copy Markdown

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

Reviewed commit: ea7851a59b

ℹ️ 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 33f2598 into main Jul 6, 2026
6 checks passed
@imjlk
imjlk deleted the codex/ios-sync-game-output branch July 6, 2026 14:13
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