Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps/update hey api 0.42.1 #21

Closed
wants to merge 11 commits into from
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**OpenAPI spec file**
If possible, please upload the OpenAPI spec file.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots or logs to help explain your problem.

- OS: [e.g. macOS]
- Version [e.g. v1.0.0]


**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8
version: 9

- name: Install Node.js
uses: actions/setup-node@v4
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
Expand All @@ -44,3 +44,10 @@ jobs:

- name: Run tsc
run: pnpm --filter @7nohe/react-app test:generated

- name: Run test
run: pnpm test

- name: Report coverage
if: always() && matrix.os == 'ubuntu-latest'
uses: davelosert/vitest-coverage-report-action@v2
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ dist-ssr

openapi
*.tsbuildinfo
coverage
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,16 @@ Options:
-o, --output <value> Output directory (default: "openapi")
-c, --client <value> HTTP client to generate [fetch, xhr, node, axios, angular] (default: "fetch")
--request <value> Path to custom request file
--useDateType Use Date type instead of string for date types for models, this will not convert the data to a Date object
--enums Generate JavaScript objects from enum definitions?
--base <value> Manually set base in OpenAPI config instead of inferring from server value
--serviceResponse <value> Define shape of returned value from service calls ['body', 'generics', 'response']
--format <value> Process output folder with formatter? ['biome', 'prettier']
--lint <value> Process output folder with linter? ['eslint', 'biome']
--operationId Use operation ID to generate operation names?
--lint Process output folder with linter?
--format Process output folder with formatter?
--serviceResponse <value> Define shape of returned value from service calls ['body', 'generics', 'response']
--base <value> Manually set base in OpenAPI config instead of inferring from server value
--enums <value> Generate JavaScript objects from enum definitions? ['javascript', 'typescript']
--useDateType Use Date type instead of string for date types for models, this will not convert the data to a Date object
--debug Enable debug mode
--noSchemas Disable generating schemas for request and response objects
--schemaTypes <value> Define the type of schema generation ['form', 'json'] (default: "json")
-h, --help display help for command
```

Expand Down Expand Up @@ -86,11 +89,7 @@ function App() {
return (
<div className="App">
<h1>Pet List</h1>
<ul>
{data?.map((pet) => (
<li key={pet.id}>{pet.name}</li>
))}
</ul>
<ul>{data?.map((pet) => <li key={pet.id}>{pet.name}</li>)}</ul>
</div>
);
}
Expand Down Expand Up @@ -129,13 +128,7 @@ import { useDefaultClientFindPetsSuspense } from "../openapi/queries/suspense";
function ChildComponent() {
const { data } = useDefaultClientFindPetsSuspense({ tags: [], limit: 10 });

return (
<ul>
{data?.map((pet, index) => (
<li key={pet.id}>{pet.name}</li>
))}
</ul>
);
return <ul>{data?.map((pet, index) => <li key={pet.id}>{pet.name}</li>)}</ul>;
}

function ParentComponent() {
Expand Down
3 changes: 2 additions & 1 deletion examples/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
"dev:mock": "prism mock ./petstore.yaml --dynamic",
"build": "tsc && vite build",
"preview": "vite preview",
"generate:api": "node ../../dist/cli.mjs -i ./petstore.yaml -c axios --request ./request.ts",
"generate:api": "rimraf ./openapi && node ../../dist/cli.mjs -i ./petstore.yaml -c axios --request ./request.ts",
"test:generated": "tsc -p ./tsconfig.openapi.json --noEmit"
},
"dependencies": {
"@tanstack/react-query": "^5.18.1",
"axios": "^1.6.7",
"form-data": "~4.0.0",
"prettier": "^3.2.5",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand Down
21 changes: 12 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@7nohe/openapi-react-query-codegen",
"version": "1.0.6",
"version": "1.1.0",
"description": "OpenAPI React Query Codegen",
"bin": {
"openapi-rq": "dist/cli.mjs"
Expand All @@ -13,7 +13,8 @@
"build": "rimraf dist && tsc -p tsconfig.json",
"preview": "npm run build && npm -C examples/react-app run generate:api",
"prepublishOnly": "npm run build",
"release": "npx git-ensure -a && npx bumpp --commit --tag --push"
"release": "npx git-ensure -a && npx bumpp --commit --tag --push",
"test": "vitest --coverage.enabled true"
},
"repository": {
"type": "git",
Expand All @@ -37,20 +38,22 @@
"author": "Daiki Urata (@7nohe)",
"license": "MIT",
"devDependencies": {
"@hey-api/openapi-ts": "0.36.0",
"@hey-api/openapi-ts": "0.42.1",
"@types/node": "^20.10.6",
"@vitest/coverage-v8": "^1.5.0",
"commander": "^12.0.0",
"glob": "^10.3.10",
"rimraf": "^5.0.5",
"ts-morph": "^22.0.0",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"vitest": "^1.5.0"
},
"peerDependencies": {
"@hey-api/openapi-ts": "0.36.0",
"commander": ">= 11 < 13",
"glob": ">= 10",
"ts-morph": ">= 22 < 23",
"typescript": ">= 4.8.3"
"@hey-api/openapi-ts": "0.42.1",
"commander": "12.x",
"glob": "10.x",
"ts-morph": "22.x",
"typescript": "5.x"
},
"engines": {
"node": ">=14"
Expand Down
Loading