Documentation
¶
Overview ¶
Package modfind is the centralized Go module discovery primitive for tinywasm tooling. It runs `go list -m -json all` once per project root, caches the parsed result, and classifies each module as writable (main module or local replace — tooling may generate files there) or read-only (module cache).
It replaces the byte-identical `go list -m -json all` loops previously copy-pasted in ssr, image/min and imagemin. Sibling to depfind: depfind maps the package import graph; modfind enumerates modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Finder ¶ added in v0.0.2
type Finder struct {
// contains filtered or unexported fields
}
Finder runs `go list -m -json all` once per rootDir and caches the result.
func (*Finder) Dirs ¶ added in v0.0.2
Dirs returns just the Dir of every discovered module — the []string shape ssr/image/imagemin previously produced. Order matches Discover.
func (*Finder) Discover ¶ added in v0.0.2
Discover returns all modules visible from rootDir (cached after first call). Modules with no on-disk Dir are skipped.
func (*Finder) Refresh ¶ added in v0.0.2
Refresh invalidates the cache for rootDir (call after a go.mod change).
type Module ¶ added in v0.0.2
type Module struct {
Path string // import path, e.g. "github.com/veltylabs/item-catalog"
Dir string // absolute on-disk dir (cache path or local replace path)
Version string // empty for Main and for local replace targets
IsMain bool // the root module of the project at rootDir
IsReplace bool // satisfied by a local (filesystem) replace directive
Indirect bool // transitive dependency (not a direct require)
}
Module is one Go module on disk, classified for tooling.