From 661231ed9fefb03744308eb2931c0c644d728b36 Mon Sep 17 00:00:00 2001 From: Gus Cairo Date: Fri, 2 Aug 2024 15:20:06 +0100 Subject: [PATCH 1/3] Enable InternalImportsByDefault in v2 modules --- Package@swift-6.swift | 68 +++++++++++++++---- .../Client/Internal/RetryDelaySequence.swift | 4 +- .../Concurrency Primitives/Lock.swift | 4 +- .../Internal/AsyncIteratorSequence.swift | 3 +- .../Internal/BroadcastAsyncSequence.swift | 3 +- .../Streaming/Internal/BufferedStream.swift | 2 +- .../Connection/ClientConnectionHandler.swift | 4 +- .../Client/Connection/Connection.swift | 7 +- .../Client/Connection/ConnectionFactory.swift | 5 +- .../Client/Connection/GRPCChannel.swift | 3 +- .../LoadBalancers/PickFirstLoadBalancer.swift | 2 +- .../RoundRobinLoadBalancer.swift | 2 +- .../Connection/LoadBalancers/Subchannel.swift | 2 +- .../Client/HTTP2ClientTransport.swift | 2 +- .../Client/Resolver/NameResolver.swift | 2 +- .../GRPCHTTP2Core/GRPCMessageDecoder.swift | 3 +- .../Internal/NIOChannelPipeline+GRPC.swift | 7 +- .../NIOSocketAddress+GRPCSocketAddress.swift | 2 +- Sources/GRPCHTTP2Core/Internal/Timer.swift | 2 +- .../Server/Connection/ServerConnection.swift | 4 +- .../Server/GRPCServerStreamHandler.swift | 6 +- .../Server/HTTP2ServerTransport.swift | 3 +- .../HTTP2ClientTransport+Posix.swift | 8 +-- .../HTTP2ServerTransport+Posix.swift | 7 +- ...TP2ServerTransport+TransportServices.swift | 7 +- .../InProcessClientTransport.swift | 2 +- .../InProcessServerTransport.swift | 2 +- .../InProcessTransport.swift | 3 +- .../ClientTracingInterceptor.swift | 2 +- .../ServerTracingInterceptor.swift | 2 +- Sources/GRPCProtobuf/Coding.swift | 4 +- .../ProtobufCodeGenerator.swift | 4 +- 32 files changed, 118 insertions(+), 63 deletions(-) diff --git a/Package@swift-6.swift b/Package@swift-6.swift index ea133c329..ba5f2176d 100644 --- a/Package@swift-6.swift +++ b/Package@swift-6.swift @@ -207,7 +207,11 @@ extension Target { .atomics ], path: "Sources/GRPCCore", - swiftSettings: [._swiftLanguageMode(.v5), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v5), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -217,7 +221,11 @@ extension Target { dependencies: [ .grpcCore ], - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -228,7 +236,11 @@ extension Target { .grpcCore, .tracing ], - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -243,7 +255,11 @@ extension Target { .dequeModule, .atomics ], - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -256,7 +272,11 @@ extension Target { .nioPosix, .nioExtras ], - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -270,7 +290,11 @@ extension Target { .nioExtras, .nioTransportServices ], - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -283,7 +307,11 @@ extension Target { .grpcHTTP2TransportNIOPosix, .grpcHTTP2TransportNIOTransportServices, ], - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -510,7 +538,7 @@ extension Target { .grpcCore, .grpcProtobuf ], - swiftSettings: [._swiftLanguageMode(.v5), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] ) } @@ -814,7 +842,11 @@ extension Target { .target( name: "GRPCCodeGen", path: "Sources/GRPCCodeGen", - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -826,7 +858,11 @@ extension Target { .protobuf, ], path: "Sources/GRPCProtobuf", - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -839,7 +875,11 @@ extension Target { .grpcCodeGen ], path: "Sources/GRPCProtobufCodeGen", - swiftSettings: [._swiftLanguageMode(.v6), .enableUpcomingFeature("ExistentialAny")] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } @@ -851,7 +891,11 @@ extension Target { .grpcProtobuf ], path: "Sources/Services/Health", - swiftSettings: [._swiftLanguageMode(.v6)] + swiftSettings: [ + ._swiftLanguageMode(.v6), + .enableUpcomingFeature("ExistentialAny"), + .enableUpcomingFeature("InternalImportsByDefault") + ] ) } } diff --git a/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift b/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift index b07691e4e..6865d60d0 100644 --- a/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift +++ b/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift @@ -14,9 +14,9 @@ * limitations under the License. */ #if canImport(Darwin) -import Darwin +public import Darwin // should be @usableFromInline #else -import Glibc +public import Glibc // should be @usableFromInline #endif @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) diff --git a/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift b/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift index cd334df5f..73f8f4bf6 100644 --- a/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift +++ b/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift @@ -28,9 +28,9 @@ //===----------------------------------------------------------------------===// #if canImport(Darwin) -import Darwin +public import Darwin // should be @usableFromInline #elseif canImport(Glibc) -import Glibc +public import Glibc // should be @usableFromInline #endif @usableFromInline diff --git a/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift b/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift index 8319d46d1..1a2692b65 100644 --- a/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift +++ b/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Atomics + +public import Atomics // should be @usableFromInline @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @usableFromInline diff --git a/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift b/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift index 6367fa859..7df82ecca 100644 --- a/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift +++ b/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import DequeModule + +public import DequeModule // should be @usableFromInline /// An `AsyncSequence` which can broadcast its values to multiple consumers concurrently. /// diff --git a/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift b/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift index f6fd3dcc1..8d5b3605c 100644 --- a/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift +++ b/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift @@ -25,7 +25,7 @@ // //===----------------------------------------------------------------------===// -import DequeModule +public import DequeModule // should be @usableFromInline /// An asynchronous sequence generated from an error-throwing closure that /// calls a continuation to produce new elements. diff --git a/Sources/GRPCHTTP2Core/Client/Connection/ClientConnectionHandler.swift b/Sources/GRPCHTTP2Core/Client/Connection/ClientConnectionHandler.swift index 5138dee21..4cf354857 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/ClientConnectionHandler.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/ClientConnectionHandler.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import NIOCore -import NIOHTTP2 +package import NIOCore +package import NIOHTTP2 /// An event which happens on a client's HTTP/2 connection. package enum ClientConnectionEvent: Sendable { diff --git a/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift b/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift index 9bd3f97bd..64bd7ece7 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift @@ -14,10 +14,11 @@ * limitations under the License. */ -import GRPCCore +package import GRPCCore +package import NIOHTTP2 +package import NIOCore + import NIOConcurrencyHelpers -import NIOCore -import NIOHTTP2 /// A `Connection` provides communication to a single remote peer. /// diff --git a/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift b/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift index 57225bc67..09a4d75c0 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift @@ -14,8 +14,9 @@ * limitations under the License. */ -import NIOCore -import NIOHTTP2 +package import NIOCore +package import NIOHTTP2 + import NIOPosix @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift b/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift index c36df29a5..019cca6b1 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift @@ -14,9 +14,10 @@ * limitations under the License. */ +package import GRPCCore + import Atomics import DequeModule -import GRPCCore @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) package struct GRPCChannel: ClientTransport { diff --git a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/PickFirstLoadBalancer.swift b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/PickFirstLoadBalancer.swift index d654fcff1..d0e66a5a3 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/PickFirstLoadBalancer.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/PickFirstLoadBalancer.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +package import GRPCCore /// A load-balancer which has a single subchannel. /// diff --git a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/RoundRobinLoadBalancer.swift b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/RoundRobinLoadBalancer.swift index b6c838955..a6a8418b0 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/RoundRobinLoadBalancer.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/RoundRobinLoadBalancer.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +package import GRPCCore /// A load-balancer which maintains to a set of subchannels and uses round-robin to pick a /// subchannel when picking a subchannel to use. diff --git a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift index c4e122300..a1c1a0457 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +package import GRPCCore import NIOConcurrencyHelpers /// A ``Subchannel`` provides communication to a single ``Endpoint``. diff --git a/Sources/GRPCHTTP2Core/Client/HTTP2ClientTransport.swift b/Sources/GRPCHTTP2Core/Client/HTTP2ClientTransport.swift index c2440689a..e4cd97784 100644 --- a/Sources/GRPCHTTP2Core/Client/HTTP2ClientTransport.swift +++ b/Sources/GRPCHTTP2Core/Client/HTTP2ClientTransport.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +public import GRPCCore /// A namespace for the HTTP/2 client transport. public enum HTTP2ClientTransport {} diff --git a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver.swift b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver.swift index 93f44b48a..ad1436fe2 100644 --- a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver.swift +++ b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +public import GRPCCore /// A name resolver can provide resolved addresses and service configuration values over time. @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) diff --git a/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift b/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift index ca65e6942..aeaeff209 100644 --- a/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift +++ b/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift @@ -14,8 +14,9 @@ * limitations under the License. */ +package import NIOCore + import GRPCCore -import NIOCore /// A ``GRPCMessageDecoder`` helps with the deframing of gRPC data frames: /// - It reads the frame's metadata to know whether the message payload is compressed or not, and its length diff --git a/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift b/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift index d44ea5109..a6a5b40ae 100644 --- a/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift +++ b/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift @@ -14,10 +14,11 @@ * limitations under the License. */ -import GRPCCore -import NIOCore +package import GRPCCore +package import NIOCore +package import NIOHTTP2 + import NIOHPACK -import NIOHTTP2 @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) extension ChannelPipeline.SynchronousOperations { diff --git a/Sources/GRPCHTTP2Core/Internal/NIOSocketAddress+GRPCSocketAddress.swift b/Sources/GRPCHTTP2Core/Internal/NIOSocketAddress+GRPCSocketAddress.swift index cf015466a..db7eb537d 100644 --- a/Sources/GRPCHTTP2Core/Internal/NIOSocketAddress+GRPCSocketAddress.swift +++ b/Sources/GRPCHTTP2Core/Internal/NIOSocketAddress+GRPCSocketAddress.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import NIOCore +package import NIOCore extension GRPCHTTP2Core.SocketAddress { package init(_ nioSocketAddress: NIOCore.SocketAddress) { diff --git a/Sources/GRPCHTTP2Core/Internal/Timer.swift b/Sources/GRPCHTTP2Core/Internal/Timer.swift index 7c53333d1..bfc4ff29a 100644 --- a/Sources/GRPCHTTP2Core/Internal/Timer.swift +++ b/Sources/GRPCHTTP2Core/Internal/Timer.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import NIOCore +package import NIOCore package struct Timer { /// The delay to wait before running the task. diff --git a/Sources/GRPCHTTP2Core/Server/Connection/ServerConnection.swift b/Sources/GRPCHTTP2Core/Server/Connection/ServerConnection.swift index 2997580df..84d1d25a2 100644 --- a/Sources/GRPCHTTP2Core/Server/Connection/ServerConnection.swift +++ b/Sources/GRPCHTTP2Core/Server/Connection/ServerConnection.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import GRPCCore -import NIOCore +package import GRPCCore +package import NIOCore @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public enum ServerConnection { diff --git a/Sources/GRPCHTTP2Core/Server/GRPCServerStreamHandler.swift b/Sources/GRPCHTTP2Core/Server/GRPCServerStreamHandler.swift index d0f17601e..df4c184eb 100644 --- a/Sources/GRPCHTTP2Core/Server/GRPCServerStreamHandler.swift +++ b/Sources/GRPCHTTP2Core/Server/GRPCServerStreamHandler.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import GRPCCore -import NIOCore -import NIOHTTP2 +package import GRPCCore +package import NIOCore +package import NIOHTTP2 @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) package final class GRPCServerStreamHandler: ChannelDuplexHandler, RemovableChannelHandler { diff --git a/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift b/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift index ffeb21511..59bdd77b3 100644 --- a/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift +++ b/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift @@ -14,7 +14,8 @@ * limitations under the License. */ -import GRPCCore +public import GRPCCore + import NIOHTTP2 /// A namespace for the HTTP/2 server transport. diff --git a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift index 7348174d8..b31c66855 100644 --- a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift +++ b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift @@ -14,10 +14,10 @@ * limitations under the License. */ -import GRPCCore -import GRPCHTTP2Core -import NIOCore -import NIOPosix +public import GRPCHTTP2Core // should be @usableFromInline +public import GRPCCore +public import NIOCore +public import NIOPosix // has to be public because of default argument value in init @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) extension HTTP2ClientTransport { diff --git a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift index 1de2301aa..3ff02d7c7 100644 --- a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift +++ b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift @@ -14,12 +14,13 @@ * limitations under the License. */ -import GRPCCore -import GRPCHTTP2Core +public import GRPCCore +public import GRPCHTTP2Core +public import NIOPosix // has to be public because of default argument value in init + import NIOCore import NIOExtras import NIOHTTP2 -import NIOPosix extension HTTP2ServerTransport { /// A NIOPosix-backed implementation of a server transport. diff --git a/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift b/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift index 8d85d7a25..80e7fde54 100644 --- a/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift +++ b/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift @@ -15,12 +15,13 @@ */ #if canImport(Network) -import GRPCCore -import GRPCHTTP2Core +public import GRPCCore +public import NIOTransportServices // has to be public because of default argument value in init +public import GRPCHTTP2Core + import NIOCore import NIOExtras import NIOHTTP2 -import NIOTransportServices extension HTTP2ServerTransport { /// A NIO Transport Services-backed implementation of a server transport. diff --git a/Sources/GRPCInProcessTransport/InProcessClientTransport.swift b/Sources/GRPCInProcessTransport/InProcessClientTransport.swift index a34020676..c8f9412ec 100644 --- a/Sources/GRPCInProcessTransport/InProcessClientTransport.swift +++ b/Sources/GRPCInProcessTransport/InProcessClientTransport.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +public import GRPCCore /// An in-process implementation of a ``ClientTransport``. /// diff --git a/Sources/GRPCInProcessTransport/InProcessServerTransport.swift b/Sources/GRPCInProcessTransport/InProcessServerTransport.swift index a4ea05e7b..412d1bd58 100644 --- a/Sources/GRPCInProcessTransport/InProcessServerTransport.swift +++ b/Sources/GRPCInProcessTransport/InProcessServerTransport.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +public import GRPCCore /// An in-process implementation of a ``ServerTransport``. /// diff --git a/Sources/GRPCInProcessTransport/InProcessTransport.swift b/Sources/GRPCInProcessTransport/InProcessTransport.swift index ec553e72a..32a2002e9 100644 --- a/Sources/GRPCInProcessTransport/InProcessTransport.swift +++ b/Sources/GRPCInProcessTransport/InProcessTransport.swift @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import GRPCCore + +public import GRPCCore public enum InProcessTransport { /// Returns a pair containing an ``InProcessServerTransport`` and an ``InProcessClientTransport``. diff --git a/Sources/GRPCInterceptors/ClientTracingInterceptor.swift b/Sources/GRPCInterceptors/ClientTracingInterceptor.swift index 22dbcd134..8d0994493 100644 --- a/Sources/GRPCInterceptors/ClientTracingInterceptor.swift +++ b/Sources/GRPCInterceptors/ClientTracingInterceptor.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +public import GRPCCore import Tracing /// A client interceptor that injects tracing information into the request. diff --git a/Sources/GRPCInterceptors/ServerTracingInterceptor.swift b/Sources/GRPCInterceptors/ServerTracingInterceptor.swift index 78b992a40..250ce2e9a 100644 --- a/Sources/GRPCInterceptors/ServerTracingInterceptor.swift +++ b/Sources/GRPCInterceptors/ServerTracingInterceptor.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +public import GRPCCore import Tracing /// A server interceptor that extracts tracing information from the request. diff --git a/Sources/GRPCProtobuf/Coding.swift b/Sources/GRPCProtobuf/Coding.swift index ecd4b48f8..4aa0718cf 100644 --- a/Sources/GRPCProtobuf/Coding.swift +++ b/Sources/GRPCProtobuf/Coding.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import GRPCCore -import SwiftProtobuf +public import GRPCCore +public import SwiftProtobuf /// Serializes a Protobuf message into a sequence of bytes. public struct ProtobufSerializer: GRPCCore.MessageSerializer { diff --git a/Sources/GRPCProtobufCodeGen/ProtobufCodeGenerator.swift b/Sources/GRPCProtobufCodeGen/ProtobufCodeGenerator.swift index adde3ddf8..0fd4e7727 100644 --- a/Sources/GRPCProtobufCodeGen/ProtobufCodeGenerator.swift +++ b/Sources/GRPCProtobufCodeGen/ProtobufCodeGenerator.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import GRPCCodeGen -import SwiftProtobufPluginLibrary +public import GRPCCodeGen +public import SwiftProtobufPluginLibrary public struct ProtobufCodeGenerator { internal var configuration: SourceGenerator.Configuration From 402717caee1f68d64ed1816a84c3fa07505dceaa Mon Sep 17 00:00:00 2001 From: Gus Cairo Date: Fri, 2 Aug 2024 15:29:25 +0100 Subject: [PATCH 2/3] Formatting --- .../GRPCCore/Call/Client/Internal/RetryDelaySequence.swift | 4 ++-- Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift | 4 ++-- .../GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift | 2 +- .../GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift | 2 +- Sources/GRPCCore/Streaming/Internal/BufferedStream.swift | 2 +- Sources/GRPCHTTP2Core/Client/Connection/Connection.swift | 5 ++--- .../GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift | 1 - Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift | 3 +-- Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift | 3 +-- Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift | 3 +-- Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift | 1 - .../HTTP2ClientTransport+Posix.swift | 4 ++-- .../HTTP2ServerTransport+Posix.swift | 3 +-- .../HTTP2ServerTransport+TransportServices.swift | 2 +- 14 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift b/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift index 6865d60d0..d22c6fd52 100644 --- a/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift +++ b/Sources/GRPCCore/Call/Client/Internal/RetryDelaySequence.swift @@ -14,9 +14,9 @@ * limitations under the License. */ #if canImport(Darwin) -public import Darwin // should be @usableFromInline +public import Darwin // should be @usableFromInline #else -public import Glibc // should be @usableFromInline +public import Glibc // should be @usableFromInline #endif @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) diff --git a/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift b/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift index 73f8f4bf6..7bb9e4ca2 100644 --- a/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift +++ b/Sources/GRPCCore/Internal/Concurrency Primitives/Lock.swift @@ -28,9 +28,9 @@ //===----------------------------------------------------------------------===// #if canImport(Darwin) -public import Darwin // should be @usableFromInline +public import Darwin // should be @usableFromInline #elseif canImport(Glibc) -public import Glibc // should be @usableFromInline +public import Glibc // should be @usableFromInline #endif @usableFromInline diff --git a/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift b/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift index 1a2692b65..05596c6d4 100644 --- a/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift +++ b/Sources/GRPCCore/Streaming/Internal/AsyncIteratorSequence.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -public import Atomics // should be @usableFromInline +public import Atomics // should be @usableFromInline @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) @usableFromInline diff --git a/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift b/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift index 7df82ecca..5f812eb11 100644 --- a/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift +++ b/Sources/GRPCCore/Streaming/Internal/BroadcastAsyncSequence.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -public import DequeModule // should be @usableFromInline +public import DequeModule // should be @usableFromInline /// An `AsyncSequence` which can broadcast its values to multiple consumers concurrently. /// diff --git a/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift b/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift index 8d5b3605c..f2692c2a6 100644 --- a/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift +++ b/Sources/GRPCCore/Streaming/Internal/BufferedStream.swift @@ -25,7 +25,7 @@ // //===----------------------------------------------------------------------===// -public import DequeModule // should be @usableFromInline +public import DequeModule // should be @usableFromInline /// An asynchronous sequence generated from an error-throwing closure that /// calls a continuation to produce new elements. diff --git a/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift b/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift index 64bd7ece7..d4a11232f 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift @@ -15,10 +15,9 @@ */ package import GRPCCore -package import NIOHTTP2 -package import NIOCore - import NIOConcurrencyHelpers +package import NIOCore +package import NIOHTTP2 /// A `Connection` provides communication to a single remote peer. /// diff --git a/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift b/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift index 09a4d75c0..142601c21 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift @@ -16,7 +16,6 @@ package import NIOCore package import NIOHTTP2 - import NIOPosix @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift b/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift index 019cca6b1..16dc993ff 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift @@ -14,10 +14,9 @@ * limitations under the License. */ -package import GRPCCore - import Atomics import DequeModule +package import GRPCCore @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) package struct GRPCChannel: ClientTransport { diff --git a/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift b/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift index aeaeff209..1d377bd12 100644 --- a/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift +++ b/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift @@ -14,9 +14,8 @@ * limitations under the License. */ -package import NIOCore - import GRPCCore +package import NIOCore /// A ``GRPCMessageDecoder`` helps with the deframing of gRPC data frames: /// - It reads the frame's metadata to know whether the message payload is compressed or not, and its length diff --git a/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift b/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift index a6a5b40ae..f1dd19943 100644 --- a/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift +++ b/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift @@ -16,9 +16,8 @@ package import GRPCCore package import NIOCore -package import NIOHTTP2 - import NIOHPACK +package import NIOHTTP2 @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) extension ChannelPipeline.SynchronousOperations { diff --git a/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift b/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift index 59bdd77b3..250f91dea 100644 --- a/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift +++ b/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift @@ -15,7 +15,6 @@ */ public import GRPCCore - import NIOHTTP2 /// A namespace for the HTTP/2 server transport. diff --git a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift index b31c66855..1d7cff13e 100644 --- a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift +++ b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ClientTransport+Posix.swift @@ -14,10 +14,10 @@ * limitations under the License. */ -public import GRPCHTTP2Core // should be @usableFromInline public import GRPCCore +public import GRPCHTTP2Core // should be @usableFromInline public import NIOCore -public import NIOPosix // has to be public because of default argument value in init +public import NIOPosix // has to be public because of default argument value in init @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) extension HTTP2ClientTransport { diff --git a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift index 3ff02d7c7..3e3279a6c 100644 --- a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift +++ b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift @@ -16,11 +16,10 @@ public import GRPCCore public import GRPCHTTP2Core -public import NIOPosix // has to be public because of default argument value in init - import NIOCore import NIOExtras import NIOHTTP2 +public import NIOPosix // has to be public because of default argument value in init extension HTTP2ServerTransport { /// A NIOPosix-backed implementation of a server transport. diff --git a/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift b/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift index 80e7fde54..ebadc1e59 100644 --- a/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift +++ b/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift @@ -16,7 +16,7 @@ #if canImport(Network) public import GRPCCore -public import NIOTransportServices // has to be public because of default argument value in init +public import NIOTransportServices // has to be public because of default argument value in init public import GRPCHTTP2Core import NIOCore From 1006c0d145cbccdf0b33bddc719a2219db4ba098 Mon Sep 17 00:00:00 2001 From: Gus Cairo Date: Mon, 5 Aug 2024 15:24:16 +0100 Subject: [PATCH 3/3] Explicit internal --- Sources/GRPCCore/GRPCClient.swift | 2 +- Sources/GRPCCore/GRPCServer.swift | 2 +- Sources/GRPCCore/Timeout.swift | 3 ++- Sources/GRPCHTTP2Core/Client/Connection/Connection.swift | 2 +- .../Client/Connection/ConnectionFactory.swift | 2 +- Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift | 4 ++-- .../Client/Connection/LoadBalancers/Subchannel.swift | 2 +- .../GRPCHTTP2Core/Client/Connection/RequestQueue.swift | 2 +- .../GRPCHTTP2Core/Client/GRPCClientStreamHandler.swift | 6 +++--- .../GRPCHTTP2Core/Client/Resolver/NameResolver+IPv4.swift | 2 +- .../GRPCHTTP2Core/Client/Resolver/NameResolver+IPv6.swift | 2 +- .../GRPCHTTP2Core/Client/Resolver/NameResolver+UDS.swift | 2 +- .../Client/Resolver/NameResolver+VSOCK.swift | 2 +- .../GRPCHTTP2Core/Compression/CompressionAlgorithm.swift | 2 +- Sources/GRPCHTTP2Core/Compression/Zlib.swift | 6 +++--- Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift | 2 +- Sources/GRPCHTTP2Core/GRPCMessageFramer.swift | 4 ++-- Sources/GRPCHTTP2Core/GRPCStreamStateMachine.swift | 8 ++++---- .../GRPCHTTP2Core/Internal/ConstantAsyncSequence.swift | 2 +- .../GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift | 2 +- Sources/GRPCHTTP2Core/Internal/ProcessUniqueID.swift | 2 +- Sources/GRPCHTTP2Core/OneOrManyQueue.swift | 2 +- .../Connection/GRPCServerFlushNotificationHandler.swift | 2 +- .../ServerConnectionManagementHandler+StateMachine.swift | 4 ++-- .../Connection/ServerConnectionManagementHandler.swift | 4 ++-- Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift | 2 +- .../HTTP2ServerTransport+Posix.swift | 6 +++--- .../NIOClientBootstrap+SocketAddress.swift | 8 ++++---- .../HTTP2ServerTransport+TransportServices.swift | 6 +++--- Sources/GRPCInterceptors/ClientTracingInterceptor.swift | 2 +- Sources/GRPCInterceptors/HookedWriter.swift | 4 ++-- Sources/GRPCInterceptors/ServerTracingInterceptor.swift | 2 +- Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift | 8 ++++---- 33 files changed, 56 insertions(+), 55 deletions(-) diff --git a/Sources/GRPCCore/GRPCClient.swift b/Sources/GRPCCore/GRPCClient.swift index c4cc1ed9f..1ba012640 100644 --- a/Sources/GRPCCore/GRPCClient.swift +++ b/Sources/GRPCCore/GRPCClient.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import Atomics +internal import Atomics /// A gRPC client. /// diff --git a/Sources/GRPCCore/GRPCServer.swift b/Sources/GRPCCore/GRPCServer.swift index b24d90fd1..e0700f380 100644 --- a/Sources/GRPCCore/GRPCServer.swift +++ b/Sources/GRPCCore/GRPCServer.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import Atomics +internal import Atomics /// A gRPC server. /// diff --git a/Sources/GRPCCore/Timeout.swift b/Sources/GRPCCore/Timeout.swift index b350fdaea..e4e174e98 100644 --- a/Sources/GRPCCore/Timeout.swift +++ b/Sources/GRPCCore/Timeout.swift @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Dispatch + +internal import Dispatch /// A timeout for a gRPC call. /// diff --git a/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift b/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift index d4a11232f..9f28ed6b3 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/Connection.swift @@ -15,7 +15,7 @@ */ package import GRPCCore -import NIOConcurrencyHelpers +internal import NIOConcurrencyHelpers package import NIOCore package import NIOHTTP2 diff --git a/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift b/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift index 142601c21..c56e507db 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/ConnectionFactory.swift @@ -16,7 +16,7 @@ package import NIOCore package import NIOHTTP2 -import NIOPosix +internal import NIOPosix @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) package protocol HTTP2Connector: Sendable { diff --git a/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift b/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift index 16dc993ff..50122c11c 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/GRPCChannel.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import Atomics -import DequeModule +internal import Atomics +internal import DequeModule package import GRPCCore @available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) diff --git a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift index a1c1a0457..cd1b197b6 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/LoadBalancers/Subchannel.swift @@ -15,7 +15,7 @@ */ package import GRPCCore -import NIOConcurrencyHelpers +internal import NIOConcurrencyHelpers /// A ``Subchannel`` provides communication to a single ``Endpoint``. /// diff --git a/Sources/GRPCHTTP2Core/Client/Connection/RequestQueue.swift b/Sources/GRPCHTTP2Core/Client/Connection/RequestQueue.swift index 492dc9b61..7d4876eea 100644 --- a/Sources/GRPCHTTP2Core/Client/Connection/RequestQueue.swift +++ b/Sources/GRPCHTTP2Core/Client/Connection/RequestQueue.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import DequeModule +internal import DequeModule @available(macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0, *) struct RequestQueue { diff --git a/Sources/GRPCHTTP2Core/Client/GRPCClientStreamHandler.swift b/Sources/GRPCHTTP2Core/Client/GRPCClientStreamHandler.swift index b219a517e..3640af268 100644 --- a/Sources/GRPCHTTP2Core/Client/GRPCClientStreamHandler.swift +++ b/Sources/GRPCHTTP2Core/Client/GRPCClientStreamHandler.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import GRPCCore -import NIOCore -import NIOHTTP2 +internal import GRPCCore +internal import NIOCore +internal import NIOHTTP2 @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) final class GRPCClientStreamHandler: ChannelDuplexHandler { diff --git a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv4.swift b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv4.swift index e6c2bf828..d3b66ea18 100644 --- a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv4.swift +++ b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv4.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +internal import GRPCCore extension ResolvableTargets { /// A resolvable target for IPv4 addresses. diff --git a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv6.swift b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv6.swift index c3681d228..6c41a0353 100644 --- a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv6.swift +++ b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+IPv6.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +internal import GRPCCore extension ResolvableTargets { /// A resolvable target for IPv4 addresses. diff --git a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+UDS.swift b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+UDS.swift index 149b541fa..b957bffd5 100644 --- a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+UDS.swift +++ b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+UDS.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +internal import GRPCCore extension ResolvableTargets { /// A resolvable target for Unix Domain Socket address. diff --git a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+VSOCK.swift b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+VSOCK.swift index 0e7b5a1f5..e8c6c815b 100644 --- a/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+VSOCK.swift +++ b/Sources/GRPCHTTP2Core/Client/Resolver/NameResolver+VSOCK.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +internal import GRPCCore extension ResolvableTargets { /// A resolvable target for Virtual Socket addresses. diff --git a/Sources/GRPCHTTP2Core/Compression/CompressionAlgorithm.swift b/Sources/GRPCHTTP2Core/Compression/CompressionAlgorithm.swift index 7988549d1..1608f4c1e 100644 --- a/Sources/GRPCHTTP2Core/Compression/CompressionAlgorithm.swift +++ b/Sources/GRPCHTTP2Core/Compression/CompressionAlgorithm.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +internal import GRPCCore extension CompressionAlgorithm { init?(name: String) { diff --git a/Sources/GRPCHTTP2Core/Compression/Zlib.swift b/Sources/GRPCHTTP2Core/Compression/Zlib.swift index da6252275..a2a25110f 100644 --- a/Sources/GRPCHTTP2Core/Compression/Zlib.swift +++ b/Sources/GRPCHTTP2Core/Compression/Zlib.swift @@ -14,9 +14,9 @@ * limitations under the License. */ -import CGRPCZlib -import GRPCCore -import NIOCore +internal import CGRPCZlib +internal import GRPCCore +internal import NIOCore enum Zlib { enum Method { diff --git a/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift b/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift index 1d377bd12..e8e4f1c8f 100644 --- a/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift +++ b/Sources/GRPCHTTP2Core/GRPCMessageDecoder.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +internal import GRPCCore package import NIOCore /// A ``GRPCMessageDecoder`` helps with the deframing of gRPC data frames: diff --git a/Sources/GRPCHTTP2Core/GRPCMessageFramer.swift b/Sources/GRPCHTTP2Core/GRPCMessageFramer.swift index d80e1d526..059c3e161 100644 --- a/Sources/GRPCHTTP2Core/GRPCMessageFramer.swift +++ b/Sources/GRPCHTTP2Core/GRPCMessageFramer.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import GRPCCore -import NIOCore +internal import GRPCCore +internal import NIOCore /// A ``GRPCMessageFramer`` helps with the framing of gRPC data frames: /// - It prepends data with the required metadata (compression flag and message length). diff --git a/Sources/GRPCHTTP2Core/GRPCStreamStateMachine.swift b/Sources/GRPCHTTP2Core/GRPCStreamStateMachine.swift index 8d6d93f3b..b9a08862e 100644 --- a/Sources/GRPCHTTP2Core/GRPCStreamStateMachine.swift +++ b/Sources/GRPCHTTP2Core/GRPCStreamStateMachine.swift @@ -14,10 +14,10 @@ * limitations under the License. */ -import GRPCCore -import NIOCore -import NIOHPACK -import NIOHTTP1 +internal import GRPCCore +internal import NIOCore +internal import NIOHPACK +internal import NIOHTTP1 package enum Scheme: String { case http diff --git a/Sources/GRPCHTTP2Core/Internal/ConstantAsyncSequence.swift b/Sources/GRPCHTTP2Core/Internal/ConstantAsyncSequence.swift index 0792d4e0a..d1ecef17e 100644 --- a/Sources/GRPCHTTP2Core/Internal/ConstantAsyncSequence.swift +++ b/Sources/GRPCHTTP2Core/Internal/ConstantAsyncSequence.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import GRPCCore +internal import GRPCCore @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) private struct ConstantAsyncSequence: AsyncSequence, Sendable { diff --git a/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift b/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift index f1dd19943..dbbd837d2 100644 --- a/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift +++ b/Sources/GRPCHTTP2Core/Internal/NIOChannelPipeline+GRPC.swift @@ -16,7 +16,7 @@ package import GRPCCore package import NIOCore -import NIOHPACK +internal import NIOHPACK package import NIOHTTP2 @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) diff --git a/Sources/GRPCHTTP2Core/Internal/ProcessUniqueID.swift b/Sources/GRPCHTTP2Core/Internal/ProcessUniqueID.swift index 7c9bbba55..d80658e00 100644 --- a/Sources/GRPCHTTP2Core/Internal/ProcessUniqueID.swift +++ b/Sources/GRPCHTTP2Core/Internal/ProcessUniqueID.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import Atomics +internal import Atomics /// An ID which is unique within this process. struct ProcessUniqueID: Hashable, Sendable, CustomStringConvertible { diff --git a/Sources/GRPCHTTP2Core/OneOrManyQueue.swift b/Sources/GRPCHTTP2Core/OneOrManyQueue.swift index 8995f5641..fdf88186c 100644 --- a/Sources/GRPCHTTP2Core/OneOrManyQueue.swift +++ b/Sources/GRPCHTTP2Core/OneOrManyQueue.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import DequeModule +internal import DequeModule /// A FIFO-queue which allows for a single element to be stored on the stack and defers to a /// heap-implementation if further elements are added. diff --git a/Sources/GRPCHTTP2Core/Server/Connection/GRPCServerFlushNotificationHandler.swift b/Sources/GRPCHTTP2Core/Server/Connection/GRPCServerFlushNotificationHandler.swift index 85aa23608..1bbffc205 100644 --- a/Sources/GRPCHTTP2Core/Server/Connection/GRPCServerFlushNotificationHandler.swift +++ b/Sources/GRPCHTTP2Core/Server/Connection/GRPCServerFlushNotificationHandler.swift @@ -14,7 +14,7 @@ * limitations under the License. */ -import NIOCore +internal import NIOCore @available(macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0, *) final class GRPCServerFlushNotificationHandler: ChannelOutboundHandler { diff --git a/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler+StateMachine.swift b/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler+StateMachine.swift index 4aabf09a5..8ca7660d6 100644 --- a/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler+StateMachine.swift +++ b/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler+StateMachine.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import NIOCore -import NIOHTTP2 +internal import NIOCore +internal import NIOHTTP2 extension ServerConnectionManagementHandler { /// Tracks the state of TCP connections at the server. diff --git a/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler.swift b/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler.swift index c4b63eb8f..350cf44eb 100644 --- a/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler.swift +++ b/Sources/GRPCHTTP2Core/Server/Connection/ServerConnectionManagementHandler.swift @@ -14,8 +14,8 @@ * limitations under the License. */ -import NIOCore -import NIOHTTP2 +internal import NIOCore +internal import NIOHTTP2 /// A `ChannelHandler` which manages the lifecycle of a gRPC connection over HTTP/2. /// diff --git a/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift b/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift index 250f91dea..c0aef9094 100644 --- a/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift +++ b/Sources/GRPCHTTP2Core/Server/HTTP2ServerTransport.swift @@ -15,7 +15,7 @@ */ public import GRPCCore -import NIOHTTP2 +internal import NIOHTTP2 /// A namespace for the HTTP/2 server transport. public enum HTTP2ServerTransport {} diff --git a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift index 3e3279a6c..0d806dc73 100644 --- a/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift +++ b/Sources/GRPCHTTP2TransportNIOPosix/HTTP2ServerTransport+Posix.swift @@ -16,9 +16,9 @@ public import GRPCCore public import GRPCHTTP2Core -import NIOCore -import NIOExtras -import NIOHTTP2 +internal import NIOCore +internal import NIOExtras +internal import NIOHTTP2 public import NIOPosix // has to be public because of default argument value in init extension HTTP2ServerTransport { diff --git a/Sources/GRPCHTTP2TransportNIOPosix/NIOClientBootstrap+SocketAddress.swift b/Sources/GRPCHTTP2TransportNIOPosix/NIOClientBootstrap+SocketAddress.swift index 6a056abed..5eb6e193e 100644 --- a/Sources/GRPCHTTP2TransportNIOPosix/NIOClientBootstrap+SocketAddress.swift +++ b/Sources/GRPCHTTP2TransportNIOPosix/NIOClientBootstrap+SocketAddress.swift @@ -14,10 +14,10 @@ * limitations under the License. */ -import GRPCCore -import GRPCHTTP2Core -import NIOCore -import NIOPosix +internal import GRPCCore +internal import GRPCHTTP2Core +internal import NIOCore +internal import NIOPosix extension ClientBootstrap { @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) diff --git a/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift b/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift index ebadc1e59..93d6f3fd8 100644 --- a/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift +++ b/Sources/GRPCHTTP2TransportNIOTransportServices/HTTP2ServerTransport+TransportServices.swift @@ -19,9 +19,9 @@ public import GRPCCore public import NIOTransportServices // has to be public because of default argument value in init public import GRPCHTTP2Core -import NIOCore -import NIOExtras -import NIOHTTP2 +internal import NIOCore +internal import NIOExtras +internal import NIOHTTP2 extension HTTP2ServerTransport { /// A NIO Transport Services-backed implementation of a server transport. diff --git a/Sources/GRPCInterceptors/ClientTracingInterceptor.swift b/Sources/GRPCInterceptors/ClientTracingInterceptor.swift index 8d0994493..065d9936e 100644 --- a/Sources/GRPCInterceptors/ClientTracingInterceptor.swift +++ b/Sources/GRPCInterceptors/ClientTracingInterceptor.swift @@ -15,7 +15,7 @@ */ public import GRPCCore -import Tracing +internal import Tracing /// A client interceptor that injects tracing information into the request. /// diff --git a/Sources/GRPCInterceptors/HookedWriter.swift b/Sources/GRPCInterceptors/HookedWriter.swift index ed4977dca..8a9994033 100644 --- a/Sources/GRPCInterceptors/HookedWriter.swift +++ b/Sources/GRPCInterceptors/HookedWriter.swift @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import GRPCCore -import Tracing +internal import GRPCCore +internal import Tracing @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) struct HookedWriter: RPCWriterProtocol { diff --git a/Sources/GRPCInterceptors/ServerTracingInterceptor.swift b/Sources/GRPCInterceptors/ServerTracingInterceptor.swift index 250ce2e9a..5a568e425 100644 --- a/Sources/GRPCInterceptors/ServerTracingInterceptor.swift +++ b/Sources/GRPCInterceptors/ServerTracingInterceptor.swift @@ -15,7 +15,7 @@ */ public import GRPCCore -import Tracing +internal import Tracing /// A server interceptor that extracts tracing information from the request. /// diff --git a/Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift b/Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift index 59904ce46..824da05a6 100644 --- a/Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift +++ b/Sources/GRPCProtobufCodeGen/ProtobufCodeGenParser.swift @@ -14,11 +14,11 @@ * limitations under the License. */ -import Foundation -import SwiftProtobuf -import SwiftProtobufPluginLibrary +internal import Foundation +internal import SwiftProtobuf +internal import SwiftProtobufPluginLibrary -import struct GRPCCodeGen.CodeGenerationRequest +internal import struct GRPCCodeGen.CodeGenerationRequest /// Parses a ``FileDescriptor`` object into a ``CodeGenerationRequest`` object. internal struct ProtobufCodeGenParser {