Skip to content

Conversation

@MickVanDuijn
Copy link
Contributor

No description provided.

Copy link
Contributor Author

MickVanDuijn commented Dec 20, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch 9 times, most recently from acb94e9 to 54d623e Compare December 20, 2024 10:11
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from 54d623e to 18cbe92 Compare January 6, 2025 11:51
@MickVanDuijn MickVanDuijn marked this pull request as ready for review January 6, 2025 12:00
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch 2 times, most recently from 050edb4 to 5e775ae Compare January 6, 2025 12:12
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch 2 times, most recently from fae2765 to 5b0d0a9 Compare March 3, 2025 08:41
@MickVanDuijn MickVanDuijn changed the base branch from main to 03-03-refactor_upgrade_packages March 3, 2025 08:41
Base automatically changed from 03-03-refactor_upgrade_packages to main March 3, 2025 08:43
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from 5b0d0a9 to 4605087 Compare March 3, 2025 08:43
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from 4605087 to e268d58 Compare March 3, 2025 08:50
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from e268d58 to aea93f7 Compare March 3, 2025 12:11
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from aea93f7 to 37a9012 Compare March 3, 2025 12:12
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from 37a9012 to bbd08dd Compare March 3, 2025 12:22
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from bbd08dd to 81f8976 Compare March 5, 2025 15:00
@MickVanDuijn MickVanDuijn force-pushed the 12-20-feat_add_minimal_example_with_SDK_generation branch from 81f8976 to 107a8e4 Compare March 5, 2025 15:04
Comment on lines +34 to +41
- 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;
Copy link

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
    fi

Spotted 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"
Copy link

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.

@MickVanDuijn MickVanDuijn merged commit 9effd1e into main Mar 5, 2025
15 of 16 checks passed
@MickVanDuijn MickVanDuijn deleted the 12-20-feat_add_minimal_example_with_SDK_generation branch March 5, 2025 15:09
@github-actions
Copy link

github-actions bot commented Mar 5, 2025

🎉 This PR is included in version 1.25.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants