fix(demo-ios): reference GutenbergKit as a local Swift package#559
Open
dcalhoun wants to merge 2 commits into
Open
fix(demo-ios): reference GutenbergKit as a local Swift package#559dcalhoun wants to merge 2 commits into
dcalhoun wants to merge 2 commits into
Conversation
The demo project wired the repo root in as a plain folder reference (`PBXFileReference` with `path = ../..`) rather than a package reference. Xcode treats a folder-referenced local package as an editable root package, so it wrote the demo app's merged dependency graph — including `wordpress-rs` — into the library's own `Package.resolved` at the repo root. That produced a recurring, unwanted diff: opening the demo app in Xcode added a `wordpress-rs` pin to the root lockfile, and resolving the Swift package on its own removed it again. Declare the root as an `XCLocalSwiftPackageReference` instead. The demo app's graph now resolves into a demo-scoped lockfile under `project.xcworkspace/xcshareddata/swiftpm/`, leaving the library's `Package.resolved` untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Pins the demo app's dependency graph (SVGView, SwiftSoup, wordpress-rs) so the app and its E2E tests resolve reproducibly. This lockfile is scoped to the demo app and is separate from the library's root `Package.resolved`, which consumers resolve independently. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
XCFramework BuildThis PR's XCFramework is available for testing. Add the following to your .package(url: "https://github.com/wordpress-mobile/GutenbergKit", branch: "pr-build/559")Built from 3ce66a9 |
dcalhoun
commented
Jul 21, 2026
| "location" : "https://github.com/scinfu/SwiftSoup.git", | ||
| "state" : { | ||
| "revision" : "ead56133a693d0184d8c2db1a6d6394410cacfd6", | ||
| "version" : "2.13.6" |
Member
Author
There was a problem hiding this comment.
The below is referenced in the PR description. I don't believe this is an issue, but let me know if you do.
That demo lockfile is committed so the demo app and its E2E tests resolve reproducibly. It pins SwiftSoup 2.13.6 while the root pins 2.8.8 — expected, since these are now independent graphs and both satisfy
from: "2.7.5".
dcalhoun
marked this pull request as ready for review
July 21, 2026 20:22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Stops the iOS demo app from rewriting the library's root
Package.resolvedevery time the project is opened in Xcode.Why?
Opening
ios/Demo-iOS/Gutenberg.xcodeprojadded awordpress-rspin to the repo-rootPackage.resolved; resolving the Swift package on its own removed it again. The result was a recurring diff that had to be discarded by hand.The root cause is in the demo project: it referenced the repo root as a plain folder (
PBXFileReferencewithpath = ../..) rather than as a package. Xcode treats a folder-referenced local package as an editable root package, so it wrote the demo app's merged dependency graph — includingwordpress-rs, which is a demo-app dependency and not aGutenbergKitlibrary dependency — into the library's own lockfile.How?
Declare the root as an
XCLocalSwiftPackageReferenceand drop the folder reference. The demo app's graph now resolves into a demo-scoped lockfile underproject.xcworkspace/xcshareddata/swiftpm/, leaving the library'sPackage.resolveduntouched.That demo lockfile is committed so the demo app and its E2E tests resolve reproducibly. It pins SwiftSoup 2.13.6 while the root pins 2.8.8 — expected, since these are now independent graphs and both satisfy
from: "2.7.5".Testing Instructions
ios/Demo-iOS/Gutenberg.xcodeprojin Xcode and let packages resolve.git status— the rootPackage.resolvedshould be unmodified.To see the previous behavior, repeat step 1 on
trunk: the rootPackage.resolvedgains awordpress-rspin.Verified locally with DerivedData and the demo lockfile deleted beforehand, so the result is not a warm-cache artifact:
Package.resolved.xcodebuild build -scheme Gutenbergsucceeds, and the built app containsGutenbergKit_GutenbergKitResources.bundle, confirming the local package links.