shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Dan Maltbie 2021-01-01T21:30:47.235300Z

I'm working with a package that has an alternate way to install for its "nightly" build. I've cloned the package repo to my local drive and built the package (actually it builds multiple packages but in my example I'm only using one.) The local repo serves up the package via a http interface using a simple Python server. I can then install the package using npm install with the dependency in my project package.json file of  `"@ndn/packet": "http://localhost:8000/packet.tgz"`. The package installs properly but fails when I run shadow-cljs to compile. I have tested using this package with webpack and node.js so I am confident that the Javascript stuff is working properly. Is there something I need to do with shadow-cljs to get this to work? The compile fails with the following error: (parallels) (27)# shadow-cljs compile app shadow-cljs - config: /media/psf/DataPartition/lastmile/ttncore/shadow-cljs.edn [:app] Compiling ... npm package "@ndn/packet" expected version "@ndn/tlv@http://localhost:8000/tlv.tgz" but "0.0.20201213-nightly-eb9e062" is installed. [:app] Build completed. (225 files, 6 compiled, 0 warnings, 11.57s) npm ls reports the following: (parallels) (28)# npm ls | more ttncore@0.0.1 /media/psf/DataPartition/lastmile/ttncore ├─┬ @babel/runtime@7.12.5 │ └── regenerator-runtime@0.13.7 ├─┬ @ndn/packet@0.0.20201213-nightly-eb9e062 │ ├─┬ @ndn/tlv@0.0.20201213-nightly-eb9e062 And here's a snippet from my package.json file: "dependencies": { "@babel/runtime": "^7.12.5", "@ndn/packet": "<http://localhost:8000/packet.tgz>",

thheller 2021-01-01T23:47:12.235900Z

@dmaltbie [:app] Build completed. (225 files, 6 compiled, 0 warnings, 11.57s) the build succeeded? the "expected version" thing is just a warning?

thheller 2021-01-02T10:37:27.243600Z

into shadow-cljs.edn at the top level

thheller 2021-01-02T10:39:03.243800Z

you must have a deps.cljs files somewhere. its the only file that causes those warnings. it might be in one of the cljsjs dependencies though so if the warning goes away after removing them its probably one of those

Dan Maltbie 2021-01-03T19:48:04.252500Z

I expect this is my bonehead problem, but I can't get the :npm-deps option to work. I've tried several ways with no success. I even tried it in a deps.cljs file in the src directory. Can you please look at my shadow-cljs.edn file and tell me what I'm doing wrong? You'll see I've tried it in various places in the .edn file just to see if I misplaced it. No luck. Also, I've searched for the deps.cljs file but I'm not finding one. (used find starting from root and grep to search the source tree). Thanks.

thheller 2021-01-03T20:36:26.253100Z

at the top level the one is just fine. are you maybe on an old version that doesn't have this flag?

Dan Maltbie 2021-01-03T23:01:34.253500Z

Here's what I've got:

(parallels) (157)# shadow-cljs info
shadow-cljs - config: /media/psf/DataPartition/lastmile/ttncore/shadow-cljs.edn
=== Version
jar:            2.11.11
cli:            2.11.11
deps:           1.3.2
config-version: 2.11.11

=== Java
openjdk version "11.0.9.1" 2020-11-04
OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04)
OpenJDK 64-Bit Server VM (build 11.0.9.1+1-Ubuntu-0ubuntu1.20.04, mixed mode, sharing)

Dan Maltbie 2021-01-03T23:17:36.253700Z

Also in my package.json I have (is this necessary?):

"devDependencies": {
        "onchange": "^7.1.0",
        "shadow-cljs": "^2.11.11",
        "tailwindcss": "^1.9.6"
    },

thheller 2021-01-04T00:12:35.253900Z

looks fine to me. I don't know what is up with your setup but again you can ignore the warning. it has no impact on the build whatsoever.

Dan Maltbie 2021-01-04T02:39:32.254200Z

Ok. Thanks for your help.

Dan Maltbie 2021-01-04T23:07:54.280500Z

Just curious, is there is a way to examine the option settings for a given runtime of the compiler?

thheller 2021-01-05T10:35:33.292500Z

not sure I understand the question? which "runtime" are you talking about abnd which settings?

thheller 2021-01-08T13:51:01.393500Z

hey, I just released version 2.11.12 which should get rid of the warning you asked about. it doesn't compare versions using http: etc anymore

thheller 2021-01-08T13:51:24.393700Z

in addition there is a :js-options {:check-versions false} to turn the check off completely (true by default)

Dan Maltbie 2021-01-18T18:27:41.091400Z

That worked for me!! Thanks. I really appreciate being able to weed out the extraneous warnings so that I can see any others with less clutter. Big Thumbs Up!