···88::: warning
99This page is under construction. We appreciate your patience.
1010:::
1111+1212+## Working with Examples
1313+1414+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.
1515+1616+### Generating Example Code
1717+1818+When you make changes to the core packages that affect code generation, you need to regenerate the client code in all examples:
1919+2020+```bash
2121+pnpm examples:generate
2222+```
2323+2424+This command will:
2525+2626+- Find all examples with an `openapi-ts` script
2727+- Run the OpenAPI code generator for each example
2828+- Update the generated client code in each example
2929+3030+### Checking Example Code
3131+3232+Before committing changes, ensure that all generated example code is up-to-date:
3333+3434+```bash
3535+pnpm examples:check
3636+```
3737+3838+This command will:
3939+4040+- Regenerate all example code
4141+- Check if any files were modified
4242+- Exit with an error if generated code is out of sync
4343+4444+This check is also run automatically in CI to ensure examples stay in sync with the main codebase.
4545+4646+### Example Workflow
4747+4848+1. Make changes to core packages
4949+2. Build the packages: `pnpm build --filter="@hey-api/**"`
5050+3. Regenerate examples: `pnpm examples:generate`
5151+4. Commit all changes including the updated generated code
5252+5. The CI will verify that examples are in sync
5353+5454+::: tip
5555+Think of generated example code as snapshot tests - they should always reflect the current state of the code generator.
5656+:::
+84
examples/README.md
···11+# Examples
22+33+This directory contains integration examples demonstrating how to use `@hey-api/openapi-ts` with various frameworks, libraries, and client implementations.
44+55+## Available Examples
66+77+- **openapi-ts-angular** - Angular integration with common HTTP client
88+- **openapi-ts-angular-common** - Angular with @angular/common/http
99+- **openapi-ts-axios** - Using Axios client
1010+- **openapi-ts-fastify** - Fastify server integration
1111+- **openapi-ts-fetch** - Native Fetch API client
1212+- **openapi-ts-next** - Next.js integration
1313+- **openapi-ts-nuxt** - Nuxt.js integration with plugin
1414+- **openapi-ts-ofetch** - Using ofetch client
1515+- **openapi-ts-openai** - OpenAI API integration
1616+- **openapi-ts-pinia-colada** - Vue with Pinia Colada state management
1717+- **openapi-ts-sample** - Sample/template example (excluded from CI)
1818+- **openapi-ts-tanstack-angular-query-experimental** - Angular with TanStack Query
1919+- **openapi-ts-tanstack-react-query** - React with TanStack Query
2020+- **openapi-ts-tanstack-svelte-query** - Svelte with TanStack Query
2121+- **openapi-ts-tanstack-vue-query** - Vue with TanStack Query
2222+2323+## Generated Code
2424+2525+All examples (except `openapi-ts-sample`) contain generated client code that is **committed to the repository**. This ensures:
2626+2727+1. Examples always reflect the current state of the code generator
2828+2. Changes to the code generator are visible in pull requests
2929+3. CI can verify that examples are kept up-to-date
3030+3131+## Regenerating Examples
3232+3333+After making changes to the core packages, regenerate all example code:
3434+3535+```bash
3636+pnpm examples:generate
3737+```
3838+3939+This command will run `openapi-ts` for each example that has an `openapi-ts` script in its `package.json`.
4040+4141+## Verifying Examples
4242+4343+To check if all examples are up-to-date with the current codebase:
4444+4545+```bash
4646+pnpm examples:check
4747+```
4848+4949+This check is also run automatically in CI. If it fails, run `pnpm examples:generate` and commit the changes.
5050+5151+## Running Examples
5252+5353+Each example can be run individually using the `example` script:
5454+5555+```bash
5656+# Run dev server for fetch example
5757+pnpm example fetch dev
5858+5959+# Build fetch example
6060+pnpm example fetch build
6161+```
6262+6363+Or directly using pnpm filters:
6464+6565+```bash
6666+pnpm --filter @example/openapi-ts-fetch dev
6767+```
6868+6969+## Creating New Examples
7070+7171+When creating a new example:
7272+7373+1. Create a new directory in `examples/`
7474+2. Add an `openapi-ts` script to `package.json`
7575+3. Run `pnpm examples:generate` to create initial generated code
7676+4. Commit both the source and generated code
7777+5. The example will automatically be included in CI checks
7878+7979+## Excluding Examples
8080+8181+To exclude an example from CI (like `openapi-ts-sample`):
8282+8383+1. Remove the `openapi-ts` script from `package.json`, or
8484+2. Update the exclusion filters in `package.json` scripts and `.github/workflows/ci.yml`