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

fix: Only export types from @seamapi/types #67

Merged
merged 4 commits into from
Apr 10, 2024
Merged

Conversation

razor-x
Copy link
Collaborator

@razor-x razor-x commented Apr 10, 2024

  • fix: Only re-export types from @seamapi/types/connect
  • Add zod as dependency
  • Run npm update

@razor-x razor-x marked this pull request as ready for review April 10, 2024 00:21
@@ -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"
Copy link
Collaborator Author

@razor-x razor-x Apr 10, 2024

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

Copy link

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)

Copy link
Collaborator Author

@razor-x razor-x Apr 10, 2024

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

Copy link
Collaborator Author

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

@razor-x razor-x requested review from phpnode and mxsdev April 10, 2024 00:24
@razor-x razor-x merged commit 69d48c0 into main Apr 10, 2024
14 checks passed
@razor-x razor-x deleted the only-export-types branch April 10, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants