Utilities for generating custom Clerk viewer CLJS builds via shadow-cljs
.
Utilities for generating custom Clerk viewer CLJS builds via `shadow-cljs`.
(clerk-build-config cljs-namespaces)
Given sequence cljs-namespaces
of symbols naming ClojureScript namspaces,
returns a :builds
entry for a shadow-cljs
build of Clerk's viewer JS.
The resulting build will include all supplied namespaces, plus Clerk's
nextjournal.clerk.static-app
namespace.`
Given sequence `cljs-namespaces` of symbols naming ClojureScript namspaces, returns a `:builds` entry for a `shadow-cljs` build of Clerk's viewer JS. The resulting build will include all supplied namespaces, plus Clerk's `nextjournal.clerk.static-app` namespace.`
(install-npm-deps!)
This command:
npm install
deps.cljs
file on the classpathpackage.json
file.Unlike shadow-cljs
's native npm-deps/main
, this command also
installs shadow-npm-dep
, negating any need to tell the user to have
versions match or to remember to do this install themselves.
This command: - Triggers an `npm install` - Installs any dependency referenced by a `deps.cljs` file on the classpath - Installs these dependencies into the calling project's `package.json` file. Unlike `shadow-cljs`'s native `npm-deps/main`, this command also installs [[shadow-npm-dep]], negating any need to tell the user to have versions match or to remember to do this install themselves.
Output directory for our controlled shadow-cljs
build.
Output directory for our controlled `shadow-cljs` build.
(release! cljs-namespaces)
Given some sequence cljs-namespaces
of symbols representing ClojureScript
namespaces,
install-npm-deps!
Returns the path of the generated JS.
Given some sequence `cljs-namespaces` of symbols representing ClojureScript namespaces, - installs all required npm dependencies with [[install-npm-deps!]] - generates a release build of custom Clerk viewer JS. Returns the path of the generated JS.
(server-config m)
Returns a full, normalized shadow-cljs
config with no :builds
registered
beyond the defaults.
This config is sufficient to start a shadow-cljs
server.
Returns a full, normalized `shadow-cljs` config with no `:builds` registered beyond the defaults. This config is sufficient to start a `shadow-cljs` server.
Schema for the NPM dependency for shadow-cljs
associated with the
currently loaded shadow-cljs
JVM library.
Schema for the NPM dependency for `shadow-cljs` associated with the currently loaded `shadow-cljs` JVM library.
Shadow version of the currently-loaded shadow-cljs
dependency.
Shadow version of the currently-loaded `shadow-cljs` dependency.
(stop-watch!)
Shuts down the shadow-cljs
server (if running) and stops the build watcher
for the custom Clerk viewer build.
Shuts down the `shadow-cljs` server (if running) and stops the build watcher for the custom Clerk viewer build.
(watch! cljs-namespaces)
(watch! cljs-namespaces {:keys [port] :or {port 8765}})
Given some sequence cljs-namespaces
of symbols representing ClojureScript
namespaces,
install-npm-deps!
shadow-cljs
watcher process that recompiles the bundle on any file changeshadow-cljs
server.Optionally takes a map of config options:
:port
: overrides the port from which shadow-cljs
serves the JS.Returns a map with the following keys:
:js-url
: URL with the JS location:stop-fn
: No-arg function to call to kill the watcher. (You can also kill
it with stop-watch!
.)Given some sequence `cljs-namespaces` of symbols representing ClojureScript namespaces, - installs all required npm dependencies with [[install-npm-deps!]] - builds a custom Clerk viewer bundle with these namespaces included - starts a `shadow-cljs` watcher process that recompiles the bundle on any file change - serves the generated JS from a `shadow-cljs` server. Optionally takes a map of config options: - `:port`: overrides the port from which `shadow-cljs` serves the JS. Returns a map with the following keys: - `:js-url`: URL with the JS location - `:stop-fn`: No-arg function to call to kill the watcher. (You can also kill it with [[stop-watch!]].)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close