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

build: generate client with openapi-typescript #274

Merged
merged 2 commits into from
Oct 14, 2024
Merged

Conversation

rafaelcr
Copy link
Collaborator

@rafaelcr rafaelcr commented Oct 9, 2024

This PR refactors the TS client to be generated with openapi-typescript instead of swagger-codegen. This allows us to ship it for recent node and typescript versions.

Fixes #268
Fixes #193

Copy link

github-actions bot commented Oct 9, 2024

Vercel deployment URL: https://token-metadata-cyhoaearf-hirosystems.vercel.app 🚀

"scripts": {
"prepublishOnly": "npm run build",
"build": "rimraf ./lib && npm run build:client --prefix .. && npm run build:node && npm run build:browser",
"build:node": "tsc && cp -R src/generated lib/generated",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zone117x I noticed you didn't copy the generated types to the lib dir in the Stacks API client. Not sure why that never worked for me in my tests so I had to do this instead. I also tried including the src directory in the "files" entry in this file but it made no difference because the included path was still incorrect.

Let me know if you have other ideas.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually had to do the same thing here: hirosystems/stacks-blockchain-api#2110

I think you can also have the generator output a .ts file rather than a .d.ts file and then typescript will include a final .d.ts in the output dir.

Copy link

codecov bot commented Oct 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@rafaelcr rafaelcr merged commit b7e838d into develop Oct 14, 2024
9 checks passed
@rafaelcr rafaelcr deleted the fix/client branch October 14, 2024 15:58
@blockstack-devops
Copy link

🎉 This PR is included in version 1.1.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
3 participants