Skip to content

Commit

Permalink
Merge pull request #5636 from nebulab/spaghetticode/admin-tailwind-sa…
Browse files Browse the repository at this point in the history
…ndbox-fix

Add Admin Tailwind build when generating sandbox
  • Loading branch information
spaghetticode authored Feb 20, 2024
2 parents 5502e5e + 26ed5f7 commit 656afaa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,17 @@ data already loaded.
bin/sandbox
```

* Start the server (`bin/rails` will forward any argument to the sandbox)
* You can start the Rails server and other services from either the Solidus folder or the
sandbox one by running the command:

```bash
bin/rails server
bin/dev
```

Please note: if you run `bin/rails server` or similar commands, only the Rails server will
start. This might cause the error `couldn't find file 'solidus_admin/tailwind.css'` when you
try to load admin pages.
### Tests
Solidus uses [RSpec](http://rspec.info) for tests. Refer to its documentation for
Expand Down
15 changes: 8 additions & 7 deletions core/lib/generators/solidus/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class InstallGenerator < Rails::Generators::AppBase
class_option :sample, type: :boolean, default: true, banner: 'Load sample data (migrations and seeds must be run)'
class_option :active_storage, type: :boolean, default: true, banner: 'Install ActiveStorage as image attachments handler for products and taxons'
class_option :admin_preview, type: :boolean, default: true, desc: 'Install the admin preview'
class_option :build_admin_tailwind, type: :boolean, default: true, desc: 'Build and install Solidus Admin Tailwind CSS file and rake tasks'
class_option :auto_accept, type: :boolean
class_option :user_class, type: :string
class_option :admin_email, type: :string
Expand Down Expand Up @@ -175,20 +176,20 @@ def run_migrations
end
end

def install_subcomponents
apply_template_for :authentication, @selected_authentication
apply_template_for :frontend, @selected_frontend
apply_template_for :payment_method, @selected_payment_method
end

def install_solidus_admin
return unless options[:admin_preview]

say_status :installing, "SolidusAdmin", :blue
unless File.read(app_path.join('Gemfile')).include?('solidus_admin')
bundle_command 'add solidus_admin -v ">= 0.2"'
end
generate 'solidus_admin:install'
end

def install_subcomponents
apply_template_for :authentication, @selected_authentication
apply_template_for :frontend, @selected_frontend
apply_template_for :payment_method, @selected_payment_method
generate "solidus_admin:install #{'--tailwind' if options[:build_admin_tailwind]}"
end

def populate_seed_data
Expand Down

0 comments on commit 656afaa

Please sign in to comment.