solidus_core 3.2.9 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +6 -2
- data/app/controllers/spree/base_controller.rb +1 -1
- data/app/models/concerns/spree/active_storage_adapter/attachment.rb +4 -0
- data/app/models/concerns/spree/default_price.rb +0 -6
- data/app/models/concerns/spree/ransackable_attributes.rb +24 -4
- data/app/models/concerns/spree/user_methods.rb +2 -2
- data/app/models/spree/address.rb +1 -1
- data/app/models/spree/calculator/flat_fee.rb +21 -0
- data/app/models/spree/country.rb +1 -1
- data/app/models/spree/credit_card.rb +1 -1
- data/app/models/spree/customer_return.rb +1 -1
- data/app/models/spree/line_item.rb +2 -2
- data/app/models/spree/option_type.rb +1 -1
- data/app/models/spree/option_value.rb +1 -1
- data/app/models/spree/order/number_generator.rb +7 -1
- data/app/models/spree/order.rb +5 -4
- data/app/models/spree/order_promotion.rb +1 -1
- data/app/models/spree/order_updater.rb +11 -2
- data/app/models/spree/payment/processing.rb +58 -55
- data/app/models/spree/payment_method/bogus_credit_card.rb +6 -7
- data/app/models/spree/payment_method/simple_bogus_credit_card.rb +8 -0
- data/app/models/spree/payment_method.rb +16 -10
- data/app/models/spree/price.rb +1 -1
- data/app/models/spree/product.rb +3 -4
- data/app/models/spree/product_property.rb +1 -1
- data/app/models/spree/promotion/actions/free_shipping.rb +1 -0
- data/app/models/spree/promotion/order_adjustments_recalculator.rb +92 -0
- data/app/models/spree/promotion.rb +2 -2
- data/app/models/spree/promotion_code.rb +1 -1
- data/app/models/spree/property.rb +1 -1
- data/app/models/spree/return_authorization.rb +1 -1
- data/app/models/spree/shipment.rb +2 -2
- data/app/models/spree/state.rb +1 -1
- data/app/models/spree/stock_item.rb +1 -1
- data/app/models/spree/stock_location.rb +1 -1
- data/app/models/spree/stock_movement.rb +2 -2
- data/app/models/spree/store_credit_prioritizer.rb +17 -0
- data/app/models/spree/tax/tax_helpers.rb +2 -2
- data/app/models/spree/tax_calculator/default.rb +31 -0
- data/app/models/spree/tax_rate.rb +8 -1
- data/app/models/spree/taxon.rb +1 -1
- data/app/models/spree/taxonomy.rb +1 -1
- data/app/models/spree/user_last_url_storer/rules/authentication_rule.rb +1 -1
- data/app/models/spree/variant.rb +25 -5
- data/app/models/spree/zone.rb +1 -1
- data/config/locales/en.yml +13 -2
- data/db/migrate/20220805202442_add_level_to_spree_tax_rates.rb +5 -0
- data/db/migrate/20221123152807_add_shipping_category_to_spree_variants.rb +5 -0
- data/db/seeds.rb +4 -1
- data/lib/generators/solidus/install/app_templates/authentication/custom.rb +21 -0
- data/lib/generators/solidus/install/app_templates/authentication/devise.rb +16 -0
- data/lib/generators/solidus/install/app_templates/authentication/existing.rb +10 -0
- data/lib/generators/solidus/install/app_templates/authentication/none.rb +1 -0
- data/lib/generators/solidus/install/app_templates/frontend/break_down_solidus_gem.rb +54 -0
- data/lib/generators/solidus/install/app_templates/frontend/classic.rb +16 -0
- data/lib/generators/solidus/install/app_templates/frontend/none.rb +2 -0
- data/lib/generators/solidus/install/app_templates/frontend/starter.rb +3 -0
- data/lib/generators/solidus/install/app_templates/payment_method/bolt.rb +11 -9
- data/lib/generators/solidus/install/app_templates/payment_method/paypal.rb +8 -9
- data/lib/generators/solidus/install/install_generator.rb +213 -190
- data/lib/generators/solidus/install/templates/config/initializers/spree.rb.tt +3 -4
- data/lib/generators/solidus/update/update_generator.rb +2 -14
- data/lib/generators/spree/custom_user/custom_user_generator.rb +6 -4
- data/lib/generators/spree/custom_user/templates/authentication_helpers.rb.tt +2 -6
- data/lib/generators/spree/custom_user/templates/migration.rb.tt +7 -3
- data/lib/generators/spree/dummy/dummy_generator.rb +10 -8
- data/lib/generators/spree/dummy/templates/rails/database.yml +6 -12
- data/lib/spree/app_configuration.rb +23 -0
- data/lib/spree/bus.rb +3 -3
- data/lib/spree/core/controller_helpers/current_host.rb +5 -1
- data/lib/spree/core/product_duplicator.rb +1 -1
- data/lib/spree/core/search/base.rb +17 -8
- data/lib/spree/core/version.rb +2 -2
- data/lib/spree/core.rb +1 -20
- data/lib/spree/migration_helpers.rb +3 -3
- data/lib/spree/migrations.rb +12 -10
- data/lib/spree/permitted_attributes.rb +4 -1
- data/lib/spree/rails_compatibility.rb +0 -17
- data/lib/spree/testing_support/common_rake.rb +7 -6
- data/lib/spree/testing_support/dummy_app.rb +5 -5
- data/lib/spree/testing_support/factories/address_factory.rb +9 -11
- data/lib/spree/testing_support/factories/calculator_factory.rb +3 -0
- data/lib/spree/testing_support/factories/country_factory.rb +1 -2
- data/lib/spree/testing_support/factories/promotion_factory.rb +28 -14
- data/lib/spree/testing_support/factories/state_factory.rb +8 -2
- data/lib/spree/testing_support/factory_bot.rb +1 -1
- data/lib/spree/testing_support/order_walkthrough.rb +1 -1
- data/lib/tasks/colorado_delivery_fee.rake +28 -0
- data/solidus_core.gemspec +2 -2
- metadata +34 -23
- data/lib/generators/solidus/install/install_generator/bundler_context.rb +0 -105
- data/lib/generators/solidus/install/install_generator/install_frontend.rb +0 -61
- data/lib/generators/solidus/install/install_generator/support_solidus_frontend_extraction.rb +0 -48
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidus_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Solidus Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionmailer
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 7.1.x
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '6.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 7.1.x
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '6.0'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 7.1.x
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
49
|
+
version: '6.0'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 7.1.x
|
@@ -56,7 +56,7 @@ dependencies:
|
|
56
56
|
requirements:
|
57
57
|
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version: '
|
59
|
+
version: '6.0'
|
60
60
|
- - "<"
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 7.1.x
|
@@ -66,7 +66,7 @@ dependencies:
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
69
|
+
version: '6.0'
|
70
70
|
- - "<"
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: 7.1.x
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
requirements:
|
77
77
|
- - ">="
|
78
78
|
- !ruby/object:Gem::Version
|
79
|
-
version: '
|
79
|
+
version: '6.0'
|
80
80
|
- - "<"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 7.1.x
|
@@ -86,7 +86,7 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '6.0'
|
90
90
|
- - "<"
|
91
91
|
- !ruby/object:Gem::Version
|
92
92
|
version: 7.1.x
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
|
-
version: '
|
99
|
+
version: '6.0'
|
100
100
|
- - "<"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: 7.1.x
|
@@ -106,7 +106,7 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '6.0'
|
110
110
|
- - "<"
|
111
111
|
- !ruby/object:Gem::Version
|
112
112
|
version: 7.1.x
|
@@ -116,7 +116,7 @@ dependencies:
|
|
116
116
|
requirements:
|
117
117
|
- - ">="
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version: '
|
119
|
+
version: '6.0'
|
120
120
|
- - "<"
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: 7.1.x
|
@@ -126,7 +126,7 @@ dependencies:
|
|
126
126
|
requirements:
|
127
127
|
- - ">="
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version: '
|
129
|
+
version: '6.0'
|
130
130
|
- - "<"
|
131
131
|
- !ruby/object:Gem::Version
|
132
132
|
version: 7.1.x
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
requirements:
|
137
137
|
- - ">="
|
138
138
|
- !ruby/object:Gem::Version
|
139
|
-
version: '
|
139
|
+
version: '6.0'
|
140
140
|
- - "<"
|
141
141
|
- !ruby/object:Gem::Version
|
142
142
|
version: 7.1.x
|
@@ -146,7 +146,7 @@ dependencies:
|
|
146
146
|
requirements:
|
147
147
|
- - ">="
|
148
148
|
- !ruby/object:Gem::Version
|
149
|
-
version: '
|
149
|
+
version: '6.0'
|
150
150
|
- - "<"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: 7.1.x
|
@@ -156,7 +156,7 @@ dependencies:
|
|
156
156
|
requirements:
|
157
157
|
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version: '
|
159
|
+
version: '6.0'
|
160
160
|
- - "<"
|
161
161
|
- !ruby/object:Gem::Version
|
162
162
|
version: 7.1.x
|
@@ -166,7 +166,7 @@ dependencies:
|
|
166
166
|
requirements:
|
167
167
|
- - ">="
|
168
168
|
- !ruby/object:Gem::Version
|
169
|
-
version: '
|
169
|
+
version: '6.0'
|
170
170
|
- - "<"
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: 7.1.x
|
@@ -482,6 +482,7 @@ files:
|
|
482
482
|
- app/models/spree/calculator.rb
|
483
483
|
- app/models/spree/calculator/default_tax.rb
|
484
484
|
- app/models/spree/calculator/distributed_amount.rb
|
485
|
+
- app/models/spree/calculator/flat_fee.rb
|
485
486
|
- app/models/spree/calculator/flat_percent_item_total.rb
|
486
487
|
- app/models/spree/calculator/flat_rate.rb
|
487
488
|
- app/models/spree/calculator/flexi_rate.rb
|
@@ -552,6 +553,7 @@ files:
|
|
552
553
|
- app/models/spree/promotion/actions/create_item_adjustments.rb
|
553
554
|
- app/models/spree/promotion/actions/create_quantity_adjustments.rb
|
554
555
|
- app/models/spree/promotion/actions/free_shipping.rb
|
556
|
+
- app/models/spree/promotion/order_adjustments_recalculator.rb
|
555
557
|
- app/models/spree/promotion/rules/first_order.rb
|
556
558
|
- app/models/spree/promotion/rules/first_repeat_purchase_since.rb
|
557
559
|
- app/models/spree/promotion/rules/item_total.rb
|
@@ -654,6 +656,7 @@ files:
|
|
654
656
|
- app/models/spree/store_credit.rb
|
655
657
|
- app/models/spree/store_credit_category.rb
|
656
658
|
- app/models/spree/store_credit_event.rb
|
659
|
+
- app/models/spree/store_credit_prioritizer.rb
|
657
660
|
- app/models/spree/store_credit_reason.rb
|
658
661
|
- app/models/spree/store_credit_type.rb
|
659
662
|
- app/models/spree/store_payment_method.rb
|
@@ -763,14 +766,21 @@ files:
|
|
763
766
|
- db/migrate/20210122110141_add_name_to_spree_addresses.rb
|
764
767
|
- db/migrate/20210312061050_change_column_null_on_prices.rb
|
765
768
|
- db/migrate/20220317165036_set_promotions_with_any_policy_to_all_if_possible.rb
|
769
|
+
- db/migrate/20220805202442_add_level_to_spree_tax_rates.rb
|
770
|
+
- db/migrate/20221123152807_add_shipping_category_to_spree_variants.rb
|
766
771
|
- db/seeds.rb
|
772
|
+
- lib/generators/solidus/install/app_templates/authentication/custom.rb
|
773
|
+
- lib/generators/solidus/install/app_templates/authentication/devise.rb
|
774
|
+
- lib/generators/solidus/install/app_templates/authentication/existing.rb
|
775
|
+
- lib/generators/solidus/install/app_templates/authentication/none.rb
|
776
|
+
- lib/generators/solidus/install/app_templates/frontend/break_down_solidus_gem.rb
|
777
|
+
- lib/generators/solidus/install/app_templates/frontend/classic.rb
|
778
|
+
- lib/generators/solidus/install/app_templates/frontend/none.rb
|
779
|
+
- lib/generators/solidus/install/app_templates/frontend/starter.rb
|
767
780
|
- lib/generators/solidus/install/app_templates/payment_method/bolt.rb
|
768
781
|
- lib/generators/solidus/install/app_templates/payment_method/none.rb
|
769
782
|
- lib/generators/solidus/install/app_templates/payment_method/paypal.rb
|
770
783
|
- lib/generators/solidus/install/install_generator.rb
|
771
|
-
- lib/generators/solidus/install/install_generator/bundler_context.rb
|
772
|
-
- lib/generators/solidus/install/install_generator/install_frontend.rb
|
773
|
-
- lib/generators/solidus/install/install_generator/support_solidus_frontend_extraction.rb
|
774
784
|
- lib/generators/solidus/install/templates/config/initializers/spree.rb.tt
|
775
785
|
- lib/generators/solidus/install/templates/vendor/assets/javascripts/spree/backend/all.js
|
776
786
|
- lib/generators/solidus/install/templates/vendor/assets/stylesheets/spree/backend/all.css
|
@@ -973,6 +983,7 @@ files:
|
|
973
983
|
- lib/spree/testing_support/url_helpers.rb
|
974
984
|
- lib/spree/user_class_handle.rb
|
975
985
|
- lib/spree_core.rb
|
986
|
+
- lib/tasks/colorado_delivery_fee.rake
|
976
987
|
- lib/tasks/payment_method.rake
|
977
988
|
- lib/tasks/solidus/check_orders_with_invalid_email.rake
|
978
989
|
- lib/tasks/solidus/delete_prices_with_nil_amount.rake
|
@@ -1016,14 +1027,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1016
1027
|
requirements:
|
1017
1028
|
- - ">="
|
1018
1029
|
- !ruby/object:Gem::Version
|
1019
|
-
version: 2.
|
1030
|
+
version: 2.7.0
|
1020
1031
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1021
1032
|
requirements:
|
1022
1033
|
- - ">="
|
1023
1034
|
- !ruby/object:Gem::Version
|
1024
1035
|
version: 1.8.23
|
1025
1036
|
requirements: []
|
1026
|
-
rubygems_version: 3.
|
1037
|
+
rubygems_version: 3.3.26
|
1027
1038
|
signing_key:
|
1028
1039
|
specification_version: 4
|
1029
1040
|
summary: Essential models, mailers, and classes for the Solidus e-commerce project.
|
@@ -1,105 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Solidus
|
4
|
-
class InstallGenerator < Rails::Generators::AppBase
|
5
|
-
# Bundler context during the install process.
|
6
|
-
#
|
7
|
-
# This class gives access to information about the bundler context in which
|
8
|
-
# the install generator is run. I.e., which solidus components are present
|
9
|
-
# in the user's Gemfile. It also allows modifying the Gemfile to add or
|
10
|
-
# remove gems.
|
11
|
-
#
|
12
|
-
# @api private
|
13
|
-
class BundlerContext
|
14
|
-
# Write and remove into and from a Gemfile
|
15
|
-
#
|
16
|
-
# This custom injector fixes support for path, git and custom sources,
|
17
|
-
# which is missing in bundler's upstream injector for a dependency fetched
|
18
|
-
# with `Bundled.locked_gems.dependencies`.
|
19
|
-
#
|
20
|
-
# @api private
|
21
|
-
class InjectorWithPathSupport < Bundler::Injector
|
22
|
-
private def build_gem_lines(conservative_versioning)
|
23
|
-
@deps.map do |d|
|
24
|
-
name = d.name.dump
|
25
|
-
is_local = d.source.instance_of?(Bundler::Source::Path)
|
26
|
-
is_git = d.source.instance_of?(Bundler::Source::Git)
|
27
|
-
|
28
|
-
requirement = if is_local
|
29
|
-
", path: \"#{d.source.path}\""
|
30
|
-
elsif is_git
|
31
|
-
", git: \"#{d.git}\"".yield_self { |g| d.ref ? g + ", ref: \"#{d.ref}\"" : g }
|
32
|
-
elsif conservative_versioning
|
33
|
-
", \"#{conservative_version(@definition.specs[d.name][0])}\""
|
34
|
-
else
|
35
|
-
", #{d.requirement.as_list.map(&:dump).join(", ")}"
|
36
|
-
end
|
37
|
-
|
38
|
-
source = ", :source => \"#{d.source.remotes.join(",")}\"" unless is_local || is_git || d.source.nil?
|
39
|
-
|
40
|
-
%(gem #{name}#{requirement}#{source})
|
41
|
-
end.join("\n")
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
attr_reader :dependencies, :injector
|
46
|
-
|
47
|
-
def self.bundle_cleanly(&block)
|
48
|
-
Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&block) : Bundler.with_clean_env(&block)
|
49
|
-
end
|
50
|
-
|
51
|
-
def initialize
|
52
|
-
@dependencies = uncached_dependencies
|
53
|
-
@injector = InjectorWithPathSupport
|
54
|
-
end
|
55
|
-
|
56
|
-
def solidus_in_gemfile?
|
57
|
-
!solidus_dependency.nil?
|
58
|
-
end
|
59
|
-
|
60
|
-
def component_in_gemfile?(name)
|
61
|
-
!@dependencies["solidus_#{name}"].nil?
|
62
|
-
end
|
63
|
-
|
64
|
-
def break_down_components(components)
|
65
|
-
raise <<~MSG unless solidus_in_gemfile?
|
66
|
-
solidus meta gem needs to be present in the Gemfile to build the component dependency
|
67
|
-
MSG
|
68
|
-
|
69
|
-
@injector.inject(
|
70
|
-
components.map { |component| dependency_for_component(component) }
|
71
|
-
)
|
72
|
-
end
|
73
|
-
|
74
|
-
def remove(*args, **kwargs, &block)
|
75
|
-
@injector.remove(*args, **kwargs, &block)
|
76
|
-
end
|
77
|
-
|
78
|
-
private
|
79
|
-
|
80
|
-
def dependency_for_component(component)
|
81
|
-
Bundler::Dependency.new(
|
82
|
-
"solidus_#{component}",
|
83
|
-
solidus_dependency.requirement,
|
84
|
-
{
|
85
|
-
"source" => solidus_dependency.source,
|
86
|
-
"git" => solidus_dependency.source.try(:uri),
|
87
|
-
"ref" => solidus_dependency.source.try(:ref)
|
88
|
-
}
|
89
|
-
)
|
90
|
-
end
|
91
|
-
|
92
|
-
def solidus_dependency
|
93
|
-
@dependencies['solidus']
|
94
|
-
end
|
95
|
-
|
96
|
-
# We want to get the locked gems from `Bundler.definition.locked_gems`
|
97
|
-
# instead of `Bundler.locked_gems` so that the locked gems won't be
|
98
|
-
# memoized. See
|
99
|
-
# https://rubydoc.info/gems/bundler/2.3.22/Bundler.locked_gems.
|
100
|
-
def uncached_dependencies
|
101
|
-
Bundler.definition.locked_gems.dependencies
|
102
|
-
end
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
@@ -1,61 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Solidus
|
4
|
-
class InstallGenerator < Rails::Generators::AppBase
|
5
|
-
class InstallFrontend
|
6
|
-
attr_reader :bundler_context,
|
7
|
-
:generator_context
|
8
|
-
|
9
|
-
def initialize(bundler_context:, generator_context:)
|
10
|
-
@bundler_context = bundler_context
|
11
|
-
@generator_context = generator_context
|
12
|
-
end
|
13
|
-
|
14
|
-
def call(frontend)
|
15
|
-
case frontend
|
16
|
-
when 'solidus_frontend'
|
17
|
-
install_solidus_frontend
|
18
|
-
when 'solidus_starter_frontend'
|
19
|
-
install_solidus_starter_frontend
|
20
|
-
else
|
21
|
-
install_custom_frontend
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
private
|
26
|
-
|
27
|
-
def install_solidus_frontend
|
28
|
-
unless @bundler_context.component_in_gemfile?(:frontend)
|
29
|
-
# `Rails::Generator::AppBase#bundle_command` is protected so have to `send` it.
|
30
|
-
# See https://api.rubyonrails.org/v3.2.16/classes/Rails/Generators/AppBase.html#method-i-run_bundle
|
31
|
-
@generator_context.send :bundle_command, 'add solidus_frontend'
|
32
|
-
end
|
33
|
-
|
34
|
-
# Solidus bolt will be handled in the installer as a payment method.
|
35
|
-
begin
|
36
|
-
skip_solidus_bolt = ENV['SKIP_SOLIDUS_BOLT']
|
37
|
-
ENV['SKIP_SOLIDUS_BOLT'] = 'true'
|
38
|
-
@generator_context.generate("solidus_frontend:install #{@generator_context.options[:auto_accept] ? '--auto-accept' : ''}")
|
39
|
-
ensure
|
40
|
-
ENV['SKIP_SOLIDUS_BOLT'] = skip_solidus_bolt
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
def install_solidus_starter_frontend
|
45
|
-
remove_solidus_frontend
|
46
|
-
@generator_context.apply "https://raw.githubusercontent.com/solidusio/solidus_starter_frontend/v3.2/template.rb"
|
47
|
-
end
|
48
|
-
|
49
|
-
def install_custom_frontend
|
50
|
-
remove_solidus_frontend
|
51
|
-
@generator_context.apply ENV['FRONTEND'] or abort("Frontend installation failed.")
|
52
|
-
end
|
53
|
-
|
54
|
-
def remove_solidus_frontend
|
55
|
-
return unless @bundler_context.component_in_gemfile?(:frontend)
|
56
|
-
|
57
|
-
@bundler_context.remove(['solidus_frontend'])
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
data/lib/generators/solidus/install/install_generator/support_solidus_frontend_extraction.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Solidus
|
4
|
-
class InstallGenerator < Rails::Generators::AppBase
|
5
|
-
# Helper for extracting solidus_frontend from solidus meta-gem
|
6
|
-
#
|
7
|
-
# We're recommending users use newer solidus_starter_frontend. However,
|
8
|
-
# we're still shipping solidus_frontend as part of the solidus meta-gem. The
|
9
|
-
# reason is that we don't want users updating previous versions to see its
|
10
|
-
# storefront gone suddenly.
|
11
|
-
#
|
12
|
-
# In future solidus releases, solidus_frontend won't be a component anymore.
|
13
|
-
# However, until that happens:
|
14
|
-
#
|
15
|
-
# - For users of the new frontend, we need to prevent pulling
|
16
|
-
# solidus_frontend.
|
17
|
-
# - For users of the legacy frontend, we need to prevent Bundler from
|
18
|
-
# resolving it from the mono-repo while it's still there.
|
19
|
-
#
|
20
|
-
# This class is a needed companion during the deprecation
|
21
|
-
# path. It'll modify the user's Gemfile, breaking the solidus gem down into
|
22
|
-
# its components but solidus_frontend.
|
23
|
-
class SupportSolidusFrontendExtraction
|
24
|
-
attr_reader :bundler_context
|
25
|
-
|
26
|
-
def initialize(bundler_context:)
|
27
|
-
@bundler_context = bundler_context
|
28
|
-
end
|
29
|
-
|
30
|
-
def call
|
31
|
-
return unless needs_to_break_down_solidus_meta_gem?
|
32
|
-
|
33
|
-
break_down_solidus_meta_gem
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def break_down_solidus_meta_gem
|
39
|
-
@bundler_context.break_down_components(%w[core backend api sample])
|
40
|
-
@bundler_context.remove(['solidus'])
|
41
|
-
end
|
42
|
-
|
43
|
-
def needs_to_break_down_solidus_meta_gem?
|
44
|
-
@bundler_context.solidus_in_gemfile?
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|