nestjs / terminus

Terminus module for Nest framework (node.js) :robot:
https://nestjs.com/
MIT License
675 stars 100 forks source link

too many dependencies #561

Closed Diluka closed 4 years ago

Diluka commented 4 years ago

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

install all the packages

Expected behavior

do not install the packages I don't need

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

{
    "@nestjs/terminus": {
      "version": "6.5.6",
      "resolved": "https://registry.npm.taobao.org/@nestjs/terminus/download/@nestjs/terminus-6.5.6.tgz",
      "integrity": "sha1-6XejwZG5NrbZGVyrQ/rYEslykXA=",
      "requires": {
        "@grpc/proto-loader": "0.5.3",
        "@nestjs/microservices": "6.11.6",
        "@nestjs/mongoose": "6.3.1",
        "@nestjs/platform-express": "6.11.6",
        "@nestjs/platform-fastify": "6.11.6",
        "@nestjs/typeorm": "6.2.0",
        "amqp-connection-manager": "3.2.0",
        "amqplib": "0.5.5",
        "check-disk-space": "2.1.0",
        "grpc": "1.24.2",
        "mongoose": "5.8.11",
        "mqtt": "3.0.0",
        "nats": "1.4.0",
        "redis": "2.8.0",
        "typeorm": "0.2.22"
      },
}

Environment


Nest version: 6.5.6


For Tooling issues:
- Node version:  v12.14.1 
- Platform:  Linux 

Others:

BrunnerLivio commented 4 years ago

These dependencies are declared as optionalDependenices. As recommended in the Installation, we recommend using the --no-optional install option. Is that flexibility good enough?

➜ npm i @nestjs/terminus &&  tree -L 1 node_modules
node_modules
├── check-disk-space
├── d
├── es5-ext
├── es6-iterator
├── es6-symbol
├── ext
├── @nestjs
├── next-tick
└── type

Though, thanks to your issue, I've found that check-disk-space-package is actually a direct dependency, even though it should be optional too. Will fix that asap.

Diluka commented 4 years ago

My suggestion is remove all the optionalDependenices and make a list of what feature need what libs. And this instrument should also be here.

It needs to keep --no-optional in every npm install commands. It not good enough.

Like @nestjs/platform-express and @nestjs/platform-fastify they are not optionalDependenices to @nestjs/core

BrunnerLivio commented 4 years ago

@Diluka Sorry for the late reply.

So there are two options to approach this:

@kamilmysliwiec how did you approach this regarding webpack? Any insights?

Diluka commented 4 years ago

@BrunnerLivio one or more libs i use don't support webpack

BrunnerLivio commented 4 years ago

Resolved in 7.0.0 :tada: