-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add minimal example with SDK generation #62
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
feat: add minimal example with SDK generation #62
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
acb94e9 to
54d623e
Compare
54d623e to
18cbe92
Compare
050edb4 to
5e775ae
Compare
fae2765 to
5b0d0a9
Compare
5b0d0a9 to
4605087
Compare
4605087 to
e268d58
Compare
e268d58 to
aea93f7
Compare
aea93f7 to
37a9012
Compare
37a9012 to
bbd08dd
Compare
bbd08dd to
81f8976
Compare
81f8976 to
107a8e4
Compare
| - name: Clean schemas | ||
| working-directory: examples/minimal-sdk | ||
| shell: bash | ||
| run: | | ||
| rm -rf {src,sdk}/**/schemas; | ||
| rm -rf {src,sdk}/**/*.type.ts; | ||
| rm -rf sdk/**/*.client.ts; | ||
| rm -rf foo.openapi.json; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this workflow runs on both Windows and Ubuntu, the rm -rf commands will fail on Windows even when using PowerShell. Consider using the cross-platform rimraf package or implementing OS-specific cleanup commands. A simple approach would be:
- name: Clean schemas
working-directory: examples/minimal-sdk
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
Remove-Item -Recurse -Force src/**/schemas -ErrorAction Ignore
Remove-Item -Recurse -Force src/**/*.type.ts -ErrorAction Ignore
Remove-Item -Recurse -Force sdk/**/*.client.ts -ErrorAction Ignore
Remove-Item -Force foo.openapi.json -ErrorAction Ignore
else
rm -rf {src,sdk}/**/schemas
rm -rf {src,sdk}/**/*.type.ts
rm -rf sdk/**/*.client.ts
rm -rf foo.openapi.json
fiSpotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
| "generate:openapi": "node ../../bin/run.js openapi && npx biome format --write foo.openapi.json", | ||
| "generate:types": "npx therefore -f src --clean", | ||
| "generate:sdk": "npx therefore -f sdk --clean", | ||
| "generate": "npm run generate:types && npm run generate:sdk && npm run generate:openapi" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The script order creates a potential race condition. The generate:openapi command should run first since it generates the OpenAPI spec that the other commands depend on. Recommend reordering to:
npm run generate:openapi && npm run generate:types && npm run generate:sdk
This ensures the OpenAPI spec exists before type and SDK generation begins.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
🎉 This PR is included in version 1.25.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |

No description provided.