Skip to content

fix(ios): improve bundle identifier detection and replacement#87

Merged
OutdatedGuy merged 7 commits intoOutdatedGuy:mainfrom
smithemely:patch-1
Nov 12, 2025
Merged

fix(ios): improve bundle identifier detection and replacement#87
OutdatedGuy merged 7 commits intoOutdatedGuy:mainfrom
smithemely:patch-1

Conversation

@smithemely
Copy link
Contributor

  • 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
Contributor 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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

OutdatedGuy and others added 2 commits November 12, 2025 09:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

OutdatedGuy and others added 3 commits November 12, 2025 09:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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!

@OutdatedGuy OutdatedGuy merged commit b7b5406 into OutdatedGuy:main Nov 12, 2025
1 check passed
@OutdatedGuy OutdatedGuy mentioned this pull request Dec 4, 2025
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