Dry-system.build idea

Been working on a few different projects where I’ve found the need to “build” some dependencies such as web assets, and native libraries.

It stuck me how useful dry-system’s lifecycle and dependency resolution system would be for this. Imagine:

App.build(:assets) do |app|
  # settings…

  
  start do
    sh “webpack —mode=#{app.env}”

    register(“assets.manifest”, load_json(“manifest.json”))
  end 
end

Since building is a very different concern from booting, it would make sense to have this as a different part of the lifecycle, with configuration living in the system/build folders”.

Just an idea, would love some thoughts!

Could this be done via a rake task instead to avoid building files during runtime?

Very good point. I suppose I find rake to be underwhelming when it comes to configuration and dependent tasks