This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-25
Channels
- # announcements (4)
- # babashka (3)
- # beginners (79)
- # biff (4)
- # calva (17)
- # cider (18)
- # clj-kondo (21)
- # cljdoc (45)
- # cljs-dev (14)
- # cljsrn (9)
- # clojure (90)
- # clojure-europe (86)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-portugal (1)
- # clojure-uk (9)
- # clojurescript (20)
- # code-reviews (23)
- # conjure (14)
- # cursive (12)
- # datascript (12)
- # emacs (5)
- # events (2)
- # fulcro (13)
- # gratitude (1)
- # holy-lambda (9)
- # lambdaisland (2)
- # malli (6)
- # nbb (1)
- # nextjournal (2)
- # nrepl (30)
- # off-topic (63)
- # pathom (1)
- # portal (24)
- # reagent (5)
- # reitit (13)
- # releases (2)
- # remote-jobs (1)
- # sci (90)
- # shadow-cljs (49)
- # spacemacs (5)
- # sql (13)
- # testing (20)
- # tools-build (17)
- # xtdb (27)
How can I sepcify different comands for jackin. Currently for shadow it is:
npx shadow-cljs -d cider/cider-nrepl:0.27.4 watch :app
I’d like it to be
npx shadow-cljs -d cider/cider-nrepl:0.27.4 watch :app <some-args>
Along with this doc, I thought the original command might come from https://github.com/BetterThanTomorrow/calva/blob/published/src/nrepl/connectSequence.ts#L1 but I didn’t find the word watch
.<!subteam^S03BGSAUPTQ|@calva-team> since we are building a command line as an array which we then execute. Maybe a way to solve this more general case is to make the command line array itself configurable? That would then be used instead of Calva building it. We could have some place-holder variables for the dependencies. So in the case above, the user would use a custom connect sequence with something like so in it:
"jack-in-command-line": ["npx", "shadow-cljs", "-d", "$CIDER-NREPL-VERSION", "watch", ":app", "some-arg-1", "some-arg-2"]
It would become a bit tricky to construct the command line for Leiningen and deps.edn this way, but we could make a convenience command for copying out the jack-in command as an array, to start off with.
The user can then also specify a custom script:
"jack-in-command-line": ["start-my-repl.sh", "$CIDER-NREPL-VERSION"]
And if we execute the command with some environment variables for the dependencies and middlewares, the user can use those in their script and the command-line would be only:
"jack-in-command-line": ["start-my-repl.sh"]
In combination with the current ways to provide jackInEnv
, this should provide a lot of flexibility, I think.but otherwise that sounds good to me
Yes, those vars should be properly prefixed of course. $CIDER-NREPL-VERSION
above is not an env var, just to clarify.
oh absolutely, but even in that case prefixes prevent possible overlap, like namespacing keys
I really like this idea. it was forever a pain in emacs that it wasn't simple to override these things
To have developers as the end users does provide room for some solutions that would be a bit crazy otherwise. 😃
I mean with the variables we'll interpolate into their command array it still pays to prefix with CALVA since it's possible that any other value could be a legitimate value they don't want interpolated
I assumed we couldn't get variables in the array interpolated by the shell. You think we can? Then we don't need to interpolate at all. Just execute with env vars and the user can use them either in the array or inside some script.
no, I meant outside the shell