forked from babashka/nbb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,20 @@ | ||
{:tasks | ||
{#_#_shadow-server (shell "npx shadow-cljs server") | ||
#_#_shadow-compile (shell "npx shadow-cljs compile :app") | ||
#_#_shadow-node-repl (shell "npx shadow-cljs node-repl") | ||
{:requires ([babashka.fs :as fs]) | ||
clean (fs/delete-tree "out") | ||
compile (do (shell "npx shadow-cljs --force-spawn compile modules") | ||
(spit "out/nodashka_core.js" | ||
(clojure.string/replace (slurp "out/nodashka_core.js") (re-pattern "self") "globalThis")) | ||
(spit "out/nodashka_main.js" | ||
(str "#!/usr/bin/env node\n\n" (slurp "out/nodashka_main.js"))) | ||
(shell "chmod +x out/nodashka_main.js")) | ||
release (do (shell "npx shadow-cljs --force-spawn release modules") | ||
(spit "out/nodashka_core.js" | ||
(clojure.string/replace (slurp "out/nodashka_core.js") (re-pattern "self") "globalThis")) | ||
(spit "out/nodashka_main.js" | ||
(str "#!/usr/bin/env node\n\n" (slurp "out/nodashka_main.js"))) | ||
(shell "chmod +x out/nodashka_main.js")) | ||
release {:depends [clean] | ||
:task | ||
(do (shell "npx shadow-cljs --force-spawn release modules") | ||
(spit "out/nodashka_core.js" | ||
(clojure.string/replace (slurp "out/nodashka_core.js") (re-pattern "self") "globalThis")) | ||
(spit "out/nodashka_main.js" | ||
(str "#!/usr/bin/env node\n\n" (slurp "out/nodashka_main.js"))) | ||
(shell "chmod +x out/nodashka_main.js"))} | ||
run (shell "out/nodashka_main.js test.cljs") | ||
#_#_publish (shell "npm publish")}} | ||
publish {:depends [release] | ||
:task (shell "npm publish")}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
console.log("hello"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
(ns script | ||
(:require ["csv-parse/lib/sync.js" :default csv-parse] | ||
["fs" :as fs] | ||
["shelljs" :default sh])) | ||
(:require | ||
["csv-parse/lib/sync.js" :default csv-parse] | ||
["fs" :as fs] | ||
["shelljs" :default sh])) | ||
|
||
(println (count (str (.readFileSync fs "script.cljs")))) | ||
|
||
(prn (.ls sh ".")) | ||
|
||
(prn (csv-parse "foo,bar")) | ||
|
||
;; evaluate local file | ||
(js/eval (str (.readFileSync fs "./foo.js"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters