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

Update `Configuration` to support passing additional imports #21

Closed markst closed 3 months ago

markst commented 11 months 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 11 months ago

20

markst commented 11 months ago

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

args:
  autoMockableImports: ["Combine", "BookPlayerKit"]
  autoMockableTestableImports: ["BookPlayer"]
markst commented 11 months ago

Might be an idea to add some tests for Configuration parsing

BarredEwe commented 11 months 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 11 months 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 3 months ago

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