Skip to content

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

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

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

Conversation

@wan9chi

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

@wan9chiGraphite App

wan9chi commented May 28, 2026

Copy link
Copy Markdown
MemberAuthor

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

socket-securityBot commented May 28, 2026

Copy link
Copy Markdown

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

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Addedcargo/​napi@​3.9.08210093100100
Addedcargo/​napi-build@​2.3.29810093100100
Addedcargo/​napi-derive@​3.5.69910093100100

View full report

@chatgpt-codex-connectorchatgpt-codex-connectorBot left a comment

Copy link
Copy Markdown

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 👍 / 👎.

@wan9chi
wan9chiforce-pushed the feat/runner-js-bridge branch from 6b6728f to 69e90aaCompareMay 28, 2026 08:02
@wan9chi
wan9chiforce-pushed the feat/runner-protocol branch from 68ad1bc to 64e2883CompareMay 28, 2026 08:02
@wan9chi
wan9chiforce-pushed the feat/runner-js-bridge branch from 69e90aa to 887d8a1CompareMay 28, 2026 08:29
@wan9chi
wan9chiforce-pushed the feat/runner-protocol branch from 64e2883 to 4ed66c7CompareMay 28, 2026 08:29
@wan9chiwan9chi changed the title feat(runner): JS bridge for vite-task-clientfeat(client): napi binding + JS wrapperMay 28, 2026
@wan9chi
wan9chiforce-pushed the feat/runner-protocol branch from 4ed66c7 to fceab96CompareMay 28, 2026 09:07
@wan9chi
wan9chiforce-pushed the feat/runner-js-bridge branch 2 times, most recently from cef2366 to d3bc701CompareMay 28, 2026 09:09
@wan9chi
wan9chiforce-pushed the feat/runner-protocol branch 2 times, most recently from 59c904f to c1ee666CompareMay 28, 2026 09:11
@wan9chi
wan9chiforce-pushed the feat/runner-js-bridge branch 2 times, most recently from 3925257 to f0aef36CompareMay 28, 2026 09:57
@wan9chi
wan9chiforce-pushed the feat/runner-protocol branch 2 times, most recently from 4c5ec78 to 5e2923cCompareMay 28, 2026 10:13
@wan9chi
wan9chiforce-pushed the feat/runner-js-bridge branch 2 times, most recently from 90e6422 to 9975d4cCompareMay 28, 2026 10:43
@wan9chi
wan9chiforce-pushed the feat/runner-protocol branch from 5e2923c to 6fe2c6dCompareMay 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>
@wan9chi
wan9chiforce-pushed the feat/runner-js-bridge branch from 9975d4c to 7d95cc5CompareMay 28, 2026 11:46
@wan9chi
wan9chiforce-pushed the feat/runner-protocol branch from 6fe2c6d to 0d670c3CompareMay 28, 2026 11:46
@wan9chi

Copy link
Copy Markdown
MemberAuthor

Superseded by restructured 2-PR stack:

@wan9chiwan9chi closed this May 28, 2026
Sign up for freeto 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

@wan9chi