Skip to content

feat(cli): add experimental packageOptions#8471

Merged
jcesarmobile merged 4 commits into
mainfrom
RMET-5206
May 26, 2026
Merged

feat(cli): add experimental packageOptions#8471
jcesarmobile merged 4 commits into
mainfrom
RMET-5206

Conversation

@jcesarmobile
Copy link
Copy Markdown
Member

In addition of the folder name conflict, I found another conflict with target names, so for the folder name problem I added symlink option, which will create a symbolic link to the node_modules folder inside a new symlinks folder (so we can remove it on update to remove old symbolic links before doing the copy and configuration of existing plugins), since we don't keep track of existing plugins, it's better to just remove everything and start over to not have dangling symlinks after plugin removals.

For target name conflicts I added moduleAliases, where you put the existing target name, and the name to be used as alias

can be tested on https://github.com/jcesarmobile/devicecollision which has both @capacitor/device and @capacitor-community/device and when you fix the folder name problem with symlink: true, the target name problem appears. Adding this to solve both problems:

experimental: {
    ios: {
      spm: {
        packageOptions: {
          '@capacitor-community/device': {
            symlink: true, 
            moduleAliases: {
              'DevicePlugin': 'CommunityDevicePlugin',
            }
        }
        }
      }
    }
  }

closes #8451

We should probably put the packageTraits inside packageOptions, but didn't do it since it would be breaking, we could do it for Capacitor 9, unless we update to Swift 6 and we could make them non experimental.

@OS-pedrogustavobilro OS-pedrogustavobilro self-assigned this May 22, 2026
Comment thread cli/src/declarations.ts Outdated
Copy link
Copy Markdown
Contributor

@OS-pedrogustavobilro OS-pedrogustavobilro left a comment

Choose a reason for hiding this comment

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

Tested with your app and a few others, everything's working well, very nice!

@jcesarmobile jcesarmobile merged commit 258867b into main May 26, 2026
5 of 6 checks passed
@jcesarmobile jcesarmobile deleted the RMET-5206 branch May 26, 2026 10:00
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.

[Bug]: SwiftPM identity collision between plugin and transitive dependency

2 participants