-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add support for the Bun and pnpm package managers. #1196
Comments
For those who don't want to wait for this, you can use the existing {:node-modules
{; Override the guessed Node.js package manager.
;
; Not needed if you specify :install-cmd.
:managed-by
:bun
; Override the guessed install command for the Node.js package manager.
:install-cmd
["bun" "add"]}} The corresponding documentation PR surfaces this in the user guide. |
I'm unsure if I want to add this until there is some actual support for these runtimes. I've been meaning to change how the install process works for a while now, see #998. |
This would only support additional Node.js package managers (i.e. manages
Users are free to mix and match package managers and runtimes. This is like how in Clojure we can use Bun having both the package manager and runtime in a single executable can be confusing since there isn't a CLJS REPL on Bun being added here (users need to use the browser REPL instead). I think we can just note that in the user guide (Node REPL requires As a side note, the Bun runtime has polyfills for Node.js runtime APIs. https://bun.sh/docs/runtime/nodejs-apis On the pure JavaScript side, most Node.js applications seem to just work when executed on the Bun runtime. It's not 100% coverage yet so there will be some gaps. Likewise on the CLJS side, people can typically do tl;dr I don't think missing a CLJS REPL on the Bun runtime should be a blocker since we'd be complecting Bun package manager support with Bun runtime support. For the linked issue on reworking In other words, when shadow-cljs finishes I think it might be better for shadow-cljs to not pin exact versions in Clojure has similar behavior with deps expansion (e.g. if a library a project uses There might be a different pattern where the
{:npm-deps
{"cljs-lib-a" "^1"}}
{
"name": "cljs-lib-a",
"version": "1.0.0",
"dependencies": {
"fraction.js": "^2"
}
} This would offload a fair amount of the version resolution logic to the Node.js package manager, but this won't fix existing packages whose Granted, this requires publishing effectively a placeholder package to the npm public registry (npmjs.org) that's otherwise empty (unless someone is trying to vend compiled CLJS artifacts). The main problem is that it doesn't play nice with source-based libraries vended through Git. If they use a Git procurer in Another approach for library vendors might be to just omit a
{:deps
{cljs-lib-a
{:mvn/version "5.0.0"}
cljs-lib-b
{:git/url "git+ssh://github.com/org/cljs-lib-b.git"
:git/sha "{hash}"}}
{
"name": "cljs-lib-z",
"version": "1.0.0",
"dependencies": {
"cljs-lib-a": "^5",
"cljs-lib-b": "git+ssh://github.com/org/cljs-lib-b.git#{hash}"
}
} This seems to work decently well for both source (e.g. Git) and compiled artifact (e.g. Clojars) vending. It's also problematic though because In comparison, Likewise for To extend that, maybe we should view People would use their Since we start with a fresh Here's an example with the ClojureScript compiler (made for testing similar changes submitted to it): https://github.com/commiterate/test-clojurescript-bun The main ugliness with this is that This approach is the same as how we treat |
Add support for using the Bun and pnpm package managers to manage
package.json
andnode_modules
. These are popular Node.js package managers that are faster and more space efficient than npm and Yarn.Users of the Bun package manager are probably also using the Bun runtime which supports partial CommonJS and ESM interop. This helps smooth over integration between CLJS and the JavaScript ecosystem (no need to mess with different Clojure requires syntax when handling ESM v. CommonJS).
This is not about adding support for running a CLJS REPL on the Bun runtime (e.g. #923 for a CLJS REPL on the Deno runtime). Bun users should use an existing REPL like the browser REPL.
The text was updated successfully, but these errors were encountered: