From 223dcafe04b19682865f780e844a850a5d674e3d Mon Sep 17 00:00:00 2001 From: Christopher Fuller Date: Wed, 18 Sep 2024 16:10:24 -0700 Subject: [PATCH 01/11] Apply standard Swift package configuration (#843) * Apply standard Swift package configuration * Remove extraneous value from .gitignore * Remove SwiftLint disables * Disable strict concurrency in CI * Skip package plugin validation in workflows * Remove SWIFT_TREAT_WARNINGS_AS_ERRORS temporarily * Revert "Disable strict concurrency in CI" This reverts commit 961738eae49d526140bd092bf3fcaff1bb1065f5. * Remove -warnings-as-errors temporarily * Remove plugins from SwiftLint config --- .github/workflows/artifactory.yml | 7 +- .github/workflows/docc.yml | 4 +- .github/workflows/genesis.yml | 6 +- .github/workflows/lint.yml | 9 +- .github/workflows/pages.yml | 4 +- .github/workflows/swift.yml | 29 +-- .github/workflows/xcode.yml | 6 +- .gitignore | 6 - .swiftlint-rules.yml | 9 + .swiftlint.yml | 1 - CONTRIBUTING.md | 25 +-- Makefile | 56 +++-- Package.resolved | 86 ++++++-- Package.swift | 95 +++----- Package@swift-5.10.swift | 171 --------------- Plugins/SwiftLintPlugin/SwiftLintPlugin.swift | 204 ------------------ .../NodesCodeGeneratorCommand.swift | 1 - .../NodesXcodeTemplatesGeneratorCommand.swift | 1 - Sources/Nodes/Core/AbstractBuilder.swift | 4 + Sources/Nodes/Core/AbstractContext.swift | 2 +- Sources/Nodes/Core/AbstractFlow.swift | 1 - Sources/Nodes/Core/AbstractWorker.swift | 2 +- Sources/Nodes/Core/Config/Plugin.swift | 4 + Sources/Nodes/Core/Config/PluginList.swift | 8 + .../Nodes/Debugging/DebugInformation.swift | 4 + Sources/Nodes/Internal/FlowController.swift | 5 +- Sources/Nodes/Internal/WorkerController.swift | 4 + .../UIKit/Classes/NavigationController.swift | 4 + Sources/Nodes/Utility/LeakDetector.swift | 1 + ...ependencyProviderRegistrationBuilder.swift | 4 + Sources/NodesTesting/XCTestCase.swift | 4 + .../XcodeTemplatePropertyListTests.swift | 1 - .../CoreTests/AbstractBuilderTests.swift | 1 + .../ConfigTests/PluginListTests.swift | 3 + .../CoreTests/ConfigTests/PluginTests.swift | 3 +- .../InternalTests/FlowControllerTests.swift | 1 - .../ReactiveTests/StateObserverTests.swift | 1 + Tests/NodesTests/Support/NodesMocks.swift | 4 - .../NodesTests/Support/TestCaseHelpers.swift | 4 + ...ViewController+ViewControllableTests.swift | 4 + 40 files changed, 211 insertions(+), 578 deletions(-) delete mode 100644 Package@swift-5.10.swift delete mode 100644 Plugins/SwiftLintPlugin/SwiftLintPlugin.swift diff --git a/.github/workflows/artifactory.yml b/.github/workflows/artifactory.yml index 2a9832aa8..9261afdbe 100644 --- a/.github/workflows/artifactory.yml +++ b/.github/workflows/artifactory.yml @@ -5,7 +5,7 @@ on: tags: ['[0-9]+.[0-9]+.[0-9]+'] env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: artifactory: @@ -18,15 +18,14 @@ jobs: - name: Install dependencies run: brew install jfrog-cli - name: Checkout source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build documentation run: | make docs open="no" DERIVED_DATA_PATH="$(mktemp -d)" mkdir Documentation mv .build/documentation/archive/Nodes.doccarchive Documentation - name: Archive - run: > - tar -czf "Nodes-${GITHUB_REF_NAME}.tar.gz" Sources Documentation + run: tar -czf "Nodes-${GITHUB_REF_NAME}.tar.gz" Sources Documentation - name: Upload run: > jf rt u diff --git a/.github/workflows/docc.yml b/.github/workflows/docc.yml index e9556a960..09b5c56ba 100644 --- a/.github/workflows/docc.yml +++ b/.github/workflows/docc.yml @@ -7,7 +7,7 @@ on: branches: [ main ] env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: docc: @@ -15,6 +15,6 @@ jobs: runs-on: macos-latest steps: - name: Checkout source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build run: make docs open="no" DERIVED_DATA_PATH="$(mktemp -d)" diff --git a/.github/workflows/genesis.yml b/.github/workflows/genesis.yml index 7fa147de8..98a1b3607 100644 --- a/.github/workflows/genesis.yml +++ b/.github/workflows/genesis.yml @@ -7,7 +7,7 @@ on: branches: [ main ] env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: genesis: @@ -21,7 +21,7 @@ jobs: brew install mint xcodegen needle mockolo mint install yonaskolb/genesis - name: Checkout source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Create temporary directory id: mktemp run: echo "directory=$(mktemp -d)" >> "$GITHUB_OUTPUT" @@ -55,7 +55,7 @@ jobs: build-for-testing -scheme "Tinder" -destination "name=$SIMULATOR,OS=latest" - SWIFT_TREAT_WARNINGS_AS_ERRORS=YES + -skipPackagePluginValidation - name: Test working-directory: ${{ steps.mktemp.outputs.directory }} run: > diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ba018de03..41c031aa2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ on: branches: [ main ] env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: lint: @@ -15,11 +15,10 @@ jobs: runs-on: macos-latest steps: - name: Checkout source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Download swiftlint binary run: swift package resolve - name: Lint - run: | - DIRECTORY_NAME=$(echo "${PWD##*/}" | tr '[:upper:]' '[:lower:]') - "$(find ".build/artifacts/${DIRECTORY_NAME}" -type f -name swiftlint -perm +111 -print -quit)" \ + run: > + "$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)" lint --strict --reporter github-actions-logging diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 623bba283..4570b13ec 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -5,7 +5,7 @@ on: tags: ['[0-9]+.[0-9]+.[0-9]+'] env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: pages: @@ -23,7 +23,7 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Configure pages uses: actions/configure-pages@v2 - name: Build documentation diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index d9353870e..8d3abf983 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -7,8 +7,7 @@ on: branches: [ main ] env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer - SWIFT_STRICT_CONCURRENCY: complete + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: swift: @@ -16,30 +15,8 @@ jobs: runs-on: macos-latest steps: - name: Checkout source - uses: actions/checkout@v3 - - name: Validate excluded snapshots - run: | - SNAPSHOTS=$(find Tests -type d -name "__Snapshots__" | sort) - EXCLUDED=$(swift package dump-package | jq -r '.targets[] | select(.type == "test") | "Tests/" + .name + "/" + .exclude[]' | sort) - UNEXCLUDED=$(comm -23 <(echo "$SNAPSHOTS") <(echo "$EXCLUDED")) - if test -n "$UNEXCLUDED" - then - echo "::error::Snapshot directories must be excluded from Swift package:" >&2 - echo "$UNEXCLUDED" >&2 - exit 1 - fi + uses: actions/checkout@v4 - name: Build - run: swift build -v -Xswiftc -warnings-as-errors + run: swift build -v - name: Test run: swift test -v - - name: Delete snapshots - run: make delete-snapshots - - name: Record snapshots - run: swift test -v - continue-on-error: true - - name: Validate recorded snapshots - run: test -z "$(git status --porcelain)" - - name: Validate executables - run: | - swift run -- nodes-code-gen --help - swift run -- nodes-xcode-templates-gen --help diff --git a/.github/workflows/xcode.yml b/.github/workflows/xcode.yml index e3eb0eb9f..52d1af6a8 100644 --- a/.github/workflows/xcode.yml +++ b/.github/workflows/xcode.yml @@ -7,7 +7,7 @@ on: branches: [ main ] env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer jobs: xcode: @@ -17,7 +17,7 @@ jobs: SIMULATOR: iPhone 14 steps: - name: Checkout source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Resolve package dependencies run: xcodebuild -resolvePackageDependencies - name: Build @@ -26,7 +26,7 @@ jobs: build-for-testing -scheme "Nodes-Package" -destination "name=$SIMULATOR,OS=latest" - SWIFT_TREAT_WARNINGS_AS_ERRORS=YES + -skipPackagePluginValidation - name: Test run: > xcodebuild diff --git a/.gitignore b/.gitignore index ac74394db..7088ee8f1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,9 +8,3 @@ # Xcode *.xcworkspace/ *.xcodeproj/ - -# Codegen -**/Generated/ - -# Bazel -bazel-* diff --git a/.swiftlint-rules.yml b/.swiftlint-rules.yml index 8695ec8c4..58fa60d93 100644 --- a/.swiftlint-rules.yml +++ b/.swiftlint-rules.yml @@ -33,6 +33,7 @@ only_rules: - contains_over_filter_is_empty - contains_over_first_not_nil - contains_over_range_nil_comparison +# - contrasted_opening_brace - control_statement - convenience_type - custom_rules @@ -73,6 +74,7 @@ only_rules: - file_name - file_name_no_space - file_types_order +- final_test_case - first_where - flatmap_over_map_reduce - for_where @@ -124,11 +126,13 @@ only_rules: - multiple_closures_with_trailing_closure - nesting - nimble_operator +# - no_empty_block - no_extension_access_modifier - no_fallthrough_only - no_grouping_extension # - no_magic_numbers - no_space_in_method_call +- non_optional_string_data_conversion - non_overridable_class_declaration - notification_center_detachment - ns_number_init_as_function_reference @@ -137,6 +141,7 @@ only_rules: - nsobject_prefer_isequal - number_separator # - object_literal +# - one_declaration_per_file - opening_brace - operator_usage_whitespace - operator_whitespace @@ -146,6 +151,7 @@ only_rules: - override_in_extension - pattern_matching_keywords - period_spacing +- prefer_key_path - prefer_nimble - prefer_self_in_static_references - prefer_self_type_over_type_of_self @@ -181,6 +187,7 @@ only_rules: # - return_value_from_void_function - self_binding - self_in_property_initialization +# - shorthand_argument - shorthand_operator - shorthand_optional_binding - single_test_class @@ -189,6 +196,7 @@ only_rules: - sorted_imports - statement_position - static_operator +- static_over_final_class - strict_fileprivate - strong_iboutlet - superfluous_disable_command @@ -221,6 +229,7 @@ only_rules: - unused_control_flow_label - unused_enumerated - unused_optional_binding +- unused_parameter - unused_setter_value - valid_ibinspectable - vertical_parameter_alignment diff --git a/.swiftlint.yml b/.swiftlint.yml index 64751522e..94e6336ca 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,5 +1,4 @@ included: -- Plugins - Sources - Tests diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 73da17d61..bdbb231bc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,16 +1,11 @@ # Contributing to Nodes -- [Dependencies](#dependencies) -- [Open Package in Xcode](#open-package-in-xcode) -- [Static Analysis](#static-analysis) +- [Open Package](#open-package) +- [Lint Package](#lint-package) - [Testing](#testing) - [Creating Releases](#creating-releases) -## Dependencies - -Follow the [Swift Package Resources installation instructions](https://github.com/TinderApp/Swift-Package-Resources) to install tooling dependencies. - -## Open Package in Xcode +## Open Package > The file header comment template will also be installed. @@ -18,16 +13,10 @@ Follow the [Swift Package Resources installation instructions](https://github.co make open ``` -## Static Analysis +## Lint Package > SwiftLint violations are visible in Xcode as well. -Package dependencies must be resolved to download the SwiftLint binary. - -``` -swift package resolve -``` - To run SwiftLint from the command line: ``` @@ -40,12 +29,6 @@ To run analysis rules: make analyze ``` -To enable new rules whenever SwiftLint is upgraded to a new version: - -``` -make rules -``` - ## Testing To re-record all existing snapshot references, delete all using the following command and then run the tests. diff --git a/Makefile b/Makefile index e29841f13..04ea245ed 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,3 @@ -# -# The SwiftLint recipes require the Swift Package Resources scripts to be installed. -# -# https://github.com/TinderApp/Swift-Package-Resources#installation -# - .PHONY: release release: override library = Nodes release: override platforms = macos catalyst ios tvos watchos @@ -44,7 +38,8 @@ fix: .PHONY: lint lint: format ?= emoji lint: - @swiftlint lint --strict --progress --reporter "$(format)" + @swift package plugin \ + swiftlint lint --strict --progress --reporter "$(format)" .PHONY: analyze analyze: target ?= Nodes @@ -60,13 +55,11 @@ endif -destination "generic/platform=$(platform)" \ -derivedDataPath "$$DERIVED_DATA" \ -configuration "Debug" \ + -skipPackagePluginValidation \ CODE_SIGNING_ALLOWED="NO" \ > "$$XCODEBUILD_LOG"; \ - swiftlint analyze --strict --progress --reporter "$(format)" --compiler-log-path "$$XCODEBUILD_LOG" - -.PHONY: rules -rules: - @swiftlint rules | lint-rules + swift package plugin \ + swiftlint analyze --strict --progress --reporter "$(format)" --compiler-log-path "$$XCODEBUILD_LOG" .PHONY: delete-snapshots delete-snapshots: @@ -76,25 +69,6 @@ delete-snapshots: echo "Deleted $$snapshots"; \ done -.PHONY: preview -preview: target ?= Nodes -preview: - swift package --disable-sandbox preview-documentation --target "$(target)" - -.PHONY: site -site: target ?= Nodes -site: prefix ?= $(shell pwd) -site: DOCC_PATH = $(shell xcrun --find docc) -site: ARCHIVE_PATH = .build/documentation/archive -site: - @make docs open="no" - "$(DOCC_PATH)" process-archive \ - transform-for-static-hosting \ - "$(ARCHIVE_PATH)/$(target).doccarchive" \ - --output-path "$(prefix)/_site" - cp docs.html "$(prefix)/_site/index.html" - cp docs.html "$(prefix)/_site/documentation/index.html" - .PHONY: docs docs: target ?= Nodes docs: destination ?= generic/platform=iOS @@ -107,6 +81,7 @@ docs: -scheme "$(target)" \ -destination "$(destination)" \ -derivedDataPath "$(DERIVED_DATA_PATH)" \ + -skipPackagePluginValidation \ OTHER_DOCC_FLAGS="--warnings-as-errors" @find "$(DERIVED_DATA_PATH)" \ -type d \ @@ -114,6 +89,25 @@ docs: -exec cp -R {} "$(ARCHIVE_PATH)/" \; $(if $(filter $(open),OPEN),@open "$(ARCHIVE_PATH)/$(target).doccarchive",) +.PHONY: preview +preview: target ?= Nodes +preview: + swift package --disable-sandbox preview-documentation --target "$(target)" + +.PHONY: site +site: target ?= Nodes +site: prefix ?= $(shell pwd) +site: DOCC_PATH = $(shell xcrun --find docc) +site: ARCHIVE_PATH = .build/documentation/archive +site: + @make docs open="no" + "$(DOCC_PATH)" process-archive \ + transform-for-static-hosting \ + "$(ARCHIVE_PATH)/$(target).doccarchive" \ + --output-path "$(prefix)/_site" + cp docs.html "$(prefix)/_site/index.html" + cp docs.html "$(prefix)/_site/documentation/index.html" + .PHONY: get-libraries get-libraries: @./bin/get-libraries diff --git a/Package.resolved b/Package.resolved index a1dd9f502..bad74fc47 100644 --- a/Package.resolved +++ b/Package.resolved @@ -9,6 +9,24 @@ "version" : "0.3.0" } }, + { + "identity" : "collectionconcurrencykit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/JohnSundell/CollectionConcurrencyKit.git", + "state" : { + "revision" : "b4f23e24b5a1bff301efc5e70871083ca029ff95", + "version" : "0.2.0" + } + }, + { + "identity" : "cryptoswift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/krzyzanowskim/CryptoSwift.git", + "state" : { + "revision" : "678d442c6f7828def400a70ae15968aef67ef52d", + "version" : "1.8.3" + } + }, { "identity" : "cwlcatchexception", "kind" : "remoteSourceControl", @@ -32,8 +50,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/uber/needle.git", "state" : { - "revision" : "6db73ae873952794b94fd6bb5111554e23c160af", - "version" : "0.24.0" + "revision" : "69f7a889d2736f2621c6083ac29e0a75d158f249", + "version" : "0.25.1" } }, { @@ -41,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/Quick/Nimble.git", "state" : { - "revision" : "d616f15123bfb36db1b1075153f73cf40605b39d", - "version" : "13.0.0" + "revision" : "54b4e52183f16fe806014cbfd63718a84f8ba072", + "version" : "13.4.0" } }, { @@ -54,6 +72,15 @@ "version" : "1.0.1" } }, + { + "identity" : "sourcekitten", + "kind" : "remoteSourceControl", + "location" : "https://github.com/jpsim/SourceKitten.git", + "state" : { + "revision" : "fd4df99170f5e9d7cf9aa8312aa8506e0e7a44e7", + "version" : "0.35.0" + } + }, { "identity" : "spectre", "kind" : "remoteSourceControl", @@ -77,8 +104,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-argument-parser.git", "state" : { - "revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", - "version" : "1.3.0" + "revision" : "41982a3656a71c768319979febd796c6fd111d5c", + "version" : "1.5.0" } }, { @@ -86,14 +113,14 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-docc-plugin.git", "state" : { - "revision" : "26ac5758409154cc448d7ab82389c520fa8a8247", - "version" : "1.3.0" + "revision" : "2eb22993b3dfd0c0d32729b357c8dabb6cd44680", + "version" : "1.4.2" } }, { "identity" : "swift-docc-symbolkit", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-docc-symbolkit", + "location" : "https://github.com/swiftlang/swift-docc-symbolkit", "state" : { "revision" : "b45d1f2ed151d057b54504d653e0da5552844e34", "version" : "1.0.0" @@ -104,17 +131,44 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/pointfreeco/swift-snapshot-testing.git", "state" : { - "revision" : "59b663f68e69f27a87b45de48cb63264b8194605", - "version" : "1.15.1" + "revision" : "6d932a79e7173b275b96c600c86c603cf84f153c", + "version" : "1.17.4" } }, { "identity" : "swift-syntax", "kind" : "remoteSourceControl", - "location" : "https://github.com/apple/swift-syntax.git", + "location" : "https://github.com/swiftlang/swift-syntax", + "state" : { + "revision" : "515f79b522918f83483068d99c68daeb5116342d", + "version" : "600.0.0-prerelease-2024-08-14" + } + }, + { + "identity" : "swiftlint", + "kind" : "remoteSourceControl", + "location" : "https://github.com/realm/SwiftLint.git", + "state" : { + "revision" : "a24488f26e60247d8fff7bbb03d51910af3dc91c", + "version" : "0.56.2" + } + }, + { + "identity" : "swiftytexttable", + "kind" : "remoteSourceControl", + "location" : "https://github.com/scottrhoyt/SwiftyTextTable.git", + "state" : { + "revision" : "c6df6cf533d120716bff38f8ff9885e1ce2a4ac3", + "version" : "0.9.0" + } + }, + { + "identity" : "swxmlhash", + "kind" : "remoteSourceControl", + "location" : "https://github.com/drmohundro/SWXMLHash.git", "state" : { - "revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", - "version" : "509.0.2" + "revision" : "a853604c9e9a83ad9954c7e3d2a565273982471f", + "version" : "7.0.2" } }, { @@ -122,8 +176,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/jpsim/Yams.git", "state" : { - "revision" : "8a835d918245ca22f36663dd3862138805d7f707", - "version" : "5.1.0" + "revision" : "3036ba9d69cf1fd04d433527bc339dc0dc75433d", + "version" : "5.1.3" } } ], diff --git a/Package.swift b/Package.swift index 1ad709b36..95cb2d7ef 100644 --- a/Package.swift +++ b/Package.swift @@ -1,18 +1,11 @@ -// swift-tools-version:5.9 +// swift-tools-version:5.8 import PackageDescription -let packageName = "Nodes" - -enum SwiftLint { - static let plugin = "SwiftLintPlugin-\(packageName)" - static let binary = "SwiftLintBinary-\(packageName)" -} - let package = Package( - name: packageName, + name: "Nodes", platforms: [ - .macOS(.v10_15), + .macOS(.v12), .iOS(.v13), .tvOS(.v13), .watchOS(.v6), @@ -37,28 +30,31 @@ let package = Package( dependencies: [ .package( url: "https://github.com/apple/swift-argument-parser.git", - from: "1.0.0"), + exact: "1.5.0"), .package( url: "https://github.com/apple/swift-docc-plugin.git", - from: "1.0.0"), + exact: "1.4.2"), .package( url: "https://github.com/JohnSundell/Codextended.git", - from: "0.3.0"), + exact: "0.3.0"), .package( url: "https://github.com/jpsim/Yams.git", - from: "5.1.0"), + exact: "5.1.3"), .package( url: "https://github.com/stencilproject/Stencil.git", - from: "0.15.0"), + exact: "0.15.1"), .package( url: "https://github.com/uber/needle.git", - from: "0.22.0"), + exact: "0.25.1"), + .package( + url: "https://github.com/realm/SwiftLint.git", + exact: "0.56.2"), .package( url: "https://github.com/Quick/Nimble.git", - from: "13.0.0"), + exact: "13.4.0"), .package( url: "https://github.com/pointfreeco/swift-snapshot-testing.git", - from: "1.15.0"), + exact: "1.17.4"), ], targets: [ .executableTarget( @@ -67,28 +63,16 @@ let package = Package( "NodesGenerator", .product(name: "ArgumentParser", package: "swift-argument-parser"), ], - path: "Sources/Executables/NodesCodeGenerator", - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), + path: "Sources/Executables/NodesCodeGenerator"), .executableTarget( name: "NodesXcodeTemplatesGenerator", dependencies: [ "NodesGenerator", .product(name: "ArgumentParser", package: "swift-argument-parser"), ], - path: "Sources/Executables/NodesXcodeTemplatesGenerator", - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), + path: "Sources/Executables/NodesXcodeTemplatesGenerator"), .target( - name: "Nodes", - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), + name: "Nodes"), .target( name: "NodesGenerator", dependencies: [ @@ -98,29 +82,17 @@ let package = Package( ], resources: [ .process("Resources"), - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), ]), .target( name: "NodesTesting", dependencies: [ .product(name: "NeedleFoundation", package: "needle") - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), ]), .testTarget( name: "NodesTests", dependencies: [ "Nodes", "Nimble", - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), ]), .testTarget( name: "NodesGeneratorTests", @@ -132,40 +104,23 @@ let package = Package( ], exclude: [ "__Snapshots__", - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), ]), .testTarget( name: "NodesTestingTests", dependencies: [ "NodesTesting", "Nimble", - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), ]), - .plugin( - name: SwiftLint.plugin, - capability: .buildTool(), - dependencies: [ - .target(name: SwiftLint.binary) - ], - path: "Plugins/SwiftLintPlugin"), - .binaryTarget( - name: SwiftLint.binary, - url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip", - checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"), ] ) -extension Array where Element == SwiftSetting { +package.targets.forEach { target in + + target.swiftSettings = [ + .enableExperimentalFeature("StrictConcurrency"), + ] - static var swiftSettings: [SwiftSetting] { - guard let value: String = Context.environment["SWIFT_STRICT_CONCURRENCY"] - else { return [] } - return [.unsafeFlags(["-strict-concurrency=\(value)"])] - } + target.plugins = [ + .plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"), + ] } diff --git a/Package@swift-5.10.swift b/Package@swift-5.10.swift deleted file mode 100644 index 3328bf851..000000000 --- a/Package@swift-5.10.swift +++ /dev/null @@ -1,171 +0,0 @@ -// swift-tools-version:5.10 - -import PackageDescription - -let packageName = "Nodes" - -enum SwiftLint { - static let plugin = "SwiftLintPlugin-\(packageName)" - static let binary = "SwiftLintBinary-\(packageName)" -} - -let package = Package( - name: packageName, - platforms: [ - .macOS(.v10_15), - .iOS(.v13), - .tvOS(.v13), - .watchOS(.v6), - ], - products: [ - .executable( - name: "nodes-code-gen", - targets: ["NodesCodeGenerator"]), - .executable( - name: "nodes-xcode-templates-gen", - targets: ["NodesXcodeTemplatesGenerator"]), - .library( - name: "Nodes", - targets: ["Nodes"]), - .library( - name: "NodesGenerator", - targets: ["NodesGenerator"]), - .library( - name: "NodesTesting", - targets: ["NodesTesting"]), - ], - dependencies: [ - .package( - url: "https://github.com/apple/swift-argument-parser.git", - from: "1.0.0"), - .package( - url: "https://github.com/apple/swift-docc-plugin.git", - from: "1.0.0"), - .package( - url: "https://github.com/JohnSundell/Codextended.git", - from: "0.3.0"), - .package( - url: "https://github.com/jpsim/Yams.git", - from: "5.0.0"), - .package( - url: "https://github.com/stencilproject/Stencil.git", - from: "0.15.0"), - .package( - url: "https://github.com/uber/needle.git", - from: "0.22.0"), - .package( - url: "https://github.com/Quick/Nimble.git", - from: "13.0.0"), - .package( - url: "https://github.com/pointfreeco/swift-snapshot-testing.git", - from: "1.15.0"), - ], - targets: [ - .executableTarget( - name: "NodesCodeGenerator", - dependencies: [ - "NodesGenerator", - .product(name: "ArgumentParser", package: "swift-argument-parser"), - ], - path: "Sources/Executables/NodesCodeGenerator", - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .executableTarget( - name: "NodesXcodeTemplatesGenerator", - dependencies: [ - "NodesGenerator", - .product(name: "ArgumentParser", package: "swift-argument-parser"), - ], - path: "Sources/Executables/NodesXcodeTemplatesGenerator", - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .target( - name: "Nodes", - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .target( - name: "NodesGenerator", - dependencies: [ - "Codextended", - "Yams", - "Stencil", - ], - resources: [ - .process("Resources"), - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .target( - name: "NodesTesting", - dependencies: [ - .product(name: "NeedleFoundation", package: "needle") - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .testTarget( - name: "NodesTests", - dependencies: [ - "Nodes", - "Nimble", - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .testTarget( - name: "NodesGeneratorTests", - dependencies: [ - "NodesGenerator", - "Nimble", - .product(name: "SnapshotTesting", package: "swift-snapshot-testing"), - .product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"), - ], - exclude: [ - "__Snapshots__", - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .testTarget( - name: "NodesTestingTests", - dependencies: [ - "NodesTesting", - "Nimble", - ], - swiftSettings: .swiftSettings, - plugins: [ - .plugin(name: SwiftLint.plugin), - ]), - .plugin( - name: SwiftLint.plugin, - capability: .buildTool(), - dependencies: [ - .target(name: SwiftLint.binary) - ], - path: "Plugins/SwiftLintPlugin"), - .binaryTarget( - name: SwiftLint.binary, - url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip", - checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"), - ] -) - -extension Array where Element == SwiftSetting { - - static var swiftSettings: [SwiftSetting] { - [ - .enableExperimentalFeature("StrictConcurrency"), - ] - } -} diff --git a/Plugins/SwiftLintPlugin/SwiftLintPlugin.swift b/Plugins/SwiftLintPlugin/SwiftLintPlugin.swift deleted file mode 100644 index 9befef78d..000000000 --- a/Plugins/SwiftLintPlugin/SwiftLintPlugin.swift +++ /dev/null @@ -1,204 +0,0 @@ -// -// Copyright © 2023 Tinder (Match Group, LLC) -// - -import Foundation -import PackagePlugin - -@main -internal struct SwiftLintPlugin: BuildToolPlugin { - - internal enum SwiftLintPluginError: Error, CustomStringConvertible { - - case swiftFilesNotInProjectDirectory(Path) - case swiftFilesNotInWorkingDirectory(Path) - - internal var description: String { - switch self { - case let .swiftFilesNotInProjectDirectory(directory): - return """ - Swift files are not in project directory. - Directory: \(directory) - """ - case let .swiftFilesNotInWorkingDirectory(directory): - return """ - Swift files are not in working directory. - Directory: \(directory) - """ - } - } - } - - internal func createBuildCommands( - context: PluginContext, - target: Target - ) async throws -> [Command] { - try makeCommand(executable: context.tool(named: "swiftlint"), - swiftFiles: (target as? SourceModuleTarget).flatMap(swiftFiles) ?? [], - environment: environment(context: context, target: target), - pluginWorkDirectory: context.pluginWorkDirectory) - } - - /// Collects the paths of the Swift files to be linted. - private func swiftFiles(target: SourceModuleTarget) -> [Path] { - target - .sourceFiles(withSuffix: "swift") - .map(\.path) - } - - /// Creates an environment dictionary containing a value for the `BUILD_WORKSPACE_DIRECTORY` key. - /// - /// This method locates the topmost `.swiftlint.yml` config file within the package directory for this target - /// and sets the config file's containing directory as the `BUILD_WORKSPACE_DIRECTORY` value. The package - /// directory is used if a config file is not found. - /// - /// The `BUILD_WORKSPACE_DIRECTORY` environment variable controls SwiftLint's working directory. - /// - /// Reference: [https://github.com/realm/SwiftLint/blob/0.50.3/Source/swiftlint/Commands/SwiftLint.swift#L7]( - /// https://github.com/realm/SwiftLint/blob/0.50.3/Source/swiftlint/Commands/SwiftLint.swift#L7 - /// ) - private func environment( - context: PluginContext, - target: Target - ) throws -> [String: String] { - - let workingDirectory: Path = try target - .directory - .resolveWorkingDirectory(in: context.package.directory) - - return ["BUILD_WORKSPACE_DIRECTORY": "\(workingDirectory)"] - } - - private func makeCommand( - executable: PluginContext.Tool, - swiftFiles: [Path], - environment: [String: String], - pluginWorkDirectory path: Path - ) -> [Command] { - - print("Environment:", environment) - - guard !swiftFiles.isEmpty - else { return [] } - - let arguments: [String] = ["lint", "--quiet", "--force-exclude", "--cache-path", "\(path)"] - - return [ - .prebuildCommand( - displayName: "SwiftLint", - executable: executable.path, - arguments: arguments + swiftFiles.map(\.string), - environment: environment, - outputFilesDirectory: path.appending("Output")) - ] - } -} - -#if canImport(XcodeProjectPlugin) - -import XcodeProjectPlugin - -// swiftlint:disable:next no_grouping_extension -extension SwiftLintPlugin: XcodeBuildToolPlugin { - - internal func createBuildCommands( - context: XcodePluginContext, - target: XcodeTarget - ) throws -> [Command] { - try makeCommand(executable: context.tool(named: "swiftlint"), - swiftFiles: swiftFiles(target: target), - environment: environment(context: context, target: target), - pluginWorkDirectory: context.pluginWorkDirectory) - } - - /// Collects the paths of the Swift files to be linted. - private func swiftFiles(target: XcodeTarget) -> [Path] { - target - .inputFiles - .filter { $0.type == .source && $0.path.extension == "swift" } - .map(\.path) - } - - /// Creates an environment dictionary containing a value for the `BUILD_WORKSPACE_DIRECTORY` key. - /// - /// This method locates the topmost `.swiftlint.yml` config file within the project directory for this target's - /// Swift source files and sets the config file's containing directory as the `BUILD_WORKSPACE_DIRECTORY` value. - /// The project directory is used if a config file is not found. - /// - /// The `BUILD_WORKSPACE_DIRECTORY` environment variable controls SwiftLint's working directory. - /// - /// Reference: [https://github.com/realm/SwiftLint/blob/0.50.3/Source/swiftlint/Commands/SwiftLint.swift#L7]( - /// https://github.com/realm/SwiftLint/blob/0.50.3/Source/swiftlint/Commands/SwiftLint.swift#L7 - /// ) - private func environment( - context: XcodePluginContext, - target: XcodeTarget - ) throws -> [String: String] { - - let projectDirectory: Path = context.xcodeProject.directory - let swiftFiles: [Path] = swiftFiles(target: target) - let swiftFilesNotInProjectDirectory: [Path] = swiftFiles.filter { !$0.isDescendant(of: projectDirectory) } - - guard swiftFilesNotInProjectDirectory.isEmpty - else { throw SwiftLintPluginError.swiftFilesNotInProjectDirectory(projectDirectory) } - - let directories: [Path] = try swiftFiles.map { try $0.resolveWorkingDirectory(in: projectDirectory) } - let workingDirectory: Path = directories.min { $0.depth < $1.depth } ?? projectDirectory - let swiftFilesNotInWorkingDirectory: [Path] = swiftFiles.filter { !$0.isDescendant(of: workingDirectory) } - - guard swiftFilesNotInWorkingDirectory.isEmpty - else { throw SwiftLintPluginError.swiftFilesNotInWorkingDirectory(workingDirectory) } - - return ["BUILD_WORKSPACE_DIRECTORY": "\(workingDirectory)"] - } -} - -#endif - -extension Path { - - internal enum PathError: Error, CustomStringConvertible { - - case pathNotInDirectory(path: Path, directory: Path) - - internal var description: String { - switch self { - case let .pathNotInDirectory(path, directory): - return """ - Path is not in directory. - Path: \(path) - Directory: \(directory) - """ - } - } - } - - internal var directoryContainsConfigFile: Bool { - FileManager.default.fileExists(atPath: "\(self)/.swiftlint.yml") - } - - internal var depth: Int { - URL(fileURLWithPath: "\(self)").pathComponents.count - } - - internal func isDescendant(of path: Path) -> Bool { - "\(self)".hasPrefix("\(path)") - } - - internal func resolveWorkingDirectory(in directory: Path) throws -> Path { - - guard "\(self)".hasPrefix("\(directory)") - else { throw PathError.pathNotInDirectory(path: self, directory: directory) } - - let path: Path? = sequence(first: self) { path in - let path: Path = path.removingLastComponent() - guard "\(path)".hasPrefix("\(directory)") - else { return nil } - return path - } - .reversed() - .first(where: \.directoryContainsConfigFile) - - return path ?? directory - } -} diff --git a/Sources/Executables/NodesCodeGenerator/NodesCodeGeneratorCommand.swift b/Sources/Executables/NodesCodeGenerator/NodesCodeGeneratorCommand.swift index cde460210..785f33b3a 100644 --- a/Sources/Executables/NodesCodeGenerator/NodesCodeGeneratorCommand.swift +++ b/Sources/Executables/NodesCodeGenerator/NodesCodeGeneratorCommand.swift @@ -10,7 +10,6 @@ import NodesGenerator internal struct NodesCodeGeneratorCommand: ParsableCommand { #if swift(>=5.10) - // swiftlint:disable:next explicit_acl type_contents_order nonisolated(unsafe) internal static let configuration: CommandConfiguration = .init( commandName: "nodes-code-gen", abstract: "Nodes Code Generator" diff --git a/Sources/Executables/NodesXcodeTemplatesGenerator/NodesXcodeTemplatesGeneratorCommand.swift b/Sources/Executables/NodesXcodeTemplatesGenerator/NodesXcodeTemplatesGeneratorCommand.swift index 2036512d0..f4ac58808 100644 --- a/Sources/Executables/NodesXcodeTemplatesGenerator/NodesXcodeTemplatesGeneratorCommand.swift +++ b/Sources/Executables/NodesXcodeTemplatesGenerator/NodesXcodeTemplatesGeneratorCommand.swift @@ -9,7 +9,6 @@ import NodesGenerator internal struct NodesXcodeTemplatesGeneratorCommand: ParsableCommand { #if swift(>=5.10) - // swiftlint:disable:next explicit_acl type_contents_order nonisolated(unsafe) internal static let configuration: CommandConfiguration = .init( commandName: "nodes-xcode-templates-gen", abstract: "Nodes Xcode Templates Generator" diff --git a/Sources/Nodes/Core/AbstractBuilder.swift b/Sources/Nodes/Core/AbstractBuilder.swift index ef3e1f02b..e8a3b76a2 100644 --- a/Sources/Nodes/Core/AbstractBuilder.swift +++ b/Sources/Nodes/Core/AbstractBuilder.swift @@ -43,6 +43,8 @@ open class AbstractBuilder: Flow { #if DEBUG - // swiftlint:disable:next redundant_type_annotation private var _isStarted: Bool = false #endif diff --git a/Sources/Nodes/Core/AbstractWorker.swift b/Sources/Nodes/Core/AbstractWorker.swift index 2b86b9bfe..d62de2391 100644 --- a/Sources/Nodes/Core/AbstractWorker.swift +++ b/Sources/Nodes/Core/AbstractWorker.swift @@ -10,7 +10,7 @@ open class _BaseWorker: Worker { // swiftlint:disable:this type_name /// A Boolean value indicating whether the `Worker` instance has started working. - public private(set) var isWorking: Bool = false // swiftlint:disable:this redundant_type_annotation + public private(set) var isWorking: Bool = false /// Initializes a ``_BaseWorker`` instance. public init() {} diff --git a/Sources/Nodes/Core/Config/Plugin.swift b/Sources/Nodes/Core/Config/Plugin.swift index d47206279..80bc4f7d4 100644 --- a/Sources/Nodes/Core/Config/Plugin.swift +++ b/Sources/Nodes/Core/Config/Plugin.swift @@ -32,6 +32,8 @@ open class Plugin { self.componentFactory = componentFactory } + // swiftlint:disable unused_parameter + /// Contains the plugin's enabled criteria. /// /// The `create` method of the plugin will return a `BuildType` instance when enabled, otherwise `nil`. @@ -65,6 +67,8 @@ open class Plugin { preconditionFailure("Method in abstract base class must be overridden") } + // swiftlint:enable unused_parameter + /// Initializes and returns a `BuildType` instance when the plugin is enabled, otherwise `nil`. /// /// - Parameter state: The `StateType` instance. diff --git a/Sources/Nodes/Core/Config/PluginList.swift b/Sources/Nodes/Core/Config/PluginList.swift index 39ebb3f20..64fd3de18 100644 --- a/Sources/Nodes/Core/Config/PluginList.swift +++ b/Sources/Nodes/Core/Config/PluginList.swift @@ -78,6 +78,8 @@ open class PluginList { self.componentFactory = componentFactory } + // swiftlint:disable unused_parameter + /// Defines the collection of type-erased `AnyPlugin` instances. /// /// - Important: This abstract method must be overridden in subclasses. @@ -117,6 +119,8 @@ open class PluginList { plugins(component: component).map(\.key) } + // swiftlint:enable unused_parameter + /// Calls `create` on the plugins for the keys provided by ``creationOrder(component:state:)`` and returns /// the resulting non-nil `BuildType` instances in creation order. /// @@ -274,6 +278,8 @@ open class PluginListWithDefault: PluginList { + // swiftlint:disable unused_parameter + /// Defines the default instance to prepend to the collection of `BuildType` instances. /// /// - Important: This abstract method must be overridden in subclasses. @@ -290,6 +296,8 @@ open class PluginListWithDefault(withObjectOfType type: T.Type) -> Bool { (object as? T) != nil } @@ -80,6 +82,8 @@ public enum DebugInformation { else { return nil } return output } + + // swiftlint:enable unused_parameter } internal final class FlowWillStartNotification: NotificationPosting { diff --git a/Sources/Nodes/Internal/FlowController.swift b/Sources/Nodes/Internal/FlowController.swift index ff1fb78c0..c09c2afd8 100644 --- a/Sources/Nodes/Internal/FlowController.swift +++ b/Sources/Nodes/Internal/FlowController.swift @@ -23,7 +23,6 @@ public final class FlowController { /// The array of `Flow` instances managed by the ``FlowController``. public private(set) var flows: [Flow] = [] - // swiftlint:disable:next redundant_type_annotation internal var isFlowLeakDetectionEnabled: Bool = true /// Initializes a new ``FlowController`` instance to manage a collection of `Flow` instances. @@ -92,6 +91,8 @@ public final class FlowController { flows.reversed().forEach(detach) } + // swiftlint:disable unused_parameter + /// Detaches `Flow` instances of the given `type` (in LIFO order) where the given predicate closure returns `true`. /// /// Under normal circumstances, user interactions do not directly cause ``ViewControllable`` instances to @@ -210,6 +211,8 @@ public final class FlowController { flows.compactMap { $0 as? T } } + // swiftlint:enable unused_parameter + /// Executes the given closure with each `Flow` instance of the given `type`, if any exist, /// in the `flows` array. /// diff --git a/Sources/Nodes/Internal/WorkerController.swift b/Sources/Nodes/Internal/WorkerController.swift index bcdbb0712..88f28e005 100644 --- a/Sources/Nodes/Internal/WorkerController.swift +++ b/Sources/Nodes/Internal/WorkerController.swift @@ -30,6 +30,8 @@ public final class WorkerController { workers.forEach { $0.stop() } } + // swiftlint:disable unused_parameter + /// Returns the first `Worker` instance of the given `type`, if any exist, in the `workers` array. /// /// - Parameter type: The type of the `Worker` instance to return. @@ -67,6 +69,8 @@ public final class WorkerController { workers.compactMap { $0 as? T } } + // swiftlint:enable unused_parameter + /// Executes the given closure with each `Worker` instance of the given `type`, if any exist, /// in the `workers` array. /// diff --git a/Sources/Nodes/UIKit/Classes/NavigationController.swift b/Sources/Nodes/UIKit/Classes/NavigationController.swift index 7294d791b..6a6ab97cc 100644 --- a/Sources/Nodes/UIKit/Classes/NavigationController.swift +++ b/Sources/Nodes/UIKit/Classes/NavigationController.swift @@ -88,6 +88,8 @@ open class NavigationController: UINavigationController, UINavigationControllerD private var previousChildren: [UIViewController] = [] + // swiftlint:disable unused_parameter + /// Notifies the delegate after the navigation controller displays a view controller’s view and navigation /// item properties. /// @@ -112,6 +114,8 @@ open class NavigationController: UINavigationController, UINavigationControllerD didPopViewControllers(Array(previousChildren[startIndex...endIndex])) } + // swiftlint:enable unused_parameter + /// Assigns the closure in which to call the receiver method informing a `Context` instance of removed /// view controllers. /// diff --git a/Sources/Nodes/Utility/LeakDetector.swift b/Sources/Nodes/Utility/LeakDetector.swift index 475b36fac..3953c1d5f 100644 --- a/Sources/Nodes/Utility/LeakDetector.swift +++ b/Sources/Nodes/Utility/LeakDetector.swift @@ -67,6 +67,7 @@ public enum LeakDetector { #else + // swiftlint:disable:next unused_parameter public static func detect(_ object: AnyObject, delay: TimeInterval = 1) {} #endif diff --git a/Sources/NodesTesting/DependencyProviderRegistrationBuilder.swift b/Sources/NodesTesting/DependencyProviderRegistrationBuilder.swift index 1c13da52b..b7f149fa4 100644 --- a/Sources/NodesTesting/DependencyProviderRegistrationBuilder.swift +++ b/Sources/NodesTesting/DependencyProviderRegistrationBuilder.swift @@ -36,6 +36,8 @@ public final class DependencyProviderRegistrationBuilder { injectComponent(ofType: type, with: dependency) } + // swiftlint:disable unused_parameter + /// Injects a Needle component with mock dependencies. /// /// - Parameters: @@ -53,4 +55,6 @@ public final class DependencyProviderRegistrationBuilder { registration(path, dependency() as AnyObject) return self } + + // swiftlint:enable unused_parameter } diff --git a/Sources/NodesTesting/XCTestCase.swift b/Sources/NodesTesting/XCTestCase.swift index 94bb4db3d..39633bcc5 100644 --- a/Sources/NodesTesting/XCTestCase.swift +++ b/Sources/NodesTesting/XCTestCase.swift @@ -59,6 +59,8 @@ extension XCTestCase { } } + // swiftlint:disable unused_parameter + @MainActor private func registerBootstrapComponent>( componentFactory: @escaping () -> T @@ -70,4 +72,6 @@ extension XCTestCase { addTeardownBlock(teardown) } } + + // swiftlint:enable unused_parameter } diff --git a/Tests/NodesGeneratorTests/XcodeTemplatePropertyListTests.swift b/Tests/NodesGeneratorTests/XcodeTemplatePropertyListTests.swift index 7315a5904..bfc895c84 100644 --- a/Tests/NodesGeneratorTests/XcodeTemplatePropertyListTests.swift +++ b/Tests/NodesGeneratorTests/XcodeTemplatePropertyListTests.swift @@ -12,7 +12,6 @@ final class XcodeTemplatePropertyListTests: XCTestCase { private typealias Option = PropertyList.Option func testEncode() throws { - // swiftlint:disable:next redundant_type_annotation let flag: Bool = false // swiftlint:disable:next closure_body_length let plist: XcodeTemplatePropertyList = .init(sortOrder: 23) { diff --git a/Tests/NodesTests/CoreTests/AbstractBuilderTests.swift b/Tests/NodesTests/CoreTests/AbstractBuilderTests.swift index cf8f6ee51..1030966d0 100644 --- a/Tests/NodesTests/CoreTests/AbstractBuilderTests.swift +++ b/Tests/NodesTests/CoreTests/AbstractBuilderTests.swift @@ -14,6 +14,7 @@ final class AbstractBuilderTests: XCTestCase { private class TestBuilder: AbstractBuilder { + // swiftlint:disable:next unused_parameter override func build(component: ComponentType, dynamicBuildDependency: Void) -> BuildType { BuildType() } diff --git a/Tests/NodesTests/CoreTests/ConfigTests/PluginListTests.swift b/Tests/NodesTests/CoreTests/ConfigTests/PluginListTests.swift index 8f3e1188a..41ba65a8c 100644 --- a/Tests/NodesTests/CoreTests/ConfigTests/PluginListTests.swift +++ b/Tests/NodesTests/CoreTests/ConfigTests/PluginListTests.swift @@ -24,6 +24,7 @@ final class PluginListTests: XCTestCase, TestCaseHelpers { // swiftlint:disable:next discouraged_optional_collection var creationOrderOverride: [String]? + // swiftlint:disable:next unused_parameter override func plugins(component: ComponentType) -> KeyValuePairs { [ "plugin1": AnyPlugin(BuildType(identifier: "plugin1")), @@ -42,10 +43,12 @@ final class PluginListTests: XCTestCase, TestCaseHelpers { // swiftlint:disable:next discouraged_optional_collection var creationOrderOverride: [String]? + // swiftlint:disable:next unused_parameter override func `default`(component: ComponentType) -> (key: String, instance: BuildType) { (key: "default", instance: BuildType(identifier: "default")) } + // swiftlint:disable:next unused_parameter override func plugins(component: ComponentType) -> KeyValuePairs { [ "plugin1": AnyPlugin(BuildType(identifier: "plugin1")), diff --git a/Tests/NodesTests/CoreTests/ConfigTests/PluginTests.swift b/Tests/NodesTests/CoreTests/ConfigTests/PluginTests.swift index dc9769976..5debbd9be 100644 --- a/Tests/NodesTests/CoreTests/ConfigTests/PluginTests.swift +++ b/Tests/NodesTests/CoreTests/ConfigTests/PluginTests.swift @@ -14,13 +14,14 @@ final class PluginTests: XCTestCase, TestCaseHelpers { private class TestPlugin: Plugin { - // swiftlint:disable:next redundant_type_annotation var isEnabledOverride: Bool = true + // swiftlint:disable:next unused_parameter override func isEnabled(component: ComponentType, state: Void) -> Bool { isEnabledOverride } + // swiftlint:disable:next unused_parameter override func build(component: ComponentType) -> BuildType { BuildType() } diff --git a/Tests/NodesTests/InternalTests/FlowControllerTests.swift b/Tests/NodesTests/InternalTests/FlowControllerTests.swift index c03847c80..f5f75c18f 100644 --- a/Tests/NodesTests/InternalTests/FlowControllerTests.swift +++ b/Tests/NodesTests/InternalTests/FlowControllerTests.swift @@ -31,7 +31,6 @@ final class FlowControllerTests: XCTestCase, TestCaseHelpers { func testFlowLeakDetection() { let flowController: FlowController = givenFlowController(with: mockFlows) expect(flowController.isFlowLeakDetectionEnabled) == true - // swiftlint:disable:next redundant_type_annotation var called: Bool = false flowController.withoutFlowLeakDetection { flowController in called = true diff --git a/Tests/NodesTests/ReactiveTests/StateObserverTests.swift b/Tests/NodesTests/ReactiveTests/StateObserverTests.swift index c6ba92c69..2b0e6f826 100644 --- a/Tests/NodesTests/ReactiveTests/StateObserverTests.swift +++ b/Tests/NodesTests/ReactiveTests/StateObserverTests.swift @@ -13,6 +13,7 @@ final class StateObserverTests: XCTestCase { private(set) var observerCallCount: Int = 0 + // swiftlint:disable:next unused_parameter func update(with: Void) { observerCallCount += 1 } diff --git a/Tests/NodesTests/Support/NodesMocks.swift b/Tests/NodesTests/Support/NodesMocks.swift index d4bebcf41..608ffcae3 100644 --- a/Tests/NodesTests/Support/NodesMocks.swift +++ b/Tests/NodesTests/Support/NodesMocks.swift @@ -10,7 +10,6 @@ internal final class FlowMock: Flow, Equatable { internal let tree: Node = .init(name: "", children: []) - // swiftlint:disable:next redundant_type_annotation internal private(set) var isStarted: Bool = false // swiftlint:disable:next identifier_name @@ -33,7 +32,6 @@ internal final class FlowMock: Flow, Equatable { internal final class ContextMock: Context { - // swiftlint:disable:next redundant_type_annotation internal private(set) var isActive: Bool = false internal func activate() { @@ -47,7 +45,6 @@ internal final class ContextMock: Context { internal final class WorkerMock: Worker, Equatable { - // swiftlint:disable:next redundant_type_annotation internal private(set) var isWorking: Bool = false internal static func == (lhs: WorkerMock, rhs: WorkerMock) -> Bool { @@ -65,7 +62,6 @@ internal final class WorkerMock: Worker, Equatable { internal final class CancellableMock: Cancellable { - // swiftlint:disable:next redundant_type_annotation internal private(set) var isCancelled: Bool = false internal static func == (lhs: CancellableMock, rhs: CancellableMock) -> Bool { diff --git a/Tests/NodesTests/Support/TestCaseHelpers.swift b/Tests/NodesTests/Support/TestCaseHelpers.swift index 1c51c23bf..818ef7081 100644 --- a/Tests/NodesTests/Support/TestCaseHelpers.swift +++ b/Tests/NodesTests/Support/TestCaseHelpers.swift @@ -31,6 +31,8 @@ extension TestCaseHelpers where Self: XCTestCase { addTeardownBlock { block(reference()) } } + // swiftlint:disable unused_parameter + @MainActor internal func tearDown( keyPath: ReferenceWritableKeyPath, @@ -41,6 +43,8 @@ extension TestCaseHelpers where Self: XCTestCase { addTeardownBlock(for: keyPath, with: initialValue) } + // swiftlint:enable unused_parameter + @MainActor internal func tearDown( keyPath: ReferenceWritableKeyPath, diff --git a/Tests/NodesTests/UIKitTests/ExtensionsTests/UIViewController+ViewControllableTests.swift b/Tests/NodesTests/UIKitTests/ExtensionsTests/UIViewController+ViewControllableTests.swift index 645647ca5..d9092aa60 100644 --- a/Tests/NodesTests/UIKitTests/ExtensionsTests/UIViewController+ViewControllableTests.swift +++ b/Tests/NodesTests/UIKitTests/ExtensionsTests/UIViewController+ViewControllableTests.swift @@ -24,6 +24,8 @@ final class UIViewControllerViewControllableTests: XCTestCase { private(set) var willMoveCallCount: Int = 0 private(set) var didMoveCallCount: Int = 0 + // swiftlint:disable unused_parameter + override func present( _ viewControllerToPresent: UIViewController, animated flag: Bool, @@ -39,6 +41,8 @@ final class UIViewControllerViewControllableTests: XCTestCase { dismissCallCount += 1 } + // swiftlint:enable unused_parameter + override func willMove(toParent parent: UIViewController?) { super.willMove(toParent: parent) willMoveCallCount += 1 From 1006781b5c09a00b4db556d9a7c1944095200c14 Mon Sep 17 00:00:00 2001 From: Christopher Fuller Date: Wed, 18 Sep 2024 20:40:39 -0700 Subject: [PATCH 02/11] Update Nodes quick start with standard Swift package configuration (#845) * Update Nodes quick start with standard SPM config * Fix xcodegen config * Disable unused_parameter SwiftLint rule * Upgrade Needle and Nimble * Set Nimble to v13.4 --- .github/workflows/genesis.yml | 5 ++--- genesis.yml | 36 +++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/genesis.yml b/.github/workflows/genesis.yml index 98a1b3607..901a626cc 100644 --- a/.github/workflows/genesis.yml +++ b/.github/workflows/genesis.yml @@ -41,9 +41,8 @@ jobs: run: swift package resolve - name: Lint working-directory: ${{ steps.mktemp.outputs.directory }} - run: | - DIRECTORY_NAME=$(echo "${PWD##*/}" | tr '[:upper:]' '[:lower:]') - "$(find ".build/artifacts/${DIRECTORY_NAME}" -type f -name swiftlint -perm +111 -print -quit)" \ + run: > + "$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)" lint --strict --reporter github-actions-logging - name: Resolve package dependencies working-directory: ${{ steps.mktemp.outputs.directory }} diff --git a/genesis.yml b/genesis.yml index c99d96bfc..042736dc4 100644 --- a/genesis.yml +++ b/genesis.yml @@ -1,6 +1,6 @@ options: - - question: "Nodes Version Requirement (up to next major):" + - question: "Nodes Version:" name: nodes type: string required: true @@ -25,7 +25,7 @@ options: type: string required: true - - question: "[OPTIONAL] Nodes repository absolute file path (overrides Nodes version requirement):" + - question: "[OPTIONAL] Nodes repository absolute file path (overrides Nodes version):" name: path type: string required: false @@ -83,6 +83,7 @@ files: - contains_over_filter_is_empty - contains_over_first_not_nil - contains_over_range_nil_comparison + # - contrasted_opening_brace - control_statement - convenience_type - custom_rules @@ -123,6 +124,7 @@ files: # - file_name - file_name_no_space # - file_types_order + - final_test_case - first_where - flatmap_over_map_reduce - for_where @@ -174,11 +176,13 @@ files: - multiple_closures_with_trailing_closure - nesting - nimble_operator + # - no_empty_block - no_extension_access_modifier - no_fallthrough_only # - no_grouping_extension # - no_magic_numbers - no_space_in_method_call + - non_optional_string_data_conversion - non_overridable_class_declaration - notification_center_detachment - ns_number_init_as_function_reference @@ -187,6 +191,7 @@ files: - nsobject_prefer_isequal - number_separator # - object_literal + # - one_declaration_per_file - opening_brace - operator_usage_whitespace - operator_whitespace @@ -196,6 +201,7 @@ files: - override_in_extension - pattern_matching_keywords - period_spacing + - prefer_key_path - prefer_nimble - prefer_self_in_static_references - prefer_self_type_over_type_of_self @@ -231,6 +237,7 @@ files: # - return_value_from_void_function - self_binding - self_in_property_initialization + # - shorthand_argument - shorthand_operator - shorthand_optional_binding - single_test_class @@ -239,6 +246,7 @@ files: - sorted_imports - statement_position - static_operator + - static_over_final_class # - strict_fileprivate - strong_iboutlet - superfluous_disable_command @@ -271,6 +279,7 @@ files: - unused_control_flow_label - unused_enumerated - unused_optional_binding + # - unused_parameter - unused_setter_value - valid_ibinspectable - vertical_parameter_alignment @@ -870,7 +879,7 @@ files: - path: Package.swift contents: | - // swift-tools-version:5.9 + // swift-tools-version:5.8 import PackageDescription @@ -883,14 +892,11 @@ files: path: "{{ path }}"), {% else %} url: "git@github.com:TinderApp/Nodes.git", - from: "{{ nodes }}"), + exact: "{{ nodes }}"), {% endif %} - ], - targets: [ - .binaryTarget( - name: "SwiftLintBinary-{{ project|replace:' ','_' }}", - url: "https://github.com/realm/SwiftLint/releases/download/0.54.0/SwiftLintBinary-macos.artifactbundle.zip", - checksum: "963121d6babf2bf5fd66a21ac9297e86d855cbc9d28322790646b88dceca00f1"), + .package( + url: "https://github.com/realm/SwiftLint.git", + exact: "0.56.2"), ] ) @@ -1003,14 +1009,14 @@ files: path: {{ path }} {% else %} url: git@github.com:TinderApp/Nodes.git - from: {{ nodes }} + version: {{ nodes }} {% endif %} NeedleFoundation: url: https://github.com/uber/needle.git - from: 0.24.0 + version: 0.25.1 Nimble: url: https://github.com/Quick/Nimble.git - from: 13.0.0 + version: 13.4.0 configFiles: Debug: BuildSettings/Debug.xcconfig Release: BuildSettings/Release.xcconfig @@ -1124,9 +1130,7 @@ files: # https://github.com/realm/SwiftLint/blob/0.52.4/Source/swiftlint/Commands/SwiftLint.swift#L8 unset BUILD_WORKSPACE_DIRECTORY - DIRECTORY_NAME="$(echo "${PWD##*/}" | tr '[:upper:]' '[:lower:]')" - - "$(find ".build/artifacts/${DIRECTORY_NAME}" -type f -name swiftlint -perm +111 -print -quit)" + "$(find ".build/artifacts/swiftlint" -type f -name swiftlint -perm +111 -print -quit)" else echo "SwiftLint is skipped in CI." fi From 7006007a7be2b753922bebf0c15387045121387d Mon Sep 17 00:00:00 2001 From: Christopher Fuller Date: Wed, 18 Sep 2024 21:03:14 -0700 Subject: [PATCH 03/11] Add Store for state management (#799) Add store --- Customization/Perception.md | 342 +++++++++++++++++ Customization/RxSwift.md | 11 - Sources/Nodes/Reactive/StateObserver.swift | 2 +- Sources/Nodes/Reactive/WithViewState.swift | 63 ---- .../StateManagement/ObservableStore.swift | 349 +++++++++++++++++ Sources/Nodes/StateManagement/Store.swift | 352 ++++++++++++++++++ Sources/Nodes/_Documentation.docc/Nodes.md | 20 +- .../ReactiveTests/WithViewStateTests.swift | 26 -- .../ObservableStoreTests.swift | 103 +++++ .../StateManagementTests/StoreTests.swift | 104 ++++++ 10 files changed, 1270 insertions(+), 102 deletions(-) create mode 100644 Customization/Perception.md delete mode 100644 Sources/Nodes/Reactive/WithViewState.swift create mode 100644 Sources/Nodes/StateManagement/ObservableStore.swift create mode 100644 Sources/Nodes/StateManagement/Store.swift delete mode 100644 Tests/NodesTests/ReactiveTests/WithViewStateTests.swift create mode 100644 Tests/NodesTests/StateManagementTests/ObservableStoreTests.swift create mode 100644 Tests/NodesTests/StateManagementTests/StoreTests.swift diff --git a/Customization/Perception.md b/Customization/Perception.md new file mode 100644 index 000000000..7e758a356 --- /dev/null +++ b/Customization/Perception.md @@ -0,0 +1,342 @@ +A store compatible with [Perception](https://github.com/pointfreeco/swift-perception). + +```swift +// +// Copyright © 2024 Tinder (Match Group, LLC) +// + +import Combine +import Nodes +import Observation +import Perception +import SwiftUI + +// MARK: - Protocols + +@preconcurrency +@MainActor +public protocol PerceptibleStateStore: AnyObject { + + associatedtype State: Equatable + + var state: State { get set } +} + +@preconcurrency +@MainActor +public protocol PerceptibleViewStateStore: AnyObject, Perceptible { + + associatedtype ViewState: Equatable + + var viewState: ViewState { get } + + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding + + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding +} + +// MARK: - State Store + +@preconcurrency +@MainActor +public final class AnyPerceptibleStateStore< + State: Equatable +>: PerceptibleStateStore { + + public var state: State { + get { box.state } + set { box.state = newValue } + } + + private var box: PerceptibleStateStoreBase + + public init( + _ base: Base + ) where Base.State == State { + if let base: AnyPerceptibleStateStore = base as? AnyPerceptibleStateStore { + box = base.box + } else { + box = PerceptibleStateStoreBox(base) + } + } +} + +@preconcurrency +@MainActor +private class PerceptibleStateStoreBox< + Base: PerceptibleStateStore +>: PerceptibleStateStoreBase { + + override var state: Base.State { + get { base.state } + set { base.state = newValue } + } + + private var base: Base + + init(_ base: Base) { + self.base = base + } +} + +@preconcurrency +@MainActor +private class PerceptibleStateStoreBase< + State: Equatable +>: PerceptibleStateStore { + + var state: State { + get { preconditionFailure("Property in abstract base class must be overridden") } + // swiftlint:disable:next unused_setter_value + set { preconditionFailure("Property in abstract base class must be overridden") } + } +} + +// MARK: - View State Store + +@Perceptible +@preconcurrency +@MainActor +public final class AnyPerceptibleViewStateStore< + ViewState: Equatable +>: PerceptibleViewStateStore { + + public var viewState: ViewState { + box.viewState + } + + @PerceptionIgnored + private var box: PerceptibleViewStateStoreBase + + public init( + _ base: Base + ) where Base.ViewState == ViewState { + box = PerceptibleViewStateStoreBox(base) + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + box.bind(to: keyPath, onChange: onChange) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + box.bind(to: keyPath, onChange: onChange) + } +} + +@preconcurrency +@MainActor +private class PerceptibleViewStateStoreBox< + Base: PerceptibleViewStateStore +>: PerceptibleViewStateStoreBase { + + override var viewState: Base.ViewState { + base.viewState + } + + private var base: Base + + init(_ base: Base) { + self.base = base + } + + override func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + base.bind(to: keyPath, onChange: onChange) + } + + override func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + base.bind(to: keyPath, onChange: onChange) + } +} + +@preconcurrency +@MainActor +private class PerceptibleViewStateStoreBase< + ViewState: Equatable +>: PerceptibleViewStateStore { + + var viewState: ViewState { + preconditionFailure("Property in abstract base class must be overridden") + } + + // swiftlint:disable:next unavailable_function + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + preconditionFailure("Method in abstract base class must be overridden") + } + + // swiftlint:disable:next unavailable_function + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + preconditionFailure("Method in abstract base class must be overridden") + } +} + +// MARK: - Preview + +#if DEBUG + +@preconcurrency +@MainActor +public final class PerceptiblePreviewStore: PerceptibleViewStateStore { + + public let viewState: ViewState + + public init(viewState: ViewState) { + self.viewState = viewState + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + .constant(viewState[keyPath: keyPath]) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + .constant(viewState[keyPath: keyPath]) + } +} + +#endif + +// MARK: - Scope + +@Perceptible +@preconcurrency +@MainActor +private final class PerceptibleScope< + Store: PerceptibleViewStateStore, + ViewState: Equatable +>: PerceptibleViewStateStore { + + var viewState: ViewState { + store.viewState[keyPath: keyPath] + } + + private let store: Store + private let keyPath: KeyPath + + init( + store: Store, + keyPath: KeyPath + ) { + self.store = store + self.keyPath = keyPath + } + + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + store.bind(to: self.keyPath.appending(path: keyPath), onChange: onChange) + } + + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + store.bind(to: self.keyPath.appending(path: keyPath), onChange: onChange) + } +} + +// MARK: - Store + +@Perceptible +@preconcurrency +@MainActor +open class PerceptibleStore< + State: Equatable, + ViewState: Equatable +>: PerceptibleStateStore, PerceptibleViewStateStore { + + @PerceptionIgnored + public var state: State { + didSet { + guard state != oldValue + else { return } + viewState = transform(state) + viewStateSubject.send(viewState) + } + } + + public private(set) var viewState: ViewState + + public let viewStatePublisher: AnyPublisher + + private let viewStateSubject: CurrentValueSubject + + private let transform: (_ state: State) -> ViewState + + public convenience init( + state: State, + transform: T + ) where T.Input == State, T.Output == ViewState { + self.init(state: state) { transform($0) } + } + + public init( + state: State, + transform: @escaping (State) -> ViewState + ) { + let viewState: ViewState = transform(state) + let viewStateSubject: CurrentValueSubject = .init(viewState) + self.state = state + self.viewState = viewState + self.viewStatePublisher = viewStateSubject + .removeDuplicates() + .eraseToAnyPublisher() + self.viewStateSubject = viewStateSubject + self.transform = transform + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + Binding(get: { [self] in viewState[keyPath: keyPath] }, set: { onChange($0) }) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + Binding(get: { [self] in viewState[keyPath: keyPath] }, set: { onChange?($0) }) + } +} + +// MARK: - Extensions + +extension PerceptibleViewStateStore { + + public func scope( + viewState keyPath: KeyPath + ) -> AnyPerceptibleViewStateStore { + AnyPerceptibleViewStateStore(PerceptibleScope(store: self, keyPath: keyPath)) + } +} +``` diff --git a/Customization/RxSwift.md b/Customization/RxSwift.md index e8c08ea9d..a218c3839 100644 --- a/Customization/RxSwift.md +++ b/Customization/RxSwift.md @@ -138,17 +138,6 @@ extension StateObserver { } } -extension WithViewState { - - public init( - initialState: ViewState, - stateObservable publisher: P, - @ViewBuilder content: @escaping (ViewState) -> Content - ) where P.Output == ViewState, P.Failure == Never { - self.init(initialState: initialState, statePublisher: publisher, content: content) - } -} - extension Observable: Publisher { public typealias Output = Element diff --git a/Sources/Nodes/Reactive/StateObserver.swift b/Sources/Nodes/Reactive/StateObserver.swift index 2afcdfa47..a04a6feb1 100644 --- a/Sources/Nodes/Reactive/StateObserver.swift +++ b/Sources/Nodes/Reactive/StateObserver.swift @@ -13,7 +13,7 @@ import Combine * configuring the `update(with:)` method to automatically be called with view state emitted by a given * publisher. * - * > Important: For [SwiftUI](https://developer.apple.com/documentation/swiftui) use ``WithViewState`` instead. + * > Important: `StateObserver` is not to be used with [SwiftUI](https://developer.apple.com/documentation/swiftui). */ @preconcurrency @MainActor diff --git a/Sources/Nodes/Reactive/WithViewState.swift b/Sources/Nodes/Reactive/WithViewState.swift deleted file mode 100644 index e3a2a8f97..000000000 --- a/Sources/Nodes/Reactive/WithViewState.swift +++ /dev/null @@ -1,63 +0,0 @@ -// -// Copyright © 2021 Tinder (Match Group, LLC) -// - -#if canImport(Combine) && canImport(SwiftUI) - -import Combine -import SwiftUI - -/** - * A [SwiftUI](https://developer.apple.com/documentation/swiftui) helper - * [View](https://developer.apple.com/documentation/swiftui/view) that provides access to view state emitted - * by a given [Combine](https://developer.apple.com/documentation/combine) publisher. - * - * Usage Example: - * ```swift - * struct ExampleViewState: Equatable { - * let text: String - * } - * - * struct ExampleView: View { - * let initialState: ExampleViewState = .init(text: "Hello World") - * let statePublisher: AnyPublisher - * var body: some View { - * WithViewState(initialState: initialState, statePublisher: statePublisher) { viewState in - * Text(viewState.text) - * } - * } - * } - * ``` - */ -@available(macOS 10.15, macCatalyst 13.0, iOS 13.0, tvOS 13.0, watchOS 6.0, *) -public struct WithViewState: View { - - /// The content and behavior of the view. - public var body: some View { - content(viewState).onReceive(publisher) { viewState = $0 } - } - - @State private var viewState: ViewState - - private let publisher: AnyPublisher - private let content: (ViewState) -> Content - - /// Initializes a ``WithViewState`` view with the given view state `publisher`, `initialState` and `content`. - /// - /// - Parameters: - /// - initialState: The initial view state. - /// - publisher: The view state [`Publisher`](https://developer.apple.com/documentation/combine/publisher) - /// instance to observe. - /// - content: A view builder that creates the content of this view. - public init( - initialState: ViewState, - statePublisher publisher: P, - @ViewBuilder content: @escaping (ViewState) -> Content - ) where P.Output == ViewState, P.Failure == Never { - _viewState = State(initialValue: initialState) - self.publisher = publisher.eraseToAnyPublisher() - self.content = content - } -} - -#endif diff --git a/Sources/Nodes/StateManagement/ObservableStore.swift b/Sources/Nodes/StateManagement/ObservableStore.swift new file mode 100644 index 000000000..32b9d240e --- /dev/null +++ b/Sources/Nodes/StateManagement/ObservableStore.swift @@ -0,0 +1,349 @@ +// +// Copyright © 2024 Tinder (Match Group, LLC) +// + +#if canImport(Combine) && canImport(SwiftUI) + +import Combine +import SwiftUI + +// MARK: - Protocols + +@preconcurrency +@MainActor +public protocol ObservableStateStore: AnyObject { + + associatedtype State: Equatable + + var state: State { get set } +} + +@preconcurrency +@MainActor +public protocol ObservableViewStateStore: AnyObject, ObservableObject { + + associatedtype ViewState: Equatable + + var viewState: ViewState { get } + + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding + + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding +} + +// MARK: - State Store + +@preconcurrency +@MainActor +public final class AnyObservableStateStore< + State: Equatable +>: ObservableStateStore { + + public var state: State { + get { box.state } + set { box.state = newValue } + } + + private var box: ObservableStateStoreBase + + public init( + _ base: Base + ) where Base.State == State { + if let base: AnyObservableStateStore = base as? AnyObservableStateStore { + box = base.box + } else { + box = ObservableStateStoreBox(base) + } + } +} + +@preconcurrency +@MainActor +private class ObservableStateStoreBox< + Base: ObservableStateStore +>: ObservableStateStoreBase { + + override var state: Base.State { + get { base.state } + set { base.state = newValue } + } + + private var base: Base + + init(_ base: Base) { + self.base = base + } +} + +@preconcurrency +@MainActor +private class ObservableStateStoreBase< + State: Equatable +>: ObservableStateStore { + + var state: State { + get { preconditionFailure("Property in abstract base class must be overridden") } + // swiftlint:disable:next unused_setter_value + set { preconditionFailure("Property in abstract base class must be overridden") } + } +} + +// MARK: - View State Store + +@preconcurrency +@MainActor +public final class AnyObservableViewStateStore< + ViewState: Equatable +>: ObservableViewStateStore { + + public var viewState: ViewState { + box.viewState + } + + private var box: ObservableViewStateStoreBase + + private var cancellable: AnyCancellable? + + public init( + _ base: Base + ) where Base.ViewState == ViewState { + box = ObservableViewStateStoreBox(base) + cancellable = base + .objectWillChange + .sink { [weak self] _ in + self?.objectWillChange.send() + } + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + box.bind(to: keyPath, onChange: onChange) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + box.bind(to: keyPath, onChange: onChange) + } +} + +@preconcurrency +@MainActor +private class ObservableViewStateStoreBox< + Base: ObservableViewStateStore +>: ObservableViewStateStoreBase { + + override var viewState: Base.ViewState { + base.viewState + } + + private var base: Base + + init(_ base: Base) { + self.base = base + } + + override func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + base.bind(to: keyPath, onChange: onChange) + } + + override func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + base.bind(to: keyPath, onChange: onChange) + } +} + +@preconcurrency +@MainActor +private class ObservableViewStateStoreBase< + ViewState: Equatable +>: ObservableViewStateStore { + + var viewState: ViewState { + preconditionFailure("Property in abstract base class must be overridden") + } + + // swiftlint:disable:next unavailable_function + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + preconditionFailure("Method in abstract base class must be overridden") + } + + // swiftlint:disable:next unavailable_function + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + preconditionFailure("Method in abstract base class must be overridden") + } +} + +// MARK: - Preview + +#if DEBUG + +@preconcurrency +@MainActor +public final class ObservablePreviewStore: ObservableViewStateStore { + + public let viewState: ViewState + + public init(viewState: ViewState) { + self.viewState = viewState + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + .constant(viewState[keyPath: keyPath]) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + .constant(viewState[keyPath: keyPath]) + } +} + +#endif + +// MARK: - Scope + +@preconcurrency +@MainActor +private final class ObservableScope< + Store: ObservableViewStateStore, + ViewState: Equatable +>: ObservableViewStateStore { + + var viewState: ViewState { + store.viewState[keyPath: keyPath] + } + + private let store: Store + private let keyPath: KeyPath + + private var cancellable: AnyCancellable? + + init( + store: Store, + keyPath: KeyPath + ) { + self.store = store + self.keyPath = keyPath + cancellable = store + .objectWillChange + .sink { [weak self] _ in + self?.objectWillChange.send() + } + } + + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + store.bind(to: self.keyPath.appending(path: keyPath), onChange: onChange) + } + + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + store.bind(to: self.keyPath.appending(path: keyPath), onChange: onChange) + } +} + +// MARK: - Store + +@preconcurrency +@MainActor +open class ObservableStore< + State: Equatable, + ViewState: Equatable +>: ObservableStateStore, ObservableViewStateStore { + + public var state: State { + didSet { + guard state != oldValue + else { return } + viewState = transform(state) + viewStateSubject.send(viewState) + } + } + + @Published + public private(set) var viewState: ViewState + + public let viewStatePublisher: AnyPublisher + + private let viewStateSubject: CurrentValueSubject + + private let transform: (_ state: State) -> ViewState + + public convenience init( + state: State, + transform: T + ) where T.Input == State, T.Output == ViewState { + self.init(state: state) { transform($0) } + } + + public init( + state: State, + transform: @escaping (State) -> ViewState + ) { + let viewState: ViewState = transform(state) + let viewStateSubject: CurrentValueSubject = .init(viewState) + self.state = state + self.viewState = viewState + self.viewStatePublisher = viewStateSubject + .removeDuplicates() + .eraseToAnyPublisher() + self.viewStateSubject = viewStateSubject + self.transform = transform + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + Binding(get: { [self] in viewState[keyPath: keyPath] }, set: { onChange($0) }) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + Binding(get: { [self] in viewState[keyPath: keyPath] }, set: { onChange?($0) }) + } +} + +// MARK: - Extensions + +extension ObservableViewStateStore { + + public func scope( + viewState keyPath: KeyPath + ) -> AnyObservableViewStateStore { + AnyObservableViewStateStore(ObservableScope(store: self, keyPath: keyPath)) + } +} + +#endif diff --git a/Sources/Nodes/StateManagement/Store.swift b/Sources/Nodes/StateManagement/Store.swift new file mode 100644 index 000000000..4c487a69c --- /dev/null +++ b/Sources/Nodes/StateManagement/Store.swift @@ -0,0 +1,352 @@ +// +// Copyright © 2024 Tinder (Match Group, LLC) +// + +#if canImport(Combine) && canImport(Observation) && canImport(SwiftUI) + +import Combine +import Observation +import SwiftUI + +// MARK: - Protocols + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +public protocol StateStore: AnyObject { + + associatedtype State: Equatable + + var state: State { get set } +} + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +public protocol ViewStateStore: AnyObject, Observable { + + associatedtype ViewState: Equatable + + var viewState: ViewState { get } + + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding + + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding +} + +// MARK: - State Store + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +public final class AnyStateStore< + State: Equatable +>: StateStore { + + public var state: State { + get { box.state } + set { box.state = newValue } + } + + private var box: StateStoreBase + + public init( + _ base: Base + ) where Base.State == State { + if let base: AnyStateStore = base as? AnyStateStore { + box = base.box + } else { + box = StateStoreBox(base) + } + } +} + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +private class StateStoreBox< + Base: StateStore +>: StateStoreBase { + + override var state: Base.State { + get { base.state } + set { base.state = newValue } + } + + private var base: Base + + init(_ base: Base) { + self.base = base + } +} + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +private class StateStoreBase< + State: Equatable +>: StateStore { + + var state: State { + get { preconditionFailure("Property in abstract base class must be overridden") } + // swiftlint:disable:next unused_setter_value + set { preconditionFailure("Property in abstract base class must be overridden") } + } +} + +// MARK: - View State Store + +@Observable +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +public final class AnyViewStateStore< + ViewState: Equatable +>: ViewStateStore { + + public var viewState: ViewState { + box.viewState + } + + @ObservationIgnored + private var box: ViewStateStoreBase + + public init( + _ base: Base + ) where Base.ViewState == ViewState { + box = ViewStateStoreBox(base) + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + box.bind(to: keyPath, onChange: onChange) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + box.bind(to: keyPath, onChange: onChange) + } +} + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +private class ViewStateStoreBox< + Base: ViewStateStore +>: ViewStateStoreBase { + + override var viewState: Base.ViewState { + base.viewState + } + + private var base: Base + + init(_ base: Base) { + self.base = base + } + + override func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + base.bind(to: keyPath, onChange: onChange) + } + + override func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + base.bind(to: keyPath, onChange: onChange) + } +} + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +private class ViewStateStoreBase< + ViewState: Equatable +>: ViewStateStore { + + var viewState: ViewState { + preconditionFailure("Property in abstract base class must be overridden") + } + + // swiftlint:disable:next unavailable_function + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + preconditionFailure("Method in abstract base class must be overridden") + } + + // swiftlint:disable:next unavailable_function + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + preconditionFailure("Method in abstract base class must be overridden") + } +} + +// MARK: - Preview + +#if DEBUG + +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +public final class PreviewStore: ViewStateStore { + + public let viewState: ViewState + + public init(viewState: ViewState) { + self.viewState = viewState + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + .constant(viewState[keyPath: keyPath]) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + .constant(viewState[keyPath: keyPath]) + } +} + +#endif + +// MARK: - Scope + +@Observable +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +private final class Scope< + Store: ViewStateStore, + ViewState: Equatable +>: ViewStateStore { + + var viewState: ViewState { + store.viewState[keyPath: keyPath] + } + + private let store: Store + private let keyPath: KeyPath + + init( + store: Store, + keyPath: KeyPath + ) { + self.store = store + self.keyPath = keyPath + } + + func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + store.bind(to: self.keyPath.appending(path: keyPath), onChange: onChange) + } + + func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + store.bind(to: self.keyPath.appending(path: keyPath), onChange: onChange) + } +} + +// MARK: - Store + +@Observable +@preconcurrency +@MainActor +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +open class Store< + State: Equatable, + ViewState: Equatable +>: StateStore, ViewStateStore { + + @ObservationIgnored + public var state: State { + didSet { + guard state != oldValue + else { return } + viewState = transform(state) + viewStateSubject.send(viewState) + } + } + + public private(set) var viewState: ViewState + + public let viewStatePublisher: AnyPublisher + + private let viewStateSubject: CurrentValueSubject + + private let transform: (_ state: State) -> ViewState + + public convenience init( + state: State, + transform: T + ) where T.Input == State, T.Output == ViewState { + self.init(state: state) { transform($0) } + } + + public init( + state: State, + transform: @escaping (State) -> ViewState + ) { + let viewState: ViewState = transform(state) + let viewStateSubject: CurrentValueSubject = .init(viewState) + self.state = state + self.viewState = viewState + self.viewStatePublisher = viewStateSubject + .removeDuplicates() + .eraseToAnyPublisher() + self.viewStateSubject = viewStateSubject + self.transform = transform + } + + public func bind( + to keyPath: KeyPath, + onChange: @escaping @MainActor (T) -> Void + ) -> Binding { + Binding(get: { [self] in viewState[keyPath: keyPath] }, set: { onChange($0) }) + } + + public func bind( + to keyPath: KeyPath, + onChange: (@MainActor (T) -> Void)? + ) -> Binding { + Binding(get: { [self] in viewState[keyPath: keyPath] }, set: { onChange?($0) }) + } +} + +// MARK: - Extensions + +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +extension ViewStateStore { + + public func scope( + viewState keyPath: KeyPath + ) -> AnyViewStateStore { + AnyViewStateStore(Scope(store: self, keyPath: keyPath)) + } +} + +#endif diff --git a/Sources/Nodes/_Documentation.docc/Nodes.md b/Sources/Nodes/_Documentation.docc/Nodes.md index 0050a90a6..a7736d330 100644 --- a/Sources/Nodes/_Documentation.docc/Nodes.md +++ b/Sources/Nodes/_Documentation.docc/Nodes.md @@ -113,6 +113,25 @@ A ``ViewControllable`` protocol is used instead of the concrete class type to li - ``WindowViewControllable`` - ``ModalStyle`` +### State Management + +Each node includes a store for transforming state into view state to be provided to the view for display. + +``Store`` is the recommended store type, compatible with [UIKit](https://developer.apple.com/documentation/uikit), [AppKit](https://developer.apple.com/documentation/appkit) and the [Observation](https://developer.apple.com/documentation/observation) framework for use with [SwiftUI](https://developer.apple.com/documentation/swiftui). ``ObservableStore`` is available for backwards compatibility with older OS versions and the [`ObservableObject`](https://developer.apple.com/documentation/combine/observableobject) protocol. + +- ``Store`` +- ``StateStore`` +- ``ViewStateStore`` +- ``AnyStateStore`` +- ``AnyViewStateStore`` +- ``PreviewStore`` +- ``ObservableStore`` +- ``ObservableStateStore`` +- ``ObservableViewStateStore`` +- ``AnyObservableStateStore`` +- ``AnyObservableViewStateStore`` +- ``ObservablePreviewStore`` + ### UIKit Additions - ``NavigationController`` @@ -123,7 +142,6 @@ A ``ViewControllable`` protocol is used instead of the concrete class type to li - ``MutableState`` - ``StateObserver`` - ``Transform`` -- ``WithViewState`` ### Utility diff --git a/Tests/NodesTests/ReactiveTests/WithViewStateTests.swift b/Tests/NodesTests/ReactiveTests/WithViewStateTests.swift deleted file mode 100644 index 611265998..000000000 --- a/Tests/NodesTests/ReactiveTests/WithViewStateTests.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Copyright © 2022 Tinder (Match Group, LLC) -// - -import Combine -import Nimble -import Nodes -import SwiftUI -import XCTest - -final class WithViewStateTests: XCTestCase { - - private struct State: Equatable {} - - @MainActor - func testWithViewState() { - var states: [State] = [] - let withViewState: WithViewState = .init(initialState: State(), statePublisher: Empty()) { state in - states.append(state) - return EmptyView() - } - expect(states).to(beEmpty()) - expect(withViewState.body).to(beAKindOf(SubscriptionView, EmptyView>.self)) - expect(states) == [State()] - } -} diff --git a/Tests/NodesTests/StateManagementTests/ObservableStoreTests.swift b/Tests/NodesTests/StateManagementTests/ObservableStoreTests.swift new file mode 100644 index 000000000..5ed3d2fb7 --- /dev/null +++ b/Tests/NodesTests/StateManagementTests/ObservableStoreTests.swift @@ -0,0 +1,103 @@ +// +// Copyright © 2024 Tinder (Match Group, LLC) +// + +import Combine +import Nimble +import Nodes +import SwiftUI +import XCTest + +final class ObservableStoreTests: XCTestCase { + + private final class ObservableStore: Nodes.ObservableStore { + + init() { + super.init(state: 1) { $0 == 0 ? "23" : "\($0)" } + } + } + + @MainActor + func testObservableStore() { + + let store: ObservableStore = .init() + + expect(store).to(notBeNilAndToDeallocateAfterTest()) + + var values: [String] = [] + + let cancellable: AnyCancellable = store + .viewStatePublisher + .sink { values.append($0) } + + let stateStore: AnyObservableStateStore = .init(store) + let viewStateStore: AnyObservableViewStateStore = .init(store) + let scopedViewStateStore: AnyObservableViewStateStore = .init(store.scope(viewState: \.self)) + + expect(values) == ["1"] + + expect(stateStore.state) == 1 + expect(viewStateStore.viewState) == "1" + expect(scopedViewStateStore.viewState) == "1" + + stateStore.state = 23 + + expect(values) == ["1", "23"] + + expect(stateStore.state) == 23 + expect(viewStateStore.viewState) == "23" + expect(scopedViewStateStore.viewState) == "23" + + stateStore.state = 23 + + expect(values) == ["1", "23"] + + expect(stateStore.state) == 23 + expect(viewStateStore.viewState) == "23" + expect(scopedViewStateStore.viewState) == "23" + + stateStore.state = 0 + + expect(values) == ["1", "23"] + + expect(stateStore.state) == 0 + expect(viewStateStore.viewState) == "23" + expect(scopedViewStateStore.viewState) == "23" + + stateStore.state = 100 + + expect(values) == ["1", "23", "100"] + + expect(stateStore.state) == 100 + expect(viewStateStore.viewState) == "100" + expect(scopedViewStateStore.viewState) == "100" + + cancellable.cancel() + } + + @MainActor + func testObservablePreviewStore() { + let store: ObservablePreviewStore = .init(viewState: 23) + expect(store).to(notBeNilAndToDeallocateAfterTest()) + expect(store.viewState) == 23 + } + + @MainActor + func testObservableStoreBindings() { + let store: ObservableStore = .init() + expect(store).to(notBeNilAndToDeallocateAfterTest()) + let onChangeA: (String) -> Void = { value in + let sanitized: String = value.replacingOccurrences(of: "|", with: "") + store.state = Int(sanitized) ?? -1 + } + let onChangeB: ((String) -> Void)? = onChangeA + let bindingA: Binding = store.bind(to: \.self, onChange: onChangeA) + let bindingB: Binding = store.bind(to: \.self, onChange: onChangeB) + expect(bindingA.wrappedValue) == "1" + expect(bindingB.wrappedValue) == "1" + bindingA.wrappedValue = "|23|" + bindingB.wrappedValue = "|23|" + expect(bindingA.wrappedValue) == "23" + expect(bindingB.wrappedValue) == "23" + } +} diff --git a/Tests/NodesTests/StateManagementTests/StoreTests.swift b/Tests/NodesTests/StateManagementTests/StoreTests.swift new file mode 100644 index 000000000..93a4bc81b --- /dev/null +++ b/Tests/NodesTests/StateManagementTests/StoreTests.swift @@ -0,0 +1,104 @@ +// +// Copyright © 2024 Tinder (Match Group, LLC) +// + +import Combine +import Nimble +import Nodes +import SwiftUI +import XCTest + +@available(macOS 14.0, macCatalyst 17.0, iOS 17.0, tvOS 17.0, watchOS 10.0, *) +final class StoreTests: XCTestCase { + + private final class Store: Nodes.Store { + + init() { + super.init(state: 1) { $0 == 0 ? "23" : "\($0)" } + } + } + + @MainActor + func testStore() { + + let store: Store = .init() + + expect(store).to(notBeNilAndToDeallocateAfterTest()) + + var values: [String] = [] + + let cancellable: AnyCancellable = store + .viewStatePublisher + .sink { values.append($0) } + + let stateStore: AnyStateStore = .init(store) + let viewStateStore: AnyViewStateStore = .init(store) + let scopedViewStateStore: AnyViewStateStore = .init(store.scope(viewState: \.self)) + + expect(values) == ["1"] + + expect(stateStore.state) == 1 + expect(viewStateStore.viewState) == "1" + expect(scopedViewStateStore.viewState) == "1" + + stateStore.state = 23 + + expect(values) == ["1", "23"] + + expect(stateStore.state) == 23 + expect(viewStateStore.viewState) == "23" + expect(scopedViewStateStore.viewState) == "23" + + stateStore.state = 23 + + expect(values) == ["1", "23"] + + expect(stateStore.state) == 23 + expect(viewStateStore.viewState) == "23" + expect(scopedViewStateStore.viewState) == "23" + + stateStore.state = 0 + + expect(values) == ["1", "23"] + + expect(stateStore.state) == 0 + expect(viewStateStore.viewState) == "23" + expect(scopedViewStateStore.viewState) == "23" + + stateStore.state = 100 + + expect(values) == ["1", "23", "100"] + + expect(stateStore.state) == 100 + expect(viewStateStore.viewState) == "100" + expect(scopedViewStateStore.viewState) == "100" + + cancellable.cancel() + } + + @MainActor + func testPreviewStore() { + let store: PreviewStore = .init(viewState: 23) + expect(store).to(notBeNilAndToDeallocateAfterTest()) + expect(store.viewState) == 23 + } + + @MainActor + func testStoreBindings() { + let store: Store = .init() + expect(store).to(notBeNilAndToDeallocateAfterTest()) + let onChangeA: (String) -> Void = { value in + let sanitized: String = value.replacingOccurrences(of: "|", with: "") + store.state = Int(sanitized) ?? -1 + } + let onChangeB: ((String) -> Void)? = onChangeA + let bindingA: Binding = store.bind(to: \.self, onChange: onChangeA) + let bindingB: Binding = store.bind(to: \.self, onChange: onChangeB) + expect(bindingA.wrappedValue) == "1" + expect(bindingB.wrappedValue) == "1" + bindingA.wrappedValue = "|23|" + bindingB.wrappedValue = "|23|" + expect(bindingA.wrappedValue) == "23" + expect(bindingB.wrappedValue) == "23" + } +} From 9917a79a0471a43f596423800e1fe18ffb8de7e9 Mon Sep 17 00:00:00 2001 From: Christopher Fuller Date: Thu, 19 Sep 2024 13:00:57 -0700 Subject: [PATCH 04/11] Disable unused_parameter SwiftLint rule in stores (#847) --- Sources/Nodes/StateManagement/ObservableStore.swift | 8 ++++++++ Sources/Nodes/StateManagement/Store.swift | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/Sources/Nodes/StateManagement/ObservableStore.swift b/Sources/Nodes/StateManagement/ObservableStore.swift index 32b9d240e..c279a2142 100644 --- a/Sources/Nodes/StateManagement/ObservableStore.swift +++ b/Sources/Nodes/StateManagement/ObservableStore.swift @@ -177,6 +177,8 @@ private class ObservableViewStateStoreBase< preconditionFailure("Property in abstract base class must be overridden") } + // swiftlint:disable unused_parameter + // swiftlint:disable:next unavailable_function func bind( to keyPath: KeyPath, @@ -192,6 +194,8 @@ private class ObservableViewStateStoreBase< ) -> Binding { preconditionFailure("Method in abstract base class must be overridden") } + + // swiftlint:enable unused_parameter } // MARK: - Preview @@ -208,6 +212,8 @@ public final class ObservablePreviewStore: ObservableViewS self.viewState = viewState } + // swiftlint:disable unused_parameter + public func bind( to keyPath: KeyPath, onChange: @escaping @MainActor (T) -> Void @@ -221,6 +227,8 @@ public final class ObservablePreviewStore: ObservableViewS ) -> Binding { .constant(viewState[keyPath: keyPath]) } + + // swiftlint:enable unused_parameter } #endif diff --git a/Sources/Nodes/StateManagement/Store.swift b/Sources/Nodes/StateManagement/Store.swift index 4c487a69c..14103b020 100644 --- a/Sources/Nodes/StateManagement/Store.swift +++ b/Sources/Nodes/StateManagement/Store.swift @@ -181,6 +181,8 @@ private class ViewStateStoreBase< preconditionFailure("Property in abstract base class must be overridden") } + // swiftlint:disable unused_parameter + // swiftlint:disable:next unavailable_function func bind( to keyPath: KeyPath, @@ -196,6 +198,8 @@ private class ViewStateStoreBase< ) -> Binding { preconditionFailure("Method in abstract base class must be overridden") } + + // swiftlint:enable unused_parameter } // MARK: - Preview @@ -213,6 +217,8 @@ public final class PreviewStore: ViewStateStore { self.viewState = viewState } + // swiftlint:disable unused_parameter + public func bind( to keyPath: KeyPath, onChange: @escaping @MainActor (T) -> Void @@ -226,6 +232,8 @@ public final class PreviewStore: ViewStateStore { ) -> Binding { .constant(viewState[keyPath: keyPath]) } + + // swiftlint:enable unused_parameter } #endif From 99fc702982e4b916913b1cea2d59d22c5159a579 Mon Sep 17 00:00:00 2001 From: Christopher Fuller Date: Thu, 19 Sep 2024 14:13:59 -0700 Subject: [PATCH 05/11] Add initial state factory method (#844) * Add initial state factory method * Use Self instead of type name * Reformat --- .../Resources/Stencils/Context.stencil | 6 +----- .../NodesGenerator/Resources/Stencils/State.stencil | 12 +++++++++--- ...stGenerateAppPreset.Contents-AppContext-swift.txt | 2 +- ...testGenerateAppPreset.Contents-AppState-swift.txt | 7 ++++++- ...GenerateRootPreset.Contents-RootContext-swift.txt | 2 +- ...stGenerateRootPreset.Contents-RootState-swift.txt | 4 ++++ ...ScenePreset.Contents-WindowSceneContext-swift.txt | 2 +- ...teScenePreset.Contents-WindowSceneState-swift.txt | 7 ++++++- ...rateWindowPreset.Contents-WindowContext-swift.txt | 2 +- ...nerateWindowPreset.Contents-WindowState-swift.txt | 7 ++++++- .../testRenderNode.Context-AppKit-mockCount-0.txt | 2 +- .../testRenderNode.Context-AppKit-mockCount-1.txt | 2 +- .../testRenderNode.Context-AppKit-mockCount-2.txt | 2 +- ...tRenderNode.Context-AppKitSwiftUI-mockCount-0.txt | 2 +- ...tRenderNode.Context-AppKitSwiftUI-mockCount-1.txt | 2 +- ...tRenderNode.Context-AppKitSwiftUI-mockCount-2.txt | 2 +- .../testRenderNode.Context-Custom-mockCount-0.txt | 2 +- .../testRenderNode.Context-Custom-mockCount-1.txt | 2 +- .../testRenderNode.Context-Custom-mockCount-2.txt | 2 +- .../testRenderNode.Context-UIKit-mockCount-0.txt | 2 +- .../testRenderNode.Context-UIKit-mockCount-1.txt | 2 +- .../testRenderNode.Context-UIKit-mockCount-2.txt | 2 +- ...stRenderNode.Context-UIKitSwiftUI-mockCount-0.txt | 2 +- ...stRenderNode.Context-UIKitSwiftUI-mockCount-1.txt | 2 +- ...stRenderNode.Context-UIKitSwiftUI-mockCount-2.txt | 2 +- .../testRenderNode.State-AppKit-mockCount-0.txt | 7 ++++++- .../testRenderNode.State-AppKit-mockCount-1.txt | 7 ++++++- .../testRenderNode.State-AppKit-mockCount-2.txt | 7 ++++++- ...estRenderNode.State-AppKitSwiftUI-mockCount-0.txt | 7 ++++++- ...estRenderNode.State-AppKitSwiftUI-mockCount-1.txt | 7 ++++++- ...estRenderNode.State-AppKitSwiftUI-mockCount-2.txt | 7 ++++++- .../testRenderNode.State-Custom-mockCount-0.txt | 7 ++++++- .../testRenderNode.State-Custom-mockCount-1.txt | 7 ++++++- .../testRenderNode.State-Custom-mockCount-2.txt | 7 ++++++- .../testRenderNode.State-UIKit-mockCount-0.txt | 7 ++++++- .../testRenderNode.State-UIKit-mockCount-1.txt | 7 ++++++- .../testRenderNode.State-UIKit-mockCount-2.txt | 7 ++++++- ...testRenderNode.State-UIKitSwiftUI-mockCount-0.txt | 7 ++++++- ...testRenderNode.State-UIKitSwiftUI-mockCount-1.txt | 7 ++++++- ...testRenderNode.State-UIKitSwiftUI-mockCount-2.txt | 7 ++++++- ...RenderNodePresetApp.Context-UIKit-mockCount-0.txt | 2 +- ...RenderNodePresetApp.Context-UIKit-mockCount-1.txt | 2 +- ...RenderNodePresetApp.Context-UIKit-mockCount-2.txt | 2 +- ...stRenderNodePresetApp.State-UIKit-mockCount-0.txt | 7 ++++++- ...stRenderNodePresetApp.State-UIKit-mockCount-1.txt | 7 ++++++- ...stRenderNodePresetApp.State-UIKit-mockCount-2.txt | 7 ++++++- ...enderNodePresetRoot.Context-UIKit-mockCount-0.txt | 2 +- ...enderNodePresetRoot.Context-UIKit-mockCount-1.txt | 2 +- ...enderNodePresetRoot.Context-UIKit-mockCount-2.txt | 2 +- ...tRenderNodePresetRoot.State-UIKit-mockCount-0.txt | 4 ++++ ...tRenderNodePresetRoot.State-UIKit-mockCount-1.txt | 4 ++++ ...tRenderNodePresetRoot.State-UIKit-mockCount-2.txt | 4 ++++ ...nderNodePresetScene.Context-UIKit-mockCount-0.txt | 2 +- ...nderNodePresetScene.Context-UIKit-mockCount-1.txt | 2 +- ...nderNodePresetScene.Context-UIKit-mockCount-2.txt | 2 +- ...RenderNodePresetScene.State-UIKit-mockCount-0.txt | 7 ++++++- ...RenderNodePresetScene.State-UIKit-mockCount-1.txt | 7 ++++++- ...RenderNodePresetScene.State-UIKit-mockCount-2.txt | 7 ++++++- ...derNodePresetWindow.Context-UIKit-mockCount-0.txt | 2 +- ...derNodePresetWindow.Context-UIKit-mockCount-1.txt | 2 +- ...derNodePresetWindow.Context-UIKit-mockCount-2.txt | 2 +- ...enderNodePresetWindow.State-UIKit-mockCount-0.txt | 7 ++++++- ...enderNodePresetWindow.State-UIKit-mockCount-1.txt | 7 ++++++- ...enderNodePresetWindow.State-UIKit-mockCount-2.txt | 7 ++++++- ...estRenderNodeViewInjected.Context-mockCount-0.txt | 2 +- ...estRenderNodeViewInjected.Context-mockCount-1.txt | 2 +- ...estRenderNodeViewInjected.Context-mockCount-2.txt | 2 +- .../testRenderNodeViewInjected.State-mockCount-0.txt | 7 ++++++- .../testRenderNodeViewInjected.State-mockCount-1.txt | 7 ++++++- .../testRenderNodeViewInjected.State-mockCount-2.txt | 7 ++++++- ...derNode_withPlugin.Context-AppKit-mockCount-0.txt | 2 +- ...derNode_withPlugin.Context-AppKit-mockCount-1.txt | 2 +- ...derNode_withPlugin.Context-AppKit-mockCount-2.txt | 2 +- ..._withPlugin.Context-AppKitSwiftUI-mockCount-0.txt | 2 +- ..._withPlugin.Context-AppKitSwiftUI-mockCount-1.txt | 2 +- ..._withPlugin.Context-AppKitSwiftUI-mockCount-2.txt | 2 +- ...derNode_withPlugin.Context-Custom-mockCount-0.txt | 2 +- ...derNode_withPlugin.Context-Custom-mockCount-1.txt | 2 +- ...derNode_withPlugin.Context-Custom-mockCount-2.txt | 2 +- ...nderNode_withPlugin.Context-UIKit-mockCount-0.txt | 2 +- ...nderNode_withPlugin.Context-UIKit-mockCount-1.txt | 2 +- ...nderNode_withPlugin.Context-UIKit-mockCount-2.txt | 2 +- ...e_withPlugin.Context-UIKitSwiftUI-mockCount-0.txt | 2 +- ...e_withPlugin.Context-UIKitSwiftUI-mockCount-1.txt | 2 +- ...e_withPlugin.Context-UIKitSwiftUI-mockCount-2.txt | 2 +- ...enderNode_withPlugin.State-AppKit-mockCount-0.txt | 7 ++++++- ...enderNode_withPlugin.State-AppKit-mockCount-1.txt | 7 ++++++- ...enderNode_withPlugin.State-AppKit-mockCount-2.txt | 7 ++++++- ...de_withPlugin.State-AppKitSwiftUI-mockCount-0.txt | 7 ++++++- ...de_withPlugin.State-AppKitSwiftUI-mockCount-1.txt | 7 ++++++- ...de_withPlugin.State-AppKitSwiftUI-mockCount-2.txt | 7 ++++++- ...enderNode_withPlugin.State-Custom-mockCount-0.txt | 7 ++++++- ...enderNode_withPlugin.State-Custom-mockCount-1.txt | 7 ++++++- ...enderNode_withPlugin.State-Custom-mockCount-2.txt | 7 ++++++- ...RenderNode_withPlugin.State-UIKit-mockCount-0.txt | 7 ++++++- ...RenderNode_withPlugin.State-UIKit-mockCount-1.txt | 7 ++++++- ...RenderNode_withPlugin.State-UIKit-mockCount-2.txt | 7 ++++++- ...ode_withPlugin.State-UIKitSwiftUI-mockCount-0.txt | 7 ++++++- ...ode_withPlugin.State-UIKitSwiftUI-mockCount-1.txt | 7 ++++++- ...ode_withPlugin.State-UIKitSwiftUI-mockCount-2.txt | 7 ++++++- ...withPluginAndTests.Context-AppKit-mockCount-0.txt | 2 +- ...withPluginAndTests.Context-AppKit-mockCount-1.txt | 2 +- ...withPluginAndTests.Context-AppKit-mockCount-2.txt | 2 +- ...ginAndTests.Context-AppKitSwiftUI-mockCount-0.txt | 2 +- ...ginAndTests.Context-AppKitSwiftUI-mockCount-1.txt | 2 +- ...ginAndTests.Context-AppKitSwiftUI-mockCount-2.txt | 2 +- ...withPluginAndTests.Context-Custom-mockCount-0.txt | 2 +- ...withPluginAndTests.Context-Custom-mockCount-1.txt | 2 +- ...withPluginAndTests.Context-Custom-mockCount-2.txt | 2 +- ..._withPluginAndTests.Context-UIKit-mockCount-0.txt | 2 +- ..._withPluginAndTests.Context-UIKit-mockCount-1.txt | 2 +- ..._withPluginAndTests.Context-UIKit-mockCount-2.txt | 2 +- ...uginAndTests.Context-UIKitSwiftUI-mockCount-0.txt | 2 +- ...uginAndTests.Context-UIKitSwiftUI-mockCount-1.txt | 2 +- ...uginAndTests.Context-UIKitSwiftUI-mockCount-2.txt | 2 +- ...e_withPluginAndTests.State-AppKit-mockCount-0.txt | 7 ++++++- ...e_withPluginAndTests.State-AppKit-mockCount-1.txt | 7 ++++++- ...e_withPluginAndTests.State-AppKit-mockCount-2.txt | 7 ++++++- ...luginAndTests.State-AppKitSwiftUI-mockCount-0.txt | 7 ++++++- ...luginAndTests.State-AppKitSwiftUI-mockCount-1.txt | 7 ++++++- ...luginAndTests.State-AppKitSwiftUI-mockCount-2.txt | 7 ++++++- ...e_withPluginAndTests.State-Custom-mockCount-0.txt | 7 ++++++- ...e_withPluginAndTests.State-Custom-mockCount-1.txt | 7 ++++++- ...e_withPluginAndTests.State-Custom-mockCount-2.txt | 7 ++++++- ...de_withPluginAndTests.State-UIKit-mockCount-0.txt | 7 ++++++- ...de_withPluginAndTests.State-UIKit-mockCount-1.txt | 7 ++++++- ...de_withPluginAndTests.State-UIKit-mockCount-2.txt | 7 ++++++- ...PluginAndTests.State-UIKitSwiftUI-mockCount-0.txt | 7 ++++++- ...PluginAndTests.State-UIKitSwiftUI-mockCount-1.txt | 7 ++++++- ...PluginAndTests.State-UIKitSwiftUI-mockCount-2.txt | 7 ++++++- ...nderNode_withTests.Context-AppKit-mockCount-0.txt | 2 +- ...nderNode_withTests.Context-AppKit-mockCount-1.txt | 2 +- ...nderNode_withTests.Context-AppKit-mockCount-2.txt | 2 +- ...e_withTests.Context-AppKitSwiftUI-mockCount-0.txt | 2 +- ...e_withTests.Context-AppKitSwiftUI-mockCount-1.txt | 2 +- ...e_withTests.Context-AppKitSwiftUI-mockCount-2.txt | 2 +- ...nderNode_withTests.Context-Custom-mockCount-0.txt | 2 +- ...nderNode_withTests.Context-Custom-mockCount-1.txt | 2 +- ...nderNode_withTests.Context-Custom-mockCount-2.txt | 2 +- ...enderNode_withTests.Context-UIKit-mockCount-0.txt | 2 +- ...enderNode_withTests.Context-UIKit-mockCount-1.txt | 2 +- ...enderNode_withTests.Context-UIKit-mockCount-2.txt | 2 +- ...de_withTests.Context-UIKitSwiftUI-mockCount-0.txt | 2 +- ...de_withTests.Context-UIKitSwiftUI-mockCount-1.txt | 2 +- ...de_withTests.Context-UIKitSwiftUI-mockCount-2.txt | 2 +- ...RenderNode_withTests.State-AppKit-mockCount-0.txt | 7 ++++++- ...RenderNode_withTests.State-AppKit-mockCount-1.txt | 7 ++++++- ...RenderNode_withTests.State-AppKit-mockCount-2.txt | 7 ++++++- ...ode_withTests.State-AppKitSwiftUI-mockCount-0.txt | 7 ++++++- ...ode_withTests.State-AppKitSwiftUI-mockCount-1.txt | 7 ++++++- ...ode_withTests.State-AppKitSwiftUI-mockCount-2.txt | 7 ++++++- ...RenderNode_withTests.State-Custom-mockCount-0.txt | 7 ++++++- ...RenderNode_withTests.State-Custom-mockCount-1.txt | 7 ++++++- ...RenderNode_withTests.State-Custom-mockCount-2.txt | 7 ++++++- ...tRenderNode_withTests.State-UIKit-mockCount-0.txt | 7 ++++++- ...tRenderNode_withTests.State-UIKit-mockCount-1.txt | 7 ++++++- ...tRenderNode_withTests.State-UIKit-mockCount-2.txt | 7 ++++++- ...Node_withTests.State-UIKitSwiftUI-mockCount-0.txt | 7 ++++++- ...Node_withTests.State-UIKitSwiftUI-mockCount-1.txt | 7 ++++++- ...Node_withTests.State-UIKitSwiftUI-mockCount-2.txt | 7 ++++++- ...enerateWithIdentifier.Contents-AppKit-Context.txt | 2 +- ...tGenerateWithIdentifier.Contents-AppKit-State.txt | 7 ++++++- ...r.Contents-AppKitCreatedForPluginList-Context.txt | 2 +- ...ier.Contents-AppKitCreatedForPluginList-State.txt | 7 ++++++- ...WithIdentifier.Contents-AppKitSwiftUI-Context.txt | 2 +- ...teWithIdentifier.Contents-AppKitSwiftUI-State.txt | 7 ++++++- ...nts-AppKitSwiftUICreatedForPluginList-Context.txt | 2 +- ...tents-AppKitSwiftUICreatedForPluginList-State.txt | 7 ++++++- ...enerateWithIdentifier.Contents-Custom-Context.txt | 2 +- ...tGenerateWithIdentifier.Contents-Custom-State.txt | 7 ++++++- ...r.Contents-CustomCreatedForPluginList-Context.txt | 2 +- ...ier.Contents-CustomCreatedForPluginList-State.txt | 7 ++++++- ...GenerateWithIdentifier.Contents-UIKit-Context.txt | 2 +- ...stGenerateWithIdentifier.Contents-UIKit-State.txt | 7 ++++++- ...er.Contents-UIKitCreatedForPluginList-Context.txt | 2 +- ...fier.Contents-UIKitCreatedForPluginList-State.txt | 7 ++++++- ...eWithIdentifier.Contents-UIKitSwiftUI-Context.txt | 2 +- ...ateWithIdentifier.Contents-UIKitSwiftUI-State.txt | 7 ++++++- ...ents-UIKitSwiftUICreatedForPluginList-Context.txt | 2 +- ...ntents-UIKitSwiftUICreatedForPluginList-State.txt | 7 ++++++- ...eWithIdentifier.Contents-ViewInjected-Context.txt | 2 +- ...ateWithIdentifier.Contents-ViewInjected-State.txt | 7 ++++++- .../testGenerateWithURL.Contents-AppKit-Context.txt | 2 +- .../testGenerateWithURL.Contents-AppKit-State.txt | 7 ++++++- ...L.Contents-AppKitCreatedForPluginList-Context.txt | 2 +- ...URL.Contents-AppKitCreatedForPluginList-State.txt | 7 ++++++- ...enerateWithURL.Contents-AppKitSwiftUI-Context.txt | 2 +- ...tGenerateWithURL.Contents-AppKitSwiftUI-State.txt | 7 ++++++- ...nts-AppKitSwiftUICreatedForPluginList-Context.txt | 2 +- ...tents-AppKitSwiftUICreatedForPluginList-State.txt | 7 ++++++- .../testGenerateWithURL.Contents-Custom-Context.txt | 2 +- .../testGenerateWithURL.Contents-Custom-State.txt | 7 ++++++- ...L.Contents-CustomCreatedForPluginList-Context.txt | 2 +- ...URL.Contents-CustomCreatedForPluginList-State.txt | 7 ++++++- .../testGenerateWithURL.Contents-UIKit-Context.txt | 2 +- .../testGenerateWithURL.Contents-UIKit-State.txt | 7 ++++++- ...RL.Contents-UIKitCreatedForPluginList-Context.txt | 2 +- ...hURL.Contents-UIKitCreatedForPluginList-State.txt | 7 ++++++- ...GenerateWithURL.Contents-UIKitSwiftUI-Context.txt | 2 +- ...stGenerateWithURL.Contents-UIKitSwiftUI-State.txt | 7 ++++++- ...ents-UIKitSwiftUICreatedForPluginList-Context.txt | 2 +- ...ntents-UIKitSwiftUICreatedForPluginList-State.txt | 7 ++++++- ...GenerateWithURL.Contents-ViewInjected-Context.txt | 2 +- ...stGenerateWithURL.Contents-ViewInjected-State.txt | 7 ++++++- 204 files changed, 709 insertions(+), 206 deletions(-) diff --git a/Sources/NodesGenerator/Resources/Stencils/Context.stencil b/Sources/NodesGenerator/Resources/Stencils/Context.stencil index 894b2cf9f..b3f28bc24 100644 --- a/Sources/NodesGenerator/Resources/Stencils/Context.stencil +++ b/Sources/NodesGenerator/Resources/Stencils/Context.stencil @@ -98,11 +98,7 @@ internal final class {{ node_name }}ContextImp: AbstractContext { analytics: {{ node_name }}Analytics{% if node_name == "App" %}{{ ',' }} windowScenePublisher: AnyPublisher{% endif +%} ) { - {% if node_name == "Root" %} - self.state = {{ node_name }}State(name: "{{ node_name }} View Controller", isReady: false) - {% else %} - self.state = {{ node_name }}State() - {% endif %} + self.state = .initialState() self.analytics = analytics {% if node_name == "App" %} self.windowScenePublisher = windowScenePublisher diff --git a/Sources/NodesGenerator/Resources/Stencils/State.stencil b/Sources/NodesGenerator/Resources/Stencils/State.stencil index 5175f0185..7fd0c5894 100644 --- a/Sources/NodesGenerator/Resources/Stencils/State.stencil +++ b/Sources/NodesGenerator/Resources/Stencils/State.stencil @@ -10,12 +10,18 @@ import {{ import }} PURPOSE: The state of the Node. */ -{% if node_name == "Root" %} internal struct {{ node_name }}State: Equatable { +{% if node_name == "Root" %} internal var name: String internal var isReady: Bool -} + + internal static func initialState() -> Self { + Self(name: "{{ node_name }} View Controller", isReady: false) + } {% else %} -internal struct {{ node_name }}State: Equatable {} + internal static func initialState() -> Self { + Self() + } {% endif %} +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppContext-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppContext-swift.txt index 0cc0f6952..886481308 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppContext-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppContext-swift.txt @@ -47,7 +47,7 @@ internal final class AppContextImp: AbstractContext analytics: AppAnalytics, windowScenePublisher: AnyPublisher ) { - self.state = AppState() + self.state = .initialState() self.analytics = analytics self.windowScenePublisher = windowScenePublisher super.init(workers: workers) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppState-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppState-swift.txt index 024af18e8..bfba922ee 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppState-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateAppPreset.Contents-AppState-swift.txt @@ -6,4 +6,9 @@ PURPOSE: The state of the Node. */ -internal struct AppState: Equatable {} +internal struct AppState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootContext-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootContext-swift.txt index 45ef55b79..f441e005e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootContext-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootContext-swift.txt @@ -55,7 +55,7 @@ internal final class RootContextImp: AbstractContext workers: [Worker], analytics: RootAnalytics ) { - self.state = RootState(name: "Root View Controller", isReady: false) + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootState-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootState-swift.txt index 28a4a1f12..ad264b1f0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootState-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateRootPreset.Contents-RootState-swift.txt @@ -10,4 +10,8 @@ internal struct RootState: Equatable { internal var name: String internal var isReady: Bool + + internal static func initialState() -> Self { + Self(name: "Root View Controller", isReady: false) + } } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneContext-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneContext-swift.txt index 61607d8a1..0742214de 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneContext-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneContext-swift.txt @@ -52,7 +52,7 @@ internal final class WindowSceneContextImp: AbstractContext workers: [Worker], analytics: WindowSceneAnalytics ) { - self.state = WindowSceneState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneState-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneState-swift.txt index 2a92bd989..50a1c8993 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneState-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateScenePreset.Contents-WindowSceneState-swift.txt @@ -6,4 +6,9 @@ PURPOSE: The state of the Node. */ -internal struct WindowSceneState: Equatable {} +internal struct WindowSceneState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowContext-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowContext-swift.txt index c883e0453..5db4a8bf3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowContext-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowContext-swift.txt @@ -52,7 +52,7 @@ internal final class WindowContextImp: AbstractContext workers: [Worker], analytics: WindowAnalytics ) { - self.state = WindowState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowState-swift.txt b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowState-swift.txt index 2ae8943cc..501b0e03d 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowState-swift.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/PresetGeneratorTests/testGenerateWindowPreset.Contents-WindowState-swift.txt @@ -6,4 +6,9 @@ PURPOSE: The state of the Node. */ -internal struct WindowState: Equatable {} +internal struct WindowState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-AppKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-Custom-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.Context-UIKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-AppKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-Custom-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode.State-UIKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-0.txt index f081b557b..fb9717e9d 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-0.txt @@ -39,7 +39,7 @@ internal final class AppContextImp: AbstractContext { analytics: AppAnalytics, windowScenePublisher: AnyPublisher ) { - self.state = AppState() + self.state = .initialState() self.analytics = analytics self.windowScenePublisher = windowScenePublisher super.init(workers: workers) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-1.txt index 6480c8ff4..268765c0c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-1.txt @@ -47,7 +47,7 @@ internal final class AppContextImp: AbstractContext analytics: AppAnalytics, windowScenePublisher: AnyPublisher ) { - self.state = AppState() + self.state = .initialState() self.analytics = analytics self.windowScenePublisher = windowScenePublisher super.init(workers: workers) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-2.txt index 2d9b357ee..e803e799e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.Context-UIKit-mockCount-2.txt @@ -49,7 +49,7 @@ internal final class AppContextImp: AbstractContext analytics: AppAnalytics, windowScenePublisher: AnyPublisher ) { - self.state = AppState() + self.state = .initialState() self.analytics = analytics self.windowScenePublisher = windowScenePublisher super.init(workers: workers) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-0.txt index 5d96fa818..73203719b 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct AppState: Equatable {} +internal struct AppState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-1.txt index cff5b65df..e8b14fe40 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct AppState: Equatable {} +internal struct AppState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-2.txt index de1feb78c..b8ba98de0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetApp.State-UIKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct AppState: Equatable {} +internal struct AppState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-0.txt index 49ddd78da..d460139f9 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-0.txt @@ -47,7 +47,7 @@ internal final class RootContextImp: AbstractContext { workers: [Worker], analytics: RootAnalytics ) { - self.state = RootState(name: "Root View Controller", isReady: false) + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-1.txt index d4bee2ee1..6955161d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-1.txt @@ -55,7 +55,7 @@ internal final class RootContextImp: AbstractContext workers: [Worker], analytics: RootAnalytics ) { - self.state = RootState(name: "Root View Controller", isReady: false) + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-2.txt index 7ef7c18f0..cce2a630a 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.Context-UIKit-mockCount-2.txt @@ -57,7 +57,7 @@ internal final class RootContextImp: AbstractContext workers: [Worker], analytics: RootAnalytics ) { - self.state = RootState(name: "Root View Controller", isReady: false) + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-0.txt index e13067409..637548554 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-0.txt @@ -8,4 +8,8 @@ internal struct RootState: Equatable { internal var name: String internal var isReady: Bool + + internal static func initialState() -> Self { + Self(name: "Root View Controller", isReady: false) + } } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-1.txt index 46a4cbf41..caad41e01 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-1.txt @@ -10,4 +10,8 @@ internal struct RootState: Equatable { internal var name: String internal var isReady: Bool + + internal static func initialState() -> Self { + Self(name: "Root View Controller", isReady: false) + } } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-2.txt index 5b69092de..3c789a922 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetRoot.State-UIKit-mockCount-2.txt @@ -11,4 +11,8 @@ internal struct RootState: Equatable { internal var name: String internal var isReady: Bool + + internal static func initialState() -> Self { + Self(name: "Root View Controller", isReady: false) + } } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-0.txt index 838381bf7..c793105f0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-0.txt @@ -44,7 +44,7 @@ internal final class WindowSceneContextImp: AbstractContext { workers: [Worker], analytics: WindowSceneAnalytics ) { - self.state = WindowSceneState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-1.txt index 3331cbb67..5c70f946b 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class WindowSceneContextImp: AbstractContext workers: [Worker], analytics: WindowSceneAnalytics ) { - self.state = WindowSceneState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-2.txt index 17ca7eb6b..a5b0c4867 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.Context-UIKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class WindowSceneContextImp: AbstractContext workers: [Worker], analytics: WindowSceneAnalytics ) { - self.state = WindowSceneState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-0.txt index c93d35e63..2f6f2904e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct WindowSceneState: Equatable {} +internal struct WindowSceneState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-1.txt index 31b98a9e9..e179b255d 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct WindowSceneState: Equatable {} +internal struct WindowSceneState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-2.txt index ef3b1e304..c0551f44e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetScene.State-UIKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct WindowSceneState: Equatable {} +internal struct WindowSceneState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-0.txt index 2f0fa9629..ea7aa403a 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-0.txt @@ -44,7 +44,7 @@ internal final class WindowContextImp: AbstractContext { workers: [Worker], analytics: WindowAnalytics ) { - self.state = WindowState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-1.txt index ca62599cb..463e853f3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class WindowContextImp: AbstractContext workers: [Worker], analytics: WindowAnalytics ) { - self.state = WindowState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-2.txt index 3e02cf762..cbe58e578 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.Context-UIKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class WindowContextImp: AbstractContext workers: [Worker], analytics: WindowAnalytics ) { - self.state = WindowState() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-0.txt index 7128f8b7c..8fc6a5a95 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct WindowState: Equatable {} +internal struct WindowState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-1.txt index 8b8c5aad4..732141106 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct WindowState: Equatable {} +internal struct WindowState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-2.txt index 498102d9c..2913cabe3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodePresetWindow.State-UIKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct WindowState: Equatable {} +internal struct WindowState: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-0.txt index c0758cba7..40a166df5 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-0.txt @@ -44,7 +44,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-1.txt index e6672ce1b..fd0d3a581 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-2.txt index cba75d885..a724417ab 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.Context-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNodeViewInjected.State-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-AppKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-Custom-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.Context-UIKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-AppKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-Custom-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPlugin.State-UIKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-AppKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-Custom-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.Context-UIKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-AppKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-Custom-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withPluginAndTests.State-UIKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-AppKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-Custom-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKit-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-0.txt index cea805fb9..a7e911782 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-0.txt @@ -45,7 +45,7 @@ internal final class ContextImp: AbstractContext { workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-1.txt index fcaab2346..2a779f7d0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-1.txt @@ -53,7 +53,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-2.txt index 857010ce1..df5349e06 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.Context-UIKitSwiftUI-mockCount-2.txt @@ -55,7 +55,7 @@ internal final class ContextImp: AbstractContext workers: [Worker], analytics: Analytics ) { - self.state = State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-AppKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-Custom-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKit-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-0.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-0.txt index 3cf3637a3..9efced6a7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-0.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-0.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-1.txt index 3a7469b06..d4a181ee3 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-1.txt @@ -6,4 +6,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-2.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-2.txt index 685e6a7a9..8faa15c74 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-2.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilRendererTests/testRenderNode_withTests.State-UIKitSwiftUI-mockCount-2.txt @@ -7,4 +7,9 @@ import PURPOSE: The state of the Node. */ -internal struct State: Equatable {} +internal struct State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-Context.txt index aca37ae63..247e30360 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-Context.txt @@ -50,7 +50,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-ViewInjected-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-Context.txt index bf2853cfd..37383c0af 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-Context.txt @@ -51,7 +51,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-Context.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-Context.txt index aca37ae63..247e30360 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-Context.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-Context.txt @@ -50,7 +50,7 @@ internal final class ___VARIABLE_productName___ContextImp: AbstractContext workers: [Worker], analytics: ___VARIABLE_productName___Analytics ) { - self.state = ___VARIABLE_productName___State() + self.state = .initialState() self.analytics = analytics super.init(workers: workers) } diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-State.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-State.txt index 3c39be7db..837a0a43c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-State.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-ViewInjected-State.txt @@ -4,4 +4,9 @@ PURPOSE: The state of the Node. */ -internal struct ___VARIABLE_productName___State: Equatable {} +internal struct ___VARIABLE_productName___State: Equatable { + + internal static func initialState() -> Self { + Self() + } +} From 72ed091bda1c44e3e3adfe0325f3ee5adb12335b Mon Sep 17 00:00:00 2001 From: Garric Nahapetian Date: Fri, 20 Sep 2024 16:42:29 -0700 Subject: [PATCH 06/11] Add Nodes dependency to NodesTesting target (#836) --- Package.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Package.swift b/Package.swift index 95cb2d7ef..e193d1bd9 100644 --- a/Package.swift +++ b/Package.swift @@ -86,6 +86,7 @@ let package = Package( .target( name: "NodesTesting", dependencies: [ + "Nodes", .product(name: "NeedleFoundation", package: "needle") ]), .testTarget( From 52339ae347d7cb8eab999842a3ff5fe054ab14dc Mon Sep 17 00:00:00 2001 From: Garric Nahapetian Date: Fri, 20 Sep 2024 16:42:46 -0700 Subject: [PATCH 07/11] Add isObservableStoreEnabled Config option (#837) * Add isObservableStoreEnabled Config option * Update default value * Update documentation * Move property --- Customization/Configuration.md | 1 + Sources/NodesGenerator/Config.swift | 5 +++++ Tests/NodesGeneratorTests/ConfigTests.swift | 1 + Tests/NodesGeneratorTests/Support/TestFactories.swift | 1 + .../__Snapshots__/ConfigTests/testConfig.1.txt | 1 + .../ConfigTests/testConfigWithEmptyFileContents.1.txt | 1 + .../ConfigTests/testDecodingFromEmptyString.1.txt | 1 + .../ConfigTests/testDecodingWithEmptyArray.1.txt | 1 + 8 files changed, 12 insertions(+) diff --git a/Customization/Configuration.md b/Customization/Configuration.md index e9fb2ca50..2af677bae 100644 --- a/Customization/Configuration.md +++ b/Customization/Configuration.md @@ -77,6 +77,7 @@ contextGenericTypes: workerGenericTypes: - AnyCancellable isViewInjectedTemplateEnabled: true +isObservableStoreEnabled: false isPreviewProviderEnabled: false isTestTemplatesGenerationEnabled: true isPeripheryCommentEnabled: false diff --git a/Sources/NodesGenerator/Config.swift b/Sources/NodesGenerator/Config.swift index 874b239c8..edc1a54fe 100644 --- a/Sources/NodesGenerator/Config.swift +++ b/Sources/NodesGenerator/Config.swift @@ -55,6 +55,7 @@ public struct Config: Codable, Equatable { public var workerGenericTypes: [String] public var isViewInjectedTemplateEnabled: Bool + public var isObservableStoreEnabled: Bool public var isPreviewProviderEnabled: Bool public var isTestTemplatesGenerationEnabled: Bool public var isPeripheryCommentEnabled: Bool @@ -118,6 +119,7 @@ extension Config { contextGenericTypes = ["AnyCancellable"] workerGenericTypes = ["AnyCancellable"] isViewInjectedTemplateEnabled = true + isObservableStoreEnabled = false isPreviewProviderEnabled = false isTestTemplatesGenerationEnabled = true isPeripheryCommentEnabled = false @@ -224,6 +226,9 @@ extension Config { isViewInjectedTemplateEnabled = (try? decoder.decode(CodingKeys.isViewInjectedTemplateEnabled)) ?? defaults.isViewInjectedTemplateEnabled + isObservableStoreEnabled = + (try? decoder.decode(CodingKeys.isObservableStoreEnabled)) + ?? defaults.isObservableStoreEnabled isPreviewProviderEnabled = (try? decoder.decode(CodingKeys.isPreviewProviderEnabled)) ?? defaults.isPreviewProviderEnabled diff --git a/Tests/NodesGeneratorTests/ConfigTests.swift b/Tests/NodesGeneratorTests/ConfigTests.swift index 3f3e9d96f..92ee6bf4d 100644 --- a/Tests/NodesGeneratorTests/ConfigTests.swift +++ b/Tests/NodesGeneratorTests/ConfigTests.swift @@ -185,6 +185,7 @@ final class ConfigTests: XCTestCase, TestFactories { - - isViewInjectedTemplateEnabled: true + isObservableStoreEnabled: false isPreviewProviderEnabled: true isTestTemplatesGenerationEnabled: true isPeripheryCommentEnabled: true diff --git a/Tests/NodesGeneratorTests/Support/TestFactories.swift b/Tests/NodesGeneratorTests/Support/TestFactories.swift index e83c33873..472e48f85 100644 --- a/Tests/NodesGeneratorTests/Support/TestFactories.swift +++ b/Tests/NodesGeneratorTests/Support/TestFactories.swift @@ -50,6 +50,7 @@ extension TestFactories { config.contextGenericTypes = [""] config.workerGenericTypes = [""] config.isViewInjectedTemplateEnabled = true + config.isObservableStoreEnabled = false config.isPreviewProviderEnabled = true config.isTestTemplatesGenerationEnabled = true config.isPeripheryCommentEnabled = true diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt index fff76d404..0b458768c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfig.1.txt @@ -38,6 +38,7 @@ ▿ Variable - name: "" - type: "" + - isObservableStoreEnabled: false - isPeripheryCommentEnabled: true - isPreviewProviderEnabled: true - isTestTemplatesGenerationEnabled: true diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt index 35da7e692..b4fc4621e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testConfigWithEmptyFileContents.1.txt @@ -12,6 +12,7 @@ - "NeedleFoundation" - flowImports: 0 members - flowProperties: 0 elements + - isObservableStoreEnabled: false - isPeripheryCommentEnabled: false - isPreviewProviderEnabled: false - isTestTemplatesGenerationEnabled: true diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt index 35da7e692..b4fc4621e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingFromEmptyString.1.txt @@ -12,6 +12,7 @@ - "NeedleFoundation" - flowImports: 0 members - flowProperties: 0 elements + - isObservableStoreEnabled: false - isPeripheryCommentEnabled: false - isPreviewProviderEnabled: false - isTestTemplatesGenerationEnabled: true diff --git a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt index 35da7e692..b4fc4621e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/ConfigTests/testDecodingWithEmptyArray.1.txt @@ -12,6 +12,7 @@ - "NeedleFoundation" - flowImports: 0 members - flowProperties: 0 elements + - isObservableStoreEnabled: false - isPeripheryCommentEnabled: false - isPreviewProviderEnabled: false - isTestTemplatesGenerationEnabled: true From 87b36a3e9c13d2992323721b524fdf35cfb60943 Mon Sep 17 00:00:00 2001 From: Garric Nahapetian Date: Mon, 23 Sep 2024 09:46:05 -0700 Subject: [PATCH 08/11] Add NodesTesting import to test stencils (#835) * Check isViewInjected in imports(with:including:) * Remove local property * Move test as not needed * Fix imports for SwiftUI * Improve formatting * Remove as not needed --- Sources/NodesGenerator/StencilTemplate.swift | 3 +- .../StencilTemplateTests.swift | 5 ++- ...dentifier.Contents-AppKit-ContextTests.txt | 1 + ...ppKitCreatedForPluginList-ContextTests.txt | 1 + ...er.Contents-AppKitSwiftUI-ContextTests.txt | 1 + ...ents-AppKitSwiftUI-ViewControllerTests.txt | 2 +- ...iftUICreatedForPluginList-ContextTests.txt | 1 + ...eatedForPluginList-ViewControllerTests.txt | 2 +- ...dentifier.Contents-Custom-ContextTests.txt | 1 + ...ustomCreatedForPluginList-ContextTests.txt | 1 + ...Identifier.Contents-UIKit-ContextTests.txt | 1 + ...UIKitCreatedForPluginList-ContextTests.txt | 1 + ...ier.Contents-UIKitSwiftUI-ContextTests.txt | 1 + ...tents-UIKitSwiftUI-ViewControllerTests.txt | 2 +- ...iftUICreatedForPluginList-ContextTests.txt | 1 + ...eatedForPluginList-ViewControllerTests.txt | 2 +- ...teWithURL.Contents-AppKit-ContextTests.txt | 1 + ...ppKitCreatedForPluginList-ContextTests.txt | 1 + ...RL.Contents-AppKitSwiftUI-ContextTests.txt | 1 + ...ents-AppKitSwiftUI-ViewControllerTests.txt | 2 +- ...iftUICreatedForPluginList-ContextTests.txt | 1 + ...eatedForPluginList-ViewControllerTests.txt | 2 +- ...teWithURL.Contents-Custom-ContextTests.txt | 1 + ...ustomCreatedForPluginList-ContextTests.txt | 1 + ...ateWithURL.Contents-UIKit-ContextTests.txt | 1 + ...UIKitCreatedForPluginList-ContextTests.txt | 1 + ...URL.Contents-UIKitSwiftUI-ContextTests.txt | 1 + ...tents-UIKitSwiftUI-ViewControllerTests.txt | 2 +- ...iftUICreatedForPluginList-ContextTests.txt | 1 + ...eatedForPluginList-ViewControllerTests.txt | 2 +- ...on.AppKit-SwiftUI-CreatedForPluginList.txt | 5 ++- ...codeTemplatePermutation.AppKit-SwiftUI.txt | 5 ++- ...estNodeXcodeTemplatePermutation.AppKit.txt | 3 +- ...Permutation.AppKitCreatedForPluginList.txt | 3 +- ...estNodeXcodeTemplatePermutation.Custom.txt | 3 +- ...Permutation.CustomCreatedForPluginList.txt | 3 +- ...ion.UIKit-SwiftUI-CreatedForPluginList.txt | 5 ++- ...XcodeTemplatePermutation.UIKit-SwiftUI.txt | 5 ++- ...testNodeXcodeTemplatePermutation.UIKit.txt | 3 +- ...ePermutation.UIKitCreatedForPluginList.txt | 3 +- .../testNodeXcodeTemplate.1.txt | 38 ++++++++++++------- 41 files changed, 81 insertions(+), 39 deletions(-) diff --git a/Sources/NodesGenerator/StencilTemplate.swift b/Sources/NodesGenerator/StencilTemplate.swift index 42b50eab0..3ad4d8159 100644 --- a/Sources/NodesGenerator/StencilTemplate.swift +++ b/Sources/NodesGenerator/StencilTemplate.swift @@ -246,6 +246,7 @@ public enum StencilTemplate: CustomStringConvertible, Equatable, Sendable { .union(config.reactiveImports) case .contextTests: config.baseTestImports + .union(uiFramework == nil ? [] : ["NodesTesting"]) case .flow: config.baseImports .union(["Nodes"]) @@ -277,7 +278,7 @@ public enum StencilTemplate: CustomStringConvertible, Equatable, Sendable { .union(uiFramework.flatMap { [$0.import] } ?? []) case .viewControllerTests: uiFramework == nil ? [] : config.baseTestImports - .union(config.reactiveImports) + .union(uiFramework?.kind.isHostingSwiftUI == true ? ["NodesTesting"] : config.reactiveImports) case .viewState: uiFramework == nil ? [] : config.baseImports .union(["Nodes"]) diff --git a/Tests/NodesGeneratorTests/StencilTemplateTests.swift b/Tests/NodesGeneratorTests/StencilTemplateTests.swift index fa463eb4b..e80a58c57 100644 --- a/Tests/NodesGeneratorTests/StencilTemplateTests.swift +++ b/Tests/NodesGeneratorTests/StencilTemplateTests.swift @@ -295,7 +295,8 @@ final class StencilTemplateTests: XCTestCase, TestFactories { ] case .contextTests: expect(imports) == [ - "" + "", + "NodesTesting" ] case .flow: expect(imports) == [ @@ -345,7 +346,7 @@ final class StencilTemplateTests: XCTestCase, TestFactories { case .viewControllerTests: expect(imports) == [ "", - "" + uiFramework.kind.isHostingSwiftUI ? "NodesTesting" : "" ] case .viewState: expect(imports) == [ diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKit-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitCreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUI-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-Custom-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-CustomCreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKit-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitCreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUI-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithIdentifier.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKit-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitCreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUI-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-AppKitSwiftUICreatedForPluginList-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-Custom-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-CustomCreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKit-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitCreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUI-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt index 3cab1d579..bab53a261 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ContextTests.txt @@ -3,6 +3,7 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ContextTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt index 31524e520..0ac3720fe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateGeneratorTests/testGenerateWithURL.Contents-UIKitSwiftUICreatedForPluginList-ViewControllerTests.txt @@ -2,8 +2,8 @@ #warning("Manually move this test file to the corresponding test target then delete this warning.") -import Combine import Nimble +import NodesTesting import XCTest final class ___VARIABLE_productName___ViewControllerTests: XCTestCase { diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt index 4753f0ae3..96c8e0075 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -86,7 +87,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "NSHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt index a078fd754..9493ed015 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -86,7 +87,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "NSHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt index d2321a9ab..d883ff93a 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt index 8f2e3c6c5..06eb47a1a 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt index 816d603ff..c3518d885 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt index 0aeb9274f..ae4f2c131 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt index 81b1415c7..80eafe48b 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -86,7 +87,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "UIHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt index 0eb7c3a1f..8bb56754e 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -86,7 +87,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "UIHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt index 978e96a5b..0134a496c 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt index 732be5f82..690b82600 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt @@ -29,8 +29,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt index eb5fc9ffa..e38ae58f5 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt @@ -32,8 +32,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -154,8 +155,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -276,8 +278,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -333,7 +336,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "NSHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" @@ -398,8 +401,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -455,7 +459,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "NSHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" @@ -520,8 +524,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -642,8 +647,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -764,8 +770,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -821,7 +828,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "UIHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" @@ -886,8 +893,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -943,7 +951,7 @@ - viewControllerSuperParameters: "" ▿ viewControllerTestsImports: 2 elements - "" - - "" + - "NodesTesting" - viewControllerType: "UIHostingController" - viewControllerUpdateComment: "" - viewStateEmptyFactory: "" @@ -1008,8 +1016,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) @@ -1130,8 +1139,9 @@ - "" - "" - "Nodes" - ▿ contextTestsImports: 1 element + ▿ contextTestsImports: 2 elements - "" + - "NodesTesting" ▿ dependencies: 1 element ▿ 2 key/value pairs ▿ (2 elements) From 44c733a3fae46d91fbec2b74b7c58c99051988cf Mon Sep 17 00:00:00 2001 From: Garric Nahapetian Date: Mon, 23 Sep 2024 12:38:08 -0700 Subject: [PATCH 09/11] Add storePrefix to Config (#838) * Add isObservableStoreEnabled Config option * Add storePrefix to Config * Add test * Update TestFactories * Fix bad rebase * Improve test * Set isObservableStoreEnabled explicitly Co-authored-by: Christopher Fuller --------- Co-authored-by: Christopher Fuller --- Sources/NodesGenerator/Config.swift | 1 + Tests/NodesGeneratorTests/ConfigTests.swift | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/Sources/NodesGenerator/Config.swift b/Sources/NodesGenerator/Config.swift index edc1a54fe..de0429544 100644 --- a/Sources/NodesGenerator/Config.swift +++ b/Sources/NodesGenerator/Config.swift @@ -60,6 +60,7 @@ public struct Config: Codable, Equatable { public var isTestTemplatesGenerationEnabled: Bool public var isPeripheryCommentEnabled: Bool + public var storePrefix: String { isObservableStoreEnabled ? "Observable" : "" } public var isNimbleEnabled: Bool { baseTestImports.contains("Nimble") } public init( diff --git a/Tests/NodesGeneratorTests/ConfigTests.swift b/Tests/NodesGeneratorTests/ConfigTests.swift index 92ee6bf4d..aecf3aa2a 100644 --- a/Tests/NodesGeneratorTests/ConfigTests.swift +++ b/Tests/NodesGeneratorTests/ConfigTests.swift @@ -105,6 +105,14 @@ final class ConfigTests: XCTestCase, TestFactories { } } + func testStorePrefix() { + var config: Config = .init() + config.isObservableStoreEnabled = false + expect(config.storePrefix.isEmpty) == true + config.isObservableStoreEnabled = true + expect(config.storePrefix) == "Observable" + } + func testIsNimbleEnabled() { var config: Config = .init() config.baseTestImports = ["Nimble"] From ffdfdf595f6be6fe3ebe9f41ed5e2a78b940502e Mon Sep 17 00:00:00 2001 From: Garric Nahapetian Date: Mon, 23 Sep 2024 14:51:21 -0700 Subject: [PATCH 10/11] Add storePrefix to NodeStencilContext (#839) * Add storePrefix to NodeStencilContext * Disable SwiftLint * Record snapshot references --- Sources/NodesGenerator/PresetGenerator.swift | 1 + .../StencilContexts/NodeStencilContext.swift | 8 ++++++++ .../NodeXcodeTemplatePermutation.swift | 2 ++ Tests/NodesGeneratorTests/Support/TestFactories.swift | 3 +++ .../testNodePresetRootStencilContext.1.txt | 5 ++++- .../StencilContextsTests/testNodeStencilContext.1.txt | 5 ++++- .../testNodeStencilContext_withPlugin.1.txt | 5 ++++- ...Permutation.AppKit-SwiftUI-CreatedForPluginList.txt | 1 + ...testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt | 1 + .../testNodeXcodeTemplatePermutation.AppKit.txt | 1 + ...eTemplatePermutation.AppKitCreatedForPluginList.txt | 1 + .../testNodeXcodeTemplatePermutation.Custom.txt | 1 + ...eTemplatePermutation.CustomCreatedForPluginList.txt | 1 + ...ePermutation.UIKit-SwiftUI-CreatedForPluginList.txt | 1 + .../testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt | 1 + .../testNodeXcodeTemplatePermutation.UIKit.txt | 1 + ...deTemplatePermutation.UIKitCreatedForPluginList.txt | 1 + .../XcodeTemplateTests/testNodeXcodeTemplate.1.txt | 10 ++++++++++ 18 files changed, 46 insertions(+), 3 deletions(-) diff --git a/Sources/NodesGenerator/PresetGenerator.swift b/Sources/NodesGenerator/PresetGenerator.swift index 9d3e141f3..748f1a6fe 100644 --- a/Sources/NodesGenerator/PresetGenerator.swift +++ b/Sources/NodesGenerator/PresetGenerator.swift @@ -93,6 +93,7 @@ public final class PresetGenerator { publisherFailureType: config.publisherFailureType, contextGenericTypes: config.contextGenericTypes, workerGenericTypes: config.workerGenericTypes, + storePrefix: config.storePrefix, isPreviewProviderEnabled: config.isPreviewProviderEnabled, isPeripheryCommentEnabled: config.isPeripheryCommentEnabled, isNimbleEnabled: config.isNimbleEnabled diff --git a/Sources/NodesGenerator/StencilContexts/NodeStencilContext.swift b/Sources/NodesGenerator/StencilContexts/NodeStencilContext.swift index 825051ed4..78cf111e3 100644 --- a/Sources/NodesGenerator/StencilContexts/NodeStencilContext.swift +++ b/Sources/NodesGenerator/StencilContexts/NodeStencilContext.swift @@ -46,6 +46,7 @@ public struct NodeStencilContext: StencilContext { private let publisherFailureType: String private let contextGenericTypes: [String] private let workerGenericTypes: [String] + private let storePrefix: String private let isPreviewProviderEnabled: Bool private let isPeripheryCommentEnabled: Bool private let isNimbleEnabled: Bool @@ -94,6 +95,7 @@ public struct NodeStencilContext: StencilContext { "publisher_failure_type": publisherFailureType, "context_generic_types": contextGenericTypes, "worker_generic_types": workerGenericTypes, + "store_prefix": storePrefix, "is_preview_provider_enabled": isPreviewProviderEnabled, "is_periphery_comment_enabled": isPeripheryCommentEnabled, "is_nimble_enabled": isNimbleEnabled @@ -143,6 +145,7 @@ public struct NodeStencilContext: StencilContext { publisherFailureType: String, contextGenericTypes: [String], workerGenericTypes: [String], + storePrefix: String, isPreviewProviderEnabled: Bool, isPeripheryCommentEnabled: Bool, isNimbleEnabled: Bool @@ -190,6 +193,7 @@ public struct NodeStencilContext: StencilContext { publisherFailureType: publisherFailureType, contextGenericTypes: contextGenericTypes, workerGenericTypes: workerGenericTypes, + storePrefix: storePrefix, isPreviewProviderEnabled: isPreviewProviderEnabled, isPeripheryCommentEnabled: isPeripheryCommentEnabled, isNimbleEnabled: isNimbleEnabled @@ -233,6 +237,7 @@ public struct NodeStencilContext: StencilContext { publisherFailureType: String, contextGenericTypes: [String], workerGenericTypes: [String], + storePrefix: String, isPreviewProviderEnabled: Bool, isPeripheryCommentEnabled: Bool, isNimbleEnabled: Bool @@ -282,6 +287,7 @@ public struct NodeStencilContext: StencilContext { publisherFailureType: publisherFailureType, contextGenericTypes: contextGenericTypes, workerGenericTypes: workerGenericTypes, + storePrefix: storePrefix, isPreviewProviderEnabled: isPreviewProviderEnabled, isPeripheryCommentEnabled: isPeripheryCommentEnabled, isNimbleEnabled: isNimbleEnabled @@ -331,6 +337,7 @@ public struct NodeStencilContext: StencilContext { publisherFailureType: String, contextGenericTypes: [String], workerGenericTypes: [String], + storePrefix: String, isPreviewProviderEnabled: Bool, isPeripheryCommentEnabled: Bool, isNimbleEnabled: Bool @@ -378,6 +385,7 @@ public struct NodeStencilContext: StencilContext { self.publisherFailureType = publisherFailureType self.contextGenericTypes = contextGenericTypes self.workerGenericTypes = workerGenericTypes + self.storePrefix = storePrefix self.isPreviewProviderEnabled = isPreviewProviderEnabled self.isPeripheryCommentEnabled = isPeripheryCommentEnabled self.isNimbleEnabled = isNimbleEnabled diff --git a/Sources/NodesGenerator/XcodeTemplatePermutations/NodeXcodeTemplatePermutation.swift b/Sources/NodesGenerator/XcodeTemplatePermutations/NodeXcodeTemplatePermutation.swift index fdc48e77e..87fa4ed8b 100644 --- a/Sources/NodesGenerator/XcodeTemplatePermutations/NodeXcodeTemplatePermutation.swift +++ b/Sources/NodesGenerator/XcodeTemplatePermutations/NodeXcodeTemplatePermutation.swift @@ -8,6 +8,7 @@ internal struct NodeXcodeTemplatePermutation: XcodeTemplatePermutation { internal let stencils: [StencilTemplate] internal let stencilContext: StencilContext + // swiftlint:disable:next function_body_length internal init(for uiFramework: UIFramework, createdForPluginList: Bool, config: Config) { self.name = "\(uiFramework.name)\(createdForPluginList ? XcodeTemplateConstants.createdForPluginList : "")" let node: StencilTemplate.Node = .init(.variation(for: uiFramework.kind)) @@ -56,6 +57,7 @@ internal struct NodeXcodeTemplatePermutation: XcodeTemplatePermutation { publisherFailureType: config.publisherFailureType, contextGenericTypes: config.contextGenericTypes, workerGenericTypes: config.workerGenericTypes, + storePrefix: config.storePrefix, isPreviewProviderEnabled: config.isPreviewProviderEnabled, isPeripheryCommentEnabled: config.isPeripheryCommentEnabled, isNimbleEnabled: config.isNimbleEnabled diff --git a/Tests/NodesGeneratorTests/Support/TestFactories.swift b/Tests/NodesGeneratorTests/Support/TestFactories.swift index 472e48f85..f6151413c 100644 --- a/Tests/NodesGeneratorTests/Support/TestFactories.swift +++ b/Tests/NodesGeneratorTests/Support/TestFactories.swift @@ -49,6 +49,7 @@ extension TestFactories { config.publisherFailureType = "" config.contextGenericTypes = [""] config.workerGenericTypes = [""] + config.isObservableStoreEnabled = true config.isViewInjectedTemplateEnabled = true config.isObservableStoreEnabled = false config.isPreviewProviderEnabled = true @@ -103,6 +104,7 @@ extension TestFactories { publisherFailureType: mockCount > 0 ? "" : "", contextGenericTypes: .mock(with: "contextGenericType", count: mockCount), workerGenericTypes: .mock(with: "workerGenericType", count: mockCount), + storePrefix: mockCount > 0 ? "" : "", isPreviewProviderEnabled: mockCount > 0, isPeripheryCommentEnabled: mockCount > 0, isNimbleEnabled: mockCount > 0 @@ -150,6 +152,7 @@ extension TestFactories { publisherFailureType: mockCount > 0 ? "" : "", contextGenericTypes: .mock(with: "contextGenericType", count: mockCount), workerGenericTypes: .mock(with: "workerGenericType", count: mockCount), + storePrefix: mockCount > 0 ? "" : "", isPreviewProviderEnabled: mockCount > 0, isPeripheryCommentEnabled: mockCount > 0, isNimbleEnabled: mockCount > 0 diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodePresetRootStencilContext.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodePresetRootStencilContext.1.txt index 5c04913cf..988d66c7a 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodePresetRootStencilContext.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodePresetRootStencilContext.1.txt @@ -1,4 +1,4 @@ -▿ 45 key/value pairs +▿ 46 key/value pairs ▿ (2 elements) - key: "analytics_imports" ▿ value: 1 element @@ -108,6 +108,9 @@ - key: "state_imports" ▿ value: 1 element - "" + ▿ (2 elements) + - key: "store_prefix" + - value: "" ▿ (2 elements) - key: "view_controllable_flow_type" - value: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext.1.txt index 1cbc328d0..be0433539 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext.1.txt @@ -1,4 +1,4 @@ -▿ 45 key/value pairs +▿ 46 key/value pairs ▿ (2 elements) - key: "analytics_imports" ▿ value: 1 element @@ -108,6 +108,9 @@ - key: "state_imports" ▿ value: 1 element - "" + ▿ (2 elements) + - key: "store_prefix" + - value: "" ▿ (2 elements) - key: "view_controllable_flow_type" - value: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext_withPlugin.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext_withPlugin.1.txt index 919f5a6b7..f80f776d7 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext_withPlugin.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/StencilContextsTests/testNodeStencilContext_withPlugin.1.txt @@ -1,4 +1,4 @@ -▿ 45 key/value pairs +▿ 46 key/value pairs ▿ (2 elements) - key: "analytics_imports" ▿ value: 1 element @@ -110,6 +110,9 @@ - key: "state_imports" ▿ value: 1 element - "" + ▿ (2 elements) + - key: "store_prefix" + - value: "" ▿ (2 elements) - key: "view_controllable_flow_type" - value: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt index 96c8e0075..29640e320 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI-CreatedForPluginList.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt index 9493ed015..6ea289cd2 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit-SwiftUI.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt index d883ff93a..1969b1926 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKit.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt index 06eb47a1a..84241ccb9 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.AppKitCreatedForPluginList.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt index c3518d885..9ecae6e8d 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.Custom.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt index ae4f2c131..da894b9d2 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.CustomCreatedForPluginList.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt index 80eafe48b..f652f4fd8 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI-CreatedForPluginList.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt index 8bb56754e..425ab4dbe 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit-SwiftUI.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt index 0134a496c..fe28d79b0 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKit.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt index 690b82600..323129682 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplatePermutationTests/testNodeXcodeTemplatePermutation.UIKitCreatedForPluginList.txt @@ -72,6 +72,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" diff --git a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt index e38ae58f5..f185f22c2 100644 --- a/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt +++ b/Tests/NodesGeneratorTests/__Snapshots__/XcodeTemplateTests/testNodeXcodeTemplate.1.txt @@ -75,6 +75,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -198,6 +199,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -321,6 +323,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -444,6 +447,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -567,6 +571,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -690,6 +695,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -813,6 +819,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -936,6 +943,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -1059,6 +1067,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" @@ -1182,6 +1191,7 @@ - publisherType: "" ▿ stateImports: 1 element - "" + - storePrefix: "" - viewControllableFlowType: "" - viewControllableMockContents: "" - viewControllableType: "" From ddc05a34b5a77282fd069bfbc5dae354a33ad9cf Mon Sep 17 00:00:00 2001 From: Garric Nahapetian Date: Mon, 23 Sep 2024 17:05:01 -0700 Subject: [PATCH 11/11] Remove trailing space (#850) --- Customization/Configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Customization/Configuration.md b/Customization/Configuration.md index 2af677bae..30734a26a 100644 --- a/Customization/Configuration.md +++ b/Customization/Configuration.md @@ -77,7 +77,7 @@ contextGenericTypes: workerGenericTypes: - AnyCancellable isViewInjectedTemplateEnabled: true -isObservableStoreEnabled: false +isObservableStoreEnabled: false isPreviewProviderEnabled: false isTestTemplatesGenerationEnabled: true isPeripheryCommentEnabled: false