Skip to content

Commit

Permalink
Fix tests and lints
Browse files Browse the repository at this point in the history
- Fix publishing tests missing dev dep and workaround nbb.edn bug
- Fix regex which fails in cljs tests
- Fix typo
- Fix missing dep in job
  • Loading branch information
logseq-cldwalker authored and tiensonqin committed Apr 9, 2023
1 parent fef07fe commit 12c0ae3
Show file tree
Hide file tree
Showing 6 changed files with 380 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/publishing.yml
Expand Up @@ -52,9 +52,11 @@ jobs:
distribution: 'zulu'
java-version: ${{ env.JAVA_VERSION }}

- name: Set up Babashka
# Clojure needed for bb step
- name: Set up Clojure
uses: DeLaGuardo/setup-clojure@10.1
with:
cli: ${{ env.CLOJURE_VERSION }}
bb: ${{ env.BABASHKA_VERSION }}

- name: Fetch yarn deps
Expand Down
2 changes: 1 addition & 1 deletion deps/graph-parser/src/logseq/graph_parser/cli.cljs
Expand Up @@ -30,7 +30,7 @@ TODO: Fail fast when process exits 1"
;; See https://git-scm.com/docs/git-ls-files#_output for more
(let [files (->> (str (.-stdout (sh ["git" "ls-files" "-z"]
{:cwd dir :stdio nil})))
(#(string/split % #"\0"))
(#(string/split % (re-pattern "\0")))
(map #(hash-map :file/path (str dir "/" %)))
graph-parser/filter-files)]
(mapv #(assoc % :file/content (slurp (:file/path %))) files)))
Expand Down
7 changes: 4 additions & 3 deletions deps/publishing/nbb.edn
@@ -1,7 +1,8 @@
{:paths ["src"]
:deps
{logseq/graph-parser
;; Nbb bug. Should just be "../db"
{:local/root "../../../../db"}
{;; logseq/db should just be "../db". Fine on CI but locally it requires three
;; levels more. Disabled until bug is sorted out
; logseq/db
;{:local/root "../../../../db"}
io.github.nextjournal/nbb-test-runner
{:git/sha "60ed57aa04bca8d604f5ba6b28848bd887109347"}}}
5 changes: 3 additions & 2 deletions deps/publishing/package.json
Expand Up @@ -3,12 +3,13 @@
"version": "1.0.0",
"private": true,
"devDependencies": {
"@logseq/nbb-logseq": "^1.2.168"
"@logseq/nbb-logseq": "^1.2.168",
"mldoc": "^1.5.1"
},
"dependencies": {
"fs-extra": "9.1.0"
},
"scripts": {
"test": "yarn nbb-logseq -cp test:../graph-parser/src -m nextjournal.test-runner"
"test": "yarn nbb-logseq -cp test:../db/src:../graph-parser/src -m nextjournal.test-runner"
}
}
2 changes: 1 addition & 1 deletion deps/publishing/src/logseq/publishing/db.cljs
Expand Up @@ -6,7 +6,7 @@

(defn ^:api get-area-block-asset-url
"Returns asset url for an area block used by pdf assets. This lives in this ns
because it is used by this dep and needs to be indepent from the frontend app"
because it is used by this dep and needs to be independent from the frontend app"
[block page]
(when-some [props (and block page (:block/properties block))]
(when-some [uuid (:block/uuid block)]
Expand Down

0 comments on commit 12c0ae3

Please sign in to comment.