-
Notifications
You must be signed in to change notification settings - Fork 99
Improved detection logic for package manager #171
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
base: main
Are you sure you want to change the base?
Conversation
b7bab1d to
5dd3185
Compare
55e6f72 to
ae8ee6c
Compare
lib/install/helpers.rb
Outdated
|
|
||
| helper.run %(#{helper.bundler_run_cmd} #{name}) if run_script | ||
| end | ||
| }.freeze |
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.
This is interesting, but too complicated.
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 get what you mean, i commited a new version a bit more simpler to read.
ae8ee6c to
27e8fd8
Compare
lib/install/helpers.rb
Outdated
| when File.exist?("yarn.lock") then :yarn | ||
| when File.exist?("bun.lockb") then :bun | ||
| when File.exist?("bun.lock") then :bun |
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.
The Bun lockfiles should come before yarn.lock, since Bun optionally generates a yarn.lock file.
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.
Good catch, i update
…rates a yarn.lock file
|
Lets review it again, so we fixed #169 |
rails/jsbundling-rails#213 (comment)
Summary
This PR enhances the CSS Bundling Rails gem by implementing comprehensive support for multiple JavaScript package managers (Yarn, Bun, PNPM, and NPM) with improved detection logic and consistent behavior.
Changes
Technical Details
TOOLS_COMMANDSconstant mapping each package manager to its specific commandsSCRIPT_STRATEGIESto handle package.json script modifications per package managertool_determined_by_config_fileandtool_determined_by_executableThis change enhances developer experience by providing better support for their preferred package manager while maintaining backward compatibility.