Skip to content

Add macros#2

Merged
aromanov91 merged 16 commits intomainfrom
feature/screens
Sep 26, 2025
Merged

Add macros#2
aromanov91 merged 16 commits intomainfrom
feature/screens

Conversation

@aromanov91
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings September 24, 2025 21:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a comprehensive feature implementation for "screens" that adds architectural components for modular Swift UI development. The implementation includes macro-based code generation for ViewModels, Views, and Modules, along with protocol definitions and test components.

  • Adds macro system for automated code generation (@viewmodel, @view, @module)
  • Implements architectural protocols for ViewState, ViewModel, View, and Module components
  • Creates extensive test suite with product-based example modules

Reviewed Changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Sources/OversizeArchitecture/Macros.swift Defines public macro interfaces for ViewModel, View, and Module generation
Sources/OversizeArchitectureMacros/Macros/*.swift Implements macro expansion logic for automated code generation
Sources/OversizeArchitecture/Protocols/*.swift Defines core architectural protocols with associated types
Tests/OversizeArchitectureTests/ArchitectureTests/TestViews/ Comprehensive test modules demonstrating the architecture
Tests/OversizeArchitectureTests/ArchitectureTests/*SwiftTests.swift Extensive test suite using Swift Testing framework
README.md Documentation explaining the architecture and macro usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


await MainActor.run {
#expect(state.id == product.id)
#expect(state.name == "Product")
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test expects state.name to be 'Product' but the test creates a product with name 'Test Product'. The expected value should match the input product name or the test should verify the actual behavior of ProductDetailViewState initialization.

Suggested change
#expect(state.name == "Product")
#expect(state.name == product.name)

Copilot uses AI. Check for mistakes.
}

await MainActor.run {
#expect(state.name == "Product")
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar issue as above - test expects 'Product' as name when input is nil, but this should verify the actual default behavior of ProductDetailViewState.

Suggested change
#expect(state.name == "Product")
let defaultState = ProductDetailViewState(input: nil)
#expect(state.name == defaultState.name)

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,17 @@
//
// Copyright © 2025 Alexander Romanov
// MealProductDetailViewState.swift, created on 10.07.2025
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment header refers to 'MealProductDetailViewState.swift' but the actual file is 'ProductDetailViewState.swift'. The comment should match the actual filename.

Suggested change
// MealProductDetailViewState.swift, created on 10.07.2025
// ProductDetailViewState.swift, created on 10.07.2025

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,32 @@
//
// Copyright © 2025 Alexander Romanov
// MealProductDetailViewModel.swift, created on 10.07.2025
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment header refers to 'MealProductDetailViewModel.swift' but the actual file is 'ProductDetailViewModel.swift'. The comment should match the actual filename.

Suggested change
// MealProductDetailViewModel.swift, created on 10.07.2025
// ProductDetailViewModel.swift, created on 10.07.2025

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,19 @@
//
// Copyright © 2025 Alexander Romanov
// MealProductDetailScreen.swift, created on 10.07.2025
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment header refers to 'MealProductDetailScreen.swift' but the actual file is 'ProductDetailView.swift'. The comment should match the actual filename.

Suggested change
// MealProductDetailScreen.swift, created on 10.07.2025
// ProductDetailView.swift, created on 10.07.2025

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,35 @@
//
// Copyright © 2025 Alexander Romanov
// ProductListInput.swift, created on 17.09.2025
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment header refers to 'ProductListInput.swift' but the actual file is 'ProductListModule.swift'. The comment should match the actual filename.

Suggested change
// ProductListInput.swift, created on 17.09.2025
// ProductListModule.swift, created on 17.09.2025

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,50 @@
//
// Copyright © 2025 Alexander Romanov
// ProductEditInput.swift, created on 17.09.2025
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment header refers to 'ProductEditInput.swift' but the actual file is 'ProductEditModule.swift'. The comment should match the actual filename.

Suggested change
// ProductEditInput.swift, created on 17.09.2025
// ProductEditModule.swift, created on 17.09.2025

Copilot uses AI. Check for mistakes.
@aromanov91 aromanov91 changed the title Feature/screens Add macros Sep 25, 2025
@aromanov91 aromanov91 requested a review from Copilot September 25, 2025 10:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copilot AI review requested due to automatic review settings September 25, 2025 10:28
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

//
// Copyright © 2025 Alexander Romanov
// ViewModelMacroTests.swift, created on 12.09.2025
// ViewModelMacroSwiftTests.swift, created on 18.09.2024
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The creation date shows 2024 but should be 2025 based on the copyright year and other file dates in this PR.

Suggested change
// ViewModelMacroSwiftTests.swift, created on 18.09.2024
// ViewModelMacroSwiftTests.swift, created on 18.09.2025

Copilot uses AI. Check for mistakes.
@aromanov91 aromanov91 requested a review from Copilot September 25, 2025 10:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

//
// Copyright © 2025 Alexander Romanov
// ViewModelMacroTests.swift, created on 12.09.2025
// ViewModelMacroTests.swift, created on 18.09.2024
Copy link

Copilot AI Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The creation date shows 2024 but should be 2025 to match other files in the codebase.

Suggested change
// ViewModelMacroTests.swift, created on 18.09.2024
// ViewModelMacroTests.swift, created on 18.09.2025

Copilot uses AI. Check for mistakes.
@aromanov91 aromanov91 requested a review from Copilot September 25, 2025 10:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 36 out of 36 changed files in this pull request and generated no new comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@aromanov91 aromanov91 merged commit e193648 into main Sep 26, 2025
4 checks passed
@aromanov91 aromanov91 deleted the feature/screens branch September 26, 2025 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants