It appears that Clerk NPM dependencies are written to our package.json via our shadow build. Is this intended Clerk behavior? ๐งต
$ git st
On branch clerklol
nothing to commit, working tree clean
$ make shadow-dev
clojure -M:backend:dev:test:shadow -m shadow.cljs.devtools.cli watch client portfolio
WARNING: abs already refers to: #'clojure.core/abs in namespace: clojure.math.numeric-tower, being replaced by: #'clojure.math.numeric-tower/abs
WARNING: abs already refers to: #'clojure.core/abs in namespace: geo.spatial, being replaced by: #'clojure.math.numeric-tower/abs
running: npm install --save --save-exact katex@^0.12.0 markdown-it@^14.1.0 punycode@2.1.1 markdown-it-block-image@^0.0.3 markdown-it-texmath@^1.0.0 markdown-it-footnote@^3.0.3 markdown-it-toc-done-right@^4.2.0
[... NPM stuff omitted]
^Cmake: *** [shadow-dev] Error 130
make shadow-dev 26.24s user 0.98s system 246% cpu 11.050 total
$ git st
On branch clerklol
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: package-lock.json
modified: package.json
no changes added to commit (use "git add" and/or "git commit -a")
$ git diff package.json
diff --git a/package.json b/package.json
index 271f8b9a..df5d5d59 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,13 @@
"@js-joda/core": "3.2.0",
"@js-joda/timezone": "2.21.1",
"@mattilsynet/design": "^2.1.2",
+ "katex": "0.12.0",
+ "markdown-it": "14.1.0",
+ "markdown-it-block-image": "0.0.3",
+ "markdown-it-footnote": "3.0.3",
+ "markdown-it-texmath": "1.0.0",
+ "markdown-it-toc-done-right": "4.2.0",
+ "punycode": "2.1.1",
"snabbdom": "3.5.1"
}
} I'm not completely sure whether this is actually what's happening yet, so take this with a grain of salt. I'm working on a minimal repro.
My wild guess is that katex and friends could have been dev dependencies? Or do we Clerk consumers need them for something? As far as I'm aware, Clerk runs just fine without a CLJS build.
minimal repro!
;; deps.edn
{:aliases
{:shadow {:extra-deps {thheller/shadow-cljs {:mvn/version "3.3.4"}}}
:dev {:extra-deps {io.github.nextjournal/clerk {:mvn/version "0.18.1150"}}}
}}
then,
clojure -M:dev:shadow -m shadow.cljs.devtools.cli watch client portfolio
then, observe package.json has been modified.
Please advise if I'm doing something stupid, or am pointing the finger in the wrong direction.Same behavior on {:mvn/version "0.18.1150"} and {:mvn/version "0.18.1158"}.
A reasonable workaround appears to be not to put Clerk on Shadow-CLJS's classpath.
I ended up moving Clerk, Noj and notebooks/ to its own :science alias, which is not turned on when Shadow-CLJS builds our Clojurescript.
these look like the npm deps of nextjournal/markdown
https://github.com/nextjournal/markdown/blob/main/src/deps.cljs