deps

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 20 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package deps extracts direct dependencies from Go and npm manifests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGo

func NewGo() plugin.Plugin

func NewNpm

func NewNpm() plugin.Plugin

Types

type GoPlugin

type GoPlugin struct{}

func (GoPlugin) Name

func (GoPlugin) Name() string

func (GoPlugin) Run

func (GoPlugin) Run(r *repo.Repo) plugin.Result

Run reports every requirement of every go.mod. A requirement marked // indirect is a transitive dependency: direct false, roots the module folder. Since Go 1.17 a module's go.mod lists every module its build needs, so go.mod is the lockfile; go.sum adds hashes, not packages. No via: go.mod does not record which module requires which. The key carries the module directory, so two modules in one repo can pin different versions without clashing, and the unit links the dependency to the service built from that directory.

A requirement is internal when a replace directive points it to a folder of the repo with a go.mod, or a go.work uses both modules.

Scope comes from the import lines of the module's own Go files: imported from a non-test file = prod, only from _test.go = test, imported nowhere = unknown (a tool, a build tag, a leftover).

func (GoPlugin) Version

func (GoPlugin) Version() string

func (GoPlugin) Watches

func (GoPlugin) Watches(p string) bool

type NpmPlugin

type NpmPlugin struct{}

func (NpmPlugin) Name

func (NpmPlugin) Name() string

func (NpmPlugin) Run

func (NpmPlugin) Run(r *repo.Repo) plugin.Result

Run reports the direct dependencies of every package.json. The version is the exact one from the nearest package-lock.json when it has the package, else the declared range as written (a URL in either loses its credentials); the licence is the lockfile's, when it records one.

Transitive dependencies come from package-lock.json (lockfile version 2 or 3, the packages section): one fact per installed location that a manifest reaches only through another package, resolved the way npm resolves node_modules. Without a lockfile, direct dependencies only.

A dependency is internal when it names a member of the workspace its manifest belongs to, or its spec is workspace:, file: or link: pointing to a tracked package.json. It then carries internal {name, path, spec} and is never a third-party package.

func (NpmPlugin) Version

func (NpmPlugin) Version() string

func (NpmPlugin) Watches

func (NpmPlugin) Watches(p string) bool

type NugetPlugin

type NugetPlugin struct{}

func (NugetPlugin) Name

func (NugetPlugin) Name() string

func (NugetPlugin) Run

func (NugetPlugin) Run(r *repo.Repo) plugin.Result

Run reports the direct dependencies of every .NET project file: PackageReference items with their versions resolved by the msbuild reader, ProjectReference items to other projects of the repo as internal dependencies, and, for a non-SDK-style project only, the entries of its sibling packages.config (which lists transitive packages too, so every entry is direct).

The key carries the lower-cased NuGet id, since ids are case-insensitive; name keeps the spelling as written. A package listed twice in one project (for example per target framework) is reported once, from its first line. A project reference that leaves the repo, or names a project the repo does not contain, gives no fact.

func (NugetPlugin) Version

func (NugetPlugin) Version() string

func (NugetPlugin) Watches

func (NugetPlugin) Watches(p string) bool

type PythonPlugin

type PythonPlugin struct{}

PythonPlugin reads Python dependencies: pyproject.toml (PEP 621 [project], [dependency-groups], Poetry tables) and requirements*.txt (PEP 508 lines, -r includes), with the exact version from a lockfile in the same folder or above (uv.lock, poetry.lock, Pipfile.lock). Transitive dependencies come from the same lockfile: uv.lock and poetry.lock record which package requires which; Pipfile.lock does not, so its other packages are transitive with no via. Nothing is installed or run; setup.py is code and is not read.

func (PythonPlugin) Name

func (PythonPlugin) Name() string

func (PythonPlugin) Run

func (PythonPlugin) Version

func (PythonPlugin) Version() string

func (PythonPlugin) Watches

func (PythonPlugin) Watches(p string) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL