Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[Cherry](https://github.com/squint-cljs/cherry): Experimental ClojureScript to ES6 module compiler

## Unreleased

- Fix `cherry compile` CLI command not receiving file arguments

## 0.5.33 (2025-11-27)

- Fix [#163](https://github.com/squint-cljs/cherry/issues/163): Add assert to macros ([@willcohen](https://github.com/willcohen))
Expand Down
8 changes: 8 additions & 0 deletions bb/integration_tests.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
(let [out (:out (p/shell {:out :string} "node test-resources/js_api.mjs"))]
(is (= ["1" "1"] (str/split-lines out)))))

(deftest compile-test
(let [tmp-file "/tmp/cherry-compile-test.cljs"
out-file "/tmp/cherry-compile-test.mjs"]
(spit tmp-file "(ns compile-test)\n(defn hello [] (js/console.log \"hello\"))")
(shell "rm" "-f" out-file)
(sh "npx" "cherry" "compile" tmp-file)
(is (.exists (java.io.File. out-file)) "compile should create output file")))

(defn run-tests []
(shell {:dir "test-resources/test_project"} "npm install")
(let [{:keys [fail error]} (t/run-tests 'integration-tests)]
Expand Down
4 changes: 2 additions & 2 deletions src/cherry/internal/cli.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ Options:

(def table
[{:cmds ["run"] :fn run :args->opts [:file]}
{:cmds ["compile"] :fn (fn [{:keys [opts rest-cmds]}]
(compile-files opts rest-cmds))}
{:cmds ["compile"] :fn (fn [{:keys [opts args]}]
(compile-files opts args))}
{:cmds [] :fn fallback}])

(defn init []
Expand Down
Loading