Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 0 additions & 2 deletions Sources/NodesGenerator/Resources/Stencils/Analytics.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ import {{ import }}
*
*/

/// PURPOSE:
/// The interface for analytics tracked by this Node.
///
/// Add requirements to this protocol to provide analytics tracking methods for this Node.
/// @mockable
internal protocol {{ node_name }}Analytics: AnyObject {}

/// PURPOSE:
/// Custom analytics implementation for this Node.
{% if analytics_properties %}
internal final class {{ node_name }}AnalyticsImp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// The interface of the Flow.
/// @mockable
@MainActor
Expand All @@ -16,7 +15,6 @@ internal protocol {{ node_name }}Flow: {{ plugin_list_name }}Flow {}
internal protocol {{ node_name }}Flow: {{ view_controllable_flow_type }} {}
{% endif %}

/// PURPOSE:
/// Declares the dependencies required by this Node that will be injected (not created by this Node itself).
/// @mockable
@MainActor
Expand All @@ -30,21 +28,18 @@ public protocol {{ node_name }}Dependency: Dependency {
public protocol {{ node_name }}Dependency: Dependency {}
{% endif %}

/// PURPOSE:
/// A dependency needed by the Builder (such as a Listener), passed in from the caller (i.e. is not on the DI graph).
///
/// Can be a tuple or struct containing multiple values when necessary.
internal typealias {{ node_name }}DynamicBuildDependency = {{ node_name }}Listener

/// PURPOSE:
/// A dependency used by the Component itself, passed into the Component's initializer (in the Component factory).
///
/// Can be a tuple or struct containing multiple values when necessary.
internal typealias {{ node_name }}DynamicComponentDependency = Void

// MARK: - Component

/// PURPOSE:
/// Declares dependencies that are owned by this Node.
public final class {{ node_name }}Component: Component
<
Expand Down Expand Up @@ -121,7 +116,6 @@ public final class {{ node_name }}Component: Component
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The Builder interface (available to mock for testability).
/// @mockable
@MainActor
Expand All @@ -138,7 +132,6 @@ internal protocol {{ node_name }}Builder: AnyObject {
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// Concrete implementation of the Builder, where everything is created and associated.
internal final class {{ node_name }}BuilderImp: AbstractBuilder
<
Expand Down
7 changes: 0 additions & 7 deletions Sources/NodesGenerator/Resources/Stencils/Builder.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// The interface of the Flow.
/// @mockable
@MainActor
Expand All @@ -25,7 +24,6 @@ internal protocol {{ node_name }}Flow: Flow {}
{% endif %}
{% if node_name != "App" %}

/// PURPOSE:
/// Declares the dependencies required by this Node that will be injected (not created by this Node itself).
/// @mockable
@MainActor
Expand All @@ -40,7 +38,6 @@ public protocol {{ node_name }}Dependency: Dependency {}
{% endif %}
{% endif %}

/// PURPOSE:
/// A dependency needed by the Builder (such as a Listener), passed in from the caller (i.e. is not on the DI graph).
///
/// Can be a tuple or struct containing multiple values when necessary.
Expand All @@ -52,15 +49,13 @@ internal typealias {{ node_name }}DynamicBuildDependency = Void
internal typealias {{ node_name }}DynamicBuildDependency = ({{ node_name }}Listener, {{ node_name }}ViewControllable)
{% endif %}

/// PURPOSE:
/// A dependency used by the Component itself, passed into the Component's initializer (in the Component factory).
///
/// Can be a tuple or struct containing multiple values when necessary.
internal typealias {{ node_name }}DynamicComponentDependency = Void

// MARK: - Component

/// PURPOSE:
/// Declares dependencies that are owned by this Node.
{% if node_name == "App" %}
public final class {{ node_name }}Component: BootstrapComponent {
Expand Down Expand Up @@ -167,7 +162,6 @@ public final class {{ node_name }}Component: Component
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The Builder interface (available to mock for testability).
/// @mockable
@MainActor
Expand All @@ -193,7 +187,6 @@ internal protocol {{ node_name }}Builder: AnyObject {
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// Concrete implementation of the Builder, where everything is created and associated.
internal final class {{ node_name }}BuilderImp: AbstractBuilder
<
Expand Down
3 changes: 0 additions & 3 deletions Sources/NodesGenerator/Resources/Stencils/Context.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ import {{ import }}
{% endif %}
{% if node_name != "App" %}

/// PURPOSE:
/// The Context delegates callbacks to its (external) Listener, typically the parent Context.
/// @mockable
@MainActor
internal protocol {{ node_name }}Listener: AnyObject {}
{% endif %}

/// PURPOSE:
/// The interface that the Context will speak to the Flow through. Used to initiate navigation as
/// an example.
/// @mockable
Expand All @@ -32,7 +30,6 @@ internal protocol {{ node_name }}FlowInterface: Flow {
internal protocol {{ node_name }}FlowInterface: Flow {}
{% endif %}

/// PURPOSE:
/// Contains the business logic of the Node. The lifecycle of the Node is bookended between the
/// `didBecomeActive` and `willResignActive` methods.
{% if context_generic_types %}
Expand Down
3 changes: 0 additions & 3 deletions Sources/NodesGenerator/Resources/Stencils/Flow.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// The interface that the Flow will speak to the Context through. Used for informing the Context of
/// presentation lifecycle events, as an example.
/// @mockable
Expand All @@ -20,7 +19,6 @@ internal protocol {{ node_name }}ContextInterface: Context, RootListener {}
{% else %}
internal protocol {{ node_name }}ContextInterface: Context {}

/// PURPOSE:
/// The interface of the View used for presenting the View of child Nodes. May inherit additional base
/// protocols to add further pre-baked presentation behavior and/or add new methods for custom presentation
/// implementation as necessary.
Expand All @@ -31,7 +29,6 @@ internal protocol {{ node_name }}ContextInterface: Context {}
internal protocol {{ node_name }}ViewControllable: {{ view_controllable_type }} {}
{% endif %}

/// PURPOSE:
/// Responsible for presenting views and starting child Flows, and should not contain business logic.
internal final class {{ node_name }}FlowImp: AbstractFlow
<
Expand Down
5 changes: 0 additions & 5 deletions Sources/NodesGenerator/Resources/Stencils/Plugin.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// Declares the dependencies required by this Plugin that will be injected (not created by this Plugin itself).
/// @mockable
@MainActor
public protocol {{ plugin_name }}PluginDependency: Dependency {}

/// PURPOSE:
/// Declares dependencies that are owned by this Plugin.
public final class {{ plugin_name }}PluginComponent: Component
<
Expand Down Expand Up @@ -61,14 +59,12 @@ public final class {{ plugin_name }}PluginComponent: Component
}
}

/// PURPOSE:
/// To provide additional state used in determining if the Plugin is enabled (can be any type relevant to the Plugin).
internal typealias {{ plugin_name }}PluginStateType = Void

{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The Plugin interface (available to mock for testability).
/// @mockable
@MainActor
Expand All @@ -79,7 +75,6 @@ internal protocol {{ plugin_name }}Plugin {
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// Concrete implementation of the Plugin.
internal final class {{ plugin_name }}PluginImp: Plugin
<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {{ import }}
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The common Flow interface.
/// @mockable
@MainActor
Expand All @@ -18,7 +17,6 @@ internal protocol {{ plugin_list_name }}Flow: {{ view_controllable_flow_type }}
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The common Listener interface.
/// @mockable
@MainActor
Expand All @@ -27,7 +25,6 @@ internal protocol {{ plugin_list_name }}Listener: AnyObject {}
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The common Builder interface.
/// @mockable
@MainActor
Expand All @@ -37,13 +34,11 @@ internal protocol {{ plugin_list_name }}Builder: AnyObject {
) -> {{ plugin_list_name }}Flow
}

/// PURPOSE:
/// Declares the dependencies required by this Plugin List that will be injected (not created by this Plugin List itself).
/// @mockable
@MainActor
public protocol {{ plugin_list_name }}PluginListDependency: Dependency {}

/// PURPOSE:
/// Declares dependencies that are owned by this Plugin List.
public final class {{ plugin_list_name }}PluginListComponent: Component
<
Expand Down Expand Up @@ -88,18 +83,15 @@ public final class {{ plugin_list_name }}PluginListComponent: Component
*/
}

/// PURPOSE:
/// The type used for the keys of the Plugin List (can be any `Hashable` type such as `String` or an enumeration).
internal typealias {{ plugin_list_name }}PluginListKeyType = String

/// PURPOSE:
/// To provide additional state used in determining if the plugins are enabled (can be any type relevant to the plugins).
internal typealias {{ plugin_list_name }}PluginListStateType = Void

{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The Plugin List protocol (available to mock for testability).
/// @mockable
@MainActor
Expand All @@ -112,7 +104,6 @@ internal protocol {{ plugin_list_name }}PluginList {
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// Concrete implementation of the Plugin List providing the Plugin collection and (optionally) the creation order.
internal final class {{ plugin_list_name }}PluginListImp: PluginList
<
Expand Down
1 change: 0 additions & 1 deletion Sources/NodesGenerator/Resources/Stencils/State.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// The state of the Node.
internal struct {{ node_name }}State: Equatable {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// The interface that the View will speak to the Context through. Used for informing the Context of
/// view events and user interactions.
/// @mockable
@MainActor
internal protocol {{ node_name }}Receiver: AnyObject {}

/// PURPOSE:
/// Host of the SwiftUI view.
internal final class {{ node_name }}ViewController: {{ view_controller_type }}
<
Expand All @@ -35,7 +33,6 @@ internal final class {{ node_name }}ViewController: {{ view_controller_type }}

extension {{ node_name }}ViewController: {{ node_name }}ViewControllable {}

/// PURPOSE:
/// Concrete implementation of the View.
internal struct {{ node_name }}View {

Expand Down Expand Up @@ -78,7 +75,6 @@ extension {{ node_name }}View: View {
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// The SwiftUI preview (excluded from release builds).
internal struct {{ node_name }}View_Previews: PreviewProvider {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// The interface that the View will speak to the Context through. Used for informing the Context of
/// view events and user interactions.
/// @mockable
Expand All @@ -19,7 +18,6 @@ internal protocol {{ node_name }}Receiver: AnyObject {
internal protocol {{ node_name }}Receiver: AnyObject {}
{% endif %}

/// PURPOSE:
/// Concrete implementation of the UI.
internal final class {{ node_name }}ViewController: {{ view_controller_type }}, StateObserver {
{% if view_controller_static_content %}
Expand Down
2 changes: 0 additions & 2 deletions Sources/NodesGenerator/Resources/Stencils/ViewState.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {{ import }}
{% endfor %}
{% endif %}

/// PURPOSE:
/// The view state of the view.
{% if node_name == "Root" %}
internal struct {{ node_name }}ViewState: Equatable {
Expand All @@ -17,7 +16,6 @@ internal struct {{ node_name }}ViewState: Equatable {
internal struct {{ node_name }}ViewState: Equatable {}
{% endif %}

/// PURPOSE:
/// The factory used to create view state from the state of the Node.
internal class {{ node_name }}ViewStateFactory: Nodes.Transform {

Expand Down
2 changes: 0 additions & 2 deletions Sources/NodesGenerator/Resources/Stencils/Worker.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,13 @@ import {{ import }}
{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// Encapsulates work to be performed by the Node.
/// @mockable
internal protocol {{ worker_name }}Worker: Worker {}

{% if is_periphery_comment_enabled %}
// periphery:ignore
{% endif %}
/// PURPOSE:
/// Concrete implementation of the Worker.
{% if worker_generic_types %}
internal final class {{ worker_name }}WorkerImp: AbstractWorker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,12 @@
*
*/

/// PURPOSE:
/// The interface for analytics tracked by this Node.
///
/// Add requirements to this protocol to provide analytics tracking methods for this Node.
/// @mockable
internal protocol AppAnalytics: AnyObject {}

/// PURPOSE:
/// Custom analytics implementation for this Node.
internal final class AppAnalyticsImp {}

Expand Down
Loading