-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Tweaks for the Solidus installer #4504
Tweaks for the Solidus installer #4504
Conversation
ebfd2ed changed the installer to allow users select solidus_starter_frontend or solidus_frontend as their storefront. If the installer added solidus_frontend to the Gemfile, the `source:` argument was given to avoid conflicts with the `frontend` directory in the mono-repo. However, the directory was removed in c89fbf0. See solidusio#4490 (comment) for more context
In ebfd2ed, we updated the installer to allow the selection of both solidus_frontend and solidus_starter_frontend. When solidus_starter_frontend is chosen, we need to break down the solidus meta-gem so that solidus_frontend is not pulled. We also broke down the meta-gem when solidus_frontend was chosen to avoid source conflicts with the gem in the mono-repo. However, we removed the `frontend` directory in c89fbf0. That means that's no longer needed, as the gem is explicitly added to the Gemfile.
Bundler expects two different types in `Bundler::Dependency#source`. When it's created from `Bundler.locked_gems.dependencies`, it's a `Bundler::Source` instance. However, the canonical injector expects it to be a `String`. We're now tweaking our injector to extract the source URI from the `Bundler::Source` instance.
As `Bundler::Source::Git` is a subclass of `Bundler::Source::Path`, our installer replaced `git` sources with its download path when breaking down the solidus meta-gem. We're now adding the `git` & `ref` options when the source is a `Bundler::Source::Git`. It also works for shortcuts like `github:` or `branch:`, as they're translated into `git:` & `ref:` options.
Both groups and autorequire options are always `nil` when fetching a `Bundler::Dependency` from `Bundler.locked_gems.dependencies`. We're acknowledging that by not doing anything with them. That means that those options will be lost after the installation in the unlikely scenario they're given. However, they can be seen more as optimizations, and users can add them again manually. There's no easy workaround for that.
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.
Thanks Marc, this one seems tricky. Can you please confirm that we can remove these "hacks" on the next major, when no frontend will be in the metagem?
Yeah, @kennyadsl. I agree it's very hacky. However, using built-in bundler tools, even when they're half-cooked, is the most robust way to support our deprecation path. As you said, we can remove all of it before v4. |
Summary
We're tweaking the installer with some fixes and optimizations. Please, see the individual commits for better comprehension and review:
source:
when installing solidus_frontendChecklist
Check out our PR guidelines for more details.
The following are mandatory for all PRs:
The following are not always needed (
cross them outif they are not):- [ ] I have added automated tests to cover my changes.- [ ] I have attached screenshots to demo visual changes.- [ ] I have opened a PR to update the guides.- [ ] I have updated the readme to account for my changes.