fix(ios): improve bundle identifier detection and replacement#87
fix(ios): improve bundle identifier detection and replacement#87OutdatedGuy merged 7 commits intoOutdatedGuy:mainfrom
Conversation
smithemely
commented
Apr 22, 2025
- fix: handle both quoted and unquoted bundle identifiers
- feat: implement smarter base identifier detection logic
- fix: properly preserve extensions with multiple segments
…edGuy#86) * fix: handle both quoted and unquoted bundle identifiers * feat: implement smarter base identifier detection logic * fix: properly preserve extensions with multiple segments
|
I tested the updated implementation with various bundle identifier patterns in real projects, and it works correctly. The solution now handles:
This fix ensures bundle identifiers are consistently renamed throughout the project file while maintaining the structure of complex extension identifiers. It's more robust than the previous implementation. |
|
I'll test this once I get some free time. Although I was thinking of adding an additional property where users can provide the old package name, so no need for any complex logic. |
* fix: use RegExp.escape to safely handle special characters * perf: deduplicate identifiers upfront with Set * feat: smart base detection by counting extensions * fix: correct character class with dash at end [A-Za-z0-9._-] * refactor: single replaceAllMapped for all identifier patterns
OutdatedGuy
left a comment
There was a problem hiding this comment.
LGTM! Can you write one test that uses the updated logic to test around 20-30 different bundle ids, with/without quotes, extension, special characters, etc.
There was a problem hiding this comment.
Pull Request Overview
This PR improves the iOS bundle identifier detection and replacement logic by implementing a smarter approach to handle both quoted and unquoted bundle identifiers, detect the base identifier through extension counting, and preserve multi-segment extensions correctly.
- Replaces regex-based bundle identifier replacement with an extraction-first approach
- Implements heuristic-based base identifier detection by counting extensions
- Preserves original quoting style (quoted vs unquoted) in replacements
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
… improve bundle identifier matching logic