Skip to content

Fix XCLocalSwiftPackageReference type definition#35

Merged
EvanBacon merged 4 commits into
mainfrom
@evanbacon/XCLocalSwiftPackageReference
Feb 27, 2026
Merged

Fix XCLocalSwiftPackageReference type definition#35
EvanBacon merged 4 commits into
mainfrom
@evanbacon/XCLocalSwiftPackageReference

Conversation

@EvanBacon
Copy link
Copy Markdown
Owner

Summary

  • Remove incorrect path property from XCLocalSwiftPackageReference
  • Make relativePath required (was optional)
  • Fix misleading comment that was copied from XCRemoteSwiftPackageReference

Context

The original implementation was based on CocoaPods/Xcodeproj which defines both path and relative_path. However, this appears to be inaccurate:

  1. Real pbxproj files generated by Xcode only contain relativePath
  2. The tuist/XcodeProj Swift implementation only defines relativePath
  3. The CocoaPods comment on path says "repository url" which doesn't make sense for a local package

Test plan

  • Build passes
  • All 210 tests pass

🤖 Generated with Claude Code

EvanBacon and others added 4 commits February 27, 2026 11:26
Remove incorrect `path` property and make `relativePath` required.
The `path` property was based on CocoaPods/Xcodeproj which appears to
have an inaccuracy - real pbxproj files only contain `relativePath`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace `Record<string, any>` with a discriminated union type that
captures all version requirement variants:
- upToNextMajorVersion
- upToNextMinorVersion
- versionRange
- exactVersion
- branch
- revision

Also fix repositoryURL to be optional per the Swift implementation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
productName is always present in real pbxproj files. Also added
documentation about the "plugin:" prefix for plugin dependencies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 24 tests covering:
- XCLocalSwiftPackageReference: create, getDisplayName, is()
- XCRemoteSwiftPackageReference: parsing, all 6 version requirement types
- XCSwiftPackageProductDependency: parsing, create with local/remote refs
- Round-trip serialization for all SPM types

Also fix XCSwiftPackageProductDependency.getObjectProps() to properly
declare `package` as a reference property, enabling automatic
inflation/deflation of package references.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@EvanBacon EvanBacon merged commit 8e49ff6 into main Feb 27, 2026
1 check passed
@EvanBacon EvanBacon deleted the @evanbacon/XCLocalSwiftPackageReference branch February 27, 2026 19:36
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.

1 participant