Skip to content
This repository was archived by the owner on Aug 11, 2022. It is now read-only.

Conversation

iarna
Copy link
Contributor

@iarna iarna commented Mar 1, 2017

Something we've been talking about for a while. With a project of any size the post-install module list is unwieldy. This give us something like:

$ npm install
npm added 125, removed 32, updated 148 and moved 5 packages.
$

Versus what we got previously:

$ npm install
- hoek@2.16.3 node_modules/ammo/node_modules/hoek
- items@2.1.1 node_modules/bossy/node_modules/items
- joi@9.1.0 node_modules/bossy/node_modules/joi
isemail@2.2.1 node_modules/bossy/node_modules/isemail -> node_modules/crumb/node_modules/isemail
topo@2.0.2 node_modules/bossy/node_modules/topo -> node_modules/crumb/node_modules/topo
lodash@3.10.1 node_modules/elasticsearch/node_modules/lodash -> node_modules/first-mate-select-grammar/node_modules/lodash
- isemail@2.1.2 node_modules/hapi/node_modules/joi/node_modules/isemail
- moment@2.13.0 node_modules/hapi/node_modules/joi/node_modules/moment
- mime-db@1.23.0 node_modules/hapi/node_modules/mimos/node_modules/mime-db
- content@3.0.1 node_modules/hapi/node_modules/subtext/node_modules/content
- b64@3.0.1 node_modules/hapi/node_modules/subtext/node_modules/pez/node_modules/b64
- vise@2.0.1 node_modules/hapi/node_modules/subtext/node_modules/pez/node_modules/nigel/node_modules/vise
- nigel@2.0.1 node_modules/hapi/node_modules/subtext/node_modules/pez/node_modules/nigel
- pez@2.1.1 node_modules/hapi/node_modules/subtext/node_modules/pez
- wreck@7.2.1 node_modules/hapi/node_modules/subtext/node_modules/wreck
window-size@0.2.0 node_modules/nyc/node_modules/yargs/node_modules/window-size -> node_modules/highlights/node_modules/window-size
- hoek@2.16.3 node_modules/inert/node_modules/hoek
- globals@9.12.0 node_modules/lab/node_modules/globals
- js-tokens@1.0.3 node_modules/loose-envify/node_modules/js-tokens
- get-stdin@4.0.1 node_modules/nyc/node_modules/get-stdin
- lodash.keys@4.0.7 node_modules/nyc/node_modules/lodash.keys
- lodash.rest@4.0.3 node_modules/nyc/node_modules/lodash.rest
- lodash.assign@4.0.9 node_modules/nyc/node_modules/lodash.assign
- pkg-up@1.0.0 node_modules/nyc/node_modules/pkg-up
- spdx-exceptions@1.0.5 node_modules/nyc/node_modules/spdx-exceptions
minimist@1.2.0 node_modules/nyc/node_modules/detect-indent/node_modules/minimist -> node_modules/standard-engine/node_modules/minimist
- hoek@2.16.3 node_modules/catbox-redis/node_modules/hoek
- deap@1.0.0 node_modules/deap
- glob@5.0.15 node_modules/esformatter/node_modules/glob
- kilt@2.0.1 node_modules/hapi/node_modules/kilt
- peekaboo@2.0.1 node_modules/hapi/node_modules/peekaboo
- joi@6.10.1 node_modules/inert/node_modules/joi
- items@2.1.1 node_modules/lab/node_modules/items
- lodash-compat@3.10.2 node_modules/lodash-compat
- promise-js@0.0.6 node_modules/promise-js
- hoek@3.0.4 node_modules/vision/node_modules/hoek
- items@2.1.1 node_modules/vision/node_modules/items
npm-website@4.1.0 /Users/rebecca/code/newww
├── @npmcorp/background-refresh-cache@1.0.2 
├── @npmcorp/feature-flagger@1.1.0 
├── @npmcorp/pui-css-drop-down-menu@8.0.0 
├── @npmcorp/pui-css-flex-grid@8.1.0 
├── @npmcorp/pui-css-header@8.3.1 
├── @npmcorp/pui-css-utils@8.2.1 
├─┬ @npmcorp/redis-pool@2.0.1 
│ └── generic-pool@3.1.7 
├─┬ annotation-poller@2.4.0
│ └── jquery@2.2.4 
├── async@2.1.5 
├── bluebird@3.4.7 
├── catbox-redis@2.0.2 
├── code@4.0.0 
├─┬ crumb@6.0.3
│ └── joi@8.4.2 
├── dotenv@4.0.0 
├─┬ elasticsearch@12.1.3 
│ └─┬ promise@7.1.1 
│   └── asap@2.0.5 
├─┬ esformatter@0.10.0 
│ ├─┬ babel-traverse@6.23.1 
│ │ ├─┬ babel-code-frame@6.22.0 
│ │ │ └── js-tokens@3.0.1 
│ │ ├─┬ babel-messages@6.23.0 
│ │ │ └── babel-runtime@6.23.0 
│ │ ├─┬ babel-runtime@6.23.0 
│ │ │ └── regenerator-runtime@0.10.3 
│ │ ├─┬ babel-types@6.23.0 
│ │ │ └── babel-runtime@6.23.0 
│ │ ├── babylon@6.16.1 
│ │ ├── globals@9.16.0 
│ │ └─┬ invariant@2.2.2 
│ │   └── loose-envify@1.3.1 
│ └─┬ npm-run@3.0.0 
│   └── sync-exec@0.6.2 
├─┬ esformatter-jsx@7.4.1 
│ ├── babylon@6.14.1 
│ ├── esformatter-ignore@0.1.3 
│ └─┬ js-beautify@1.6.4 
│   ├─┬ config-chain@1.1.11 
│   │ └── proto-list@1.2.4 
│   ├─┬ editorconfig@0.13.2 
│   │ └── lru-cache@3.2.0 
│   └── nopt@3.0.6 
├── github-url-to-object@2.2.6 
├── google-libphonenumber@2.0.11 
├─┬ gulp-favicons@2.2.6
│ └─┬ favicons@4.8.3
│   └── async@1.5.2 
├─┬ gulp-uglify@2.0.1 
│ ├─┬ make-error-cause@1.2.2 
│ │ └── make-error@1.2.2 
│ ├─┬ through2@2.0.3 
│ │ └── readable-stream@2.2.3 
│ └── uglify-js@2.7.5 
├─┬ handlebars@4.0.5
│ └── async@1.5.2 
├─┬ hapi@16.1.0 
│ ├── accept@2.1.3 
│ ├── ammo@2.0.3 
│ ├── b64@3.0.2 
│ ├── boom@4.2.0 
│ ├── call@4.0.0 
│ ├── catbox@7.1.3 
│ ├── catbox-memory@2.0.4 
│ ├── content@3.0.3 
│ ├── cryptiles@3.1.1 
│ ├── heavy@4.0.3 
│ ├── hoek@4.1.0 
│ ├── iron@4.0.4 
│ ├── isemail@2.2.1 
│ ├── items@2.1.1 
│ ├── joi@10.1.0 
│ ├── mime-db@1.25.0 
│ ├── mimos@3.0.3 
│ ├── nigel@2.0.2 
│ ├── pez@2.1.4 
│ ├── podium@1.2.5 
│ ├── shot@3.4.0 
│ ├── statehood@5.0.1 
│ ├─┬ subtext@4.3.0 
│ │ └── wreck@10.0.0 
│ ├── topo@2.0.2 
│ └── vise@2.0.2 
├── hapi-stateless-notifications@4.1.0 
├─┬ inert@4.1.0 
│ ├─┬ ammo@2.0.3 
│ │ └── boom@4.2.0 
│ ├── boom@4.2.0 
│ ├── items@2.1.1 
│ └── lru-cache@4.0.2 
├── joi@10.2.2 
├── jquery@3.1.1 
├─┬ lab@11.2.2 
│ ├── bossy@3.0.4 
│ ├── diff@3.2.0 
│ ├─┬ eslint@3.13.1 
│ │ ├── ignore@3.2.4 
│ │ ├── shelljs@0.7.6 
│ │ └── strip-json-comments@2.0.1 
│ ├── seedrandom@2.4.2 
│ └── source-map-support@0.4.11 
├─┬ marky-markdown@9.0.1 
│ ├── atom-language-diff@1.0.2 
│ ├── atom-language-nginx@0.6.1 
│ ├─┬ github-slugger@1.1.1 
│ │ └── emoji-regex@6.1.0 
│ ├─┬ highlights@1.4.1 
│ │ ├─┬ first-mate@6.2.1 
│ │ │ ├─┬ emissary@1.3.3 
│ │ │ │ ├─┬ es6-weak-map@0.1.4 
│ │ │ │ │ ├── es6-iterator@0.1.3 
│ │ │ │ │ └── es6-symbol@2.0.1 
│ │ │ │ ├── mixto@1.0.0 
│ │ │ │ └─┬ property-accessors@1.1.3 
│ │ │ │   └─┬ es6-weak-map@0.1.4 
│ │ │ │     ├── es6-iterator@0.1.3 
│ │ │ │     └── es6-symbol@2.0.1 
│ │ │ ├── event-kit@2.2.0 
│ │ │ ├── grim@2.0.1 
│ │ │ └── oniguruma@6.1.1 
│ │ ├── first-mate-select-grammar@1.0.1 
│ │ ├─┬ fs-plus@2.9.3 
│ │ │ ├── async@0.2.10 
│ │ │ ├── mkdirp@0.3.5 
│ │ │ └── rimraf@2.2.8 
│ │ ├─┬ season@5.4.1 
│ │ │ ├─┬ cson-parser@1.0.9 
│ │ │ │ └── coffee-script@1.9.0 
│ │ │ └── optimist@0.4.0 
│ │ ├─┬ underscore-plus@1.6.6 
│ │ │ └── underscore@1.6.0 
│ │ └─┬ yargs@4.8.1 
│ │   └── cliui@3.2.0 
│ ├── highlights-tokens@1.0.1 
│ ├─┬ innertext@1.0.1 
│ │ └── html-entities@1.2.0 
│ ├── is-badge@1.3.0 
│ ├── language-dart@0.1.1 
│ ├── language-erlang@2.0.0 
│ ├── language-glsl@2.0.1 
│ ├── language-haxe@0.2.1 
│ ├── language-ini@1.16.0 
│ ├── language-rust@0.4.9 
│ ├── language-stylus@0.5.2 
│ ├── lodash.pickby@4.6.0 
│ ├─┬ markdown-it@8.3.0 
│ │ ├── linkify-it@2.0.3 
│ │ ├── mdurl@1.0.1 
│ │ └── uc.micro@1.0.3 
│ ├── markdown-it-emoji@1.3.0 
│ ├─┬ markdown-it-expand-tabs@1.0.11 
│ │ └── lodash.repeat@4.1.0 
│ ├── markdown-it-lazy-headers@0.1.3 
│ ├── markdown-it-task-lists@1.4.1 
│ ├── property-ttl@1.0.0 
│ ├─┬ sanitize-html@1.14.1 
│ │ ├── regexp-quote@0.0.0 
│ │ └── xtend@4.0.1 
│ └─┬ similarity@1.1.0 
│   └── leven@2.1.0 
├─┬ nemo@2.3.1
│ └── async@1.5.2 
├─┬ nock@9.0.2 
│ ├── lodash@4.9.0 
│ └── propagate@0.4.0 
├── npm-humans@3.2.0 
├── redis-mock@0.16.0 
├─┬ request@2.79.0 
│ ├── form-data@2.1.2 
│ ├── qs@6.3.1 
│ └── uuid@3.0.1 
├── scooter@4.0.0 
├─┬ standard@8.6.0 
│ ├─┬── ignore@3.2.4 
│ │ ├─┬ inquirer@0.12.0 
│ │ │ └── run-async@0.1.0 
│ │ ├── shelljs@0.7.6 
│ │ ├── strip-bom@3.0.0 
│ │ └── strip-json-comments@1.0.4 
│ ├── eslint-config-standard@6.2.1 
│ ├── eslint-config-standard-jsx@3.2.0 
│ ├── eslint-plugin-promise@3.4.2 
│ ├─┬ eslint-plugin-react@6.7.1 
│ │ └── jsx-ast-utils@1.4.0 
│ ├── eslint-plugin-standard@2.0.1 
│ └─┬ standard-engine@5.2.0 
│   ├─┬ deglob@2.1.0 
│   │ └── run-parallel@1.1.6 
│   ├── find-root@1.0.0 
│   ├── get-stdin@5.0.1 
│   ├── home-or-tmp@2.0.0 
│   └─┬ pkg-config@1.1.1 
│     ├── debug-log@1.0.1 
│     └── xtend@4.0.1 
├── stripe@4.15.0 
├─┬ tap@9.0.3 
│ ├── coveralls@2.11.16 
│ ├─┬ foreground-child@1.5.6 
│ │ └─┬ cross-spawn@4.0.2
│ │   └── lru-cache@4.0.2 
│ ├─┬ nyc@10.1.2 
│ │ ├── archy@1.0.0 
│ │ ├─┬ caching-transform@1.0.1
│ │ │ └─┬ write-file-atomic@1.3.1 
│ │ │   └── graceful-fs@4.1.11 
│ │ ├── debug-log@1.0.1 
│ │ ├─┬ foreground-child@1.5.6 
│ │ │ └─┬ cross-spawn@4.0.2 
│ │ │   └── lru-cache@4.0.2 
│ │ ├─┬ glob@7.1.1 
│ │ │ ├── inflight@1.0.6 
│ │ │ ├── inherits@2.0.3 
│ │ │ ├── minimatch@3.0.3 
│ │ │ ├── once@1.4.0 
│ │ │ └── path-is-absolute@1.0.1 
│ │ ├── istanbul-lib-coverage@1.0.1 
│ │ ├─┬ istanbul-lib-hook@1.0.0 
│ │ │ └── append-transform@0.4.0 
│ │ ├─┬ istanbul-lib-instrument@1.4.2 
│ │ │ ├─┬ babel-generator@6.21.0 
│ │ │ │ ├─┬ babel-runtime@6.20.0 
│ │ │ │ │ └── regenerator-runtime@0.10.1 
│ │ │ │ ├─┬ detect-indent@4.0.0 
│ │ │ │ │ └─┬ repeating@2.0.1 
│ │ │ │ │   └── is-finite@1.0.2 
│ │ │ │ ├── jsesc@1.3.0 
│ │ │ │ └── lodash@4.17.4 
│ │ │ ├── babel-template@6.16.0 
│ │ │ ├─┬ babel-traverse@6.21.0 
│ │ │ │ ├── babel-code-frame@6.20.0 
│ │ │ │ ├─┬ debug@2.6.0 
│ │ │ │ │ └── ms@0.7.2 
│ │ │ │ ├── globals@9.14.0 
│ │ │ │ └─┬ invariant@2.2.2 
│ │ │ │   └─┬ loose-envify@1.3.1 
│ │ │ │     └── js-tokens@3.0.0 
│ │ │ ├── babel-types@6.21.0 
│ │ │ └── babylon@6.15.0 
│ │ ├─┬ istanbul-lib-report@1.0.0-alpha.3
│ │ │ └── supports-color@3.2.3 
│ │ ├── istanbul-lib-source-maps@1.1.0 
│ │ ├─┬ istanbul-reports@1.0.0 
│ │ │ └─┬ handlebars@4.0.6 
│ │ │   ├─┬ source-map@0.4.4
│ │ │   │ └── amdefine@1.0.1 
│ │ │   └── uglify-js@2.7.5 
│ │ ├── merge-source-map@1.0.3 
│ │ ├─┬ micromatch@2.3.11
│ │ │ ├─┬ braces@1.8.5
│ │ │ │ └─┬ expand-range@1.8.2
│ │ │ │   └─┬ fill-range@2.2.3
│ │ │ │     ├── randomatic@1.1.6 
│ │ │ │     └── repeat-string@1.6.1 
│ │ │ ├─┬ kind-of@3.1.0 
│ │ │ │ └── is-buffer@1.1.4 
│ │ │ └─┬ object.omit@2.0.1 
│ │ │   └─┬ for-own@0.1.4
│ │ │     └── for-in@0.1.6 
│ │ ├── signal-exit@3.0.2 
│ │ ├─┬ spawn-wrap@1.2.4
│ │ │ ├── os-homedir@1.0.2 
│ │ │ └── which@1.2.12 
│ │ ├─┬ test-exclude@3.3.0 
│ │ │ ├── object-assign@4.1.1 
│ │ │ └─┬ read-pkg-up@1.0.1
│ │ │   └─┬ read-pkg@1.1.0
│ │ │     └─┬ normalize-package-data@2.3.5
│ │ │       └─┬ validate-npm-package-license@3.0.1
│ │ │         ├─┬ spdx-correct@1.0.2
│ │ │         │ └── spdx-license-ids@1.2.2 
│ │ │         └── spdx-expression-parse@1.0.4 
│ │ ├─┬ yargs@6.6.0 
│ │ │ ├── camelcase@3.0.0 
│ │ │ ├─┬ cliui@3.2.0
│ │ │ │ └── wrap-ansi@2.1.0 
│ │ │ ├── get-caller-file@1.0.2 
│ │ │ └─┬ string-width@1.0.2 
│ │ │   ├── code-point-at@1.1.0 
│ │ │   ├─┬ is-fullwidth-code-point@1.0.0
│ │ │   │ └── number-is-nan@1.0.1 
│ │ │   └─┬ strip-ansi@3.0.1
│ │ │     └── ansi-regex@2.1.1 
│ │ └── yargs-parser@4.2.1 
│ ├── opener@1.4.3 
│ ├── readable-stream@2.2.3 
│ ├─┬ tap-mocha-reporter@3.0.3 
│ │ ├── readable-stream@2.2.3 
│ │ └── tap-parser@5.3.3 
│ ├─┬ tap-parser@4.2.4 
│ │ └── readable-stream@2.2.3 
│ └── tmatch@3.0.0 
├─┬ vision@4.1.1 
│ └── boom@4.2.0 
└── with-fixtures@1.2.0 
$ 

Test failures are due to tests relying on specific npm install output and will require patching.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling c67f7a7 on iarna/post-install-report into ** on release-next**.

@legodude17
Copy link
Contributor

I would prefer something like apt-get does:

$ npm install
125 packages added, 32 removed, 148 updated, and 5 moved.
12MB used
$ 

@iarna
Copy link
Contributor Author

iarna commented Mar 1, 2017

Disk utilization is not a bad idea, but out of scope for this.

Copy link
Contributor

@zkat zkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This is gonna be great 🎉

@legodude17
Copy link
Contributor

Ok. Now I can't decide which format I like better. 🤔

Copy link
Contributor

@legodude17 legodude17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better then it used to be. 🎆

lib/install.js Outdated
var lastAction = actions.pop()
report += actions.join(', ') + ' and ' + lastAction
}
report += ' package' + (plural ? 's' : '') + '.'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest removing the period.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But... but... I like my complete sentences. =D

Copy link
Contributor

@legodude17 legodude17 Mar 2, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like complete sentences in logs. They look weird and takes 6 extra characters. 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

six? I don't understand. There'd only be one…

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant in the code, not the log. 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯_(ツ)_/¯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good answer. Also, use more github emoji. =D 🎆 😆

lib/install.js Outdated
if (updated) actions.push('updated ' + updated)
if (moved) actions.push('moved ' + moved)
if (actions.length === 0) {
return cb()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think that if nothing happened it should print that.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like

$ npm install
Nothing changed
$ 

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly more complicated as we may be bubbling up an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(But ideally I like that.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may land it as is, and then we can patch that in next. Depends on how long getting through the tests takes. =D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds like a good idea.

@iarna iarna force-pushed the release-next branch 2 times, most recently from 87bbc1d to 47f77ad Compare March 6, 2017 22:38
@iarna iarna force-pushed the iarna/post-install-report branch from 6005571 to 1b36ac6 Compare March 6, 2017 23:00
@iarna iarna force-pushed the iarna/post-install-report branch from 1b36ac6 to 27f9cb7 Compare March 8, 2017 01:18
@zkat zkat force-pushed the release-next branch 3 times, most recently from 6f1b69a to 2ae141b Compare March 10, 2017 01:02
@legodude17
Copy link
Contributor

Just thought of this, would a PR to include sizes in this report be accepted? (Maybe after this is merged)

Copy link
Contributor

@legodude17 legodude17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 😃

@jacobq
Copy link

jacobq commented Mar 24, 2017

Will it still be possible to get some more verbose output available when enabled via an environment variable (e.g. DEBUG=*) or a command line argument like --verbose or --debug?

@iarna
Copy link
Contributor Author

iarna commented Mar 27, 2017

@legodude17 asked:

Just thought of this, would a PR to include sizes in this report be accepted? (Maybe after this is merged)

If it doesn't have a substantial impact in install speed, yes.

@jacobq asked:

Will it still be possible to get some more verbose output available when enabled via an environment variable (e.g. DEBUG=*) or a command line argument like --verbose or --debug?

How about via --json or --parseable? Those are currently accepted and give output that's intended to be machine readable.

@jacobq
Copy link

jacobq commented Mar 27, 2017

@iarna That should be fine, thanks; I didn't realize those options were there.

@legodude17
Copy link
Contributor

@iarna Good to know! I will look into it.

@ORESoftware
Copy link

ORESoftware commented Apr 14, 2017

Hmm, I am poking around the issue tracker - I am looking for that option for npm install that would prevent printing out the big old dependency tree for the package, was that this?

@legodude17
Copy link
Contributor

This is a PR for a feature in a future release. To my knowledge there is not good way to prevent npm from outputting the tree.

watilde and others added 11 commits April 14, 2017 16:13
* scripts: replace cli.js with npm-cli.js

* cli: remove unused file cli.js

* docs: replace cli.js with bin/npm-cli.js

PR-URL: #12096
Credit: @watilde
Reviewed-By: @zkat
It was used as a stub file to not break a monkey patching hack,
but it's no longer required. It's removed with npm@5.

Fixes: #15965

PR-URL: #16204
Credit: @watilde 
Reviewed-By: @zkat
@iarna iarna force-pushed the iarna/post-install-report branch 3 times, most recently from ad02037 to d39dc0e Compare April 19, 2017 01:37
@iarna iarna force-pushed the iarna/post-install-report branch from d39dc0e to 89f9140 Compare April 19, 2017 02:03
@iarna
Copy link
Contributor Author

iarna commented Apr 20, 2017

This is merged into release-next-5 so I'm going to close it. (I can't put this as merge-to-release-next-5 now that it's merged, apparently. Oh well. =D)

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

Successfully merging this pull request may close these issues.

7 participants