diff --git a/Customization/Configuration.md b/Customization/Configuration.md index ded3d1c95..59581cba0 100644 --- a/Customization/Configuration.md +++ b/Customization/Configuration.md @@ -52,6 +52,7 @@ dependencyInjectionImports: builderImports: [] flowImports: [] pluginListImports: [] +pluginListInterfaceImports: [] viewControllerImports: [] dependencies: [] analyticsProperties: [] diff --git a/Sources/NodesGenerator/Config.swift b/Sources/NodesGenerator/Config.swift index 26ffce943..adc534a96 100644 --- a/Sources/NodesGenerator/Config.swift +++ b/Sources/NodesGenerator/Config.swift @@ -40,6 +40,7 @@ public struct Config: Codable, Equatable { public var flowImports: Set public var interfaceImports: Set public var pluginListImports: Set + public var pluginListInterfaceImports: Set public var viewControllerImports: Set public var dependencies: [Variable] public var analyticsProperties: [Variable] @@ -97,6 +98,7 @@ extension Config { flowImports = [] interfaceImports = [] pluginListImports = [] + pluginListInterfaceImports = [] viewControllerImports = [] dependencies = [] analyticsProperties = [] @@ -176,6 +178,9 @@ extension Config { pluginListImports = (try? decoder.decode(CodingKeys.pluginListImports)) ?? defaults.pluginListImports + pluginListInterfaceImports = + (try? decoder.decode(CodingKeys.pluginListInterfaceImports)) + ?? defaults.pluginListInterfaceImports viewControllerImports = (try? decoder.decode(CodingKeys.viewControllerImports)) ?? defaults.viewControllerImports diff --git a/Sources/NodesGenerator/StencilTemplate.swift b/Sources/NodesGenerator/StencilTemplate.swift index 24bdf604f..c915518d0 100644 --- a/Sources/NodesGenerator/StencilTemplate.swift +++ b/Sources/NodesGenerator/StencilTemplate.swift @@ -305,6 +305,7 @@ public enum StencilTemplate: CustomStringConvertible, Equatable, Sendable { case .pluginListInterface: config.baseImports .union(["Nodes"]) + .union(config.pluginListInterfaceImports) case .pluginListTests: config.baseTestImports .union(["NodesTesting"]) diff --git a/Tests/NodesGeneratorTests/ConfigTests.swift b/Tests/NodesGeneratorTests/ConfigTests.swift index fca9dd291..a374f9b6f 100644 --- a/Tests/NodesGeneratorTests/ConfigTests.swift +++ b/Tests/NodesGeneratorTests/ConfigTests.swift @@ -163,6 +163,9 @@ final class ConfigTests: XCTestCase, TestFactories { pluginListImports: - - + pluginListInterfaceImports: + - + - viewControllerImports: - - diff --git a/Tests/NodesGeneratorTests/StencilTemplateTests.swift b/Tests/NodesGeneratorTests/StencilTemplateTests.swift index 5ca1bdc6d..8e374a9df 100644 --- a/Tests/NodesGeneratorTests/StencilTemplateTests.swift +++ b/Tests/NodesGeneratorTests/StencilTemplateTests.swift @@ -369,6 +369,7 @@ final class StencilTemplateTests: XCTestCase, TestFactories { case .pluginListInterface: expect(imports) == [ "", + "", "Nodes" ] case .pluginListTests: @@ -496,6 +497,7 @@ final class StencilTemplateTests: XCTestCase, TestFactories { case .pluginListInterface: expect(imports) == [ "", + "", "Nodes" ] case .pluginListTests: diff --git a/Tests/NodesGeneratorTests/Support/TestFactories.swift b/Tests/NodesGeneratorTests/Support/TestFactories.swift index 739864f12..5fded2816 100644 --- a/Tests/NodesGeneratorTests/Support/TestFactories.swift +++ b/Tests/NodesGeneratorTests/Support/TestFactories.swift @@ -36,6 +36,7 @@ extension TestFactories { config.flowImports = [""] config.interfaceImports = [""] config.pluginListImports = [""] + config.pluginListInterfaceImports = [""] config.viewControllerImports = [""] config.dependencies = [Variable(name: "", type: "")] config.analyticsProperties = [Variable(name: "", type: "")] diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt index a6d1f8876..bb3c1e2ac 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt @@ -49,6 +49,9 @@ ▿ pluginListImports: 2 members - "" - "" + ▿ pluginListInterfaceImports: 2 members + - "" + - "" - publisherFailureType: "" - publisherType: "" ▿ reactiveImports: 2 members diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt index 590927a65..0782fb0e3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt @@ -19,6 +19,7 @@ - isTestTemplatesGenerationEnabled: true - isViewInjectedTemplateEnabled: true - pluginListImports: 0 members + - pluginListInterfaceImports: 0 members - publisherFailureType: "Never" - publisherType: "AnyPublisher" ▿ reactiveImports: 1 member diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt index 590927a65..0782fb0e3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt @@ -19,6 +19,7 @@ - isTestTemplatesGenerationEnabled: true - isViewInjectedTemplateEnabled: true - pluginListImports: 0 members + - pluginListInterfaceImports: 0 members - publisherFailureType: "Never" - publisherType: "AnyPublisher" ▿ reactiveImports: 1 member diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt index 590927a65..0782fb0e3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt @@ -19,6 +19,7 @@ - isTestTemplatesGenerationEnabled: true - isViewInjectedTemplateEnabled: true - pluginListImports: 0 members + - pluginListInterfaceImports: 0 members - publisherFailureType: "Never" - publisherType: "AnyPublisher" ▿ reactiveImports: 1 member diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testPluginListXcodeTemplatePermutation.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testPluginListXcodeTemplatePermutation.1.txt index b72e2526e..a05d90779 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testPluginListXcodeTemplatePermutation.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testPluginListXcodeTemplatePermutation.1.txt @@ -9,8 +9,9 @@ - "" - "" - "Nodes" - ▿ pluginListInterfaceImports: 2 elements + ▿ pluginListInterfaceImports: 3 elements - "" + - "" - "Nodes" - pluginListName: "___VARIABLE_productName___" ▿ pluginListTestsImports: 2 elements diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testPluginListXcodeTemplate.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testPluginListXcodeTemplate.1.txt index 3a3f60b1c..29cc8b6d8 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testPluginListXcodeTemplate.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testPluginListXcodeTemplate.1.txt @@ -12,8 +12,9 @@ - "" - "" - "Nodes" - ▿ pluginListInterfaceImports: 2 elements + ▿ pluginListInterfaceImports: 3 elements - "" + - "" - "Nodes" - pluginListName: "___VARIABLE_productName___" ▿ pluginListTestsImports: 2 elements