2023-03-27 20:59:23 +00:00
|
|
|
## Description
|
|
|
|
|
2023-09-08 17:48:47 +00:00
|
|
|
This library provides common util namespaces and resources to share between the
|
|
|
|
frontend and other non-frontend contexts. This library is not supposed to depend
|
|
|
|
on other logseq libraries. This library is compatible with ClojureScript and
|
|
|
|
with node/[nbb-logseq](https://github.com/logseq/nbb-logseq) to respectively
|
|
|
|
provide frontend and Electron/commandline functionality.
|
2023-05-10 14:36:05 +00:00
|
|
|
|
2023-03-27 20:59:23 +00:00
|
|
|
|
|
|
|
## API
|
|
|
|
|
|
|
|
This library is under the parent namespace `logseq.common`.
|
|
|
|
|
|
|
|
## 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/logseq-common.yml) for linting examples.
|
|
|
|
|
2023-05-10 14:36:05 +00:00
|
|
|
### Setup
|
|
|
|
|
|
|
|
To run linters and tests, you'll want to install yarn dependencies once:
|
|
|
|
```
|
|
|
|
yarn install
|
|
|
|
```
|
2023-03-27 20:59:23 +00:00
|
|
|
### Testing
|
|
|
|
|
2023-05-10 14:36:05 +00:00
|
|
|
To run nbb-logseq tests:
|
|
|
|
|
|
|
|
```
|
|
|
|
# Run all tests
|
|
|
|
$ yarn test
|
|
|
|
# List available options
|
|
|
|
$ yarn test -H
|
|
|
|
# Run tests with :focus metadata flag
|
|
|
|
$ yarn test -i focus
|
|
|
|
```
|
|
|
|
|
2023-03-27 20:59:23 +00:00
|
|
|
To run ClojureScript tests:
|
|
|
|
```
|
|
|
|
clojure -M:test
|
|
|
|
```
|
|
|
|
|
2023-05-10 14:36:05 +00:00
|
|
|
To auto-run ClojureScript tests while writing tests:
|
2023-03-27 20:59:23 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
clojure -M:test -w src
|
|
|
|
```
|
2023-05-10 14:36:05 +00:00
|
|
|
### Managing dependencies
|
|
|
|
|
|
|
|
See [standard nbb/cljs library advice in graph-parser](/deps/graph-parser/README.md#managing-dependencies).
|