rename server -> publisher

This commit is contained in:
2026-01-31 22:51:54 -07:00
parent 262a5f680c
commit 6028aad2f2
7 changed files with 11 additions and 13 deletions

11
publisher/.dir-locals.el Normal file
View File

@@ -0,0 +1,11 @@
((nil
. ((cider-clojure-cli-aliases . ":dev")
(eval
. (progn
(defun start-deertopia-server ()
(let ((n (cider-format-connection-params "%j" cider-launch-params)))
(when (equal n "net-deertopia")
(cider-interactive-eval
"(do (require '[net.deertopia.publisher.server :as server])
(server/start!))"))))
(add-hook 'cider-connected-hook #'start-deertopia-server))))))

23
publisher/deps.edn Normal file
View File

@@ -0,0 +1,23 @@
{:deps {org.clojure/clojure {:mvn/version "1.12.0"}
http-kit/http-kit {:mvn/version "2.8.0"}
org.clojure/tools.logging {:mvn/version "1.3.0"}
hiccup/hiccup {:mvn/version "2.0.0-RC4"}
compojure/compojure {:mvn/version "1.7.1"}
org.clojars.pntblnk/clj-ldap {:mvn/version "0.0.17"}
ring/ring-defaults {:mvn/version "0.6.0"}
babashka/fs {:mvn/version "0.5.24"}
org.clojure/core.match {:mvn/version "1.1.0"}
com.github.seancorfield/next.jdbc {:mvn/version "1.3.1070"}
org.xerial/sqlite-jdbc {:mvn/version "3.47.1.0"}
cheshire/cheshire {:mvn/version "6.1.0"}
instaparse/instaparse {:mvn/version "1.5.0"}
babashka/process {:mvn/version "0.6.25"}
org.clojure/test.check {:mvn/version "1.1.2"}
#_#_
io.github.msyds/spec-dict
{:git/sha "531d629b7f05f37232261cf9e8927a4b5915714f"}
net.deertopia/doerg {:local/root "../doerg"}}
:paths ["src" "resources" "test"]
:aliases
{:dev
{:extra-deps {vvvvalvalval/scope-capture-nrepl {:mvn/version "0.3.1"}}}}}

View File

@@ -0,0 +1,53 @@
;;; -*- mode:clojure -*-
;;;
;;; USAGE:
;;;
;;; bb -cp . -m override-deps -- [DEP-NAME INFO]…
;;;
;;; This script takes a series of deps substitutions on the command
;;; line, applies them to a deps.edn file (read on stdin), and spits
;;; the result to stdout.
;;;
;;; It is used to build the Doerg server with Nix, since Clj-nix does
;;; not resolve the local deps itself.
(ns override-deps
(:require [rewrite-clj.zip :as z]
[babashka.fs :as fs]
[clojure.edn :as edn]))
(defn apply-overrides [zloc overrides]
(loop [os (seq overrides)
loc zloc]
(if-some [[[k v] & xs] os]
(recur xs (z/assoc loc k v))
loc)))
(defn args->overrides [args]
(assert (even? (count args)))
(->> args (map edn/read-string) (apply hash-map)))
(defn -main [& args]
(let [zloc (-> (slurp *in*) z/of-string)
overrides (args->overrides args)]
(-> zloc
z/down
(z/find-value :deps) z/right
(apply-overrides overrides)
z/root-string
print)))
(comment
"Example overrides"
(def overrides '{net.deertopia/doerg "blah!!!!"
ring/ring-defaults {:mvn/version "xxxxx"}}))
(comment
"Behaviour of `args->overrides`."
(= (args->overrides ["net.deertopia/doerg" "{:mvn/version \"abc\"}"
"ring/ring-defaults" "{:local/root \"/path/to/jar\"}"])
'{ring/ring-defaults {:local/root "/path/to/jar"}
net.deertopia/doerg {:mvn/version "abc"}}))

21
publisher/package.nix Normal file
View File

@@ -0,0 +1,21 @@
{ mkCljBin
, doerg
, babashka
}:
mkCljBin {
name = "net.deertopia/publisher";
version = "0.1.0";
projectSrc = ./.;
lockfile = ../deps-lock.json;
main-ns = "net.deertopia.publisher.main";
buildInputs = [];
nativeBuildInputs = [
babashka
];
postPatch = ''
mv deps.edn deps.edn.old
bb -cp . -m override-deps < deps.edn.old > deps.edn \
net.deertopia/doerg '{:local/root "${doerg.lib}/${doerg.name}.jar"}'
'';
}

View File

@@ -0,0 +1,7 @@
(ns net.deertopia.publisher.main
(:require [net.deertopia.doerg.main :as doerg])
(:gen-class))
(defn -main []
(doerg/-main)
(println "hi from publisher"))

25
publisher/vendor.nix Normal file
View File

@@ -0,0 +1,25 @@
{ fetchzip
, fetchurl
}:
{
ibm-plex-serif = fetchzip {
url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-serif%401.1.0/ibm-plex-serif.zip";
hash = "sha256-8ygaAeMKygYS4GCub4YUQmkh87pYHfi3s0PQ6AbaeGw=";
};
ibm-plex-math = fetchzip {
url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-math%401.1.0/ibm-plex-math.zip";
hash = "sha256-dJA6uqxa/yb3eLY4l39NeP0yIl2NfrbaRpf6h0/F7Xc=";
};
ibm-plex-sans-kr = fetchzip {
url = "https://github.com/IBM/plex/releases/download/%40ibm%2Fplex-sans-kr%401.1.0/ibm-plex-sans-kr.zip";
hash = "sha256-FsHxMvLlI4yylgG96DOZIdW2DYpk7I+c5QgkVIkNZIE=";
};
"d3.v7.min.js" = fetchurl {
url = "https://d3js.org/d3.v7.min.js";
hash = "sha256-8glLv2FBs1lyLE/kVOtsSw8OQswQzHr5IfwVj864ZTk=";
};
}