desktop-example-app icon indicating copy to clipboard operation
desktop-example-app copied to clipboard

Feature request: write the example app as a phoenix generator

Open adamwight opened this issue 2 months ago • 5 comments

I spent some time migrating the example app to a newer framework eg. in #28, and what I found is that the necessary bits seem very minimal, but are bundled together with some opinionated decisions such as using dart-css rather than the current default of tailwind. This could be made much more sustainable by packaging the needed customizations in a phx.new.* generator, see for example this blog post which outlines one straightforward approach.

An even more elegant approach might be to package custom template files and code-modifying modules capable of adding elixir-desktop support to an existing project.

adamwight avatar Oct 17 '25 07:10 adamwight

Looking at phx.new and phx.gen.*, the existing tooling is not great. It seems that code generators are using crude text operations rather than something fancy like quote and Macro.to_string...

Maybe a better approach might be to consolidate the elixir-desktop integration down to a minimum, and document that. To be continued...

adamwight avatar Oct 28 '25 00:10 adamwight

Maybe igniter is a better option?

WurmPeter avatar Oct 28 '25 06:10 WurmPeter

I'm open for options, and agree that trying to keep it minimal would be great so it doesn't have to be changed every time phoenix decides on a new ui standard (e.g. the inclusion of daisyui now)

dominicletz avatar Oct 28 '25 08:10 dominicletz

@WurmPeter thanks for suggesting Igniter, this looks like the right approach.

I've started writing a desktop.install task, all it does is add the dependency for now: elixir-desktop/desktop#62

adamwight avatar Oct 29 '25 04:10 adamwight

A small update: the PR is now able to add all necessary glue to an existing project, so that it will launch a Desktop window.

adamwight avatar Nov 06 '25 23:11 adamwight