@@ -85,8 +85,8 @@ if Code.ensure_loaded?(Igniter) do
85
85
|> configure_pubsub_server ( )
86
86
|> install_backpex_hooks ( )
87
87
|> install_daisyui ( )
88
- |> add_backpex_formatter ( )
89
88
|> add_files_to_tailwind_content ( )
89
+ |> add_backpex_formatter ( )
90
90
|> add_backpex_routes ( )
91
91
|> generate_layout ( )
92
92
|> check_for_bg_white ( )
@@ -157,12 +157,6 @@ if Code.ensure_loaded?(Igniter) do
157
157
)
158
158
end
159
159
160
- # Add Backpex to formatter
161
-
162
- defp add_backpex_formatter ( igniter ) do
163
- Formatter . import_dep ( igniter , :backpex )
164
- end
165
-
166
160
# Add backpex files to tailwind content
167
161
168
162
defp add_files_to_tailwind_content ( igniter ) do
@@ -173,6 +167,12 @@ if Code.ensure_loaded?(Igniter) do
173
167
|> Helpers . add_line_to_file ( app_css_path , "@source \" ../../deps/backpex/assets/js/**/*.*js\" " )
174
168
end
175
169
170
+ # Add Backpex to formatter
171
+
172
+ defp add_backpex_formatter ( igniter ) do
173
+ Formatter . import_dep ( igniter , :backpex )
174
+ end
175
+
176
176
# Add Backpex routes
177
177
178
178
defp add_backpex_routes ( igniter ) do
@@ -215,7 +215,7 @@ if Code.ensure_loaded?(Igniter) do
215
215
end
216
216
end
217
217
218
- # Creates default adminlayout
218
+ # Creates default admin layout
219
219
220
220
defp generate_layout ( igniter ) do
221
221
if igniter . args . options [ :no_layout ] do
@@ -231,41 +231,6 @@ if Code.ensure_loaded?(Igniter) do
231
231
end
232
232
end
233
233
234
- # Checks for tailwind forms plugin
235
-
236
- defp check_for_tailwind_forms_plugin ( igniter ) do
237
- app_css_path = igniter . args . options [ :app_css_path ]
238
- line = "@plugin \" @tailwindcss/forms\" "
239
-
240
- if Igniter . exists? ( igniter , app_css_path ) do
241
- Igniter . update_file ( igniter , app_css_path , & maybe_remove_tailwind_forms_plugin ( & 1 , line ) )
242
- else
243
- Warning . warn_with_code_sample (
244
- igniter ,
245
- """
246
- app.css not found at #{ app_css_path } .
247
- You may remove the following line from your app.css file because it can cause issues with daisyUI:
248
- """ ,
249
- line
250
- )
251
- end
252
- end
253
-
254
- defp maybe_remove_tailwind_forms_plugin ( source , line ) do
255
- app_css_content = Rewrite.Source . get ( source , :content )
256
-
257
- with true <- String . contains? ( app_css_content , line ) ,
258
- true <- remove_tailwind_forms_plugin? ( line ) do
259
- Rewrite.Source . update ( source , :content , & String . replace ( & 1 , line , "" ) )
260
- else
261
- _false -> source
262
- end
263
- end
264
-
265
- defp remove_tailwind_forms_plugin? ( line ) do
266
- Mix . shell ( ) . yes? ( "The following line could cause issues with daisyUI: #{ line } . Do you want to remove it?" )
267
- end
268
-
269
234
# Checks for default background color
270
235
271
236
defp check_for_bg_white ( igniter ) do
@@ -300,6 +265,41 @@ if Code.ensure_loaded?(Igniter) do
300
265
"A background color at the body could cause issues with the backpex app_shell. Do you want to remove it? See: https://hexdocs.pm/backpex/installation.html#remove-default-background-color"
301
266
)
302
267
end
268
+
269
+ # Checks for tailwind forms plugin
270
+
271
+ defp check_for_tailwind_forms_plugin ( igniter ) do
272
+ app_css_path = igniter . args . options [ :app_css_path ]
273
+ line = "@plugin \" @tailwindcss/forms\" "
274
+
275
+ if Igniter . exists? ( igniter , app_css_path ) do
276
+ Igniter . update_file ( igniter , app_css_path , & maybe_remove_tailwind_forms_plugin ( & 1 , line ) )
277
+ else
278
+ Warning . warn_with_code_sample (
279
+ igniter ,
280
+ """
281
+ app.css not found at #{ app_css_path } .
282
+ You may remove the following line from your app.css file because it can cause issues with daisyUI:
283
+ """ ,
284
+ line
285
+ )
286
+ end
287
+ end
288
+
289
+ defp maybe_remove_tailwind_forms_plugin ( source , line ) do
290
+ app_css_content = Rewrite.Source . get ( source , :content )
291
+
292
+ with true <- String . contains? ( app_css_content , line ) ,
293
+ true <- remove_tailwind_forms_plugin? ( line ) do
294
+ Rewrite.Source . update ( source , :content , & String . replace ( & 1 , line , "" ) )
295
+ else
296
+ _false -> source
297
+ end
298
+ end
299
+
300
+ defp remove_tailwind_forms_plugin? ( line ) do
301
+ Mix . shell ( ) . yes? ( "The following line could cause issues with daisyUI: #{ line } . Do you want to remove it?" )
302
+ end
303
303
end
304
304
else
305
305
defmodule Mix.Tasks.Backpex.Install do
0 commit comments