deepkit / deepkit-framework

A new full-featured and high-performance TypeScript framework
https://deepkit.io/
MIT License
3.14k stars 116 forks source link

Remove unrelated packages from production dependencies #346

Open H4ad opened 1 year ago

H4ad commented 1 year ago

Remove unnecessary packages from production dependencies to have a lighter zip file.

Like this one with @types/ws and faker for example. https://github.com/deepkit/deepkit-framework/blob/master/packages/framework/package.json#L48-L69

Also, in this file, some dependencies that should be in production are inside the development dependencies and vice versa.

My use case for this is when I deploy to lambda, I use a library to filter only the production dependencies and these heavy packages inside the production dependencies hurts the package size a lot.

marcj commented 1 year ago

I'm afraid they are needed to get all features of deepkit/framework out of the box. Removing them means disabling features and making installation more complicated. What about removing these libraries in your build step if you know you don't need them?

H4ad commented 1 year ago

We can pass it one by one to see if it's needed, any dependencies used inside src should be inside production, any dependencies used just for testing and building should be inside development.

Also, I actually remove a lot of dependencies in my build step, but I don't really know exactly which dependency deepkit actually uses, so it's better if deepkit actually organizes this for whoever downloads it.

I will try to create a PR and we will see if it harms the usability of the deepkit and its functionalities.