Developing
此内容尚不支持你的语言。
Working with Examples
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Writing Changelogs
Section titled “Writing Changelogs”We use Changesets to manage releases and generate changelogs. When contributing changes, create a changeset to document your updates.
Creating a Changeset
Section titled “Creating a Changeset”Run the following command to create a new changeset:
pnpm changesetThis will prompt you to:
- Select the packages that were changed
- Choose the semver bump type (major, minor, or patch)
- Write a summary of your changes
Changeset Format
Section titled “Changeset Format”Changesets use the following format:
---"@hey-api/openapi-ts": patch---
**scope**: description of changesScopes:
cli,parser,output,config,input,internal,build,error→ Core sectionplugin(name)→ Plugins section (e.g.,**plugin(zod)**:,**plugin(@hey-api/client-axios)**:)- Any other scope → Other section
Breaking Changes:
- Use
**BREAKING**:prefix in the description to mark breaking changes - For packages on v0.x (major version 0), minor bumps may include breaking changes. Use signal words like “removed”, “renamed”, or “changed signature” to indicate breaking changes.
Examples
Section titled “Examples”---"@hey-api/openapi-ts": patch---
**parser**: fix explicit discriminator mapping---"@hey-api/openapi-ts": minor---
**plugin(zod)**: handle guid string format---"@hey-api/openapi-ts": minor---
**BREAKING**: removed deprecated `getClient()` function---"@hey-api/openapi-ts": patch---
**plugin(@hey-api/client-fetch)**: improve error handling