bhauman / lein-figwheel

Figwheel builds your ClojureScript code and hot loads it into the browser as you are coding!
Eclipse Public License 1.0
2.88k stars 209 forks source link

npm-deps should support scoped packages #587

Closed kurtharriger closed 7 years ago

kurtharriger commented 7 years ago

Configuration validator suggests that npm-deps key must be a keyword, however the reader doesn't like :@ so for scoped packages you must use a string instead:

                           :npm-deps {"@atlaskit/editor-cq" "4.3.1"}

Error at [:cljsbuild :builds 0 :compiler :npm-deps "@atlaskit/editor-cq" 0] The key "@atlaskit/editor-cq" at (:cljsbuild :builds 0 :compiler :npm-deps) does not conform. It should be a Keyword

bhauman commented 7 years ago

Did you try pretending a colon as in :"@asdf/asdf" ?

On Jul 30, 2017, at 4:36 AM, Kurt Harriger notifications@github.com wrote:

Configuration validator suggests that npm-deps key must be a keyword, however the reader doesn't like :@ so for scoped packages you must use a string instead:

                       :npm-deps {"@atlaskit/editor-cq" "4.3.1"}

Error at [:cljsbuild :builds 0 :compiler :npm-deps "" 0] The key "" at (:cljsbuild :builds 0 :compiler :npm-deps) does not conform. It should be a Keyword

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

bhauman commented 7 years ago

Also, do scoped packages work in ClojureScript proper?

kurtharriger commented 7 years ago

:"@abc/def" didnt work either. Was recently added/fixed in

https://dev.clojure.org/jira/browse/CLJS-2226

On Mon, Jul 31, 2017 at 10:31 AM Bruce Hauman notifications@github.com wrote:

Also, does scoped packages work in ClojureScript proper?

— You are receiving this because you authored the thread.

Reply to this email directly, view it on GitHub https://github.com/bhauman/lein-figwheel/issues/587#issuecomment-318941149, or mute the thread https://github.com/notifications/unsubscribe-auth/AAG328iHLn67mlmu3C_MUFQ674V2gD7Mks5sTSBlgaJpZM4Onk5R .

swannodette commented 7 years ago

I'll just add that :npm-deps keys do not need to be keywords. Strings are valid, and probably in general the better way to go.

njj commented 6 years ago

@swannodette Does anyone here have an example of requiring in a scoped package? I'm having some issues with clojure thinking I'm trying to dereference because of the @.

kurtharriger commented 6 years ago

I created an issue several months ago

https://dev.clojure.org/jira/browse/CLJS-2451

There is a link to an repo where it can be reproduced by uncommenting the require statement in core.cljs

I’ve since been using shadow-cljs but it doesn’t support babel transforms to input dependencies and recently gave cljsbuild another try but didn’t get much further than before.

I think the problem might be in the code the generates the foreign libs. Perhaps it isn’t being registered correctly and the error is just misleading.

I recently tried using the build api directly to generate the node-inputs. https://clojurescript.org/guides/javascript-modules

I ran into some issues there in with the js script cljsbuild uses to resolve deps. It had some issues resolving ./schema which was a folder with index.js rather than a file also had issue with rxjs/Observable. I also had this issue with rxjs in shadow-cljs initially and might be the similar root cause

https://github.com/thheller/shadow-cljs/issues/149