BarredEwe / Prefire

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

Update `Configuration` to support passing additional imports #21

Closed markst closed 8 months ago

markst commented 1 year ago

We have multiple swift packages which need to be imported into our generated definitions.

Similar to how Sourcery supports passing autoMockableImports. https://github.com/krzysztofzablocki/Sourcery/pull/940

These changes include imports in Configuration

markst commented 1 year ago

20

markst commented 1 year ago

@BarredEwe perhaps it might be preferred to allow passing more generics arguments as args?

args:
  autoMockableImports: ["Combine", "BookPlayerKit"]
  autoMockableTestableImports: ["BookPlayer"]
markst commented 1 year ago

Might be an idea to add some tests for Configuration parsing

BarredEwe commented 1 year ago

@BarredEwe perhaps it might be preferred to allow passing more generics arguments as args?

args:
  autoMockableImports: ["Combine", "BookPlayerKit"]
  autoMockableTestableImports: ["BookPlayer"]

Sounds great! This will save us from adding all the arguments from Sourcery in the future. And given the ability to add a custom Stencil, it will be great to throw custom arguments there

markst commented 1 year ago

Great job 👍

If you want, you can add configuration parsing tests. I plan to do it anyway in the future)

I tried adding tests, but it doesn't seem possible for for plugins!

BarredEwe commented 8 months ago

Thanks for the Pull Request! In the new version 2.0, I added support, you can already try it.