BarredEwe / Prefire

🔥 A library based on SwiftUI Preview, for easy generation: Playbook view, Snapshot and Accessibility tests
Apache License 2.0
251 stars 16 forks source link

Fix - LONG LIST OF ALL THE SWIFT FILES IN OUR PRESENTATION PACKAGE #46

Closed BarredEwe closed 1 month ago

BarredEwe commented 2 months ago

Short description 📝

When the number of sources (files) is more than 4096, it gave an error:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'too many arguments (4220) -- limit is 4096'

Solution 📦

Now, when starting sourcery, an additional sourcery.yml file is generated in the cache folder. This allows you to bypass the restriction.

woutergoossens commented 2 months ago
Screenshot 2024-04-16 at 14 34 06 Screenshot 2024-04-16 at 14 41 18

I am getting this error now.. @BarredEwe

woutergoossens commented 2 months ago

@BarredEwe The tests in this PR are also failing because of that file..

BarredEwe commented 2 months ago

@woutergoossens I have updated the PR. Could you try again?

woutergoossens commented 2 months ago

@woutergoossens I have updated the PR. Could you try again?

Other error ==>

Screenshot 2024-04-22 at 19 12 48
BarredEwe commented 2 months ago

@woutergoossens Hmm. I can't reproduce it. Could you send me /Users/gowo/Library/Developer/Xcode/DerivedData/Presentation-gkbvpnlvzvzfoefbirrgyrkvqkzi/SourcePackages/plugins/presentation.output/PresentationPreviewTests/PrefireTestsPlugin/Cache/sourcery-yml file?

woutergoossens commented 2 months ago

@woutergoossens Hmm. I can't reproduce it. Could you send me /Users/gowo/Library/Developer/Xcode/DerivedData/Presentation-gkbvpnlvzvzfoefbirrgyrkvqkzi/SourcePackages/plugins/presentation.output/PresentationPreviewTests/PrefireTestsPlugin/Cache/sourcery-yml file?

sourcery.yml.zip

woutergoossens commented 2 months ago

@BarredEwe Problem is here on line 2129

Screenshot 2024-04-22 at 19 45 17

while reading .yml '/Users/gowo/Library/Developer/Xcode/DerivedData/Presentation-gkbvpnlvzvzfoefbirrgyrkvqkzi/SourcePackages/plugins/presentation.output/PresentationPreviewTests/PrefireTestsPlugin/Cache/sourcery.yml'. '2129:46: error: scanner: mapping values are not allowed in this context: TransferSummaryScreen(viewModel: TransferSummaryPreviewViewModel.withErrorMessage()) ^'Using configuration file at '/Users/gowo/Library/Developer/Xcode/DerivedData/Presentation-gkbvpnlvzvzfoefbirrgyrkvqkzi/SourcePackages/plugins/presentation.output/PresentationPreviewTests/PrefireTestsPlugin/Cache/sourcery.yml' error: while reading .yml '/Users/gowo/Library/Developer/Xcode/DerivedData/Presentation-gkbvpnlvzvzfoefbirrgyrkvqkzi/SourcePackages/plugins/presentation.output/PresentationPreviewTests/PrefireTestsPlugin/Cache/sourcery.yml'. '2129:46: error: scanner: mapping values are not allowed in this context: TransferSummaryScreen(viewModel: TransferSummaryPreviewViewModel.withErrorMessage())

Any idea?

BarredEwe commented 2 months ago

@woutergoossens I will try another solution with a custom installation of source in the .prefer.yml file.

woutergoossens commented 2 months ago

@woutergoossens I will try another solution with a custom installation of source in the .prefer.yml file.

Or I should split up our package in other packages to get rid of the > 4000 swift files limit.. :D

BarredEwe commented 2 months ago

@woutergoossens I pushed another fix. Will you try again? 😅

woutergoossens commented 2 months ago

@woutergoossens I pushed another fix. Will you try again? 😅

Yes, working! Thanks!

BarredEwe commented 2 months ago

@woutergoossens Then I need to finalize everything and I will post a new release

woutergoossens commented 2 months ago

@woutergoossens Then I need to finalize everything and I will post a new release

Hey @BarredEwe, when do you think I can expect a new release so we can enable our preview tests again? :) THanks!

BarredEwe commented 1 month ago

@woutergoossens Then I need to finalize everything and I will post a new release

Hey @BarredEwe, when do you think I can expect a new release so we can enable our preview tests again? :) THanks!

I've almost finished everything. There are several problems with formatting the generated code, but in general everything is solvable.

PS: The modification came out quite large, so it takes a lot of time (

BarredEwe commented 1 month ago

@woutergoossens Could you try this version? If everything is OK, then we can make a release)

woutergoossens commented 1 month ago

@BarredEwe Thanks! Tested, verified and working 🥳