Skip to content
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

Allow npm or pnpm to be used as a package manager instead of yarn #176

Closed
KevinNorth opened this issue Oct 25, 2023 · 5 comments
Closed

Comments

@KevinNorth
Copy link

KevinNorth commented Oct 25, 2023

If I understand correctly, jsbundling-rails is hard-coded to use yarn. Can this please be changed to allow consumers to specify their preferred Node package manager?

@KevinNorth
Copy link
Author

I successfully monkey-patched jsbundling-rails to use pnpm in a project I'm working on, so I have some ideas on how this could be implemented. If you think this feature request is a good idea, I would be happy to put together a pull request for it!

@h0jeZvgoxFepBQ2C
Copy link

yes pleas create a PR, I would like to use npm too instead of yarn

@h0jeZvgoxFepBQ2C
Copy link

Same request in the cssbundling-rails repo too rails/cssbundling-rails#138

@G-Rath
Copy link

G-Rath commented Oct 26, 2023

fwiw I recently created package_json to facilitate this, which is in the process of being landed in Shakapacker.

You can follow that here, and we've also got it working in our rails-template across the five main package managers (npm, pnpm, yarn classic, yarn berry, and bun).

My understanding is that jsbundling-rails is primarily only using package managers in its install templates and it looks like a single build call in a rake task that should be easy to customize per app so I wasn't going to look at suggesting package_json here until after Shakapacker has been switched over in a new major and proven stable for a while, but if folks are already interested and open to it here I'm happy to help with its integration :)

@KevinNorth
Copy link
Author

Hello! Thanks for the encouragement to pursue this. I'm going to be busy on a higher-priority project for a little while. But I'll plan to come back to this and hopefully have a PR up by the end of the year or early next year.

I'll definitely look into your contributions when I do so, G-Rath!

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

No branches or pull requests

4 participants