Skip to content

feat(client): napi binding + JS wrapper#405

Closed
branchseer wants to merge 1 commit into
feat/runner-protocolfrom
feat/runner-js-bridge
Closed

feat(client): napi binding + JS wrapper#405
branchseer wants to merge 1 commit into
feat/runner-protocolfrom
feat/runner-js-bridge

Conversation

@branchseer
Copy link
Copy Markdown
Member

Adds the JS surface that lets spawned Node tools talk to the runner
over the IPC introduced in the previous PR:

  • crates/vite_task_client_napi — napi binding that exposes the Rust
    Client to JS as a RunnerClient returned from load().
  • packages/vite-task-client — JS wrapper with ignoreInput,
    ignoreOutput, disableCache, getEnv, and getEnvs. Types live
    in index.js as JSDoc; index.d.ts is generated via
    pnpm build-vite-task-client-types and a CI staleness check fails
    the build if the committed .d.ts drifts from the source.

The package is consumable as a no-op outside the runner: when
VP_RUN_NODE_CLIENT_PATH isn't set, load() returns null and every
exported function becomes a no-op (or returns undefined/{}). That
means the wrapper is safe to add as a regular dependency from a tool
that wants to opt in to runner-aware behavior without requiring its
users to run under vp.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Copy link
Copy Markdown
Member Author

branchseer commented May 28, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@socket-security
Copy link
Copy Markdown

socket-security Bot commented May 28, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedcargo/​napi@​3.9.08210093100100
Addedcargo/​napi-build@​2.3.29810093100100
Addedcargo/​napi-derive@​3.5.69910093100100

View full report

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b6728fc85

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
"name": "@voidzero-dev/vite-task-client",
"version": "0.0.0",
"private": true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the private flag before publishing the client

This package is described as a regular dependency / separately npm-published JS wrapper, but private: true makes npm/pnpm refuse publication. In the release path for @voidzero-dev/vite-task-client, this leaves consumers unable to install the bridge even though the package metadata and generated types are present.

Useful? React with 👍 / 👎.

@branchseer branchseer force-pushed the feat/runner-js-bridge branch from 6b6728f to 69e90aa Compare May 28, 2026 08:02
@branchseer branchseer force-pushed the feat/runner-protocol branch from 68ad1bc to 64e2883 Compare May 28, 2026 08:02
@branchseer branchseer force-pushed the feat/runner-js-bridge branch from 69e90aa to 887d8a1 Compare May 28, 2026 08:29
@branchseer branchseer force-pushed the feat/runner-protocol branch from 64e2883 to 4ed66c7 Compare May 28, 2026 08:29
@branchseer branchseer changed the title feat(runner): JS bridge for vite-task-client feat(client): napi binding + JS wrapper May 28, 2026
@branchseer branchseer force-pushed the feat/runner-protocol branch from 4ed66c7 to fceab96 Compare May 28, 2026 09:07
@branchseer branchseer force-pushed the feat/runner-js-bridge branch 2 times, most recently from cef2366 to d3bc701 Compare May 28, 2026 09:09
@branchseer branchseer force-pushed the feat/runner-protocol branch 2 times, most recently from 59c904f to c1ee666 Compare May 28, 2026 09:11
@branchseer branchseer force-pushed the feat/runner-js-bridge branch 2 times, most recently from 3925257 to f0aef36 Compare May 28, 2026 09:57
@branchseer branchseer force-pushed the feat/runner-protocol branch 2 times, most recently from 4c5ec78 to 5e2923c Compare May 28, 2026 10:13
@branchseer branchseer force-pushed the feat/runner-js-bridge branch 2 times, most recently from 90e6422 to 9975d4c Compare May 28, 2026 10:43
@branchseer branchseer force-pushed the feat/runner-protocol branch from 5e2923c to 6fe2c6d Compare May 28, 2026 10:43
Adds the JS surface that lets spawned Node tools talk to the runner
over the IPC introduced in the previous PR:

- `crates/vite_task_client_napi` — napi binding that exposes the Rust
  `Client` to JS as a `RunnerClient` returned from `load()`.
- `packages/vite-task-client` — JS wrapper with `ignoreInput`,
  `ignoreOutput`, `disableCache`, `getEnv`, and `getEnvs`. Types live
  in `index.js` as JSDoc; `index.d.ts` is generated via
  `pnpm build-vite-task-client-types` and a CI staleness check fails
  the build if the committed `.d.ts` drifts from the source.

The package is consumable as a no-op outside the runner: when
`VP_RUN_NODE_CLIENT_PATH` isn't set, `load()` returns `null` and every
exported function becomes a no-op (or returns `undefined`/`{}`). That
means the wrapper is safe to add as a regular dependency from a tool
that wants to opt in to runner-aware behavior without requiring its
users to run under `vp`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@branchseer branchseer force-pushed the feat/runner-js-bridge branch from 9975d4c to 7d95cc5 Compare May 28, 2026 11:46
@branchseer branchseer force-pushed the feat/runner-protocol branch from 6fe2c6d to 0d670c3 Compare May 28, 2026 11:46
@branchseer
Copy link
Copy Markdown
Member Author

Superseded by restructured 2-PR stack:

@branchseer branchseer closed this May 28, 2026
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