degree9 / boot-npm Goto Github PK
View Code? Open in Web Editor NEWNode Package Manager (NPM) wrapper task for boot-clj
Home Page: https://oss.degree9.io/
License: MIT License
Node Package Manager (NPM) wrapper task for boot-clj
Home Page: https://oss.degree9.io/
License: MIT License
I've been having some difficulties lately to make npm
work with a private repo (hosted on github), I wouldn't get into details here (unless you want me to). Apparently yarn works better in this specific case. I wonder if it would be difficult to make this task to be able to work with both npm
and yarn
?
*Automate commands at bottom of blog post.
Hi and thanks as usual for your good work on these libs!
With the latest boot-css
(which contains boot-npm
1.10.0-SNAPSHOT
), I get the following warnings from npm
:
Adding file to fileset...
• ./package.json -> ./package.json
Executing Process: npm
npm WARN saveError ENOENT: no such file or directory, open '/home/arichiardi/.boot/cache/cache/project/home/arichiardi/git/ar-website/degree9.boot-npm/cache/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/arichiardi/.boot/cache/cache/project/home/arichiardi/git/ar-website/degree9.boot-npm/cache/package.json'
npm WARN cache No description
npm WARN cache No repository field.
npm WARN cache No README data
npm WARN cache No license field.
Minor, maybe the task can take the info from boot or use some temporary data for package.json
?
for call like
(npm/npm :package "package.edn"
:cache-key ::npm-modules)
gives me:
$ boot watch dev-build
java.lang.Thread.run Thread.java: 748
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 624
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1149
java.util.concurrent.FutureTask.run FutureTask.java: 266
...
clojure.core/binding-conveyor-fn/fn core.clj: 1938
boot.core/boot/fn core.clj: 1032
...
boot.core/construct-tasks core.clj: 994
clojure.core/apply core.clj: 646
...
boot.user$eval1912$fn__1913.doInvoke : 39
...
degree9.boot-npm/eval1807/fn boot_npm.clj: 53
...
degree9.boot-npm/deep-merge boot_npm.clj: 10
degree9.boot-npm/deep-merge boot_npm.clj: 24
clojure.core/apply core.clj: 648
...
clojure.core/merge-with core.clj: 2942
clojure.core/merge-with core.clj: 2950
clojure.core/reduce1 core.clj: 915
clojure.core/reduce1 core.clj: 925
clojure.core/merge-with/merge2 core.clj: 2957
clojure.core/reduce1 core.clj: 925
clojure.core/merge-with/merge-entry core.clj: 2954
clojure.core/partial/fn core.clj: 2516
...
degree9.boot-npm/deep-merge boot_npm.clj: 10
degree9.boot-npm/deep-merge boot_npm.clj: 30
clojure.core/apply core.clj: 646
...
clojure.core/merge core.clj: 2932
clojure.core/merge core.clj: 2939
clojure.core/reduce1 core.clj: 915
clojure.core/reduce1 core.clj: 925
clojure.core/merge/fn core.clj: 2940
clojure.core/conj core.clj: 82
java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IPersistentCollection
clojure.lang.ExceptionInfo: java.lang.String cannot be cast to clojure.lang.IPersistentCollection
line: 65
Is there anything changed for post 1.0 ? or this is a regression?
would be great to be able to install directly via git ex. kubernetes-client/javascript#65
I tried this again and now it seems to work.
But next thing I that got me stuck is that you generate some custom package.json file,
contents of which I can't control.
I'd be fine it you can take entire package.json in a form of Clojure map or have a way to disable creation or copying of this file.
At the moment it is not clear how to make npm module available in your application.
Say, I want to use pluralise module, what are steps to make it available in the application?
I'd be happy to submit a PR with updated docs, but I need to figure this out for myself first.
Hi
currently, boot-npm doesn’t work on windows. That because the executable for npm is actually a wrapper called npm.cmd
, and neither windows nor commons-exec is smart enough to slap on the .cmd
extension when asked to execute npm
.
I have two fixes for the problem:
npm
through the windows interpreter cmd.exe
. cmd.exe
figures out the missing extension. What I like about this solution is that it’s fairly generic. It could be pushed down at least to boot-exec, and plausibly to clj-commons-exec or even apache commons-exec.cmd
extension, making it simpler than the fix aboveobviously, both fixes leave the everything as usual on non-windows platforms.
Would you be interested in a pull request for one fix or the other?
Hey there!
I'm experiencing a "Unable to resolve symbol: deep-merge in this context" error. Here are the steps to reproduce:
boot help
.boot-clj fails with the following stacktrace:
$ boot help
Classpath conflict: org.clojure/clojure version 1.9.0 already loaded, NOT loading version 1.8.0
Boot.main Boot.java: 257
...
jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke DelegatingMethodAccessorImpl.java: 43
jdk.internal.reflect.NativeMethodAccessorImpl.invoke NativeMethodAccessorImpl.java: 62
jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 NativeMethodAccessorImpl.java
boot.App.main App.java: 491
boot.App.runBoot App.java: 399
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 150
org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 159
...
boot.main/-main main.clj: 216
boot.main/-main/fn main.clj: 216
clojure.core/load-string core.clj: 4055
clojure.core/load-reader core.clj: 4053
...
boot.user$eval174.invoke : 13
boot.user$eval174.invokeStatic : 13
...
clojure.core/require core.clj: 5947 (repeats 2 times)
clojure.core/apply core.clj: 659
...
clojure.core/load-libs core.clj: 5909
clojure.core/load-libs core.clj: 5925
clojure.core/apply core.clj: 659
...
clojure.core/load-lib core.clj: 5868
clojure.core/load-lib core.clj: 5887
clojure.core/load-lib/fn core.clj: 5888
clojure.core/load-one core.clj: 5848
...
clojure.core/load core.clj: 6029
clojure.core/load core.clj: 6045
clojure.core/load/fn core.clj: 6046
...
java.lang.RuntimeException: Unable to resolve symbol: deep-merge in this context
clojure.lang.ExceptionInfo: Unable to resolve symbol: deep-merge in this context
line: 72
I see that deep-merge
function is called in boot_npm.clj
https://github.com/degree9/boot-npm/blob/master/src/degree9/boot_npm.clj#L72, and I have no idea where it comes from. Could you please point me to its origin?
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.