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.

Do not run install storefront by default when generating dummy app

Damian Legawiec99080ab9375d
diff --git a/core/lib/generators/spree/install/install_generator.rb b/core/lib/generators/spree/install/install_generator.rb
index 77f152d2ab..3fe4a7263e 100644
--- a/core/lib/generators/spree/install/install_generator.rb
+++ b/core/lib/generators/spree/install/install_generator.rb
@@ -10,7 +10,7 @@ module Spree
class_option :migrate, type: :boolean, default: true, banner: 'Run Spree migrations'
class_option :seed, type: :boolean, default: true, banner: 'load seed data (migrations must be run)'
class_option :sample, type: :boolean, default: true, banner: 'load sample data (migrations must be run)'
- class_option :install_storefront, type: :boolean, default: true, banner: 'installs storefront configuration files'
+ class_option :install_storefront, type: :boolean, default: false, banner: 'installs default rails storefront'
class_option :copy_storefront, type: :boolean, default: false, banner: 'copy all storefront views and stylesheets'
class_option :auto_accept, type: :boolean
class_option :user_class, type: :string
diff --git a/core/lib/spree/testing_support/common_rake.rb b/core/lib/spree/testing_support/common_rake.rb
index 6200926a56..e9700177c6 100644
--- a/core/lib/spree/testing_support/common_rake.rb
+++ b/core/lib/spree/testing_support/common_rake.rb
@@ -8,14 +8,24 @@ require 'generators/spree/dummy_model/dummy_model_generator'
desc 'Generates a dummy app for testing'
namespace :common do
task :test_app, :user_class do |_t, args|
- args.with_defaults(user_class: 'Spree::LegacyUser')
+ args.with_defaults(user_class: 'Spree::LegacyUser', install_storefront: 'false')
require ENV['LIB_NAME'].to_s
ENV['RAILS_ENV'] = 'test'
Rails.env = 'test'
Spree::DummyGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", '--quiet']
- Spree::InstallGenerator.start ["--lib_name=#{ENV['LIB_NAME']}", '--auto-accept', '--migrate=false', '--seed=false', '--sample=false', '--quiet', '--copy_storefront=false', '--install_storefront=false', "--user_class=#{args[:user_class]}"]
+ Spree::InstallGenerator.start [
+ "--lib_name=#{ENV['LIB_NAME']}",
+ '--auto-accept',
+ '--migrate=false',
+ '--seed=false',
+ '--sample=false',
+ '--quiet',
+ '--copy_storefront=false',
+ "--install_storefront=#{args[:install_storefront]}",
+ "--user_class=#{args[:user_class]}"
+ ]
puts 'Setting up dummy database...'
system("bundle exec rake db:drop db:create > #{File::NULL}")
diff --git a/frontend/Rakefile b/frontend/Rakefile
index cf2bff13cd..e7349090e1 100644
--- a/frontend/Rakefile
+++ b/frontend/Rakefile
@@ -11,5 +11,5 @@ task default: :spec
desc "Generates a dummy app for testing"
task :test_app do
ENV['LIB_NAME'] = 'spree/frontend'
- Rake::Task['common:test_app'].invoke
+ Rake::Task['common:test_app'].execute( { install_storefront: true } )
end
diff --git a/frontend/lib/generators/spree/frontend/install/install_generator.rb b/frontend/lib/generators/spree/frontend/install/install_generator.rb
index c7fd023883..a5ae11faf5 100644
--- a/frontend/lib/generators/spree/frontend/install/install_generator.rb
+++ b/frontend/lib/generators/spree/frontend/install/install_generator.rb
@@ -2,7 +2,7 @@ module Spree
module Frontend
module Generators
class InstallGenerator < Rails::Generators::Base
- desc 'Copies storefront configuration files for easy customization'
+ desc 'Installs Spree rails storefront'
def self.source_paths
[