dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
26 stars 34 forks source link

Automagically update commands #49

Closed rishson closed 6 years ago

rishson commented 8 years ago

Extends #11

We should display which commands can be updated (where a more recent version is available):

dojo version

You are currently running:

dojo-cli-build-webpack 0.23.121 (can be updated)
dojo-cli-test 0.3.22 (can be updated)
...

On dojo-cli 2.1.223

Run 'dojo update' to update all commands to the latest versions.
Run 'dojo update -h' to see all the update options.

We will need to provide dojo update alongside this feature.

rishson commented 7 years ago

dojo update should update all out of date commands dojo update someCommand should update only the specified command.

rishson commented 7 years ago

Implementation plan for --outdated:

Using david, parse package.json remove all non dojo-cli prefixed dev-deps. pass to david display dojo cli command modules that can be updated and show latest stable release no, e.g.

build (dojo-cli-build-webpack) 1.0.0 can be updated to 1.2.3

where 1.2.3 is the latest stable release.

The removal of non dojo-cli prefixed dev-deps is to speed up the check, and because to get david to ignore deps, you have to name the deps to ignore rather than passing a regex.

rishson commented 7 years ago

After discussion with @agubler - deciding to put the version check under a flag - version -outdated.

rishson commented 7 years ago

Moving the version --outdated work to a separate issue. Refs #68

rishson commented 7 years ago

So david does not expose its update functionality in the lib, only via its cli. The implementation will have to do this itself:

npm.load(...);
npm.commands.install(..)
agubler commented 7 years ago

@rishon wouldn't we just suggest that people use npm update --dev --save?

rishson commented 7 years ago

For now, I think just some text that says that is fine (but isn't it npm update --save - cus they may have installed commands as globals?)

agubler commented 7 years ago

it would be -g for global, --dev is so that it does devDepdencies as well.

rishson commented 7 years ago

Yeah - its not worth listing the permutations of flags to the user (global, dev-dep). Probably best to just say These commands can be updated with 'npm update' or similar.

Sidenote: npm update will downgrade deps that are passed latest - good to know 😕