Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Bring back spree_dev_tools/listen gem to the template

Damian Legawiec186612c5e960
diff --git a/template.rb b/template.rb
index c7efa4492d..33e3478358 100644
--- a/template.rb
+++ b/template.rb
@@ -23,6 +23,13 @@ def add_gems
gem 'spree_storefront', USE_LOCAL_SPREE ? { path: '../' } : { version: SPREE_VERSION }
# translations
gem 'spree_i18n'
+
+ # Development & Test gems
+ gem_group :development, :test do
+ gem 'spree_dev_tools'
+ gem 'letter_opener'
+ gem 'listen'
+ end
end
def setup_importmap
@@ -67,6 +74,23 @@ def install_spree
end
end
+def configure_development_environment
+ say 'Configuring development environment...', :blue
+
+ # Letter opener and file watcher configuration
+ inject_into_file 'config/environments/development.rb', before: /^end/ do
+ <<-RUBY
+
+ # Letter Opener for email previews
+ config.action_mailer.delivery_method = :letter_opener
+ config.action_mailer.perform_deliveries = true
+
+ # Improved file watching
+ config.file_watcher = ActiveSupport::EventedFileUpdateChecker
+ RUBY
+ end
+end
+
def setup_procfile
say 'Setting up Procfile.dev...', :blue
@@ -125,6 +149,7 @@ add_gems
after_bundle do
setup_importmap
+ configure_development_environment
setup_devise
install_spree
setup_procfile