Do we have a solution for Deface overrides in app ...
# general
m
Do we have a solution for Deface overrides in app folders breaking all extensions with current Rails/Zeitwerk/Solidus? I'm trying to contribute to
solidus_reviews
, but it's impossible to get a green build...
c
I would also like to know as I am trying to get the build on
solidus_taxjar
green against
main
šŸ˜ž @Jared Norman suggested moving to the DSL syntax that uses
.deface
files instead, but I haven't given that a try yet.
ā¤ļø 1
a
Does something like this work?
Copy code
Rails.autoloaders.main.ignore(
      File.join(File.dirname(__FILE__), '../path/to/deface/*.rb')
    )

    config.to_prepare do
      Dir.glob(File.join(File.dirname(__FILE__), '../path/to/deface/*.rb')) do |c|
        Rails.configuration.cache_classes ? require(c) : load(c)
      end
    end
j
The big issue is that deface collides with the new convention of putting "decorators" (now called overrides)
app/overrides
.
šŸ˜ž 1
neckbeard 1
c
@Alistair Norman Yeah I was contemplating adding something like that, but since it's an extension it may not be desirable for applications that include it. I think the hope with using
.deface
files is that Zeitwerk just ignores them
m
https://github.com/AlchemyCMS/alchemy-solidus uses the DSL, and it seems to be working fine.
šŸ‘šŸ¼ 1
ā¤ļø 1
t
I'm going to give that a try. Fingers crossed! Thanks all!
šŸ‘šŸ¼ 1
c
Let us know how it goes šŸ˜„
t
I've been playing around with @Alistair Norman’s suggestion, which feels like it should work, but thus far have not been able to make it take hold.
m
The
.deface
DSL idea does work in Solidus Reviews: https://github.com/solidusio-contrib/solidus_reviews/pull/117
šŸŽ‰ 1
sqlite
builds fail for another reason
c
Me and @Alistair Norman were able to do the same for
solidus_taxjar
and that resolved the issue for us as well https://github.com/SuperGoodSoft/solidus_taxjar/pull/254/commits/dd664da8a17ed4ef8dbaa7aadbd167aa4e2c9cfb
m
Hm, we have menu items these days, I think for just adding a config page to the main menu, you can just use an initializer!
šŸ‘€ 1
c
Hmm, good call, we should be able to do this through the backend configuration šŸ¤”