dub icon indicating copy to clipboard operation
dub copied to clipboard

`dub select`, `dub deselect`, `dub upgrade -l`

Open WebFreak001 opened this issue 3 years ago • 12 comments

first part to interact with dub.selections.json

dub explain comes in a separate PR. (for issues see #1064)

fix #123

WebFreak001 avatar Aug 03 '22 08:08 WebFreak001

I'm not sure that select is right name, as it sounds like an action.

Examples from other package managers:

  • cargo tree: https://doc.rust-lang.org/stable/cargo/commands/cargo-tree.html
  • yarn why: https://yarnpkg.com/cli/why
  • yarn set resolution: https://yarnpkg.com/cli/set/resolution (with dub select I would expect to change which versions are selected / resolved - e.g. to update dub.selections.json
  • npm explain: https://docs.npmjs.com/cli/v7/commands/npm-explain
  • pipenv graph https://pipenv.pypa.io/en/latest/cli/#pipenv-graph (I'm not sure about this one)

PetarKirov avatar Aug 03 '22 18:08 PetarKirov

yes dub select <pkg> <version> can be used to select packages in dub.selections.json

I'm thinking that doing dub select without any arguments should also perform some useful action, so I was thinking showing the full dependency graph would be a good addition.

WebFreak001 avatar Aug 04 '22 08:08 WebFreak001

I guess dub describe already exists so it could be a sub-whatever of that

maxhaton avatar Aug 04 '22 10:08 maxhaton

maybe it's better to separate dub select and dub explain into two PRs.

EDIT: done, this PR is now only dub select

WebFreak001 avatar Aug 08 '22 14:08 WebFreak001

maybe it's better to separate dub select and dub explain into two PRs.

"Everything should be made as simple as possible, but no simpler" - (Not) Einstein

maxhaton avatar Aug 10 '22 12:08 maxhaton

Suggestion: dub explain => dub why to better reflect my state of mind every time I need this command (/s).

Geod24 avatar Aug 10 '22 12:08 Geod24

I moved the dub explain part out of here into a separate branch for now, as the select interface is quite a lot easier to add, show and test.

dub upgrade -l now shows this kind of output and does an implicit dry run: (can be made a non-dry run)

image

dub select pkg ver can be used to insert or change a dependency in dub.selections.json

dub deselect pkg can be used to remove a dependency from dub.selections.json

WebFreak001 avatar Feb 13 '23 00:02 WebFreak001

test failure seems unrelated? (dmd-master only)

WebFreak001 avatar Feb 26 '23 18:02 WebFreak001

need an approve to merge @Geod24

WebFreak001 avatar Mar 01 '23 23:03 WebFreak001

I'm a bit confused, I thought this was only for optional dependencies, originally, but there's no mention of it ?

Geod24 avatar Mar 02 '23 01:03 Geod24