From b6ef97af40f66ebf14ebdcfc1e703d1b62a4905c Mon Sep 17 00:00:00 2001 From: Gabriel Sambarino Date: Fri, 7 Jul 2023 13:28:24 +0200 Subject: [PATCH 1/3] Make the Starter Frontend the default option for the installer --- .../solidus_subscriptions/install/install_generator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/generators/solidus_subscriptions/install/install_generator.rb b/lib/generators/solidus_subscriptions/install/install_generator.rb index e727e053..e9805d87 100644 --- a/lib/generators/solidus_subscriptions/install/install_generator.rb +++ b/lib/generators/solidus_subscriptions/install/install_generator.rb @@ -6,7 +6,8 @@ class InstallGenerator < Rails::Generators::Base source_root File.expand_path('templates', __dir__) class_option :auto_run_migrations, type: :boolean, default: false - class_option :frontend, type: :string, default: 'classic' + # Either 'starter' or 'classic' + class_option :frontend, type: :string, default: 'starter' def copy_initializer template 'initializer.rb', 'config/initializers/solidus_subscriptions.rb' From a84fdabfd2d9f325e453d90156c447a828ca3d11 Mon Sep 17 00:00:00 2001 From: Gabriel Sambarino Date: Fri, 7 Jul 2023 13:28:57 +0200 Subject: [PATCH 2/3] Modify the sandbox script to run the installer without the explicit starter flag --- bin/sandbox | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/sandbox b/bin/sandbox index a5f83de9..8c665ac6 100755 --- a/bin/sandbox +++ b/bin/sandbox @@ -71,7 +71,7 @@ unbundled bundle exec rails generate solidus:install \ --payment-method=none \ $@ -unbundled bundle exec rails generate ${extension_name}:install --frontend=starter --auto-run-migrations=true +unbundled bundle exec rails generate ${extension_name}:install --auto-run-migrations=true echo echo "🚀 Sandbox app successfully created for $extension_name!" From f0215414a59b1d0570d7bf820511d9e7a0696039 Mon Sep 17 00:00:00 2001 From: Gabriel Sambarino Date: Fri, 7 Jul 2023 13:29:22 +0200 Subject: [PATCH 3/3] Amend documentation to reflect changes to the installer --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 156f7c00..7653ed5d 100644 --- a/README.md +++ b/README.md @@ -13,24 +13,27 @@ Add solidus_subscriptions to your Gemfile: gem 'solidus_subscriptions', github: 'solidusio/solidus_subscriptions' ``` +### Starter Frontend + Bundle your dependencies and run the installation generator: ```shell $ bundle -$ bin/rails generate solidus_subscriptions:install --frontend=starter +$ bin/rails generate solidus_subscriptions:install ``` -Please, be aware that the starter installation only works with the default +Please, be aware that the installation only works with the default implementation of the starter frontend. Any customization to the files that will be modified by the installer might break the installation procedure. If that happens, try to adapt the installed code on top of the customizations of the store. +### Legacy Frontend If you are using the legacy `solidus_frontend` gem, please run this command instead: ```shell -$ bin/rails generate solidus_subscriptions:install +$ bin/rails generate solidus_subscriptions:install --frontend=classic ``` ### Guest checkout