pbvex-backend
PBVex application backend
Use the project's local pbvex through package scripts or npx pbvex; a global CLI is optional and must match the local dependency. Do not assume pnpm is installed in an application repository.
Author application code under pbvex/. Import schema/runtime APIs from public pbvex/server and validators from pbvex/values; import factories/references from pbvex/_generated/* using the correct relative path for the current module. Do not import internal Go packages or manually construct function paths.
npx pbvex codegen
npx pbvex typecheck
npx pbvex build --check
rg -n "(query|mutation|action|httpAction)\(" pbvex
Define bounded contracts
Ordinary TypeScript helpers are local implementation details: write normal parameter and return types, and do not add PBVex validators unless the helper itself needs runtime validation. In contrast, exports created with generated query, internalQuery, mutation, internalMutation, action, or internalAction factories are deployed wire boundaries. Every stable deployed value function must declare returns as well as intentional args; validators enforce runtime values and determine generated reference types. HTTP actions instead use their native Request/Response contract.
Omitting returns is exactly an implicit v.any(): PBVex still applies bounded wire-value encoding and checks, but application shape validation is lost and generated references expose any. Explicit v.any() is appropriate only for an intentionally dynamic contract or short-lived prototyping, not as a way to silence a contract error.