Skip to content

build: adopt explicit import access-level modifiers - #1074

Merged
grdsdev merged 8 commits into
mainfrom
feat/swift6-import-visibility
Jul 6, 2026
Merged

grdsdev merged 8 commits into
mainfrom
feat/swift6-import-visibility

Conversation

@grdsdev

@grdsdev grdsdev commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • MemberImportVisibility in the per-target swiftSettings loop in Package.swift.
  • Updates every non-test source file across all targets (Helpers, Auth, Functions, PostgREST, RealtimeV2, Realtime, Storage, Supabase, and TestHelpers, which is a regular .target despite the name) to declare public import / package import wherever a type crosses that file's public or package API surface, or add a plain import where a module's members were used without being directly imported (relying on a transitive import, which MemberImportVisibility no longer allows).
  • Only import statements were changed — no declaration's access level was modified anywhere.
  • Stacked on build: enable ImmutableWeakCaptures and InferIsolatedConformances #1071.

Test plan

  • swift build succeeds with zero errors
  • swift build --build-tests succeeds with zero errors
  • swift test — the failures present (26) are pre-existing and reproduce identically on the unmodified base commit when run as the same full parallel suite:
    • IntegrationTests.RealtimeIntegrationTests failures require a live local Supabase instance (supabase start), not present in this environment.
    • Two StorageTests snapshot tests are order-dependent under full-suite parallel execution and fail/pass depending on run order, independent of this change.
  • swift-format lint -r on all touched files shows no new warnings versus the base commit (one pre-existing-style OrderedImports issue that this change itself introduced in AuthClient.swift was caught and fixed before committing)

grdsdev added 2 commits July 3, 2026 17:42
Adopts two of the upcoming-feature flags from pointfreeco/sqlite-data#467
into the per-target swiftSettings loop.
Enables InternalImportsByDefault and MemberImportVisibility in the
per-target swiftSettings loop, adopted from
pointfreeco/sqlite-data#467, and updates every non-test source file
across all targets to declare public import / package import where a
type crosses that file's public or package API surface, or a plain
import where a module's members are only used internally but weren't
directly imported before.

Only import statements were changed; no declaration's access level was
modified. Verified with `swift build`, `swift build --build-tests`,
and `swift test` (failures present are pre-existing: integration tests
require a live Supabase instance, and two Storage snapshot tests are
order-dependent under full-suite parallel execution — both reproduce
identically on the unmodified base commit).

Stacked on feat/swift6-warnings-as-errors.
@grdsdev
grdsdev requested a review from a team as a code owner July 3, 2026 21:25
Base automatically changed from feat/swift6-narrow-features to main July 6, 2026 13:22
@grdsdev
grdsdev enabled auto-merge (squash) July 6, 2026 14:27
@coveralls

coveralls commented Jul 6, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 28807969182

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+1.8%) to 83.019%

Details

  • Coverage increased (+1.8%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 29 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

29 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
Sources/RealtimeV2/WebSocket/URLSessionWebSocket.swift 29 57.63%

Coverage Stats

Coverage Status
Relevant Lines: 9399
Covered Lines: 7803
Line Coverage: 83.02%
Coverage Strength: 1142436.61 hits per line

💛 - Coveralls

grdsdev added 3 commits July 6, 2026 13:18
With MemberImportVisibility enabled, URLRequest/URLResponse/HTTPURLResponse
on Linux come from FoundationNetworking. Upgrading the import access level
to match the declarations that use these types fixes the build errors.

LoggerInterceptor also needed the FoundationNetworking import added since
it accesses .httpMethod, .url, and .expectedContentLength.
public/package declarations whose types (URLRequest, URLResponse,
HTTPURLResponse, URLSession) come from FoundationNetworking on Linux
require a matching-or-higher access level import to compile with
MemberImportVisibility enabled.
@grdsdev
grdsdev merged commit 3cae8eb into main Jul 6, 2026
28 checks passed
@grdsdev
grdsdev deleted the feat/swift6-import-visibility branch July 6, 2026 16:57
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.

4 participants