Conversation
📝 WalkthroughWalkthroughThe PR adds logic to synchronize the ChangesXcode Build Configuration Sync for CheckIn Widget
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/withCheckInLiveActivity.js (1)
447-461: ⚡ Quick winEliminate duplication: reuse existing host build config access.
Lines 426–437 already navigate to the host target's build configuration and read
firstHostConfig.buildSettings. Lines 447–461 duplicate this entire navigation with slightly different variable names (hostBuildConfigListIdvs.hostConfigListId) to readDEVELOPMENT_TEAMfrom the same object.Refactor by reading
DEVELOPMENT_TEAMat lines 433–434 alongside the version numbers.♻️ Proposed refactor to eliminate duplication
const hostTarget = project.getFirstTarget(); let hostMarketingVersion = null; let hostCurrentProjectVersion = null; + let hostDevelopmentTeam = null; const hostConfigListId = targetSection[hostTarget.uuid].buildConfigurationList; const hostConfigList = project.pbxXCConfigurationList()[hostConfigListId]; if (hostConfigList) { const firstHostConfigUuid = hostConfigList.buildConfigurations[0]?.value; if (firstHostConfigUuid) { const firstHostConfig = project.pbxXCBuildConfigurationSection()[firstHostConfigUuid]; if (firstHostConfig?.buildSettings) { hostMarketingVersion = firstHostConfig.buildSettings.MARKETING_VERSION || null; hostCurrentProjectVersion = firstHostConfig.buildSettings.CURRENT_PROJECT_VERSION || null; + hostDevelopmentTeam = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null; } } } // MARKETING_VERSION in pbxproj is already quoted (e.g., '"1.2.3"'); // config.version is raw (e.g., '1.2.3'), so wrap it in quotes. const resolvedMarketingVersion = hostMarketingVersion || (config.version ? `"${config.version}"` : '"1.0"'); // CURRENT_PROJECT_VERSION in pbxproj is an unquoted number string (e.g., '42'); // config.ios?.buildNumber is raw, pass through as-is. const resolvedCurrentProjectVersion = hostCurrentProjectVersion || (config.ios?.buildNumber ?? '1'); - // Resolve DEVELOPMENT_TEAM from the host target so the widget extension - // can be signed. EAS sets this on the main target during credential - // application; copying it here ensures the widget inherits it. - let hostDevelopmentTeam = null; - const hostBuildConfigListId = targetSection[hostTarget.uuid].buildConfigurationList; - const hostBuildConfigList = project.pbxXCConfigurationList()[hostBuildConfigListId]; - if (hostBuildConfigList) { - const firstHostConfigUuid = hostBuildConfigList.buildConfigurations[0]?.value; - if (firstHostConfigUuid) { - const firstHostConfig = project.pbxXCBuildConfigurationSection()[firstHostConfigUuid]; - if (firstHostConfig?.buildSettings) { - hostDevelopmentTeam = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null; - } - } - } - const buildConfigListId = targetSection[widgetTarget.uuid].buildConfigurationList;🤖 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 `@plugins/withCheckInLiveActivity.js` around lines 447 - 461, The code duplicates navigation to the host target's build configuration to read DEVELOPMENT_TEAM; instead reuse the already-resolved firstHostConfig from the earlier block where you read version numbers and set hostDevelopmentTeam = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null (or null if absent), then remove the later duplicated block that declares hostBuildConfigListId/hostBuildConfigList and repeats the lookup; keep references to project.pbxXCConfigurationList(), project.pbxXCBuildConfigurationSection(), and firstHostConfig as used earlier (ensure firstHostConfig is in scope where you add the DEVELOPMENT_TEAM read).
🤖 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 `@plugins/withCheckInLiveActivity.js`:
- Around line 447-461: The code duplicates navigation to the host target's build
configuration to read DEVELOPMENT_TEAM; instead reuse the already-resolved
firstHostConfig from the earlier block where you read version numbers and set
hostDevelopmentTeam = firstHostConfig.buildSettings.DEVELOPMENT_TEAM || null (or
null if absent), then remove the later duplicated block that declares
hostBuildConfigListId/hostBuildConfigList and repeats the lookup; keep
references to project.pbxXCConfigurationList(),
project.pbxXCBuildConfigurationSection(), and firstHostConfig as used earlier
(ensure firstHostConfig is in scope where you add the DEVELOPMENT_TEAM read).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f93442a9-6041-4870-a347-55a9f9b11c61
📒 Files selected for processing (1)
plugins/withCheckInLiveActivity.js
|
Approve |
Summary by CodeRabbit