lawik
This is definitely mostly about Igniter, incidentally about Nerves and Phoenix.
Both of those projects have generators that create a mix project. The convention in Nerves is a “poncho” project, that is, not quite an umbrella. You put Phoenix as thing_ui and Nerves as thing_firmware.
The firmware project puts the UI project as a path dependency. You copy and modify a ton of Phoenix config over the the firmware project. Then you run locally or compile firmware for your device from the firmware project.
I want to make a generator that does this all for you. It seems like igniter would be very helpful for patching config and such. But I’m uncertain if the --with approach works here for igniter.new and to what extent Igniter helps for this journey. I am fundamentally generating two separate mix projects and tying them together a bit.
Trending in Questions
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
lawik
@zachdaniel what is more helpful around Igniter, ask question in Ash forum or ping you?
Cause I didn’t see a space to put this in that made sense that you’d see
zachdaniel
We’ve got an “igniter” channel in the ash discord, but here is good too! I’ve updated my notification settings so I get pinged on
ignitertagged posts going forward, thanks for the heads upSo, to answer your question:
the current state of the world is that
igniter.newvery much expects to create a mix project at the moment. Another fundamental (current) limitation of igniter is that it expects to be run in the context of a single mix project (but you could read/add files from external to the project)I think we could actually potentially build some kind of first class support for poncho projects into
igniter.neworigniter.new_ponchoeven. But barring that, it would probably look something like this:Then depending on how the installer is packaged, you might just include
your_installerin the list of packages being installed, or you’d add another call to something likemix nerves.create_and_copy_phoenix_app.lawik
My current thinking is to not make it a poncho in the end. But this still means juggling and merging between two generators
zachdaniel
lawik
On vacation right now but can holler when I get goong on this.
Essentially I want to generate a Nerves mix project and a Phoenix mix project and then use igniter to work out ways to merge files that exist in both (such as config, mix.exs).
mayel
On a similar note, our poncho project uses plain text files to specify deps instead of placing them in
mix.exsas we found that easier to programmatically edit but also makes it more composable (we can have different deps source files that are included or not based on env or compile flags). This works by including a short script withCode.eval_file("mess.exs")inmix.exsGiven that context, I’d love a way to be able to use
igniter.installin the project, maybe with an escape hatch to call another function instead ofIgniter.apply_and_fetch_dependencies?zachdaniel
Igniter has a
.igniter.exsfile that can be used to configure these things, or we can try to detect things like this, but it definitely won’t work out of the box. Interested in exploring the idea thoughaxelson
I wonder if it would first make sense to start by creating an igniter-powered version of
mix phx.newandmix nerves.new, then you could adapt those to be able to work together (possibly within a single project) or work in a poncho fashion. Although maybe that’s what you have in mind already.