core/resolver
Classes
ResolverError
Defined in: venpm/src/core/resolver.ts:12
Extends
Error
Constructors
Constructor
new ResolverError(message): ResolverError;Defined in: venpm/src/core/resolver.ts:13
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
Overrides
Error.constructorProperties
cause?
optional cause?: unknown;Defined in: venpm-docs/node_modules/typescript/lib/lib.es2022.error.d.ts:24
Inherited from
Error.causemessage
message: string;Defined in: venpm-docs/node_modules/typescript/lib/lib.es5.d.ts:1075
Inherited from
Error.messagename
name: string;Defined in: venpm-docs/node_modules/typescript/lib/lib.es5.d.ts:1074
Inherited from
Error.namestack?
optional stack?: string;Defined in: venpm-docs/node_modules/typescript/lib/lib.es5.d.ts:1076
Inherited from
Error.stackstackTraceLimit
static stackTraceLimit: number;Defined in: venpm/node_modules/@types/node/globals.d.ts:68
The Error.stackTraceLimit property specifies the number of stack frames collected by a stack trace (whether generated by new Error().stack or Error.captureStackTrace(obj)).
The default value is 10 but may be set to any valid JavaScript number. Changes will affect any stack trace captured after the value has been changed.
If set to a non-number value, or set to a negative number, stack traces will not capture any frames.
Inherited from
Error.stackTraceLimitMethods
captureStackTrace()
static captureStackTrace(targetObject, constructorOpt?): void;Defined in: venpm/node_modules/@types/node/globals.d.ts:52
Creates a .stack property on targetObject, which when accessed returns a string representing the location in the code at which Error.captureStackTrace() was called.
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack; // Similar to `new Error().stack`The first line of the trace will be prefixed with ${myObject.name}: ${myObject.message}.
The optional constructorOpt argument accepts a function. If given, all frames above constructorOpt, including constructorOpt, will be omitted from the generated stack trace.
The constructorOpt argument is useful for hiding implementation details of error generation from the user. For instance:
function a() {
b();
}
function b() {
c();
}
function c() {
// Create an error without stack trace to avoid calculating the stack trace twice.
const { stackTraceLimit } = Error;
Error.stackTraceLimit = 0;
const error = new Error();
Error.stackTraceLimit = stackTraceLimit;
// Capture the stack trace above function b
Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
throw error;
}
a();Parameters
| Parameter | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
void
Inherited from
Error.captureStackTraceprepareStackTrace()
static prepareStackTrace(err, stackTraces): any;Defined in: venpm/node_modules/@types/node/globals.d.ts:56
Parameters
| Parameter | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
any
See
https://v8.dev/docs/stack-trace-api#customizing-stack-traces
Inherited from
Error.prepareStackTraceInterfaces
ResolveOptions
Defined in: venpm/src/core/resolver.ts:21
Properties
forceMethod?
optional forceMethod?: FetchMethod;Defined in: venpm/src/core/resolver.ts:23
fromRepo?
optional fromRepo?: string;Defined in: venpm/src/core/resolver.ts:25
gitAvailable
gitAvailable: boolean;Defined in: venpm/src/core/resolver.ts:22
version?
optional version?: string;Defined in: venpm/src/core/resolver.ts:24
Functions
buildDependencyGraph()
function buildDependencyGraph(indexes, pluginName): string[];Defined in: venpm/src/core/resolver.ts:79
Build a topologically-sorted install order for pluginName and all its transitive dependencies. Circular dependencies are detected and will throw a ResolverError. Missing dependencies also throw.
Returns an array of plugin names in dependency-first order (deps before dependents).
Parameters
| Parameter | Type |
|---|---|
indexes | PluginIndex[] |
pluginName | string |
Returns
string[]
collectMissingOptionalDeps()
function collectMissingOptionalDeps(
indexes,
pluginName,
lockfile): string[];Defined in: venpm/src/core/resolver.ts:158
Collect optional dependencies that are not currently installed. These are surfaced as warnings, not auto-installed.
Parameters
| Parameter | Type |
|---|---|
indexes | PluginIndex[] |
pluginName | string |
lockfile | LockfileData |
Returns
string[]
findPlugin()
function findPlugin(
indexes,
name,
fromRepo?):
| {
entry: PluginEntry;
repoName: string;
}
| null;Defined in: venpm/src/core/resolver.ts:34
Find a plugin by name across all indexes, optionally filtered by repo name. Returns the first match found. If fromRepo is given, only that repo is searched.
Parameters
| Parameter | Type |
|---|---|
indexes | PluginIndex[] |
name | string |
fromRepo? | string |
Returns
| { entry: PluginEntry; repoName: string; } | null
generateInstallPlan()
function generateInstallPlan(
indexes,
pluginName,
lockfile,
options): InstallPlan;Defined in: venpm/src/core/resolver.ts:175
Generate a full install plan for pluginName, resolving dependencies and skipping already-installed plugins. Returns an InstallPlan with entries in dependency-first order, plus any missing optional deps as warnings.
Parameters
| Parameter | Type |
|---|---|
indexes | PluginIndex[] |
pluginName | string |
lockfile | LockfileData |
options | ResolveOptions |
Returns
resolveVersion()
function resolveVersion(entry, constraint?): string;Defined in: venpm/src/core/resolver.ts:57
Resolve a version string for a plugin entry.
- No constraint → return the entry's latest
versionfield. - Constraint provided → look up in the entry's
versionsmap and return it. - Version not found → throw ResolverError.
Parameters
| Parameter | Type |
|---|---|
entry | PluginEntry |
constraint? | string |
Returns
string
selectMethodFromSource()
function selectMethodFromSource(source, gitAvailable): FetchMethod;Defined in: venpm/src/core/resolver.ts:113
Parameters
| Parameter | Type |
|---|---|
source | PluginSource |
gitAvailable | boolean |