Skip to content

Commit

Permalink
merge master and fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Astr0surf3r committed Nov 1, 2024
2 parents 80f7728 + 39eeafb commit c399ad5
Show file tree
Hide file tree
Showing 410 changed files with 1,483 additions and 1,447 deletions.
82 changes: 59 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ executors:
parameters: &parameters
ruby:
type: string
default: "3.0"
default: "3.1"
working_directory: &workdir ~/solidus
environment: &environment
DEFAULT_MAX_WAIT_TIME: 10
Expand Down Expand Up @@ -160,23 +160,23 @@ commands:
ruby -v >> /tmp/.ruby-versions
gem --version >> /tmp/.gems-versions
bundle --version >> /tmp/.gems-versions
gem search -eq rails -v "~> 7" -v "< 7.2" >> /tmp/.gems-versions # get the latest rails from rubygems
gem search -eq rails -v "~> 7" -v "< 8.0" >> /tmp/.gems-versions # get the latest rails from rubygems
gem search -eq solidus >> /tmp/.gems-versions # get the latest solidus from rubygems
cat /tmp/.ruby-versions
cat /tmp/.gems-versions
- restore_cache:
keys:
- solidus-installer-v9-{{ checksum "/tmp/.ruby-versions" }}-{{ checksum "/tmp/.gems-versions" }}
- solidus-installer-v9-{{ checksum "/tmp/.ruby-versions" }}-
- solidus-installer-v11-{{ checksum "/tmp/.ruby-versions" }}-{{ checksum "/tmp/.gems-versions" }}
- solidus-installer-v11-{{ checksum "/tmp/.ruby-versions" }}-
- run:
name: "Prepare the rails application"
command: |
cd /tmp
test -d my_app || (gem install rails -v "< 7.1" && gem install solidus)
test -d my_app || (gem install rails -v "< 8.0" && gem install solidus)
test -d my_app || rails new my_app --skip-git
- save_cache:
key: solidus-installer-v9-{{ checksum "/tmp/.ruby-versions" }}-{{ checksum "/tmp/.gems-versions" }}
key: solidus-installer-v11-{{ checksum "/tmp/.ruby-versions" }}-{{ checksum "/tmp/.gems-versions" }}
paths:
- /tmp/my_app
- /home/circleci/.rubygems
Expand All @@ -192,10 +192,10 @@ commands:
parameters:
app_root:
type: string
default: '/tmp/my_app'
default: "/tmp/my_app"
path:
type: string
default: '/'
default: "/"
expected_text:
type: string

Expand Down Expand Up @@ -224,8 +224,8 @@ commands:
mkdir -p /tmp/dummy_extension
cd /tmp/dummy_extension
bundle init
bundle add rails -v "< 7.1" --skip-install
bundle add sqlite3 -v "~> 1.3" --skip-install
bundle add rails -v "< 8.0" --skip-install
bundle add sqlite3 -v "~> 2.0" --skip-install
test -n "<<parameters.extra_gems>>" && bundle add <<parameters.extra_gems>> --skip-install
bundle add solidus --path "$(ruby -e"puts File.expand_path ENV['CIRCLE_WORKING_DIRECTORY']")"
export LIB_NAME=set # dummy requireable file
Expand All @@ -240,7 +240,7 @@ jobs:
ESLINT_USE_FLAT_CONFIG: false
steps:
- checkout
- run: 'bundle install'
- run: "bundle install"
- run:
name: Check Ruby
command: "bin/rake lint:rb"
Expand Down Expand Up @@ -291,7 +291,7 @@ jobs:
default: postgres
ruby:
type: string
default: '3.2'
default: "3.2"
rails:
type: string
default: "7.1"
Expand Down Expand Up @@ -327,28 +327,28 @@ jobs:
default: postgres
ruby:
type: string
default: '3.2'
default: "3.2"
executor:
name: << parameters.database >>
ruby: << parameters.ruby >>
parallelism: 3
environment:
COVERAGE: 'true'
COVERAGE: "true"
COVERAGE_DIR: /tmp/coverage
DISABLE_ACTIVE_STORAGE: false
steps:
- setup
- run:
name: Setup Coverage Env Vars
command: |
echo 'export COVERAGE_FILE=/tmp/coverage/coverage.xml' >> $BASH_ENV
source $BASH_ENV
echo 'export COVERAGE_FILE=/tmp/coverage/coverage.xml' >> $BASH_ENV
source $BASH_ENV
- run:
name: Verify Coverage Env Vars
command: |
echo $COVERAGE
echo /tmp/coverage
echo /tmp/coverage/coverage.xml
echo $COVERAGE
echo /tmp/coverage
echo /tmp/coverage/coverage.xml
- run:
name: Setup Coverage Directory
command: mkdir -p /tmp/coverage
Expand All @@ -370,13 +370,49 @@ workflows:
# https://www.fastruby.io/blog/ruby/rails/versions/compatibility-table.html.
- test_solidus:
name: &name "test-rails-<<matrix.rails>>-ruby-<<matrix.ruby>>-<<matrix.database>>-<<#matrix.paperclip>>paperclip<</matrix.paperclip>><<^matrix.paperclip>>activestorage<</matrix.paperclip>>"
matrix: { parameters: { rails: ['7.0', '7.1'], ruby: ['3.0'], database: ['mysql'], paperclip: [true] } }
matrix:
{
parameters:
{
rails: ["7.0", "7.1", "7.2"],
ruby: ["3.1"],
database: ["mysql"],
paperclip: [true],
},
}
- test_solidus:
name: *name
matrix: { parameters: { rails: ['7.0', '7.1'], ruby: ['3.1'], database: ['postgres'], paperclip: [false] } }
matrix:
{
parameters:
{
rails: ["7.0", "7.1", "7.2"],
ruby: ["3.1"],
database: ["postgres"],
paperclip: [false],
},
}
- test_solidus:
name: *name
matrix: { parameters: { rails: ['7.0'], ruby: ['3.2'], database: ['sqlite'], paperclip: [false] } }
matrix:
{
parameters:
{
rails: ["7.1"],
ruby: ["3.2"],
database: ["sqlite"],
paperclip: [false],
},
}
- test_solidus:
name: *name
matrix: { parameters: { rails: ['7.1', 'main'], ruby: ['3.3.2'], database: ['sqlite'], paperclip: [false] } }
matrix:
{
parameters:
{
rails: ["7.2", "main"],
ruby: ["3.3.5"],
database: ["sqlite"],
paperclip: [false],
},
}
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
989ba2e74e49332d2281187d09a2dc7aad75922a
# Rubocop auto (Mar 8, 2018)
b3007bb0973dcb987b0328b4e59306cd2549148d
# Autocorrect circle/config.yml with prettier (Sep 12, 2024)
c636624093fec55e38f14cade4dee4ec0a829802
# Rubocop: Autocorrect (Sep 12, 2024)
273e5bd54e2b1783206043e316c2de4c9e95eb45
32 changes: 16 additions & 16 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require:

AllCops:
Exclude:
- '**/{tmp,vendor,spec/dummy,sandbox,templates,pkg}/**/*'
TargetRubyVersion: 3.0
- "**/{tmp,vendor,spec/dummy,sandbox,templates,pkg}/**/*"
TargetRubyVersion: 3.1
NewCops: disable
SuggestExtensions: false

Expand Down Expand Up @@ -121,7 +121,7 @@ Rails/DynamicFindBy:
# It's okay to skip model validations to setup a spec.
Rails/SkipsModelValidations:
Exclude:
- '*/spec/**/*'
- "*/spec/**/*"

# We use a lot of
#
Expand All @@ -132,15 +132,15 @@ Rails/SkipsModelValidations:
# syntax in the specs files.
Lint/AmbiguousBlockAssociation:
Exclude:
- '*/spec/**/*'
- 'spec/**/*' # For the benefit of apps that inherit from this config
- "*/spec/**/*"
- "spec/**/*" # For the benefit of apps that inherit from this config

# We use eval to add common_spree_dependencies into the Gemfiles of each of our gems
Security/Eval:
Exclude:
- 'Gemfile'
- 'common_spree_dependencies.rb'
- '*/Gemfile'
- "Gemfile"
- "common_spree_dependencies.rb"
- "*/Gemfile"

Naming/VariableNumber:
Enabled: false
Expand Down Expand Up @@ -306,10 +306,10 @@ Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always
Exclude:
- '*/lib/generators/**/*'
- '**/bin/**/*'
- '*/db/migrate/**/*'
- '*/config/importmap.rb'
- "*/lib/generators/**/*"
- "**/bin/**/*"
- "*/db/migrate/**/*"
- "*/config/importmap.rb"

# json.() is idiomatic in jbuilder files
Style/LambdaCall:
Expand All @@ -333,13 +333,13 @@ Lint/SuppressedException:

Lint/MissingSuper:
Exclude:
- '*/app/components/**/*' # components need pristine initializer methods
- 'core/lib/spree/deprecated_instance_variable_proxy.rb' # this is a known class that doesn't require super
- 'core/lib/spree/preferences/configuration.rb' # this class has no superclass defining `self.inherited`
- "*/app/components/**/*" # components need pristine initializer methods
- "core/lib/spree/deprecated_instance_variable_proxy.rb" # this is a known class that doesn't require super
- "core/lib/spree/preferences/configuration.rb" # this class has no superclass defining `self.inherited`

Rails/FindEach:
Exclude:
- 'db/migrate/**/*'
- "db/migrate/**/*"

# Since we're writing library code we can't assume that
# tasks should load the rails environment loaded.
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gemspec require: false
if /(stable|main)/.match? ENV['RAILS_VERSION']
gem 'rails', github: 'rails', require: false, branch: ENV['RAILS_VERSION']
else
gem 'rails', ENV['RAILS_VERSION'] || '< 7.2', require: false
gem 'rails', ENV['RAILS_VERSION'] || ['> 7.0', '< 8.0.0.beta1'], require: false
end
# rubocop:enable Bundler/DuplicatedGem

Expand Down
2 changes: 1 addition & 1 deletion admin/app/components/solidus_admin/base_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BaseComponent < ViewComponent::Base
include Turbo::FramesHelper

def icon_tag(name, **attrs)
render component("ui/icon").new(name: name, **attrs)
render component("ui/icon").new(name:, **attrs)
end

def missing_translation(key, options)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(user_label:, account_path:, logout_path:, logout_method:)
def locale_options_for_select(available_locales)
available_locales.map do |locale|
[
t("spree.i18n.this_file_language", locale: locale, default: locale.to_s, fallback: false),
t("spree.i18n.this_file_language", locale:, default: locale.to_s, fallback: false),
locale,
]
end.sort
Expand All @@ -27,7 +27,7 @@ def autosubmit_select_tag(name, options, icon:, &block)
block_given? ? capture(&block) : nil,
tag.label(safe_join([
icon_tag(icon, class: "w-full max-w-[20px] h-5 fill-current shrink"),
tag.select(options, name: name, onchange: "this.form.requestSubmit()", class: "w-full appearance-none grow bg-transparent outline-none"),
tag.select(options, name:, onchange: "this.form.requestSubmit()", class: "w-full appearance-none grow bg-transparent outline-none"),
icon_tag("expand-up-down-line", class: "w-full max-w-[20px] h-5 fill-current shrink"),
]), class: "flex gap-2 items-center px-2"),
])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def initialize(
@logo_path = logo_path
@items = items.map do |attrs|
children = attrs[:children].to_a.map { SolidusAdmin::MenuItem.new(**_1, top_level: false) }
SolidusAdmin::MenuItem.new(**attrs, children: children, top_level: true)
SolidusAdmin::MenuItem.new(**attrs, children:, top_level: true)
end
@store = store
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def state_column
'canceled' => :blue,
'cart' => :graphite_light,
}[order.state] || :yellow
component('ui/badge').new(name: order.state.humanize, color: color)
component('ui/badge').new(name: order.state.humanize, color:)
end
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(adjustment)
end

def call
render component("ui/thumbnail_with_caption").new(caption: caption, detail: detail) do
render component("ui/thumbnail_with_caption").new(caption:, detail:) do
thumbnail
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(adjustment)
end

def call
render component("ui/thumbnail_with_caption").new(icon: icon, caption: caption, detail: detail)
render component("ui/thumbnail_with_caption").new(icon:, caption:, detail:)
end

def caption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def self.from_product(product)
:unavailable
end

new(status: status)
new(status:)
end

def initialize(status:)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def stock_movements_column
count = stock_movement_counts[_1.id] || 0

link_to(
"#{count} #{Spree::StockMovement.model_name.human(count: count).downcase}",
"#{count} #{Spree::StockMovement.model_name.human(count:).downcase}",
spree.admin_stock_location_stock_movements_path(
_1.stock_location.id,
q: { variant_sku_eq: _1.variant.sku },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def columns
color = _1.active? ? :green : :graphite_light
text = _1.active? ? t('.active') : t('.inactive')

component('ui/badge').new(name: text, color: color)
component('ui/badge').new(name: text, color:)
},
},
{
Expand All @@ -78,7 +78,7 @@ def columns
count = _1.stock_movements.count

link_to(
"#{count} #{Spree::StockMovement.model_name.human(count: count).downcase}",
"#{count} #{Spree::StockMovement.model_name.human(count:).downcase}",
spree.admin_stock_location_stock_movements_path(_1),
class: 'body-link'
)
Expand Down
Loading

0 comments on commit c399ad5

Please sign in to comment.