jamesfer / cypher-query-builder

An flexible and intuitive query builder for Neo4j and Cypher.
http://jamesfer.me/cypher-query-builder/index.html
MIT License
104 stars 22 forks source link

fix(Package): Reduce package size #164

Closed bboure closed 3 years ago

bboure commented 3 years ago

Hi,

I was investigating the size of my deployed packages that were getting quite big. In my investigation, I found out that this package is contributing to bloating my packages.

I identified two reasons:

1) Some @types packages sneaked into the prod dependencies, so they were installed even on prod (npm install --only=prod)

2) The Docs and all sorts of unnecessary files were included in the package published to npm making it 6.57 MB unpacked. After removing, the unpacked size is down to about 1M

jamesfer commented 3 years ago

Hey @bboure, thank you for the PR. I think it's a good idea. I've just pushed an additional commit to clean a few things up.

Once you've had a look, I will squash the commits into one before merging to keep things neat.

jamesfer commented 3 years ago

Actually I just remembered that those two @types packages were in the production dependencies because they are required if you are using typescript. In a few places we use types from Lodash in function signatures and I think typescript throws an error if the @types/lodash is not present.

Ideally we should use our own types but that is probably for another PR.

I've updated my commit.

bboure commented 3 years ago

Thanks for your feedback.

Sorry, looks like I went too fast with this one 😛

Yeah, the most important thing here is to remove the docs from the package.

LGTM like tit is now 👍

Thanks!

github-actions[bot] commented 3 years ago

:tada: This PR is included in version 6.0.3 :tada:

The release is available on:

Your semantic-release bot :package::rocket: