Skip to content

Commit 67109b3

Browse files
committed
Remove algolia
1 parent 26e1f3e commit 67109b3

File tree

6 files changed

+2
-68
lines changed

6 files changed

+2
-68
lines changed

config.edn

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
getclojure.algolia/algolia-app-id #config/env "ALGOLIA_APP_ID"
3-
getclojure.algolia/algolia-admin-api-key #config/env "ALGOLIA_ADMIN_API_KEY"
4-
getclojure.algolia/algolia-index #config/env "ALGOLIA_INDEX"
52
getclojure.elastic/elastic-url #config/env "BONSAI_URL"
63
getclojure.elastic/index-name #config/env "INDEX_NAME"
74
getclojure.config/env #config/env "APP_ENV"

env.example

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
export DB_URL="jdbc:postgresql://localhost:5432/getclojure?user=postgres&password=postgres"
2-
export ALGOLIA_ADMIN_API_KEY="abc123"
3-
export ALGOLIA_INDEX="index_name"
4-
export ALGOLIA_APP_ID="APPID"
51
export APP_ENV="development"
62
export BONSAI_URL="https://foo:[email protected]:123"
73
export INDEX_NAME="getclojure"

project.clj

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
:url "http://www.eclipse.org/legal/epl-v10.html"}
66
:dependencies [[org.clojure/clojure "1.11.1"]
77
[org.babashka/sci "0.3.5"]
8-
[cheshire "5.10.2"]
98
[ring/ring-jetty-adapter "1.9.5"]
109
[ring/ring-defaults "0.3.3"]
1110
[compojure "1.6.2"]
1211
[hiccup "1.0.5"]
1312
[com.github.seancorfield/next.jdbc "1.2.780"]
1413
[org.postgresql/postgresql "42.3.4"]
1514
[com.outpace/config "0.13.5"]
16-
[com.algolia/algoliasearch-core "3.16.5"]
17-
[com.algolia/algoliasearch-java-net "3.16.5"]
1815
[enlive "1.1.6"]
1916
[com.taoensso/timbre "5.2.1"]
2017
[prismatic/schema "1.2.1"]
@@ -39,8 +36,7 @@
3936
"extract-sexp-input-file" ["trampoline" "run" "-m" "getclojure.extract" "sexps"]
4037
;; Generate files for seed, analysis, and presentation
4138
"gen-working-sexps" ["trampoline" "run" "-m" "getclojure.sexp" "working"]
42-
"gen-formatted-sexps" ["trampoline" "run" "-m" "getclojure.sexp" "formatted"]
43-
"gen-algolia-json" ["trampoline" "run" "-m" "getclojure.sexp" "algolia"]}
39+
"gen-formatted-sexps" ["trampoline" "run" "-m" "getclojure.sexp" "formatted"]}
4440
:jvm-opts ["--add-modules" "jdk.incubator.foreign"
4541
"--enable-native-access=ALL-UNNAMED"]
4642
:min-lein-version "2.0.0")

src/getclojure/algolia.clj

-29
This file was deleted.

src/getclojure/db.clj

-10
This file was deleted.

src/getclojure/sexp.clj

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
(ns getclojure.sexp
22
(:refer-clojure :exclude [eval])
33
(:require
4-
[cheshire.core :as json]
54
[clojure.java.io :as io]
65
[clojure.string :as str]
76
[getclojure.format :as fmt]
@@ -138,19 +137,6 @@
138137
format-coll
139138
(spit "resources/sexps/formatted-sexps.edn")))
140139

141-
(s/defn generate-algolia-json-file
142-
"Provided a `filename`, reads a file containing a collection of maps of the
143-
form {:input ... :output ... :value ...} and writes to a file a json-encoded
144-
collection of the form: [{\"input\" ... \"value\" ... \"output\" ...
145-
\"formatted-input\" ... \"formatted-value\" ... \"formatted-output\" ...}] for
146-
uploading to an algolia index."
147-
[filename :- s/Str]
148-
(log/info "Generating algolia output.json")
149-
(spit "output.json"
150-
(->> (read-resource filename)
151-
format-coll
152-
(json/encode))))
153-
154140
(s/defn generate-working-sexps-file
155141
[filename :- s/Str]
156142
(log/info "Generating working-sexps.edn")
@@ -160,11 +146,9 @@
160146
(let [op (first args)]
161147
(case op
162148
"working" (generate-working-sexps-file "sexps/input.edn")
163-
"algolia" (generate-algolia-json-file "sexps/working-sexps.edn")
164149
"formatted" (generate-formatted-collection "sexps/working-sexps.edn")
165-
(do (println "Valid arguments: working, algolia, or formatted.")
150+
(do (println "Valid arguments: working, formatted.")
166151
(println " - `working` produces `sexps/working-sexps.edn` from `sexps/input.edn` which contains all s-expressions which run in SCI")
167-
(println " - `algolia` produces `output.json` from `sexps/working-sexps.edn` for consumption by Algolia")
168152
(println " - `formatted` produces `sexps/formatted-sexps.edn` from `sexps/working-sexps.edn` for ElasticSearch"))))
169153

170154
(shutdown-agents)

0 commit comments

Comments
 (0)