Why a package is in a project
In AEL, the Agent Engineering Language, ael pack why explains why a package is part of a project: which package you declared brings it in, and through which others.
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 shows the shortest. - Whether the chain applies to your target. A dependency may be limited to some targets. Such a link stays recorded in the lock file, but it is not part of a build for another target, and the answer says so.
- The features that bring it in, when a package is needed only because a feature was requested.
A package that you declare yourself is its own answer: the chain has one link.
What it reads
ael pack why reads the dependency graph that pack.lock records. It changes nothing, uses no network, and runs no package code. The answer is about dependencies: that a package is part of the project. It does 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 shows it as unused, and the build leaves 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.