Skip to content

Commit cdbe665

Browse files
Update examples to use 0.9.8
1 parent 6eeaa71 commit cdbe665

File tree

7 files changed

+25
-14
lines changed

7 files changed

+25
-14
lines changed

examples/fly-io/nbb.edn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{:deps
22
{logseq/graph-parser
33
{:git/url "https://github.com/logseq/logseq"
4-
:git/sha "0c4198c824489ddec0a510d1168c932bde36fa81"
5-
:git/tag "0.8.14"
4+
:git/sha "82cf4d3c65acbf230a3170640fe271dd74095067"
5+
:git/tag "0.9.8"
66
:deps/root "deps/graph-parser"}
77
#_{:local/root "../../../logseq/deps/graph-parser"}}}

examples/from-js/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ The following sections describe Node.js scripts that call Logseq's graph-parser
1717
in ClojureScript and then return control to Javascript to process the result.
1818
These scripts use a specific version of Logseq as specified in `nbb.edn`.
1919

20-
### query.js
20+
### query.mjs
2121

22-
[query.js](query.js) converts the given graph directory into a database and
22+
[query.mjs](query.mjs) converts the given graph directory into a database and
2323
then runs the given query on that database. This script is able to run any
2424
Datalog query the Logseq app can, but from the commandline. Here's how to use
2525
this script:
@@ -29,14 +29,14 @@ this script:
2929
$ git clone https://github.com/logseq/docs && cd docs
3030

3131
# Print all the page names in the graph
32-
$ node query.js . '[:find ?n :where [?b :block/name ?n]]'
32+
$ node query.mjs . '[:find ?n :where [?b :block/name ?n]]'
3333
Parsing 269 files...
3434
[
3535
"setting___enable journals",
3636
...
3737

3838
# Print all the tasks' contents
39-
$ node query.js . '[:find (pull ?b [:block/content]) :where (task ?b #{"TODO"})]'
39+
$ node query.mjs . '[:find (pull ?b [:block/content]) :where (task ?b #{"TODO"})]'
4040
Parsing 269 files...
4141
[
4242
{

examples/from-js/nbb.edn

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{:deps
22
{logseq/graph-parser
33
{:git/url "https://github.com/logseq/logseq"
4-
:git/sha "0c4198c824489ddec0a510d1168c932bde36fa81"
5-
:git/tag "0.8.14"
4+
:git/sha "82cf4d3c65acbf230a3170640fe271dd74095067"
5+
:git/tag "0.9.8"
66
:deps/root "deps/graph-parser"}
77
#_{:local/root "../../../logseq/deps/graph-parser"}}}

examples/from-js/query.js renamed to examples/from-js/query.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { loadString } from '@logseq/nbb-logseq'
22
import { exit } from 'process';
33

4-
// Expects to be called as `node query.js ...`
4+
// Expects to be called as `node query.mjs ...`
55
const args = process.argv.slice(2);
66
if (args.length < 2) {
77
console.log("Usage: $0 GRAPH-DIR QUERY");

examples/linked-data/nbb.edn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{:deps
22
{logseq/graph-parser
33
{:git/url "https://github.com/logseq/logseq"
4-
:git/sha "090d25b5e845e98ec2f003279f91ff34e4393cc6"
4+
:git/sha "82cf4d3c65acbf230a3170640fe271dd74095067"
5+
:git/tag "0.9.8"
56
:deps/root "deps/graph-parser"}
67
#_{:local/root "../../logseq/deps/graph-parser"}
78

examples/multiple-databases/multi_db.cljs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,25 @@
99
[datascript.transit :as dt]
1010
[clojure.pprint :as pprint]
1111
[clojure.edn :as edn]
12-
["fs" :as fs]))
12+
["fs" :as fs]
13+
["child_process" :as child-process]))
14+
15+
(defn- sh
16+
"Run shell cmd synchronously and print to inherited streams by default. Aims
17+
to be similar to babashka.tasks/shell
18+
TODO: Fail fast when process exits 1"
19+
[cmd opts]
20+
(child-process/spawnSync (first cmd)
21+
(clj->js (rest cmd))
22+
(clj->js (merge {:stdio "inherit"} opts))))
1323

1424
(defn- clone-graphs
1525
[graph-urls]
1626
(map (fn [graph-url]
1727
(let [graph-dir (str "graphs/" (re-find #"[^/]+$" graph-url))]
1828
(if (fs/existsSync graph-dir)
1929
(println "Graph" graph-url "is already cloned")
20-
(gp-cli/sh ["git" "clone" graph-url graph-dir] {}))
30+
(sh ["git" "clone" graph-url graph-dir] {}))
2131
graph-dir))
2232
graph-urls))
2333

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{:deps
22
{logseq/graph-parser
33
{:git/url "https://github.com/logseq/logseq"
4-
:git/sha "0c4198c824489ddec0a510d1168c932bde36fa81"
5-
:git/tag "0.8.14"
4+
:git/sha "82cf4d3c65acbf230a3170640fe271dd74095067"
5+
:git/tag "0.9.8"
66
:deps/root "deps/graph-parser"}
77
#_{:local/root "../../../logseq/deps/graph-parser"}}}

0 commit comments

Comments
 (0)