solidus_starter_frontend compatibility with extension dummy apps #4634
benjaminwil
started this conversation in
New Features or Ideas
Replies: 1 comment 6 replies
-
|
Hi @benjaminwil, thanks for opening this discussion. You're right. It's impossible to generate the dummy application with a frontend other than solidus_frontend. There're two reasons for that:
However, we're still in the process of evaluating and understanding all possible consequences of that. Do you think developing your extension in those terms would be viable? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We are developing a Solidus extension that needs to test the customer-facing storefront of a Solidus application. Right now we do that by installing
solidus_frontendand using its storefront.But as of Solidus 3.2.0,
solidus_frontendhas been deprecated. We can continue to use it to test our extension, but it seems like at some point this will become inconvenient.We tried to follow the instructions in the
solidus_starter_frontendREADME to install it in our extension's dummy app. We even saw the git repo get cloned as it should. Unfortunately, when we inspected the dummy app no views or controllers it provides were present.Reproduction instructions
Prepare a new extension:
Add a install generator task to install
solidus_starter_frontend.You might not do this in a real extension. But this reproduces the issue: you can't run the generator inside of a dummy app.
If you install using the "For existing stores" instructions,
bin/rails app:template LOCATION="https://github.com/solidusio/solidus_starter_frontend/raw/main/template.rbyou get even weirder errors.Run tests:
Result
The dummy app does not get
solidus_starter_frontendviews:Terminal output
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem Generating dummy Rails application... create config/master.key Copied migration 20220921220359_create_active_storage_tables.active_storage.rb from active_storage Created database 'db/solidus_test.sqlite3' create config/initializers/solidus_frontend.rb exist app/assets/images create vendor/assets/javascripts/spree/frontend create vendor/assets/stylesheets/spree/frontend create vendor/assets/images/spree/frontend create vendor/assets/javascripts/spree/frontend/all.js create vendor/assets/stylesheets/spree/frontend/all.css Setting up dummy database... bin/rails db:environment:set RAILS_ENV=test bin/rails db:drop db:create db:migrate VERBOSE=false RAILS_ENV=test Running extension installation generator... bin/rails generate solidus_hello_world:install --auto-run-migrations create config/initializers/solidus_hello_world.rb append vendor/assets/javascripts/spree/frontend/all.js append vendor/assets/javascripts/spree/backend/all.js insert vendor/assets/stylesheets/spree/frontend/all.css insert vendor/assets/stylesheets/spree/backend/all.css run bin/rails railties:install:migrations FROM=solidus_hello_world from "." run bin/rails generate solidus:install --frontend=solidus_starter_frontend from "." conflict config/initializers/spree.rb Overwrite /Users/bw/Projects/solidus_hello_world/spec/dummy/config/initializers/spree.rb? (enter "h" for help) [Ynaqdhm] Y force config/initializers/spree.rb Installing Active Storage rake active_storage:install exist app/assets/images exist vendor/assets/javascripts/spree/backend exist vendor/assets/stylesheets/spree/backend exist vendor/assets/images/spree/backend conflict vendor/assets/javascripts/spree/backend/all.js Overwrite /Users/bw/Projects/solidus_hello_world/spec/dummy/vendor/assets/javascripts/spree/backend/all.js? (enter "h" for help) [Ynaqdhm] Y force vendor/assets/javascripts/spree/backend/all.js conflict vendor/assets/stylesheets/spree/backend/all.css Overwrite /Users/bw/Projects/solidus_hello_world/spec/dummy/vendor/assets/stylesheets/spree/backend/all.css? (enter "h" for help) [Ynaqdhm] Y force vendor/assets/stylesheets/spree/backend/all.css exist app/overrides
File unchanged! The supplied flag value not found! db/seeds.rb
'copying migrations
creating database
rake db:create
Database 'db/solidus_test.sqlite3' already exists
gemfile solidus_auth_devise
/Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/actions/file_manipulation.rb:274:in
binread': No such file or directory @ rb_sysopen - /Users/bw/Projects/solidus_hello_world/spec/dummy/Gemfile (Errno::ENOENT) from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/actions/file_manipulation.rb:274:ingsub_file'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/generators/actions.rb:389:in
append_file_with_newline' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/generators/actions.rb:57:inblock in gem'
from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/actions.rb:201:in
block in in_root' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/actions.rb:190:inblock in inside'from /Users/bw/.asdf/installs/ruby/3.0.2/lib/ruby/3.0.0/fileutils.rb:139:in
chdir' from /Users/bw/.asdf/installs/ruby/3.0.2/lib/ruby/3.0.0/fileutils.rb:139:incd'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/actions.rb:190:in
inside' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/actions.rb:201:inin_root'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/generators/actions.rb:46:in
gem' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/bundler/gems/solidus-c0a35d703265/core/lib/generators/solidus/install/install_generator.rb:155:inblock in run_bundle_install_if_needed_by_plugins'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/bundler/gems/solidus-c0a35d703265/core/lib/generators/solidus/install/install_generator.rb:154:in
each' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/bundler/gems/solidus-c0a35d703265/core/lib/generators/solidus/install/install_generator.rb:154:inrun_bundle_install_if_needed_by_plugins'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in
run' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in
block in invoke_all' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:ineach'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:in
map' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:134:ininvoke_all'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/group.rb:232:in
dispatch' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/base.rb:485:instart'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/generators.rb:263:in
invoke' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/commands/generate/generate_command.rb:26:inperform'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/command.rb:27:in
run' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:ininvoke_command'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/thor-1.2.1/lib/thor.rb:392:in
dispatch' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/command/base.rb:87:inperform'from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/command.rb:48:in
invoke' from /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/railties-7.0.4/lib/rails/commands.rb:18:in<top (required)>'from bin/rails:4:in
require' from bin/rails:4:inrun bin/rails db:migrate from "."
cd /Users/bw/Projects/solidus_hello_world
/Users/bw/.asdf/installs/ruby/3.0.2/bin/ruby -I/Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/rspec-core-3.11.0/lib:/Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/rspec-support-3.11.1/lib /Users/bw/Projects/solidus_hello_world/vendor/bundle/ruby/3.0.0/gems/rspec-core-3.11.0/exe/rspec --pattern spec/**{,/*/**}/*_spec.rb
Provide a CODECOV_TOKEN environment variable to enable Codecov uploads
We are transitioning to a new way of loading factories for extensions.
Be sure this extension does not load factories using require but uses
the load_for() method in its spec_helper.rb, eg:
SolidusDevSupport::TestingSupport::Factories.load_for(ExtensionName1::Engine, ExtensionName2::Engine)
This will load Solidus Core factories right before the ones defined in
lib/extension_name/testing_support/factories/*_factory.rb or
lib/extension_name/testing_support/factories.rb
This message will be removed when all extensions are updated.
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
No examples found.
Randomized with seed 20806
Finished in 1.06 seconds (files took 4.99 seconds to load)
0 examples, 0 failures
Randomized with seed 20806
Coverage report generated for RSpec to /Users/bw/Projects/solidus_hello_world/coverage. 20 / 22 LOC (90.91%) covered.
Potential solutions
--user-classargs, we can also provide the option to specify--frontend. Link to source.extension:specsdefault Rake task. Maybe we should also provide aextension:specs:with_frontendtask.Beta Was this translation helpful? Give feedback.
All reactions