Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e87997c

Browse files
committedNov 9, 2022
update solidus_dev_support setup
1 parent 23a21ed commit e87997c

File tree

4 files changed

+47
-78
lines changed

4 files changed

+47
-78
lines changed
 

β€Ž.circleci/config.yml

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
version: 2.1
22

33
orbs:
4+
# Required for feature specs.
5+
browser-tools: circleci/browser-tools@1.1
6+
47
# Always take the latest version of the orb, this allows us to
58
# run specs against Solidus supported versions only without the need
69
# to change this configuration every time a Solidus version is released
@@ -11,14 +14,17 @@ jobs:
1114
run-specs-with-postgres:
1215
executor: solidusio_extensions/postgres
1316
steps:
17+
- browser-tools/install-browser-tools
1418
- solidusio_extensions/run-tests
1519
run-specs-with-mysql:
1620
executor: solidusio_extensions/mysql
1721
steps:
22+
- browser-tools/install-browser-tools
1823
- solidusio_extensions/run-tests
1924
lint-code:
2025
executor: solidusio_extensions/sqlite-memory
2126
steps:
27+
- browser-tools/install-browser-tools
2228
- solidusio_extensions/lint-code
2329

2430
workflows:

β€Ž.rubocop.yml

+1-57
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,4 @@ require:
22
- solidus_dev_support/rubocop
33

44
AllCops:
5-
Exclude:
6-
- sandbox/**/*
7-
- spec/dummy/**/*
8-
- vendor/bundle/**/*
9-
10-
RSpec/DescribeClass:
11-
Enabled: false
12-
13-
Style/ClassAndModuleChildren:
14-
Enabled: false
15-
16-
Rails/ApplicationRecord:
17-
Enabled: false
18-
19-
RSpec/MessageSpies:
20-
Enabled: false
21-
22-
RSpec/MultipleExpectations:
23-
Enabled: false
24-
25-
RSpec/MultipleMemoizedHelpers:
26-
Max: 8
27-
28-
RSpec/NamedSubject:
29-
Enabled: false
30-
31-
Style/FrozenStringLiteralComment:
32-
Exclude:
33-
- spec/**/*
34-
- db/migrate/**/*
35-
- bin/**/*
36-
37-
RSpec/NestedGroups:
38-
Enabled: false
39-
40-
RSpec/VerifiedDoubles:
41-
IgnoreSymbolicNames: true
42-
43-
44-
# Enabled on 2020-09-08
45-
46-
Rails/ActiveRecordCallbacksOrder: {Enabled: true}
47-
Rails/AfterCommitOverride: {Enabled: true}
48-
Rails/FindById: {Enabled: true}
49-
Rails/Inquiry: {Enabled: true}
50-
Rails/MailerName: {Enabled: true}
51-
Rails/MatchRoute: {Enabled: true}
52-
Rails/NegateInclude: {Enabled: true}
53-
Rails/Pluck: {Enabled: true}
54-
Rails/PluckInWhere: {Enabled: true}
55-
Rails/RenderInline: {Enabled: true}
56-
Rails/RenderPlainText: {Enabled: true}
57-
Rails/ShortI18n: {Enabled: true}
58-
Rails/SquishedSQLHeredocs: {Enabled: true}
59-
Rails/WhereExists: {Enabled: true}
60-
Rails/WhereNot: {Enabled: true}
61-
Performance/Sum: {Enabled: true}
5+
NewCops: disable

β€ŽGemfile

+11-8
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ source 'https://rubygems.org'
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

66
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
7+
gem 'solidus', github: 'solidusio/solidus', branch: branch
8+
9+
# The solidus_frontend gem has been pulled out since v3.2
10+
gem 'solidus_frontend', github: 'solidusio/solidus_frontend' if branch == 'master'
11+
gem 'solidus_frontend' if branch >= 'v3.2' # rubocop:disable Bundler/DuplicatedGem
1412

1513
# Needed to help Bundler figure out how to resolve dependencies,
1614
# otherwise it takes forever to resolve them.
@@ -20,7 +18,7 @@ gem 'rails', '>0.a'
2018
# Provides basic authentication functionality for testing parts of your engine
2119
gem 'solidus_auth_devise'
2220

23-
case ENV['DB']
21+
case ENV.fetch('DB', nil)
2422
when 'mysql'
2523
gem 'mysql2'
2624
when 'postgresql'
@@ -35,6 +33,11 @@ gem 'dato', require: 'dato'
3533
gem 'prismic.io', require: 'prismic'
3634
gem 'solidus_static_content', github: 'solidusio-contrib/solidus_static_content'
3735

36+
# While we still support Ruby < 3 we need to workaround a limitation in
37+
# the 'async' gem that relies on the latest ruby, since RubyGems doesn't
38+
# resolve gems based on the required ruby version.
39+
gem 'async', '< 3' if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('3')
40+
3841
gemspec
3942

4043
# Use a local Gemfile to include development dependencies that might not be

β€Žbin/sandbox

+29-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22

33
set -e
4+
if [ ! -z $DEBUG ]
5+
then
6+
set -x
7+
fi
48

59
case "$DB" in
610
postgres|postgresql)
@@ -9,21 +13,36 @@ postgres|postgresql)
913
mysql)
1014
RAILSDB="mysql"
1115
;;
12-
sqlite|'')
16+
sqlite3|sqlite)
17+
RAILSDB="sqlite3"
18+
;;
19+
'')
20+
echo "~~> Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
1321
RAILSDB="sqlite3"
1422
;;
1523
*)
16-
echo "Invalid DB specified: $DB"
24+
echo "Invalid value specified for the Solidus sandbox: DB=\"$DB\"."
25+
echo "Please use 'postgres', 'mysql', or 'sqlite' instead."
1726
exit 1
1827
;;
1928
esac
29+
echo "~~> Using $RAILSDB as the database engine"
2030

21-
if [ ! -z $SOLIDUS_BRANCH ]
31+
if [ -n $SOLIDUS_BRANCH ]
2232
then
2333
BRANCH=$SOLIDUS_BRANCH
2434
else
35+
echo "~~> Use 'export SOLIDUS_BRANCH=[master|v3.2|...]' to control the Solidus branch"
2536
BRANCH="master"
2637
fi
38+
echo "~~> Using branch $BRANCH of solidus"
39+
40+
if [ -z $SOLIDUS_FRONTEND ]
41+
then
42+
echo "~~> Use 'export SOLIDUS_FRONTEND=[solidus_frontend|solidus_starter_frontend]' to control the Solidus frontend"
43+
SOLIDUS_FRONTEND="solidus_frontend"
44+
fi
45+
echo "~~> Using branch $SOLIDUS_FRONTEND as the solidus frontend"
2746

2847
extension_name="solidus_content"
2948

@@ -50,7 +69,6 @@ fi
5069
cd ./sandbox
5170
cat <<RUBY >> Gemfile
5271
gem 'solidus', github: 'solidusio/solidus', branch: '$BRANCH'
53-
gem 'solidus_auth_devise', '>= 2.1.0'
5472
gem 'rails-i18n'
5573
gem 'solidus_i18n'
5674
@@ -67,20 +85,18 @@ unbundled bundle install --gemfile Gemfile
6785

6886
unbundled bundle exec rake db:drop db:create
6987

70-
unbundled bundle exec rails generate spree:install \
88+
unbundled bundle exec rails generate solidus:install \
7189
--auto-accept \
7290
--user_class=Spree::User \
7391
--enforce_available_locales=true \
74-
--with-authentication=false \
75-
--payment-method=none
92+
--with-authentication=true \
93+
--payment-method=none \
94+
--frontend=${SOLIDUS_FRONTEND} \
7695
$@
7796

78-
unbundled bundle exec rails generate solidus:auth:install
79-
unbundled bundle exec rails generate ${extension_name}:install
97+
unbundled bundle exec rails generate solidus:auth:install --auto-run-migrations
98+
unbundled bundle exec rails generate ${extension_name}:install --auto-run-migrations
8099

81100
echo
82101
echo "πŸš€ Sandbox app successfully created for $extension_name!"
83-
echo "πŸš€ Using $RAILSDB and Solidus $BRANCH"
84-
echo "πŸš€ Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
85-
echo "πŸš€ Use 'export SOLIDUS_BRANCH=<BRANCH-NAME>' to control the Solidus version"
86-
echo "πŸš€ This app is intended for test purposes."
102+
echo "πŸ§ͺ This app is intended for test purposes."

0 commit comments

Comments
 (0)
Please sign in to comment.