Skip to content

Commit 56ae0c3

Browse files
authored
NodeJS client, integration test setup (#24)
1 parent d8ba6a0 commit 56ae0c3

39 files changed

+3278
-638
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
pull_request:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
name: Build
9+
jobs:
10+
setup:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Install node
17+
uses: actions/setup-node@v3
18+
- name: Install rust
19+
run: rustup install stable
20+
- name: Build rust
21+
run: cargo build

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
push:
3+
tags:
4+
- "*"
5+
workflow_dispatch:
6+
7+
name: Publish
8+
jobs:
9+
publish-crate:
10+
name: Publish observation-tools crate
11+
runs-on: ubuntu-latest
12+
environment: crates.io
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
- name: Install rust
17+
run: rustup install stable
18+
- name: Publish
19+
run: cargo publish -p observation-tools
20+
env:
21+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,4 +509,5 @@ Cargo.lock
509509

510510
# End of https://www.toptal.com/developers/gitignore/api/node,yarn,bazel,intellij,clion+all,rust,python
511511

512-
.observation-tools/
512+
.observation-tools/
513+
*.node

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.rs

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"printWidth": 100
3+
}

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ For more details refer to [Design](docs/design.md)
2424

2525
## Coding Guidelines
2626

27-
- Always use workspace imports for dependencies to ensure consistency across crates.
27+
- Always use workspace imports for dependencies to ensure consistency across crates.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ object_store = "0.12.4"
2828
observation-tools-client = { path = "crates/observation-tools-client" }
2929
observation-tools-server = { path = "crates/observation-tools-server" }
3030
observation-tools-shared = { path = "crates/observation-tools-shared" }
31-
reqwest = "0.12.24"
31+
reqwest = { version = "0.12.24", default-features = false, features = ["rustls-tls"] }
3232
serde = { version = "1.0", features = ["derive"] }
3333
serde_json = "1.0"
3434
sled = "0.34"
@@ -38,4 +38,5 @@ tower = "0.5"
3838
tower-http = { version = "0.6", features = ["fs", "trace", "cors"] }
3939
tracing = "0.1"
4040
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
41-
uuid = { version = "1.11", features = ["v7", "serde"] }
41+
uuid = { version = "1.11", features = ["v7", "serde", "js"] }
42+
wasm-bindgen = "0.2.105"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ Export, visualize, and inspect data from anywhere in your program.
77
## License
88

99
All code, except the client library, is distributed under the GNU AGPLv3 license. The client library is licensed under
10-
the Apache-2.0 license to allow usage in commercial projects.
10+
the Apache-2.0 license to allow usage in commercial projects.

crates/observation-tools-client/Cargo.toml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,26 @@ edition.workspace = true
55
license = "Apache-2.0"
66
repository.workspace = true
77

8+
[lib]
9+
crate-type = ["cdylib"]
10+
811
[dependencies]
912
anyhow.workspace = true
13+
async-channel = "2.3"
1014
chrono.workspace = true
1115
log.workspace = true
16+
napi = { version = "3", features = ["async", "tokio_rt"] }
17+
napi-derive = { version = "3", features = ["type-def"] }
1218
observation-tools-shared.workspace = true
1319
reqwest = { workspace = true, features = ["json"] }
1420
serde.workspace = true
1521
serde_json.workspace = true
1622
thiserror.workspace = true
17-
tokio.workspace = true
23+
tokio = { workspace = true, features = ["macros", "rt", "time"] }
1824
tracing.workspace = true
1925

20-
[features]
21-
default = []
26+
[build-dependencies]
27+
napi-build = "2"
2228

2329
[dev-dependencies]
2430
tracing-subscriber.workspace = true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
napi_build::setup();
3+
}

0 commit comments

Comments
 (0)