solidus_frontend 3.1.6 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 459f3d85fb3d6fc2ec11d5cd0f07f7e5938ab2c00cf68c9edc7baab1890c3b41
4
- data.tar.gz: 5e5d99adcb4f93fdb90eb4b046240e2b4e9d00ec5caeeda1b59b9539d3857c63
3
+ metadata.gz: f67c5061f8988a3d113100333ec8abbfd7de24c16fdba135aebfe2a50bc768e0
4
+ data.tar.gz: e633ac0e75eb85a3867219bbad88cde3df31c6c5c2350c719a4796456f0a5377
5
5
  SHA512:
6
- metadata.gz: 7f2ac3eb2b2434c9b4d8a0a4b30217b1774f35d4a952630ba03da9adde5b7f0372e5f1d0a2449a6c8df13ba2a20e58caee79a93c3bd9927b61f1a9881b40d93e
7
- data.tar.gz: b3991ddd67b28633ca9b487ea5cacbe93e8cb077ddd891e00d291b68a18c26ef50d988cd8668fa040c86b52b61537185516bee21790f2bd3b349f792a0d53f3f
6
+ metadata.gz: 3655c61e63c543fc87f52c7e60668b16dd15271021edfa8e56b2dc8b75680ab9948640b49d4b075645209e3ecbf5e6d65b3bd35f4289a5efe2661954b5ef57cf
7
+ data.tar.gz: 91797462fb8db0768bdba595d3ad738222ccb65077f7fba0601240f10286d2ddbe4361a5bd172d0b51f9f146137f2fcd28524f0d8dfcd820f6b06d5db24ca2eb
@@ -0,0 +1,59 @@
1
+ version: 2.1
2
+
3
+ orbs:
4
+ browser-tools: circleci/browser-tools@1.3
5
+
6
+ # Always take the latest version of the orb, this allows us to
7
+ # run specs against Solidus supported versions only without the need
8
+ # to change this configuration every time a Solidus version is released
9
+ # or goes EOL.
10
+ solidusio_extensions: solidusio/extensions@volatile
11
+
12
+ commands:
13
+ libvips:
14
+ steps:
15
+ - run:
16
+ name: Install libvips
17
+ command: sudo apt-get install -y libvips
18
+
19
+ jobs:
20
+ run-specs-with-postgres:
21
+ executor: solidusio_extensions/postgres
22
+ steps:
23
+ - checkout
24
+ - browser-tools/install-chrome
25
+ - browser-tools/install-chromedriver
26
+ - libvips
27
+ - solidusio_extensions/run-tests-solidus-master
28
+ - solidusio_extensions/store-test-results
29
+ run-specs-with-mysql:
30
+ executor: solidusio_extensions/mysql
31
+ steps:
32
+ - checkout
33
+ - browser-tools/install-chrome
34
+ - browser-tools/install-chromedriver
35
+ - libvips
36
+ - solidusio_extensions/run-tests-solidus-master
37
+ - solidusio_extensions/store-test-results
38
+ lint-code:
39
+ executor: solidusio_extensions/sqlite-memory
40
+ steps:
41
+ - solidusio_extensions/lint-code
42
+
43
+ workflows:
44
+ "Run specs on supported Solidus versions":
45
+ jobs:
46
+ - run-specs-with-postgres
47
+ - run-specs-with-mysql
48
+
49
+ "Weekly run specs against master":
50
+ triggers:
51
+ - schedule:
52
+ cron: "0 0 * * 4" # every Thursday
53
+ filters:
54
+ branches:
55
+ only:
56
+ - master
57
+ jobs:
58
+ - run-specs-with-postgres
59
+ - run-specs-with-mysql
@@ -0,0 +1 @@
1
+ \set HISTFILE ~/history/psql_history
@@ -0,0 +1,58 @@
1
+ ARG RUBY_VERSION
2
+ FROM ruby:$RUBY_VERSION-slim-buster
3
+
4
+ ARG PG_VERSION
5
+ ARG MYSQL_VERSION
6
+ ARG NODE_VERSION
7
+ ARG BUNDLER_VERSION
8
+
9
+ RUN apt-get update -qq \
10
+ && DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
11
+ build-essential \
12
+ gnupg2 \
13
+ curl \
14
+ git \
15
+ imagemagick \
16
+ libvips \
17
+ libmariadb-dev \
18
+ sqlite3 \
19
+ libsqlite3-dev \
20
+ chromium \
21
+ chromium-driver \
22
+ && rm -rf /var/cache/apt/lists/*
23
+
24
+ RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
25
+ && echo 'deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main' $PG_VERSION > /etc/apt/sources.list.d/pgdg.list
26
+
27
+ RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 467b942d3a79bd29 \
28
+ && echo "deb http://repo.mysql.com/apt/debian/ buster mysql-"$MYSQL_VERSION > /etc/apt/sources.list.d/mysql.list
29
+
30
+ RUN curl -sSL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
31
+
32
+ RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \
33
+ DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
34
+ libpq-dev \
35
+ postgresql-client-$PG_VERSION \
36
+ mysql-client \
37
+ nodejs \
38
+ && rm -rf /var/lib/apt/lists/*
39
+
40
+ ENV APP_USER=solidus_user \
41
+ LANG=C.UTF-8 \
42
+ BUNDLE_JOBS=4 \
43
+ BUNDLE_RETRY=3
44
+ ENV GEM_HOME=/home/$APP_USER/gems
45
+ ENV APP_HOME=/home/$APP_USER/app
46
+ ENV PATH=$PATH:$GEM_HOME/bin
47
+
48
+ RUN useradd -ms /bin/bash $APP_USER
49
+
50
+ RUN gem update --system \
51
+ && gem install bundler:$BUNDLER_VERSION \
52
+ && chown -R $APP_USER:$(id -g $APP_USER) /home/$APP_USER/gems
53
+
54
+ USER $APP_USER
55
+
56
+ RUN mkdir -p /home/$APP_USER/history
57
+
58
+ WORKDIR /home/$APP_USER/app
data/.gem_release.yml ADDED
@@ -0,0 +1,5 @@
1
+ bump:
2
+ recurse: false
3
+ file: 'lib/spree/frontend/version.rb'
4
+ message: Bump SolidusFrontend to %{version}
5
+ tag: true
data/.github/stale.yml ADDED
@@ -0,0 +1,17 @@
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: false
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: stale
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 might 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
@@ -0,0 +1,2 @@
1
+ issues=false
2
+ exclude-labels=infrastructure
data/.gitignore ADDED
@@ -0,0 +1,21 @@
1
+ *.gem
2
+ \#*
3
+ *~
4
+ .#*
5
+ .DS_Store
6
+ .idea
7
+ .project
8
+ .sass-cache
9
+ coverage
10
+ Gemfile.lock
11
+ Gemfile-local
12
+ tmp
13
+ nbproject
14
+ pkg
15
+ *.swp
16
+ spec/dummy
17
+ spec/examples.txt
18
+ /sandbox
19
+ .rvmrc
20
+ .ruby-version
21
+ .ruby-gemset
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ require:
2
+ - solidus_dev_support/rubocop
3
+
4
+ AllCops:
5
+ NewCops: disable
data/CHANGELOG.md ADDED
@@ -0,0 +1,7 @@
1
+ # Changelog
2
+
3
+ ## Solidus 3.2.0 (v3.2, 2022-08-18)
4
+
5
+ - Initial release from the standalone repository. See [Solidus'
6
+ CHANGELOG](https://github.com/solidusio/solidus/blob/master/CHANGELOG.md) for
7
+ previous updates.
data/Gemfile ADDED
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ branch = ENV.fetch('SOLIDUS_BRANCH', 'master')
6
+
7
+ git "https://github.com/solidusio/solidus.git", branch: branch do
8
+ gem 'solidus_api'
9
+ gem 'solidus_core'
10
+ end
11
+
12
+ gem 'rails', ENV.fetch('RAILS_VERSION', nil)
13
+
14
+ # Temporarily locking sprockets to v3.x
15
+ # see https://github.com/solidusio/solidus/issues/3374
16
+ # and https://github.com/rails/sprockets-rails/issues/369
17
+ gem 'sprockets', '~> 3'
18
+
19
+ case ENV['DB']
20
+ when 'mysql'
21
+ gem 'mysql2'
22
+ when 'postgresql'
23
+ gem 'pg'
24
+ else
25
+ gem 'sqlite3'
26
+ end
27
+
28
+ gemspec
29
+
30
+ # Use a local Gemfile to include development dependencies that might not be
31
+ # relevant for the project or for other contributors, e.g. pry-byebug.
32
+ #
33
+ # We use `send` instead of calling `eval_gemfile` to work around an issue with
34
+ # how Dependabot parses projects: https://github.com/dependabot/dependabot-core/issues/1658.
35
+ send(:eval_gemfile, 'Gemfile-local') if File.exist? 'Gemfile-local'
data/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Frontend contains controllers and views implementing a storefront and cart for Solidus.
4
4
 
5
+ ## Warning
6
+
7
+ For new Solidus apps, we recommend that you use
8
+ [SolidusStarterFrontend](https://github.com/solidusio/solidus_starter_frontend)
9
+ instead.
10
+
5
11
  ## Override views
6
12
 
7
13
  In order to customize a view you should copy the file into your host app. Using Deface is not
@@ -33,10 +39,169 @@ This will copy all views whose directory or filename contains the string "produc
33
39
 
34
40
  After upgrading Solidus to a new version run the generator again and follow on screen instructions.
35
41
 
36
- ## Testing
42
+ ## Developing Solidus Frontend
43
+
44
+ * Clone the Git repo
45
+
46
+ ```bash
47
+ git clone git://github.com/solidusio/solidus_frontend.git
48
+ cd solidus
49
+ ```
50
+
51
+ ### Without Docker
52
+
53
+ * Install the gem dependencies
54
+
55
+ ```bash
56
+ bin/setup
57
+ ```
58
+
59
+ _Note_: If you're using PostgreSQL or MySQL, you'll need to install those gems through the DB environment variable.
60
+
61
+ ```bash
62
+ # PostgreSQL
63
+ export DB=postgresql
64
+ bin/setup
65
+
66
+ # MySQL
67
+ export DB=mysql
68
+ bin/setup
69
+ ```
70
+
71
+ ### With Docker
72
+
73
+ ```bash
74
+ docker-compose up -d
75
+ ```
76
+
77
+ Wait for all the gems to be installed (progress can be checked through `docker-compose logs -f app`).
78
+
79
+ You can provide the ruby version you want your image to use:
80
+
81
+ ```bash
82
+ docker-compose build --build-arg RUBY_VERSION=2.6 app
83
+ docker-compose up -d
84
+ ```
85
+
86
+ The rails version can be customized at runtime through `RAILS_VERSION` environment variable:
87
+
88
+ ```bash
89
+ RAILS_VERSION='~> 5.0' docker-compose up -d
90
+ ```
91
+
92
+ Running tests:
93
+
94
+ ```bash
95
+ # sqlite
96
+ docker-compose exec app bundle exec rspec
97
+ # postgres
98
+ docker-compose exec app env DB=postgres bundle exec rspec
99
+ # mysql
100
+ docker-compose exec app env DB=mysql bundle exec rspec
101
+ ```
102
+
103
+ Accessing the databases:
104
+
105
+ ```bash
106
+ # sqlite
107
+ docker-compose exec app sqlite3 /path/to/db
108
+ # postgres
109
+ docker-compose exec app env PGPASSWORD=password psql -U root -h postgres
110
+ # mysql
111
+ docker-compose exec app mysql -u root -h mysql -ppassword
112
+ ```
113
+
114
+ In order to be able to access the [sandbox application](#sandbox), just make
115
+ sure to provide the appropriate `--binding` option to `rails server`. By
116
+ default, port `3000` is exposed, but you can change it through `SANDBOX_PORT`
117
+ environment variable:
118
+
119
+ ```bash
120
+ SANDBOX_PORT=4000 docker-compose up -d
121
+ docker-compose exec app bin/sandbox
122
+ docker-compose exec app bin/rails server --binding 0.0.0.0 --port 4000
123
+ ```
124
+
125
+ ### Sandbox
126
+
127
+ Solidus is meant to be run within the context of Rails application. You can
128
+ easily create a sandbox application inside of your cloned source directory for
129
+ testing purposes.
130
+
131
+ This sandbox includes solidus\_auth\_devise and generates with seed and sample
132
+ data already loaded.
133
+
134
+ * Create the sandbox application
135
+
136
+ ```bash
137
+ bin/sandbox
138
+ ```
139
+
140
+ You can create a sandbox with PostgreSQL or MySQL by setting the DB environment variable.
141
+
142
+ ```bash
143
+ # PostgreSQL
144
+ export DB=postgresql
145
+ bin/sandbox
146
+
147
+ # MySQL
148
+ export DB=mysql
149
+ bin/sandbox
150
+ ```
151
+
152
+ If you need to create a Rails 5.2 application for your sandbox, for example
153
+ if you are still using Ruby 2.4 which is not supported by Rails 6, you can
154
+ use the `RAILS_VERSION` environment variable.
155
+
156
+ ```bash
157
+ export RAILS_VERSION='~> 5.2.0'
158
+ bin/setup
159
+ bin/sandbox
160
+ ```
161
+
162
+ * Start the server (`bin/rails` will forward any argument to the sandbox)
163
+
164
+ ```bash
165
+ bin/rails server
166
+ ```
167
+
168
+ ### Tests
169
+
170
+ Solidus uses [RSpec](http://rspec.info) for tests. Refer to its documentation for
171
+ more information about the testing library.
172
+
173
+ #### CircleCI
174
+
175
+ We use CircleCI to run the tests for Solidus as well as all incoming pull
176
+ requests. All pull requests must pass to be merged.
177
+
178
+ You can see the build statuses at
179
+ [https://circleci.com/gh/solidusio/solidus_frontend](https://circleci.com/gh/solidusio/solidus_frontend).
180
+
181
+ #### Run all tests
182
+
183
+ [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home) is
184
+ required to run the frontend suites.
37
185
 
38
186
  Run the tests
39
187
 
40
188
  ```bash
41
189
  bundle exec rspec
42
190
  ```
191
+
192
+ By default, `rspec` runs the tests for SQLite 3. If you would like to run specs
193
+ against another database you may specify the database in the command:
194
+
195
+ ```bash
196
+ env DB=postgresql bundle exec rspec
197
+ ```
198
+
199
+ #### Code coverage reports
200
+
201
+ If you want to run the [SimpleCov](https://github.com/colszowka/simplecov) code
202
+ coverage report:
203
+
204
+ ```bash
205
+ COVERAGE=true bundle exec rspec
206
+ ```
207
+
data/Rakefile CHANGED
@@ -1,17 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rubygems'
4
- require 'rake'
5
- require 'rake/testtask'
6
- require 'rspec/core/rake_task'
7
3
  require 'spree/testing_support/dummy_app/rake_tasks'
8
-
9
- RSpec::Core::RakeTask.new
10
- task default: :spec
4
+ require 'solidus_dev_support/rake_tasks'
11
5
 
12
6
  DummyApp::RakeTasks.new(
13
7
  gem_root: File.expand_path(__dir__),
14
8
  lib_name: 'solidus_frontend'
15
9
  )
16
10
 
17
- task test_app: 'db:reset'
11
+ SolidusDevSupport::RakeTasks.install
12
+
13
+ task default: 'extension:specs'
@@ -207,8 +207,8 @@ module Spree
207
207
  end
208
208
  end
209
209
 
210
- if try_spree_current_user && try_spree_current_user.respond_to?(:wallet)
211
- @wallet_payment_sources = try_spree_current_user.wallet.wallet_payment_sources
210
+ if spree_current_user&.respond_to?(:wallet)
211
+ @wallet_payment_sources = spree_current_user.wallet.wallet_payment_sources
212
212
  @default_wallet_payment_source = @wallet_payment_sources.detect(&:default) ||
213
213
  @wallet_payment_sources.first
214
214
  end
@@ -230,7 +230,7 @@ module Spree
230
230
  flash[:error] = I18n.t('spree.insufficient_stock_for_order')
231
231
  redirect_to cart_path
232
232
  else
233
- availability_validator = Spree::Stock::AvailabilityValidator.new
233
+ availability_validator = Spree::Config.stock.availability_validator_class.new
234
234
  unavailable_items = @order.line_items.reject { |line_item| availability_validator.validate(line_item) }
235
235
  if unavailable_items.any?
236
236
  item_names = unavailable_items.map(&:name).to_sentence
@@ -37,7 +37,7 @@ module Spree
37
37
  end
38
38
 
39
39
  def load_product
40
- if try_spree_current_user.try(:has_spree_role?, "admin")
40
+ if spree_current_user.try(:has_spree_role?, "admin")
41
41
  @products = Spree::Product.with_discarded
42
42
  else
43
43
  @products = Spree::Product.available
@@ -23,10 +23,10 @@
23
23
 
24
24
  <div class="form-buttons" data-hook="buttons">
25
25
  <%= submit_tag t('spree.save_and_continue'), class: 'continue button primary' %>
26
- <% if try_spree_current_user %>
26
+ <% if spree_current_user %>
27
27
  <span data-hook="save_user_address">
28
28
  &nbsp; &nbsp;
29
- <%= check_box_tag 'save_user_address', '1', try_spree_current_user.respond_to?(:persist_order_address) %>
29
+ <%= check_box_tag 'save_user_address', '1', spree_current_user.respond_to?(:persist_order_address) %>
30
30
  <%= label_tag :save_user_address, t('spree.save_my_address') %>
31
31
  </span>
32
32
  <% end %>
@@ -13,7 +13,7 @@
13
13
  <p data-hook="links">
14
14
  <%= link_to t('spree.back_to_store'), spree.root_path, class: "button" %>
15
15
  <% unless order_just_completed?(@order) %>
16
- <% if try_spree_current_user && respond_to?(:account_path) %>
16
+ <% if spree_current_user && respond_to?(:account_path) %>
17
17
  <%= link_to t('spree.my_account'), spree.account_path, class: "button" %>
18
18
  <% end %>
19
19
  <% end %>
@@ -1,7 +1,8 @@
1
1
  <nav id="top-nav-bar" class="columns ten">
2
2
  <ul id="nav-bar" class="inline" data-hook>
3
3
  <%= render 'spree/shared/locale_selector' %>
4
- <%= render 'spree/shared/login_bar_items' %>
4
+ <%# solidus_auth_devise or a custom auth system can replace this partial %>
5
+ <%= render 'spree/shared/login_bar_items' if lookup_context.exists?('spree/shared/_login_bar_items') %>
5
6
  <li id="search-bar" data-hook>
6
7
  <%= render partial: 'spree/shared/search' %>
7
8
  </li>
data/bin/console ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require "bundler/setup"
6
+ require "solidus_frontend"
7
+
8
+ # You can add fixtures and/or initialization code here to make experimenting
9
+ # with your gem easier. You can also use a different console, if you like.
10
+ $LOAD_PATH.unshift(*Dir["#{__dir__}/../app/*"])
11
+
12
+ # (If you use this, don't forget to add pry to your Gemfile!)
13
+ # require "pry"
14
+ # Pry.start
15
+
16
+ require "irb"
17
+ IRB.start(__FILE__)
data/bin/rails ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if %w[g generate].include? ARGV.first
4
+ exec "#{__dir__}/rails-engine", *ARGV
5
+ else
6
+ exec "#{__dir__}/rails-sandbox", *ARGV
7
+ end
data/bin/rails-engine ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails gems
3
+ # installed from the root of your application.
4
+
5
+ ENGINE_ROOT = File.expand_path('..', __dir__)
6
+ ENGINE_PATH = File.expand_path('../lib/solidus_frontend/engine', __dir__)
7
+
8
+ # Set up gems listed in the Gemfile.
9
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
10
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
11
+
12
+ require 'rails/all'
13
+ require 'rails/engine/commands'
data/bin/rails-sandbox ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ app_root = 'sandbox'
4
+
5
+ unless File.exist? "#{app_root}/bin/rails"
6
+ warn 'Creating the sandbox app...'
7
+ Dir.chdir "#{__dir__}/.." do
8
+ system "#{__dir__}/sandbox" or begin
9
+ warn 'Automatic creation of the sandbox app failed'
10
+ exit 1
11
+ end
12
+ end
13
+ end
14
+
15
+ Dir.chdir app_root
16
+ exec 'bin/rails', *ARGV
data/bin/rake ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "rubygems"
5
+ require "bundler/setup"
6
+
7
+ load Gem.bin_path("rake", "rake")
data/bin/sandbox ADDED
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set -e
4
+
5
+ case "$DB" in
6
+ postgres|postgresql)
7
+ RAILSDB="postgresql"
8
+ ;;
9
+ mysql)
10
+ RAILSDB="mysql"
11
+ ;;
12
+ sqlite|'')
13
+ RAILSDB="sqlite3"
14
+ ;;
15
+ *)
16
+ echo "Invalid DB specified: $DB"
17
+ exit 1
18
+ ;;
19
+ esac
20
+
21
+ if [ ! -z $SOLIDUS_BRANCH ]
22
+ then
23
+ BRANCH=$SOLIDUS_BRANCH
24
+ else
25
+ BRANCH="master"
26
+ fi
27
+
28
+ extension_name="solidus_frontend"
29
+
30
+ # Stay away from the bundler env of the containing extension.
31
+ function unbundled {
32
+ ruby -rbundler -e'b = proc {system *ARGV}; Bundler.respond_to?(:with_unbundled_env) ? Bundler.with_unbundled_env(&b) : Bundler.with_clean_env(&b)' -- $@
33
+ }
34
+
35
+ rm -rf ./sandbox
36
+ unbundled bundle exec rails new sandbox --database="$RAILSDB" \
37
+ --skip-bundle \
38
+ --skip-git \
39
+ --skip-keeps \
40
+ --skip-rc \
41
+ --skip-spring \
42
+ --skip-test \
43
+ --skip-javascript
44
+
45
+ if [ ! -d "sandbox" ]; then
46
+ echo 'sandbox rails application failed'
47
+ exit 1
48
+ fi
49
+
50
+ cd ./sandbox
51
+ cat <<RUBY >> Gemfile
52
+ gem 'solidus_api', github: 'solidusio/solidus', branch: '$BRANCH', glob: '**/*.gemspec'
53
+ gem 'solidus_backend', github: 'solidusio/solidus', branch: '$BRANCH', glob: '**/*.gemspec'
54
+ gem 'solidus_core', github: 'solidusio/solidus', branch: '$BRANCH', glob: '**/*.gemspec'
55
+ gem 'solidus_sample', github: 'solidusio/solidus', branch: '$BRANCH', glob: '**/*.gemspec'
56
+
57
+ gem '$extension_name', path: '..'
58
+
59
+ gem 'solidus_auth_devise', '>= 2.1.0'
60
+ gem 'rails-i18n'
61
+ gem 'solidus_i18n'
62
+
63
+ group :test, :development do
64
+ platforms :mri do
65
+ gem 'pry-byebug'
66
+ end
67
+ end
68
+ RUBY
69
+
70
+ unbundled bundle install --gemfile Gemfile
71
+
72
+ unbundled bundle exec rake db:drop db:create
73
+
74
+ unbundled bundle exec rails generate solidus:install \
75
+ --auto-accept \
76
+ --user_class=Spree::User \
77
+ --enforce_available_locales=true \
78
+ --with-authentication=false \
79
+ --payment-method=none \
80
+ $@
81
+
82
+ unbundled bundle exec rails generate solidus:auth:install
83
+ unbundled bundle exec rails generate ${extension_name}:install
84
+
85
+ echo
86
+ echo "🚀 Sandbox app successfully created for $extension_name!"
87
+ echo "🚀 Using $RAILSDB and Solidus $BRANCH"
88
+ echo "🚀 Use 'export DB=[postgres|mysql|sqlite]' to control the DB adapter"
89
+ echo "🚀 Use 'export SOLIDUS_BRANCH=<BRANCH-NAME>' to control the Solidus version"
90
+ echo "🚀 This app is intended for test purposes."
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ gem install bundler --conservative
7
+ bundle update
8
+ bin/rake clobber
@@ -0,0 +1,63 @@
1
+ version: '3.7'
2
+
3
+ services:
4
+ mysql:
5
+ image: mysql:8.0
6
+ command: --default-authentication-plugin=mysql_native_password
7
+ environment:
8
+ MYSQL_ROOT_PASSWORD: password
9
+ volumes:
10
+ - mysql:/var/lib/mysql:cached
11
+
12
+ postgres:
13
+ image: postgres:13.2
14
+ environment:
15
+ POSTGRES_USER: root
16
+ POSTGRES_PASSWORD: password
17
+ volumes:
18
+ - postgres:/var/lib/postgresql/data:cached
19
+
20
+ app:
21
+ build:
22
+ context: .dockerdev
23
+ dockerfile: Dockerfile
24
+ args:
25
+ RUBY_VERSION: "3.1"
26
+ PG_VERSION: 13
27
+ NODE_VERSION: 14
28
+ MYSQL_VERSION: "8.0"
29
+ BUNDLER_VERSION: 2
30
+ image: solidus-3.2.0
31
+ command: bash -c "(bundle check || bundle) && bash -c 'echo Container initialized, see README.md for further steps.' && tail -f /dev/null"
32
+ environment:
33
+ CAPYBARA_DRIVER: selenium_chrome_headless_docker_friendly
34
+ DB_USERNAME: root
35
+ DB_PASSWORD: password
36
+ RAILS_VERSION: ${RAILS_VERSION:-~> 7.0.2}
37
+ DB_ALL: "1"
38
+ DB_MYSQL_HOST: mysql
39
+ DB_POSTGRES_HOST: postgres
40
+ HISTFILE: "/home/solidus_user/history/bash_history"
41
+ MYSQL_HISTFILE: "/home/solidus_user/history/mysql_history"
42
+ RAILS_ENV: development
43
+ ACTIVE_STORAGE_VARIANT_PROCESSOR: "vips"
44
+ ports:
45
+ - "${SANDBOX_PORT:-3000}:${SANDBOX_PORT:-3000}"
46
+ volumes:
47
+ - .:/home/solidus_user/app:delegated
48
+ - bundle:/home/solidus_user/gems:cached
49
+ - history:/home/solidus_user/history:cached
50
+ - .dockerdev/.psqlrc:/home/solidus_user/.psqlrc:cached
51
+ tty: true
52
+ stdin_open: true
53
+ tmpfs:
54
+ - /tmp
55
+ depends_on:
56
+ - mysql
57
+ - postgres
58
+
59
+ volumes:
60
+ bundle:
61
+ history:
62
+ postgres:
63
+ mysql:
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module SolidusFrontend
4
+ module Generators
5
+ class InstallGenerator < Rails::Generators::Base
6
+ source_root File.expand_path('templates', __dir__)
7
+
8
+ def copy_initializer
9
+ template 'initializer.rb', 'config/initializers/solidus_frontend.rb'
10
+ end
11
+
12
+ def setup_assets
13
+ empty_directory 'app/assets/images'
14
+
15
+ %w{javascripts stylesheets images}.each do |path|
16
+ empty_directory "vendor/assets/#{path}/spree/frontend"
17
+ end
18
+
19
+ template "vendor/assets/javascripts/spree/frontend/all.js"
20
+ template "vendor/assets/stylesheets/spree/frontend/all.css"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Warning: frontend is still part of the Solidus meta-gem. Make sure to enable
4
+ # these configurations only if they haven't been enabled in the `spree.rb`
5
+ # initializer.
6
+
7
+ # Spree.config do |config|
8
+ # # Frontend:
9
+
10
+ # Custom logo for the frontend
11
+ # config.logo = "logo/solidus.svg"
12
+
13
+ # Template to use when rendering layout
14
+ # config.layout = "spree/layouts/spree_application"
15
+ # end
16
+
17
+ # Spree::Frontend::Config.configure do |config|
18
+ # config.locale = 'en'
19
+ # end
@@ -0,0 +1,10 @@
1
+ // This is a manifest file that'll be compiled into including all the files listed below.
2
+ // Add new JavaScript code in separate files in this directory and they'll automatically
3
+ // be included in the compiled file accessible from http://example.com/assets/application.js
4
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
+ // the compiled file.
6
+ //
7
+ //= require jquery3
8
+ //= require rails-ujs
9
+ //= require spree/frontend
10
+ //= require_tree .
@@ -0,0 +1,9 @@
1
+ /*
2
+ * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
+ * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
+ * the top of the compiled file, but it's generally better to create a new file per style scope.
5
+ *
6
+ *= require spree/frontend
7
+ *= require_self
8
+ *= require_tree .
9
+ */
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spree
4
+ module Frontend
5
+ VERSION = "3.2.0"
6
+
7
+ def self.version
8
+ VERSION
9
+ end
10
+
11
+ def self.gem_version
12
+ Gem::Version.new(version)
13
+ end
14
+ end
15
+ end
@@ -1,12 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../core/lib/spree/core/version.rb'
3
+ require_relative 'lib/spree/frontend/version.rb'
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.name = 'solidus_frontend'
8
- s.version = Spree.solidus_version
9
- s.summary = 'Cart and storefront for the Solidus e-commerce project.'
8
+ s.version = Spree::Frontend.version
9
+
10
+ s.summary = <<~SUMMARY
11
+ Legacy cart and storefront for the Solidus e-commerce project.
12
+ For new Solidus apps, we recommend that you use
13
+ [SolidusStarterFrontend](https://github.com/solidusio/solidus_starter_frontend)
14
+ instead.
15
+ SUMMARY
16
+
10
17
  s.description = s.summary
11
18
 
12
19
  s.author = 'Solidus Team'
@@ -14,6 +21,11 @@ Gem::Specification.new do |s|
14
21
  s.homepage = 'http://solidus.io'
15
22
  s.license = 'BSD-3-Clause'
16
23
 
24
+ s.metadata['rubygems_mfa_required'] = 'true'
25
+ s.metadata['homepage_uri'] = s.homepage
26
+ s.metadata['source_code_uri'] = 'https://github.com/solidusio/solidus_frontend'
27
+ s.metadata['changelog_uri'] = 'https://github.com/solidusio/solidus_frontend/blob/master/CHANGELOG.md'
28
+
17
29
  s.files = `git ls-files -z`.split("\x0").reject do |f|
18
30
  f.match(%r{^(spec|script)/})
19
31
  end
@@ -21,8 +33,8 @@ Gem::Specification.new do |s|
21
33
  s.required_ruby_version = '>= 2.5.0'
22
34
  s.required_rubygems_version = '>= 1.8.23'
23
35
 
24
- s.add_dependency 'solidus_api', s.version
25
- s.add_dependency 'solidus_core', s.version
36
+ s.add_dependency 'solidus_api', '>= 3.2.0.alpha'
37
+ s.add_dependency 'solidus_core', '>= 3.2.0.alpha'
26
38
 
27
39
  s.add_dependency 'canonical-rails', '~> 0.2.10'
28
40
  s.add_dependency 'font-awesome-rails', '~> 4.0'
@@ -33,4 +45,8 @@ Gem::Specification.new do |s|
33
45
  s.add_dependency 'truncate_html', '~> 0.9', '>= 0.9.2'
34
46
 
35
47
  s.add_development_dependency 'capybara-accessible'
48
+ s.add_development_dependency 'solidus_dev_support', '~> 2.5'
49
+ s.add_development_dependency 'rspec-activemodel-mocks', '~> 1.1'
50
+ s.add_development_dependency 'rails-controller-testing'
51
+ s.add_development_dependency 'generator_spec'
36
52
  end
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_frontend
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.6
4
+ version: 3.2.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: 2022-06-01 00:00:00.000000000 Z
11
+ date: 2022-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: solidus_api
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 3.1.6
19
+ version: 3.2.0.alpha
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 3.1.6
26
+ version: 3.2.0.alpha
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: solidus_core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 3.1.6
33
+ version: 3.2.0.alpha
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 3.1.6
40
+ version: 3.2.0.alpha
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: canonical-rails
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -156,12 +156,81 @@ dependencies:
156
156
  - - ">="
157
157
  - !ruby/object:Gem::Version
158
158
  version: '0'
159
- description: Cart and storefront for the Solidus e-commerce project.
159
+ - !ruby/object:Gem::Dependency
160
+ name: solidus_dev_support
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '2.5'
166
+ type: :development
167
+ prerelease: false
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - "~>"
171
+ - !ruby/object:Gem::Version
172
+ version: '2.5'
173
+ - !ruby/object:Gem::Dependency
174
+ name: rspec-activemodel-mocks
175
+ requirement: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - "~>"
178
+ - !ruby/object:Gem::Version
179
+ version: '1.1'
180
+ type: :development
181
+ prerelease: false
182
+ version_requirements: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - "~>"
185
+ - !ruby/object:Gem::Version
186
+ version: '1.1'
187
+ - !ruby/object:Gem::Dependency
188
+ name: rails-controller-testing
189
+ requirement: !ruby/object:Gem::Requirement
190
+ requirements:
191
+ - - ">="
192
+ - !ruby/object:Gem::Version
193
+ version: '0'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: '0'
201
+ - !ruby/object:Gem::Dependency
202
+ name: generator_spec
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
208
+ type: :development
209
+ prerelease: false
210
+ version_requirements: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
215
+ description: Legacy cart and storefront for the Solidus e-commerce project. For new
216
+ Solidus apps, we recommend that you use [SolidusStarterFrontend](https://github.com/solidusio/solidus_starter_frontend)
217
+ instead.
160
218
  email: contact@solidus.io
161
219
  executables: []
162
220
  extensions: []
163
221
  extra_rdoc_files: []
164
222
  files:
223
+ - ".circleci/config.yml"
224
+ - ".dockerdev/.psqlrc"
225
+ - ".dockerdev/Dockerfile"
226
+ - ".gem_release.yml"
227
+ - ".github/stale.yml"
228
+ - ".github_changelog_generator"
229
+ - ".gitignore"
230
+ - ".rspec"
231
+ - ".rubocop.yml"
232
+ - CHANGELOG.md
233
+ - Gemfile
165
234
  - LICENSE
166
235
  - README.md
167
236
  - Rakefile
@@ -258,7 +327,6 @@ files:
258
327
  - app/views/spree/shared/_image.html.erb
259
328
  - app/views/spree/shared/_link_to_cart.html.erb
260
329
  - app/views/spree/shared/_locale_selector.html.erb
261
- - app/views/spree/shared/_login_bar_items.html.erb
262
330
  - app/views/spree/shared/_main_nav_bar.html.erb
263
331
  - app/views/spree/shared/_nav_bar.html.erb
264
332
  - app/views/spree/shared/_order_details.html.erb
@@ -271,15 +339,28 @@ files:
271
339
  - app/views/spree/store/cart_link.html.erb
272
340
  - app/views/spree/taxons/_taxon.html.erb
273
341
  - app/views/spree/taxons/show.html.erb
342
+ - bin/console
343
+ - bin/rails
344
+ - bin/rails-engine
345
+ - bin/rails-sandbox
346
+ - bin/rake
347
+ - bin/sandbox
348
+ - bin/setup
274
349
  - config/initializers/assets.rb
275
350
  - config/initializers/canonical_rails.rb
276
351
  - config/routes.rb
352
+ - docker-compose.yml
277
353
  - lib/generators/solidus/views/override_generator.rb
354
+ - lib/generators/solidus_frontend/install/install_generator.rb
355
+ - lib/generators/solidus_frontend/install/templates/initializer.rb
356
+ - lib/generators/solidus_frontend/install/templates/vendor/assets/javascripts/spree/frontend/all.js
357
+ - lib/generators/solidus_frontend/install/templates/vendor/assets/stylesheets/spree/frontend/all.css
278
358
  - lib/solidus_frontend.rb
279
359
  - lib/spree/frontend.rb
280
360
  - lib/spree/frontend/config.rb
281
361
  - lib/spree/frontend/engine.rb
282
362
  - lib/spree/frontend/middleware/seo_assist.rb
363
+ - lib/spree/frontend/version.rb
283
364
  - lib/spree/frontend_configuration.rb
284
365
  - lib/spree_frontend.rb
285
366
  - lib/tasks/rake_util.rb
@@ -288,7 +369,11 @@ files:
288
369
  homepage: http://solidus.io
289
370
  licenses:
290
371
  - BSD-3-Clause
291
- metadata: {}
372
+ metadata:
373
+ rubygems_mfa_required: 'true'
374
+ homepage_uri: http://solidus.io
375
+ source_code_uri: https://github.com/solidusio/solidus_frontend
376
+ changelog_uri: https://github.com/solidusio/solidus_frontend/blob/master/CHANGELOG.md
292
377
  post_install_message:
293
378
  rdoc_options: []
294
379
  require_paths:
@@ -304,8 +389,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
304
389
  - !ruby/object:Gem::Version
305
390
  version: 1.8.23
306
391
  requirements: []
307
- rubygems_version: 3.2.31
392
+ rubygems_version: 3.3.7
308
393
  signing_key:
309
394
  specification_version: 4
310
- summary: Cart and storefront for the Solidus e-commerce project.
395
+ summary: Legacy cart and storefront for the Solidus e-commerce project. For new Solidus
396
+ apps, we recommend that you use [SolidusStarterFrontend](https://github.com/solidusio/solidus_starter_frontend)
397
+ instead.
311
398
  test_files: []
@@ -1 +0,0 @@
1
- <%# solidus_auth_devise or a custom auth system can replace this partial %>