Open micalevisk opened 2 years ago
Hello @micalevisk, I agree with your feedback and the drivers should be made available on demand. Due to office work, I have not been able to focus on this much lately. If you would like to contribute to this package, and raise a PR. Otherwise I will pick this up on coming weekends and do it!
Cheers! 💯
can we use this loadPackage
helper approach from NestJS
or do you have another ideia?
I've been pretty busy too but I would like to use nest-storage
with GCS thus this feat will be good for me
Sounds like a good solution to me. I will pick it up, you make sure that you don't miss the deadlines :p
Happy Coding! Cheers 💯
Is your feature request related to a problem? Please describe.
I want to use the fs driver and another cloud driver. I might not need S3 thus I won't need the
aws-sdk
dependency as wellhttps://github.com/squareboat/nest-storage/blob/add9803f5a2b56f9fe20f0de540361bcb1425052/package.json#L42-L47
That dep is quite huge. Having that installed doesn't make much sense in my use case
Describe the solution you'd like
Moving hard dependencies that are driver-specific (like
fs-extra
andaws-sdk
) to optional peer dependencies listDescribe alternatives you've considered
I can use
overrides
from NPM v8+ orresolutions
from Yarn to override those deps to some "noop" one like this one. But this sounds a bit hacky and not reliable to me as those drivers are not lazily loaded.With this approach, using Yarn, my
node_modules
size becomes 5x smaller.Additional context
Having such feature will problably require a major release because now users will need to install those deps beforehand.
At same time, this feature will we could to make the package size smaller regardless of how many drivers are supported.