Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit418d878

Browse files
committed
Add support for the Bun and pnpm package managers
1 parent47a7bfd commit418d878

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

‎src/main/clojure/cljs/cli.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ present"
606606
:doc (str"Set the output directory to use. If"
607607
"supplied, cljsc_opts.edn in that directory"
608608
"will be used to set ClojureScript compiler"
609-
"options")}
609+
"options")}
610610
["-w""--watch"] {:group::compile:fn watch-opt
611611
:arg"paths"
612612
:doc (str"Continuously build, only effective with the"
@@ -617,7 +617,7 @@ present"
617617
:doc"Set the output compiled file"}
618618
["--deps-cmd"] {:group::compile:fn deps-cmd-opt
619619
:arg"string"
620-
:doc"Set the node dependency manager. Only npm oryarn supported"}
620+
:doc"Set the node dependency manager. Only npm, bun, pnpm, andyarn are supported"}
621621
["-O""--optimizations"] {:group::compile:fn optimize-opt
622622
:arg"level"
623623
:doc
@@ -629,7 +629,7 @@ present"
629629
:doc
630630
(str"The JavaScript target. Configures environment bootstrap and"
631631
"defaults to browser. Supported values: node or nodejs,"
632-
"webworker, bundle, none")}
632+
"webworker, bundle, none")}
633633
["-ro""--repl-opts"] {:group ::main&compile:fn repl-env-opts-opt
634634
:arg"edn"
635635
:doc (str"Options to configure the repl-env, can be an EDN string or"

‎src/main/clojure/cljs/closure.clj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2621,7 +2621,11 @@
26212621
(let [proc (-> (ProcessBuilder.
26222622
(into (cond->>
26232623
[deps-cmd
2624-
({"npm""install""yarn""add"} deps-cmd)
2624+
({"npm""install"
2625+
"bun""add"
2626+
"pnpm""add"
2627+
"yarn""add"}
2628+
deps-cmd)
26252629
"@cljs-oss/module-deps"]
26262630
util/windows? (into ["cmd""/c"]))
26272631
(map (fn [[dep version]] (str (name dep)"@" version)))
@@ -2665,7 +2669,9 @@
26652669
(string/replace"CLJS_TARGET" (str"" (when target (name target))))
26662670
(string/replace"MAIN_ENTRIES" main-entries)
26672671
(string/replace"FILE_SEPARATOR" (escape-backslashes File/separator)))
2668-
proc (-> (ProcessBuilder. ["node""--eval" code])
2672+
proc (-> (ProcessBuilder. (case (:deps-cmd opts)
2673+
"bun" ["bun""--eval" code]
2674+
["node""--eval" code]))
26692675
.start)
26702676
is (.getInputStream proc)
26712677
iw (StringWriter. (*1610241024))

‎src/test/clojure/cljs/foreign/node_test.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
([f]
1212
(test-util/delete-node-modules)
1313
(doseq [f (map io/file
14-
["package.json""package-lock.json""yarn.lock"
15-
"yarn-error.log"])]
14+
["package.json""package-lock.json""bun.lockb"
15+
"pnpm-lock.yaml""yarn.lock""yarn-error.log"])]
1616
(when (.exists f)
1717
(io/delete-file f)))
1818
(f)))
@@ -21,7 +21,7 @@
2121
([lib version]
2222
(install:npm lib version))
2323
([cmd lib version]
24-
(let [action ({:npm"install":yarn"add"} cmd)]
24+
(let [action ({:npm"install":bun"add":pnpm"add":yarn"add"} cmd)]
2525
(sh/sh (name cmd) action (str lib"@" version)))))
2626

2727
(test/use-fixtures:once cleanup)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp