Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce dependency tree #165

Closed
paulirish opened this issue Jul 24, 2012 · 8 comments
Closed

reduce dependency tree #165

paulirish opened this issue Jul 24, 2012 · 8 comments

Comments

@paulirish
Copy link
Member

It's pretty big these days.. could use some pruning

We rely on a specific SHA of grunt inside 0.4.0a and hopefully we'll have 0.4 final to use soon. In the meantime our grunt tasks we pull in rely on 0.3.10 and 0.3.11 of grunt, which ends up pulling in quite a few things.

My primary aim is reducing install time here.. can someone do a pass on cleaning up any superfluous deps?

The full dep tree:

$ npm ls
yeoman@0.0.1 
├── async@0.1.22 
├─┬ cheerio@0.8.3 
│ ├─┬ cheerio-select@0.0.3 
│ │ └─┬ CSSselect@0.2.4 
│ │   └── CSSwhat@0.1.0 
│ ├── entities@0.1.1 
│ └── htmlparser2@2.2.9 
├─┬ clean-css@0.3.3 
│ └── optimist@0.1.9 
├── coffee-script@1.3.3 
├── colors@0.6.0-1 
├─┬ connect@1.8.7 
│ ├── formidable@1.0.11 
│ ├── mime@1.2.5 
│ └── qs@0.5.0 
├── faye-websocket@0.4.2 
├─┬ fstream@0.1.18 
│ ├── graceful-fs@1.1.8 
│ ├── inherits@1.0.0 
│ └── rimraf@2.0.2 
├─┬ fstream-ignore@0.0.5 
│ ├── inherits@1.0.0 
│ └─┬ minimatch@0.2.5 
│   └── lru-cache@1.1.0 
├─┬ grunt@0.4.0a 
│ ├── colors@0.6.0-1 
│ ├─┬ connect@2.2.2 
│ │ ├── crc@0.1.0 
│ │ ├── debug@0.7.0 
│ │ ├── formidable@1.0.9 
│ │ ├── mime@1.2.4 
│ │ └── qs@0.4.2 
│ ├── dateformat@1.0.2-1.2.3 
│ ├─┬ glob-whatev@0.1.6 
│ │ └─┬ minimatch@0.2.5 
│ │   └── lru-cache@1.1.0 
│ ├─┬ gzip-js@0.3.1 
│ │ ├── crc32@0.2.2 
│ │ └── deflate-js@0.2.2 
│ ├── hooker@0.2.3 
│ ├─┬ jshint@0.7.1 
│ │ ├─┬ cli@0.4.3 
│ │ │ └─┬ glob@3.1.10 
│ │ │   ├── graceful-fs@1.1.8 
│ │ │   ├── inherits@1.0.0 
│ │ │   └─┬ minimatch@0.2.5 
│ │ │     └── lru-cache@1.1.0 
│ │ └─┬ minimatch@0.0.5 
│ │   └── lru-cache@1.0.6 
│ ├─┬ nodeunit@0.7.4 
│ │ └─┬ tap@0.2.5 
│ │   ├── buffer-equal@0.0.0 
│ │   ├── deep-equal@0.0.0 
│ │   ├─┬ difflet@0.2.1 
│ │   │ ├── charm@0.0.8 
│ │   │ └── traverse@0.6.3 
│ │   ├── inherits@1.0.0 
│ │   ├─┬ runforcover@0.0.2 
│ │   │ └─┬ bunker@0.1.2 
│ │   │   └─┬ burrito@0.2.12 
│ │   │     ├── traverse@0.5.2 
│ │   │     └── uglify-js@1.1.1 
│ │   ├── slide@1.1.3 
│ │   └── yamlish@0.0.5 
│ ├─┬ nopt@1.0.10 
│ │ └── abbrev@1.0.3 
│ ├─┬ prompt@0.1.12 
│ │ ├── pkginfo@0.2.3 
│ │ └─┬ winston@0.5.11 
│ │   ├── eyes@0.1.7 
│ │   ├─┬ loggly@0.3.11 
│ │   │ └── timespan@2.2.0 
│ │   └── stack-trace@0.0.6 
│ ├── semver@1.0.14 
│ ├─┬ temporary@0.0.4 
│ │ └── package@1.0.1 
│ ├── uglify-js@1.2.6 
│ ├── underscore@1.3.3 
│ └── underscore.string@2.1.1 
├─┬ grunt-jasmine-task@0.2.0 
│ ├─┬ grunt@0.3.10 
│ │ ├── async@0.1.22 
│ │ ├── colors@0.6.0-1 
│ │ ├─┬ connect@2.3.4 
│ │ │ ├── bytes@0.0.1 
│ │ │ ├── cookie@0.0.4 
│ │ │ ├── crc@0.2.0 
│ │ │ ├── debug@0.7.0 
│ │ │ ├── formidable@1.0.11 
│ │ │ ├── fresh@0.0.1 
│ │ │ ├── mime@1.2.4 
│ │ │ ├── qs@0.4.2 
│ │ │ └── range-parser@0.0.4 
│ │ ├── dateformat@1.0.2-1.2.3 
│ │ ├─┬ glob-whatev@0.1.6 
│ │ │ └─┬ minimatch@0.2.5 
│ │ │   └── lru-cache@1.1.0 
│ │ ├─┬ gzip-js@0.3.1 
│ │ │ ├── crc32@0.2.2 
│ │ │ └── deflate-js@0.2.2 
│ │ ├── hooker@0.2.3 
│ │ ├─┬ jshint@0.5.9 
│ │ │ ├── argsparser@0.0.6 
│ │ │ └─┬ minimatch@0.2.5 
│ │ │   └── lru-cache@1.1.0 
│ │ ├─┬ nodeunit@0.6.4 
│ │ │ ├── tap-assert@0.0.10 
│ │ │ └─┬ tap-producer@0.0.1 
│ │ │   ├── inherits@1.0.0 
│ │ │   ├── tap-results@0.0.2 
│ │ │   └── yamlish@0.0.5 
│ │ ├─┬ nopt@1.0.10 
│ │ │ └── abbrev@1.0.3 
│ │ ├─┬ prompt@0.1.12 
│ │ │ ├── pkginfo@0.2.3 
│ │ │ └─┬ winston@0.5.11 
│ │ │   ├── eyes@0.1.7 
│ │ │   ├─┬ loggly@0.3.11 
│ │ │   │ ├── request@2.9.202 
│ │ │   │ └── timespan@2.2.0 
│ │ │   └── stack-trace@0.0.6 
│ │ ├── semver@1.0.14 
│ │ ├─┬ temporary@0.0.4 
│ │ │ └── package@1.0.1 
│ │ ├── uglify-js@1.0.7 
│ │ ├── underscore@1.2.4 
│ │ └── underscore.string@2.1.1 
│ └─┬ temporary@0.0.4 
│   └── package@1.0.1 
├─┬ grunt-mocha@0.1.2 
│ ├── growl@1.5.1 
│ ├─┬ grunt@0.3.11 
│ │ ├─┬ connect@2.3.9 
│ │ │ ├── bytes@0.1.0 
│ │ │ ├── cookie@0.0.4 
│ │ │ ├── crc@0.2.0 
│ │ │ ├── debug@0.7.0 
│ │ │ ├── formidable@1.0.11 
│ │ │ ├── fresh@0.1.0 
│ │ │ ├── qs@0.4.2 
│ │ │ └─┬ send@0.0.3 
│ │ │   ├── mime@1.2.6 
│ │ │   └── range-parser@0.0.4 
│ │ ├── dateformat@1.0.2-1.2.3 
│ │ ├─┬ glob-whatev@0.1.8 
│ │ │ └─┬ minimatch@0.2.5 
│ │ │   └── lru-cache@1.1.0 
│ │ ├─┬ gzip-js@0.3.1 
│ │ │ ├── crc32@0.2.2 
│ │ │ └── deflate-js@0.2.2 
│ │ ├── hooker@0.2.3 
│ │ ├─┬ jshint@0.5.9 
│ │ │ ├── argsparser@0.0.6 
│ │ │ └─┬ minimatch@0.2.5 
│ │ │   └── lru-cache@1.1.0 
│ │ ├─┬ nodeunit@0.6.4 
│ │ │ ├── tap-assert@0.0.10 
│ │ │ └─┬ tap-producer@0.0.1 
│ │ │   ├── inherits@1.0.0 
│ │ │   ├── tap-results@0.0.2 
│ │ │   └── yamlish@0.0.5 
│ │ ├─┬ nopt@1.0.10 
│ │ │ └── abbrev@1.0.3 
│ │ ├─┬ prompt@0.1.12 
│ │ │ ├── pkginfo@0.2.3 
│ │ │ └─┬ winston@0.5.11 
│ │ │   ├── eyes@0.1.7 
│ │ │   ├─┬ loggly@0.3.11 
│ │ │   │ └── timespan@2.2.0 
│ │ │   └── stack-trace@0.0.6 
│ │ ├── semver@1.0.14 
│ │ ├── uglify-js@1.0.7 
│ │ ├── underscore@1.2.4 
│ │ └── underscore.string@2.1.1 
│ └─┬ temporary@0.0.4 
│   └── package@1.0.1 
├─┬ grunt-shell@0.1.1  extraneous
│ └─┬ grunt@0.3.10 
│   ├── async@0.1.22 
│   ├── colors@0.6.0-1 
│   ├─┬ connect@2.3.4 
│   │ ├── bytes@0.0.1 
│   │ ├── cookie@0.0.4 
│   │ ├── crc@0.2.0 
│   │ ├── debug@0.7.0 
│   │ ├── formidable@1.0.11 
│   │ ├── fresh@0.0.1 
│   │ ├── mime@1.2.4 
│   │ ├── qs@0.4.2 
│   │ └── range-parser@0.0.4 
│   ├── dateformat@1.0.2-1.2.3 
│   ├─┬ glob-whatev@0.1.6 
│   │ └─┬ minimatch@0.2.5 
│   │   └── lru-cache@1.1.0 
│   ├─┬ gzip-js@0.3.1 
│   │ ├── crc32@0.2.2 
│   │ └── deflate-js@0.2.2 
│   ├── hooker@0.2.3 
│   ├─┬ jshint@0.5.9 
│   │ ├── argsparser@0.0.6 
│   │ └─┬ minimatch@0.2.5 
│   │   └── lru-cache@1.1.0 
│   ├─┬ nodeunit@0.6.4 
│   │ ├── tap-assert@0.0.10 
│   │ └─┬ tap-producer@0.0.1 
│   │   ├── inherits@1.0.0 
│   │   ├── tap-results@0.0.2 
│   │   └── yamlish@0.0.5 
│   ├─┬ nopt@1.0.10 
│   │ └── abbrev@1.0.3 
│   ├─┬ prompt@0.1.12 
│   │ ├── pkginfo@0.2.3 
│   │ └─┬ winston@0.5.11 
│   │   ├── eyes@0.1.7 
│   │   ├─┬ loggly@0.3.11 
│   │   │ ├── request@2.9.202 
│   │   │ └── timespan@2.2.0 
│   │   └── stack-trace@0.0.6 
│   ├── semver@1.0.14 
│   ├─┬ temporary@0.0.4 
│   │ └── package@1.0.1 
│   ├── uglify-js@1.0.7 
│   ├── underscore@1.2.4 
│   └── underscore.string@2.1.1 
├── html-minifier@0.4.5 
├── less@1.2.2 
├── mkdirp@0.3.3 
├─┬ mocha@1.2.1 
│ ├── commander@0.6.1 
│ ├── debug@0.7.0 
│ ├── diff@1.0.2 
│ ├── growl@1.5.1 
│ └─┬ jade@0.26.3 
│   └── mkdirp@0.3.0 
├── ncp@0.2.6 
├─┬ node-inspector@0.2.0beta2  extraneous
│ └── async@0.1.22 
├── open@0.0.2 
├─┬ phantom@0.3.4  extraneous
│ ├─┬ dnode@0.9.12 
│ │ ├── jsonify@0.0.0 
│ │ ├── lazy@1.0.8 
│ │ ├─┬ socket.io@0.8.6 
│ │ │ ├── policyfile@0.0.4 
│ │ │ └── redis@0.6.7 
│ │ └─┬ socket.io-client@0.8.6 
│ │   ├── uglify-js@1.0.6 
│ │   ├── websocket-client@1.0.0 
│ │   └── xmlhttprequest@1.2.2 
│ ├─┬ dnode-protocol@0.1.5 
│ │ ├── jsonify@0.0.0 
│ │ └── traverse@0.6.2 
│ └─┬ express@2.5.10 
│   ├── mime@1.2.4 
│   ├── mkdirp@0.3.0 
│   └── qs@0.4.2 
├─┬ prompt@0.2.1 
│ ├── colors@0.6.0-1 
│ ├── pkginfo@0.2.3 
│ ├── revalidator@0.1.1 
│ ├─┬ utile@0.1.1 
│ │ ├── async@0.1.22 
│ │ ├── i@0.3.0 
│ │ └── rimraf@1.0.9 
│ └─┬ winston@0.6.1 
│   ├── async@0.1.22 
│   ├── cycle@1.0.0 
│   ├── eyes@0.1.7 
│   └── stack-trace@0.0.6 
├── request@2.9.202 
├── requirejs@2.0.4 
├─┬ rimraf@2.0.2 
│ └── graceful-fs@1.1.8 
├─┬ ronn@0.3.8 
│ └── opts@1.2.2 
├─┬ socket.io@0.9.6  extraneous
│ ├── policyfile@0.0.4 
│ ├── redis@0.6.7 
│ └─┬ socket.io-client@0.9.6 
│   ├─┬ active-x-obfuscator@0.0.1 
│   │ └── zeparser@0.0.5 
│   ├── uglify-js@1.2.5 
│   ├─┬ ws@0.4.16 
│   │ ├── commander@0.5.2 
│   │ └── options@0.0.3 
│   └── xmlhttprequest@1.2.2 
├─┬ tar@0.1.13 
│ ├── block-stream@0.0.6 
│ └── inherits@1.0.0 
├── underscore@1.3.3 
└── which@1.0.5 
@sindresorhus
Copy link
Member

I agree, it couldn't hurt trimming it down a bit. Though the install will take some time anyway, because of everything install.sh has to fetch and install.

There has been some relevant discussion on the grunt repo about if it's necessary for grunt plugins to have grunt as a dependency - no conclusion. cowboy/grunt#263 The additional grunt dependencies with subs is like half of the dependency-tree.

@mklabs
Copy link
Contributor

mklabs commented Jul 25, 2012

Very true.

@sindresorhus whoa, I completely missed that issue on grunt repo. Will add a few words there too.. IMHO, this is an unnecessary (and quite annoying actually) thing to have grunt plugins rely on grunt, when they really shouldn't. If a plugin is not exposing a cli API, is just exposing a task/ directory and is not directly using (eg. require()-ing) grunt.

I feel that putting grunt dep in those plugin as a devDependencies is more than enough for 90% of the plugin cases.

As you said, half of our dep tree is related to that, and the fact that the grunt plugins we rely on define grunt as a project dependency.

To help with this, we might:

  • open an issue or PR on each relevant repo to ask them to move the grunt dep from dependencies to devDependencies in their package.json
  • If we need to, we can fork each project, do the necessary changes and point our package.json dependencies to these forks.

It would help us a lot, then we might improve this dep tree a bit more by removing some unnecessary dep or stuff we can pull in from grunt.utils (like async and underscore).

In a next step, inclusion of grunt-contrib might help us remove most of the remaining deps we might have (like tar, mkdirp, rimraf and so on).

@sindresorhus
Copy link
Member

I feel that putting grunt dep in those plugin as a devDependencies is more than enough for 90% of the plugin cases.

Couldn't agree more :)

@paulirish
Copy link
Member Author

commented on cowboy/grunt#263.

filed these PRs:

kmiyashiro/grunt-mocha#6
https://github.com/creynders/grunt-jasmine-task/pull/11

@mklabs
Copy link
Contributor

mklabs commented Aug 1, 2012

Awesome, thanks a lot Paul.

Until these PRs are accepted in their respective repo and published to npm, we might want to point each deps in our package.json to your forks (I'm sure it won't be necessary).

@paulirish
Copy link
Member Author

successfully got both deps to clear out grunt and bump. hooray!

In a next step, inclusion of grunt-contrib might help us remove most of the remaining deps we might have (like tar, mkdirp, rimraf and so on).

probably helps remove some, but certainly doesn't help with dep tree size or install time. :/
https://gist.github.com/dd745e328724390b0b5c

@paulirish
Copy link
Member Author

closing this for now. i think we had MUCH SUCCESS!

@sindresorhus
Copy link
Member

Awesome Paul :)

Current dependency tree: (takes about 16sec on my Mac)

├─┬ bower@1.0.0
│ ├── archy@0.0.2
│ ├── async@0.1.22
│ ├─┬ glob@3.1.11
│ │ ├── graceful-fs@1.1.10
│ │ ├── inherits@1.0.0
│ │ └─┬ minimatch@0.2.5
│ │   └── lru-cache@1.1.1
│ ├── hogan.js@2.0.0
│ ├─┬ nopt@2.0.0
│ │ └── abbrev@1.0.3
│ ├─┬ read-package-json@0.1.2
│ │ ├── graceful-fs@1.1.10
│ │ ├── lru-cache@1.1.1
│ │ ├─┬ npmlog@0.0.2
│ │ │ └── ansi@0.1.2
│ │ └── slide@1.1.3
│ ├── request@2.10.0
│ ├── semver@1.0.14
│ ├── tmp@0.0.13
│ ├── underscore@1.3.3
│ └─┬ vows@0.6.3
│   └── eyes@0.1.7
├─┬ cheerio@0.8.3
│ ├─┬ cheerio-select@0.0.3
│ │ └─┬ CSSselect@0.2.4
│ │   └── CSSwhat@0.1.0
│ ├── entities@0.1.1
│ ├── htmlparser2@2.2.9
│ └── underscore@1.3.3
├─┬ clean-css@0.3.3
│ └── optimist@0.1.9
├── coffee-script@1.3.3
├── colors@0.6.0-1 invalid
├─┬ connect@2.2.2
│ ├── crc@0.1.0
│ ├── debug@0.7.0
│ ├── formidable@1.0.9
│ ├── mime@1.2.4
│ └── qs@0.4.2
├── faye-websocket@0.4.3
├─┬ fstream@0.1.18 invalid
│ ├── graceful-fs@1.1.10
│ └── inherits@1.0.0
├─┬ fstream-ignore@0.0.5
│ ├── inherits@1.0.0
│ └─┬ minimatch@0.2.5
│   └── lru-cache@1.1.1
├─┬ grunt@0.4.0a
│ ├── async@0.1.22
│ ├── dateformat@1.0.2-1.2.3
│ ├─┬ glob-whatev@0.1.8
│ │ └─┬ minimatch@0.2.5
│ │   └── lru-cache@1.1.1
│ ├─┬ gzip-js@0.3.1
│ │ ├── crc32@0.2.2
│ │ └── deflate-js@0.2.2
│ ├── hooker@0.2.3
│ ├─┬ jshint@0.7.2
│ │ ├─┬ cli@0.4.3
│ │ │ └─┬ glob@3.1.11
│ │ │   ├── graceful-fs@1.1.10
│ │ │   ├── inherits@1.0.0
│ │ │   └─┬ minimatch@0.2.5
│ │ │     └── lru-cache@1.1.1
│ │ └─┬ minimatch@0.0.5
│ │   └── lru-cache@1.0.6
│ ├─┬ nodeunit@0.7.4
│ │ └─┬ tap@0.3.0
│ │   ├── buffer-equal@0.0.0
│ │   ├── deep-equal@0.0.0
│ │   ├─┬ difflet@0.2.1
│ │   │ ├── charm@0.0.8
│ │   │ └── traverse@0.6.3
│ │   ├── inherits@1.0.0
│ │   ├─┬ nopt@2.0.0
│ │   │ └── abbrev@1.0.3
│ │   ├─┬ runforcover@0.0.2
│ │   │ └─┬ bunker@0.1.2
│ │   │   └─┬ burrito@0.2.12
│ │   │     ├── traverse@0.5.2
│ │   │     └── uglify-js@1.1.1
│ │   ├── slide@1.1.3
│ │   └── yamlish@0.0.5
│ ├─┬ nopt@1.0.10
│ │ └── abbrev@1.0.3
│ ├── semver@1.0.14
│ ├─┬ temporary@0.0.4
│ │ └── package@1.0.1
│ ├── uglify-js@1.2.6
│ ├── underscore@1.3.3
│ └── underscore.string@2.1.1
├─┬ grunt-jasmine-task@0.2.2
│ └─┬ temporary@0.0.4
│   └── package@1.0.1
├─┬ grunt-mocha@0.1.3
│ ├── growl@1.5.1
│ └─┬ temporary@0.0.4
│   └── package@1.0.1
├── html-minifier@0.4.5
├── less@1.2.2
├── mkdirp@0.3.3 invalid
├─┬ mocha@1.2.2
│ ├── commander@0.6.1
│ ├── debug@0.7.0
│ ├── diff@1.0.2
│ ├── growl@1.5.1
│ └─┬ jade@0.26.3
│   └── mkdirp@0.3.0
├── open@0.0.2
├─┬ prompt@0.1.12
│ ├── async@0.1.22
│ ├── pkginfo@0.2.3
│ └─┬ winston@0.5.11
│   ├── eyes@0.1.7
│   ├─┬ loggly@0.3.11
│   │ └── timespan@2.2.0
│   └── stack-trace@0.0.6
├── request@2.9.203
├── requirejs@2.0.4
├─┬ rimraf@2.0.2 invalid
│ └── graceful-fs@1.1.10
├─┬ ronn@0.3.8
│ └── opts@1.2.2
├─┬ tar@0.1.13
│ ├── block-stream@0.0.6
│ └── inherits@1.0.0
└── which@1.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants