Skip to content

Conversation

smithemely
Copy link

  • 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
@smithemely
Copy link
Author

I tested the updated implementation with various bundle identifier patterns in real projects, and it works correctly. The solution now handles:

  • Both quoted and unquoted identifiers
  • Extensions with multiple segments and dots
  • Preservation of specialized extension (.RunnerTests)
  • Proper detection of base identifiers

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.

@OutdatedGuy
Copy link
Owner

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.

@OutdatedGuy OutdatedGuy changed the title fix(ios): improve bundle identifier detection and replacement (#86) fix(ios): improve bundle identifier detection and replacement Apr 29, 2025
@OutdatedGuy OutdatedGuy linked an issue Apr 29, 2025 that may be closed by this pull request
Copy link
Owner

@OutdatedGuy OutdatedGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good to be. Just few questions and changes.

* 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
Copy link
Owner

@OutdatedGuy OutdatedGuy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

Issues with PRODUCT_BUNDLE_IDENTIFIER handling in iOS projects

2 participants