SHI SHUJUN 1a162ae3f0 fix: installation script handling of icons and user-level installations. (#12510) 7 hodín pred
..
lib 92999a6a76 use agent-browser for sync parallel clients tests 1 týždeň pred
resources e90191f632 script: add create-graph-with-clojuredocs 4 mesiacov pred
src 292db15345 add script to create clojure irc graph 2 dní pred
test ca6c254328 add offline scenario tests for chrome instances 1 deň pred
.gitignore 5186070248 Finish migration of publishing to deps 3 rokov pred
README.md ed805f039f chore: cleanup bb tasks after file graph removal 2 mesiacov pred
build-ios.sh 3bb17b46fd chore: bump to 0.8.12 3 rokov pred
bump-version.sh c22f8693cc fix: buildVersion should be a string 11 mesiacov pred
deps.edn 7f0f5f4f70 fix: create graph script not working 2 rokov pred
get-pkg-version.js 390a7f6bb9 chore(scripts): use prerelease style alpha version num 2 rokov pred
install-linux.sh 1a162ae3f0 fix: installation script handling of icons and user-level installations. (#12510) 7 hodín pred
nbb.edn ca14110a86 fix: nbb scripts failing to start 3 mesiacov pred
package.json a1b171a20e chore: bump nbb-logseq to feat-db-v34 1 týždeň pred
patch-xcode-project.sh 1e5ee6f25e Add shortcuts to patch 6 mesiacov pred
sync-open-chrome-tab-analyze-artifact.cjs 987fa8ec48 handle tx/reject too 1 týždeň pred
sync-open-chrome-tab-replay-local.cjs 8e0114a793 chore(sync-tools): add checksum drift and replay diagnostics tooling 1 týždeň pred
sync-open-chrome-tab-simulate.cjs ca6c254328 add offline scenario tests for chrome instances 1 deň pred
sync-open-electrion-simulate.cjs 8f2e2db7c6 nested tree instead of flat list 1 týždeň pred
yarn.lock a1b171a20e chore: bump nbb-logseq to feat-db-v34 1 týždeň pred

README.md

Description

This is a collection of development related scripts, written as bash scripts, bb/babashka scripts and nbb scripts.

Usage

Babashka scripts

Most bb scripts live under src/ and are defined as bb tasks. See babashka tasks

Nbb scripts

Before running nbb-logseq scripts, be sure to have node >= 18.14 installed as well as a recent babashka for managing the dependencies in nbb.edn. Then yarn install to install dependencies

Create graph scripts

These scripts generate custom database graphs written with nbb-logseq. If this is your first time generating a DB graph, first try the dev:create bb task in db graph tasks as it only requires writing EDN.

Creating graphs from the commandline using scripts and a concise EDN map is possible thanks to nbb-logseq and the namespaces logseq.outliner.db-pipeline and logseq.db.sqlite.build. For example, the create_graph_with_properties.cljs script uses this ns to create a graph with a variety of properties:

$ yarn nbb-logseq src/logseq/tasks/db_graph/create_graph_with_properties.cljs woot
Generating 16 pages and 24 blocks ...
Created graph woot!

NOTE: To use this created graph, click on the three dots menu in the upper right corner and select Import. Then click on the SQLite import button and upload the generated graph.

This script creates a DB graph with blocks containing several property types for both single and many cardinality. It also includes queries for most of these properties. Read the docs in logseq.db.sqlite.build for specifics on the EDN map.

To create large graphs with varying size:

$ yarn -s nbb-logseq src/logseq/tasks/db_graph/create_graph_with_large_sizes.cljs large
Building tx ...
Built 21000 tx, 1000 pages and 20000 blocks ...
Transacting chunk 1 of 21 starting with block: #:block{:name "page-0"}
...
Created graph large with 187810 datoms!

# To see options available
$ yarn -s nbb-logseq src/logseq/tasks/db_graph/create_graph_with_large_sizes.cljs -h
Usage: $0 GRAPH-NAME [OPTIONS]
Options:
  -h, --help        Print help
  -p, --pages  1000 Number of pages to create
  -b, --blocks 20   Number of blocks to create

Another example is the create_graph_with_schema_org.cljs script which creates a graph with the https://schema.org/ ontology with as many of the classes and properties as possible:

$ yarn -s nbb-logseq src/logseq/tasks/db_graph/create_graph_with_schema_org.cljs schema
Skipping 67 superseded properties
Skipping 25 properties with unsupported data types
Renaming 1 properties due to page name conflicts
Generating 2268 pages with 900 classes and 1368 properties ...
Created graph schema!

Update graph scripts

For database graphs, it is recommended to use logseq.outliner.db-pipeline/add-listener! when updating graphs. TODO