Why a package is in a project
In AEL, the Agent Engineering Language, ael pack why (command names may change before launch) will explain why a package is part of a project: which package you declared brings it in, and through which others.
Status
Planned for AEL Beta 0.0.1. AEL is not available yet.
Package names on this page are preview naming and may change before launch.
Usage
ael pack why math/array
ael pack why math/array --json
| Argument or option | Meaning |
|---|---|
<name> | The package to explain. |
--json | The explanation in machine-readable form. |
What it shows
- The chain. The dependency path from a package that your
pack.aeldeclares to the package you asked about, one link at a time. When there is more than one path, it will show the shortest. - Whether the chain applies to your target. A dependency may be limited to some targets. Such a link will stay recorded in the lock file, but it will not be part of a build for another target, and the answer will say so.
- The features that bring it in, when a package is needed only because a feature was requested.
A package that you declare yourself will be its own answer: the chain will have one link.
What it reads
ael pack why will read the dependency graph that pack.lock records. It will change nothing, use no network, and run no package code. The answer will be about dependencies: that a package is part of the project. It will not say that your code calls it.
To see whether your code actually uses a package, and what uses it, use ael refmap. A package may be installed because another package depends on it and still be unused by your program; the reference map will show it as unused, and the build will leave it out.
When the answer surprises you
- To stop depending on a package brought in by another, remove or change the package that brings it in, with
ael pack removeorael pack update. - To see every package and link at once, use
ael pack graph. - To see how the answer changed between two versions of the lock file, use
ael pack lock-diff.
Related
- Listing packages: which packages are declared, installed and used.
- Using packages: scopes and the lock file.