-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix and update sandbox script #169
Conversation
Goal ---- As a solidus_starter_frontend contributor I want the gem's sandbox script to generate the app with the solidus_starter_frontend gem as an engine So that the app would pick up changes I make to the app code Background ---------- Currently, the sandbox script both loads the gem and runs its generator. We want it to only the load the gem. Previous implementations ------------------------ * [Document how to run the extension as an engine in a Rails app](a4600e2) - This commit documents how to install solidus_starter_frontend as an engine. * Fix sandbox script #166 - This PR fixed the script to run `solidus_starter_frontend` as a generator instead of as a gem. Relevant links -------------- #167 (comment) - discussion on having two strategies for generating the sandbox app: one with the Starter FE running as an engine and other where Starter FE is generated into the app. Implementation -------------- * Point solidus gems in sandbox Gemfile to those in solidus_starter_frontend's Gemfile. * Fix: Install solidus using `solidus:install` instead of `spree:install`. * Fix: Pass `--auto-run-migrations` instead of `--auto-accept` to `solidus:auth:install`. * Remove `solidus_starter_frontend` call. * Call `bundle exec rails g solidus_starter_frontend:install`.
unbundled bundle exec rails generate solidus:auth:install --auto-accept | ||
unbundled bundle exec rails generate ${extension_name}:install --auto-accept | ||
unbundled bundle exec rails generate solidus:auth:install --auto-run-migrations | ||
unbundled bundle exec rails g solidus_starter_frontend:install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to running the solidus_starter_frontend:install
install command is to add the assets directly to app/views/spree/layouts/spree_application.html.erb
and then strip them from the layout when running the generator. Let me know if you prefer this alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to get what you mean here, do you have an example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kennyadsl I was easier to create a separate PR implementing that change :) Please see #170. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just go with this PR's route for now.
Goal
As a
solidus_starter_frontend
contributorI want the gem's sandbox script to generate the app with the
solidus_starter_frontend gem
as an engineSo that the app would pick up changes I make to the app code
Background
Currently, the sandbox script both loads the gem and runs its generator. We want it to only the load the gem.
Previous implementations
solidus_starter_frontend
as a generator instead of as a gem.Relevant links
#167 (comment) - discussion on having two strategies for generating the sandbox app: one with the Starter FE running as an engine and other where Starter FE is generated into the app.
Implementation
Point solidus gems in sandbox Gemfile to those in
solidus_starter_frontend's Gemfile.
Fix: Install solidus using
solidus:install
instead ofspree:install
.Fix: Pass
--auto-run-migrations
instead of--auto-accept
tosolidus:auth:install
.Remove
solidus_starter_frontend
call.Call
bundle exec rails g solidus_starter_frontend:install
.Demo
https://www.loom.com/share/1c7c4ff55baf4d8d8404a77f8520ca30
Types of changes
Checklist: