Skip to content

Allow app SPMPackages to override plugin SPMPackages by name#3

Merged
farfromrefug merged 3 commits into
mainfrom
copilot/allow-app-snpm-package-override
Jan 25, 2026
Merged

Allow app SPMPackages to override plugin SPMPackages by name#3
farfromrefug merged 3 commits into
mainfrom
copilot/allow-app-snpm-package-override

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 20, 2026

Plugins can define SPMPackages in their nativescript.config.ts, but apps had no way to override the version, URL, or libs. Plugin packages were unconditionally merged into the app's packages.

Changes

  • lib/services/ios/spm-service.ts: Extract mergePluginSPMPackages() method that skips plugin packages when an app package with the same name exists. Logs override occurrences at trace level.

  • test/spm-service.ts: Unit tests covering override scenarios (version conflicts, local packages, no conflicts).

Example

// Plugin's nativescript.config.ts
ios: {
  SPMPackages: [{
    name: "FirebaseCore",
    repositoryURL: "https://github.com/firebase/firebase-ios-sdk",
    version: "9.0.0",
    libs: ["FirebaseCore"]
  }]
}

// App's nativescript.config.ts (overrides)
ios: {
  SPMPackages: [{
    name: "FirebaseCore",
    repositoryURL: "https://github.com/firebase/firebase-ios-sdk",
    version: "10.5.0",  // App version takes precedence
    libs: ["FirebaseCore", "FirebaseAnalytics"]
  }]
}

Result: FirebaseCore 10.5.0 is applied, plugin's 9.0.0 is skipped.

Original prompt

right now when a plugin defines a nativescript.config.ts with SPMPackages in it the user can't override the SPMPackage version, url or libs. I would like it to be possible.
I am thinking that it should be possible using the app nativescript.config.ts. I am thinking that, when handling plugins SPMPackages, if we find an app SPMPackages package with the same name we use the one from the app. Makes sense to let the app say i want a different/updated version


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 20, 2026 14:05
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Co-authored-by: farfromrefug <655344+farfromrefug@users.noreply.github.com>
Copilot AI changed the title [WIP] Enable app to override SPMPackage configuration Allow app SPMPackages to override plugin SPMPackages by name Jan 20, 2026
Copilot AI requested a review from farfromrefug January 20, 2026 14:12
@farfromrefug farfromrefug marked this pull request as ready for review January 25, 2026 14:58
@farfromrefug farfromrefug merged commit c124134 into main Jan 25, 2026
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