Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.DS_Store
node_modules/
result
lib/*
35 changes: 29 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,38 @@ const options = {
## Requirements

- Node.js 18+
- liblogos_core built and available
- ffi-napi and ref-napi dependencies
- liblogos_core and logos_host binaries

## Building liblogos_core
## Setting Up Binaries

Before using this SDK, ensure liblogos_core is built:
The SDK ships with platform-specific binaries under `lib/{platform}/` and `bin/{platform}/`. Run `nix run .#copy-libs` on each target platform to populate them:

```bash
./scripts/run_core.sh build
cd logos-js-sdk
nix build
nix run .#copy-libs
```

The library should be available at `logos-liblogos/build/lib/liblogos_core.{dylib|so|dll}` and plugins at `logos-liblogos/build/modules/`.
This copies `liblogos_core` and `logos_host` into the current platform's subdirectory:

```
lib/
darwin-arm64/liblogos_core.dylib
linux-x64/liblogos_core.so
...
bin/
darwin-arm64/logos_host
linux-x64/logos_host
...
```

Run on each platform (or in CI) to build a multi-platform SDK. These directories are checked into git so they're included in npm publish.

At runtime, the SDK auto-selects the correct subdirectory for the current OS/arch.

### Resolution order

1. `sdk/lib/{platform}/` and `sdk/bin/{platform}/` — multi-platform layout
2. `sdk/lib/` and `sdk/bin/` — single-platform fallback
3. `LOGOS_LIBLOGOS_ROOT` env var — dev environment fallback
4. `sdk/result/` — nix build symlink (local `file:` deps)
287 changes: 279 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading