PureXML/third_party/rules-swift/exp/migration.md
Mihaela Mihaljevic c7ef8abfd9 chore(rules): pin rules-swift corpus, add gates and CI; drop redundant docs/rules mirror
Adopt the rules-swift pin-and-codify strategy in snapshot mode (third_party/rules-swift
@97dc70f + sha256), add codified gates, a conformance audit ledger, and
.github/workflows/rules-swift.yml (corpus-pin integrity required, full gate report mode).
Remove the docs/rules mirror it supersedes (repo-specific files kept under docs/). Style
and leak gates exclude the vendored corpus.
2026-06-30 14:02:40 +02:00

745 B

Migration Patterns

Extracting code into a new package; splitting a large package.

Extracting Code to New Package

# 1. Create new package structure
mkdir -p Sources/NewPackage
mkdir -p Tests/NewPackageTests

# 2. Move files
git mv OldPackage/SomeFeature.swift NewPackage/

# 3. Update Package.swift
# Add new target and product

# 4. Update imports in dependent files
# Change: import OldPackage
# To: import NewPackage

# 5. Rebuild
swift build

# 6. Run tests
swift test --filter NewPackageTests

Splitting Large Package

// Before: Large "Features" package
Features/
├── Auth/
├── Profile/
└── Settings/

// After: Separate feature packages
AuthFeature/
ProfileFeature/
SettingsFeature/