refactor: rename usfm/USFM to passageId/bookId across SDK - #123
Closed
bryanmontz wants to merge 4 commits into
Closed
bryanmontz wants to merge 4 commits into
bryanmontz wants to merge 4 commits into
Conversation
USFM is an esoteric term and we weren't using it precisely. Replace it with passage-id vocabulary throughout the public surface and internals. - BibleReference: stored `bookUSFM` -> `bookId`, `asUSFM` -> `passageId`, `chapterUSFM` -> `chapterPassageId`. Explicit CodingKeys preserve the JSON wire format (`"bookUSFM"`). - BibleVersion: `bookUSFMs` -> `bookIds`; internal param/local names updated. `book(with:)` / `reference(with:)` / `chapterLabels(_:)` keep their external selectors. - Internal `BibleContentStorage.chapter(versionId:usfm:)` -> `(versionId:passageId:)`; renaming flows through ChapterRepository, HighlightsCache/Repository/ViewModel, URLBuilder, UI rendering, Reader view models. - All deprecated old names kept as `@available(*, deprecated, renamed:)` forwarders so this is source-compatible. API stability check still passes (additive only). - Tests, Examples/SampleApp, and README updated to the new names. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- BibleReference.chapterPassageId: drop misleading optional; both contributing properties are non-optional so the value is always defined. Removes dead `guard let` branches at internal call sites. The deprecated `chapterUSFM: String?` forwarder is unchanged. - BibleVersionTests: rename parameterized test `bookUSFMValidation` -> `bookIdValidation` to match the renamed parameter and set. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Member
|
There need to be new API baseline files added to this PR, right? Given the newly public symbols. |
davidfedor
requested changes
May 18, 2026
| case versionMetadata(versionId: Int) | ||
| case chaptersDirectory(versionId: Int) | ||
| case chapter(versionId: Int, usfm: String) | ||
| case chapter(versionId: Int, passageId: String) |
Member
There was a problem hiding this comment.
This ends up being unclear what is meant by "passageId" here, when looked at in isolation. It might mean just the three-letter book code, or it might mean "JHN.3", or "JHN.3.16", and typechecking isn't going to help either. I think "bookId" is right.
Resolve conflict in BibleVersion+Additions.swift: take main's verseEnd invariant fix (assertionFailure when verseStart is set but verseEnd is nil) while keeping this branch's bookId rename. Apply the usfm->passageId/bookId rename to test content merged in from main (NavigationTests, BibleReferenceTests, BibleVersionDisplayTitleTests) so the branch no longer uses its own deprecated APIs. JSON wire-format keys remain "bookUSFM". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
✅ Commit Lint: passedAll commit messages in this PR conform to Conventional Commits. 📦 Release preview:
|
Contributor
Code Coverage ReportCoverage after merging bdm/rename-usfm-to-passage-id into main will be
Coverage Report
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Member
|
since this PR is ancient, I'm closing it, and having Codex do the same concepts, starting fresh. |
Contributor
Author
|
@davidfedor Sounds good. Sorry I left it forever! |
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.
Summary
usfm/USFMvocabulary topassageId/bookIdacross the SDK's public surface and internals.@available(*, deprecated, renamed:)forwarder.BibleReference'sCodingKeysare made explicit so the JSON wire format ("bookUSFM", etc.) is preserved.Examples/SampleApp, andREADME.mdto use the new names.Public-API renames (with deprecated forwarders kept)
BibleReference.bookUSFM→bookId(stored)BibleReference.init(versionId:bookUSFM:chapter:verse:)→…:bookId:…BibleReference.init(versionId:bookUSFM:chapter:verseStart:verseEnd:)→…:bookId:…BibleReference.asUSFM→passageIdBibleReference.chapterUSFM→chapterPassageIdBibleVersion.bookUSFMs→bookIdsInternal renames
BibleContentStorage.chapter(versionId:usfm:)→(versionId:passageId:)bookUSFM,usfm,chapterUSFM,asUSFM,subUSFMs,StateIn.bookUSFM,StateUp.bookUSFM, etc.) updated to match the new vocabulary throughoutChapterRepository,HighlightsCache,HighlightsRepository,HighlightsViewModel,URLBuilder,BibleVersionRendering,BibleAttributedString,BibleCardView,BibleTextView,BibleVersion+Additions, and the Reader view models / header / intro views.Test plan
swift build— cleanswift test— 365 tests passingscripts/check-api-stability.sh check— PASSED (additive only; no breaking changes)swiftlint --strict— 0 violations🤖 Generated with Claude Code
Greptile Summary
This PR renames Bible reference terminology across the SDK. The main changes are:
BibleReferenceAPIs now usebookId,passageId, andchapterPassageId.bookUSFM,asUSFM, andchapterUSFMnames.BibleReferencekeeps the existingbookUSFMJSON wire key through explicit coding keys.Confidence Score: 5/5
The rename is source-compatible and preserves the existing JSON wire format.
The changes are broad but mechanical, with deprecated forwarders retained and the reported validation covering build, tests, API stability, and linting.
What T-Rex did
Reviews (4): Last reviewed commit: "Merge branch 'main' into bdm/rename-usfm..." | Re-trigger Greptile