Do not define info inside extension because of compile dependency (#1120)

This commit is contained in:
Barnabas Jovanovics 2024-05-06 15:26:09 +02:00 committed by GitHub
parent aa09589fbd
commit 815ceff61d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -83,16 +83,18 @@ defmodule MyApp.Extensions.Base do
]
}
defmodule Info do
use Spark.InfoGenerator, extension: MyApp.Extensions.Base, sections: [:base]
# This will define `base_timestamps?/1`.
end
use Spark.Dsl.Extension,
transformers: [MyApp.Extensions.Base.AddTimestamps],
sections: [@base]
end
defmodule MyApp.Extensions.Base.Info do
use Spark.InfoGenerator, extension: MyApp.Extensions.Base, sections: [:base]
# This will define `base_timestamps?/1`.
end
```
Now we can use this configuration in our transformer, like so: