feat(ios): manage generated modulemaps in CLI-controlled directory instead of node_modules#6063
feat(ios): manage generated modulemaps in CLI-controlled directory instead of node_modules#6063edusperoni wants to merge 2 commits into
Conversation
…stead of node_modules
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthrough
ChangesModulemap CLI-managed directory refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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.
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 `@lib/services/ios-project-service.ts`:
- Around line 1739-1745: The call to this.$fs.readDirectory(headersFolderPath)
will throw an error if the headersFolderPath directory does not exist, and there
is no guard to prevent this. Add an existence check using this.$fs.getFsStats or
a similar method before calling readDirectory to verify that headersFolderPath
exists and is a directory. If the directory does not exist, handle it gracefully
by returning an empty array or skipping the operation, so the filter operation
on headerFiles can proceed safely without throwing.
🪄 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: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 637c453c-b36e-4c97-848f-92ccf6eb636f
📒 Files selected for processing (2)
lib/services/ios-project-service.tstest/ios-project-service.ts
A plugin can ship a static lib (.a) without an include/{lib} headers
folder. Check the headers dir exists before readDirectory so we bail out
gracefully (clean up any stale modulemap, return false) instead of
throwing. Addresses PR review feedback.
PR Checklist
What is the current behavior?
When preparing an iOS plugin that ships a static library (
.a) with headers, the CLI generates amodule.modulemapand writes it intonode_modules— next to the plugin's headers atnode_modules/{plugin}/platforms/ios/.../include/{lib}/module.modulemap. This mutatesnode_modules, which should be treated as immutable (it breaks clean/reproducible installs, dirties caches, and is the iOS counterpart to the Android side writing generated.aars back intonode_modules).What is the new behavior?
The generated modulemap is now written into a CLI-managed directory under the platform root —
platforms/ios/.plugins/{lib}/module.modulemap— and never intonode_modules.generateModulemap()writes to the new.pluginslocation and references the plugin's headers in place via relative paths (header "<relative path back to node_modules>"), so no headers are copied or linked andnode_modulesis left untouched. It now returns a boolean indicating whether a modulemap was produced.addStaticLibrary()adds the.plugins/{lib}directory toHEADER_SEARCH_PATHSso clang discovers the module from the new location;removeStaticLibs()removes it symmetrically on plugin removal.HEADER_SEARCH_PATHS, which the CLI controls — so this works on any iOS runtime version.Tests for
generateModulemapwere updated to cover the new output location, the relative header paths, and the boolean return value.Summary by CodeRabbit
module.modulemapgeneration into a dedicated CLI-managed directory under the iOS project root.