Skip to content

feat(cli): resolve the iOS Swift package from NPM package - #8644

Open
theproducer wants to merge 9 commits into
nextfrom
RMET-5489
Open

theproducer wants to merge 9 commits into
nextfrom
RMET-5489

Conversation

@theproducer

Copy link
Copy Markdown
Contributor

Description

Now that Capacitor for iOS is distributed via a source package and not a binary xcframework, we no longer need to fetch the package remotely, it can resolved from inside the NPM package itself.

Change Type

  • Fix
  • Feature
  • Refactor
  • Breaking Change
  • Documentation
  • Other (CI, chores, etc.)

Rationale / Problems Fixed

Tests or Reproductions

Screenshots / Media

Platforms Affected

  • Android
  • iOS
  • Web

Notes / Comments

@theproducer
theproducer requested review from a team and andredestro and removed request for a team October 6, 2026 15:00
# Conflicts:
#	cli/src/util/capacitor-package.ts

@jcesarmobile jcesarmobile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would remove the whole capacitorPackage configuration that was added earlier, I see no point in letting people use a different version than the npm installed version, we have nightlies if people want to use unreleased changes, or cloning the repo and installing from a local folder is always an option.

Comment thread package.json Outdated
Comment thread ios/Package.swift Outdated
OS-pedrogustavobilro added a commit to ionic-team/capacitor-docs that referenced this pull request Oct 14, 2026

@jcesarmobile jcesarmobile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested with a Capacitor plugin and a Cordova plugin and it was patching/generating their Package.swift files fine, but since there is code for handling the case of an older @capacitor/ios version being installed, I installed @capacitor/ios 8.x and when I ran sync, the cordova plugin's Package.swift was generated fine, but the Capacitor plugin was still using the path instead of the capacitor-swift-spm.

To be honest, I don't think we should have that code for handing older @capacitor/ios versions, it should assume it's Capacitor 9 or newer, we can keep the Package.swift file check so in case users are using a previous alpha they are instructed to update, that would also fire if they are in 8.x or older, at the moment it doesn't fire because we do the version check first.

So, I short, we should not point to capacitor-swift-pm repository, we should always point to the locally installed @capacitor/ios and if it doesn't have a Package.swift, warn about it (it already does)

This branch has not been deployed

No deployments
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.

3 participants