Developing
WARNING
This page is under construction. We appreciate your patience.
Working with Examples
The examples folder contains various integration examples that demonstrate how to use @hey-api/openapi-ts with different frameworks and libraries. These examples are kept in sync with the codebase through automated checks.
Generating Example Code
When you make changes to the core packages that affect code generation, you need to regenerate the client code in all examples:
pnpm examples:generateThis command will:
- Find all examples with an
openapi-tsscript - Run the OpenAPI code generator for each example
- Update the generated client code in each example
Checking Example Code
Before committing changes, ensure that all generated example code is up-to-date:
pnpm examples:checkThis command will:
- Regenerate all example code
- Check if any files were modified
- Exit with an error if generated code is out of sync
This check is also run automatically in CI to ensure examples stay in sync with the main codebase.
Example Workflow
- Make changes to core packages
- Build the packages:
pnpm build --filter="@hey-api/**" - Regenerate examples:
pnpm examples:generate - Commit all changes including the updated generated code
- The CI will verify that examples are in sync
TIP
Think of generated example code as snapshot tests - they should always reflect the current state of the code generator.