You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: split commands into lean + validated files for tree-shaking
Generates two parallel command files: a lean commands.ts with zero schema
imports (just HTTP plumbing + types), and commands-validated.ts whose
subclasses attach static responseSchema. Consumers swap the import path (or
use a bundler alias dev → validated) to opt into runtime response validation
without paying for it in prod. valibot lazy-loads in rest-client, so prod
imports that skip the validated file never pull valibot at all.
Also fixes a longstanding bug: inline 2xx response bodies with nested \$refs
(e.g. \`{ user: { \$ref: "..." } }\`) now correctly generate a per-command
response schema. Previously the codegen silently fell through, producing
commands with no static responseSchema and a silent validation gap.
Dead-weight removal: static bodySchema, paramsSchema, querySchema are no
longer emitted on Command classes. They were never consumed by rest-client,
and server middleware imports schemas directly from valibot.ts.
Uses namespace imports (\`import * as commands\` / \`import * as schemas\`) in
the validated file to keep generated output compact and stable across
regenerations — adding/removing a single command no longer churns the import
list.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments