Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds code generation for APIs using @hey-api/openapi-ts, specifically integrating the icanhazdadjoke API to demonstrate the new capability.
Key Changes:
- Adds @hey-api/openapi-ts for automatic client code generation from OpenAPI specifications
- Integrates icanhazdadjoke API with full type-safe client, schemas, and SDK
- Updates state management to include API clients alongside configuration
- Refactors es-toolkit imports to use specific subpath exports for better tree-shaking
Reviewed changes
Copilot reviewed 46 out of 46 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/openapi-ts.config.mts |
Configuration for @hey-api/openapi-ts code generator with custom naming and plugin settings |
src/openapi/icanhazdadjoke.yaml |
OpenAPI specification for the icanhazdadjoke API |
src/src/common/apis/icanhazdadjoke/* |
Generated API client code including types, schemas, SDK class, and fetch client |
src/src/instrumentation.ts |
Initializes API clients and adds them to global state |
src/src/server/state/types.ts |
Extends state type to include APIs alongside config |
src/src/server/state/vars/state/utils.ts |
Simplifies state initialization by passing entire state object |
src/src/server/config/schemas.ts.jinja |
Adds API configuration schema with host, path, port, and scheme settings |
src/src/server/config/lib/load-config/main.ts |
Transforms empty string environment variables to null |
src/src/server/orpc/vars/procedures/vars/test/vars/validate/main.ts |
Demonstrates API usage by fetching dad jokes |
src/src/common/orpc/vars/procedures/vars/test/vars/validate/schemas.ts |
Updates validation schema to include joke message field |
src/src/client/test/components/test/test-widget/main.tsx |
Updates UI to display fetched joke message |
src/package.json.jinja |
Adds @hey-api/openapi-ts dev dependency |
src/Taskfile.dist.yaml.jinja |
Adds apis task for code generation |
src/eslint.config.mjs |
Adds generated API code to ignored paths |
src/docker-compose.yaml.jinja |
Adds environment variables for API configuration |
src/.dockerignore.jinja |
Excludes OpenAPI specs and config from Docker builds |
| Various files | Updates es-toolkit imports to use specific subpath exports |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.