You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add Swift Package helper methods and fix test runner issue (#45)
* Add Swift Package helper methods and fix test runner issue
This PR addresses GitHub issue #31 by adding convenient helper methods
for working with Swift packages, and fixes a pre-existing Bun test
runner issue.
## New Helper Methods
**PBXProject:**
- `addPackageReference(ref)` - Add package reference to project
- `getPackageReference(identifier)` - Find package by URL or path
- `addRemoteSwiftPackage(opts)` - Create and add remote package
- `addLocalSwiftPackage(opts)` - Create and add local package
**PBXNativeTarget:**
- `addSwiftPackageProduct(opts)` - Full wiring: creates product dep,
adds to target, creates build file, adds to frameworks phase
- `getSwiftPackageProductDependencies()` - Get all package deps
- `removeSwiftPackageProduct(dep)` - Remove with cleanup
**PBXBuildFile:**
- `createFromProductRef(opts)` - Create build file for Swift packages
## Bug Fixes
- Fixed `fileRef` to be optional in PBXBuildFile (required for SPM)
- Fixed Bun test runner "export not found" error by using proper
`export type` for AnyBuildPhase in index.ts
- Fixed circular dependency in utils/paths.ts by importing directly
from source files instead of index
## Tests
Added comprehensive tests for all new functionality (50 new tests).
Closes#31
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add Swift Package Manager documentation to README
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix TypeScript errors in SwiftPackage tests
Cast json.objects access to any for property access.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
0 commit comments