Project architecture, the generated-vs-handwritten file split, and the make pipeline are documented in the contributing guide — read it first:
@CONTRIBUTING.md
- Never hand-edit generated files:
Sources/*/Client.swift,Sources/*/Types.swift, and.spi.yml. InPackage.swift, only thesourceFoldersarray between theBEGIN/END GENERATEDmarkers is machine-written (byScripts/PackageBuilder.swift); everything else in that file is hand-maintained Swift. - Regenerate, don't edit:
Package.swiftfolder list:swift Scripts/PackageBuilder.swift Package.swift.spi.yml:swift package dump-package | swift Scripts/SPIManifestBuilder.swift
- Do not read generated sources whole —
Sources/*/{Client,Types}.swiftare megabytes each. Use grep/targeted reads to inspect the generated API. - Verify manifest changes with
swift package dump-package(compare JSON before/after) plus a smoke build of one small module, e.g.swift build --target GitHubRestAPIUsers. - Commit convention for regenerated artifacts:
Commit via running: make <file>(see thecommithelper in the Makefile). swift testhits the live GitHub API unauthenticated and can flake on rate limits; prefer targetedswift buildfor local verification.- README ships in two languages: keep
README.mdandREADME.zh-TW.mdin sync.