forked from logseq/logseq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deps need to be independent to not introduce testing bugs. These bb tasks are good candidates to move into bb-tasks gitlib
- Loading branch information
1 parent
17d2462
commit ee9f390
Showing
14 changed files
with
162 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
## Description | ||
|
||
This library provides a minimal API for using a | ||
[datascript](https://github.com/tonsky/datascript) database from the Logseq app | ||
and the CLI. This library is compatible with ClojureScript and with | ||
[nbb-logseq](https://github.com/logseq/nbb-logseq) to respectively provide | ||
frontend and commandline functionality. | ||
|
||
## API | ||
|
||
This library is under the parent namespace `logseq.db`. This library provides | ||
two main namespaces, `logseq.db` and `logseq.db.rules`. | ||
|
||
## Usage | ||
|
||
See usage in `deps/graph-parser` and in the Logseq app. | ||
|
||
## Dev | ||
|
||
This follows the practices that [the Logseq frontend | ||
follows](/docs/dev-practices.md). Most of the same linters are used, with | ||
configurations that are specific to this library. See [this library's CI | ||
file](/.github/workflows/db.yml) for linting examples. | ||
|
||
### Setup | ||
|
||
To run linters, you'll want to install yarn dependencies once: | ||
``` | ||
yarn install | ||
``` | ||
|
||
This step is not needed if you're just running the application. | ||
|
||
## Linting | ||
|
||
### Datalog linting | ||
|
||
Our rules are linted through a script that also uses the datalog-parser. To run this linter: | ||
``` | ||
bb lint:rules | ||
``` | ||
|
||
|
||
### Managing dependencies | ||
|
||
The package.json dependencies are just for testing and should be updated if there is | ||
new behavior to test. | ||
|
||
The deps.edn dependecies are used by both ClojureScript and nbb-logseq. Their | ||
versions should be backwards compatible with each other with priority given to | ||
the frontend. _No new dependency_ should be introduced to this library without | ||
an understanding of the tradeoffs of adding this to nbb-logseq. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{:paths ["src"] | ||
:min-bb-version "0.8.156" | ||
:deps | ||
{logseq/bb-tasks | ||
#_{:local/root "../../../bb-tasks"} | ||
{:git/url "https://github.com/logseq/bb-tasks" | ||
:git/sha "abb32ccd26405d56fd28a29d56f3cb902b8c4334"}} | ||
|
||
:pods | ||
{clj-kondo/clj-kondo {:version "2022.02.09"}} | ||
|
||
:tasks | ||
{test:load-all-namespaces-with-nbb | ||
logseq.bb-tasks.nbb.test/load-all-namespaces | ||
|
||
lint:large-vars | ||
logseq.bb-tasks.lint.large-vars/-main | ||
|
||
lint:carve | ||
logseq.bb-tasks.lint.carve/-main | ||
|
||
lint:rules | ||
{:requires ([logseq.bb-tasks.lint.datalog :as datalog] | ||
[logseq.db.rules :as rules]) | ||
:doc "Lint datalog rules for parsability and unbound variables" | ||
:task (datalog/lint-rules | ||
(into rules/rules | ||
(-> rules/query-dsl-rules | ||
;; TODO: Update linter to handle false positive on ?str-val | ||
(dissoc :property) | ||
vals)))}} | ||
|
||
:tasks/config | ||
{:large-vars | ||
{:max-lines-count 30}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{:min-bb-version "0.8.156" | ||
:deps | ||
{logseq/bb-tasks | ||
#_{:local/root "../../../bb-tasks"} | ||
{:git/url "https://github.com/logseq/bb-tasks" | ||
:git/sha "abb32ccd26405d56fd28a29d56f3cb902b8c4334"}} | ||
|
||
:pods | ||
{clj-kondo/clj-kondo {:version "2022.02.09"}} | ||
|
||
:tasks | ||
{test:load-all-namespaces-with-nbb | ||
logseq.bb-tasks.nbb.test/load-all-namespaces | ||
|
||
lint:large-vars | ||
logseq.bb-tasks.lint.large-vars/-main | ||
|
||
lint:carve | ||
logseq.bb-tasks.lint.carve/-main} | ||
|
||
:tasks/config | ||
{:large-vars | ||
{:max-lines-count 75}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.