Closed NWYLZW closed 8 months ago
However, the fs module is only supported for the CLI and is not necessary for common use cases.
This is primarily a CLI, so I disagree.
What is your use-case?
I have agreed with the server to use JSON Schema as the serialization format between us. When I receive a serialized string from the server, I use your tool to convert it into a code string that defines the object using Zod. Finally, I obtain an instance object of Zod.
For your tool, it seems that only one function is using it. However, if you implement it on the CLI side, your tool can easily be used as a CLI on both browsers and servers. https://github.com/StefanTerdell/json-schema-to-zod/blob/c1d47eecf14ef85ee39a04fbb8b483a4a82f8d90/src/utils/cliTools.ts#L110-L118
I will not remove the function because it is crucial for the CLI to work and the use-case is a bad idea to begin with. Please see the last section of the readme.
Your options are to:
Good luck
I will try the second option. Thanks for your reply.
@NWYLZW I think 2.0.14 may have solved your issue. WebPack should be able to ignore it now.
Thank your work, I will try this version later
When I use version
@2
in my project and pack it with webpack, the repository imports thefs
module.However, the
fs
module is only supported for theCLI
and is not necessary for common use cases.