Skip to content

Commit 1d97ab3

Browse files
author
Jonathan Tapia
committed
Add support for v4
1 parent 99d3c1b commit 1d97ab3

File tree

20 files changed

+230
-115
lines changed

20 files changed

+230
-115
lines changed

.circleci/config.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,40 @@ orbs:
1111
solidusio_extensions: solidusio/extensions@volatile
1212

1313
jobs:
14+
run-specs-with-sqlite:
15+
executor:
16+
name: solidusio_extensions/sqlite
17+
ruby_version: "3.0"
18+
steps:
19+
- browser-tools/install-chrome
20+
- solidusio_extensions/run-tests
1421
run-specs-with-postgres:
1522
executor:
1623
name: solidusio_extensions/postgres
17-
ruby_version: "3.2"
24+
ruby_version: "3.0"
1825
steps:
19-
- checkout
2026
- browser-tools/install-chrome
21-
- solidusio_extensions/run-tests-solidus-master
22-
- solidusio_extensions/store-test-results
23-
27+
- solidusio_extensions/run-tests
2428
run-specs-with-mysql:
2529
executor:
2630
name: solidusio_extensions/mysql
27-
ruby_version: "3.1"
28-
steps:
29-
- checkout
30-
- browser-tools/install-chrome
31-
- solidusio_extensions/run-tests-solidus-current
32-
- solidusio_extensions/store-test-results
33-
34-
run-specs-with-sqlite:
35-
executor:
36-
name: solidusio_extensions/sqlite
3731
ruby_version: "3.0"
3832
steps:
39-
- checkout
4033
- browser-tools/install-chrome
41-
- solidusio_extensions/run-tests-solidus-older
42-
- solidusio_extensions/store-test-results
43-
34+
- solidusio_extensions/run-tests
4435
lint-code:
45-
executor: solidusio_extensions/sqlite
36+
executor:
37+
name: solidusio_extensions/sqlite-memory
38+
ruby_version: "3.0"
4639
steps:
4740
- solidusio_extensions/lint-code
4841

4942
workflows:
5043
"Run specs on supported Solidus versions":
5144
jobs:
45+
- run-specs-with-sqlite
5246
- run-specs-with-postgres
5347
- run-specs-with-mysql
54-
- run-specs-with-sqlite
5548
- lint-code
5649

5750
"Weekly run specs against master":
@@ -63,6 +56,6 @@ workflows:
6356
only:
6457
- master
6558
jobs:
59+
- run-specs-with-sqlite
6660
- run-specs-with-postgres
6761
- run-specs-with-mysql
68-
- run-specs-with-sqlite

.github/stale.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1 @@
1-
# Number of days of inactivity before an issue becomes stale
2-
daysUntilStale: 60
3-
# Number of days of inactivity before a stale issue is closed
4-
daysUntilClose: 7
5-
# Issues with these labels will never be considered stale
6-
exemptLabels:
7-
- pinned
8-
- security
9-
# Label to use when marking an issue as stale
10-
staleLabel: wontfix
11-
# Comment to post when marking an issue as stale. Set to `false` to disable
12-
markComment: >
13-
This issue has been automatically marked as stale because it has not had
14-
recent activity. It will be closed if no further activity occurs. Thank you
15-
for your contributions.
16-
# Comment to post when closing a stale issue. Set to `false` to disable
17-
closeComment: false
1+
_extends: .github

.github_changelog_generator

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
issues=false
2+
exclude-labels=infrastructure

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ pkg
1515
spec/dummy
1616
spec/examples.txt
1717
.ruby-version
18+
Gemfile-local
19+
/sandbox
20+
.rvmrc
21+
.ruby-gemset

.rubocop.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,5 @@ inherit_from: .rubocop_todo.yml
33
require:
44
- solidus_dev_support/rubocop
55

6-
inherit_gem:
7-
solidus_dev_support: .rubocop.yml
8-
96
AllCops:
10-
Exclude:
11-
- spec/dummy/**/*
12-
- vendor/**/*
13-
14-
Rails/SkipsModelValidations:
15-
Exclude:
16-
- db/migrate/**/*
7+
NewCops: disable

Gemfile

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
source 'https://rubygems.org'
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
7-
solidus_git, solidus_frontend_git = if (branch == 'master') || (branch >= 'v3.2')
8-
%w[solidusio/solidus solidusio/solidus_frontend]
9-
else
10-
%w[solidusio/solidus] * 2
11-
end
12-
gem 'solidus', github: solidus_git, branch: branch
13-
gem 'solidus_frontend', github: solidus_frontend_git, branch: branch
6+
branch = ENV.fetch('SOLIDUS_BRANCH', 'main')
7+
gem 'solidus', github: 'solidusio/solidus', branch: branch
8+
9+
# The solidus_frontend gem has been pulled out since v3.2
10+
if branch >= 'v3.2'
11+
gem 'solidus_frontend'
12+
elsif branch == 'main'
13+
gem 'solidus_frontend', github: 'solidusio/solidus_frontend', branch: branch
14+
else
15+
gem 'solidus_frontend', github: 'solidusio/solidus', branch: branch
16+
end
1417

1518
# Needed to help Bundler figure out how to resolve dependencies,
1619
# otherwise it takes forever to resolve them.
@@ -19,9 +22,8 @@ gem 'rails', '>0.a'
1922

2023
# Provides basic authentication functionality for testing parts of your engine
2124
gem 'solidus_auth_devise'
22-
gem 'solidus_dev_support'
2325

24-
case ENV['DB']
26+
case ENV.fetch('DB', nil)
2527
when 'mysql'
2628
gem 'mysql2'
2729
when 'postgresql'
@@ -30,9 +32,26 @@ else
3032
gem 'sqlite3'
3133
end
3234

35+
group :development, :test do
36+
gem 'factory_bot', '> 4.10.0'
37+
gem 'pry-rails'
38+
end
39+
3340
group :test do
3441
gem 'rails-controller-testing'
3542
gem 'rspec-activemodel-mocks'
3643
end
3744

45+
# While we still support Ruby < 3 we need to workaround a limitation in
46+
# the 'async' gem that relies on the latest ruby, since RubyGems doesn't
47+
# resolve gems based on the required ruby version.
48+
gem 'async', '< 3' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')
49+
3850
gemspec
51+
52+
# Use a local Gemfile to include development dependencies that might not be
53+
# relevant for the project or for other contributors, e.g. pry-byebug.
54+
#
55+
# We use `send` instead of calling `eval_gemfile` to work around an issue with
56+
# how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
57+
send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require 'bundler/gem_tasks'
34
require 'solidus_dev_support/rake_tasks'
45
SolidusDevSupport::RakeTasks.install
56

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Placeholder manifest file.
2-
// the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/backend/all.js'
2+
// the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/backend/all.js'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Placeholder manifest file.
2-
// the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/frontend/all.js'
2+
// the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/frontend/all.js'

bin/rails

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
1-
#!/usr/bin/env ruby
2-
31
# frozen_string_literal: true
42

5-
app_root = 'spec/dummy'
3+
#!/usr/bin/env ruby
64

7-
unless File.exist? "#{app_root}/bin/rails"
8-
system "bin/rake", app_root or begin # rubocop:disable Style/AndOr
9-
warn "Automatic creation of the dummy app failed"
10-
exit 1
11-
end
5+
if %w[g generate].include? ARGV.first
6+
exec "#{__dir__}/rails-engine", *ARGV
7+
else
8+
exec "#{__dir__}/rails-sandbox", *ARGV
129
end
13-
14-
Dir.chdir app_root
15-
exec 'bin/rails', *ARGV

0 commit comments

Comments
 (0)