♻️ Convert ArrayModel generator to Stencil template#183
Open
MadsBogeskov wants to merge 1 commit intoios-432-convert-model-generator-to-stencil-template-v2from
Conversation
ef50499 to
4c4d9d2
Compare
878e823 to
6957630
Compare
Amp-Thread-ID: https://ampcode.com/threads/T-019ce77f-038b-72fe-9f02-4a062e4ed26c Co-authored-by: Amp <amp@ampcode.com>
4c4d9d2 to
21994cf
Compare
6957630 to
b0313d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ArrayModel.toSwift() uses inline string interpolation for the file wrapper.
Solution
Extract file wrapper to ArrayModel.stencil, keep complex body logic in Swift.
Testing
All 70 tests pass including golden file tests.
Stack
#169 → #179 → #180 → #181 → #182 → this PR → …
IOS-433
Note
Low Risk
Low risk refactor that moves
ArrayModelSwift output generation from inline string building to a Stencil template; behavior should remain the same aside from potential formatting/template rendering differences.Overview
Refactors
ArrayModel.toSwift()to stop manually assembling Swift source strings and instead render output via a newArrayModel.stenciltemplate using a context dictionary.Updates
ModelDefinitionto pass the sharedtemplateRendererinto the array model path, aligning array generation with the existing template-based approach used by other model types.Written by Cursor Bugbot for commit b0313d8. This will update automatically on new commits. Configure here.