feat(client): napi binding + JS wrapper#405
Conversation
|
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.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
💡 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, |
There was a problem hiding this comment.
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 👍 / 👎.
6b6728f to
69e90aa
Compare
68ad1bc to
64e2883
Compare
69e90aa to
887d8a1
Compare
64e2883 to
4ed66c7
Compare
4ed66c7 to
fceab96
Compare
cef2366 to
d3bc701
Compare
59c904f to
c1ee666
Compare
3925257 to
f0aef36
Compare
4c5ec78 to
5e2923c
Compare
90e6422 to
9975d4c
Compare
5e2923c to
6fe2c6d
Compare
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>
9975d4c to
7d95cc5
Compare
6fe2c6d to
0d670c3
Compare
|
Superseded by restructured 2-PR stack:
|

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 RustClientto JS as aRunnerClientreturned fromload().packages/vite-task-client— JS wrapper withignoreInput,ignoreOutput,disableCache,getEnv, andgetEnvs. Types livein
index.jsas JSDoc;index.d.tsis generated viapnpm build-vite-task-client-typesand a CI staleness check failsthe build if the committed
.d.tsdrifts from the source.The package is consumable as a no-op outside the runner: when
VP_RUN_NODE_CLIENT_PATHisn't set,load()returnsnulland everyexported function becomes a no-op (or returns
undefined/{}). Thatmeans 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