Skip to content

feat(sdk): add Nodejs and JavaScript SDK packages#145

Open
aaanh wants to merge 4 commits into
beava-dev:mainfrom
aaanh:aaanh/feat/sdk/node-ts
Open

feat(sdk): add Nodejs and JavaScript SDK packages#145
aaanh wants to merge 4 commits into
beava-dev:mainfrom
aaanh:aaanh/feat/sdk/node-ts

Conversation

@aaanh
Copy link
Copy Markdown
Contributor

@aaanh aaanh commented May 15, 2026

Summary

This PR introduces the Beava JavaScript workspace under beava-js/ with two npm packages:

  • @beava/node: TypeScript HTTP client for Node.js services and scripts.
  • @beava/client: browser-oriented package name that re-exports the same fetch-based API for frontend bundles.

These packages support structured machine-to-machine interaction with a running Beava server through the HTTP data plane: ping, register, push, get, batchGet, and reset.

This PR also includes package documentation, a local Node smoke-test example, and Vitest coverage for unit and HTTP integration behavior.

Deployment Instructions

No application deployment required.

For npm release:

  1. Bump versions in beava-js/packages/beava-node/package.json and beava-js/packages/beava-client/package.json.
  2. Keep @beava/client dependency on @beava/node aligned to the same version.
  3. From beava-js/, run:
pnpm install
pnpm run build
pnpm run test
  1. Publish @beava/node first, then @beava/client:
pnpm publish --filter @beava/node --access public
pnpm publish --filter @beava/client --access public

Linked Issues

None.

Local Checks

cd beava-js
pnpm exec prettier --check README.md packages/beava-node/README.md packages/beava-client/README.md examples/node-basic.mjs packages/beava-node/test/helpers/spawn-beava-server.ts
pnpm exec turbo run build --filter=@beava/node
node --check examples/node-basic.mjs
BEAVA_INTEGRATION=1 BEAVA_REPO_ROOT=/Users/anh/repos/beava pnpm exec turbo run test --filter=@beava/node
anh:beava/ (aaanh/feat/sdk/node-ts✗) $ bash .github/scripts/check.sh                               [21:52:41]

=== cargo fmt --all --check ===
  ✓ cargo fmt --all --check

=== cargo clippy --workspace --all-targets --features testing -- -D warnings ===
  ✓ cargo clippy --workspace --all-targets --features testing -- -D warnings

=== cargo test --workspace --features testing ===
  ✓ cargo test --workspace --features testing

=== ruff check python/ ===
  ✓ ruff check python/

=== pytest python (v0 acceptance suite) ===
  ✓ pytest python (v0 acceptance suite)

=== pnpm turbo lint/check-types/test (beava-js, +HTTP integration) ===
  ✓ pnpm turbo lint/check-types/test (beava-js, +HTTP integration)

─── Summary ────────────────────────────────────────────────
PASS  cargo fmt --all --check  (1s)
PASS  cargo clippy --workspace --all-targets --features testing -- -D warnings  (0s)
PASS  cargo test --workspace --features testing  (24s)
PASS  ruff check python/  (30s)
PASS  mypy --strict beava/
PASS  pytest python (v0 acceptance suite)  (17s)
PASS  pnpm turbo lint/check-types/test (beava-js, +HTTP integration)  (2s)
─── Full log: /Users/anh/.beava-check.log ─────────────────────────────────────────

Paste this into your PR description under "Verification":

PASS  cargo fmt --all --check  (1s)
PASS  cargo clippy --workspace --all-targets --features testing -- -D warnings  (0s)
PASS  cargo test --workspace --features testing  (24s)
PASS  ruff check python/  (30s)
PASS  mypy --strict beava/
PASS  pytest python (v0 acceptance suite)  (17s)
PASS  pnpm turbo lint/check-types/test (beava-js, +HTTP integration)  (2s)

Verification:

PASS  prettier check for changed beava-js docs/example/test helper
PASS  pnpm exec turbo run build --filter=@beava/node
PASS  node --check examples/node-basic.mjs
PASS  BEAVA_INTEGRATION=1 ... pnpm exec turbo run test --filter=@beava/node  (14 tests)

Pre-flight Checklist

  • JS package docs updated.
  • Local Node example added and smoke-tested against a real Beava server.
  • @beava/node build passes.
  • @beava/node unit and HTTP integration tests pass.
  • No stale repository URLs introduced.
  • Full bash .github/scripts/check.sh run, if required before merge.

Notes for the Reviewer

The integration helper now sets BEAVA_ADMIN_ADDR=127.0.0.1:0 so temporary Beava subprocesses do not collide on the default admin port 127.0.0.1:8090 during local test runs.

@aaanh aaanh changed the title fix: make sdk reference layout responsive under 1000px feat(sdk): add Nodejs and JavaScript SDK package May 15, 2026
@aaanh aaanh changed the title feat(sdk): add Nodejs and JavaScript SDK package feat(sdk): add Nodejs and JavaScript SDK packages May 15, 2026
@aaanh aaanh force-pushed the aaanh/feat/sdk/node-ts branch from 0522c11 to ffaec95 Compare May 15, 2026 02:13
@aaanh aaanh marked this pull request as ready for review May 30, 2026 01:55
@aaanh aaanh requested a review from petrpan26 as a code owner May 30, 2026 01:55
@dosubot
Copy link
Copy Markdown
Contributor

dosubot Bot commented May 30, 2026

Related Knowledge

2 documents with suggested updates are ready for review.

beava

shared /beava/blob/main/docs/sdk-api/shared.md — ⏳ Awaiting Merge
typescript /beava/blob/main/docs/sdk-api/typescript.md — ⏳ Awaiting Merge

How did I do? Any feedback?  Join Discord

aaanh added 4 commits May 29, 2026 22:06
Ship the browser package in the pnpm workspace, expand beava-js gitignore for
local tool caches, add missing eslint deps, and align check.sh plus GitHub
workflows and SOURCE-OF-TRUTH with the JS monorepo.
Expand the package READMEs and add a local Node example so npm users can install, connect, handle errors, and smoke-test the client against a Beava server.
Avoid local admin sidecar port collisions when the HTTP integration tests spawn temporary Beava servers.
@aaanh aaanh force-pushed the aaanh/feat/sdk/node-ts branch from fce5573 to bf0b051 Compare May 30, 2026 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant