You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hanami new bookshelf runs bundle install, so users shouldn't have to run it themselves manually.
However hanami/rspec adds gem "capybara" to the generated Gemfile after that bundle install has already ran so the Gemfile.lock doesn't include it. The effect of that users think they've installed all the dependencies but they're missing any that were added from other gems.
To reproduce:
hanami new bookshelf
cd bookshelf/
git init && git add .
bundle install
and you'll see Gemfile.lock is now updated for capybara's dependencies.
I think it'd be great if we could add it in this repo, so any other gems that use after hooks to add to the Gemfile don't need to manually run bundle install themselves. If this isn't possible, then we should at least update hanami/rspec to run bundle install and document this.
I haven't looked into it but maybe we could use a before hook instead of an after hook to add the gems to the Gemfile before the bundle install is ran.
The text was updated successfully, but these errors were encountered:
@cllns Thank you for finding this! I'd occasionally seen new hanami created with a not-consistent Gemfile/Gemfile.lock state, but I could never figure out how to reproduce it.
One fix here would be to move to using a before hook instead of after.
Unfortunately, Hanami::CLI.before "install" reads a bit strangely to my eyes. The hooks from these gems are intended to run at the end of a Hanami install process, so the "before" seems out of place.
If we left the gem CLI hooks alone, perhaps a simpler fix is this: at the end of Hanami::CLI::Commands::Gem::New, right after we call run_install_command!, we just re-run the bundler and npm instals again. What do you reckon?
This also feels like an easy-enough fix for us to make in the next day or so, so we can have it included in the 2.2.1 release we make before your workshop.
Actually, I take it back, I think before "install" feels fine. And if we did that, it would allow us to do a bundle install inside the body of the "install" command, and all would be right in the world.
hanami new bookshelf
runsbundle install
, so users shouldn't have to run it themselves manually.However
hanami/rspec
addsgem "capybara"
to the generated Gemfile after thatbundle install
has already ran so theGemfile.lock
doesn't include it. The effect of that users think they've installed all the dependencies but they're missing any that were added from other gems.To reproduce:
and you'll see Gemfile.lock is now updated for capybara's dependencies.
I think it'd be great if we could add it in this repo, so any other gems that use
after
hooks to add to the Gemfile don't need to manually run bundle install themselves. If this isn't possible, then we should at least updatehanami/rspec
to runbundle install
and document this.I haven't looked into it but maybe we could use a
before
hook instead of anafter
hook to add the gems to the Gemfile before thebundle install
is ran.The text was updated successfully, but these errors were encountered: