-
Notifications
You must be signed in to change notification settings - Fork 0
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
fix: Only export types from @seamapi/types #67
Conversation
razor-x
commented
Apr 10, 2024
- fix: Only re-export types from @seamapi/types/connect
- Add zod as dependency
- Run npm update
@@ -67,7 +67,8 @@ | |||
"@seamapi/http": "0.25.3", | |||
"@seamapi/types": "1.153.2", | |||
"@seamapi/webhook": "1.0.0-rc.0", | |||
"seamapi-types": "1.42.0" | |||
"seamapi-types": "1.42.0", | |||
"zod": "^3.21.4" |
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.
This needs to be added a dependency or types will not work for consumers who use package managers that do not automatically install peer dependencies, e.g., Yarn v1.
Consumers that have strict dependency requirements can use the low level packages, however this is not recommended. https://github.com/seamapi/javascript-http?tab=readme-ov-file#installation
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.
This is for types only right? We're not actually including Zod in our bundle (it's a pretty large package)
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.
Yes it's only for types. This repo doesn't have a bundle that bundles external dependencies, it's only distributed as an es module and a commonjs module.
Note that zod is already an optional peer dependency of @seamapi/types
and is already being installed by npm users. I'm unaware of any alternative solution for dealing with "TypeScript dependencies" like this without compromising the simplicity of just yarn install seam
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.
I wouldn't consider Zod too large:
Tiny: 8kb minified + zipped
https://zod.dev/?id=introduction