Documentation
¶
Index ¶
- func AttachPackageLockPositions(g *model.Graph, projectDir string)
- func AttachPackageLockPositionsForName(g *model.Graph, projectDir, lockfileName string)
- type Detector
- func (d Detector) Applicable(ctx context.Context, req plugin.DetectionRequest) (bool, error)
- func (d Detector) Descriptor() plugin.DetectorDescriptor
- func (d Detector) Install(ctx context.Context, req plugin.DetectionRequest) error
- func (d Detector) PackageManagerSupport() []plugin.PackageManagerSupport
- func (d Detector) Ready(ctx context.Context, req plugin.DetectionRequest) error
- func (d Detector) RemediationHints(ctx context.Context, request plugin.RemediationHintRequest) (plugin.RemediationHintResponse, error)
- func (d Detector) ResolveGraph(ctx context.Context, req plugin.DetectionRequest) (plugin.DetectionResult, error)
- type LockfileDetector
- func (d LockfileDetector) Applicable(ctx context.Context, req plugin.DetectionRequest) (bool, error)
- func (d LockfileDetector) Descriptor() plugin.DetectorDescriptor
- func (d LockfileDetector) PackageManagerSupport() []plugin.PackageManagerSupport
- func (d LockfileDetector) Ready(context.Context, plugin.DetectionRequest) error
- func (d LockfileDetector) RemediationHints(_ context.Context, request plugin.RemediationHintRequest) (plugin.RemediationHintResponse, error)
- func (d LockfileDetector) ResolveGraph(_ context.Context, req plugin.DetectionRequest) (plugin.DetectionResult, error)
- type NativeDetector
- func (d NativeDetector) Applicable(ctx context.Context, req plugin.DetectionRequest) (bool, error)
- func (d NativeDetector) Descriptor() plugin.DetectorDescriptor
- func (d NativeDetector) Install(ctx context.Context, req plugin.DetectionRequest) error
- func (d NativeDetector) PackageManagerSupport() []plugin.PackageManagerSupport
- func (d NativeDetector) Ready(context.Context, plugin.DetectionRequest) error
- func (d NativeDetector) RemediationHints(_ context.Context, request plugin.RemediationHintRequest) (plugin.RemediationHintResponse, error)
- func (d NativeDetector) ResolveGraph(_ context.Context, req plugin.DetectionRequest) (plugin.DetectionResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AttachPackageLockPositions ¶
AttachPackageLockPositions populates Position on graph packages for every package whose name matches a node_modules/... key in package-lock.json.
func AttachPackageLockPositionsForName ¶ added in v0.19.0
AttachPackageLockPositionsForName populates positions from the selected npm lockfile.
Types ¶
type Detector ¶ added in v0.22.0
type Detector struct {
Logger *zap.Logger
WorkingDir string
Config node.StrategyConfig
}
Detector is the merged npm detector. It owns an internal ordered strategy (lockfile parse first, npm CLI resolution as fallback) that used to be two separately registered detectors chained through Fallback fields.
func (Detector) Applicable ¶ added in v0.22.0
Applicable reports whether any configured strategy applies to the request.
func (Detector) Descriptor ¶ added in v0.22.0
func (d Detector) Descriptor() plugin.DetectorDescriptor
Descriptor describes the merged npm detector.
func (Detector) Install ¶ added in v0.22.0
Install prepares npm dependencies before graph resolution, unless the detector's configuration opted out of install-first execution.
func (Detector) PackageManagerSupport ¶ added in v0.22.0
func (d Detector) PackageManagerSupport() []plugin.PackageManagerSupport
PackageManagerSupport returns npm package-manager discovery metadata for every internal strategy: lockfile evidence plus the manifest the CLI strategy can resolve from.
func (Detector) RemediationHints ¶ added in v0.22.0
func (d Detector) RemediationHints(ctx context.Context, request plugin.RemediationHintRequest) (plugin.RemediationHintResponse, error)
RemediationHints provides npm-specific remediation guidance.
func (Detector) ResolveGraph ¶ added in v0.22.0
func (d Detector) ResolveGraph(ctx context.Context, req plugin.DetectionRequest) (plugin.DetectionResult, error)
ResolveGraph runs the configured strategies in order and returns the first successful graph.
type LockfileDetector ¶
LockfileDetector resolves dependency graphs with npm.
func (LockfileDetector) Applicable ¶
func (d LockfileDetector) Applicable(ctx context.Context, req plugin.DetectionRequest) (bool, error)
Applicable reports whether an npm lockfile is present.
func (LockfileDetector) Descriptor ¶
func (d LockfileDetector) Descriptor() plugin.DetectorDescriptor
Descriptor describes the npm detector.
func (LockfileDetector) PackageManagerSupport ¶
func (d LockfileDetector) PackageManagerSupport() []plugin.PackageManagerSupport
PackageManagerSupport returns npm package-manager discovery metadata.
func (LockfileDetector) Ready ¶
func (d LockfileDetector) Ready(context.Context, plugin.DetectionRequest) error
Ready reports whether npm is available.
func (LockfileDetector) RemediationHints ¶ added in v0.20.1
func (d LockfileDetector) RemediationHints(_ context.Context, request plugin.RemediationHintRequest) (plugin.RemediationHintResponse, error)
RemediationHints provides npm-specific remediation guidance.
func (LockfileDetector) ResolveGraph ¶
func (d LockfileDetector) ResolveGraph(_ context.Context, req plugin.DetectionRequest) (plugin.DetectionResult, error)
ResolveGraph resolves an npm dependency graph from package-lock.json. A workspace lockfile yields one manifest entry per workspace member (the member's package.json plus its reachable dependency subtree) alongside the root entry.
type NativeDetector ¶
NativeDetector resolves dependency graphs with npm CLI commands.
func (NativeDetector) Applicable ¶
func (d NativeDetector) Applicable(ctx context.Context, req plugin.DetectionRequest) (bool, error)
Applicable reports whether npm manifests are present.
func (NativeDetector) Descriptor ¶
func (d NativeDetector) Descriptor() plugin.DetectorDescriptor
Descriptor describes the npm CLI fallback detector.
func (NativeDetector) Install ¶
func (d NativeDetector) Install(ctx context.Context, req plugin.DetectionRequest) error
Install prepares npm dependencies before graph resolution.
func (NativeDetector) PackageManagerSupport ¶
func (d NativeDetector) PackageManagerSupport() []plugin.PackageManagerSupport
PackageManagerSupport returns discovery metadata for the internal npm CLI fallback detector.
func (NativeDetector) Ready ¶
func (d NativeDetector) Ready(context.Context, plugin.DetectionRequest) error
Ready reports whether npm is available.
func (NativeDetector) RemediationHints ¶ added in v0.20.1
func (d NativeDetector) RemediationHints(_ context.Context, request plugin.RemediationHintRequest) (plugin.RemediationHintResponse, error)
RemediationHints provides npm-specific remediation guidance.
func (NativeDetector) ResolveGraph ¶
func (d NativeDetector) ResolveGraph(_ context.Context, req plugin.DetectionRequest) (plugin.DetectionResult, error)
ResolveGraph resolves an npm dependency graph via npm ls.