Fold jolt-deps into the jolt binary

Dependency resolution now lives in the `jolt` CLI itself instead of a separate
jolt-deps executable. `jolt` resolves a deps.edn into JOLT_PATH/JOLT_APP_PATHS
in-process and dispatches the deps subcommands:

  jolt -M:alias [args]   run the alias :main-opts
  jolt -A:alias CMD      run CMD with the alias paths
  jolt run FILE          resolve, then run FILE
  jolt path | tasks | task NAME

A deps.edn in the working dir is auto-resolved for the runnable commands
(repl/-m/-e/nrepl-server/FILE), so e.g. `jolt -M:nrepl` (or plain
`jolt nrepl-server`) starts an nREPL with the project and its deps loaded.

The runtime core stays deps-agnostic — it only reads JOLT_PATH. The resolver
(deps.janet) is reached only from the CLI entry and loads jpm lazily, so a run
with no deps.edn never touches it and an app baked from its own jolt/api entry
never links it. resolve-deps-argv only resolves on an explicit deps command or
when a deps.edn is present; help/version never do.

jolt-deps stays as a thin deprecation shim that forwards to `jolt`, so existing
scripts keep working. Docs (README, CLAUDE.md, building-and-deps, tools-deps)
and the help text updated.
This commit is contained in:
Yogthos 2026-06-15 22:17:35 -04:00
parent 048de0200d
commit 0df9493b49
8 changed files with 274 additions and 139 deletions

View file

@ -10,13 +10,14 @@ A Clojure implementation on top of [Janet](https://janet-lang.org). Jolt reads C
git clone https://github.com/jolt-lang/jolt.git
cd jolt
git submodule update --init # pulls vendor/sci and vendor/clojure-test-suite
jpm build # builds build/jolt and build/jolt-deps
jpm build # builds build/jolt (one binary)
```
Requires `jpm` and a recent Janet (CI-tested against 1.41). See
[docs/building-and-deps.md](docs/building-and-deps.md) for build details, the
`jpm clean` caveat, how namespaces are resolved (`JOLT_PATH`), and pulling
Clojure libraries from a `deps.edn` with the `jolt-deps` tool.
Clojure libraries from a `deps.edn` (resolved by `jolt` itself — `jolt -M:…`,
`jolt run`, `jolt path`).
## Run
@ -164,6 +165,11 @@ jolt nrepl-server 12345 # choose a port
jolt nrepl-server 0.0.0.0:12345 # choose host and port (alias: nrepl)
```
In a project with a `deps.edn`, `jolt nrepl-server` auto-resolves it, so the
server starts with the project and its dependencies on the path — connect your
editor, then `(require 'your.app)`. (Equivalently, add `:aliases {:nrepl
{:main-opts ["nrepl-server"]}}` and run `jolt -M:nrepl`.)
Supported ops: `clone`, `describe`, `eval`, `load-file`, `close`, `ls-sessions`,
`interrupt` (acknowledged; an in-flight eval can't actually be interrupted), and
`eldoc`. `eval` streams `out`, reports the current `ns`, evaluates each form in