wow-generator reference
Generate TypeScript from a Wow Manifest (GET /wow/manifest), the typed clients on @ahoo-wang/wow-client, or from an OpenAPI 3 document, its models and decorator API clients. The package root exports CodeGenerator, its configuration default, loggers, errors and option types; see the symbol index.
Install
pnpm add -D @ahoo-wang/wow-generator @ahoo-wang/fetcher @ahoo-wang/fetcher-eventstream @ahoo-wang/fetcher-decorator @ahoo-wang/wow-client typescriptThe package requires Node >=22.12.0; repository development additionally pins pnpm 10.34.9. The command includes all recursive peers (wow-generator → wow-client/Decorator/EventStream → Fetcher) and the compiler used below. ts-morph, commander and yaml install automatically as regular dependencies. These are generation-time dependencies; generated clients need their imported packages installed as runtime dependencies in the consuming application, as listed under generated output.
The package version follows Wow, and @ahoo-wang/wow-client must be on the same minor version. Coming from @ahoo-wang/fetcher-generator? The command is wow-generator, the configuration file wow-generator.config.json, and generated code imports @ahoo-wang/wow-client, so regenerate existing output; see the migration guide.
Minimal example
pnpm exec wow-generator generate -i ./openapi.json -o ./src/generated -t ./tsconfig.jsonChoose an entry point
Use the CLI for a reproducible build step, with --strict in CI to fail on warnings, and CodeGenerator.generate() for a Node script with a custom logger. Both produce source files; neither executes API operations. Start with the complete CLI input and tsconfig, then check output ownership before regenerating.