Liking cljdoc? Tell your friends :D

mentat.clerk-utils.build.shadow

Utilities for generating custom Clerk viewer CLJS builds via shadow-cljs.

Utilities for generating custom Clerk viewer CLJS builds via `shadow-cljs`.
raw docstring

clerk-build-configclj

(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.`
sourceraw docstring

install-npm-deps!clj

(install-npm-deps!)

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.

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.
sourceraw docstring

js-pathclj

Location of the generated JS code.

Location of the generated JS code.
sourceraw docstring

output-dirclj

Output directory for our controlled shadow-cljs build.

Output directory for our controlled `shadow-cljs` build.
sourceraw docstring

release!clj

(release! cljs-namespaces)

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.

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.
sourceraw docstring

server-configclj

(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.
sourceraw docstring

shadow-npm-depclj

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.
sourceraw docstring

shadow-versionclj

Shadow version of the currently-loaded shadow-cljs dependency.

Shadow version of the currently-loaded `shadow-cljs` dependency.
sourceraw docstring

stop-watch!clj

(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.
sourceraw docstring

watch!clj

(watch! cljs-namespaces)
(watch! cljs-namespaces {:keys [port] :or {port 8765}})

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!.)
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!]].)
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close