Fork me on GitHub
#joyride
<
2023-02-12
>
zimablue12:02:53

my js/require is failing but I'm not sure what I'm doing wrong, trying to do this:

(def strip-json (js/require "strip-json-comments"))
it's a library included in .vscode-server/bin, was trying to use it to strip comments from config json files in presumably the same way vscode does it

pez13:02:50

Is it available in node_modules from the script?

zimablue13:02:35

it's not, does it not search vscode's internal libraries?

borkdude14:02:35

Just use ‘require’ instead of js/require, it brings you the same feature and in a next version js/require won’t be supported anymore

borkdude14:02:01

If you want to ensure a library is there, npm install it into the .joyride folder

zimablue14:02:25

Is there any notion of a joyride dependencies file?

pez14:02:02

package.json 😀

pez14:02:44

And we are not searching vscode’s internal libraries. That would make the scripts unnecessary dependent on vscode version, I think.

zimablue14:02:21

Package.json no cljs or nbb libs though right? Although many arbitrary cljs scripts wouldn't compile to nbb anyway right

pez14:02:32

We haven't gotten to CLJS dependency management yet. You'll need to copy their source code. And they can't depend on something that Joyride does not provide built-in. See https://github.com/BetterThanTomorrow/joyride/blob/master/doc/api.md#clojurescript-namespaces You are welcome to help bring in built-in libraries that you miss.

borkdude14:02:05

Yes, just package.json

pez15:02:06

Generally I think npm often has libraries for many tasks. It's when it gets Clojure specific that it gets extra important to reach the Clojure eco system. We are adding rewrite-clj in next Joyride, for instance. I will probably release that today.

zimablue18:02:10

I wrote a minimal element of dynamically rewriting the keybindings file and registering the commands, pretty psyched about it

🎉 4
joyride 4
metal 2