Skip to content

fix(cli): make SPM dependency patch work on prereleases#8508

Merged
jcesarmobile merged 1 commit into
mainfrom
RMET-5253
Jun 15, 2026
Merged

fix(cli): make SPM dependency patch work on prereleases#8508
jcesarmobile merged 1 commit into
mainfrom
RMET-5253

Conversation

@jcesarmobile

Copy link
Copy Markdown
Member

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

Comment thread cli/src/ios/update.ts
Comment on lines +73 to +74
const preCapVersion = prerelease(iosPlatformVersion);
const forceVersion = preCapVersion ? iosPlatformVersion : `${majorCapVersion}.0.0`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good point then, it doesn't impact solely this PR; I tested it with a capacitor app and seems to work fine! Approving it ✅

OS-pedrogustavobilro added a commit to OS-pedrogustavobilro/capacitor-alpha9-spm that referenced this pull request Jun 15, 2026
@jcesarmobile jcesarmobile merged commit 6048e90 into main Jun 15, 2026
7 checks passed
@jcesarmobile jcesarmobile deleted the RMET-5253 branch June 15, 2026 10:11
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.

2 participants