Liking cljdoc? Tell your friends :D

emmy.portal.deps

Functions for resolving npm dependencies declared in deps.cljs files on the classpath.

This code is a simplified version of code in thheller's shadow-cljs library and the clerk-utils library.

Functions for resolving npm dependencies declared in `deps.cljs` files on the
classpath.

This code is a simplified version of code in
thheller's [shadow-cljs](https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/devtools/server/npm_deps.clj)
library and
the [clerk-utils](https://github.com/mentat-collective/Clerk-Utils/blob/main/src/mentat/clerk_utils/build/shadow.clj)
library.
raw docstring

dep->strclj

(dep->str dep-id)

Given a dependency name (specified as a key in the :npm-deps map of deps.cljs), returns an npm-compatible (string) name for the dependency.

Given a dependency name (specified as a key in the `:npm-deps` map of
`deps.cljs`), returns an npm-compatible (string) name for the dependency.
sourceraw docstring

get-deps-from-classpathclj

(get-deps-from-classpath)

Returns a sequence of maps of the form {:id <str> :version <str> :url <url-of-this-deps.cljs>} for every dependency specified via the :npm-deps key of each deps.cljs file on the classpath.

Returns a sequence of maps of the form {:id <str> :version <str> :url
<url-of-this-deps.cljs>} for every dependency specified via the `:npm-deps`
key of each `deps.cljs` file on the classpath.
sourceraw docstring

is-installed?clj

(is-installed? {:keys [id]} package-json)

Returns true if the supplied dependency is already present in some entry in the parsed package-json, false otherwise.

Returns true if the supplied dependency is already present in some entry in the
parsed `package-json`, false otherwise.
sourceraw docstring

npm-cmdclj

System-specific NPM command, tuned for Windows or non-Windows.

System-specific NPM command, tuned for Windows or non-Windows.
sourceraw docstring

npm-install!clj

(npm-install!)

This command:

  • Triggers an npm install (if ./package.json is present)
  • Installs any dependency referenced by a deps.cljs file on the classpath

The npm install makes sure that if some dependency specified in a deps.cljs is already present in package.json that it actually ends up in node_modules.

This command:

- Triggers an `npm install` (if ./package.json is present)
- Installs any dependency referenced by a `deps.cljs` file on the classpath

The `npm install` makes sure that if some dependency specified in a
`deps.cljs` is already present in `package.json` that it actually ends up in
`node_modules`.
sourceraw docstring

read-package-jsonclj

(read-package-json)
(read-package-json install-dir)

Returns a map with the contents of package.json if it exists in install-dir (default "."), {} otherwise.

Returns a map with the contents of package.json if it exists in
`install-dir` (default "."), {} otherwise.
sourceraw docstring

resolve-conflictsclj

(resolve-conflicts deps)

Given a sequence of dependencies, returns a sequence of dependencies distinct by ID generated by picking the first one on the classpath.

Not ideal, but this is how shadow currently does it!

Given a sequence of dependencies, returns a sequence of dependencies distinct
by ID generated by picking the first one on the classpath.

Not ideal, but this is how shadow currently does it!
sourceraw docstring

sh-printclj

(sh-print command)

Takes a vector of command pieces, prints the command and prints the results.

Takes a vector of command pieces, prints the command and prints the results.
sourceraw docstring

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

× close