SPM: wire local plugins correctly — add Package.swift to each plugin's files array

Root cause of the SPM runtime regressions (call/chat push when closed, photo save):
our local file: plugins didn't function because their package.json `files` array
omitted "Package.swift", so npm can drop it from node_modules on install → cap sync
can't wire the plugin into the CapApp-SPM package → the plugin isn't loaded at
runtime. Official plugins all list Package.swift in files; ours now do too.

Also add build-log diagnostics (node_modules symlink/copy + Package.swift presence,
and the generated CapApp-SPM/Package.swift) so the wiring is provable, not guessed.

Reapplies the SPM migration (Step B) that was reverted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-03 15:56:13 +05:30
parent 7f54182186
commit b68ba94d2a
5 changed files with 17 additions and 4 deletions
+9
View File
@@ -52,6 +52,15 @@ workflows:
# present, NO Podfile) — if a Podfile appears, the SPM flag didn't take and we'd need to fix it.
test -d ios/App/App.xcodeproj || { echo "ERROR: iOS Xcode project not generated"; ls -la ios/App || true; exit 1; }
echo "iOS project layout:"; ls -la ios/App
# ── Diagnose local-plugin SPM wiring (the regression: our file: plugins didn't function at runtime) ──
echo "=== local plugins in node_modules — symlink vs copy, and is Package.swift present? ==="
for p in native-call media-library audio-route share-inbox; do
echo "-- $p --"; ls -ld "node_modules/$p" 2>/dev/null || echo " (dir missing)"
( ls "node_modules/$p/Package.swift" >/dev/null 2>&1 && echo " Package.swift PRESENT" ) || echo " Package.swift MISSING"
done
echo "=== CapApp-SPM Package.swift — are our local plugins + LiveKit wired in? ==="
CAPSPM=$(find ios -path "*CapApp-SPM*Package.swift" 2>/dev/null | head -1)
if [ -n "$CAPSPM" ]; then echo "found: $CAPSPM"; cat "$CAPSPM"; else echo " CapApp-SPM/Package.swift NOT FOUND"; find ios -name Package.swift 2>/dev/null; fi
# App icon + splash from resources/icon.png & resources/splash*.png (1024x1024 icon, 2732² splash).
npx capacitor-assets generate --ios || echo "asset generation skipped"
+2 -1
View File
@@ -10,7 +10,8 @@
"files": [
"dist/",
"ios/",
"AudioRoute.podspec"
"AudioRoute.podspec",
"Package.swift"
],
"capacitor": {
"ios": {
+2 -1
View File
@@ -10,7 +10,8 @@
"files": [
"dist/",
"ios/",
"MediaLibrary.podspec"
"MediaLibrary.podspec",
"Package.swift"
],
"capacitor": {
"ios": {
+2 -1
View File
@@ -10,7 +10,8 @@
"files": [
"dist/",
"ios/",
"NativeCall.podspec"
"NativeCall.podspec",
"Package.swift"
],
"capacitor": {
"ios": {
+2 -1
View File
@@ -10,7 +10,8 @@
"files": [
"dist/",
"ios/",
"ShareInbox.podspec"
"ShareInbox.podspec",
"Package.swift"
],
"capacitor": {
"ios": {