Skip to content

Conversation

@phyr97
Copy link
Collaborator

@phyr97 phyr97 commented Mar 17, 2025

closes #980

This is the starting point for a backpex installer with igniter. You can use mix igniter.install backpex to add backpex to your project and have almost everything set up without any further work. More information about installing with igniter can be found in its docs.

The installer requires the new tailwind and daisyui update (#920), as it greatly reduces the pain of the tailwind and daisyui setup (no tailwind.config.js 🥳).

ToDo

  • Install the backpex hooks via igniterjs
    • requires igniterjs to be installed in the user's project
  • Install daisyui using npm command
    • checks if npm is installed and asks the user if the installer is allowed to install daisyui
  • add backpex to `.formatter.exs
  • configure pubsub server in `config.exs
  • add backpex_routes to router.exs.
  • add admin.html.heex to layouts folder
  • add @source "../../deps/backpex/**/*.*ex"; to app.css
  • warn user if tailwindcss/forms plugin exists in app.css
    • can be removed by the generator if the user confirms it
  • warn user if bg-white class is used on body tag
    • can be removed by the generator if the user confirms it
  • write docs
  • test manually with new phoenix project
  • improve code
  • fix credo warnings and possible bugs discovered while testing
  • write tests for the generator with Igniter.Test

@phyr97 phyr97 requested a review from Flo0807 May 28, 2025 14:02
@Flo0807 Flo0807 removed their request for review July 22, 2025 13:57
@phyr97
Copy link
Collaborator Author

phyr97 commented Jul 24, 2025

I would recommend to test the installer with this command:

mix igniter.install backpex@git:https://github.com/naymspace/backpex.git@feature/backpex-installer

You also need to install igniter before using this command. You can use the archive or install it in the mix.exs

@phyr97 phyr97 requested a review from Flo0807 July 24, 2025 11:36
@Flo0807 Flo0807 requested a review from Copilot July 25, 2025 12:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a Backpex installer using the Igniter framework that automates the installation and setup of Backpex in Phoenix applications. The installer handles configuration, dependency installation, file modifications, and layout generation to streamline the onboarding process.

Key changes:

  • Adds a comprehensive installer task that automates most manual setup steps from the installation guide
  • Integrates with Igniter and IgniterJS for automated file modifications and dependency management
  • Includes helper utilities for common installation tasks like file manipulation and module checking

Reviewed Changes

Copilot reviewed 6 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
priv/templates/layouts/admin.html.heex Template for the default admin layout generated by the installer
mix.exs Adds igniter and igniter_js dependencies required for the installer
lib/mix/tasks/backpex.install.ex Main installer task with comprehensive setup automation
lib/mix/helpers.ex Helper functions for file manipulation, module checking, and configuration
guides/get_started/installation.md Documentation update mentioning the new installer
demo/mix.exs Removes sourceror dependency (cleanup)

@phyr97 phyr97 requested a review from Flo0807 August 2, 2025 16:10
@Flo0807 Flo0807 changed the title Installing backpex via generator Add backpex.install command Aug 8, 2025
@Flo0807 Flo0807 added the feature New feature label Aug 8, 2025
@Flo0807 Flo0807 merged commit 83e2da6 into develop Aug 8, 2025
6 checks passed
@Flo0807 Flo0807 deleted the feature/backpex-installer branch August 8, 2025 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add generator: mix backpex.install

2 participants