fix(cli): make SPM dependency patch work on prereleases#8508
Conversation
| const preCapVersion = prerelease(iosPlatformVersion); | ||
| const forceVersion = preCapVersion ? iosPlatformVersion : `${majorCapVersion}.0.0`; |
There was a problem hiding this comment.
This also makes the change for dev and nightly builds of capacitor, which I'm unsure if we want that since those aren't available as capacitor-swift-pm versions. We could check the output of prerelease and check if it contains alpha, beta, or rc, but would like to get your thoughts if such a thing is useful to have or not.
There was a problem hiding this comment.
we should start publishing those then, since we already set the exact version in ios/App/CapApp-SPM/Package.swift, setting the Capacitor dependency value on the installed @capacitor/ios dependency, so that functionality is already broken.
There was a problem hiding this comment.
Good point then, it doesn't impact solely this PR; I tested it with a capacitor app and seems to work fine! Approving it ✅
if the capacitor/ios version is 9.0.0-alpha the CLI is setting the dependency to 9.0.0, which doesn't exist yet, so check if it's a prerelease and use the prerelease version as dependency instead of x.0.0