From 53c2160b18a3c7ed07d522ff605a87d875225be8 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Mon, 29 Jan 2024 18:08:04 +0100 Subject: [PATCH 1/3] Install Solidus Admin after other subcomponents This facilitates editing sandbox routes and Procfile when installing Tailwind. --- .../generators/solidus/install/install_generator.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/lib/generators/solidus/install/install_generator.rb b/core/lib/generators/solidus/install/install_generator.rb index 44794d4b35..044563b81f 100644 --- a/core/lib/generators/solidus/install/install_generator.rb +++ b/core/lib/generators/solidus/install/install_generator.rb @@ -175,6 +175,12 @@ 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] @@ -185,12 +191,6 @@ def install_solidus_admin 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 - end - def populate_seed_data if @load_seed_data say_status :loading, "seed data" From ccfaa23f6a4c70d6ce89c7264f5d818db861f21c Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Mon, 29 Jan 2024 18:00:05 +0100 Subject: [PATCH 2/3] Add --build-admin-tailwind flag to installers This way, we can provide the option to (not) build the Tailwind CSS file and add rake tasks for managing Admin Tailwind assets. The flag is added to the Solidus installer, then passed along when installing the new admin. --- core/lib/generators/solidus/install/install_generator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/lib/generators/solidus/install/install_generator.rb b/core/lib/generators/solidus/install/install_generator.rb index 044563b81f..4bf4eb8433 100644 --- a/core/lib/generators/solidus/install/install_generator.rb +++ b/core/lib/generators/solidus/install/install_generator.rb @@ -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 @@ -188,7 +189,7 @@ def install_solidus_admin unless File.read(app_path.join('Gemfile')).include?('solidus_admin') bundle_command 'add solidus_admin -v ">= 0.2"' end - generate 'solidus_admin:install' + generate "solidus_admin:install #{'--tailwind' if options[:build_admin_tailwind]}" end def populate_seed_data From 26ed5f7dc8e7c1bc701d2c026e748af577364da6 Mon Sep 17 00:00:00 2001 From: andrea longhi Date: Wed, 7 Feb 2024 17:42:00 +0100 Subject: [PATCH 3/3] Update doc for sandbox and Github installs The preferred (AKA the only way that fully works) way to start the sanbox is via `bin/dev`. Same thing when installing Solidus from Github or the local filesystem. --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index de8e31294a..e625d35d05 100644 --- a/README.md +++ b/README.md @@ -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