This will make the transition easier for people with automation already
built around the old dep prune. We'll remove the logic again for the
next release.
Our TOML lib doesn't support decoding directly into interface{} types,
so our only short-term choice is to decode...for a third time, and
operate directly on that.
This new type defers computation of the actual prune value for a given
project until the method is called, rather than trying to precompute it.
By deferring computation, we retain full fidelity on the original
cascading inputs.
Still a WIP hack - need to clean up, and make everything actually use this.
This merge incorporates the long-running branch that consolidated all
the work related to absorbing dep prune into dep ensure. As of this
commit, dep prune is now a hidden dummy command, and dep ensure does all
the heavy lifting automatically.
Assorted edits and wording tweaks, as well as including bash as type on
most of the fenced code blocks. Also relocated assets into docs/assets
from docs/img in order to accommodate docusaurus' expected layout.
* Removing warning when the constraint hint is empty. It's a common case
and the lock may still be imported.
* Fix warning to say lock instead of constraint when the lock hint
cannot be resolved.
The tests don't fail because it's a trailing whitespace difference
but I'm fixing so that it doesn't show up as modified for the next
person to update all the golden files
This allows people to run go test ./... -update, without this
in order to do a mass update of golden files you need to run the
update against individual packages which is a huge pain.
A convenience, as callers often need both the RootPackageTree and the
direct dependencies map. Though this does further suggest that we ought
to be able to stitch this up neatly in gps, at some point.
Also, handle an error that was previously dropped.
Specifically, we need to switch map[string]bool for
map[gps.ProjectRoot]bool. Trivial refactor, but it's preferable to do
this anyway as this is a situation where gps.ProjectRoot should be used
to denote that strings in this map are assumed to be project roots. Case
in point, one of the importers was making the assumption that it had
packages, not root paths, but it wasn't obvious without the type
hinting.
This method is a a complete and correct implementation for retrieving
the list of direct dependency names. It should be able to be used by all
dep commands, if needed.