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.

Fix: Updated the Rails app template for Spree 6 (#15018)

Damian Legawiecbf2ddb63f9df
diff --git a/spree/api/README.md b/spree/api/README.md
index 4224d4d903..3e78bcf0db 100644
--- a/spree/api/README.md
+++ b/spree/api/README.md
@@ -133,5 +133,6 @@ bundle exec rspec
## Documentation
-- [API Reference](https://docs.spreecommerce.org/api)
-- [Authentication Guide](https://docs.spreecommerce.org/developer/api/authentication)
+- [API Reference](https://spreecommerce.org/docs/api-reference)
+- [Store API authentication](https://spreecommerce.org/docs/api-reference/store-api/authentication)
+- [Admin API authentication](https://spreecommerce.org/docs/api-reference/admin-api/authentication)
diff --git a/spree/api/spree_api.gemspec b/spree/api/spree_api.gemspec
index de3348171d..f310b5c6da 100644
--- a/spree/api/spree_api.gemspec
+++ b/spree/api/spree_api.gemspec
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
s.metadata = {
'bug_tracker_uri' => 'https://github.com/spree/spree/issues',
'changelog_uri' => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- 'documentation_uri' => 'https://docs.spreecommerce.org/',
+ 'documentation_uri' => 'https://spreecommerce.org/docs/',
'source_code_uri' => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/core/README.md b/spree/core/README.md
index 71abb395a6..32043c8559 100644
--- a/spree/core/README.md
+++ b/spree/core/README.md
@@ -110,6 +110,6 @@ bundle exec rspec
## Documentation
-- [Official Documentation](https://docs.spreecommerce.org)
+- [Official Documentation](https://spreecommerce.org/docs)
- [API Reference](https://api.spreecommerce.org)
-- [Guides](https://docs.spreecommerce.org/developer)
\ No newline at end of file
+- [Guides](https://spreecommerce.org/docs/developer)
\ No newline at end of file
diff --git a/spree/core/lib/generators/spree/authentication/dummy/dummy_generator.rb b/spree/core/lib/generators/spree/authentication/dummy/dummy_generator.rb
deleted file mode 100644
index bf421d34fd..0000000000
--- a/spree/core/lib/generators/spree/authentication/dummy/dummy_generator.rb
+++ /dev/null
@@ -1,54 +0,0 @@
-require 'rails/generators'
-
-module Spree
- module Authentication
- class DummyGenerator < Rails::Generators::Base
- desc 'Set up a Spree installation with dummy authentication for testing. Creates a separate spree_admin_users table.'
-
- def self.source_paths
- paths = superclass.source_paths
- paths << File.expand_path('templates', __dir__)
- paths.flatten
- end
-
- def create_authentication_helpers
- template 'authentication_helpers.rb.tt', 'lib/spree/authentication_helpers.rb'
- end
-
- def configure_authentication_helpers
- file_action = File.exist?('config/initializers/spree.rb') ? :append_file : :create_file
- send(file_action, 'config/initializers/spree.rb') do
- <<~RUBY
-
- Rails.application.config.to_prepare do
- require_dependency 'spree/authentication_helpers'
- end
- RUBY
- end
- end
-
- def create_admin_users_migration
- # Use a fixed early timestamp (20210913) to ensure this migration runs BEFORE
- # any Spree core migrations that reference spree_admin_users table.
- # The earliest such migration is 20250122113708_add_first_and_last_name_to_spree_admin_class.rb
- # We use a timestamp before the main Spree migration (20210914000000_spree_four_three.rb)
- migration_file = File.join('db', 'migrate', '20210913000000_create_spree_admin_users.rb')
-
- # Skip if migration already exists
- return if File.exist?(migration_file) || migration_exists?('create_spree_admin_users')
-
- template 'create_spree_admin_users.rb.tt', migration_file
- end
-
- private
-
- def migration_exists?(name)
- Dir.glob(File.join('db', 'migrate', "*_#{name}.rb")).any?
- end
-
- def migration_version
- "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
- end
- end
- end
-end
diff --git a/spree/core/lib/generators/spree/authentication/dummy/templates/authentication_helpers.rb.tt b/spree/core/lib/generators/spree/authentication/dummy/templates/authentication_helpers.rb.tt
deleted file mode 100644
index d4a958f579..0000000000
--- a/spree/core/lib/generators/spree/authentication/dummy/templates/authentication_helpers.rb.tt
+++ /dev/null
@@ -1,52 +0,0 @@
-# Dummy authentication helpers for testing purposes.
-# These provide stub implementations that don't require actual routes.
-module Spree
- module AuthenticationHelpers
- def self.included(receiver)
- receiver.helper_method(
- :spree_current_user,
- :spree_login_path,
- :spree_signup_path,
- :spree_logout_path,
- :spree_forgot_password_path,
- :spree_edit_password_path,
- :spree_admin_login_path,
- :spree_admin_logout_path
- )
- end
-
- def spree_current_user
- @spree_current_user
- end
-
- def spree_login_path(_opts = {})
- '/login'
- end
-
- def spree_signup_path(_opts = {})
- '/signup'
- end
-
- def spree_logout_path(_opts = {})
- '/logout'
- end
-
- def spree_forgot_password_path(_opts = {})
- '/forgot_password'
- end
-
- def spree_edit_password_path(_opts = {})
- '/edit_password'
- end
-
- def spree_admin_login_path(_opts = {})
- '/admin/login'
- end
-
- def spree_admin_logout_path(_opts = {})
- '/admin/logout'
- end
- end
-end
-
-ApplicationController.include Spree::AuthenticationHelpers if defined?(ApplicationController)
diff --git a/spree/core/lib/generators/spree/authentication/dummy/templates/create_spree_admin_users.rb.tt b/spree/core/lib/generators/spree/authentication/dummy/templates/create_spree_admin_users.rb.tt
deleted file mode 100644
index f628d84cb2..0000000000
--- a/spree/core/lib/generators/spree/authentication/dummy/templates/create_spree_admin_users.rb.tt
+++ /dev/null
@@ -1,33 +0,0 @@
-class CreateSpreeAdminUsers < ActiveRecord::Migration<%= migration_version %>
- def change
- create_table :spree_admin_users do |t|
- t.string :encrypted_password, limit: 128
- t.string :password_digest
- t.string :email
- t.string :remember_token
- t.string :persistence_token
- t.string :reset_password_token
- t.string :perishable_token
- t.integer :sign_in_count, default: 0, null: false
- t.integer :failed_attempts, default: 0, null: false
- t.datetime :last_request_at
- t.datetime :current_sign_in_at
- t.datetime :last_sign_in_at
- t.string :current_sign_in_ip
- t.string :last_sign_in_ip
- t.string :login
- t.string :authentication_token
- t.string :unlock_token
- t.datetime :locked_at
- t.datetime :remember_created_at
- t.datetime :reset_password_sent_at
- t.string :first_name
- t.string :last_name
- t.string :selected_locale
-
- t.timestamps
- end
-
- add_index :spree_admin_users, :email, unique: true
- end
-end
diff --git a/spree/core/lib/generators/spree/dummy/dummy_generator.rb b/spree/core/lib/generators/spree/dummy/dummy_generator.rb
index 4b1a1740f6..70a7445a8f 100644
--- a/spree/core/lib/generators/spree/dummy/dummy_generator.rb
+++ b/spree/core/lib/generators/spree/dummy/dummy_generator.rb
@@ -40,7 +40,6 @@ module Spree
args << '--skip-git'
args << '--skip-keeps'
args << '--skip-rc'
- args << '--skip-spring'
args << '--skip-test'
args << '--skip-bootsnap'
args << '--skip-docker'
diff --git a/spree/core/lib/generators/spree/dummy/templates/rails/database.yml b/spree/core/lib/generators/spree/dummy/templates/rails/database.yml
index 635949d614..e6a98019ca 100644
--- a/spree/core/lib/generators/spree/dummy/templates/rails/database.yml
+++ b/spree/core/lib/generators/spree/dummy/templates/rails/database.yml
@@ -1,6 +1,3 @@
-<% if agent_number = ENV['TC_AGENT_NUMBER']
-database_prefix = agent_number + '_'
-end %>
<% if options[:lib_name]
lib_name = options[:lib_name].gsub('/', '_')
end %>
@@ -37,13 +34,13 @@ mysql: &mysql
development:
<<: *mysql
- database: <%= database_prefix %><%= lib_name %>_spree_development
+ database: <%= lib_name %>_spree_development
test:
<<: *mysql
- database: <%= database_prefix %><%= lib_name %>_spree_test<%%= ENV['TEST_ENV_NUMBER'] %>
+ database: <%= lib_name %>_spree_test<%%= ENV['TEST_ENV_NUMBER'] %>
production:
<<: *mysql
- database: <%= database_prefix %><%= lib_name %>_spree_production
+ database: <%= lib_name %>_spree_production
<% when 'postgres' %>
postgres: &postgres
adapter: postgresql
@@ -61,13 +58,13 @@ postgres: &postgres
development:
<<: *postgres
- database: <%= database_prefix %><%= lib_name %>_spree_development
+ database: <%= lib_name %>_spree_development
test:
<<: *postgres
- database: <%= database_prefix %><%= lib_name %>_spree_test<%%= ENV['TEST_ENV_NUMBER'] %>
+ database: <%= lib_name %>_spree_test<%%= ENV['TEST_ENV_NUMBER'] %>
production:
<<: *postgres
- database: <%= database_prefix %><%= lib_name %>_spree_production
+ database: <%= lib_name %>_spree_production
<% else %>
development:
adapter: sqlite3
diff --git a/spree/core/lib/generators/spree/dummy/templates/rails/test.rb b/spree/core/lib/generators/spree/dummy/templates/rails/test.rb
index 7ae8215228..24d04a25aa 100644
--- a/spree/core/lib/generators/spree/dummy/templates/rails/test.rb
+++ b/spree/core/lib/generators/spree/dummy/templates/rails/test.rb
@@ -1,11 +1,11 @@
-Dummy::Application.configure do
+Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb
# The test environment is used exclusively to run your application's
# test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
# and recreated between test runs. Don't rely on the data there!
- config.cache_classes = true
+ config.enable_reloading = false
# Configure static asset server for tests with Cache-Control for performance
config.public_file_server.enabled = true
diff --git a/spree/core/lib/generators/spree/dummy_model/templates/migration.rb.tt b/spree/core/lib/generators/spree/dummy_model/templates/migration.rb.tt
index 98df831cdd..5d0db5b68b 100644
--- a/spree/core/lib/generators/spree/dummy_model/templates/migration.rb.tt
+++ b/spree/core/lib/generators/spree/dummy_model/templates/migration.rb.tt
@@ -1,4 +1,4 @@
-class CreateSpreeDummyModels < ActiveRecord::Migration[5.1]
+class CreateSpreeDummyModels < ActiveRecord::Migration[<%= ActiveRecord::Migration.current_version %>]
def change
create_table :spree_dummy_models do |t|
t.string :name
diff --git a/spree/core/lib/spree/core.rb b/spree/core/lib/spree/core.rb
index 1923645c6c..cb15f917f3 100644
--- a/spree/core/lib/spree/core.rb
+++ b/spree/core/lib/spree/core.rb
@@ -125,7 +125,6 @@ module Spree
collections: :default,
stock_location_stock_levels: :default,
coupon_codes: :default,
- themes: :default,
addresses: :default,
gift_cards: :default,
webhooks: :default,
diff --git a/spree/core/lib/spree/testing_support/common_rake.rb b/spree/core/lib/spree/testing_support/common_rake.rb
index cb733e31c3..8e3c387cb7 100644
--- a/spree/core/lib/spree/testing_support/common_rake.rb
+++ b/spree/core/lib/spree/testing_support/common_rake.rb
@@ -3,11 +3,12 @@ require 'generators/spree/dummy_model/dummy_model_generator'
desc 'Generates a dummy app for testing'
namespace :common do
+ # :authentication is ignored (test apps use the gem-owned auth models); it stays
+ # so extensions passing positional arguments keep working.
task :test_app, [:authentication, :user_class, :admin_user_class] do |_t, args|
# Support both Rake::TaskArguments (via invoke) and Hash (via execute)
# When using execute with a Hash, args IS the hash directly
defaults = {
- authentication: 'dummy',
user_class: 'Spree::Customer',
admin_user_class: 'Spree::AdminUser',
}
@@ -45,7 +46,7 @@ namespace :common do
File.exist?(File.expand_path('../../../../spree.gemspec', __dir__))
bundle_exec = use_root_gemfile ? "bundle exec --gemfile=#{root_gemfile}" : 'bundle exec'
puts 'Running Spree install generator...'
- system("#{bundle_exec} rails g spree:install --force --auto-accept --migrate=false --seed=false --sample=false --user_class=#{args[:user_class]} --admin_user_class=#{args[:admin_user_class]} --authentication=#{args[:authentication]}")
+ system("#{bundle_exec} rails g spree:install --force --auto-accept --migrate=false --seed=false --sample=false --user_class=#{args[:user_class]} --admin_user_class=#{args[:admin_user_class]}")
unless ENV['NO_MIGRATE']
puts 'Setting up dummy database...'
diff --git a/spree/core/spec/lib/tasks/migrate_users_to_customers_spec.rb b/spree/core/spec/lib/tasks/migrate_users_to_customers_spec.rb
index 78aac6d7a9..600118a324 100644
--- a/spree/core/spec/lib/tasks/migrate_users_to_customers_spec.rb
+++ b/spree/core/spec/lib/tasks/migrate_users_to_customers_spec.rb
@@ -33,10 +33,16 @@ describe 'spree:upgrade:migrate_users_to_customers' do
t.datetime :locked_at
t.timestamps
end
+
+ # A pre-6.0 admin table keeps its Devise digest next to password_digest.
+ ActiveRecord::Base.connection.add_column :spree_admin_users, :encrypted_password, :string
+ Spree.admin_user_class.reset_column_information
end
after(:all) do
ActiveRecord::Base.connection.drop_table :spree_legacy_source_users, if_exists: true
+ ActiveRecord::Base.connection.remove_column :spree_admin_users, :encrypted_password
+ Spree.admin_user_class.reset_column_information
end
before do
diff --git a/spree/core/spec/models/spree/admin_user_spec.rb b/spree/core/spec/models/spree/admin_user_spec.rb
index 267a01a1c3..f9d512dd07 100644
--- a/spree/core/spec/models/spree/admin_user_spec.rb
+++ b/spree/core/spec/models/spree/admin_user_spec.rb
@@ -64,7 +64,7 @@ describe Spree.admin_user_class, type: :model do
# Switching an account off must not depend on its other attributes
# passing today's validations.
it 'deactivates an account that no longer validates' do
- admin_user.update_column(:email, '')
+ allow(admin_user).to receive(:valid?).and_return(false)
admin_user.deactivate!
diff --git a/spree/core/spree_core.gemspec b/spree/core/spree_core.gemspec
index 471ab72f1c..94990dbc8d 100644
--- a/spree/core/spree_core.gemspec
+++ b/spree/core/spree_core.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
@@ -48,7 +48,6 @@ Gem::Specification.new do |s|
s.add_dependency 'doorkeeper', '~> 6.0.0.rc2'
s.add_dependency 'friendly_id', '~> 5.2', '>= 5.2.1'
s.add_dependency 'geocoder'
- s.add_dependency 'highline', '>= 2', '< 4' # Necessary for the install generator
# json 3 removed the positional options hash, which ActiveSupport::JSON.decode
# still passes (`::JSON.parse(json, options)`). Rolling a transaction back
# restores JSON attributes through that path, so on json 3 any rollback
diff --git a/spree/emails/README.md b/spree/emails/README.md
index e608e8e58d..479a22b682 100644
--- a/spree/emails/README.md
+++ b/spree/emails/README.md
@@ -164,5 +164,5 @@ bundle exec rspec
## Documentation
-- [Email Customization Guide](https://docs.spreecommerce.org/developer/customization/emails)
-- [Events System](https://docs.spreecommerce.org/developer/core-concepts/events)
+- [Email Customization Guide](https://spreecommerce.org/docs/developer/customization/emails)
+- [Events System](https://spreecommerce.org/docs/developer/core-concepts/events)
diff --git a/spree/emails/spree_emails.gemspec b/spree/emails/spree_emails.gemspec
index f362b73557..eea6b2364c 100644
--- a/spree/emails/spree_emails.gemspec
+++ b/spree/emails/spree_emails.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/lib/generators/spree/install/install_generator.rb b/spree/lib/generators/spree/install/install_generator.rb
index 6749cde80b..7ceb77741a 100644
--- a/spree/lib/generators/spree/install/install_generator.rb
+++ b/spree/lib/generators/spree/install/install_generator.rb
@@ -1,7 +1,4 @@
require 'rails/generators'
-require 'highline/import'
-require 'bundler'
-require 'bundler/cli'
require 'active_support/core_ext/string/indent'
require 'spree/core'
@@ -15,8 +12,6 @@ module Spree
class_option :admin_user_class, type: :string
class_option :admin_email, type: :string
class_option :admin_password, type: :string
- class_option :enforce_available_locales, type: :boolean, default: nil
- class_option :authentication, type: :string, default: nil
def self.source_paths
paths = superclass.source_paths
@@ -28,7 +23,6 @@ module Spree
@run_migrations = options[:migrate]
@load_seed_data = options[:seed]
@load_sample_data = options[:sample]
- @authentication = options[:authentication]
unless @run_migrations
@load_seed_data = false
@@ -40,10 +34,6 @@ module Spree
template 'config/initializers/spree.rb', 'config/initializers/spree.rb'
end
- def install_authentication
- generate 'spree:authentication:dummy' if @authentication == 'dummy'
- end
-
def configure_application
application <<-APP.strip_heredoc.indent!(4)
@@ -54,13 +44,6 @@ module Spree
end
end
APP
-
- unless options[:enforce_available_locales].nil?
- application <<-APP.strip_heredoc.indent!(4)
- # Prevent this deprecation message: https://github.com/svenfuchs/i18n/commit/3b6e56e
- I18n.enforce_available_locales = #{options[:enforce_available_locales]}
- APP
- end
end
def include_seed_data
@@ -91,7 +74,6 @@ module Spree
if @load_seed_data
say_status :loading, 'seed data'
rake_options = []
- rake_options << 'AUTO_ACCEPT=1' if options[:auto_accept]
rake_options << "ADMIN_EMAIL=#{options[:admin_email]}" if options[:admin_email]
rake_options << "ADMIN_PASSWORD=#{options[:admin_password]}" if options[:admin_password]
@@ -126,14 +108,6 @@ module Spree
insert_into_file(File.join('config', 'routes.rb'),
after: "Rails.application.routes.draw do\n") do
<<-ROUTES.strip_heredoc.indent!(2)
- # This line mounts Spree's routes at the root of your application.
- # This means, any requests to URLs such as /products, will go to
- # Spree::ProductsController.
- # If you would like to change where this engine is mounted, simply change the
- # :at option to something different.
- #
- # We ask that you don't use the :as option here, as Spree relies on it being
- # the default of "spree".
mount Spree::Core::Engine, at: '/'
ROUTES
end
diff --git a/spree/lib/generators/spree/install/templates/config/initializers/spree.rb b/spree/lib/generators/spree/install/templates/config/initializers/spree.rb
index f8dea138a3..3c56d503a0 100644
--- a/spree/lib/generators/spree/install/templates/config/initializers/spree.rb
+++ b/spree/lib/generators/spree/install/templates/config/initializers/spree.rb
@@ -1,5 +1,5 @@
# Spree settings are configured with environment variables — see
-# https://docs.spreecommerce.org/developer/customization/configuration
+# https://spreecommerce.org/docs/developer/customization/configuration
# for every setting and the variable that sets it.
#
# SPREE_MINIMUM_PASSWORD_LENGTH=10
@@ -19,11 +19,6 @@
# Default is nil and your application host will be used
# Spree.cdn_host = 'cdn.example.com'
-# Multi-store setup
-# You need to set a wildcard `root_domain` on the store to enable multi-store setup
-# all new stores will be created in a subdomain of the root domain, eg. store1.lvh.me, store2.lvh.me, etc.
-# Spree.root_domain = ENV.fetch('SPREE_ROOT_DOMAIN', 'lvh.me')
-
# Use a different service for storage (S3, google, etc)
# unless Rails.env.test?
# Spree.public_storage_service_name = :amazon_public # public assets, such as product images
@@ -31,7 +26,7 @@
# end
# Swap a Spree service for your own — see
-# https://docs.spreecommerce.org/developer/customization/dependencies
+# https://spreecommerce.org/docs/developer/customization/dependencies
Spree.dependencies do |dependencies|
# Example:
# Uncomment to change the default workflow handling adding items to the cart
@@ -50,7 +45,7 @@ Rails.application.config.after_initialize do
# Stock splitters and adjusters
# Spree.stock_splitters << Spree::Stock::Splitters::SecretLogicSplitter
- # Spree.adjusters << Spree::Adjustable::Adjuster::TaxTheRich
+ # Spree.adjusters << Spree::Adjusters::TaxTheRich
# Custom promotions
# Spree.calculators.promotion_actions_create_adjustments << Spree::Calculators::PromotionActions::CreateAdjustments::AddDiscountForFriends
@@ -90,6 +85,7 @@ end
# Spree.queues.gift_cards = :default
# Spree.queues.images = :default
# Spree.queues.imports = :default
+# Spree.queues.maintenance_tasks = :default
# Spree.queues.payment_webhooks = :default
# Spree.queues.payouts = :default
# Spree.queues.products = :default
@@ -97,7 +93,6 @@ end
# Spree.queues.stock_location_stock_levels = :default
# Spree.queues.stock_reservations = :default
# Spree.queues.tax_identifiers = :default
-# Spree.queues.themes = :default
# Spree.queues.variants = :default
# Spree.queues.webhooks = :default
diff --git a/spree/mcp/spree_mcp.gemspec b/spree/mcp/spree_mcp.gemspec
index 2e3c1c92fa..39e00c6a78 100644
--- a/spree/mcp/spree_mcp.gemspec
+++ b/spree/mcp/spree_mcp.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/opentelemetry/README.md b/spree/opentelemetry/README.md
index 11701f30f7..6ff482bc00 100644
--- a/spree/opentelemetry/README.md
+++ b/spree/opentelemetry/README.md
@@ -33,7 +33,7 @@ is the kill switch.
Span attributes never contain personal data — prefixed IDs, workflow/step
names, gateway action names, and HTTP metadata only.
-See the [telemetry guide](https://docs.spreecommerce.org/developer/deployment/telemetry)
+See the [telemetry guide](https://spreecommerce.org/docs/developer/deployment/telemetry)
for the full span catalog, collector examples, and sampling guidance.
## Code-level configuration
diff --git a/spree/opentelemetry/spree_opentelemetry.gemspec b/spree/opentelemetry/spree_opentelemetry.gemspec
index c0cff86f57..d29e909c52 100644
--- a/spree/opentelemetry/spree_opentelemetry.gemspec
+++ b/spree/opentelemetry/spree_opentelemetry.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/providers/easypost/spree_easypost.gemspec b/spree/providers/easypost/spree_easypost.gemspec
index 88e582feab..67e5742c7d 100644
--- a/spree/providers/easypost/spree_easypost.gemspec
+++ b/spree/providers/easypost/spree_easypost.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/providers/meilisearch/spree_meilisearch.gemspec b/spree/providers/meilisearch/spree_meilisearch.gemspec
index 752a9b517d..ad2c1523d6 100644
--- a/spree/providers/meilisearch/spree_meilisearch.gemspec
+++ b/spree/providers/meilisearch/spree_meilisearch.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/providers/stripe/spree_stripe.gemspec b/spree/providers/stripe/spree_stripe.gemspec
index 3f5f3749ff..8f1cbe2d07 100644
--- a/spree/providers/stripe/spree_stripe.gemspec
+++ b/spree/providers/stripe/spree_stripe.gemspec
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/spree.gemspec b/spree/spree.gemspec
index 561496ed68..2ef8c5dad4 100644
--- a/spree/spree.gemspec
+++ b/spree/spree.gemspec
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.metadata = {
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
- "documentation_uri" => "https://docs.spreecommerce.org/",
+ "documentation_uri" => "https://spreecommerce.org/docs/",
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
}
diff --git a/spree/template.rb b/spree/template.rb
index cab7b84cc2..18bd767017 100644
--- a/spree/template.rb
+++ b/spree/template.rb
@@ -23,17 +23,16 @@ SPREE_VERSION = ENV['SPREE_VERSION'] || '~> 6.0'
def add_gems
say 'Adding required gems to Gemfile...', :blue
- # Spree gems - core (includes core, api, cli)
+ # Spree gems - core (includes core, api)
gem 'spree', USE_LOCAL_SPREE ? { path: File.join(SPREE_LOCAL_PATH, 'spree') } : { version: SPREE_VERSION }
# Optional Spree packages
gem 'spree_emails', USE_LOCAL_SPREE ? { path: File.join(SPREE_LOCAL_PATH, 'spree', 'emails') } : { version: SPREE_VERSION }
+ gem 'spree_dashboard', USE_LOCAL_SPREE ? { path: File.join(SPREE_LOCAL_PATH, 'spree', 'dashboard') } : { version: SPREE_VERSION }
# Development & Test gems
gem_group :development, :test do
gem 'spree_dev_tools'
- gem 'letter_opener'
- gem 'listen'
end
end
@@ -42,35 +41,19 @@ def install_spree
# Run Spree installer with migrations but without seeds - seeds run after all
# generators complete. Uses the gem-owned Spree::Customer / Spree::AdminUser
- # defaults (has_secure_password); no --authentication scaffolding.
+ # defaults (has_secure_password).
generate 'spree:install', '--force', '--auto-accept', '--seed=false'
end
-def configure_development_environment
- say 'Configuring development environment...', :blue
-
- # Letter opener and file watcher configuration
- environment nil, env: 'development' 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 seed_database
say 'Loading seed data...', :blue
if ADMIN_EMAIL.present? && ADMIN_PASSWORD.present?
# rails_command interpolates into a shell command line, so a password
# containing shell metacharacters would otherwise be mangled or executed.
- rails_command "db:seed AUTO_ACCEPT=1 ADMIN_EMAIL=#{Shellwords.escape(ADMIN_EMAIL)} ADMIN_PASSWORD=#{Shellwords.escape(ADMIN_PASSWORD)}"
+ rails_command "db:seed ADMIN_EMAIL=#{Shellwords.escape(ADMIN_EMAIL)} ADMIN_PASSWORD=#{Shellwords.escape(ADMIN_PASSWORD)}"
else
- rails_command 'db:seed AUTO_ACCEPT=1'
+ rails_command 'db:seed'
end
end
@@ -119,7 +102,6 @@ end
add_gems
after_bundle do
- configure_development_environment
install_spree
seed_database
load_sample_data