From b74ef6cfbe1f692b99fc651b1aafd9848c6032eb 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. (cherry picked from commit 53c2160b18a3c7ed07d522ff605a87d875225be8) --- .../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 a9a873e979e9e4a00c2784c89588aa9d45582d5d 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. (cherry picked from commit ccfaa23f6a4c70d6ce89c7264f5d818db861f21c) --- 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 3c3f4847ae604e61e6fe750fa23ecdcce6956189 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. (cherry picked from commit 26ed5f7dc8e7c1bc701d2c026e748af577364da6) --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e04393d400..a31ef9e445 100644 --- a/README.md +++ b/README.md @@ -308,12 +308,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