Skip to content

dependabit / plugins/registry/src / Plugin

Interface: Plugin

Defined in: packages/plugins/registry/src/registry.ts:70

Contract that all dependabit plugins must satisfy.

Remarks

Plugins are loaded and validated by PluginLoader before being registered. The optional lifecycle hooks initialize and destroy are called by PluginLoader.load and PluginRegistry.unregister respectively.

Use When

Implementing a custom access method (e.g., a proprietary package registry, an internal documentation API, or a new public API).

Pitfalls

  • Do NOT perform network calls or resource allocation in the constructor — use initialize instead so that errors are surfaced at load time, not at registration.
  • destroy must be idempotent; PluginRegistry.clear may call it even if initialize was never called.

Properties

PropertyTypeDefined in
metadata{ accessMethod: string; apiVersion?: string; description?: string; name: string; supportedTypes?: string[]; version: string; }packages/plugins/registry/src/registry.ts:71
metadata.accessMethodstringpackages/plugins/registry/src/registry.ts:41
metadata.apiVersion?stringpackages/plugins/registry/src/registry.ts:43
metadata.description?stringpackages/plugins/registry/src/registry.ts:40
metadata.namestringpackages/plugins/registry/src/registry.ts:38
metadata.supportedTypes?string[]packages/plugins/registry/src/registry.ts:42
metadata.versionstringpackages/plugins/registry/src/registry.ts:39

Methods

check()

ts
check(url): Promise<PluginCheckResult>;

Defined in: packages/plugins/registry/src/registry.ts:76

Fetch the current state of the resource at url and return a snapshot.

Parameters

ParameterTypeDescription
urlstringThe dependency URL to check.

Returns

Promise<PluginCheckResult>


destroy()?

ts
optional destroy(): Promise<void>;

Defined in: packages/plugins/registry/src/registry.ts:80

Optional async teardown called when the plugin is removed from the registry.

Returns

Promise<void>


initialize()?

ts
optional initialize(): Promise<void>;

Defined in: packages/plugins/registry/src/registry.ts:78

Optional async setup called by PluginLoader after validation.

Returns

Promise<void>

Released under the MIT License.