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

Cssbundling-rails 1.4.3 using bun in project, which using yarn and contain yarn.lock #169

Open
le0pard opened this issue Mar 4, 2025 · 7 comments

Comments

@le0pard
Copy link

le0pard commented Mar 4, 2025

Hello.

In project we are using yarn 4.6.0. All works till version 1.4.2 included.

1.4.3 now thinking if system have bun installed, it run it and generate bun.lock file in project. Which is incorrect behaviour, because project have only yarn.lock and managed by yarn. Installed bun in system doesn't mean project using bun.

Thanks

Looks like issue was introduced by #165

@navidemad
Copy link
Contributor

Does your package.json has a packageManager field, it could be interesting to choose tools from that perhaps.
Otherwise we will have to follow #165 (comment)

@le0pard
Copy link
Author

le0pard commented Mar 4, 2025

  "packageManager": "[email protected]",

in package.json present @navidemad

@le0pard
Copy link
Author

le0pard commented Mar 4, 2025

I think bun mean bun.lock files in project. So not clear why bun should manage yarn.lock

@tagliala
Copy link

tagliala commented Mar 5, 2025

Hello,

I'm experiencing the same issue

We're using yarn classic 1.22.22 (for this particular project)

The original package.json didn't include a packageManager field.

I've tried by adding:

  "packageManager": "[email protected]",

but the result does not change: running rake when cssbundling-rails 1.4.3 is installed does create a bun.lock file in the root folder of the repository

$ rake
bun install v1.2.4 (fd9a5ea6)

Checked 118 installs across 112 packages (no changes) [6.00ms]
$ tailwindcss -i ./app/assets/stylesheets/active_admin.css -o ./app/assets/builds/active_admin.css --minify -c tailwind-active_admin.config.js

Rebuilding...

Done in 1234ms.

As a workaround, I've uninstalled bun

@le0pard
Copy link
Author

le0pard commented Mar 5, 2025

We just should remove yarn.lock as autodetection for bun.

Also, for such cases as in #165 create config variable, which will set js package manager and will use it instead autodetection mechanism (so person can set bun even if have yarn.lock)

@navidemad
Copy link
Contributor

I will try a PR

@jbarrieault
Copy link

@le0pard @navidemad The lockfile & command sniffing approach keeps fixing one setup while breaking another—there are a lot of possible combinations of existing lockfiles and commands.

Adding config that allows differentiating the build command from the package manager seems like the best path. 👍

I encountered the same basic problem in rails/jsbundling-rails#213, which I now realize may fix my setup and break another's. I think the two gems should align on their solution, so I'm keeping an eye on this so I can update that PR accordingly.

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