Skip to content

Commit 0878398

Browse files
committed
use package imports
1 parent 8385afb commit 0878398

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

Sources/GRPCCodeGen/Internal/StructuredSwiftRepresentation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
/// A description of an import declaration.
3131
///
3232
/// For example: `import Foo`.
33-
struct ImportDescription: Equatable, Codable, Sendable {
33+
package struct ImportDescription: Equatable, Codable, Sendable {
3434
/// The access level of the imported module.
3535
///
3636
/// For example, the `public` in `public import Foo`.

Sources/GRPCCodeGen/Internal/Translator/IDLToStructuredSwiftTranslator.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
/// Creates a representation for the server and client code, as well as for the enums containing useful type aliases and properties.
1818
/// The representation is generated based on the ``CodeGenerationRequest`` object and user specifications,
1919
/// using types from ``StructuredSwiftRepresentation``.
20-
struct IDLToStructuredSwiftTranslator: Translator {
20+
package struct IDLToStructuredSwiftTranslator: Translator {
21+
package init() {}
22+
2123
func translate(
2224
codeGenerationRequest: CodeGenerationRequest,
2325
accessLevel: SourceGenerator.Config.AccessLevel,
@@ -97,7 +99,7 @@ struct IDLToStructuredSwiftTranslator: Translator {
9799
return StructuredSwiftRepresentation(file: file)
98100
}
99101

100-
internal func makeImports(
102+
package func makeImports(
101103
dependencies: [Dependency],
102104
accessLevel: SourceGenerator.Config.AccessLevel,
103105
accessLevelOnImports: Bool

Sources/GRPCCodeGen/SourceGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ public struct SourceGenerator: Sendable {
6161

6262
/// The possible access levels for the generated code.
6363
public struct AccessLevel: Sendable, Hashable {
64-
internal var level: Level
65-
internal enum Level {
64+
package var level: Level
65+
package enum Level {
6666
case `internal`
6767
case `public`
6868
case `package`

Tests/GRPCCodeGenTests/Internal/StructuredSwift+ImportTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024, gRPC Authors All rights reserved.
2+
* Copyright 2025, gRPC Authors All rights reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,7 +16,7 @@
1616

1717
import Testing
1818

19-
@testable import GRPCCodeGen
19+
import GRPCCodeGen
2020

2121
extension StructuredSwiftTests {
2222
@Suite("Import")

0 commit comments

Comments
 (0)