Assets generator update#8208
Merged
Merged
Conversation
There doesn't seem to be a setting for cssbundling-rails with tailwind as this always uses tailwindcss-rails and seems by design. Since we want to install and setup importmap-rails anyway, we'll do the same with cssbundling-rails.
We don't need to install the gem since we pass the --javascript=importmap argument on generating the dev/test app already.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8208 +/- ##
=======================================
Coverage 99.10% 99.10%
=======================================
Files 140 140
Lines 4013 4013
=======================================
Hits 3977 3977
Misses 36 36 ☔ View full report in Codecov by Sentry. |
148570c to
816d478
Compare
We want to generate this with its own name and not assume the host app isn't using Tailwind already. If they aren't and only plan to for the admin, then its a simple change on their to rename this. We don't need to include Procfile.dev or builds/.keep since the expectation is that the host app has installed and run the setup for both cssbundling-rails (tailwind) and importmap-rails. The most a host app will have to do after running the assets generator, is just add update the build:css script in package.json with the ActiveAdmin specific Tailwind build.
This now happens when running the install/setup scripts for cssbundling-rails and importmap-rails so we'll include this update.
This is no longer needed as all we need to do and for users, is to add the activeadmin npm package and update the build:css command with the updated tailwind command for activeadmin CSS. For that we the `npm pkg set scripts` command.
These are no longer defined. See if removing the bundle/gemfile resolves the Rails 6.1 CI build failure as everything else is passing.
We don't need git here since the app is created within the tmp directory and already ignored. It also would be one less action to run and less output too.
No need to do these updates manually as Rails already includes template methods for these actions. https://guides.rubyonrails.org/rails_application_templates.html#environment-application-data-nil-options-block https://guides.rubyonrails.org/rails_application_templates.html#route-routing-code
816d478 to
eedaa4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This updates the assets generator to only create the stylesheet file and our Tailwind config file. We now install cssbundling-rails and importmap-rails and run both their setup scripts as part of the local app generation process. This will mimic what we expect a host app to have in place. From there they (and our local app gen) just need to change/update the
build:csspackage script to use our CSS and Tailwind files. If the host app isn't using Tailwind already, they can easily update this to be in the application.css file instead if they want.This also improves our rails template file to use existing methods for adding a route or environment config file change. Also removes git as its unnecessary for the local app gen.