Skip to content

[codex] Add Capacitor SPM product alias - #18

Open
riderx wants to merge 1 commit into
mainfrom
codex/fix-spm-product-alias
Open

[codex] Add Capacitor SPM product alias#18
riderx wants to merge 1 commit into
mainfrom
codex/fix-spm-product-alias

Conversation

@riderx

@riderx riderx commented May 24, 2026

Copy link
Copy Markdown
Member

What

  • Add the CapgoCapacitorAudioSession SwiftPM library product alias while keeping the existing CapgoCapacitorPluginAudioSession product.
  • Add a wiring check that requires the Capacitor-generated SPM product name derived from the npm package name.
  • Make packed-package CI verification create a minimal temporary Capacitor app when the repo has no example-app/ fixture.
  • Refresh Package.resolved to the Capacitor 8 SwiftPM package selected by the existing from: "8.0.0" requirement.

Why

  • Capacitor v8 generated app wrapper packages request CapgoCapacitorAudioSession for @capgo/capacitor-audio-session.
  • The plugin only exported CapgoCapacitorPluginAudioSession, so host apps could fail during Xcode package resolution.
  • CI already expected packed-package verification, but this repo did not contain the fixture it tried to copy.

How

  • Added a second .library product that points to the existing AudioSessionPlugin target.
  • Derived the expected generated product name from package.json in the wiring script and fail when it is missing.
  • Added a fallback temporary app in .github/scripts/verify-packed-example.sh.

Testing

  • bun run check:wiring
  • swift package describe --type json
  • bun run fmt
  • bun run lint
  • bun run verify:web
  • bun run verify:ios
  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 ANDROID_HOME=$HOME/Library/Android/sdk ANDROID_SDK_ROOT=$HOME/Library/Android/sdk PATH=/opt/homebrew/opt/openjdk@21/bin:$PATH bun run verify:android
  • bash ./.github/scripts/verify-packed-example.sh web
  • bash ./.github/scripts/verify-packed-example.sh ios
  • JAVA_HOME=/opt/homebrew/opt/openjdk@21 ANDROID_HOME=$HOME/Library/Android/sdk ANDROID_SDK_ROOT=$HOME/Library/Android/sdk PATH=/opt/homebrew/opt/openjdk@21/bin:$PATH bash ./.github/scripts/verify-packed-example.sh android

Not Tested

  • Full Capgo app build with this package restored from a published version, because this PR must ship first before Capgo can consume the fixed package.

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

@github-actions

Copy link
Copy Markdown
Contributor

Beta npm build

Maintainers can publish this PR to npm for fast testing.

Comment /publish-beta after the PR checks are green.

The workflow will:

  • publish a prerelease package on the beta tag
  • add a pinned pr-18 dist-tag for this exact PR build
  • update this comment with the install command

Security note: beta publish is only enabled for branches inside this repository.

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@riderx, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 2 reviews/hour. Refill in 24 minutes.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

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

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2e4b2159-9a71-41a8-9eb4-d64119de5089

📥 Commits

Reviewing files that changed from the base of the PR and between 8747114 and 70ea461.

📒 Files selected for processing (4)
  • .github/scripts/verify-packed-example.sh
  • Package.resolved
  • Package.swift
  • scripts/check-capacitor-plugin-wiring.mjs
📝 Walkthrough

Walkthrough

This PR fixes iOS SwiftPM product naming consistency by updating Package.swift product declarations, upgrading the capacitor-swift-pm dependency to 8.3.4, and enhancing the plugin wiring validation script to automatically derive and verify product names from package.json conventions.

Changes

iOS SwiftPM Product Naming Fix

Layer / File(s) Summary
Dependency Update
Package.resolved
Capacitor Swift PM dependency pinned to version 8.3.4 with new revision hash.
Package Manifest Product Declarations
Package.swift
CapgoCapacitorPluginAudioSession library explicitly declares targets: ["AudioSessionPlugin"], and CapgoCapacitorAudioSession product name adjusted in products section.
Validation Script Product Name Checking
scripts/check-capacitor-plugin-wiring.mjs
Helper functions convert package.json names to PascalCase product names; iOS SwiftPM validation derives expected product name from package.json and verifies presence in Package.swift library declarations with specific error messaging.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

🚥 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 '[codex] Add Capacitor SPM product alias' directly matches the main change: adding a second SwiftPM library product alias to support Capacitor v8's generated package name.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@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 `@scripts/check-capacitor-plugin-wiring.mjs`:
- Around line 207-214: Guard calls to packageNameToSpmProductName by verifying
the package object has a valid name string before deriving the SPM product;
specifically, check that pkg && typeof pkg.name === "string" (or similar) and
report a wiring error or skip processing when missing instead of calling
packageNameToSpmProductName, and apply the same guard to the other call site
that currently invokes packageNameToSpmProductName (the second occurrence in
this file) so the script no longer throws when package.json lacks a name.
🪄 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: ASSERTIVE

Plan: Pro

Run ID: 3c3b3a7a-eef9-4965-b4dc-848d947e7253

📥 Commits

Reviewing files that changed from the base of the PR and between ce6ae73 and 8747114.

📒 Files selected for processing (3)
  • Package.resolved
  • Package.swift
  • scripts/check-capacitor-plugin-wiring.mjs

Comment thread scripts/check-capacitor-plugin-wiring.mjs
@riderx
riderx force-pushed the codex/fix-spm-product-alias branch from 8747114 to bd8de0f Compare May 24, 2026 12:23
@riderx
riderx force-pushed the codex/fix-spm-product-alias branch from bd8de0f to 70ea461 Compare May 24, 2026 12:33
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