Skip to content

Conversation

ludo237
Copy link
Contributor

@ludo237 ludo237 commented Oct 3, 2025

Hi. I've make this addition to the installer in order to be able to use bun runtime to install/build packages. I've also added a new variable to manage the build command.

@taylorotwell taylorotwell merged commit 368b8e0 into laravel:master Oct 3, 2025
20 checks passed
@ludo237 ludo237 deleted the patch-1 branch October 4, 2025 12:08
@roberto-butti
Copy link

What if, instead of guessing the package manager via the lock file, we allow the user to select the package manager via the command line?
Something like this:

      --npm                        Install and build JavaScript dependencies via Npm
      --bun                        Install and build JavaScript dependencies via Bun
      --yarn                       Install and build JavaScript dependencies via Yarn
      --pnpm                       Install and build JavaScript dependencies via Pnpm

@ludo237
Copy link
Contributor Author

ludo237 commented Oct 9, 2025

What if, instead of guessing the package manager via the lock file, we allow the user to select the package manager via the command line? Something like this:

      --npm                        Install and build JavaScript dependencies via Npm
      --bun                        Install and build JavaScript dependencies via Bun
      --yarn                       Install and build JavaScript dependencies via Yarn
      --pnpm                       Install and build JavaScript dependencies via Pnpm

Honestly this was my first idea before looking at the current implementation. This implies a bit of a refactor

@roberto-butti
Copy link

@ludo237 i have already prepared a PR. If you want, i can share with you and you can decide if :

  • you want to bring my changes in your PR
  • you want me to open a new PR

Consider that we should take care also of the composer run dev (it relies on npx and npm, in the case the choice is for bun) (but the composer run dev is defined in the composer.json of laravel/laravel - so another package)

@ludo237
Copy link
Contributor Author

ludo237 commented Oct 9, 2025

@ludo237 i have already prepared a PR. If you want, i can share with you and you can decide if :

* you want to bring my changes in your PR

* you want me to open a new PR

Consider that we should take care also of the composer run dev (it relies on npx and npm, in the case the choice is for bun) (but the composer run dev is defined in the composer.json of laravel/laravel - so another package)

Hit me up with it I will gladly look at it and help

roberto-butti added a commit to roberto-butti/installer that referenced this pull request Oct 9, 2025
…ackage manager control

Thanks to the amazing PR laravel#439  by @ludo237 , I’d like to suggest a slightly different approach to selecting the package manager, allowing developers to choose it in a more explicit and flexible way.

This PR introduces support for Yarn, PNPM, and Bun alongside npm in the Laravel Installer.
Developers can now select their preferred package manager via CLI options or an interactive prompt, or skip installation of JS packages entirely.

This approach gives developers direct control over which package manager to use, instead of relying solely on lock file detection (as in the related PR).
It improves flexibility while maintaining backward compatibility with npm as the default.
@roberto-butti
Copy link

@ludo237 this one #440

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants