feat(js): add @parity/truapi-dev-host, the local development signing host - #502
Draft
peetzweg wants to merge 2 commits into
Draft
feat(js): add @parity/truapi-dev-host, the local development signing host#502peetzweg wants to merge 2 commits into
@parity/truapi-dev-host, the local development signing host#502peetzweg wants to merge 2 commits into
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
@parity/truapi-dev-host, the local development signing host
…host Ships the truapi-host CLI as an npm dev dependency (host-rust-core#462): a process supervisor that spawns/attaches a signing-host and pre-flights its signer identity and product account, network presets that steer host and app from one knob, a truapi-dev-host launcher that wraps a dev command with the connection details injected, and a /browser export with the WebSocket-to-MessagePort bridge every product currently hand-rolls. The binary resolves through a chain (TRUAPI_HOST_BIN, installed platform package, checkout cargo build, PATH); the per-platform binary packages and their release wiring are a follow-up PR.
peetzweg
force-pushed
the
feat/truapi-dev-host
branch
from
August 25, 2026 13:02
8db2669 to
ce6acd1
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #462.
Adds
js/packages/truapi-dev-host: thetruapi-hostCLI as an npm dev dependency, wrapped in the plumbing every product currently rebuilds by hand.Why: TS product teams need a Rust toolchain and a three-minute build just to run a local signing host, then each copy ~90 lines of WebSocket↔MessagePort plumbing into their app. And because the CLI and
@parity/truapiversion independently, wire skew shows up as a misleadingMalformedFrame. Shipping both from this repo, versioned together, kills all three problems.How: two bins —
truapi-host(passthrough to the native binary, pinned by the lockfile) andtruapi-dev-host(launcher: spawns/attaches asigning-host --serve --auto-accept, waits for a real signer identity, pre-flights the product account, then runs the wrapped dev command with the frame endpoint, genesis, and resolved product id injected as env vars). The browser bridge ships as a/browsersubpath export rather than in@parity/truapi— a deliberate call, since production hosts embed the runtime in-process and never dial a WebSocket, so the transport is dev-tooling, not protocol surface. The binary resolves through a chain:TRUAPI_HOST_BIN→ installed platform package → checkout cargo build → PATH (skippingnode_modules/.bin, which would recurse into this package's own shim).Using it from this branch, before anything is published:
git switch feat/truapi-dev-host npm install npm run build --prefix js/packages/truapi-dev-host cargo build -p truapi-host-cli --bin truapi-host # or use an installed CLIthen in the consuming app:
"@parity/truapi-dev-host": "file:../host-rust-core/js/packages/truapi-dev-host"andtruapi-dev-host -- <your dev command>. The package README documents the knobs. A working consumer is paritytech/host-playground#77 — a demo-only draft that stays afile:-dependency branch until this package is merged and released, verified end to end on Paseo Next v2 (identity, raw signing, and chain-state cards in a plain browser tab).Scope notes: the per-platform binary packages and their release wiring are the follow-up PR — until then the package pins
@parity/truapi^0.9.0, the wire major currentproduct-sdk-host(0.16) pairs with. Unit tests cover network/product-id resolution and the SS58 encoder (bun test).